sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name_view) function_name_view (parameters (identifier_self) identifier_self (default_parameter (identifier_channel_names) identifier_channel_names (string_'auto') string_'auto' )default_parameter (default_parameter (identifier_gates) identifier_gates (None) None )default_parameter (default_parameter (identifier_diag_kw) identifier_diag_kw (dictionary )dictionary )default_parameter (default_parameter (identifier_offdiag_kw) identifier_offdiag_kw (dictionary )dictionary )default_parameter (default_parameter (identifier_gate_colors) identifier_gate_colors (None) None )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (identifier_channel_names) identifier_channel_names (string_'auto') string_'auto' )comparison_operator (block (expression_statement (assignment (identifier_channel_names) identifier_channel_names (call (identifier_list) identifier_list (argument_list (attribute (identifier_self) identifier_self (identifier_channel_names) identifier_channel_names )attribute )argument_list )call )assignment )expression_statement )block )if_statement (function_definition (function_name_plot_region) function_name_plot_region (parameters (identifier_channels) identifier_channels (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (subscript (identifier_channels) identifier_channels (integer_0) integer_0 )subscript (subscript (identifier_channels) identifier_channels (integer_1) integer_1 )subscript )comparison_operator (block (expression_statement (assignment (identifier_channels) identifier_channels (subscript (identifier_channels) identifier_channels (integer_0) integer_0 )subscript )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_kind) identifier_kind (string_'histogram') string_'histogram' )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_plot) identifier_plot )attribute (argument_list (identifier_channels) identifier_channels (keyword_argument (identifier_kind) identifier_kind (identifier_kind) identifier_kind )keyword_argument (keyword_argument (identifier_gates) identifier_gates (identifier_gates) identifier_gates )keyword_argument (keyword_argument (identifier_gate_colors) identifier_gate_colors (identifier_gate_colors) identifier_gate_colors )keyword_argument (keyword_argument (identifier_autolabel) identifier_autolabel (False) False )keyword_argument )argument_list )call )expression_statement )block )function_definition (expression_statement (assignment (identifier_channel_list) identifier_channel_list (call (attribute (identifier_np) identifier_np (identifier_array) identifier_array )attribute (argument_list (call (identifier_list) identifier_list (argument_list (identifier_channel_names) identifier_channel_names )argument_list )call (keyword_argument (identifier_dtype) identifier_dtype (identifier_object) identifier_object )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_channel_mat) identifier_channel_mat (list_comprehension (list_comprehension (tuple (identifier_x) identifier_x (identifier_y) identifier_y )tuple (for_in_clause (identifier_x) identifier_x (identifier_channel_list) identifier_channel_list )for_in_clause )list_comprehension (for_in_clause (identifier_y) identifier_y (identifier_channel_list) identifier_channel_list )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_channel_mat) identifier_channel_mat (call (identifier_DataFrame) identifier_DataFrame (argument_list (identifier_channel_mat) identifier_channel_mat (keyword_argument (identifier_columns) identifier_columns (identifier_channel_list) identifier_channel_list )keyword_argument (keyword_argument (identifier_index) identifier_index (identifier_channel_list) identifier_channel_list )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_kwargs) identifier_kwargs (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'wspace') string_'wspace' (float_0.1) float_0.1 )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_kwargs) identifier_kwargs (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'hspace') string_'hspace' (float_0.1) float_0.1 )argument_list )call )expression_statement (return_statement (call (identifier_plot_ndpanel) identifier_plot_ndpanel (argument_list (identifier_channel_mat) identifier_channel_mat (identifier_plot_region) identifier_plot_region (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Generates a matrix of subplots allowing for a quick way to examine how the sample looks in different channels. Parameters ---------- channel_names : [list | 'auto'] List of channel names to plot. offdiag_plot : ['histogram' | 'scatter'] Specifies the type of plot for the off-diagonal elements. diag_kw : dict Not implemented Returns ------------ axes references
(module (function_definition (function_name_serialize_basic) function_name_serialize_basic (parameters (identifier_self) identifier_self (identifier_data) identifier_data (identifier_data_type) identifier_data_type (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_custom_serializer) identifier_custom_serializer (call (attribute (identifier_self) identifier_self (identifier__get_custom_serializers) identifier__get_custom_serializers )attribute (argument_list (identifier_data_type) identifier_data_type (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement (if_statement (identifier_custom_serializer) identifier_custom_serializer (block (return_statement (call (identifier_custom_serializer) identifier_custom_serializer (argument_list (identifier_data) identifier_data )argument_list )call )return_statement )block )if_statement (if_statement (comparison_operator (identifier_data_type) identifier_data_type (string_'str') string_'str' )comparison_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_serialize_unicode) identifier_serialize_unicode )attribute (argument_list (identifier_data) identifier_data )argument_list )call )return_statement )block )if_statement (return_statement (call (call (identifier_eval) identifier_eval (argument_list (identifier_data_type) identifier_data_type )argument_list )call (argument_list (identifier_data) identifier_data )argument_list )call )return_statement )block )function_definition )module
Serialize basic builting data type. Serializes objects to str, int, float or bool. Possible kwargs: - is_xml bool : If set, adapt basic serializers without the need for basic_types_serializers - basic_types_serializers dict[str, callable] : If set, use the callable as serializer :param data: Object to be serialized. :param str data_type: Type of object in the iterable.
(module (function_definition (function_name_read_host_file) function_name_read_host_file (parameters (identifier_path) identifier_path )parameters (block (expression_statement (assignment (identifier_res) identifier_res (list )list )assignment )expression_statement (for_statement (identifier_l) identifier_l (call (attribute (call (identifier_file) identifier_file (argument_list (identifier_path) identifier_path )argument_list )call (identifier_xreadlines) identifier_xreadlines )attribute (argument_list )argument_list )call (block (expression_statement (assignment (identifier_hostname) identifier_hostname (call (attribute (identifier_l) identifier_l (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (identifier_hostname) identifier_hostname (block (expression_statement (call (attribute (identifier_res) identifier_res (identifier_append) identifier_append )attribute (argument_list (identifier_hostname) identifier_hostname )argument_list )call )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_res) identifier_res )return_statement )block )function_definition )module
Read the host file. Return a list of hostnames.
(module (function_definition (function_name_download) function_name_download (parameters (identifier_self) identifier_self (default_parameter (identifier_replace) identifier_replace (False) False )default_parameter )parameters (block (expression_statement (call (identifier_download_data) identifier_download_data (argument_list (attribute (identifier_self) identifier_self (identifier_url) identifier_url )attribute (attribute (identifier_self) identifier_self (identifier_signature) identifier_signature )attribute (keyword_argument (identifier_data_home) identifier_data_home (attribute (identifier_self) identifier_self (identifier_data_home) identifier_data_home )attribute )keyword_argument (keyword_argument (identifier_replace) identifier_replace (identifier_replace) identifier_replace )keyword_argument (keyword_argument (identifier_extract) identifier_extract (True) True )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
Download the dataset from the hosted Yellowbrick data store and save it to the location specified by ``get_data_home``. The downloader verifies the download completed successfully and safely by comparing the expected signature with the SHA 256 signature of the downloaded archive file. Parameters ---------- replace : bool, default: False If the data archive already exists, replace the dataset. If this is False and the dataset exists, an exception is raised.
(module (function_definition (function_name_delete_from_environment) function_name_delete_from_environment (parameters (identifier_self) identifier_self (identifier_environment) identifier_environment (default_parameter (identifier_synchronous) identifier_synchronous (True) True )default_parameter )parameters (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_environment) identifier_environment (identifier_Environment) identifier_Environment )argument_list )call (block (expression_statement (assignment (identifier_environment_id) identifier_environment_id (attribute (identifier_environment) identifier_environment (identifier_id) identifier_id )attribute )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_environment_id) identifier_environment_id (identifier_environment) identifier_environment )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_response) identifier_response (call (attribute (identifier_client) identifier_client (identifier_delete) identifier_delete )attribute (argument_list (call (attribute (string_'{0}/environments/{1}') string_'{0}/environments/{1}' (identifier_format) identifier_format )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier_path) identifier_path )attribute (argument_list )argument_list )call (identifier_environment_id) identifier_environment_id )argument_list )call (dictionary_splat (call (attribute (attribute (identifier_self) identifier_self (identifier__server_config) identifier__server_config )attribute (identifier_get_client_kwargs) identifier_get_client_kwargs )attribute (argument_list )argument_list )call )dictionary_splat )argument_list )call )assignment )expression_statement (return_statement (call (identifier__handle_response) identifier__handle_response (argument_list (identifier_response) identifier_response (attribute (identifier_self) identifier_self (identifier__server_config) identifier__server_config )attribute (identifier_synchronous) identifier_synchronous )argument_list )call )return_statement )block )function_definition )module
Delete this content view version from an environment. This method acts much like :meth:`nailgun.entity_mixins.EntityDeleteMixin.delete`. The documentation on that method describes how the deletion procedure works in general. This method differs only in accepting an ``environment`` parameter. :param environment: A :class:`nailgun.entities.Environment` object. The environment's ``id`` parameter *must* be specified. As a convenience, an environment ID may be passed in instead of an ``Environment`` object.
(module (function_definition (function_name_add_dependency) function_name_add_dependency (parameters (identifier_self) identifier_self (identifier_from_task_name) identifier_from_task_name (identifier_to_task_name) identifier_to_task_name )parameters (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (call (attribute (string_'Adding dependency from {0} to {1}') string_'Adding dependency from {0} to {1}' (identifier_format) identifier_format )attribute (argument_list (identifier_from_task_name) identifier_from_task_name (identifier_to_task_name) identifier_to_task_name )argument_list )call )argument_list )call )expression_statement (if_statement (not_operator (attribute (attribute (identifier_self) identifier_self (identifier_state) identifier_state )attribute (identifier_allow_change_graph) identifier_allow_change_graph )attribute )not_operator (block (raise_statement (call (identifier_DagobahError) identifier_DagobahError (argument_list (binary_operator (string_"job's graph is immutable in its current state: %s") string_"job's graph is immutable in its current state: %s" (attribute (attribute (identifier_self) identifier_self (identifier_state) identifier_state )attribute (identifier_status) identifier_status )attribute )binary_operator )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_add_edge) identifier_add_edge )attribute (argument_list (identifier_from_task_name) identifier_from_task_name (identifier_to_task_name) identifier_to_task_name )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_commit) identifier_commit )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Add a dependency between two tasks.
(module (function_definition (function_name_register_for_app) function_name_register_for_app (parameters (identifier_self) identifier_self (default_parameter (identifier_app_label) identifier_app_label (None) None )default_parameter (default_parameter (identifier_exclude_models) identifier_exclude_models (None) None )default_parameter (default_parameter (identifier_exclude_model_classes) identifier_exclude_model_classes (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_models) identifier_models (list )list )assignment )expression_statement (expression_statement (assignment (identifier_exclude_models) identifier_exclude_models (boolean_operator (identifier_exclude_models) identifier_exclude_models (list )list )boolean_operator )assignment )expression_statement (expression_statement (assignment (identifier_app_config) identifier_app_config (call (attribute (identifier_django_apps) identifier_django_apps (identifier_get_app_config) identifier_get_app_config )attribute (argument_list (identifier_app_label) identifier_app_label )argument_list )call )assignment )expression_statement (for_statement (identifier_model) identifier_model (call (attribute (identifier_app_config) identifier_app_config (identifier_get_models) identifier_get_models )attribute (argument_list )argument_list )call (block (if_statement (comparison_operator (attribute (attribute (identifier_model) identifier_model (identifier__meta) identifier__meta )attribute (identifier_label_lower) identifier_label_lower )attribute (identifier_exclude_models) identifier_exclude_models )comparison_operator (block (pass_statement )pass_statement )block (elif_clause (boolean_operator (identifier_exclude_model_classes) identifier_exclude_model_classes (call (identifier_issubclass) identifier_issubclass (argument_list (identifier_model) identifier_model (identifier_exclude_model_classes) identifier_exclude_model_classes )argument_list )call )boolean_operator (block (pass_statement )pass_statement )block )elif_clause (else_clause (block (expression_statement (call (attribute (identifier_models) identifier_models (identifier_append) identifier_append )attribute (argument_list (attribute (attribute (identifier_model) identifier_model (identifier__meta) identifier__meta )attribute (identifier_label_lower) identifier_label_lower )attribute )argument_list )call )expression_statement )block )else_clause )if_statement )block )for_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_register) identifier_register )attribute (argument_list (identifier_models) identifier_models )argument_list )call )expression_statement )block )function_definition )module
Registers all models for this app_label.
(module (function_definition (function_name_make_urls_hyperlinks) function_name_make_urls_hyperlinks (parameters (typed_parameter (identifier_text) identifier_text (type (identifier_str) identifier_str )type )typed_parameter )parameters (type (identifier_str) identifier_str )type (block (expression_statement (assignment (identifier_find_url) identifier_find_url (identifier_r) identifier_r )assignment )expression_statement (expression_statement (assignment (identifier_replace_url) identifier_replace_url (string_r'<a href="\1">\1</a>') string_r'<a href="\1">\1</a>' )assignment )expression_statement (expression_statement (assignment (identifier_find_email) identifier_find_email (call (attribute (identifier_re) identifier_re (identifier_compile) identifier_compile )attribute (argument_list (string_r'([.\w\-]+@(\w[\w\-]+\.)+[\w\-]+)') string_r'([.\w\-]+@(\w[\w\-]+\.)+[\w\-]+)' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_replace_email) identifier_replace_email (string_r'<a href="mailto:\1">\1</a>') string_r'<a href="mailto:\1">\1</a>' )assignment )expression_statement (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_re) identifier_re (identifier_sub) identifier_sub )attribute (argument_list (identifier_find_url) identifier_find_url (identifier_replace_url) identifier_replace_url (identifier_text) identifier_text )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_re) identifier_re (identifier_sub) identifier_sub )attribute (argument_list (identifier_find_email) identifier_find_email (identifier_replace_email) identifier_replace_email (identifier_text) identifier_text )argument_list )call )assignment )expression_statement (return_statement (identifier_text) identifier_text )return_statement )block )function_definition )module
Adds hyperlinks to text that appears to contain URLs. See - http://stackoverflow.com/questions/1071191 - ... except that double-replaces everything; e.g. try with ``text = "me@somewhere.com me@somewhere.com"`` - http://stackp.online.fr/?p=19
(module (function_definition (function_name_generate_exports) function_name_generate_exports (parameters )parameters (block (expression_statement (assignment (identifier_env) identifier_env (list )list )assignment )expression_statement (for_statement (identifier_name) identifier_name (call (identifier_list_installed_genomes) identifier_list_installed_genomes (argument_list )argument_list )call (block (try_statement (block (expression_statement (assignment (identifier_g) identifier_g (call (identifier_Genome) identifier_Genome (argument_list (identifier_name) identifier_name )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_env_name) identifier_env_name (call (attribute (call (attribute (identifier_re) identifier_re (identifier_sub) identifier_sub )attribute (argument_list (string_r'[^\w]+') string_r'[^\w]+' (string_"_") string_"_" (identifier_name) identifier_name )argument_list )call (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_env) identifier_env (identifier_append) identifier_append )attribute (argument_list (call (attribute (string_"export {}={}") string_"export {}={}" (identifier_format) identifier_format )attribute (argument_list (identifier_env_name) identifier_env_name (attribute (identifier_g) identifier_g (identifier_filename) identifier_filename )attribute )argument_list )call )argument_list )call )expression_statement )block (except_clause (block (pass_statement )pass_statement )block )except_clause )try_statement )block )for_statement (return_statement (identifier_env) identifier_env )return_statement )block )function_definition )module
Print export commands for setting environment variables.
(module (function_definition (function_name_unstaged) function_name_unstaged (parameters )parameters (block (with_statement (with_clause (with_item (call (attribute (identifier_conf) identifier_conf (identifier_within_proj_dir) identifier_within_proj_dir )attribute (argument_list )argument_list )call )with_item )with_clause (block (expression_statement (assignment (identifier_status) identifier_status (attribute (call (attribute (identifier_shell) identifier_shell (identifier_run) identifier_run )attribute (argument_list (string_'git status --porcelain') string_'git status --porcelain' (keyword_argument (identifier_capture) identifier_capture (True) True )keyword_argument (keyword_argument (identifier_never_pretend) identifier_never_pretend (True) True )keyword_argument )argument_list )call (identifier_stdout) identifier_stdout )attribute )assignment )expression_statement (expression_statement (assignment (identifier_results) identifier_results (list )list )assignment )expression_statement (for_statement (identifier_file_status) identifier_file_status (call (attribute (identifier_status) identifier_status (identifier_split) identifier_split )attribute (argument_list (attribute (identifier_os) identifier_os (identifier_linesep) identifier_linesep )attribute )argument_list )call (block (if_statement (boolean_operator (call (attribute (identifier_file_status) identifier_file_status (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call (comparison_operator (subscript (identifier_file_status) identifier_file_status (integer_0) integer_0 )subscript (string_' ') string_' ' )comparison_operator )boolean_operator (block (expression_statement (call (attribute (identifier_results) identifier_results (identifier_append) identifier_append )attribute (argument_list (call (attribute (subscript (identifier_file_status) identifier_file_status (slice (integer_3) integer_3 (colon) colon )slice )subscript (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_results) identifier_results )return_statement )block )with_statement )block )function_definition )module
Return a list of unstaged files in the project repository. Returns: list[str]: The list of files not tracked by project git repo.
(module (function_definition (function_name__saveState) function_name__saveState (parameters (identifier_self) identifier_self (identifier_path) identifier_path )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_addSession) identifier_addSession )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__save) identifier__save )attribute (argument_list (call (identifier_str) identifier_str (argument_list (attribute (identifier_self) identifier_self (identifier_n_sessions) identifier_n_sessions )attribute )argument_list )call (identifier_path) identifier_path )argument_list )call )expression_statement )block )function_definition )module
save current state and add a new state
(module (function_definition (function_name_del_kwnkb) function_name_del_kwnkb (parameters (identifier_mapper) identifier_mapper (identifier_connection) identifier_connection (identifier_target) identifier_target )parameters (block (if_statement (parenthesized_expression (comparison_operator (attribute (identifier_target) identifier_target (identifier_kbtype) identifier_kbtype )attribute (subscript (attribute (identifier_KnwKB) identifier_KnwKB (identifier_KNWKB_TYPES) identifier_KNWKB_TYPES )attribute (string_'taxonomy') string_'taxonomy' )subscript )comparison_operator )parenthesized_expression (block (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isfile) identifier_isfile )attribute (argument_list (call (attribute (identifier_target) identifier_target (identifier_get_filename) identifier_get_filename )attribute (argument_list )argument_list )call )argument_list )call (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_remove) identifier_remove )attribute (argument_list (call (attribute (identifier_target) identifier_target (identifier_get_filename) identifier_get_filename )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block )if_statement )block )if_statement )block )function_definition )module
Remove taxonomy file.
(module (function_definition (function_name_worker_stop) function_name_worker_stop (parameters (identifier_obj) identifier_obj (identifier_worker_ids) identifier_worker_ids )parameters (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_worker_ids) identifier_worker_ids )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (assignment (identifier_msg) identifier_msg (string_'Would you like to stop all workers?') string_'Would you like to stop all workers?' )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (string_'\n{}\n\n{}') string_'\n{}\n\n{}' (identifier_format) identifier_format )attribute (argument_list (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (argument_list (identifier_worker_ids) identifier_worker_ids )argument_list )call (string_'Would you like to stop these workers?') string_'Would you like to stop these workers?' )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (if_statement (call (attribute (identifier_click) identifier_click (identifier_confirm) identifier_confirm )attribute (argument_list (identifier_msg) identifier_msg (keyword_argument (identifier_default) identifier_default (True) True )keyword_argument (keyword_argument (identifier_abort) identifier_abort (True) True )keyword_argument )argument_list )call (block (expression_statement (call (identifier_stop_worker) identifier_stop_worker (argument_list (subscript (identifier_obj) identifier_obj (string_'config') string_'config' )subscript (keyword_argument (identifier_worker_ids) identifier_worker_ids (conditional_expression (call (identifier_list) identifier_list (argument_list (identifier_worker_ids) identifier_worker_ids )argument_list )call (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_worker_ids) identifier_worker_ids )argument_list )call (integer_0) integer_0 )comparison_operator (None) None )conditional_expression )keyword_argument )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Stop running workers. \b WORKER_IDS: The IDs of the worker that should be stopped or none to stop them all.
(module (function_definition (function_name__iter_grouped) function_name__iter_grouped (parameters (identifier_self) identifier_self )parameters (block (for_statement (identifier_indices) identifier_indices (attribute (identifier_self) identifier_self (identifier__group_indices) identifier__group_indices )attribute (block (expression_statement (yield (call (attribute (attribute (identifier_self) identifier_self (identifier__obj) identifier__obj )attribute (identifier_isel) identifier_isel )attribute (argument_list (dictionary_splat (dictionary (pair (attribute (identifier_self) identifier_self (identifier__group_dim) identifier__group_dim )attribute (identifier_indices) identifier_indices )pair )dictionary )dictionary_splat )argument_list )call )yield )expression_statement )block )for_statement )block )function_definition )module
Iterate over each element in this group
(module (function_definition (function_name_compute_groups_matrix) function_name_compute_groups_matrix (parameters (identifier_groups) identifier_groups )parameters (block (if_statement (not_operator (identifier_groups) identifier_groups )not_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_num_vars) identifier_num_vars (call (identifier_len) identifier_len (argument_list (identifier_groups) identifier_groups )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_unique_group_names) identifier_unique_group_names (call (identifier_list) identifier_list (argument_list (call (attribute (identifier_OrderedDict) identifier_OrderedDict (identifier_fromkeys) identifier_fromkeys )attribute (argument_list (identifier_groups) identifier_groups )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_number_of_groups) identifier_number_of_groups (call (identifier_len) identifier_len (argument_list (identifier_unique_group_names) identifier_unique_group_names )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_indices) identifier_indices (call (identifier_dict) identifier_dict (argument_list (list_comprehension (tuple (identifier_x) identifier_x (identifier_i) identifier_i )tuple (for_in_clause (tuple_pattern (identifier_i) identifier_i (identifier_x) identifier_x )tuple_pattern (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_unique_group_names) identifier_unique_group_names )argument_list )call )for_in_clause )list_comprehension )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_output) identifier_output (call (attribute (identifier_np) identifier_np (identifier_zeros) identifier_zeros )attribute (argument_list (tuple (identifier_num_vars) identifier_num_vars (identifier_number_of_groups) identifier_number_of_groups )tuple (keyword_argument (identifier_dtype) identifier_dtype (attribute (identifier_np) identifier_np (identifier_int) identifier_int )attribute )keyword_argument )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_parameter_row) identifier_parameter_row (identifier_group_membership) identifier_group_membership )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_groups) identifier_groups )argument_list )call (block (expression_statement (assignment (identifier_group_index) identifier_group_index (subscript (identifier_indices) identifier_indices (identifier_group_membership) identifier_group_membership )subscript )assignment )expression_statement (expression_statement (assignment (subscript (identifier_output) identifier_output (identifier_parameter_row) identifier_parameter_row (identifier_group_index) identifier_group_index )subscript (integer_1) integer_1 )assignment )expression_statement )block )for_statement (return_statement (expression_list (identifier_output) identifier_output (identifier_unique_group_names) identifier_unique_group_names )expression_list )return_statement )block )function_definition )module
Generate matrix which notes factor membership of groups Computes a k-by-g matrix which notes factor membership of groups where: k is the number of variables (factors) g is the number of groups Also returns a g-length list of unique group_names whose positions correspond to the order of groups in the k-by-g matrix Arguments --------- groups : list Group names corresponding to each variable Returns ------- tuple containing group matrix assigning parameters to groups and a list of unique group names
(module (function_definition (function_name__calculate_expires) function_name__calculate_expires (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (attribute (attribute (identifier_self) identifier_self (identifier__backend_client) identifier__backend_client )attribute (identifier_expires) identifier_expires )attribute (None) None )assignment )expression_statement (expression_statement (assignment (identifier_now) identifier_now (call (attribute (identifier_datetime) identifier_datetime (identifier_utcnow) identifier_utcnow )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (attribute (identifier_self) identifier_self (identifier__backend_client) identifier__backend_client )attribute (identifier_expires) identifier_expires )attribute (binary_operator (identifier_now) identifier_now (call (identifier_timedelta) identifier_timedelta (argument_list (keyword_argument (identifier_seconds) identifier_seconds (attribute (attribute (identifier_self) identifier_self (identifier__config) identifier__config )attribute (identifier_timeout) identifier_timeout )attribute )keyword_argument )argument_list )call )binary_operator )assignment )expression_statement )block )function_definition )module
Calculates the session expiry using the timeout
(module (function_definition (function_name_getShocks) function_name_getShocks (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_employed) identifier_employed (comparison_operator (attribute (identifier_self) identifier_self (identifier_eStateNow) identifier_eStateNow )attribute (float_1.0) float_1.0 )comparison_operator )assignment )expression_statement (expression_statement (assignment (identifier_N) identifier_N (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_np) identifier_np (identifier_sum) identifier_sum )attribute (argument_list (identifier_employed) identifier_employed )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_newly_unemployed) identifier_newly_unemployed (call (identifier_drawBernoulli) identifier_drawBernoulli (argument_list (identifier_N) identifier_N (keyword_argument (identifier_p) identifier_p (attribute (identifier_self) identifier_self (identifier_UnempPrb) identifier_UnempPrb )attribute )keyword_argument (keyword_argument (identifier_seed) identifier_seed (call (attribute (attribute (identifier_self) identifier_self (identifier_RNG) identifier_RNG )attribute (identifier_randint) identifier_randint )attribute (argument_list (integer_0) integer_0 (binary_operator (binary_operator (integer_2) integer_2 (integer_31) integer_31 )binary_operator (integer_1) integer_1 )binary_operator )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier_eStateNow) identifier_eStateNow )attribute (identifier_employed) identifier_employed )subscript (binary_operator (float_1.0) float_1.0 (identifier_newly_unemployed) identifier_newly_unemployed )binary_operator )assignment )expression_statement )block )function_definition )module
Determine which agents switch from employment to unemployment. All unemployed agents remain unemployed until death. Parameters ---------- None Returns ------- None
(module (function_definition (function_name_remove_prefix) function_name_remove_prefix (parameters (identifier_self) identifier_self (identifier_prefix) identifier_prefix )parameters (block (if_statement (comparison_operator (identifier_prefix) identifier_prefix (attribute (identifier_self) identifier_self (identifier___prefix_map) identifier___prefix_map )attribute )comparison_operator (block (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_ni) identifier_ni (call (attribute (identifier_self) identifier_self (identifier___lookup_prefix) identifier___lookup_prefix )attribute (argument_list (identifier_prefix) identifier_prefix )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_ni) identifier_ni (identifier_prefixes) identifier_prefixes )attribute (identifier_discard) identifier_discard )attribute (argument_list (identifier_prefix) identifier_prefix )argument_list )call )expression_statement (delete_statement (subscript (attribute (identifier_self) identifier_self (identifier___prefix_map) identifier___prefix_map )attribute (identifier_prefix) identifier_prefix )subscript )delete_statement (if_statement (comparison_operator (attribute (identifier_ni) identifier_ni (identifier_preferred_prefix) identifier_preferred_prefix )attribute (identifier_prefix) identifier_prefix )comparison_operator (block (expression_statement (assignment (attribute (identifier_ni) identifier_ni (identifier_preferred_prefix) identifier_preferred_prefix )attribute (call (identifier_next) identifier_next (argument_list (call (identifier_iter) identifier_iter (argument_list (attribute (identifier_ni) identifier_ni (identifier_prefixes) identifier_prefixes )attribute )argument_list )call (None) None )argument_list )call )assignment )expression_statement )block )if_statement )block )function_definition )module
Removes prefix from this set. This is a no-op if the prefix doesn't exist in it.
(module (function_definition (function_name_create_alert_policy) function_name_create_alert_policy (parameters (identifier_self) identifier_self (identifier_policy_name) identifier_policy_name )parameters (block (expression_statement (assignment (identifier_policy_data) identifier_policy_data (dictionary (pair (string_'policy') string_'policy' (dictionary (pair (string_'incident_preference') string_'incident_preference' (string_'PER_POLICY') string_'PER_POLICY' )pair (pair (string_'name') string_'name' (identifier_policy_name) identifier_policy_name )pair )dictionary )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_create_policy) identifier_create_policy (call (attribute (identifier_requests) identifier_requests (identifier_post) identifier_post )attribute (argument_list (string_'https://api.newrelic.com/v2/alerts_policies.json') string_'https://api.newrelic.com/v2/alerts_policies.json' (keyword_argument (identifier_headers) identifier_headers (attribute (identifier_self) identifier_self (identifier_auth_header) identifier_auth_header )attribute )keyword_argument (keyword_argument (identifier_data) identifier_data (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (identifier_policy_data) identifier_policy_data )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_create_policy) identifier_create_policy (identifier_raise_for_status) identifier_raise_for_status )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_policy_id) identifier_policy_id (subscript (subscript (call (attribute (identifier_create_policy) identifier_create_policy (identifier_json) identifier_json )attribute (argument_list )argument_list )call (string_'policy') string_'policy' )subscript (string_'id') string_'id' )subscript )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_refresh_all_alerts) identifier_refresh_all_alerts )attribute (argument_list )argument_list )call )expression_statement (return_statement (identifier_policy_id) identifier_policy_id )return_statement )block )function_definition )module
Creates an alert policy in NewRelic
(module (function_definition (function_name_units_convertible) function_name_units_convertible (parameters (identifier_units1) identifier_units1 (identifier_units2) identifier_units2 (default_parameter (identifier_reftimeistime) identifier_reftimeistime (True) True )default_parameter )parameters (block (try_statement (block (expression_statement (assignment (identifier_u1) identifier_u1 (call (identifier_Unit) identifier_Unit (argument_list (identifier_units1) identifier_units1 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_u2) identifier_u2 (call (identifier_Unit) identifier_Unit (argument_list (identifier_units2) identifier_units2 )argument_list )call )assignment )expression_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (return_statement (False) False )return_statement )block )except_clause )try_statement (return_statement (call (attribute (identifier_u1) identifier_u1 (identifier_is_convertible) identifier_is_convertible )attribute (argument_list (identifier_u2) identifier_u2 )argument_list )call )return_statement )block )function_definition )module
Return True if a Unit representing the string units1 can be converted to a Unit representing the string units2, else False. :param str units1: A string representing the units :param str units2: A string representing the units
(module (function_definition (function_name_rows) function_name_rows (parameters (identifier_self) identifier_self (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (type (generic_type (identifier_List) identifier_List (type_parameter (type (generic_type (identifier_List) identifier_List (type_parameter (type (identifier_Well) identifier_Well )type )type_parameter )generic_type )type )type_parameter )generic_type )type (block (expression_statement (assignment (identifier_row_dict) identifier_row_dict (call (attribute (identifier_self) identifier_self (identifier__create_indexed_dictionary) identifier__create_indexed_dictionary )attribute (argument_list (keyword_argument (identifier_group) identifier_group (integer_1) integer_1 )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_keys) identifier_keys (call (identifier_sorted) identifier_sorted (argument_list (identifier_row_dict) identifier_row_dict )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_args) identifier_args )not_operator (block (expression_statement (assignment (identifier_res) identifier_res (list_comprehension (subscript (identifier_row_dict) identifier_row_dict (identifier_key) identifier_key )subscript (for_in_clause (identifier_key) identifier_key (identifier_keys) identifier_keys )for_in_clause )list_comprehension )assignment )expression_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (subscript (identifier_args) identifier_args (integer_0) integer_0 )subscript (identifier_int) identifier_int )argument_list )call (block (expression_statement (assignment (identifier_res) identifier_res (list_comprehension (subscript (identifier_row_dict) identifier_row_dict (subscript (identifier_keys) identifier_keys (identifier_idx) identifier_idx )subscript )subscript (for_in_clause (identifier_idx) identifier_idx (identifier_args) identifier_args )for_in_clause )list_comprehension )assignment )expression_statement )block )elif_clause (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (subscript (identifier_args) identifier_args (integer_0) integer_0 )subscript (identifier_str) identifier_str )argument_list )call (block (expression_statement (assignment (identifier_res) identifier_res (list_comprehension (subscript (identifier_row_dict) identifier_row_dict (identifier_idx) identifier_idx )subscript (for_in_clause (identifier_idx) identifier_idx (identifier_args) identifier_args )for_in_clause )list_comprehension )assignment )expression_statement )block )elif_clause (else_clause (block (raise_statement (identifier_TypeError) identifier_TypeError )raise_statement )block )else_clause )if_statement (return_statement (identifier_res) identifier_res )return_statement )block )function_definition )module
Accessor function used to navigate through a labware by row. With indexing one can treat it as a typical python nested list. To access row A for example, simply write: labware.rows()[0]. This will output ['A1', 'A2', 'A3', 'A4'...] Note that this method takes args for backward-compatibility, but use of args is deprecated and will be removed in future versions. Args can be either strings or integers, but must all be the same type (e.g.: `self.rows(1, 4, 8)` or `self.rows('A', 'B')`, but `self.rows('A', 4)` is invalid. :return: A list of row lists
(module (function_definition (function_name_ssh) function_name_ssh (parameters (identifier_ctx) identifier_ctx (identifier_cluster_id) identifier_cluster_id (identifier_key_file) identifier_key_file )parameters (block (expression_statement (assignment (identifier_session) identifier_session (call (identifier_create_session) identifier_create_session (argument_list (subscript (attribute (identifier_ctx) identifier_ctx (identifier_obj) identifier_obj )attribute (string_'AWS_PROFILE_NAME') string_'AWS_PROFILE_NAME' )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_client) identifier_client (call (attribute (identifier_session) identifier_session (identifier_client) identifier_client )attribute (argument_list (string_'emr') string_'emr' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_client) identifier_client (identifier_describe_cluster) identifier_describe_cluster )attribute (argument_list (keyword_argument (identifier_ClusterId) identifier_ClusterId (identifier_cluster_id) identifier_cluster_id )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_target_dns) identifier_target_dns (subscript (subscript (identifier_result) identifier_result (string_'Cluster') string_'Cluster' )subscript (string_'MasterPublicDnsName') string_'MasterPublicDnsName' )subscript )assignment )expression_statement (expression_statement (assignment (identifier_ssh_options) identifier_ssh_options (string_'-o StrictHostKeyChecking=no -o ServerAliveInterval=10') string_'-o StrictHostKeyChecking=no -o ServerAliveInterval=10' )assignment )expression_statement (expression_statement (assignment (identifier_cmd) identifier_cmd (call (attribute (string_'ssh {ssh_options} -i {key_file} hadoop@{target_dns}') string_'ssh {ssh_options} -i {key_file} hadoop@{target_dns}' (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_ssh_options) identifier_ssh_options (identifier_ssh_options) identifier_ssh_options )keyword_argument (keyword_argument (identifier_key_file) identifier_key_file (identifier_key_file) identifier_key_file )keyword_argument (keyword_argument (identifier_target_dns) identifier_target_dns (identifier_target_dns) identifier_target_dns )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_subprocess) identifier_subprocess (identifier_call) identifier_call )attribute (argument_list (identifier_cmd) identifier_cmd (keyword_argument (identifier_shell) identifier_shell (True) True )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
SSH login to EMR master node
(module (function_definition (function_name_trimsquants) function_name_trimsquants (parameters (identifier_self) identifier_self (typed_parameter (identifier_col) identifier_col (type (identifier_str) identifier_str )type )typed_parameter (typed_parameter (identifier_sup) identifier_sup (type (identifier_float) identifier_float )type )typed_parameter )parameters (block (try_statement (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_df) identifier_df )attribute (call (attribute (identifier_self) identifier_self (identifier__trimquants) identifier__trimquants )attribute (argument_list (identifier_col) identifier_col (None) None (identifier_sup) identifier_sup )argument_list )call )assignment )expression_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_self) identifier_self (identifier_err) identifier_err )attribute (argument_list (identifier_e) identifier_e (attribute (identifier_self) identifier_self (identifier_trimsquants) identifier_trimsquants )attribute (string_"Can not trim superior quantiles") string_"Can not trim superior quantiles" )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
Remove superior quantiles from the dataframe :param col: column name :type col: str :param sup: superior quantile :type sup: float :example: ``ds.trimsquants("Col 1", 0.99)``
(module (function_definition (function_name_plot_estimates) function_name_plot_estimates (parameters (identifier_positions) identifier_positions (identifier_estimates) identifier_estimates )parameters (block (expression_statement (assignment (identifier_x) identifier_x (call (identifier_list) identifier_list (argument_list (identifier_positions) identifier_positions )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_fig) identifier_fig (call (attribute (identifier_plt) identifier_plt (identifier_figure) identifier_figure )attribute (argument_list (keyword_argument (identifier_figsize) identifier_figsize (tuple (binary_operator (identifier_SUBPLOT_WIDTH) identifier_SUBPLOT_WIDTH (call (identifier_len) identifier_len (argument_list (identifier_estimates) identifier_estimates )argument_list )call )binary_operator (identifier_FIGURE_HEIGHT) identifier_FIGURE_HEIGHT )tuple )keyword_argument )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_i) identifier_i (tuple_pattern (identifier_title) identifier_title (identifier_y) identifier_y )tuple_pattern )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (call (identifier_zip) identifier_zip (argument_list (identifier_ESTIMATE_TITLES) identifier_ESTIMATE_TITLES (identifier_estimates) identifier_estimates )argument_list )call )argument_list )call (block (expression_statement (assignment (identifier_ax) identifier_ax (call (attribute (identifier_fig) identifier_fig (identifier_add_subplot) identifier_add_subplot )attribute (argument_list (integer_1) integer_1 (call (identifier_len) identifier_len (argument_list (identifier_estimates) identifier_estimates )argument_list )call (binary_operator (identifier_i) identifier_i (integer_1) integer_1 )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_ax) identifier_ax (identifier_plot) identifier_plot )attribute (argument_list (identifier_x) identifier_x (identifier_y) identifier_y (keyword_argument (identifier_linewidth) identifier_linewidth (identifier_LINE_WIDTH) identifier_LINE_WIDTH )keyword_argument (keyword_argument (identifier_c) identifier_c (identifier_LINE_COLOR) identifier_LINE_COLOR )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_ax) identifier_ax (identifier_title) identifier_title )attribute (identifier_set_text) identifier_set_text )attribute (argument_list (identifier_title) identifier_title )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_ax) identifier_ax (identifier_set_xlim) identifier_set_xlim )attribute (argument_list (integer_0) integer_0 (integer_1) integer_1 )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_ax) identifier_ax (identifier_set_xlabel) identifier_set_xlabel )attribute (argument_list (string_"position") string_"position" )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_ax) identifier_ax (identifier_set_ylabel) identifier_set_ylabel )attribute (argument_list (string_"$\\hat P$") string_"$\\hat P$" )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_ax) identifier_ax (identifier_grid) identifier_grid )attribute (argument_list )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_fig) identifier_fig )return_statement )block )function_definition )module
Plots density, and probability estimates. Parameters ---------- positions : iterable of float Paragraph positions for which densities, and probabilities were estimated. estimates : six-tuple of (sequence of float) Estimates of P(relevant), p(position), p(position | relevant), P(position, relevant), and P(relevant | position). Returns ------- matplotlib.figure.Figure The plotted figure.
(module (function_definition (function_name_natural_neighbor_to_grid) function_name_natural_neighbor_to_grid (parameters (identifier_xp) identifier_xp (identifier_yp) identifier_yp (identifier_variable) identifier_variable (identifier_grid_x) identifier_grid_x (identifier_grid_y) identifier_grid_y )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (expression_statement (assignment (identifier_points_obs) identifier_points_obs (call (identifier_list) identifier_list (argument_list (call (identifier_zip) identifier_zip (argument_list (identifier_xp) identifier_xp (identifier_yp) identifier_yp )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_points_grid) identifier_points_grid (call (identifier_generate_grid_coords) identifier_generate_grid_coords (argument_list (identifier_grid_x) identifier_grid_x (identifier_grid_y) identifier_grid_y )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_img) identifier_img (call (identifier_natural_neighbor_to_points) identifier_natural_neighbor_to_points (argument_list (identifier_points_obs) identifier_points_obs (identifier_variable) identifier_variable (identifier_points_grid) identifier_points_grid )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_img) identifier_img (identifier_reshape) identifier_reshape )attribute (argument_list (attribute (identifier_grid_x) identifier_grid_x (identifier_shape) identifier_shape )attribute )argument_list )call )return_statement )block )function_definition )module
r"""Generate a natural neighbor interpolation of the given points to a regular grid. This assigns values to the given grid using the Liang and Hale [Liang2010]_. approach. Parameters ---------- xp: (N, ) ndarray x-coordinates of observations yp: (N, ) ndarray y-coordinates of observations variable: (N, ) ndarray observation values associated with (xp, yp) pairs. IE, variable[i] is a unique observation at (xp[i], yp[i]) grid_x: (M, 2) ndarray Meshgrid associated with x dimension grid_y: (M, 2) ndarray Meshgrid associated with y dimension Returns ------- img: (M, N) ndarray Interpolated values on a 2-dimensional grid See Also -------- natural_neighbor_to_points
(module (function_definition (function_name_get_analysis_data_by_title) function_name_get_analysis_data_by_title (parameters (identifier_self) identifier_self (identifier_ar_data) identifier_ar_data (identifier_title) identifier_title )parameters (block (expression_statement (assignment (identifier_analyses) identifier_analyses (call (attribute (identifier_ar_data) identifier_ar_data (identifier_get) identifier_get )attribute (argument_list (string_"analyses") string_"analyses" (list )list )argument_list )call )assignment )expression_statement (for_statement (identifier_analysis) identifier_analysis (identifier_analyses) identifier_analyses (block (if_statement (comparison_operator (call (attribute (identifier_analysis) identifier_analysis (identifier_get) identifier_get )attribute (argument_list (string_"title") string_"title" )argument_list )call (identifier_title) identifier_title )comparison_operator (block (return_statement (identifier_analysis) identifier_analysis )return_statement )block )if_statement )block )for_statement (return_statement (None) None )return_statement )block )function_definition )module
A template helper to pick an Analysis identified by the name of the current Analysis Service. ar_data is the dictionary structure which is returned by _ws_data
(module (function_definition (function_name_first_location_of_minimum) function_name_first_location_of_minimum (parameters (identifier_x) identifier_x )parameters (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_x) identifier_x (tuple (attribute (identifier_np) identifier_np (identifier_ndarray) identifier_ndarray )attribute (attribute (identifier_pd) identifier_pd (identifier_Series) identifier_Series )attribute )tuple )argument_list )call )not_operator (block (expression_statement (assignment (identifier_x) identifier_x (call (attribute (identifier_np) identifier_np (identifier_asarray) identifier_asarray )attribute (argument_list (identifier_x) identifier_x )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (conditional_expression (binary_operator (call (attribute (identifier_np) identifier_np (identifier_argmin) identifier_argmin )attribute (argument_list (identifier_x) identifier_x )argument_list )call (call (identifier_len) identifier_len (argument_list (identifier_x) identifier_x )argument_list )call )binary_operator (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_x) identifier_x )argument_list )call (integer_0) integer_0 )comparison_operator (attribute (identifier_np) identifier_np (identifier_NaN) identifier_NaN )attribute )conditional_expression )return_statement )block )function_definition )module
Returns the first location of the minimal value of x. The position is calculated relatively to the length of x. :param x: the time series to calculate the feature of :type x: numpy.ndarray :return: the value of this feature :return type: float
(module (function_definition (function_name__apply_replacement) function_name__apply_replacement (parameters (identifier_error) identifier_error (identifier_found_file) identifier_found_file (identifier_file_lines) identifier_file_lines )parameters (block (expression_statement (assignment (identifier_fixed_lines) identifier_fixed_lines (identifier_file_lines) identifier_file_lines )assignment )expression_statement (expression_statement (assignment (subscript (identifier_fixed_lines) identifier_fixed_lines (binary_operator (attribute (subscript (identifier_error) identifier_error (integer_1) integer_1 )subscript (identifier_line) identifier_line )attribute (integer_1) integer_1 )binary_operator )subscript (attribute (subscript (identifier_error) identifier_error (integer_1) integer_1 )subscript (identifier_replacement) identifier_replacement )attribute )assignment )expression_statement (expression_statement (assignment (identifier_concatenated_fixed_lines) identifier_concatenated_fixed_lines (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (argument_list (identifier_fixed_lines) identifier_fixed_lines )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_found_file) identifier_found_file (identifier_seek) identifier_seek )attribute (argument_list (integer_0) integer_0 )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_found_file) identifier_found_file (identifier_write) identifier_write )attribute (argument_list (identifier_concatenated_fixed_lines) identifier_concatenated_fixed_lines )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_found_file) identifier_found_file (identifier_truncate) identifier_truncate )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Apply a single replacement.
(module (function_definition (function_name_get_es) function_name_get_es (parameters (default_parameter (identifier_urls) identifier_urls (None) None )default_parameter (default_parameter (identifier_timeout) identifier_timeout (identifier_DEFAULT_TIMEOUT) identifier_DEFAULT_TIMEOUT )default_parameter (default_parameter (identifier_force_new) identifier_force_new (False) False )default_parameter (dictionary_splat_pattern (identifier_settings) identifier_settings )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_urls) identifier_urls (boolean_operator (identifier_urls) identifier_urls (identifier_DEFAULT_URLS) identifier_DEFAULT_URLS )boolean_operator )assignment )expression_statement (if_statement (comparison_operator (string_'hosts') string_'hosts' (identifier_settings) identifier_settings )comparison_operator (block (raise_statement (call (identifier_DeprecationWarning) identifier_DeprecationWarning (argument_list (string_'"hosts" is deprecated in favor of "urls".') string_'"hosts" is deprecated in favor of "urls".' )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (identifier_force_new) identifier_force_new )not_operator (block (expression_statement (assignment (identifier_key) identifier_key (call (identifier__build_key) identifier__build_key (argument_list (identifier_urls) identifier_urls (identifier_timeout) identifier_timeout (dictionary_splat (identifier_settings) identifier_settings )dictionary_splat )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_key) identifier_key (identifier__cached_elasticsearch) identifier__cached_elasticsearch )comparison_operator (block (return_statement (subscript (identifier__cached_elasticsearch) identifier__cached_elasticsearch (identifier_key) identifier_key )subscript )return_statement )block )if_statement )block )if_statement (expression_statement (assignment (identifier_es) identifier_es (call (identifier_Elasticsearch) identifier_Elasticsearch (argument_list (identifier_urls) identifier_urls (keyword_argument (identifier_timeout) identifier_timeout (identifier_timeout) identifier_timeout )keyword_argument (dictionary_splat (identifier_settings) identifier_settings )dictionary_splat )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_force_new) identifier_force_new )not_operator (block (expression_statement (assignment (subscript (identifier__cached_elasticsearch) identifier__cached_elasticsearch (identifier_key) identifier_key )subscript (identifier_es) identifier_es )assignment )expression_statement )block )if_statement (return_statement (identifier_es) identifier_es )return_statement )block )function_definition )module
Create an elasticsearch `Elasticsearch` object and return it. This will aggressively re-use `Elasticsearch` objects with the following rules: 1. if you pass the same argument values to `get_es()`, then it will return the same `Elasticsearch` object 2. if you pass different argument values to `get_es()`, then it will return different `Elasticsearch` object 3. it caches each `Elasticsearch` object that gets created 4. if you pass in `force_new=True`, then you are guaranteed to get a fresh `Elasticsearch` object AND that object will not be cached :arg urls: list of uris; Elasticsearch hosts to connect to, defaults to ``['http://localhost:9200']`` :arg timeout: int; the timeout in seconds, defaults to 5 :arg force_new: Forces get_es() to generate a new Elasticsearch object rather than pulling it from cache. :arg settings: other settings to pass into Elasticsearch constructor; See `<http://elasticsearch-py.readthedocs.org/>`_ for more details. Examples:: # Returns cached Elasticsearch object es = get_es() # Returns a new Elasticsearch object es = get_es(force_new=True) es = get_es(urls=['localhost']) es = get_es(urls=['localhost:9200'], timeout=10, max_retries=3)
(module (function_definition (function_name_update_video_image) function_name_update_video_image (parameters (identifier_edx_video_id) identifier_edx_video_id (identifier_course_id) identifier_course_id (identifier_image_data) identifier_image_data (identifier_file_name) identifier_file_name )parameters (block (try_statement (block (expression_statement (assignment (identifier_course_video) identifier_course_video (call (attribute (call (attribute (attribute (identifier_CourseVideo) identifier_CourseVideo (identifier_objects) identifier_objects )attribute (identifier_select_related) identifier_select_related )attribute (argument_list (string_'video') string_'video' )argument_list )call (identifier_get) identifier_get )attribute (argument_list (keyword_argument (identifier_course_id) identifier_course_id (identifier_course_id) identifier_course_id )keyword_argument (keyword_argument (identifier_video__edx_video_id) identifier_video__edx_video_id (identifier_edx_video_id) identifier_edx_video_id )keyword_argument )argument_list )call )assignment )expression_statement )block (except_clause (identifier_ObjectDoesNotExist) identifier_ObjectDoesNotExist (block (expression_statement (assignment (identifier_error_message) identifier_error_message (call (attribute (string_u'VAL: CourseVideo not found for edx_video_id: {0} and course_id: {1}') string_u'VAL: CourseVideo not found for edx_video_id: {0} and course_id: {1}' (identifier_format) identifier_format )attribute (argument_list (identifier_edx_video_id) identifier_edx_video_id (identifier_course_id) identifier_course_id )argument_list )call )assignment )expression_statement (raise_statement (call (identifier_ValVideoNotFoundError) identifier_ValVideoNotFoundError (argument_list (identifier_error_message) identifier_error_message )argument_list )call )raise_statement )block )except_clause )try_statement (expression_statement (assignment (pattern_list (identifier_video_image) identifier_video_image (identifier__) identifier__ )pattern_list (call (attribute (identifier_VideoImage) identifier_VideoImage (identifier_create_or_update) identifier_create_or_update )attribute (argument_list (identifier_course_video) identifier_course_video (identifier_file_name) identifier_file_name (identifier_image_data) identifier_image_data )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_video_image) identifier_video_image (identifier_image_url) identifier_image_url )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Update video image for an existing video. NOTE: If `image_data` is None then `file_name` value will be used as it is, otherwise a new file name is constructed based on uuid and extension from `file_name` value. `image_data` will be None in case of course re-run and export. Arguments: image_data (InMemoryUploadedFile): Image data to be saved for a course video. Returns: course video image url Raises: Raises ValVideoNotFoundError if the CourseVideo cannot be retrieved.
(module (function_definition (function_name_deactivate_) function_name_deactivate_ (parameters (identifier_self) identifier_self )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_preDeactivate_) identifier_preDeactivate_ )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_active) identifier_active )attribute (False) False )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_image_dimensions) identifier_image_dimensions )attribute (None) None )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (None) None )assignment )expression_statement )block )function_definition )module
Init shmem variables to None
(module (function_definition (function_name_item_frequency) function_name_item_frequency (parameters (identifier_sa) identifier_sa (default_parameter (identifier_xlabel) identifier_xlabel (identifier_LABEL_DEFAULT) identifier_LABEL_DEFAULT )default_parameter (default_parameter (identifier_ylabel) identifier_ylabel (identifier_LABEL_DEFAULT) identifier_LABEL_DEFAULT )default_parameter (default_parameter (identifier_title) identifier_title (identifier_LABEL_DEFAULT) identifier_LABEL_DEFAULT )default_parameter )parameters (block (if_statement (parenthesized_expression (boolean_operator (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_sa) identifier_sa (attribute (attribute (attribute (identifier_tc) identifier_tc (identifier_data_structures) identifier_data_structures )attribute (identifier_sarray) identifier_sarray )attribute (identifier_SArray) identifier_SArray )attribute )argument_list )call )not_operator (comparison_operator (attribute (identifier_sa) identifier_sa (identifier_dtype) identifier_dtype )attribute (identifier_str) identifier_str )comparison_operator )boolean_operator )parenthesized_expression (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_"turicreate.visualization.item_frequency supports ") string_"turicreate.visualization.item_frequency supports " (string_"SArrays of dtype str") string_"SArrays of dtype str" )binary_operator )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_title) identifier_title (call (identifier__get_title) identifier__get_title (argument_list (identifier_title) identifier_title )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_plt_ref) identifier_plt_ref (call (attribute (attribute (identifier_tc) identifier_tc (identifier_extensions) identifier_extensions )attribute (identifier_plot_item_frequency) identifier_plot_item_frequency )attribute (argument_list (identifier_sa) identifier_sa (identifier_xlabel) identifier_xlabel (identifier_ylabel) identifier_ylabel (identifier_title) identifier_title )argument_list )call )assignment )expression_statement (return_statement (call (identifier_Plot) identifier_Plot (argument_list (identifier_plt_ref) identifier_plt_ref )argument_list )call )return_statement )block )function_definition )module
Plots an item frequency of the sarray provided as input, and returns the resulting Plot object. The function supports SArrays with dtype str. Parameters ---------- sa : SArray The data to get an item frequency for. Must have dtype str xlabel : str (optional) The text label for the X axis. Defaults to "Values". ylabel : str (optional) The text label for the Y axis. Defaults to "Count". title : str (optional) The title of the plot. Defaults to LABEL_DEFAULT. If the value is LABEL_DEFAULT, the title will be "<xlabel> vs. <ylabel>". If the value is None, the title will be omitted. Otherwise, the string passed in as the title will be used as the plot title. Returns ------- out : Plot A :class: Plot object that is the item frequency plot. Examples -------- Make an item frequency of an SArray. >>> x = turicreate.SArray(['a','ab','acd','ab','a','a','a','ab','cd']) >>> ifplt = turicreate.visualization.item_frequency(x)
(module (function_definition (function_name___callback) function_name___callback (parameters (identifier_self) identifier_self (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_method) identifier_method (attribute (identifier_self) identifier_self (identifier___cb_message) identifier___cb_message )attribute )assignment )expression_statement (if_statement (comparison_operator (identifier_method) identifier_method (None) None )comparison_operator (block (try_statement (block (expression_statement (call (identifier_method) identifier_method (argument_list (identifier_data) identifier_data )argument_list )call )expression_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_ex) identifier_ex )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier__logger) identifier__logger (identifier_exception) identifier_exception )attribute (argument_list (string_"Error calling method: %s") string_"Error calling method: %s" (identifier_ex) identifier_ex )argument_list )call )expression_statement )block )except_clause )try_statement )block )if_statement )block )function_definition )module
Safely calls back a method :param data: Associated stanza
(module (function_definition (function_name_set_value) function_name_set_value (parameters (identifier_self) identifier_self (typed_parameter (identifier_dry_wet) identifier_dry_wet (type (identifier_LeakSensorState) identifier_LeakSensorState )type )typed_parameter )parameters (block (expression_statement (assignment (identifier_value) identifier_value (integer_0) integer_0 )assignment )expression_statement (if_statement (comparison_operator (identifier_dry_wet) identifier_dry_wet (attribute (identifier_self) identifier_self (identifier__dry_wet_type) identifier__dry_wet_type )attribute )comparison_operator (block (expression_statement (assignment (identifier_value) identifier_value (integer_1) integer_1 )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__update_subscribers) identifier__update_subscribers )attribute (argument_list (identifier_value) identifier_value )argument_list )call )expression_statement )block )function_definition )module
Set the value of the state to dry or wet.
(module (function_definition (function_name_tt_avg) function_name_tt_avg (parameters (identifier_self) identifier_self (default_parameter (identifier_print_output) identifier_print_output (True) True )default_parameter (default_parameter (identifier_output_file) identifier_output_file (string_"tt.csv") string_"tt.csv" )default_parameter )parameters (block (expression_statement (assignment (identifier_avg) identifier_avg (call (attribute (attribute (identifier_self) identifier_self (identifier_tt) identifier_tt )attribute (identifier_mean) identifier_mean )attribute (argument_list (keyword_argument (identifier_axis) identifier_axis (integer_2) integer_2 )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (identifier_print_output) identifier_print_output (block (expression_statement (call (attribute (identifier_np) identifier_np (identifier_savetxt) identifier_savetxt )attribute (argument_list (identifier_output_file) identifier_output_file (identifier_avg) identifier_avg (keyword_argument (identifier_delimiter) identifier_delimiter (string_",") string_"," )keyword_argument )argument_list )call )expression_statement )block )if_statement (return_statement (identifier_avg) identifier_avg )return_statement )block )function_definition )module
Compute average term-topic matrix, and print to file if print_output=True.
(module (function_definition (function_name_dilate) function_name_dilate (parameters (identifier_self) identifier_self (identifier_size) identifier_size )parameters (block (if_statement (comparison_operator (identifier_size) identifier_size (integer_0) integer_0 )comparison_operator (block (import_from_statement (dotted_name (identifier_scipy) identifier_scipy (identifier_ndimage) identifier_ndimage (identifier_morphology) identifier_morphology )dotted_name (dotted_name (identifier_binary_dilation) identifier_binary_dilation )dotted_name )import_from_statement (expression_statement (assignment (identifier_size) identifier_size (binary_operator (parenthesized_expression (binary_operator (identifier_size) identifier_size (integer_2) integer_2 )binary_operator )parenthesized_expression (integer_1) integer_1 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_coords) identifier_coords (attribute (identifier_self) identifier_self (identifier_coordinates) identifier_coordinates )attribute )assignment )expression_statement (expression_statement (assignment (identifier_tmp) identifier_tmp (call (identifier_zeros) identifier_zeros (argument_list (binary_operator (attribute (identifier_self) identifier_self (identifier_extent) identifier_extent )attribute (binary_operator (identifier_size) identifier_size (integer_2) integer_2 )binary_operator )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_coords) identifier_coords (parenthesized_expression (binary_operator (binary_operator (identifier_coords) identifier_coords (subscript (attribute (identifier_self) identifier_self (identifier_bbox) identifier_bbox )attribute (slice (integer_0) integer_0 (colon) colon (call (identifier_len) identifier_len (argument_list (attribute (identifier_self) identifier_self (identifier_center) identifier_center )attribute )argument_list )call )slice )subscript )binary_operator (identifier_size) identifier_size )binary_operator )parenthesized_expression )assignment )expression_statement (expression_statement (assignment (subscript (identifier_tmp) identifier_tmp (call (attribute (attribute (identifier_coords) identifier_coords (identifier_T) identifier_T )attribute (identifier_tolist) identifier_tolist )attribute (argument_list )argument_list )call )subscript (integer_1) integer_1 )assignment )expression_statement (expression_statement (assignment (identifier_tmp) identifier_tmp (call (identifier_binary_dilation) identifier_binary_dilation (argument_list (identifier_tmp) identifier_tmp (call (identifier_ones) identifier_ones (argument_list (tuple (identifier_size) identifier_size (identifier_size) identifier_size )tuple )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_new) identifier_new (binary_operator (binary_operator (attribute (call (identifier_asarray) identifier_asarray (argument_list (call (identifier_where) identifier_where (argument_list (identifier_tmp) identifier_tmp )argument_list )call )argument_list )call (identifier_T) identifier_T )attribute (subscript (attribute (identifier_self) identifier_self (identifier_bbox) identifier_bbox )attribute (slice (integer_0) integer_0 (colon) colon (call (identifier_len) identifier_len (argument_list (attribute (identifier_self) identifier_self (identifier_center) identifier_center )attribute )argument_list )call )slice )subscript )binary_operator (identifier_size) identifier_size )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_new) identifier_new (list_comprehension (identifier_c) identifier_c (for_in_clause (identifier_c) identifier_c (identifier_new) identifier_new )for_in_clause (if_clause (call (identifier_all) identifier_all (argument_list (comparison_operator (identifier_c) identifier_c (integer_0) integer_0 )comparison_operator )argument_list )call )if_clause )list_comprehension )assignment )expression_statement )block (else_clause (block (return_statement (identifier_self) identifier_self )return_statement )block )else_clause )if_statement (return_statement (call (identifier_one) identifier_one (argument_list (identifier_new) identifier_new )argument_list )call )return_statement )block )function_definition )module
Dilate a region using morphological operators. Parameters ---------- size : int Size of dilation in pixels
(module (function_definition (function_name_find_module) function_name_find_module (parameters (identifier_self) identifier_self (identifier_fullname) identifier_fullname (default_parameter (identifier_path) identifier_path (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_basepaths) identifier_basepaths (binary_operator (list (string_"") string_"" )list (call (identifier_list) identifier_list (argument_list (attribute (identifier_sys) identifier_sys (identifier_path) identifier_path )attribute )argument_list )call )binary_operator )assignment )expression_statement (if_statement (call (attribute (identifier_fullname) identifier_fullname (identifier_startswith) identifier_startswith )attribute (argument_list (string_".") string_"." )argument_list )call (block (if_statement (comparison_operator (identifier_path) identifier_path (None) None )comparison_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_fullname) identifier_fullname (subscript (identifier_fullname) identifier_fullname (slice (integer_1) integer_1 (colon) colon )slice )subscript )assignment )expression_statement (expression_statement (call (attribute (identifier_basepaths) identifier_basepaths (identifier_insert) identifier_insert )attribute (argument_list (integer_0) integer_0 (identifier_path) identifier_path )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (identifier_fullpath) identifier_fullpath (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (list_splat (call (attribute (identifier_fullname) identifier_fullname (identifier_split) identifier_split )attribute (argument_list (string_".") string_"." )argument_list )call )list_splat )argument_list )call )assignment )expression_statement (for_statement (identifier_head) identifier_head (identifier_basepaths) identifier_basepaths (block (expression_statement (assignment (identifier_path) identifier_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_head) identifier_head (identifier_fullpath) identifier_fullpath )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_filepath) identifier_filepath (binary_operator (identifier_path) identifier_path (attribute (identifier_self) identifier_self (identifier_ext) identifier_ext )attribute )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_dirpath) identifier_dirpath (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_path) identifier_path (binary_operator (string_"__init__") string_"__init__" (attribute (identifier_self) identifier_self (identifier_ext) identifier_ext )attribute )binary_operator )argument_list )call )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_filepath) identifier_filepath )argument_list )call (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_run_compiler) identifier_run_compiler )attribute (argument_list (identifier_filepath) identifier_filepath )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )if_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_dirpath) identifier_dirpath )argument_list )call (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_run_compiler) identifier_run_compiler )attribute (argument_list (identifier_path) identifier_path )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )if_statement )block )for_statement (return_statement (None) None )return_statement )block )function_definition )module
Searches for a Coconut file of the given name and compiles it.
(module (function_definition (function_name_do_static_merge) function_name_do_static_merge (parameters (identifier_cls) identifier_cls (identifier_c_source) identifier_c_source (identifier_c_target) identifier_c_target )parameters (block (expression_statement (call (attribute (identifier_c_target) identifier_c_target (identifier_extend) identifier_extend )attribute (argument_list (identifier_c_source) identifier_c_source )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_c_source) identifier_c_source (identifier_parent) identifier_parent )attribute (attribute (identifier_c_target) identifier_c_target (identifier_parent) identifier_parent )attribute )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_cls) identifier_cls (identifier_CLUSTERS) identifier_CLUSTERS )attribute (identifier_remove) identifier_remove )attribute (argument_list (identifier_c_source) identifier_c_source )argument_list )call )expression_statement (for_statement (identifier_m) identifier_m (attribute (identifier_c_source) identifier_c_source (identifier_mentions) identifier_mentions )attribute (block (expression_statement (assignment (subscript (attribute (identifier_cls) identifier_cls (identifier_MENTION_TO_CLUSTER) identifier_MENTION_TO_CLUSTER )attribute (identifier_m) identifier_m )subscript (identifier_c_target) identifier_c_target )assignment )expression_statement )block )for_statement )block )function_definition )module
By the time we're just folding in clusters, there's no need to maintain self.INSTANCES and self.clusters, so we just call this method
(module (function_definition (function_name_prepare) function_name_prepare (parameters (identifier_self) identifier_self (identifier_context) identifier_context )parameters (block (if_statement (identifier___debug__) identifier___debug__ (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_"Preparing request context.") string_"Preparing request context." (keyword_argument (identifier_extra) identifier_extra (call (identifier_dict) identifier_dict (argument_list (keyword_argument (identifier_request) identifier_request (call (identifier_id) identifier_id (argument_list (identifier_context) identifier_context )argument_list )call )keyword_argument )argument_list )call )keyword_argument )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (call (identifier_Request) identifier_Request (argument_list (attribute (identifier_context) identifier_context (identifier_environ) identifier_environ )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_context) identifier_context (identifier_response) identifier_response )attribute (call (identifier_Response) identifier_Response (argument_list (keyword_argument (identifier_request) identifier_request (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_context) identifier_context (identifier_environ) identifier_environ )attribute (string_'web.base') string_'web.base' )subscript (attribute (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (identifier_script_name) identifier_script_name )attribute )assignment )expression_statement (expression_statement (assignment (attribute (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (identifier_remainder) identifier_remainder )attribute (call (attribute (attribute (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (identifier_path_info) identifier_path_info )attribute (identifier_split) identifier_split )attribute (argument_list (string_'/') string_'/' )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (attribute (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (identifier_remainder) identifier_remainder )attribute (not_operator (subscript (attribute (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (identifier_remainder) identifier_remainder )attribute (integer_0) integer_0 )subscript )not_operator )boolean_operator (block (delete_statement (subscript (attribute (attribute (identifier_context) identifier_context (identifier_request) identifier_request )attribute (identifier_remainder) identifier_remainder )attribute (integer_0) integer_0 )subscript )delete_statement )block )if_statement (expression_statement (assignment (attribute (identifier_context) identifier_context (identifier_path) identifier_path )attribute (call (identifier_Bread) identifier_Bread (argument_list )argument_list )call )assignment )expression_statement )block )function_definition )module
Add the usual suspects to the context. This adds `request`, `response`, and `path` to the `RequestContext` instance.
(module (function_definition (function_name_css) function_name_css (parameters (identifier_app) identifier_app (identifier_env) identifier_env )parameters (block (expression_statement (assignment (identifier_srcdir) identifier_srcdir (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_abspath) identifier_abspath )attribute (argument_list (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_dirname) identifier_dirname )attribute (argument_list (identifier___file__) identifier___file__ )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_cssfile) identifier_cssfile (string_'bolditalic.css') string_'bolditalic.css' )assignment )expression_statement (expression_statement (assignment (identifier_csspath) identifier_csspath (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_srcdir) identifier_srcdir (identifier_cssfile) identifier_cssfile )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_buildpath) identifier_buildpath (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (attribute (identifier_app) identifier_app (identifier_outdir) identifier_outdir )attribute (string_'_static') string_'_static' )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_buildpath) identifier_buildpath )argument_list )call )expression_statement )block (except_clause (identifier_OSError) identifier_OSError (block (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_buildpath) identifier_buildpath )argument_list )call )not_operator (block (raise_statement )raise_statement )block )if_statement )block )except_clause )try_statement (expression_statement (call (identifier_copy) identifier_copy (argument_list (identifier_csspath) identifier_csspath (identifier_buildpath) identifier_buildpath )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_app) identifier_app (identifier_add_stylesheet) identifier_add_stylesheet )attribute (argument_list (identifier_cssfile) identifier_cssfile )argument_list )call )expression_statement (return_statement )return_statement )block )function_definition )module
Add bolditalic CSS. :param app: Sphinx application context. :param env: Sphinx environment context.
(module (function_definition (function_name_submit_sms_conversion) function_name_submit_sms_conversion (parameters (identifier_self) identifier_self (identifier_message_id) identifier_message_id (default_parameter (identifier_delivered) identifier_delivered (True) True )default_parameter (default_parameter (identifier_timestamp) identifier_timestamp (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_params) identifier_params (dictionary (pair (string_"message-id") string_"message-id" (identifier_message_id) identifier_message_id )pair (pair (string_"delivered") string_"delivered" (identifier_delivered) identifier_delivered )pair (pair (string_"timestamp") string_"timestamp" (boolean_operator (identifier_timestamp) identifier_timestamp (call (attribute (identifier_datetime) identifier_datetime (identifier_now) identifier_now )attribute (argument_list (attribute (identifier_pytz) identifier_pytz (identifier_utc) identifier_utc )attribute )argument_list )call )boolean_operator )pair )dictionary )assignment )expression_statement (expression_statement (call (identifier__format_date_param) identifier__format_date_param (argument_list (identifier_params) identifier_params (string_"timestamp") string_"timestamp" )argument_list )call )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier_post) identifier_post )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_api_host) identifier_api_host )attribute (string_"/conversions/sms") string_"/conversions/sms" (identifier_params) identifier_params )argument_list )call )return_statement )block )function_definition )module
Notify Nexmo that an SMS was successfully received. :param message_id: The `message-id` str returned by the send_message call. :param delivered: A `bool` indicating that the message was or was not successfully delivered. :param timestamp: A `datetime` object containing the time the SMS arrived. :return: The parsed response from the server. On success, the bytestring b'OK'
(module (function_definition (function_name_quantiles) function_name_quantiles (parameters (identifier_x) identifier_x (default_parameter (identifier_qlist) identifier_qlist (tuple (float_2.5) float_2.5 (integer_25) integer_25 (integer_50) integer_50 (integer_75) integer_75 (float_97.5) float_97.5 )tuple )default_parameter )parameters (block (expression_statement (assignment (identifier_x) identifier_x (call (attribute (identifier_x) identifier_x (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_x) identifier_x (identifier_ndim) identifier_ndim )attribute (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_sx) identifier_sx (attribute (call (identifier_sort) identifier_sort (argument_list (attribute (identifier_x) identifier_x (identifier_T) identifier_T )attribute )argument_list )call (identifier_T) identifier_T )attribute )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_sx) identifier_sx (call (identifier_sort) identifier_sort (argument_list (identifier_x) identifier_x )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (try_statement (block (expression_statement (assignment (identifier_quants) identifier_quants (list_comprehension (subscript (identifier_sx) identifier_sx (call (identifier_int) identifier_int (argument_list (binary_operator (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_sx) identifier_sx )argument_list )call (identifier_q) identifier_q )binary_operator (float_100.0) float_100.0 )binary_operator )argument_list )call )subscript (for_in_clause (identifier_q) identifier_q (identifier_qlist) identifier_qlist )for_in_clause )list_comprehension )assignment )expression_statement (return_statement (call (identifier_dict) identifier_dict (argument_list (call (identifier_zip) identifier_zip (argument_list (identifier_qlist) identifier_qlist (identifier_quants) identifier_quants )argument_list )call )argument_list )call )return_statement )block (except_clause (identifier_IndexError) identifier_IndexError (block (expression_statement (call (identifier_print_) identifier_print_ (argument_list (string_"Too few elements for quantile calculation") string_"Too few elements for quantile calculation" )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
Returns a dictionary of requested quantiles from array :Arguments: x : Numpy array An array containing MCMC samples qlist : tuple or list A list of desired quantiles (defaults to (2.5, 25, 50, 75, 97.5))
(module (function_definition (function_name_build_job) function_name_build_job (parameters (default_parameter (identifier_name) identifier_name (None) None )default_parameter (default_parameter (identifier_parameters) identifier_parameters (None) None )default_parameter )parameters (block (if_statement (not_operator (identifier_name) identifier_name )not_operator (block (raise_statement (call (identifier_SaltInvocationError) identifier_SaltInvocationError (argument_list (string_'Required parameter \'name\' is missing') string_'Required parameter \'name\' is missing' )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_server) identifier_server (call (identifier__connect) identifier__connect (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (identifier_job_exists) identifier_job_exists (argument_list (identifier_name) identifier_name )argument_list )call )not_operator (block (raise_statement (call (identifier_CommandExecutionError) identifier_CommandExecutionError (argument_list (call (attribute (string_'Job \'{0}\' does not exist.') string_'Job \'{0}\' does not exist.' (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name )argument_list )call )argument_list )call )raise_statement )block )if_statement (try_statement (block (expression_statement (call (attribute (identifier_server) identifier_server (identifier_build_job) identifier_build_job )attribute (argument_list (identifier_name) identifier_name (identifier_parameters) identifier_parameters )argument_list )call )expression_statement )block (except_clause (as_pattern (attribute (identifier_jenkins) identifier_jenkins (identifier_JenkinsException) identifier_JenkinsException )attribute (as_pattern_target (identifier_err) identifier_err )as_pattern_target )as_pattern (block (raise_statement (call (identifier_CommandExecutionError) identifier_CommandExecutionError (argument_list (call (attribute (string_'Encountered error building job \'{0}\': {1}') string_'Encountered error building job \'{0}\': {1}' (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name (identifier_err) identifier_err )argument_list )call )argument_list )call )raise_statement )block )except_clause )try_statement (return_statement (True) True )return_statement )block )function_definition )module
Initiate a build for the provided job. :param name: The name of the job is check if it exists. :param parameters: Parameters to send to the job. :return: True is successful, otherwise raise an exception. CLI Example: .. code-block:: bash salt '*' jenkins.build_job jobname
(module (function_definition (function_name_get_generation_code) function_name_get_generation_code (parameters (identifier_self) identifier_self (dictionary_splat_pattern (identifier_gencode) identifier_gencode )dictionary_splat_pattern )parameters (block (expression_statement (assignment (pattern_list (identifier_channels) identifier_channels (identifier_verts) identifier_verts )pattern_list (attribute (identifier_self) identifier_self (identifier_coordinates) identifier_coordinates )attribute )assignment )expression_statement (expression_statement (assignment (identifier_channels) identifier_channels (call (attribute (string_', ') string_', ' (identifier_join) identifier_join )attribute (argument_list (list_comprehension (call (attribute (string_"'{}'") string_"'{}'" (identifier_format) identifier_format )attribute (argument_list (identifier_ch) identifier_ch )argument_list )call (for_in_clause (identifier_ch) identifier_ch (identifier_channels) identifier_channels )for_in_clause )list_comprehension )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_verts) identifier_verts (call (identifier_list) identifier_list (argument_list (identifier_verts) identifier_verts )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_verts) identifier_verts )argument_list )call (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_verts) identifier_verts (subscript (identifier_verts) identifier_verts (integer_0) integer_0 )subscript )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_verts) identifier_verts )argument_list )call (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_verts) identifier_verts (subscript (identifier_verts) identifier_verts (integer_0) integer_0 )subscript )assignment )expression_statement )block )if_statement )block )if_statement (expression_statement (assignment (identifier_verts) identifier_verts (call (identifier_apply_format) identifier_apply_format (argument_list (identifier_verts) identifier_verts (string_'{:.3e}') string_'{:.3e}' )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_gencode) identifier_gencode (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'name') string_'name' (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_gencode) identifier_gencode (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'region') string_'region' (attribute (identifier_self) identifier_self (identifier_region) identifier_region )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_gencode) identifier_gencode (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'gate_type') string_'gate_type' (attribute (identifier_self) identifier_self (identifier__gencode_gate_class) identifier__gencode_gate_class )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_gencode) identifier_gencode (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'verts') string_'verts' (identifier_verts) identifier_verts )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_gencode) identifier_gencode (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'channels') string_'channels' (identifier_channels) identifier_channels )argument_list )call )expression_statement (expression_statement (assignment (identifier_format_string) identifier_format_string (string_"{name} = {gate_type}({verts}, ({channels}), region='{region}', name='{name}')") string_"{name} = {gate_type}({verts}, ({channels}), region='{region}', name='{name}')" )assignment )expression_statement (return_statement (call (attribute (identifier_format_string) identifier_format_string (identifier_format) identifier_format )attribute (argument_list (dictionary_splat (identifier_gencode) identifier_gencode )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Generates python code that can create the gate.
(module (function_definition (function_name_is_ip) function_name_is_ip (parameters (identifier_string) identifier_string )parameters (block (expression_statement (assignment (identifier_mo) identifier_mo (call (attribute (identifier_re) identifier_re (identifier_match) identifier_match )attribute (argument_list (string_r'(\d+)\.(\d+)\.(\d+)\.(\d+)') string_r'(\d+)\.(\d+)\.(\d+)\.(\d+)' (identifier_string) identifier_string )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_mo) identifier_mo (None) None )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement (for_statement (identifier_group) identifier_group (call (attribute (identifier_mo) identifier_mo (identifier_groups) identifier_groups )attribute (argument_list )argument_list )call (block (if_statement (comparison_operator (call (identifier_int) identifier_int (argument_list (identifier_group) identifier_group )argument_list )call (call (identifier_list) identifier_list (argument_list (call (identifier_range) identifier_range (argument_list (integer_0) integer_0 (integer_256) integer_256 )argument_list )call )argument_list )call )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement )block )for_statement (return_statement (True) True )return_statement )block )function_definition )module
Returns True if the given string is an IPv4 address, False otherwise. :type string: string :param string: Any string. :rtype: bool :return: True if the string is an IP address, False otherwise.
(module (function_definition (function_name__desy_bookkeeping2marc) function_name__desy_bookkeeping2marc (parameters (identifier_self) identifier_self (identifier_key) identifier_key (identifier_value) identifier_value )parameters (block (if_statement (comparison_operator (string_'identifier') string_'identifier' (identifier_value) identifier_value )comparison_operator (block (return_statement (dictionary (pair (string_'a') string_'a' (call (attribute (identifier_value) identifier_value (identifier_get) identifier_get )attribute (argument_list (string_'expert') string_'expert' )argument_list )call )pair (pair (string_'d') string_'d' (call (attribute (identifier_value) identifier_value (identifier_get) identifier_get )attribute (argument_list (string_'date') string_'date' )argument_list )call )pair (pair (string_'s') string_'s' (call (attribute (identifier_value) identifier_value (identifier_get) identifier_get )attribute (argument_list (string_'status') string_'status' )argument_list )call )pair )dictionary )return_statement )block )if_statement (expression_statement (call (attribute (call (attribute (identifier_self) identifier_self (identifier_setdefault) identifier_setdefault )attribute (argument_list (string_'035') string_'035' (list )list )argument_list )call (identifier_append) identifier_append )attribute (argument_list (dictionary (pair (string_'9') string_'9' (string_'DESY') string_'DESY' )pair (pair (string_'z') string_'z' (subscript (identifier_value) identifier_value (string_'identifier') string_'identifier' )subscript )pair )dictionary )argument_list )call )expression_statement )block )function_definition )module
Populate the ``595_D`` MARC field. Also populates the ``035`` MARC field through side effects.
(module (function_definition (function_name_canonicalize_half_turns) function_name_canonicalize_half_turns (parameters (typed_parameter (identifier_half_turns) identifier_half_turns (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (attribute (identifier_sympy) identifier_sympy (identifier_Basic) identifier_Basic )attribute )type (type (identifier_float) identifier_float )type )type_parameter )generic_type )type )typed_parameter )parameters (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (attribute (identifier_sympy) identifier_sympy (identifier_Basic) identifier_Basic )attribute )type (type (identifier_float) identifier_float )type )type_parameter )generic_type )type (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_half_turns) identifier_half_turns (attribute (identifier_sympy) identifier_sympy (identifier_Basic) identifier_Basic )attribute )argument_list )call (block (return_statement (identifier_half_turns) identifier_half_turns )return_statement )block )if_statement (expression_statement (augmented_assignment (identifier_half_turns) identifier_half_turns (integer_2) integer_2 )augmented_assignment )expression_statement (if_statement (comparison_operator (identifier_half_turns) identifier_half_turns (integer_1) integer_1 )comparison_operator (block (expression_statement (augmented_assignment (identifier_half_turns) identifier_half_turns (integer_2) integer_2 )augmented_assignment )expression_statement )block )if_statement (return_statement (identifier_half_turns) identifier_half_turns )return_statement )block )function_definition )module
Wraps the input into the range (-1, +1].
(module (function_definition (function_name_sar) function_name_sar (parameters (identifier_patch) identifier_patch (identifier_cols) identifier_cols (identifier_splits) identifier_splits (identifier_divs) identifier_divs (default_parameter (identifier_ear) identifier_ear (False) False )default_parameter )parameters (block (function_definition (function_name_sar_y_func) function_name_sar_y_func (parameters (identifier_spatial_table) identifier_spatial_table (identifier_all_spp) identifier_all_spp )parameters (block (return_statement (call (attribute (identifier_np) identifier_np (identifier_mean) identifier_mean )attribute (argument_list (subscript (identifier_spatial_table) identifier_spatial_table (string_'n_spp') string_'n_spp' )subscript )argument_list )call )return_statement )block )function_definition (function_definition (function_name_ear_y_func) function_name_ear_y_func (parameters (identifier_spatial_table) identifier_spatial_table (identifier_all_spp) identifier_all_spp )parameters (block (expression_statement (assignment (identifier_endemic_counter) identifier_endemic_counter (integer_0) integer_0 )assignment )expression_statement (for_statement (identifier_spp) identifier_spp (identifier_all_spp) identifier_all_spp (block (expression_statement (assignment (identifier_spp_in_cell) identifier_spp_in_cell (list_comprehension (comparison_operator (identifier_spp) identifier_spp (identifier_x) identifier_x )comparison_operator (for_in_clause (identifier_x) identifier_x (subscript (identifier_spatial_table) identifier_spatial_table (string_'spp_set') string_'spp_set' )subscript )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_spp_n_cells) identifier_spp_n_cells (call (attribute (identifier_np) identifier_np (identifier_sum) identifier_sum )attribute (argument_list (identifier_spp_in_cell) identifier_spp_in_cell )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_spp_n_cells) identifier_spp_n_cells (integer_1) integer_1 )comparison_operator (block (expression_statement (augmented_assignment (identifier_endemic_counter) identifier_endemic_counter (integer_1) integer_1 )augmented_assignment )expression_statement )block )if_statement )block )for_statement (expression_statement (assignment (identifier_n_cells) identifier_n_cells (call (identifier_len) identifier_len (argument_list (identifier_spatial_table) identifier_spatial_table )argument_list )call )assignment )expression_statement (return_statement (binary_operator (identifier_endemic_counter) identifier_endemic_counter (identifier_n_cells) identifier_n_cells )binary_operator )return_statement )block )function_definition (if_statement (identifier_ear) identifier_ear (block (expression_statement (assignment (identifier_y_func) identifier_y_func (identifier_ear_y_func) identifier_ear_y_func )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_y_func) identifier_y_func (identifier_sar_y_func) identifier_sar_y_func )assignment )expression_statement )block )else_clause )if_statement (return_statement (call (identifier__sar_ear_inner) identifier__sar_ear_inner (argument_list (identifier_patch) identifier_patch (identifier_cols) identifier_cols (identifier_splits) identifier_splits (identifier_divs) identifier_divs (identifier_y_func) identifier_y_func )argument_list )call )return_statement )block )function_definition )module
Calculates an empirical species area or endemics area relationship Parameters ---------- {0} divs : str Description of how to divide x_col and y_col. See notes. ear : bool If True, calculates an endemics area relationship Returns ------- {1} Result has 5 columns; div, x, and y; that give the ID for the division given as an argument, fractional area, and the mean species richness at that division. Notes ----- {2} For the SAR and EAR, cols must also contain x_col and y_col, giving the x and y dimensions along which to grid the patch. {3} {4} Examples -------- {5} >>> # Get the SAR at the full area (1,1), 1 x 2 division, >>> # 2 x 1 division, 2 x 2 division, 2 x 4 division, 4 x 2 division, and >>> # 4 x 4 division >>> sar = meco.empirical.sar(pat, cols='spp_col:spp; count_col:count; x_col:row; y_col:column', splits="", divs="1,1; 1,2; 2,1; 2,2; 2,4; 4,2; 4,4") >>> sar[0][1] div n_individs n_spp x y 0 1,1 2445.0000 24.0000 16 24.0000 1 1,2 1222.5000 18.5000 8 18.5000 2 2,1 1222.5000 17.0000 8 17.0000 3 2,2 611.2500 13.5000 4 13.5000 4 2,4 305.6250 10.1250 2 10.1250 5 4,2 305.6250 10.5000 2 10.5000 6 4,4 152.8125 7.5625 1 7.5625 The column div gives the divisions specified in the function call. The column n_individs specifies the average number of individuals across the cells made from the given division. n_spp gives the average species across the cells made from the given division. x gives the absolute area of a cell for the given division. y gives the same information as n_spp and is included for easy plotting. See http://www.macroeco.org/tutorial_macroeco.html for additional examples and explanation
(module (function_definition (function_name_bundle_view) function_name_bundle_view (parameters (identifier_parser) identifier_parser (identifier_token) identifier_token )parameters (block (expression_statement (assignment (identifier_bits) identifier_bits (call (attribute (identifier_token) identifier_token (identifier_split_contents) identifier_split_contents )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_bits) identifier_bits )argument_list )call (integer_3) integer_3 )comparison_operator (block (raise_statement (call (identifier_TemplateSyntaxError) identifier_TemplateSyntaxError (argument_list (binary_operator (concatenated_string (string_"'%s' takes at least two arguments") string_"'%s' takes at least two arguments" (string_" bundle and view_name") string_" bundle and view_name" )concatenated_string (subscript (identifier_bits) identifier_bits (integer_0) integer_0 )subscript )binary_operator )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_bundle) identifier_bundle (call (attribute (identifier_parser) identifier_parser (identifier_compile_filter) identifier_compile_filter )attribute (argument_list (subscript (identifier_bits) identifier_bits (integer_1) integer_1 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_viewname) identifier_viewname (call (attribute (identifier_parser) identifier_parser (identifier_compile_filter) identifier_compile_filter )attribute (argument_list (subscript (identifier_bits) identifier_bits (integer_2) integer_2 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_asvar) identifier_asvar (None) None )assignment )expression_statement (expression_statement (assignment (identifier_bits) identifier_bits (subscript (identifier_bits) identifier_bits (slice (integer_2) integer_2 (colon) colon )slice )subscript )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_bits) identifier_bits )argument_list )call (integer_2) integer_2 )comparison_operator (comparison_operator (subscript (identifier_bits) identifier_bits (unary_operator (integer_2) integer_2 )unary_operator )subscript (string_'as') string_'as' )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_asvar) identifier_asvar (subscript (identifier_bits) identifier_bits (unary_operator (integer_1) integer_1 )unary_operator )subscript )assignment )expression_statement (expression_statement (assignment (identifier_bits) identifier_bits (subscript (identifier_bits) identifier_bits (slice (colon) colon (unary_operator (integer_2) integer_2 )unary_operator )slice )subscript )assignment )expression_statement )block )if_statement (return_statement (call (identifier_ViewNode) identifier_ViewNode (argument_list (identifier_bundle) identifier_bundle (identifier_viewname) identifier_viewname (identifier_asvar) identifier_asvar )argument_list )call )return_statement )block )function_definition )module
Returns an string version of a bundle view. This is done by calling the `get_string_from_view` method of the provided bundle. This tag expects that the request object as well as the the original url_params are available in the context. Requires two arguments bundle and the name of the view you want to render. In addition, this tag also accepts the 'as xxx' syntax. Example: {% bundle_url bundle main_list as html %}
(module (function_definition (function_name___unpack_tgz) function_name___unpack_tgz (parameters (identifier_self) identifier_self (identifier_filename) identifier_filename )parameters (block (if_statement (boolean_operator (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_filename) identifier_filename (identifier_string_types) identifier_string_types )argument_list )call (call (attribute (identifier_self) identifier_self (identifier___isValidTGZ) identifier___isValidTGZ )attribute (argument_list (identifier_filename) identifier_filename )argument_list )call )boolean_operator (call (attribute (identifier_tarfile) identifier_tarfile (identifier_is_tarfile) identifier_is_tarfile )attribute (argument_list (identifier_filename) identifier_filename )argument_list )call )boolean_operator (block (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_tarfile) identifier_tarfile (identifier_open) identifier_open )attribute (argument_list (identifier_filename) identifier_filename (keyword_argument (identifier_mode) identifier_mode (string_'r:gz') string_'r:gz' )keyword_argument )argument_list )call (as_pattern_target (identifier_t) identifier_t )as_pattern_target )as_pattern )with_item )with_clause (block (for_statement (identifier_name) identifier_name (call (attribute (identifier_t) identifier_t (identifier_getnames) identifier_getnames )attribute (argument_list )argument_list )call (block (expression_statement (call (attribute (identifier_t) identifier_t (identifier_extract) identifier_extract )attribute (argument_list (identifier_name) identifier_name (attribute (identifier_self) identifier_self (identifier_plugin_abspath) identifier_plugin_abspath )attribute )argument_list )call )expression_statement )block )for_statement )block )with_statement )block (else_clause (block (raise_statement (call (identifier_TarError) identifier_TarError (argument_list (string_"Invalid Plugin Compressed File") string_"Invalid Plugin Compressed File" )argument_list )call )raise_statement )block )else_clause )if_statement )block )function_definition )module
Unpack the `tar.gz`, `tgz` compressed file format
(module (function_definition (function_name__create_cipher) function_name__create_cipher (parameters (identifier_self) identifier_self (identifier_password) identifier_password (identifier_salt) identifier_salt (identifier_IV) identifier_IV )parameters (block (import_from_statement (dotted_name (identifier_Crypto) identifier_Crypto (identifier_Protocol) identifier_Protocol (identifier_KDF) identifier_KDF )dotted_name (dotted_name (identifier_PBKDF2) identifier_PBKDF2 )dotted_name )import_from_statement (import_from_statement (dotted_name (identifier_Crypto) identifier_Crypto (identifier_Cipher) identifier_Cipher )dotted_name (dotted_name (identifier_AES) identifier_AES )dotted_name )import_from_statement (expression_statement (assignment (identifier_pw) identifier_pw (call (identifier_PBKDF2) identifier_PBKDF2 (argument_list (identifier_password) identifier_password (identifier_salt) identifier_salt (keyword_argument (identifier_dkLen) identifier_dkLen (attribute (identifier_self) identifier_self (identifier_block_size) identifier_block_size )attribute )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_AES) identifier_AES (identifier_new) identifier_new )attribute (argument_list (subscript (identifier_pw) identifier_pw (slice (colon) colon (attribute (identifier_self) identifier_self (identifier_block_size) identifier_block_size )attribute )slice )subscript (attribute (identifier_AES) identifier_AES (identifier_MODE_CFB) identifier_MODE_CFB )attribute (identifier_IV) identifier_IV )argument_list )call )return_statement )block )function_definition )module
Create the cipher object to encrypt or decrypt a payload.
(module (function_definition (function_name_reMutualReceptions) function_name_reMutualReceptions (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_planets) identifier_planets (call (identifier_copy) identifier_copy (argument_list (attribute (identifier_const) identifier_const (identifier_LIST_SEVEN_PLANETS) identifier_LIST_SEVEN_PLANETS )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_planets) identifier_planets (identifier_remove) identifier_remove )attribute (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier_id) identifier_id )attribute )argument_list )call )expression_statement (expression_statement (assignment (identifier_mrs) identifier_mrs (dictionary )dictionary )assignment )expression_statement (for_statement (identifier_ID) identifier_ID (identifier_planets) identifier_planets (block (expression_statement (assignment (identifier_mr) identifier_mr (call (attribute (attribute (identifier_self) identifier_self (identifier_dyn) identifier_dyn )attribute (identifier_reMutualReceptions) identifier_reMutualReceptions )attribute (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier_id) identifier_id )attribute (identifier_ID) identifier_ID )argument_list )call )assignment )expression_statement (if_statement (identifier_mr) identifier_mr (block (expression_statement (assignment (subscript (identifier_mrs) identifier_mrs (identifier_ID) identifier_ID )subscript (identifier_mr) identifier_mr )assignment )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_mrs) identifier_mrs )return_statement )block )function_definition )module
Returns all mutual receptions with the object and other planets, indexed by planet ID. It only includes ruler and exaltation receptions.
(module (function_definition (function_name_is_twss) function_name_is_twss (parameters (identifier_self) identifier_self (identifier_phrase) identifier_phrase )parameters (block (expression_statement (assignment (identifier_featureset) identifier_featureset (call (attribute (identifier_self) identifier_self (identifier_extract_features) identifier_extract_features )attribute (argument_list (identifier_phrase) identifier_phrase )argument_list )call )assignment )expression_statement (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_classifier) identifier_classifier )attribute (identifier_classify) identifier_classify )attribute (argument_list (identifier_featureset) identifier_featureset )argument_list )call )return_statement )block )function_definition )module
The magic function- this accepts a phrase and tells you if it classifies as an entendre
(module (function_definition (function_name__set_bounds) function_name__set_bounds (parameters (identifier_self) identifier_self (identifier_bounds) identifier_bounds )parameters (block (expression_statement (assignment (pattern_list (identifier_min_value) identifier_min_value (identifier_max_value) identifier_max_value )pattern_list (identifier_bounds) identifier_bounds )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_min_value) identifier_min_value )attribute (None) None )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_max_value) identifier_max_value )attribute (None) None )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_min_value) identifier_min_value )attribute (identifier_min_value) identifier_min_value )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_max_value) identifier_max_value )attribute (identifier_max_value) identifier_max_value )assignment )expression_statement )block )function_definition )module
Sets the boundaries for this parameter to min_value and max_value
(module (function_definition (function_name_find) function_name_find (parameters (identifier_self) identifier_self (identifier_location) identifier_location )parameters (block (try_statement (block (expression_statement (assignment (identifier_content) identifier_content (subscript (attribute (identifier_self) identifier_self (identifier_store) identifier_store )attribute (identifier_location) identifier_location )subscript )assignment )expression_statement (return_statement (call (identifier_StringIO) identifier_StringIO (argument_list (identifier_content) identifier_content )argument_list )call )return_statement )block (except_clause (block (expression_statement (assignment (identifier_reason) identifier_reason (binary_operator (string_'location "%s" not in document store') string_'location "%s" not in document store' (identifier_location) identifier_location )binary_operator )assignment )expression_statement (raise_statement (expression_list (identifier_Exception) identifier_Exception (identifier_reason) identifier_reason )expression_list )raise_statement )block )except_clause )try_statement )block )function_definition )module
Find the specified location in the store. @param location: The I{location} part of a URL. @type location: str @return: An input stream to the document. @rtype: StringIO
(module (function_definition (function_name_lock) function_name_lock (parameters (identifier_self) identifier_self )parameters (block (if_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_cache) identifier_cache )attribute (identifier_get) identifier_get )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_lock_name) identifier_lock_name )attribute )argument_list )call (block (return_statement (False) False )return_statement )block (else_clause (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_cache) identifier_cache )attribute (identifier_set) identifier_set )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_lock_name) identifier_lock_name )attribute (call (attribute (identifier_timezone) identifier_timezone (identifier_now) identifier_now )attribute (argument_list )argument_list )call (attribute (identifier_self) identifier_self (identifier_timeout) identifier_timeout )attribute )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )else_clause )if_statement )block )function_definition )module
This method sets a cache variable to mark current job as "already running".
(module (function_definition (function_name_abort_submission) function_name_abort_submission (parameters (identifier_namespace) identifier_namespace (identifier_workspace) identifier_workspace (identifier_submission_id) identifier_submission_id )parameters (block (expression_statement (assignment (identifier_uri) identifier_uri (call (attribute (string_"workspaces/{0}/{1}/submissions/{2}") string_"workspaces/{0}/{1}/submissions/{2}" (identifier_format) identifier_format )attribute (argument_list (identifier_namespace) identifier_namespace (identifier_workspace) identifier_workspace (identifier_submission_id) identifier_submission_id )argument_list )call )assignment )expression_statement (return_statement (call (identifier___delete) identifier___delete (argument_list (identifier_uri) identifier_uri )argument_list )call )return_statement )block )function_definition )module
Abort running job in a workspace. Args: namespace (str): project to which workspace belongs workspace (str): Workspace name submission_id (str): Submission's unique identifier Swagger: https://api.firecloud.org/#!/Submissions/deleteSubmission
(module (function_definition (function_name_deep_merge) function_name_deep_merge (parameters (identifier_base) identifier_base (identifier_extra) identifier_extra )parameters (block (if_statement (comparison_operator (identifier_extra) identifier_extra (None) None )comparison_operator (block (return_statement )return_statement )block )if_statement (for_statement (pattern_list (identifier_key) identifier_key (identifier_value) identifier_value )pattern_list (call (attribute (identifier_extra) identifier_extra (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (if_statement (comparison_operator (identifier_value) identifier_value (None) None )comparison_operator (block (if_statement (comparison_operator (identifier_key) identifier_key (identifier_base) identifier_base )comparison_operator (block (delete_statement (subscript (identifier_base) identifier_base (identifier_key) identifier_key )subscript )delete_statement )block )if_statement )block (elif_clause (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (call (attribute (identifier_base) identifier_base (identifier_get) identifier_get )attribute (argument_list (identifier_key) identifier_key )argument_list )call (identifier_dict) identifier_dict )argument_list )call (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (identifier_dict) identifier_dict )argument_list )call )boolean_operator (block (expression_statement (call (identifier_deep_merge) identifier_deep_merge (argument_list (subscript (identifier_base) identifier_base (identifier_key) identifier_key )subscript (identifier_value) identifier_value )argument_list )call )expression_statement )block )elif_clause (else_clause (block (expression_statement (assignment (subscript (identifier_base) identifier_base (identifier_key) identifier_key )subscript (identifier_value) identifier_value )assignment )expression_statement )block )else_clause )if_statement )block )for_statement )block )function_definition )module
Deeply merge two dictionaries, overriding existing keys in the base. :param base: The base dictionary which will be merged into. :param extra: The dictionary to merge into the base. Keys from this dictionary will take precedence.
(module (function_definition (function_name_create) function_name_create (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_steps) identifier_steps (list (tuple (attribute (identifier_self) identifier_self (identifier_create_role) identifier_create_role )attribute (tuple )tuple (dictionary )dictionary )tuple (tuple (attribute (identifier_self) identifier_self (identifier_create_vpc) identifier_create_vpc )attribute (tuple )tuple (dictionary )dictionary )tuple (tuple (attribute (identifier_self) identifier_self (identifier_create_cluster) identifier_create_cluster )attribute (tuple )tuple (dictionary )dictionary )tuple (tuple (attribute (identifier_self) identifier_self (identifier_create_node_group) identifier_create_node_group )attribute (tuple )tuple (dictionary )dictionary )tuple (tuple (attribute (identifier_self) identifier_self (identifier_create_spot_nodes) identifier_create_spot_nodes )attribute (tuple )tuple (dictionary )dictionary )tuple (tuple (attribute (identifier_self) identifier_self (identifier_create_utilities) identifier_create_utilities )attribute (tuple )tuple (dictionary )dictionary )tuple )list )assignment )expression_statement (for_statement (identifier_step) identifier_step (call (attribute (identifier_tqdm) identifier_tqdm (identifier_tqdm) identifier_tqdm )attribute (argument_list (identifier_steps) identifier_steps (keyword_argument (identifier_ncols) identifier_ncols (integer_70) integer_70 )keyword_argument )argument_list )call (block (expression_statement (assignment (pattern_list (identifier_method) identifier_method (identifier_args) identifier_args (identifier_kwargs) identifier_kwargs )pattern_list (identifier_step) identifier_step )assignment )expression_statement (expression_statement (call (identifier_method) identifier_method (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Deploy a cluster on Amazon's EKS Service configured for Jupyterhub Deployments.
(module (function_definition (function_name_get_tree) function_name_get_tree (parameters (identifier_self) identifier_self (identifier_process_name) identifier_process_name )parameters (block (for_statement (pattern_list (identifier_tree_name) identifier_tree_name (identifier_tree) identifier_tree )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_trees) identifier_trees )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (if_statement (comparison_operator (identifier_process_name) identifier_process_name (identifier_tree) identifier_tree )comparison_operator (block (return_statement (identifier_tree) identifier_tree )return_statement )block )if_statement )block )for_statement )block )function_definition )module
return tree that is managing time-periods for given process
(module (function_definition (function_name_get_fw_policy) function_name_get_fw_policy (parameters (identifier_self) identifier_self (identifier_policy_id) identifier_policy_id )parameters (block (expression_statement (assignment (identifier_policy) identifier_policy (None) None )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_policy) identifier_policy (call (attribute (attribute (identifier_self) identifier_self (identifier_neutronclient) identifier_neutronclient )attribute (identifier_show_firewall_policy) identifier_show_firewall_policy )attribute (argument_list (identifier_policy_id) identifier_policy_id )argument_list )call )assignment )expression_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_exc) identifier_exc )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_error) identifier_error )attribute (argument_list (concatenated_string (string_"Failed to get firewall plcy for id %(id)s ") string_"Failed to get firewall plcy for id %(id)s " (string_"Exc %(exc)s") string_"Exc %(exc)s" )concatenated_string (dictionary (pair (string_'id') string_'id' (identifier_policy_id) identifier_policy_id )pair (pair (string_'exc') string_'exc' (call (identifier_str) identifier_str (argument_list (identifier_exc) identifier_exc )argument_list )call )pair )dictionary )argument_list )call )expression_statement )block )except_clause )try_statement (return_statement (identifier_policy) identifier_policy )return_statement )block )function_definition )module
Return the firewall policy, given its ID.
(module (function_definition (function_name_in_file) function_name_in_file (parameters (identifier_self) identifier_self (typed_parameter (identifier_fn) identifier_fn (type (identifier_str) identifier_str )type )typed_parameter )parameters (type (generic_type (identifier_Iterator) identifier_Iterator (type_parameter (type (identifier_Statement) identifier_Statement )type )type_parameter )generic_type )type (block (expression_statement (yield (call (attribute (attribute (identifier_self) identifier_self (identifier___file_to_statements) identifier___file_to_statements )attribute (identifier_get) identifier_get )attribute (argument_list (identifier_fn) identifier_fn (list )list )argument_list )call )yield )expression_statement )block )function_definition )module
Returns an iterator over all of the statements belonging to a file.
(module (function_definition (function_name_send_response) function_name_send_response (parameters (identifier_self) identifier_self (identifier_code) identifier_code (default_parameter (identifier_message) identifier_message (None) None )default_parameter )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log_request) identifier_log_request )attribute (argument_list (identifier_code) identifier_code )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_send_response_only) identifier_send_response_only )attribute (argument_list (identifier_code) identifier_code (identifier_message) identifier_message )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_send_header) identifier_send_header )attribute (argument_list (string_'Server') string_'Server' (call (attribute (identifier_self) identifier_self (identifier_version_string) identifier_version_string )attribute (argument_list )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_send_header) identifier_send_header )attribute (argument_list (string_'Date') string_'Date' (call (attribute (identifier_self) identifier_self (identifier_date_time_string) identifier_date_time_string )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Add the response header to the headers buffer and log the response code. Also send two standard headers with the server software version and the current date.
(module (function_definition (function_name_create_driver) function_name_create_driver (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_driver_type) identifier_driver_type (call (attribute (attribute (identifier_self) identifier_self (identifier_config) identifier_config )attribute (identifier_get) identifier_get )attribute (argument_list (string_'Driver') string_'Driver' (string_'type') string_'type' )argument_list )call )assignment )expression_statement (try_statement (block (if_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_config) identifier_config )attribute (identifier_getboolean_optional) identifier_getboolean_optional )attribute (argument_list (string_'Server') string_'Server' (string_'enabled') string_'enabled' )argument_list )call (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_info) identifier_info )attribute (argument_list (string_"Creating remote driver (type = %s)") string_"Creating remote driver (type = %s)" (identifier_driver_type) identifier_driver_type )argument_list )call )expression_statement (expression_statement (assignment (identifier_driver) identifier_driver (call (attribute (identifier_self) identifier_self (identifier__create_remote_driver) identifier__create_remote_driver )attribute (argument_list )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_info) identifier_info )attribute (argument_list (string_"Creating local driver (type = %s)") string_"Creating local driver (type = %s)" (identifier_driver_type) identifier_driver_type )argument_list )call )expression_statement (expression_statement (assignment (identifier_driver) identifier_driver (call (attribute (identifier_self) identifier_self (identifier__create_local_driver) identifier__create_local_driver )attribute (argument_list )argument_list )call )assignment )expression_statement )block )else_clause )if_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_exc) identifier_exc )as_pattern_target )as_pattern (block (expression_statement (assignment (identifier_error_message) identifier_error_message (call (identifier_get_error_message_from_exception) identifier_get_error_message_from_exception (argument_list (identifier_exc) identifier_exc )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_error) identifier_error )attribute (argument_list (string_"%s driver can not be launched: %s") string_"%s driver can not be launched: %s" (call (attribute (identifier_driver_type) identifier_driver_type (identifier_capitalize) identifier_capitalize )attribute (argument_list )argument_list )call (identifier_error_message) identifier_error_message )argument_list )call )expression_statement (raise_statement )raise_statement )block )except_clause )try_statement (return_statement (identifier_driver) identifier_driver )return_statement )block )function_definition )module
Create a selenium driver using specified config properties :returns: a new selenium driver :rtype: selenium.webdriver.remote.webdriver.WebDriver
(module (function_definition (function_name__tp__get_typed_properties) function_name__tp__get_typed_properties (parameters (identifier_self) identifier_self )parameters (block (try_statement (block (return_statement (call (identifier_tuple) identifier_tuple (generator_expression (call (identifier_getattr) identifier_getattr (argument_list (identifier_self) identifier_self (identifier_p) identifier_p )argument_list )call (for_in_clause (identifier_p) identifier_p (attribute (identifier_self) identifier_self (identifier__tp__typed_properties) identifier__tp__typed_properties )attribute )for_in_clause )generator_expression )call )return_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (raise_statement (identifier_NotImplementedError) identifier_NotImplementedError )raise_statement )block )except_clause )try_statement )block )function_definition )module
Return a tuple of typed attrs that can be used for comparisons. Raises: NotImplementedError: Raised if this class was mixed into a class that was not created by _AnnotatedObjectMeta.
(module (function_definition (function_name__traverse_list) function_name__traverse_list (parameters (identifier_self) identifier_self (identifier_input_list) identifier_input_list (identifier_resolution_data) identifier_resolution_data (identifier_resolver_method) identifier_resolver_method )parameters (block (for_statement (pattern_list (identifier_index) identifier_index (identifier_value) identifier_value )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_input_list) identifier_input_list )argument_list )call (block (expression_statement (assignment (subscript (identifier_input_list) identifier_input_list (identifier_index) identifier_index )subscript (call (attribute (identifier_self) identifier_self (identifier__traverse) identifier__traverse )attribute (argument_list (identifier_value) identifier_value (identifier_resolution_data) identifier_resolution_data (identifier_resolver_method) identifier_resolver_method )argument_list )call )assignment )expression_statement )block )for_statement (return_statement (identifier_input_list) identifier_input_list )return_statement )block )function_definition )module
Traverse a list to resolve intrinsic functions on every element :param input_list: List of input :param resolution_data: Data that the `resolver_method` needs to operate :param resolver_method: Method that can actually resolve an intrinsic function, if it detects one :return: Modified list with intrinsic functions resolved
(module (function_definition (function_name_lex) function_name_lex (parameters (identifier_filename) identifier_filename )parameters (block (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_io) identifier_io (identifier_open) identifier_open )attribute (argument_list (identifier_filename) identifier_filename (keyword_argument (identifier_mode) identifier_mode (string_'r') string_'r' )keyword_argument (keyword_argument (identifier_encoding) identifier_encoding (string_'utf-8') string_'utf-8' )keyword_argument )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_it) identifier_it (call (identifier__lex_file_object) identifier__lex_file_object (argument_list (identifier_f) identifier_f )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_it) identifier_it (call (identifier__balance_braces) identifier__balance_braces (argument_list (identifier_it) identifier_it (identifier_filename) identifier_filename )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_token) identifier_token (identifier_line) identifier_line (identifier_quoted) identifier_quoted )pattern_list (identifier_it) identifier_it (block (expression_statement (yield (tuple (identifier_token) identifier_token (identifier_line) identifier_line (identifier_quoted) identifier_quoted )tuple )yield )expression_statement )block )for_statement )block )with_statement )block )function_definition )module
Generates tokens from an nginx config file
(module (function_definition (function_name_set_double_stack) function_name_set_double_stack (parameters (identifier_socket_obj) identifier_socket_obj (default_parameter (identifier_double_stack) identifier_double_stack (True) True )default_parameter )parameters (block (try_statement (block (expression_statement (assignment (identifier_opt_ipv6_only) identifier_opt_ipv6_only (attribute (identifier_socket) identifier_socket (identifier_IPV6_V6ONLY) identifier_IPV6_V6ONLY )attribute )assignment )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (if_statement (comparison_operator (attribute (identifier_os) identifier_os (identifier_name) identifier_name )attribute (string_"nt") string_"nt" )comparison_operator (block (expression_statement (assignment (identifier_opt_ipv6_only) identifier_opt_ipv6_only (integer_27) integer_27 )assignment )expression_statement )block (elif_clause (comparison_operator (call (attribute (identifier_platform) identifier_platform (identifier_system) identifier_system )attribute (argument_list )argument_list )call (string_"Linux") string_"Linux" )comparison_operator (block (expression_statement (assignment (identifier_opt_ipv6_only) identifier_opt_ipv6_only (integer_26) integer_26 )assignment )expression_statement )block )elif_clause (else_clause (block (raise_statement )raise_statement )block )else_clause )if_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_socket_obj) identifier_socket_obj (identifier_setsockopt) identifier_setsockopt )attribute (argument_list (call (identifier_ipproto_ipv6) identifier_ipproto_ipv6 (argument_list )argument_list )call (identifier_opt_ipv6_only) identifier_opt_ipv6_only (call (identifier_int) identifier_int (argument_list (not_operator (identifier_double_stack) identifier_double_stack )not_operator )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Sets up the IPv6 double stack according to the operating system :param socket_obj: A socket object :param double_stack: If True, use the double stack, else only support IPv6 :raise AttributeError: Python or system doesn't support V6 :raise socket.error: Error setting up the double stack value
(module (function_definition (function_name__parse_scram_response) function_name__parse_scram_response (parameters (identifier_response) identifier_response )parameters (block (return_statement (call (identifier_dict) identifier_dict (generator_expression (call (attribute (identifier_item) identifier_item (identifier_split) identifier_split )attribute (argument_list (string_b"=") string_b"=" (integer_1) integer_1 )argument_list )call (for_in_clause (identifier_item) identifier_item (call (attribute (identifier_response) identifier_response (identifier_split) identifier_split )attribute (argument_list (string_b",") string_b"," )argument_list )call )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Split a scram response into key, value pairs.
(module (function_definition (function_name_deprecation_warning) function_name_deprecation_warning (parameters (identifier_func) identifier_func (identifier_name) identifier_name )parameters (block (decorated_definition (decorator (call (identifier_wraps) identifier_wraps (argument_list (identifier_func) identifier_func )argument_list )call )decorator (function_definition (function_name_caller) function_name_caller (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_logger) identifier_logger (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 (assignment (identifier_instance) identifier_instance (call (identifier_func) identifier_func (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_warning) identifier_warning )attribute (argument_list (binary_operator (call (attribute (string_"Distribution `chaospy.{}` has been renamed to ") string_"Distribution `chaospy.{}` has been renamed to " (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name )argument_list )call (call (attribute (string_"`chaospy.{}` and will be deprecated next release.") string_"`chaospy.{}` and will be deprecated next release." (identifier_format) identifier_format )attribute (argument_list (attribute (attribute (identifier_instance) identifier_instance (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute )argument_list )call )binary_operator )argument_list )call )expression_statement (return_statement (identifier_instance) identifier_instance )return_statement )block )function_definition )decorated_definition (return_statement (identifier_caller) identifier_caller )return_statement )block )function_definition )module
Add a deprecation warning do each distribution.
(module (function_definition (function_name__put_overlay) function_name__put_overlay (parameters (identifier_self) identifier_self (identifier_overlay_name) identifier_overlay_name (identifier_overlay) identifier_overlay )parameters (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_overlay) identifier_overlay (identifier_dict) identifier_dict )argument_list )call )not_operator (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (string_"Overlay must be dict") string_"Overlay must be dict" )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (call (identifier_set) identifier_set (argument_list (call (attribute (identifier_self) identifier_self (identifier__identifiers) identifier__identifiers )attribute (argument_list )argument_list )call )argument_list )call (call (identifier_set) identifier_set (argument_list (call (attribute (identifier_overlay) identifier_overlay (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call )argument_list )call )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"Overlay keys must be dataset identifiers") string_"Overlay keys must be dataset identifiers" )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__storage_broker) identifier__storage_broker )attribute (identifier_put_overlay) identifier_put_overlay )attribute (argument_list (identifier_overlay_name) identifier_overlay_name (identifier_overlay) identifier_overlay )argument_list )call )expression_statement )block )function_definition )module
Store overlay so that it is accessible by the given name. :param overlay_name: name of the overlay :param overlay: overlay must be a dictionary where the keys are identifiers in the dataset :raises: TypeError if the overlay is not a dictionary, ValueError if identifiers in overlay and dataset do not match
(module (function_definition (function_name_enqueue) function_name_enqueue (parameters (identifier_self) identifier_self (identifier_item_type) identifier_item_type (identifier_item) identifier_item )parameters (block (with_statement (with_clause (with_item (attribute (identifier_self) identifier_self (identifier_enlock) identifier_enlock )attribute )with_item )with_clause (block (expression_statement (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_queue) identifier_queue )attribute (identifier_item_type) identifier_item_type )subscript (identifier_append) identifier_append )attribute (argument_list (identifier_item) identifier_item )argument_list )call )expression_statement )block )with_statement )block )function_definition )module
Queue a new data item, make item iterable
(module (function_definition (function_name_db) function_name_db (parameters (identifier_self) identifier_self (default_parameter (identifier_connection_string) identifier_connection_string (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_connection_string) identifier_connection_string (boolean_operator (identifier_connection_string) identifier_connection_string (subscript (attribute (identifier_self) identifier_self (identifier_settings) identifier_settings )attribute (string_"db") string_"db" )subscript )boolean_operator )assignment )expression_statement (if_statement (not_operator (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_self) identifier_self (string_"_db_conns") string_"_db_conns" )argument_list )call )not_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__db_conns) identifier__db_conns )attribute (dictionary )dictionary )assignment )expression_statement )block )if_statement (if_statement (not_operator (comparison_operator (identifier_connection_string) identifier_connection_string (attribute (identifier_self) identifier_self (identifier__db_conns) identifier__db_conns )attribute )comparison_operator )not_operator (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__db_conns) identifier__db_conns )attribute (identifier_connection_string) identifier_connection_string )subscript (call (attribute (attribute (identifier_oz) identifier_oz (identifier_sqlalchemy) identifier_sqlalchemy )attribute (identifier_session) identifier_session )attribute (argument_list (keyword_argument (identifier_connection_string) identifier_connection_string (identifier_connection_string) identifier_connection_string )keyword_argument )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (subscript (attribute (identifier_self) identifier_self (identifier__db_conns) identifier__db_conns )attribute (identifier_connection_string) identifier_connection_string )subscript )return_statement )block )function_definition )module
Gets the SQLALchemy session for this request
(module (function_definition (function_name_print_statistics) function_name_print_statistics (parameters (identifier_self) identifier_self )parameters (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_"Q1 =") string_"Q1 =" (attribute (identifier_self) identifier_self (identifier_Q1) identifier_Q1 )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_"Q2 =") string_"Q2 =" (attribute (identifier_self) identifier_self (identifier_Q2) identifier_Q2 )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_"cR =") string_"cR =" (attribute (identifier_self) identifier_self (identifier_cR) identifier_cR )attribute )argument_list )call )expression_statement )block )function_definition )module
Prints out the Q1, Q2, and cR statistics for the variogram fit. NOTE that ideally Q1 is close to zero, Q2 is close to 1, and cR is as small as possible.
(module (function_definition (function_name_determine_struct_tree_subtype) function_name_determine_struct_tree_subtype (parameters (identifier_self) identifier_self (identifier_data_type) identifier_data_type (identifier_obj) identifier_obj )parameters (block (if_statement (comparison_operator (string_'.tag') string_'.tag' (identifier_obj) identifier_obj )comparison_operator (block (raise_statement (call (attribute (identifier_bv) identifier_bv (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (string_"missing '.tag' key") string_"missing '.tag' key" )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (subscript (identifier_obj) identifier_obj (string_'.tag') string_'.tag' )subscript (attribute (identifier_six) identifier_six (identifier_string_types) identifier_string_types )attribute )argument_list )call )not_operator (block (raise_statement (call (attribute (identifier_bv) identifier_bv (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (binary_operator (string_'expected string, got %s') string_'expected string, got %s' (call (attribute (identifier_bv) identifier_bv (identifier_generic_type_name) identifier_generic_type_name )attribute (argument_list (subscript (identifier_obj) identifier_obj (string_'.tag') string_'.tag' )subscript )argument_list )call )binary_operator (keyword_argument (identifier_parent) identifier_parent (string_'.tag') string_'.tag' )keyword_argument )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_full_tags_tuple) identifier_full_tags_tuple (tuple (subscript (identifier_obj) identifier_obj (string_'.tag') string_'.tag' )subscript )tuple )assignment )expression_statement (if_statement (comparison_operator (identifier_full_tags_tuple) identifier_full_tags_tuple (attribute (attribute (identifier_data_type) identifier_data_type (identifier_definition) identifier_definition )attribute (identifier__tag_to_subtype_) identifier__tag_to_subtype_ )attribute )comparison_operator (block (expression_statement (assignment (identifier_subtype) identifier_subtype (subscript (attribute (attribute (identifier_data_type) identifier_data_type (identifier_definition) identifier_definition )attribute (identifier__tag_to_subtype_) identifier__tag_to_subtype_ )attribute (identifier_full_tags_tuple) identifier_full_tags_tuple )subscript )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_subtype) identifier_subtype (attribute (identifier_bv) identifier_bv (identifier_StructTree) identifier_StructTree )attribute )argument_list )call (block (raise_statement (call (attribute (identifier_bv) identifier_bv (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (binary_operator (string_"tag '%s' refers to non-leaf subtype") string_"tag '%s' refers to non-leaf subtype" (parenthesized_expression (call (attribute (string_'.') string_'.' (identifier_join) identifier_join )attribute (argument_list (identifier_full_tags_tuple) identifier_full_tags_tuple )argument_list )call )parenthesized_expression )binary_operator )argument_list )call )raise_statement )block )if_statement (return_statement (identifier_subtype) identifier_subtype )return_statement )block (else_clause (block (if_statement (attribute (identifier_self) identifier_self (identifier_strict) identifier_strict )attribute (block (raise_statement (call (attribute (identifier_bv) identifier_bv (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (binary_operator (string_"unknown subtype '%s'") string_"unknown subtype '%s'" (call (attribute (string_'.') string_'.' (identifier_join) identifier_join )attribute (argument_list (identifier_full_tags_tuple) identifier_full_tags_tuple )argument_list )call )binary_operator )argument_list )call )raise_statement )block (else_clause (block (if_statement (attribute (attribute (identifier_data_type) identifier_data_type (identifier_definition) identifier_definition )attribute (identifier__is_catch_all_) identifier__is_catch_all_ )attribute (block (return_statement (identifier_data_type) identifier_data_type )return_statement )block (else_clause (block (raise_statement (call (attribute (identifier_bv) identifier_bv (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (binary_operator (string_"unknown subtype '%s' and '%s' is not a catch-all") string_"unknown subtype '%s' and '%s' is not a catch-all" (tuple (call (attribute (string_'.') string_'.' (identifier_join) identifier_join )attribute (argument_list (identifier_full_tags_tuple) identifier_full_tags_tuple )argument_list )call (attribute (attribute (identifier_data_type) identifier_data_type (identifier_definition) identifier_definition )attribute (identifier___name__) identifier___name__ )attribute )tuple )binary_operator )argument_list )call )raise_statement )block )else_clause )if_statement )block )else_clause )if_statement )block )else_clause )if_statement )block )function_definition )module
Searches through the JSON-object-compatible dict using the data type definition to determine which of the enumerated subtypes `obj` is.
(module (function_definition (function_name_l2_regression_loss) function_name_l2_regression_loss (parameters (identifier_y) identifier_y (identifier_target) identifier_target (default_parameter (identifier_name) identifier_name (None) None )default_parameter )parameters (block (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_tf) identifier_tf (identifier_name_scope) identifier_name_scope )attribute (argument_list (identifier_name) identifier_name (string_'l2_regression') string_'l2_regression' (list (identifier_y) identifier_y (identifier_target) identifier_target )list )argument_list )call (as_pattern_target (identifier_scope) identifier_scope )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_y) identifier_y (call (attribute (identifier_tf) identifier_tf (identifier_convert_to_tensor) identifier_convert_to_tensor )attribute (argument_list (identifier_y) identifier_y (keyword_argument (identifier_name) identifier_name (string_'y') string_'y' )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_target) identifier_target (call (attribute (identifier_tf) identifier_tf (identifier_convert_to_tensor) identifier_convert_to_tensor )attribute (argument_list (identifier_target) identifier_target (keyword_argument (identifier_name) identifier_name (string_'target') string_'target' )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_tf) identifier_tf (identifier_sqrt) identifier_sqrt )attribute (argument_list (call (identifier_l2_regression_sq_loss) identifier_l2_regression_sq_loss (argument_list (identifier_y) identifier_y (identifier_target) identifier_target (keyword_argument (identifier_name) identifier_name (identifier_scope) identifier_scope )keyword_argument )argument_list )call )argument_list )call )return_statement )block )with_statement )block )function_definition )module
Calculates the square root of the SSE between y and target. Args: y: the calculated values. target: the desired values. name: the name for this op, defaults to l2_regression Returns: A tensorflow op.
(module (function_definition (function_name__readuint) function_name__readuint (parameters (identifier_self) identifier_self (identifier_length) identifier_length (identifier_start) identifier_start )parameters (block (if_statement (not_operator (identifier_length) identifier_length )not_operator (block (raise_statement (call (identifier_InterpretError) identifier_InterpretError (argument_list (concatenated_string (string_"Cannot interpret a zero length bitstring ") string_"Cannot interpret a zero length bitstring " (string_"as an integer.") string_"as an integer." )concatenated_string )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_offset) identifier_offset (attribute (identifier_self) identifier_self (identifier__offset) identifier__offset )attribute )assignment )expression_statement (expression_statement (assignment (identifier_startbyte) identifier_startbyte (binary_operator (parenthesized_expression (binary_operator (identifier_start) identifier_start (identifier_offset) identifier_offset )binary_operator )parenthesized_expression (integer_8) integer_8 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_endbyte) identifier_endbyte (binary_operator (parenthesized_expression (binary_operator (binary_operator (binary_operator (identifier_start) identifier_start (identifier_offset) identifier_offset )binary_operator (identifier_length) identifier_length )binary_operator (integer_1) integer_1 )binary_operator )parenthesized_expression (integer_8) integer_8 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_b) identifier_b (call (attribute (identifier_binascii) identifier_binascii (identifier_hexlify) identifier_hexlify )attribute (argument_list (call (identifier_bytes) identifier_bytes (argument_list (call (attribute (attribute (identifier_self) identifier_self (identifier__datastore) identifier__datastore )attribute (identifier_getbyteslice) identifier_getbyteslice )attribute (argument_list (identifier_startbyte) identifier_startbyte (binary_operator (identifier_endbyte) identifier_endbyte (integer_1) integer_1 )binary_operator )argument_list )call )argument_list )call )argument_list )call )assignment )expression_statement (assert_statement (identifier_b) identifier_b )assert_statement (expression_statement (assignment (identifier_i) identifier_i (call (identifier_int) identifier_int (argument_list (identifier_b) identifier_b (integer_16) integer_16 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_final_bits) identifier_final_bits (binary_operator (integer_8) integer_8 (parenthesized_expression (binary_operator (parenthesized_expression (binary_operator (binary_operator (identifier_start) identifier_start (identifier_offset) identifier_offset )binary_operator (identifier_length) identifier_length )binary_operator )parenthesized_expression (integer_8) integer_8 )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement (if_statement (comparison_operator (identifier_final_bits) identifier_final_bits (integer_8) integer_8 )comparison_operator (block (expression_statement (augmented_assignment (identifier_i) identifier_i (identifier_final_bits) identifier_final_bits )augmented_assignment )expression_statement )block )if_statement (expression_statement (augmented_assignment (identifier_i) identifier_i (binary_operator (parenthesized_expression (binary_operator (integer_1) integer_1 (identifier_length) identifier_length )binary_operator )parenthesized_expression (integer_1) integer_1 )binary_operator )augmented_assignment )expression_statement (return_statement (identifier_i) identifier_i )return_statement )block )function_definition )module
Read bits and interpret as an unsigned int.
(module (function_definition (function_name_stream) function_name_stream (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier__stream) identifier__stream )attribute (None) None )comparison_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__stream) identifier__stream )attribute (call (attribute (identifier_tempfile) identifier_tempfile (identifier_NamedTemporaryFile) identifier_NamedTemporaryFile )attribute (argument_list (keyword_argument (identifier_delete) identifier_delete (False) False )keyword_argument )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__stream) identifier__stream )attribute (identifier_write) identifier_write )attribute (argument_list (call (attribute (call (attribute (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (identifier_open) identifier_open )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_filename) identifier_filename )attribute (keyword_argument (identifier_view) identifier_view (string_'data') string_'data' )keyword_argument )argument_list )call (identifier_read) identifier_read )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block (except_clause (block (pass_statement )pass_statement )block )except_clause )try_statement )block )if_statement (return_statement (attribute (identifier_self) identifier_self (identifier__stream) identifier__stream )attribute )return_statement )block )function_definition )module
the stream to write the log content too. @return:
(module (function_definition (function_name_delete_host_from_segment) function_name_delete_host_from_segment (parameters (identifier_ipaddress) identifier_ipaddress (identifier_networkaddress) identifier_networkaddress (identifier_auth) identifier_auth (identifier_url) identifier_url )parameters (block (expression_statement (assignment (identifier_host_id) identifier_host_id (call (identifier_get_host_id) identifier_get_host_id (argument_list (identifier_ipaddress) identifier_ipaddress (identifier_networkaddress) identifier_networkaddress (identifier_auth) identifier_auth (identifier_url) identifier_url )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_remove_scope_ip) identifier_remove_scope_ip (argument_list (identifier_host_id) identifier_host_id (attribute (identifier_auth) identifier_auth (identifier_creds) identifier_creds )attribute (attribute (identifier_auth) identifier_auth (identifier_url) identifier_url )attribute )argument_list )call )expression_statement )block )function_definition )module
Function to abstract
(module (function_definition (function_name_intersect_regions) function_name_intersect_regions (parameters (identifier_flist) identifier_flist )parameters (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_flist) identifier_flist )argument_list )call (integer_2) integer_2 )comparison_operator (block (raise_statement (call (identifier_Exception) identifier_Exception (argument_list (string_"Require at least two regions to perform intersection") string_"Require at least two regions to perform intersection" )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_a) identifier_a (call (attribute (identifier_Region) identifier_Region (identifier_load) identifier_load )attribute (argument_list (subscript (identifier_flist) identifier_flist (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement (for_statement (identifier_b) identifier_b (list_comprehension (call (attribute (identifier_Region) identifier_Region (identifier_load) identifier_load )attribute (argument_list (identifier_f) identifier_f )argument_list )call (for_in_clause (identifier_f) identifier_f (subscript (identifier_flist) identifier_flist (slice (integer_1) integer_1 (colon) colon )slice )subscript )for_in_clause )list_comprehension (block (expression_statement (call (attribute (identifier_a) identifier_a (identifier_intersect) identifier_intersect )attribute (argument_list (identifier_b) identifier_b )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_a) identifier_a )return_statement )block )function_definition )module
Construct a region which is the intersection of all regions described in the given list of file names. Parameters ---------- flist : list A list of region filenames. Returns ------- region : :class:`AegeanTools.regions.Region` The intersection of all regions, possibly empty.
(module (function_definition (function_name_set_property) function_name_set_property (parameters (identifier_self) identifier_self (identifier_name) identifier_name (identifier_value) identifier_value )parameters (block (expression_statement (assignment (identifier_typeof) identifier_typeof (call (identifier_type) identifier_type (argument_list (call (attribute (identifier_self) identifier_self (identifier_get_property) identifier_get_property )attribute (argument_list (identifier_name) identifier_name )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__interface) identifier__interface )attribute (identifier_SetProperty) identifier_SetProperty )attribute (argument_list (identifier_name) identifier_name (call (identifier_translate_to_dbus_type) identifier_translate_to_dbus_type (argument_list (identifier_typeof) identifier_typeof (identifier_value) identifier_value )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Helper to set a property value by name, translating to correct dbus type See also :py:meth:`get_property` :param str name: The property name in the object's dictionary whose value shall be set. :param value: Properties new value to be assigned. :return: :raises KeyError: if the property key is not found in the object's dictionary :raises dbus.Exception: org.bluez.Error.DoesNotExist :raises dbus.Exception: org.bluez.Error.InvalidArguments
(module (function_definition (function_name_process_like) function_name_process_like (parameters (identifier_proc) identifier_proc )parameters (block (expression_statement (assignment (identifier_newproc) identifier_newproc (call (attribute (identifier_copy) identifier_copy (identifier_deepcopy) identifier_deepcopy )attribute (argument_list (identifier_proc) identifier_proc )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_newproc) identifier_newproc (identifier_creation_date) identifier_creation_date )attribute (call (attribute (identifier_time) identifier_time (identifier_strftime) identifier_strftime )attribute (argument_list (string_"%a, %d %b %Y %H:%M:%S %z") string_"%a, %d %b %Y %H:%M:%S %z" (call (attribute (identifier_time) identifier_time (identifier_localtime) identifier_localtime )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (identifier_newproc) identifier_newproc )return_statement )block )function_definition )module
Make an exact clone of a process, including state and all subprocesses. The creation date is updated. :param proc: process :type proc: :class:`~climlab.process.process.Process` :return: new process identical to the given process :rtype: :class:`~climlab.process.process.Process` :Example: :: >>> import climlab >>> from climlab.process.process import process_like >>> model = climlab.EBM() >>> model.subprocess.keys() ['diffusion', 'LW', 'albedo', 'insolation'] >>> albedo = model.subprocess['albedo'] >>> albedo_copy = process_like(albedo) >>> albedo.creation_date 'Thu, 24 Mar 2016 01:32:25 +0000' >>> albedo_copy.creation_date 'Thu, 24 Mar 2016 01:33:29 +0000'
(module (function_definition (function_name_add_string_pairs_from_button_element) function_name_add_string_pairs_from_button_element (parameters (identifier_xib_file) identifier_xib_file (identifier_results) identifier_results (identifier_button) identifier_button (identifier_special_ui_components_prefix) identifier_special_ui_components_prefix )parameters (block (expression_statement (assignment (identifier_button_entry_comment) identifier_button_entry_comment (call (identifier_extract_element_internationalized_comment) identifier_extract_element_internationalized_comment (argument_list (identifier_button) identifier_button )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_button_entry_comment) identifier_button_entry_comment (None) None )comparison_operator (block (return_statement )return_statement )block )if_statement (for_statement (identifier_state) identifier_state (call (attribute (identifier_button) identifier_button (identifier_getElementsByTagName) identifier_getElementsByTagName )attribute (argument_list (string_'state') string_'state' )argument_list )call (block (expression_statement (assignment (identifier_state_name) identifier_state_name (attribute (subscript (attribute (identifier_state) identifier_state (identifier_attributes) identifier_attributes )attribute (string_'key') string_'key' )subscript (identifier_value) identifier_value )attribute )assignment )expression_statement (expression_statement (assignment (identifier_state_entry_comment) identifier_state_entry_comment (binary_operator (binary_operator (binary_operator (identifier_button_entry_comment) identifier_button_entry_comment (string_" - ") string_" - " )binary_operator (identifier_state_name) identifier_state_name )binary_operator (string_" state of button") string_" state of button" )binary_operator )assignment )expression_statement (if_statement (not_operator (call (identifier_add_string_pairs_from_attributed_ui_element) identifier_add_string_pairs_from_attributed_ui_element (argument_list (identifier_results) identifier_results (identifier_state) identifier_state (identifier_state_entry_comment) identifier_state_entry_comment )argument_list )call )not_operator (block (try_statement (block (expression_statement (assignment (identifier_button_entry_key) identifier_button_entry_key (attribute (subscript (attribute (identifier_state) identifier_state (identifier_attributes) identifier_attributes )attribute (string_'title') string_'title' )subscript (identifier_value) identifier_value )attribute )assignment )expression_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (try_statement (block (expression_statement (assignment (identifier_button_entry_key) identifier_button_entry_key (attribute (attribute (subscript (call (attribute (identifier_state) identifier_state (identifier_getElementsByTagName) identifier_getElementsByTagName )attribute (argument_list (string_'string') string_'string' )argument_list )call (integer_0) integer_0 )subscript (identifier_firstChild) identifier_firstChild )attribute (identifier_nodeValue) identifier_nodeValue )attribute )assignment )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (continue_statement )continue_statement )block )except_clause )try_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_results) identifier_results (identifier_append) identifier_append )attribute (argument_list (tuple (identifier_button_entry_key) identifier_button_entry_key (identifier_state_entry_comment) identifier_state_entry_comment )tuple )argument_list )call )expression_statement )block )if_statement )block )for_statement (expression_statement (call (identifier_warn_if_element_not_of_class) identifier_warn_if_element_not_of_class (argument_list (identifier_button) identifier_button (string_'Button') string_'Button' (identifier_special_ui_components_prefix) identifier_special_ui_components_prefix )argument_list )call )expression_statement )block )function_definition )module
Adds strings pairs from a button xib element. Args: xib_file (str): Path to the xib file. results (list): The list to add the results to. button(element): The button element from the xib, to extract the string pairs from. special_ui_components_prefix(str): A custom prefix for internationalize component to allow (default is only JT)
(module (function_definition (function_name_set_role_config_groups) function_name_set_role_config_groups (parameters (identifier_self) identifier_self (identifier_role_config_group_refs) identifier_role_config_group_refs )parameters (block (expression_statement (assignment (identifier_update) identifier_update (call (attribute (identifier_copy) identifier_copy (identifier_copy) identifier_copy )attribute (argument_list (identifier_self) identifier_self )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_update) identifier_update (identifier_roleConfigGroupRefs) identifier_roleConfigGroupRefs )attribute (identifier_role_config_group_refs) identifier_role_config_group_refs )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__do_update) identifier__do_update )attribute (argument_list (identifier_update) identifier_update )argument_list )call )return_statement )block )function_definition )module
Updates the role config groups in a host template. @param role_config_group_refs: List of role config group refs. @return: An ApiHostTemplate object.
(module (function_definition (function_name_load_global_conf) function_name_load_global_conf (parameters (identifier_cls) identifier_cls (identifier_global_configuration) identifier_global_configuration )parameters (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_"Propagate global parameter for %s:") string_"Propagate global parameter for %s:" (identifier_cls) identifier_cls )argument_list )call )expression_statement (for_statement (pattern_list (identifier_prop) identifier_prop (identifier_entry) identifier_entry )pattern_list (call (attribute (attribute (identifier_global_configuration) identifier_global_configuration (identifier_properties) identifier_properties )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (if_statement (boolean_operator (not_operator (attribute (identifier_entry) identifier_entry (identifier_managed) identifier_managed )attribute )not_operator (not_operator (call (identifier_getattr) identifier_getattr (argument_list (identifier_entry) identifier_entry (string_'class_inherit') string_'class_inherit' )argument_list )call )not_operator )boolean_operator (block (continue_statement )continue_statement )block )if_statement (for_statement (tuple_pattern (identifier_cls_dest) identifier_cls_dest (identifier_change_name) identifier_change_name )tuple_pattern (attribute (identifier_entry) identifier_entry (identifier_class_inherit) identifier_class_inherit )attribute (block (if_statement (comparison_operator (identifier_cls_dest) identifier_cls_dest (identifier_cls) identifier_cls )comparison_operator (block (expression_statement (assignment (identifier_value) identifier_value (call (identifier_getattr) identifier_getattr (argument_list (identifier_global_configuration) identifier_global_configuration (identifier_prop) identifier_prop )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_"- global parameter %s=%s -> %s=%s") string_"- global parameter %s=%s -> %s=%s" (identifier_prop) identifier_prop (call (identifier_getattr) identifier_getattr (argument_list (identifier_global_configuration) identifier_global_configuration (identifier_prop) identifier_prop )argument_list )call (identifier_change_name) identifier_change_name (identifier_value) identifier_value )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_change_name) identifier_change_name (None) None )comparison_operator (block (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_cls) identifier_cls (identifier_prop) identifier_prop (identifier_value) identifier_value )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_cls) identifier_cls (identifier_change_name) identifier_change_name (identifier_value) identifier_value )argument_list )call )expression_statement )block )else_clause )if_statement )block )if_statement )block )for_statement )block )for_statement )block )function_definition )module
Apply global Alignak configuration. Some objects inherit some properties from the global configuration if they do not define their own value. E.g. the global 'accept_passive_service_checks' is inherited by the services as 'accept_passive_checks' :param cls: parent object :type cls: object :param global_configuration: current object (child) :type global_configuration: object :return: None
(module (function_definition (function_name_inter) function_name_inter (parameters (identifier_a) identifier_a (identifier_b) identifier_b )parameters (block (assert_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_a) identifier_a (attribute (identifier_stypes) identifier_stypes (identifier_SpiceCell) identifier_SpiceCell )attribute )argument_list )call )assert_statement (assert_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_b) identifier_b (attribute (identifier_stypes) identifier_stypes (identifier_SpiceCell) identifier_SpiceCell )attribute )argument_list )call )assert_statement (assert_statement (comparison_operator (attribute (identifier_a) identifier_a (identifier_dtype) identifier_dtype )attribute (attribute (identifier_b) identifier_b (identifier_dtype) identifier_dtype )attribute )comparison_operator )assert_statement (if_statement (comparison_operator (attribute (identifier_a) identifier_a (identifier_dtype) identifier_dtype )attribute (integer_0) integer_0 )comparison_operator (block (expression_statement (assignment (identifier_c) identifier_c (call (attribute (identifier_stypes) identifier_stypes (identifier_SPICECHAR_CELL) identifier_SPICECHAR_CELL )attribute (argument_list (call (identifier_max) identifier_max (argument_list (attribute (identifier_a) identifier_a (identifier_size) identifier_size )attribute (attribute (identifier_b) identifier_b (identifier_size) identifier_size )attribute )argument_list )call (call (identifier_max) identifier_max (argument_list (attribute (identifier_a) identifier_a (identifier_length) identifier_length )attribute (attribute (identifier_b) identifier_b (identifier_length) identifier_length )attribute )argument_list )call )argument_list )call )assignment )expression_statement )block (elif_clause (comparison_operator (attribute (identifier_a) identifier_a (identifier_dtype) identifier_dtype )attribute (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_c) identifier_c (call (attribute (identifier_stypes) identifier_stypes (identifier_SPICEDOUBLE_CELL) identifier_SPICEDOUBLE_CELL )attribute (argument_list (call (identifier_max) identifier_max (argument_list (attribute (identifier_a) identifier_a (identifier_size) identifier_size )attribute (attribute (identifier_b) identifier_b (identifier_size) identifier_size )attribute )argument_list )call )argument_list )call )assignment )expression_statement )block )elif_clause (elif_clause (comparison_operator (attribute (identifier_a) identifier_a (identifier_dtype) identifier_dtype )attribute (integer_2) integer_2 )comparison_operator (block (expression_statement (assignment (identifier_c) identifier_c (call (attribute (identifier_stypes) identifier_stypes (identifier_SPICEINT_CELL) identifier_SPICEINT_CELL )attribute (argument_list (call (identifier_max) identifier_max (argument_list (attribute (identifier_a) identifier_a (identifier_size) identifier_size )attribute (attribute (identifier_b) identifier_b (identifier_size) identifier_size )attribute )argument_list )call )argument_list )call )assignment )expression_statement )block )elif_clause (else_clause (block (raise_statement (identifier_NotImplementedError) identifier_NotImplementedError )raise_statement )block )else_clause )if_statement (expression_statement (call (attribute (identifier_libspice) identifier_libspice (identifier_inter_c) identifier_inter_c )attribute (argument_list (call (attribute (identifier_ctypes) identifier_ctypes (identifier_byref) identifier_byref )attribute (argument_list (identifier_a) identifier_a )argument_list )call (call (attribute (identifier_ctypes) identifier_ctypes (identifier_byref) identifier_byref )attribute (argument_list (identifier_b) identifier_b )argument_list )call (call (attribute (identifier_ctypes) identifier_ctypes (identifier_byref) identifier_byref )attribute (argument_list (identifier_c) identifier_c )argument_list )call )argument_list )call )expression_statement (return_statement (identifier_c) identifier_c )return_statement )block )function_definition )module
Intersect two sets of any data type to form a third set. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/inter_c.html :param a: First input set. :type a: spiceypy.utils.support_types.SpiceCell :param b: Second input set. :type b: spiceypy.utils.support_types.SpiceCell :return: Intersection of a and b. :rtype: spiceypy.utils.support_types.SpiceCell
(module (function_definition (function_name_dummy_func) function_name_dummy_func (parameters (identifier_arg1) identifier_arg1 (identifier_arg2) identifier_arg2 (default_parameter (identifier_arg3) identifier_arg3 (None) None )default_parameter (default_parameter (identifier_arg4) identifier_arg4 (list (integer_1) integer_1 (integer_2) integer_2 (integer_3) integer_3 )list )default_parameter (default_parameter (identifier_arg5) identifier_arg5 (dictionary )dictionary )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_foo) identifier_foo (call (attribute (identifier_kwargs) identifier_kwargs (identifier_get) identifier_get )attribute (argument_list (string_'foo') string_'foo' (None) None )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_bar) identifier_bar (call (attribute (identifier_kwargs) identifier_kwargs (identifier_pop) identifier_pop )attribute (argument_list (string_'bar') string_'bar' (integer_4) integer_4 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_foo2) identifier_foo2 (subscript (identifier_kwargs) identifier_kwargs (string_'foo2') string_'foo2' )subscript )assignment )expression_statement (expression_statement (assignment (identifier_foobar) identifier_foobar (binary_operator (binary_operator (call (identifier_str) identifier_str (argument_list (identifier_foo) identifier_foo )argument_list )call (call (identifier_str) identifier_str (argument_list (identifier_bar) identifier_bar )argument_list )call )binary_operator (call (identifier_str) identifier_str (argument_list (identifier_foo2) identifier_foo2 )argument_list )call )binary_operator )assignment )expression_statement (return_statement (identifier_foobar) identifier_foobar )return_statement )block )function_definition )module
test func for kwargs parseing
(module (function_definition (function_name_is_contextfree) function_name_is_contextfree (parameters (identifier_self) identifier_self )parameters (block (for_statement (pattern_list (identifier_lhs) identifier_lhs (identifier_rhs) identifier_rhs )pattern_list (attribute (identifier_self) identifier_self (identifier_rules) identifier_rules )attribute (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_lhs) identifier_lhs )argument_list )call (integer_1) integer_1 )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement (if_statement (comparison_operator (subscript (identifier_lhs) identifier_lhs (integer_0) integer_0 )subscript (attribute (identifier_self) identifier_self (identifier_nonterminals) identifier_nonterminals )attribute )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement )block )for_statement (return_statement (True) True )return_statement )block )function_definition )module
Returns True iff the grammar is context-free.
(module (function_definition (function_name_resend_presence) function_name_resend_presence (parameters (identifier_self) identifier_self )parameters (block (if_statement (attribute (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (identifier_established) identifier_established )attribute (block (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (identifier_enqueue) identifier_enqueue )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier_make_stanza) identifier_make_stanza )attribute (argument_list )argument_list )call )argument_list )call )return_statement )block )if_statement )block )function_definition )module
Re-send the currently configured presence. :return: Stanza token of the presence stanza or :data:`None` if the stream is not established. :rtype: :class:`~.stream.StanzaToken` .. note:: :meth:`set_presence` automatically broadcasts the new presence if any of the parameters changed.
(module (function_definition (function_name_get_productivity_stats) function_name_get_productivity_stats (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_response) identifier_response (call (attribute (identifier_API) identifier_API (identifier_get_productivity_stats) identifier_get_productivity_stats )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_api_token) identifier_api_token )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (identifier__fail_if_contains_errors) identifier__fail_if_contains_errors (argument_list (identifier_response) identifier_response )argument_list )call )expression_statement (return_statement (call (attribute (identifier_response) identifier_response (identifier_json) identifier_json )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Return the user's productivity stats. :return: A JSON-encoded representation of the user's productivity stats. :rtype: A JSON-encoded object. >>> from pytodoist import todoist >>> user = todoist.login('john.doe@gmail.com', 'password') >>> stats = user.get_productivity_stats() >>> print(stats) {"karma_last_update": 50.0, "karma_trend": "up", ... }
(module (function_definition (function_name_advance) function_name_advance (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_elem) identifier_elem (call (identifier_next) identifier_next (argument_list (attribute (identifier_self) identifier_self (identifier__iterable) identifier__iterable )attribute )argument_list )call )assignment )expression_statement (for_statement (identifier_deque) identifier_deque (attribute (identifier_self) identifier_self (identifier__deques) identifier__deques )attribute (block (expression_statement (call (attribute (identifier_deque) identifier_deque (identifier_append) identifier_append )attribute (argument_list (identifier_elem) identifier_elem )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Advance the base iterator, publish to constituent iterators.
(module (function_definition (function_name__get_licences) function_name__get_licences (parameters )parameters (block (expression_statement (assignment (identifier_licenses) identifier_licenses (identifier__LICENSES) identifier__LICENSES )assignment )expression_statement (for_statement (identifier_license) identifier_license (identifier_licenses) identifier_licenses (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (string_"{license_name} [{license_code}]") string_"{license_name} [{license_code}]" (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_license_name) identifier_license_name (subscript (identifier_licenses) identifier_licenses (identifier_license) identifier_license )subscript )keyword_argument (keyword_argument (identifier_license_code) identifier_license_code (identifier_license) identifier_license )keyword_argument )argument_list )call )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Lists all the licenses on command line
(module (function_definition (function_name_create_static_profile_path) function_name_create_static_profile_path (parameters (identifier_client_id) identifier_client_id )parameters (block (expression_statement (assignment (identifier_profile_path) identifier_profile_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_STATIC_FILES_PATH) identifier_STATIC_FILES_PATH (call (identifier_str) identifier_str (argument_list (identifier_client_id) identifier_client_id )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_profile_path) identifier_profile_path )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_profile_path) identifier_profile_path )argument_list )call )expression_statement )block )if_statement (return_statement (identifier_profile_path) identifier_profile_path )return_statement )block )function_definition )module
Create a profile path folder if not exist @param client_id: ID of client user @return string profile path
(module (function_definition (function_name_is_connected) function_name_is_connected (parameters (identifier_self) identifier_self )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier__is_open) identifier__is_open )attribute (block (expression_statement (assignment (identifier_err) identifier_err (call (attribute (identifier_hidapi) identifier_hidapi (identifier_hid_read_timeout) identifier_hid_read_timeout )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__device) identifier__device )attribute (attribute (identifier_ffi) identifier_ffi (identifier_NULL) identifier_NULL )attribute (integer_0) integer_0 (integer_0) integer_0 )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_err) identifier_err (unary_operator (integer_1) integer_1 )unary_operator )comparison_operator (block (return_statement (False) False )return_statement )block (else_clause (block (return_statement (True) True )return_statement )block )else_clause )if_statement )block (else_clause (block (expression_statement (assignment (identifier_en) identifier_en (call (attribute (call (identifier_Enumeration) identifier_Enumeration (argument_list (keyword_argument (identifier_vid) identifier_vid (attribute (identifier_self) identifier_self (identifier_vendor_id) identifier_vendor_id )attribute )keyword_argument (keyword_argument (identifier_pid) identifier_pid (attribute (identifier_self) identifier_self (identifier_product_id) identifier_product_id )attribute )keyword_argument )argument_list )call (identifier_find) identifier_find )attribute (argument_list (keyword_argument (identifier_path) identifier_path (attribute (identifier_self) identifier_self (identifier_path) identifier_path )attribute )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_en) identifier_en )argument_list )call (integer_0) integer_0 )comparison_operator (block (return_statement (False) False )return_statement )block (else_clause (block (return_statement (True) True )return_statement )block )else_clause )if_statement )block )else_clause )if_statement )block )function_definition )module
Checks if the USB device is still connected
(module (function_definition (function_name_pixels) function_name_pixels (parameters (identifier_self) identifier_self (typed_parameter (identifier_value) identifier_value (type (identifier_int) identifier_int )type )typed_parameter )parameters (type (string_'Gap') string_'Gap' )type (block (expression_statement (call (identifier_raise_not_number) identifier_raise_not_number (argument_list (identifier_value) identifier_value )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_gap) identifier_gap )attribute (call (attribute (string_'{}px') string_'{}px' (identifier_format) identifier_format )attribute (argument_list (identifier_value) identifier_value )argument_list )call )assignment )expression_statement (return_statement (identifier_self) identifier_self )return_statement )block )function_definition )module
Set the margin in pixels.
(module (function_definition (function_name__read_as_int) function_name__read_as_int (parameters (identifier_self) identifier_self (identifier_addr) identifier_addr (identifier_numBytes) identifier_numBytes )parameters (block (expression_statement (assignment (identifier_buf) identifier_buf (call (attribute (identifier_self) identifier_self (identifier_read_register) identifier_read_register )attribute (argument_list (identifier_addr) identifier_addr (identifier_numBytes) identifier_numBytes )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_buf) identifier_buf )argument_list )call (integer_4) integer_4 )comparison_operator (block (return_statement (subscript (call (attribute (identifier_struct) identifier_struct (identifier_unpack_from) identifier_unpack_from )attribute (argument_list (string_"<i") string_"<i" (identifier_buf) identifier_buf )argument_list )call (integer_0) integer_0 )subscript )return_statement )block (else_clause (block (expression_statement (assignment (identifier_rtn) identifier_rtn (integer_0) integer_0 )assignment )expression_statement (for_statement (pattern_list (identifier_i) identifier_i (identifier_byte) identifier_byte )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_buf) identifier_buf )argument_list )call (block (expression_statement (augmented_assignment (identifier_rtn) identifier_rtn (binary_operator (identifier_byte) identifier_byte (binary_operator (integer_8) integer_8 (identifier_i) identifier_i )binary_operator )binary_operator )augmented_assignment )expression_statement )block )for_statement (return_statement (identifier_rtn) identifier_rtn )return_statement )block )else_clause )if_statement )block )function_definition )module
Convenience method. Oftentimes we need to read a range of registers to represent an int. This method will automatically read @numBytes registers starting at @addr and convert the array into an int.
(module (function_definition (function_name__get_key_value_config) function_name__get_key_value_config (parameters (identifier_self) identifier_self )parameters (block (for_statement (identifier_rp) identifier_rp (attribute (identifier_self) identifier_self (identifier__remote_providers) identifier__remote_providers )attribute (block (expression_statement (assignment (identifier_val) identifier_val (call (attribute (identifier_self) identifier_self (identifier__get_remote_config) identifier__get_remote_config )attribute (argument_list (identifier_rp) identifier_rp )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__kvstore) identifier__kvstore )attribute (identifier_val) identifier_val )assignment )expression_statement (return_statement (None) None )return_statement )block )for_statement (raise_statement (call (attribute (identifier_errors) identifier_errors (identifier_RemoteConfigError) identifier_RemoteConfigError )attribute (argument_list (string_"No Files Found") string_"No Files Found" )argument_list )call )raise_statement )block )function_definition )module
Retrieves the first found remote configuration.
(module (function_definition (function_name__load_resource) function_name__load_resource (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_url) identifier_url (attribute (identifier_self) identifier_self (identifier__url) identifier__url )attribute )assignment )expression_statement (if_statement (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (block (expression_statement (augmented_assignment (identifier_url) identifier_url (call (attribute (string_'?{0}') string_'?{0}' (identifier_format) identifier_format )attribute (argument_list (call (attribute (attribute (attribute (identifier_six) identifier_six (identifier_moves) identifier_moves )attribute (identifier_urllib_parse) identifier_urllib_parse )attribute (identifier_urlencode) identifier_urlencode )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute )argument_list )call )argument_list )call )augmented_assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_r) identifier_r (call (call (identifier_getattr) identifier_getattr (argument_list (attribute (identifier_self) identifier_self (identifier__session) identifier__session )attribute (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier__meta) identifier__meta )attribute (identifier_get_method) identifier_get_method )attribute (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )argument_list )call (argument_list (identifier_url) identifier_url )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_r) identifier_r (identifier_status_code) identifier_status_code )attribute (integer_404) integer_404 )comparison_operator (block (raise_statement (call (identifier_NotFoundException) identifier_NotFoundException (argument_list (call (attribute (string_'Server returned 404 Not Found for the URL {0}') string_'Server returned 404 Not Found for the URL {0}' (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__url) identifier__url )attribute )argument_list )call )argument_list )call )raise_statement )block (elif_clause (not_operator (comparison_operator (integer_200) integer_200 (attribute (identifier_r) identifier_r (identifier_status_code) identifier_status_code )attribute (integer_400) integer_400 )comparison_operator )not_operator (block (raise_statement (call (identifier_HTTPException) identifier_HTTPException (argument_list (call (attribute (string_'Server returned {0} ({1})') string_'Server returned {0} ({1})' (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_r) identifier_r (identifier_status_code) identifier_status_code )attribute (attribute (identifier_r) identifier_r (identifier_reason) identifier_reason )attribute )argument_list )call (identifier_r) identifier_r )argument_list )call )raise_statement )block )elif_clause )if_statement (expression_statement (assignment (identifier_data) identifier_data (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier__meta) identifier__meta )attribute (identifier_deserializer) identifier_deserializer )attribute (identifier_to_dict) identifier_to_dict )attribute (argument_list (attribute (identifier_r) identifier_r (identifier_text) identifier_text )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_populate_field_values) identifier_populate_field_values )attribute (argument_list (identifier_data) identifier_data )argument_list )call )expression_statement )block )function_definition )module
Load resource data from server
(module (function_definition (function_name_graphs) function_name_graphs (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_result) identifier_result (call (identifier_Dummy) identifier_Dummy (argument_list )argument_list )call )assignment )expression_statement (for_statement (identifier_graph) identifier_graph (attribute (identifier_graphs) identifier_graphs (identifier___all__) identifier___all__ )attribute (block (expression_statement (assignment (identifier_cls) identifier_cls (call (identifier_getattr) identifier_getattr (argument_list (identifier_graphs) identifier_graphs (identifier_graph) identifier_graph )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_result) identifier_result (attribute (identifier_cls) identifier_cls (identifier_short_name) identifier_short_name )attribute (call (identifier_cls) identifier_cls (argument_list (identifier_self) identifier_self )argument_list )call )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Sorry for the black magic. The result is an object whose attributes are all the graphs found in graphs.py initialized with this instance as only argument.
(module (function_definition (function_name_remove_key) function_name_remove_key (parameters (typed_parameter (identifier_request) identifier_request (type (attribute (identifier_web) identifier_web (identifier_Request) identifier_Request )attribute )type )typed_parameter )parameters (type (attribute (identifier_web) identifier_web (identifier_Response) identifier_Response )attribute )type (block (expression_statement (assignment (identifier_keys_dir) identifier_keys_dir (subscript (identifier_CONFIG) identifier_CONFIG (string_'wifi_keys_dir') string_'wifi_keys_dir' )subscript )assignment )expression_statement (expression_statement (assignment (identifier_available_keys) identifier_available_keys (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (identifier_keys_dir) identifier_keys_dir )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_requested_hash) identifier_requested_hash (subscript (attribute (identifier_request) identifier_request (identifier_match_info) identifier_match_info )attribute (string_'key_uuid') string_'key_uuid' )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_requested_hash) identifier_requested_hash (identifier_available_keys) identifier_available_keys )comparison_operator (block (return_statement (call (attribute (identifier_web) identifier_web (identifier_json_response) identifier_json_response )attribute (argument_list (dictionary (pair (string_'message') string_'message' (call (attribute (string_'No such key file {}') string_'No such key file {}' (identifier_format) identifier_format )attribute (argument_list (identifier_requested_hash) identifier_requested_hash )argument_list )call )pair )dictionary (keyword_argument (identifier_status) identifier_status (integer_404) integer_404 )keyword_argument )argument_list )call )return_statement )block )if_statement (expression_statement (assignment (identifier_key_path) identifier_key_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_keys_dir) identifier_keys_dir (identifier_requested_hash) identifier_requested_hash )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_name) identifier_name (subscript (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (identifier_key_path) identifier_key_path )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (call (attribute (identifier_shutil) identifier_shutil (identifier_rmtree) identifier_rmtree )attribute (argument_list (identifier_key_path) identifier_key_path )argument_list )call )expression_statement (return_statement (call (attribute (identifier_web) identifier_web (identifier_json_response) identifier_json_response )attribute (argument_list (dictionary (pair (string_'message') string_'message' (call (attribute (string_'Key file {} deleted') string_'Key file {} deleted' (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name )argument_list )call )pair )dictionary (keyword_argument (identifier_status) identifier_status (integer_200) integer_200 )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Remove a key. ``` DELETE /wifi/keys/:id -> 200 OK {message: 'Removed key keyfile.pem'} ```