sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name_get_onchain_locksroots) function_name_get_onchain_locksroots (parameters (typed_parameter (identifier_chain) identifier_chain (type (string_'BlockChainService') string_'BlockChainService' )type )typed_parameter (typed_parameter (identifier_canonical_identifier) identifier_canonical_identifier (type (identifier_CanonicalIdentifier) identifier_CanonicalIdentifier )type )typed_parameter (typed_parameter (identifier_participant1) identifier_participant1 (type (identifier_Address) identifier_Address )type )typed_parameter (typed_parameter (identifier_participant2) identifier_participant2 (type (identifier_Address) identifier_Address )type )typed_parameter (typed_parameter (identifier_block_identifier) identifier_block_identifier (type (identifier_BlockSpecification) identifier_BlockSpecification )type )typed_parameter )parameters (type (generic_type (identifier_Tuple) identifier_Tuple (type_parameter (type (identifier_Locksroot) identifier_Locksroot )type (type (identifier_Locksroot) identifier_Locksroot )type )type_parameter )generic_type )type (block (expression_statement (assignment (identifier_payment_channel) identifier_payment_channel (call (attribute (identifier_chain) identifier_chain (identifier_payment_channel) identifier_payment_channel )attribute (argument_list (keyword_argument (identifier_canonical_identifier) identifier_canonical_identifier (identifier_canonical_identifier) identifier_canonical_identifier )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_token_network) identifier_token_network (attribute (identifier_payment_channel) identifier_payment_channel (identifier_token_network) identifier_token_network )attribute )assignment )expression_statement (expression_statement (assignment (identifier_participants_details) identifier_participants_details (call (attribute (identifier_token_network) identifier_token_network (identifier_detail_participants) identifier_detail_participants )attribute (argument_list (keyword_argument (identifier_participant1) identifier_participant1 (identifier_participant1) identifier_participant1 )keyword_argument (keyword_argument (identifier_participant2) identifier_participant2 (identifier_participant2) identifier_participant2 )keyword_argument (keyword_argument (identifier_channel_identifier) identifier_channel_identifier (attribute (identifier_canonical_identifier) identifier_canonical_identifier (identifier_channel_identifier) identifier_channel_identifier )attribute )keyword_argument (keyword_argument (identifier_block_identifier) identifier_block_identifier (identifier_block_identifier) identifier_block_identifier )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_our_details) identifier_our_details (attribute (identifier_participants_details) identifier_participants_details (identifier_our_details) identifier_our_details )attribute )assignment )expression_statement (expression_statement (assignment (identifier_our_locksroot) identifier_our_locksroot (attribute (identifier_our_details) identifier_our_details (identifier_locksroot) identifier_locksroot )attribute )assignment )expression_statement (expression_statement (assignment (identifier_partner_details) identifier_partner_details (attribute (identifier_participants_details) identifier_participants_details (identifier_partner_details) identifier_partner_details )attribute )assignment )expression_statement (expression_statement (assignment (identifier_partner_locksroot) identifier_partner_locksroot (attribute (identifier_partner_details) identifier_partner_details (identifier_locksroot) identifier_locksroot )attribute )assignment )expression_statement (return_statement (expression_list (identifier_our_locksroot) identifier_our_locksroot (identifier_partner_locksroot) identifier_partner_locksroot )expression_list )return_statement )block )function_definition )module
Return the locksroot for `participant1` and `participant2` at `block_identifier`.
(module (function_definition (function_name_assert_instance_created) function_name_assert_instance_created (parameters (identifier_self) identifier_self (identifier_model_class) identifier_model_class (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (return_statement (call (identifier__InstanceContext) identifier__InstanceContext (argument_list (attribute (identifier_self) identifier_self (identifier_assert_instance_does_not_exist) identifier_assert_instance_does_not_exist )attribute (attribute (identifier_self) identifier_self (identifier_assert_instance_exists) identifier_assert_instance_exists )attribute (identifier_model_class) identifier_model_class (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Checks if a model instance was created in the database. For example:: >>> with self.assert_instance_created(Article, slug='lorem-ipsum'): ... Article.objects.create(slug='lorem-ipsum')
(module (function_definition (function_name_delete) function_name_delete (parameters (identifier_self) identifier_self )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (expression_statement (assignment (identifier_parent) identifier_parent (attribute (identifier_self) identifier_self (identifier_parent) identifier_parent )attribute )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_parent) identifier_parent (identifier_expr) identifier_expr )attribute (identifier__supports_contents) identifier__supports_contents )attribute (argument_list )argument_list )call (block (expression_statement (call (attribute (identifier_parent) identifier_parent (identifier_remove) identifier_remove )attribute (argument_list (identifier_self) identifier_self )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (for_statement (identifier_arg) identifier_arg (attribute (identifier_parent) identifier_parent (identifier_args) identifier_args )attribute (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_expr) identifier_expr )attribute (attribute (identifier_arg) identifier_arg (identifier_contents) identifier_contents )attribute )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_arg) identifier_arg (identifier_contents) identifier_contents )attribute (identifier_remove) identifier_remove )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_expr) identifier_expr )attribute )argument_list )call )expression_statement )block )if_statement )block )for_statement )block )function_definition )module
r"""Delete this node from the parse tree. Where applicable, this will remove all descendants of this node from the parse tree. >>> from TexSoup import TexSoup >>> soup = TexSoup(r'''\textit{\color{blue}{Silly}}\textit{keep me!}''') >>> soup.textit.color.delete() >>> soup \textit{}\textit{keep me!} >>> soup.textit.delete() >>> soup \textit{keep me!}
(module (function_definition (function_name_format_payload) function_name_format_payload (parameters (identifier_enc) identifier_enc (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_payload) identifier_payload (dictionary (pair (string_'enc') string_'enc' (identifier_enc) identifier_enc )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_load) identifier_load (dictionary )dictionary )assignment )expression_statement (for_statement (identifier_key) identifier_key (identifier_kwargs) identifier_kwargs (block (expression_statement (assignment (subscript (identifier_load) identifier_load (identifier_key) identifier_key )subscript (subscript (identifier_kwargs) identifier_kwargs (identifier_key) identifier_key )subscript )assignment )expression_statement )block )for_statement (expression_statement (assignment (subscript (identifier_payload) identifier_payload (string_'load') string_'load' )subscript (identifier_load) identifier_load )assignment )expression_statement (return_statement (call (identifier_package) identifier_package (argument_list (identifier_payload) identifier_payload )argument_list )call )return_statement )block )function_definition )module
Pass in the required arguments for a payload, the enc type and the cmd, then a list of keyword args to generate the body of the load dict.
(module (function_definition (function_name_get_metadata) function_name_get_metadata (parameters (identifier_self) identifier_self (identifier_loadbalancer) identifier_loadbalancer (default_parameter (identifier_node) identifier_node (None) None )default_parameter (default_parameter (identifier_raw) identifier_raw (False) False )default_parameter )parameters (block (if_statement (identifier_node) identifier_node (block (expression_statement (assignment (identifier_uri) identifier_uri (binary_operator (string_"/loadbalancers/%s/nodes/%s/metadata") string_"/loadbalancers/%s/nodes/%s/metadata" (tuple (call (attribute (identifier_utils) identifier_utils (identifier_get_id) identifier_get_id )attribute (argument_list (identifier_loadbalancer) identifier_loadbalancer )argument_list )call (call (attribute (identifier_utils) identifier_utils (identifier_get_id) identifier_get_id )attribute (argument_list (identifier_node) identifier_node )argument_list )call )tuple )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_uri) identifier_uri (binary_operator (string_"/loadbalancers/%s/metadata") string_"/loadbalancers/%s/metadata" (call (attribute (identifier_utils) identifier_utils (identifier_get_id) identifier_get_id )attribute (argument_list (identifier_loadbalancer) identifier_loadbalancer )argument_list )call )binary_operator )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (pattern_list (identifier_resp) identifier_resp (identifier_body) identifier_body )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_api) identifier_api )attribute (identifier_method_get) identifier_method_get )attribute (argument_list (identifier_uri) identifier_uri )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_meta) identifier_meta (call (attribute (identifier_body) identifier_body (identifier_get) identifier_get )attribute (argument_list (string_"metadata") string_"metadata" (list )list )argument_list )call )assignment )expression_statement (if_statement (identifier_raw) identifier_raw (block (return_statement (identifier_meta) identifier_meta )return_statement )block )if_statement (expression_statement (assignment (identifier_ret) identifier_ret (call (identifier_dict) identifier_dict (argument_list (list_comprehension (tuple (subscript (identifier_itm) identifier_itm (string_"key") string_"key" )subscript (subscript (identifier_itm) identifier_itm (string_"value") string_"value" )subscript )tuple (for_in_clause (identifier_itm) identifier_itm (identifier_meta) identifier_meta )for_in_clause )list_comprehension )argument_list )call )assignment )expression_statement (return_statement (identifier_ret) identifier_ret )return_statement )block )function_definition )module
Returns the current metadata for the load balancer. If 'node' is provided, returns the current metadata for that node.
(module (function_definition (function_name_set_default_keychain) function_name_set_default_keychain (parameters (identifier_keychain) identifier_keychain (default_parameter (identifier_domain) identifier_domain (string_"user") string_"user" )default_parameter (default_parameter (identifier_user) identifier_user (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_cmd) identifier_cmd (call (attribute (string_"security default-keychain -d {0} -s {1}") string_"security default-keychain -d {0} -s {1}" (identifier_format) identifier_format )attribute (argument_list (identifier_domain) identifier_domain (identifier_keychain) identifier_keychain )argument_list )call )assignment )expression_statement (return_statement (call (subscript (identifier___salt__) identifier___salt__ (string_'cmd.run') string_'cmd.run' )subscript (argument_list (identifier_cmd) identifier_cmd (keyword_argument (identifier_runas) identifier_runas (identifier_user) identifier_user )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Set the default keychain keychain The location of the keychain to set as default domain The domain to use valid values are user|system|common|dynamic, the default is user user The user to set the default keychain as CLI Example: .. code-block:: bash salt '*' keychain.set_keychain /Users/fred/Library/Keychains/login.keychain
(module (function_definition (function_name_get_modelnames) function_name_get_modelnames (parameters )parameters (type (generic_type (identifier_List) identifier_List (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type (block (return_statement (call (identifier_sorted) identifier_sorted (generator_expression (call (identifier_str) identifier_str (argument_list (subscript (call (attribute (identifier_fn) identifier_fn (identifier_split) identifier_split )attribute (argument_list (string_'.') string_'.' )argument_list )call (integer_0) integer_0 )subscript )argument_list )call (for_in_clause (identifier_fn) identifier_fn (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (subscript (attribute (identifier_models) identifier_models (identifier___path__) identifier___path__ )attribute (integer_0) integer_0 )subscript )argument_list )call )for_in_clause (if_clause (parenthesized_expression (boolean_operator (call (attribute (identifier_fn) identifier_fn (identifier_endswith) identifier_endswith )attribute (argument_list (string_'.py') string_'.py' )argument_list )call (parenthesized_expression (comparison_operator (identifier_fn) identifier_fn (string_'__init__.py') string_'__init__.py' )comparison_operator )parenthesized_expression )boolean_operator )parenthesized_expression )if_clause )generator_expression )call )return_statement )block )function_definition )module
Return a sorted |list| containing all application model names. >>> from hydpy.auxs.xmltools import XSDWriter >>> print(XSDWriter.get_modelnames()) # doctest: +ELLIPSIS [...'dam_v001', 'dam_v002', 'dam_v003', 'dam_v004', 'dam_v005',...]
(module (function_definition (function_name_when_file_changed) function_name_when_file_changed (parameters (list_splat_pattern (identifier_filenames) identifier_filenames )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (function_definition (function_name__register) function_name__register (parameters (identifier_action) identifier_action )parameters (block (expression_statement (assignment (identifier_handler) identifier_handler (call (attribute (identifier_Handler) identifier_Handler (identifier_get) identifier_get )attribute (argument_list (identifier_action) identifier_action )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_handler) identifier_handler (identifier_add_predicate) identifier_add_predicate )attribute (argument_list (call (identifier_partial) identifier_partial (argument_list (identifier_any_file_changed) identifier_any_file_changed (identifier_filenames) identifier_filenames (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )argument_list )call )expression_statement (return_statement (identifier_action) identifier_action )return_statement )block )function_definition (return_statement (identifier__register) identifier__register )return_statement )block )function_definition )module
Register the decorated function to run when one or more files have changed. :param list filenames: The names of one or more files to check for changes (a callable returning the name is also accepted). :param str hash_type: The type of hash to use for determining if a file has changed. Defaults to 'md5'. Must be given as a kwarg.
(module (function_definition (function_name_use_options) function_name_use_options (parameters (identifier_allowed) identifier_allowed )parameters (block (function_definition (function_name_update_docstring) function_name_update_docstring (parameters (identifier_f) identifier_f )parameters (block (expression_statement (call (identifier__update_option_docstring) identifier__update_option_docstring (argument_list (identifier_f) identifier_f (identifier_allowed) identifier_allowed )argument_list )call )expression_statement (decorated_definition (decorator (call (attribute (identifier_functools) identifier_functools (identifier_wraps) identifier_wraps )attribute (argument_list (identifier_f) identifier_f )argument_list )call )decorator (function_definition (function_name_check_options) function_name_check_options (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_options) identifier_options (call (attribute (identifier_kwargs) identifier_kwargs (identifier_get) identifier_get )attribute (argument_list (string_'options') string_'options' (dictionary )dictionary )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_not_allowed) identifier_not_allowed (list_comprehension (identifier_option) identifier_option (for_in_clause (identifier_option) identifier_option (identifier_options) identifier_options )for_in_clause (if_clause (boolean_operator (comparison_operator (identifier_option) identifier_option (identifier_allowed) identifier_allowed )comparison_operator (not_operator (call (attribute (identifier_option) identifier_option (identifier_startswith) identifier_startswith )attribute (argument_list (string_'_') string_'_' )argument_list )call )not_operator )boolean_operator )if_clause )list_comprehension )assignment )expression_statement (if_statement (identifier_not_allowed) identifier_not_allowed (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_warning) identifier_warning )attribute (argument_list (call (attribute (concatenated_string (string_'The following options are not supported by ') string_'The following options are not supported by ' (string_'this function and will likely result in ') string_'this function and will likely result in ' (string_'undefined behavior: {}.') string_'undefined behavior: {}.' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_not_allowed) identifier_not_allowed )argument_list )call )argument_list )call )expression_statement )block )if_statement (return_statement (call (identifier_f) identifier_f (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )decorated_definition (return_statement (identifier_check_options) identifier_check_options )return_statement )block )function_definition (return_statement (identifier_update_docstring) identifier_update_docstring )return_statement )block )function_definition )module
Decorator that logs warnings when unpermitted options are passed into its wrapped function. Requires that wrapped function has an keyword-only argument named `options`. If wrapped function has {options} in its docstring, fills in with the docs for allowed options. Args: allowed (list str): list of option keys allowed. If the wrapped function is called with an option not in allowed, log a warning. All values in allowed must also be present in `defaults`. Returns: Wrapped function with options validation. >>> @use_options(['title']) ... def test(*, options={}): return options['title'] >>> test(options={'title': 'Hello'}) 'Hello' >>> # test(options={'not_allowed': 123}) # Also logs error message ''
(module (function_definition (function_name_validate) function_name_validate (parameters (identifier_self) identifier_self (identifier_data) identifier_data )parameters (block (if_statement (boolean_operator (comparison_operator (identifier_data) identifier_data (None) None )comparison_operator (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_data) identifier_data (identifier_dict) identifier_dict )argument_list )call )not_operator )boolean_operator (block (raise_statement (call (attribute (identifier_serializers) identifier_serializers (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (string_"Invalid data") string_"Invalid data" )argument_list )call )raise_statement )block )if_statement (try_statement (block (expression_statement (assignment (identifier_profiles) identifier_profiles (list_comprehension (subscript (identifier_ev) identifier_ev (string_"profile") string_"profile" )subscript (for_in_clause (identifier_ev) identifier_ev (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_"encoded_videos") string_"encoded_videos" (list )list )argument_list )call )for_in_clause )list_comprehension )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_profiles) identifier_profiles )argument_list )call (call (identifier_len) identifier_len (argument_list (call (identifier_set) identifier_set (argument_list (identifier_profiles) identifier_profiles )argument_list )call )argument_list )call )comparison_operator (block (raise_statement (call (attribute (identifier_serializers) identifier_serializers (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (string_"Invalid data: duplicate profiles") string_"Invalid data: duplicate profiles" )argument_list )call )raise_statement )block )if_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (raise_statement (call (attribute (identifier_serializers) identifier_serializers (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (string_"profile required for deserializing") string_"profile required for deserializing" )argument_list )call )raise_statement )block )except_clause (except_clause (identifier_TypeError) identifier_TypeError (block (raise_statement (call (attribute (identifier_serializers) identifier_serializers (identifier_ValidationError) identifier_ValidationError )attribute (argument_list (string_"profile field needs to be a profile_name (str)") string_"profile field needs to be a profile_name (str)" )argument_list )call )raise_statement )block )except_clause )try_statement (expression_statement (assignment (identifier_course_videos) identifier_course_videos (list_comprehension (tuple (identifier_course_video) identifier_course_video (identifier_image) identifier_image )tuple (for_in_clause (pattern_list (identifier_course_video) identifier_course_video (identifier_image) identifier_image )pattern_list (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'courses') string_'courses' (list )list )argument_list )call )for_in_clause (if_clause (identifier_course_video) identifier_course_video )if_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (subscript (identifier_data) identifier_data (string_'courses') string_'courses' )subscript (identifier_course_videos) identifier_course_videos )assignment )expression_statement (return_statement (identifier_data) identifier_data )return_statement )block )function_definition )module
Check that the video data is valid.
(module (function_definition (function_name_show) function_name_show (parameters (identifier_self) identifier_self (typed_default_parameter (identifier_ax) identifier_ax (type (attribute (identifier_plt) identifier_plt (identifier_Axes) identifier_Axes )attribute )type (None) None )typed_default_parameter (typed_default_parameter (identifier_figsize) identifier_figsize (type (identifier_tuple) identifier_tuple )type (tuple (integer_3) integer_3 (integer_3) integer_3 )tuple )typed_default_parameter (typed_default_parameter (identifier_title) identifier_title (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type (None) None )typed_default_parameter (typed_default_parameter (identifier_hide_axis) identifier_hide_axis (type (identifier_bool) identifier_bool )type (True) True )typed_default_parameter (typed_default_parameter (identifier_cmap) identifier_cmap (type (identifier_str) identifier_str )type (string_'tab20') string_'tab20' )typed_default_parameter (typed_default_parameter (identifier_alpha) identifier_alpha (type (identifier_float) identifier_float )type (float_0.5) float_0.5 )typed_default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (string_"Show the `ImageSegment` on `ax`.") string_"Show the `ImageSegment` on `ax`." )expression_statement (expression_statement (assignment (identifier_ax) identifier_ax (call (identifier_show_image) identifier_show_image (argument_list (identifier_self) identifier_self (keyword_argument (identifier_ax) identifier_ax (identifier_ax) identifier_ax )keyword_argument (keyword_argument (identifier_hide_axis) identifier_hide_axis (identifier_hide_axis) identifier_hide_axis )keyword_argument (keyword_argument (identifier_cmap) identifier_cmap (identifier_cmap) identifier_cmap )keyword_argument (keyword_argument (identifier_figsize) identifier_figsize (identifier_figsize) identifier_figsize )keyword_argument (keyword_argument (identifier_interpolation) identifier_interpolation (string_'nearest') string_'nearest' )keyword_argument (keyword_argument (identifier_alpha) identifier_alpha (identifier_alpha) identifier_alpha )keyword_argument (keyword_argument (identifier_vmin) identifier_vmin (integer_0) integer_0 )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (identifier_title) identifier_title (block (expression_statement (call (attribute (identifier_ax) identifier_ax (identifier_set_title) identifier_set_title )attribute (argument_list (identifier_title) identifier_title )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Show the `ImageSegment` on `ax`.
(module (function_definition (function_name__remove_existing_jobs) function_name__remove_existing_jobs (parameters (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_new_data) identifier_new_data (list )list )assignment )expression_statement (expression_statement (assignment (identifier_guids) identifier_guids (list_comprehension (subscript (subscript (identifier_datum) identifier_datum (string_'job') string_'job' )subscript (string_'job_guid') string_'job_guid' )subscript (for_in_clause (identifier_datum) identifier_datum (identifier_data) identifier_data )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_state_map) identifier_state_map (dictionary_comprehension (pair (identifier_guid) identifier_guid (identifier_state) identifier_state )pair (for_in_clause (tuple_pattern (identifier_guid) identifier_guid (identifier_state) identifier_state )tuple_pattern (call (attribute (call (attribute (attribute (identifier_Job) identifier_Job (identifier_objects) identifier_objects )attribute (identifier_filter) identifier_filter )attribute (argument_list (keyword_argument (identifier_guid__in) identifier_guid__in (identifier_guids) identifier_guids )keyword_argument )argument_list )call (identifier_values_list) identifier_values_list )attribute (argument_list (string_'guid') string_'guid' (string_'state') string_'state' )argument_list )call )for_in_clause )dictionary_comprehension )assignment )expression_statement (for_statement (identifier_datum) identifier_datum (identifier_data) identifier_data (block (expression_statement (assignment (identifier_job) identifier_job (subscript (identifier_datum) identifier_datum (string_'job') string_'job' )subscript )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_state_map) identifier_state_map (identifier_get) identifier_get )attribute (argument_list (subscript (identifier_job) identifier_job (string_'job_guid') string_'job_guid' )subscript )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_new_data) identifier_new_data (identifier_append) identifier_append )attribute (argument_list (identifier_datum) identifier_datum )argument_list )call )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_current_state) identifier_current_state (subscript (identifier_state_map) identifier_state_map (subscript (identifier_job) identifier_job (string_'job_guid') string_'job_guid' )subscript )subscript )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_current_state) identifier_current_state (string_'completed') string_'completed' )comparison_operator (parenthesized_expression (boolean_operator (comparison_operator (subscript (identifier_job) identifier_job (string_'state') string_'state' )subscript (string_'pending') string_'pending' )comparison_operator (comparison_operator (identifier_current_state) identifier_current_state (string_'running') string_'running' )comparison_operator )boolean_operator )parenthesized_expression )boolean_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (call (attribute (identifier_new_data) identifier_new_data (identifier_append) identifier_append )attribute (argument_list (identifier_datum) identifier_datum )argument_list )call )expression_statement )block )else_clause )if_statement )block )for_statement (return_statement (identifier_new_data) identifier_new_data )return_statement )block )function_definition )module
Remove jobs from data where we already have them in the same state. 1. split the incoming jobs into pending, running and complete. 2. fetch the ``job_guids`` from the db that are in the same state as they are in ``data``. 3. build a new list of jobs in ``new_data`` that are not already in the db and pass that back. It could end up empty at that point.
(module (function_definition (function_name_assign_agent_to_resource) function_name_assign_agent_to_resource (parameters (identifier_self) identifier_self (identifier_agent_id) identifier_agent_id (identifier_resource_id) identifier_resource_id )parameters (block (expression_statement (assignment (identifier_collection) identifier_collection (call (identifier_JSONClientValidated) identifier_JSONClientValidated (argument_list (string_'resource') string_'resource' (keyword_argument (identifier_collection) identifier_collection (string_'Resource') string_'Resource' )keyword_argument (keyword_argument (identifier_runtime) identifier_runtime (attribute (identifier_self) identifier_self (identifier__runtime) identifier__runtime )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_resource) identifier_resource (call (attribute (identifier_collection) identifier_collection (identifier_find_one) identifier_find_one )attribute (argument_list (dictionary (pair (string_'_id') string_'_id' (call (identifier_ObjectId) identifier_ObjectId (argument_list (call (attribute (identifier_resource_id) identifier_resource_id (identifier_get_identifier) identifier_get_identifier )attribute (argument_list )argument_list )call )argument_list )call )pair )dictionary )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (call (identifier_ResourceAgentSession) identifier_ResourceAgentSession (argument_list (attribute (identifier_self) identifier_self (identifier__catalog_id) identifier__catalog_id )attribute (attribute (identifier_self) identifier_self (identifier__proxy) identifier__proxy )attribute (attribute (identifier_self) identifier_self (identifier__runtime) identifier__runtime )attribute )argument_list )call (identifier_get_resource_by_agent) identifier_get_resource_by_agent )attribute (argument_list (identifier_agent_id) identifier_agent_id )argument_list )call )expression_statement )block (except_clause (attribute (identifier_errors) identifier_errors (identifier_NotFound) identifier_NotFound )attribute (block (pass_statement )pass_statement )block )except_clause (else_clause (block (raise_statement (call (attribute (identifier_errors) identifier_errors (identifier_AlreadyExists) identifier_AlreadyExists )attribute (argument_list )argument_list )call )raise_statement )block )else_clause )try_statement (if_statement (comparison_operator (string_'agentIds') string_'agentIds' (identifier_resource) identifier_resource )comparison_operator (block (expression_statement (assignment (subscript (identifier_resource) identifier_resource (string_'agentIds') string_'agentIds' )subscript (list (call (identifier_str) identifier_str (argument_list (identifier_agent_id) identifier_agent_id )argument_list )call )list )assignment )expression_statement )block (else_clause (block (expression_statement (call (attribute (subscript (identifier_resource) identifier_resource (string_'agentIds') string_'agentIds' )subscript (identifier_append) identifier_append )attribute (argument_list (call (identifier_str) identifier_str (argument_list (identifier_agent_id) identifier_agent_id )argument_list )call )argument_list )call )expression_statement )block )else_clause )if_statement (expression_statement (call (attribute (identifier_collection) identifier_collection (identifier_save) identifier_save )attribute (argument_list (identifier_resource) identifier_resource )argument_list )call )expression_statement )block )function_definition )module
Adds an existing ``Agent`` to a ``Resource``. arg: agent_id (osid.id.Id): the ``Id`` of the ``Agent`` arg: resource_id (osid.id.Id): the ``Id`` of the ``Resource`` raise: AlreadyExists - ``agent_id`` is already assigned to ``resource_id`` raise: NotFound - ``agent_id`` or ``resource_id`` not found raise: NullArgument - ``agent_id`` or ``resource_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure *compliance: mandatory -- This method must be implemented.*
(module (function_definition (function_name_overlaps) function_name_overlaps (parameters (identifier_self) identifier_self (identifier_junc) identifier_junc (default_parameter (identifier_tolerance) identifier_tolerance (integer_0) integer_0 )default_parameter )parameters (block (if_statement (not_operator (call (attribute (attribute (identifier_self) identifier_self (identifier_left) identifier_left )attribute (identifier_overlaps) identifier_overlaps )attribute (argument_list (attribute (identifier_junc) identifier_junc (identifier_left) identifier_left )attribute (keyword_argument (identifier_padding) identifier_padding (identifier_tolerance) identifier_tolerance )keyword_argument )argument_list )call )not_operator (block (return_statement (False) False )return_statement )block )if_statement (if_statement (not_operator (call (attribute (attribute (identifier_self) identifier_self (identifier_right) identifier_right )attribute (identifier_overlaps) identifier_overlaps )attribute (argument_list (attribute (identifier_junc) identifier_junc (identifier_right) identifier_right )attribute (keyword_argument (identifier_padding) identifier_padding (identifier_tolerance) identifier_tolerance )keyword_argument )argument_list )call )not_operator (block (return_statement (False) False )return_statement )block )if_statement (return_statement (True) True )return_statement )block )function_definition )module
see if junction overlaps with tolerance
(module (function_definition (function_name_fig_to_src) function_name_fig_to_src (parameters (identifier_figure) identifier_figure (default_parameter (identifier_image_format) identifier_image_format (string_'png') string_'png' )default_parameter (default_parameter (identifier_dpi) identifier_dpi (integer_80) integer_80 )default_parameter )parameters (block (if_statement (comparison_operator (identifier_image_format) identifier_image_format (string_'png') string_'png' )comparison_operator (block (expression_statement (assignment (identifier_f) identifier_f (call (attribute (identifier_io) identifier_io (identifier_BytesIO) identifier_BytesIO )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_figure) identifier_figure (identifier_savefig) identifier_savefig )attribute (argument_list (identifier_f) identifier_f (keyword_argument (identifier_format) identifier_format (identifier_image_format) identifier_image_format )keyword_argument (keyword_argument (identifier_dpi) identifier_dpi (identifier_dpi) identifier_dpi )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_f) identifier_f (identifier_seek) identifier_seek )attribute (argument_list (integer_0) integer_0 )argument_list )call )expression_statement (return_statement (call (identifier_png_to_src) identifier_png_to_src (argument_list (call (attribute (identifier_f) identifier_f (identifier_read) identifier_read )attribute (argument_list )argument_list )call )argument_list )call )return_statement )block (elif_clause (comparison_operator (identifier_image_format) identifier_image_format (string_'svg') string_'svg' )comparison_operator (block (expression_statement (assignment (identifier_f) identifier_f (call (attribute (identifier_io) identifier_io (identifier_StringIO) identifier_StringIO )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_figure) identifier_figure (identifier_savefig) identifier_savefig )attribute (argument_list (identifier_f) identifier_f (keyword_argument (identifier_format) identifier_format (identifier_image_format) identifier_image_format )keyword_argument (keyword_argument (identifier_dpi) identifier_dpi (identifier_dpi) identifier_dpi )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_f) identifier_f (identifier_seek) identifier_seek )attribute (argument_list (integer_0) integer_0 )argument_list )call )expression_statement (return_statement (call (identifier_svg_to_src) identifier_svg_to_src (argument_list (call (attribute (identifier_f) identifier_f (identifier_read) identifier_read )attribute (argument_list )argument_list )call )argument_list )call )return_statement )block )elif_clause )if_statement )block )function_definition )module
Convert a matplotlib figure to an inline HTML image. :param matplotlib.figure.Figure figure: Figure to display. :param str image_format: png (default) or svg :param int dpi: dots-per-inch for raster graphics. :rtype: str
(module (function_definition (function_name_get_dir_walker) function_name_get_dir_walker (parameters (identifier_recursive) identifier_recursive (default_parameter (identifier_topdown) identifier_topdown (True) True )default_parameter (default_parameter (identifier_followlinks) identifier_followlinks (False) False )default_parameter )parameters (block (if_statement (identifier_recursive) identifier_recursive (block (expression_statement (assignment (identifier_walk) identifier_walk (call (identifier_partial) identifier_partial (argument_list (attribute (identifier_os) identifier_os (identifier_walk) identifier_walk )attribute (keyword_argument (identifier_topdown) identifier_topdown (identifier_topdown) identifier_topdown )keyword_argument (keyword_argument (identifier_followlinks) identifier_followlinks (identifier_followlinks) identifier_followlinks )keyword_argument )argument_list )call )assignment )expression_statement )block (else_clause (block (function_definition (function_name_walk) function_name_walk (parameters (identifier_path) identifier_path (default_parameter (identifier_topdown) identifier_topdown (identifier_topdown) identifier_topdown )default_parameter (default_parameter (identifier_followlinks) identifier_followlinks (identifier_followlinks) identifier_followlinks )default_parameter )parameters (block (try_statement (block (expression_statement (yield (call (identifier_next) identifier_next (argument_list (call (attribute (identifier_os) identifier_os (identifier_walk) identifier_walk )attribute (argument_list (identifier_path) identifier_path (keyword_argument (identifier_topdown) identifier_topdown (identifier_topdown) identifier_topdown )keyword_argument (keyword_argument (identifier_followlinks) identifier_followlinks (identifier_followlinks) identifier_followlinks )keyword_argument )argument_list )call )argument_list )call )yield )expression_statement )block (except_clause (identifier_NameError) identifier_NameError (block (expression_statement (yield (call (attribute (call (attribute (identifier_os) identifier_os (identifier_walk) identifier_walk )attribute (argument_list (identifier_path) identifier_path (keyword_argument (identifier_topdown) identifier_topdown (identifier_topdown) identifier_topdown )keyword_argument (keyword_argument (identifier_followlinks) identifier_followlinks (identifier_followlinks) identifier_followlinks )keyword_argument )argument_list )call (identifier_next) identifier_next )attribute (argument_list )argument_list )call )yield )expression_statement )block )except_clause )try_statement )block )function_definition )block )else_clause )if_statement (return_statement (identifier_walk) identifier_walk )return_statement )block )function_definition )module
Returns a recursive or a non-recursive directory walker. :param recursive: ``True`` produces a recursive walker; ``False`` produces a non-recursive walker. :returns: A walker function.
(module (function_definition (function_name_syscal_save_to_config_txt) function_name_syscal_save_to_config_txt (parameters (identifier_filename) identifier_filename (identifier_configs) identifier_configs (default_parameter (identifier_spacing) identifier_spacing (integer_1) integer_1 )default_parameter )parameters (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_'Number of measurements: ') string_'Number of measurements: ' (subscript (attribute (identifier_configs) identifier_configs (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript )argument_list )call )expression_statement (expression_statement (assignment (identifier_number_of_electrodes) identifier_number_of_electrodes (call (attribute (call (attribute (identifier_configs) identifier_configs (identifier_max) identifier_max )attribute (argument_list )argument_list )call (identifier_astype) identifier_astype )attribute (argument_list (identifier_int) identifier_int )argument_list )call )assignment )expression_statement (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_filename) identifier_filename (string_'w') string_'w' )argument_list )call (as_pattern_target (identifier_fid) identifier_fid )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (identifier__syscal_write_electrode_coords) identifier__syscal_write_electrode_coords (argument_list (identifier_fid) identifier_fid (identifier_spacing) identifier_spacing (identifier_number_of_electrodes) identifier_number_of_electrodes )argument_list )call )expression_statement (expression_statement (call (identifier__syscal_write_quadpoles) identifier__syscal_write_quadpoles (argument_list (identifier_fid) identifier_fid (call (attribute (identifier_configs) identifier_configs (identifier_astype) identifier_astype )attribute (argument_list (identifier_int) identifier_int )argument_list )call )argument_list )call )expression_statement )block )with_statement )block )function_definition )module
Write configurations to a Syscal ascii file that can be read by the Electre Pro program. Parameters ---------- filename: string output filename configs: numpy.ndarray Nx4 array with measurement configurations A-B-M-N
(module (function_definition (function_name__bind) function_name__bind (parameters (identifier_self) identifier_self )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__bind_as) identifier__bind_as )attribute (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_settings) identifier_settings )attribute (identifier_BIND_DN) identifier_BIND_DN )attribute (attribute (attribute (identifier_self) identifier_self (identifier_settings) identifier_settings )attribute (identifier_BIND_PASSWORD) identifier_BIND_PASSWORD )attribute (keyword_argument (identifier_sticky) identifier_sticky (True) True )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
Binds to the LDAP server with AUTH_LDAP_BIND_DN and AUTH_LDAP_BIND_PASSWORD.
(module (function_definition (function_name_parameters) function_name_parameters (parameters (identifier_self) identifier_self (identifier_sequence) identifier_sequence (identifier_value_means) identifier_value_means (identifier_value_ranges) identifier_value_ranges (identifier_arrangement) identifier_arrangement )parameters (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'sequence') string_'sequence' )subscript (identifier_sequence) identifier_sequence )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_means') string_'value_means' )subscript (identifier_value_means) identifier_value_means )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_ranges') string_'value_ranges' )subscript (identifier_value_ranges) identifier_value_ranges )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'arrangement') string_'arrangement' )subscript (identifier_arrangement) identifier_arrangement )assignment )expression_statement (if_statement (call (identifier_any) identifier_any (generator_expression (comparison_operator (identifier_x) identifier_x (integer_0) integer_0 )comparison_operator (for_in_clause (identifier_x) identifier_x (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_ranges') string_'value_ranges' )subscript )for_in_clause )generator_expression )call (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"range values must be greater than zero") string_"range values must be greater than zero" )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'variable_parameters') string_'variable_parameters' )subscript (list )list )assignment )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (call (identifier_len) identifier_len (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_means') string_'value_means' )subscript )argument_list )call )argument_list )call (block (expression_statement (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'variable_parameters') string_'variable_parameters' )subscript (identifier_append) identifier_append )attribute (argument_list (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (argument_list (list (string_'var') string_'var' (call (identifier_str) identifier_str (argument_list (identifier_i) identifier_i )argument_list )call )list )argument_list )call )argument_list )call )expression_statement )block )for_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (call (attribute (call (identifier_set) identifier_set (argument_list (identifier_arrangement) identifier_arrangement )argument_list )call (identifier_intersection) identifier_intersection )attribute (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'variable_parameters') string_'variable_parameters' )subscript )argument_list )call )argument_list )call (call (identifier_len) identifier_len (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_means') string_'value_means' )subscript )argument_list )call )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"argument mismatch!") string_"argument mismatch!" )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_ranges') string_'value_ranges' )subscript )argument_list )call (call (identifier_len) identifier_len (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__params) identifier__params )attribute (string_'value_means') string_'value_means' )subscript )argument_list )call )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"argument mismatch!") string_"argument mismatch!" )argument_list )call )raise_statement )block )if_statement )block )function_definition )module
Relates the individual to be evolved to the full parameter string. Parameters ---------- sequence: str Full amino acid sequence for specification object to be optimized. Must be equal to the number of residues in the model. value_means: list List containing mean values for parameters to be optimized. value_ranges: list List containing ranges for parameters to be optimized. Values must be positive. arrangement: list Full list of fixed and variable parameters for model building. Fixed values are the appropriate value. Values to be varied should be listed as 'var0', 'var1' etc, and must be in ascending numerical order. Variables can be repeated if required.
(module (function_definition (function_name_get_calculated_display_values) function_name_get_calculated_display_values (parameters (identifier_self) identifier_self (typed_default_parameter (identifier_immediate) identifier_immediate (type (identifier_bool) identifier_bool )type (False) False )typed_default_parameter )parameters (type (identifier_DisplayValues) identifier_DisplayValues )type (block (if_statement (boolean_operator (boolean_operator (not_operator (identifier_immediate) identifier_immediate )not_operator (not_operator (attribute (identifier_self) identifier_self (identifier___is_master) identifier___is_master )attribute )not_operator )boolean_operator (not_operator (attribute (identifier_self) identifier_self (identifier___last_display_values) identifier___last_display_values )attribute )not_operator )boolean_operator (block (if_statement (boolean_operator (not_operator (attribute (identifier_self) identifier_self (identifier___current_display_values) identifier___current_display_values )attribute )not_operator (attribute (identifier_self) identifier_self (identifier___data_item) identifier___data_item )attribute )boolean_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier___current_display_values) identifier___current_display_values )attribute (call (identifier_DisplayValues) identifier_DisplayValues (argument_list (attribute (attribute (identifier_self) identifier_self (identifier___data_item) identifier___data_item )attribute (identifier_xdata) identifier_xdata )attribute (attribute (identifier_self) identifier_self (identifier_sequence_index) identifier_sequence_index )attribute (attribute (identifier_self) identifier_self (identifier_collection_index) identifier_collection_index )attribute (attribute (identifier_self) identifier_self (identifier_slice_center) identifier_slice_center )attribute (attribute (identifier_self) identifier_self (identifier_slice_width) identifier_slice_width )attribute (attribute (identifier_self) identifier_self (identifier_display_limits) identifier_display_limits )attribute (attribute (identifier_self) identifier_self (identifier_complex_display_type) identifier_complex_display_type )attribute (attribute (identifier_self) identifier_self (identifier___color_map_data) identifier___color_map_data )attribute )argument_list )call )assignment )expression_statement (function_definition (function_name_finalize) function_name_finalize (parameters (identifier_display_values) identifier_display_values )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier___last_display_values) identifier___last_display_values )attribute (identifier_display_values) identifier_display_values )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_display_values_changed_event) identifier_display_values_changed_event )attribute (identifier_fire) identifier_fire )attribute (argument_list )argument_list )call )expression_statement )block )function_definition (expression_statement (assignment (attribute (attribute (identifier_self) identifier_self (identifier___current_display_values) identifier___current_display_values )attribute (identifier_on_finalize) identifier_on_finalize )attribute (identifier_finalize) identifier_finalize )assignment )expression_statement )block )if_statement (return_statement (attribute (identifier_self) identifier_self (identifier___current_display_values) identifier___current_display_values )attribute )return_statement )block )if_statement (return_statement (attribute (identifier_self) identifier_self (identifier___last_display_values) identifier___last_display_values )attribute )return_statement )block )function_definition )module
Return the display values. Return the current (possibly uncalculated) display values unless 'immediate' is specified. If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate' values avoids calculation except in cases where the display values haven't already been calculated.
(module (function_definition (function_name_log) function_name_log (parameters (identifier_array) identifier_array (identifier_cutoff) identifier_cutoff )parameters (block (expression_statement (assignment (identifier_arr) identifier_arr (call (attribute (identifier_numpy) identifier_numpy (identifier_copy) identifier_copy )attribute (argument_list (identifier_array) identifier_array )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_arr) identifier_arr (comparison_operator (identifier_arr) identifier_arr (identifier_cutoff) identifier_cutoff )comparison_operator )subscript (identifier_cutoff) identifier_cutoff )assignment )expression_statement (return_statement (call (attribute (identifier_numpy) identifier_numpy (identifier_log) identifier_log )attribute (argument_list (identifier_arr) identifier_arr )argument_list )call )return_statement )block )function_definition )module
Compute the logarithm of an array with a cutoff on the small values
(module (function_definition (function_name_save) function_name_save (parameters (identifier_self) identifier_self (identifier_value) identifier_value (identifier_redis) identifier_redis (keyword_separator )keyword_separator (default_parameter (identifier_commit) identifier_commit (True) True )default_parameter )parameters (block (expression_statement (assignment (identifier_value) identifier_value (call (attribute (identifier_self) identifier_self (identifier_prepare) identifier_prepare )attribute (argument_list (identifier_value) identifier_value )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_value) identifier_value (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_redis) identifier_redis (identifier_hset) identifier_hset )attribute (argument_list (call (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier_key) identifier_key )attribute (argument_list )argument_list )call (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute (identifier_value) identifier_value )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_redis) identifier_redis (identifier_hdel) identifier_hdel )attribute (argument_list (call (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier_key) identifier_key )attribute (argument_list )argument_list )call (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )argument_list )call )expression_statement )block )else_clause )if_statement (if_statement (attribute (identifier_self) identifier_self (identifier_index) identifier_index )attribute (block (expression_statement (assignment (identifier_key) identifier_key (call (attribute (identifier_self) identifier_self (identifier_key) identifier_key )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier__old) identifier__old )attribute )comparison_operator (block (expression_statement (call (attribute (identifier_redis) identifier_redis (identifier_hdel) identifier_hdel )attribute (argument_list (identifier_key) identifier_key (subscript (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier__old) identifier__old )attribute (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )subscript )argument_list )call )expression_statement )block )if_statement (if_statement (comparison_operator (identifier_value) identifier_value (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_redis) identifier_redis (identifier_hset) identifier_hset )attribute (argument_list (identifier_key) identifier_key (identifier_value) identifier_value (attribute (attribute (identifier_self) identifier_self (identifier_obj) identifier_obj )attribute (identifier_id) identifier_id )attribute )argument_list )call )expression_statement )block )if_statement )block )if_statement )block )function_definition )module
Sets this fields value in the databse
(module (function_definition (function_name_currentuser) function_name_currentuser (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_request) identifier_request (call (attribute (identifier_requests) identifier_requests (identifier_get) identifier_get )attribute (argument_list (call (attribute (string_'{0}/api/v3/user') string_'{0}/api/v3/user' (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_host) identifier_host )attribute )argument_list )call (keyword_argument (identifier_headers) identifier_headers (attribute (identifier_self) identifier_self (identifier_headers) identifier_headers )attribute )keyword_argument (keyword_argument (identifier_verify) identifier_verify (attribute (identifier_self) identifier_self (identifier_verify_ssl) identifier_verify_ssl )attribute )keyword_argument (keyword_argument (identifier_auth) identifier_auth (attribute (identifier_self) identifier_self (identifier_auth) identifier_auth )attribute )keyword_argument (keyword_argument (identifier_timeout) identifier_timeout (attribute (identifier_self) identifier_self (identifier_timeout) identifier_timeout )attribute )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_request) identifier_request (identifier_json) identifier_json )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Returns the current user parameters. The current user is linked to the secret token :return: a list with the current user properties
(module (function_definition (function_name_system) function_name_system (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier__base) identifier__base )attribute (integer_2) integer_2 )comparison_operator (block (return_statement (string_"NIST") string_"NIST" )return_statement )block (elif_clause (comparison_operator (attribute (identifier_self) identifier_self (identifier__base) identifier__base )attribute (integer_10) integer_10 )comparison_operator (block (return_statement (string_"SI") string_"SI" )return_statement )block )elif_clause (else_clause (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_"Instances mathematical base is an unsupported value: %s") string_"Instances mathematical base is an unsupported value: %s" (parenthesized_expression (call (identifier_str) identifier_str (argument_list (attribute (identifier_self) identifier_self (identifier__base) identifier__base )attribute )argument_list )call )parenthesized_expression )binary_operator )argument_list )call )raise_statement )block )else_clause )if_statement )block )function_definition )module
The system of units used to measure an instance
(module (function_definition (function_name__set_overlay_verify) function_name__set_overlay_verify (parameters (identifier_name) identifier_name (identifier_overlay_path) identifier_overlay_path (identifier_config_path) identifier_config_path )parameters (block (global_statement (identifier_DEBUG) identifier_DEBUG )global_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_config_path) identifier_config_path )argument_list )call (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_"Config path already exists! Not moving forward") string_"Config path already exists! Not moving forward" )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (string_"config_path: {0}") string_"config_path: {0}" (identifier_format) identifier_format )attribute (argument_list (identifier_config_path) identifier_config_path )argument_list )call )argument_list )call )expression_statement (return_statement (unary_operator (integer_1) integer_1 )unary_operator )return_statement )block )if_statement (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_config_path) identifier_config_path )argument_list )call )expression_statement (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (binary_operator (identifier_config_path) identifier_config_path (string_"/dtbo") string_"/dtbo" )binary_operator (string_'wb') string_'wb' )argument_list )call (as_pattern_target (identifier_outfile) identifier_outfile )as_pattern_target )as_pattern )with_item )with_clause (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_overlay_path) identifier_overlay_path (string_'rb') string_'rb' )argument_list )call (as_pattern_target (identifier_infile) identifier_infile )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_shutil) identifier_shutil (identifier_copyfileobj) identifier_copyfileobj )attribute (argument_list (identifier_infile) identifier_infile (identifier_outfile) identifier_outfile )argument_list )call )expression_statement )block )with_statement )block )with_statement (expression_statement (call (attribute (identifier_time) identifier_time (identifier_sleep) identifier_sleep )attribute (argument_list (float_0.2) float_0.2 )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_name) identifier_name (string_"CUST") string_"CUST" )comparison_operator (block (return_statement (integer_0) integer_0 )return_statement )block (elif_clause (comparison_operator (identifier_name) identifier_name (string_"PWM0") string_"PWM0" )comparison_operator (block (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_PWMSYSFSPATH) identifier_PWMSYSFSPATH )argument_list )call (block (if_statement (identifier_DEBUG) identifier_DEBUG (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_"PWM IS LOADED!") string_"PWM IS LOADED!" )argument_list )call )expression_statement )block )if_statement (return_statement (integer_0) integer_0 )return_statement )block (else_clause (block (if_statement (identifier_DEBUG) identifier_DEBUG (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_"ERROR LOAIDNG PWM0") string_"ERROR LOAIDNG PWM0" )argument_list )call )expression_statement )block )if_statement (return_statement (integer_1) integer_1 )return_statement )block )else_clause )if_statement )block )elif_clause (elif_clause (comparison_operator (identifier_name) identifier_name (string_"SPI2") string_"SPI2" )comparison_operator (block (if_statement (comparison_operator (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (identifier_SPI2SYSFSPATH) identifier_SPI2SYSFSPATH )argument_list )call (string_"") string_"" )comparison_operator (block (if_statement (identifier_DEBUG) identifier_DEBUG (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_"SPI2 IS LOADED!") string_"SPI2 IS LOADED!" )argument_list )call )expression_statement )block )if_statement (return_statement (integer_0) integer_0 )return_statement )block (else_clause (block (if_statement (identifier_DEBUG) identifier_DEBUG (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_"ERROR LOADING SPI2") string_"ERROR LOADING SPI2" )argument_list )call )expression_statement )block )if_statement (return_statement (integer_0) integer_0 )return_statement )block )else_clause )if_statement )block )elif_clause )if_statement )block )function_definition )module
_set_overlay_verify - Function to load the overlay and verify it was setup properly
(module (function_definition (function_name_disengage) function_name_disengage (parameters (identifier_self) identifier_self )parameters (block (if_statement (boolean_operator (attribute (identifier_self) identifier_self (identifier__driver) identifier__driver )attribute (call (attribute (attribute (identifier_self) identifier_self (identifier__driver) identifier__driver )attribute (identifier_is_connected) identifier_is_connected )attribute (argument_list )argument_list )call )boolean_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__driver) identifier__driver )attribute (identifier_home) identifier_home )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__engaged) identifier__engaged )attribute (False) False )assignment )expression_statement )block )if_statement )block )function_definition )module
Home the magnet
(module (function_definition (function_name_add) function_name_add (parameters (identifier_self) identifier_self (identifier_properties) identifier_properties )parameters (block (expression_statement (assignment (identifier_new_nic) identifier_new_nic (call (attribute (call (identifier_super) identifier_super (argument_list (identifier_FakedNicManager) identifier_FakedNicManager (identifier_self) identifier_self )argument_list )call (identifier_add) identifier_add )attribute (argument_list (identifier_properties) identifier_properties )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_partition) identifier_partition (attribute (identifier_self) identifier_self (identifier_parent) identifier_parent )attribute )assignment )expression_statement (if_statement (comparison_operator (string_'virtual-switch-uri') string_'virtual-switch-uri' (attribute (identifier_new_nic) identifier_new_nic (identifier_properties) identifier_properties )attribute )comparison_operator (block (expression_statement (assignment (identifier_vswitch_uri) identifier_vswitch_uri (subscript (attribute (identifier_new_nic) identifier_new_nic (identifier_properties) identifier_properties )attribute (string_'virtual-switch-uri') string_'virtual-switch-uri' )subscript )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_vswitch) identifier_vswitch (call (attribute (attribute (identifier_self) identifier_self (identifier_hmc) identifier_hmc )attribute (identifier_lookup_by_uri) identifier_lookup_by_uri )attribute (argument_list (identifier_vswitch_uri) identifier_vswitch_uri )argument_list )call )assignment )expression_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (raise_statement (call (identifier_InputError) identifier_InputError (argument_list (call (attribute (concatenated_string (string_"The virtual switch specified in the ") string_"The virtual switch specified in the " (string_"'virtual-switch-uri' property does not ") string_"'virtual-switch-uri' property does not " (string_"exist: {!r}") string_"exist: {!r}" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_vswitch_uri) identifier_vswitch_uri )argument_list )call )argument_list )call )raise_statement )block )except_clause )try_statement (expression_statement (assignment (identifier_connected_uris) identifier_connected_uris (subscript (attribute (identifier_vswitch) identifier_vswitch (identifier_properties) identifier_properties )attribute (string_'connected-vnic-uris') string_'connected-vnic-uris' )subscript )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_new_nic) identifier_new_nic (identifier_uri) identifier_uri )attribute (identifier_connected_uris) identifier_connected_uris )comparison_operator (block (expression_statement (call (attribute (identifier_connected_uris) identifier_connected_uris (identifier_append) identifier_append )attribute (argument_list (attribute (identifier_new_nic) identifier_new_nic (identifier_uri) identifier_uri )attribute )argument_list )call )expression_statement )block )if_statement )block )if_statement (if_statement (comparison_operator (string_'device-number') string_'device-number' (attribute (identifier_new_nic) identifier_new_nic (identifier_properties) identifier_properties )attribute )comparison_operator (block (expression_statement (assignment (identifier_devno) identifier_devno (call (attribute (identifier_partition) identifier_partition (identifier_devno_alloc) identifier_devno_alloc )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_new_nic) identifier_new_nic (identifier_properties) identifier_properties )attribute (string_'device-number') string_'device-number' )subscript (identifier_devno) identifier_devno )assignment )expression_statement )block )if_statement (assert_statement (comparison_operator (string_'nic-uris') string_'nic-uris' (attribute (identifier_partition) identifier_partition (identifier_properties) identifier_properties )attribute )comparison_operator )assert_statement (expression_statement (call (attribute (subscript (attribute (identifier_partition) identifier_partition (identifier_properties) identifier_properties )attribute (string_'nic-uris') string_'nic-uris' )subscript (identifier_append) identifier_append )attribute (argument_list (attribute (identifier_new_nic) identifier_new_nic (identifier_uri) identifier_uri )attribute )argument_list )call )expression_statement (return_statement (identifier_new_nic) identifier_new_nic )return_statement )block )function_definition )module
Add a faked NIC resource. Parameters: properties (dict): Resource properties. Special handling and requirements for certain properties: * 'element-id' will be auto-generated with a unique value across all instances of this resource type, if not specified. * 'element-uri' will be auto-generated based upon the element ID, if not specified. * 'class' will be auto-generated to 'nic', if not specified. * Either 'network-adapter-port-uri' (for backing ROCE adapters) or 'virtual-switch-uri'(for backing OSA or Hipersockets adapters) is required to be specified. * 'device-number' will be auto-generated with a unique value within the partition in the range 0x8000 to 0xFFFF, if not specified. This method also updates the 'nic-uris' property in the parent faked Partition resource, by adding the URI for the faked NIC resource. This method also updates the 'connected-vnic-uris' property in the virtual switch referenced by 'virtual-switch-uri' property, and sets it to the URI of the faked NIC resource. Returns: :class:`zhmcclient_mock.FakedNic`: The faked NIC resource. Raises: :exc:`zhmcclient_mock.InputError`: Some issue with the input properties.
(module (function_definition (function_name_process) function_name_process (parameters (identifier_self) identifier_self (identifier_metric) identifier_metric )parameters (block (for_statement (identifier_rule) identifier_rule (attribute (identifier_self) identifier_self (identifier_rules) identifier_rules )attribute (block (expression_statement (call (attribute (identifier_rule) identifier_rule (identifier_process) identifier_process )attribute (argument_list (identifier_metric) identifier_metric (identifier_self) identifier_self )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
process a single metric @type metric: diamond.metric.Metric @param metric: metric to process @rtype None
(module (function_definition (function_name_memory) function_name_memory (parameters (identifier_self) identifier_self )parameters (block (class_definition (identifier_GpuMemoryInfo) identifier_GpuMemoryInfo (argument_list (identifier_Structure) identifier_Structure )argument_list (block (expression_statement (assignment (identifier__fields_) identifier__fields_ (list (tuple (string_'total') string_'total' (identifier_c_ulonglong) identifier_c_ulonglong )tuple (tuple (string_'free') string_'free' (identifier_c_ulonglong) identifier_c_ulonglong )tuple (tuple (string_'used') string_'used' (identifier_c_ulonglong) identifier_c_ulonglong )tuple )list )assignment )expression_statement )block )class_definition (expression_statement (assignment (identifier_c_memory) identifier_c_memory (call (identifier_GpuMemoryInfo) identifier_GpuMemoryInfo (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (identifier__check_return) identifier__check_return (argument_list (call (call (attribute (identifier__NVML) identifier__NVML (identifier_get_function) identifier_get_function )attribute (argument_list (string_"nvmlDeviceGetMemoryInfo") string_"nvmlDeviceGetMemoryInfo" )argument_list )call (argument_list (attribute (identifier_self) identifier_self (identifier_hnd) identifier_hnd )attribute (call (identifier_byref) identifier_byref (argument_list (identifier_c_memory) identifier_c_memory )argument_list )call )argument_list )call )argument_list )call )expression_statement (return_statement (dictionary (pair (string_'total') string_'total' (attribute (identifier_c_memory) identifier_c_memory (identifier_total) identifier_total )attribute )pair (pair (string_'free') string_'free' (attribute (identifier_c_memory) identifier_c_memory (identifier_free) identifier_free )attribute )pair (pair (string_'used') string_'used' (attribute (identifier_c_memory) identifier_c_memory (identifier_used) identifier_used )attribute )pair )dictionary )return_statement )block )function_definition )module
Memory information in bytes Example: >>> print(ctx.device(0).memory()) {'total': 4238016512L, 'used': 434831360L, 'free': 3803185152L} Returns: total/used/free memory in bytes
(module (function_definition (function_name_floating_ip_disassociate) function_name_floating_ip_disassociate (parameters (identifier_self) identifier_self (identifier_server_name) identifier_server_name (identifier_floating_ip) identifier_floating_ip )parameters (block (expression_statement (assignment (identifier_nt_ks) identifier_nt_ks (attribute (identifier_self) identifier_self (identifier_compute_conn) identifier_compute_conn )attribute )assignment )expression_statement (expression_statement (assignment (identifier_server_) identifier_server_ (call (attribute (identifier_self) identifier_self (identifier_server_by_name) identifier_server_by_name )attribute (argument_list (identifier_server_name) identifier_server_name )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_server) identifier_server (call (attribute (attribute (identifier_nt_ks) identifier_nt_ks (identifier_servers) identifier_servers )attribute (identifier_get) identifier_get )attribute (argument_list (subscript (attribute (identifier_server_) identifier_server_ (identifier___dict__) identifier___dict__ )attribute (string_'id') string_'id' )subscript )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_remove_floating_ip) identifier_remove_floating_ip )attribute (argument_list (identifier_floating_ip) identifier_floating_ip )argument_list )call )expression_statement (return_statement (subscript (call (attribute (identifier_self) identifier_self (identifier_floating_ip_list) identifier_floating_ip_list )attribute (argument_list )argument_list )call (identifier_floating_ip) identifier_floating_ip )subscript )return_statement )block )function_definition )module
Disassociate a floating IP from server .. versionadded:: 2016.3.0
(module (function_definition (function_name_cli) function_name_cli (parameters (identifier_env) identifier_env (identifier_identifier) identifier_identifier (identifier_name) identifier_name (identifier_all) identifier_all (identifier_note) identifier_note )parameters (block (expression_statement (assignment (identifier_vsi) identifier_vsi (call (attribute (identifier_SoftLayer) identifier_SoftLayer (identifier_VSManager) identifier_VSManager )attribute (argument_list (attribute (identifier_env) identifier_env (identifier_client) identifier_client )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_vs_id) identifier_vs_id (call (attribute (identifier_helpers) identifier_helpers (identifier_resolve_id) identifier_resolve_id )attribute (argument_list (attribute (identifier_vsi) identifier_vsi (identifier_resolve_ids) identifier_resolve_ids )attribute (identifier_identifier) identifier_identifier (string_'VS') string_'VS' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_capture) identifier_capture (call (attribute (identifier_vsi) identifier_vsi (identifier_capture) identifier_capture )attribute (argument_list (identifier_vs_id) identifier_vs_id (identifier_name) identifier_name (identifier_all) identifier_all (identifier_note) identifier_note )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_table) identifier_table (call (attribute (identifier_formatting) identifier_formatting (identifier_KeyValueTable) identifier_KeyValueTable )attribute (argument_list (list (string_'name') string_'name' (string_'value') string_'value' )list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_table) identifier_table (identifier_align) identifier_align )attribute (string_'name') string_'name' )subscript (string_'r') string_'r' )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_table) identifier_table (identifier_align) identifier_align )attribute (string_'value') string_'value' )subscript (string_'l') string_'l' )assignment )expression_statement (expression_statement (call (attribute (identifier_table) identifier_table (identifier_add_row) identifier_add_row )attribute (argument_list (list (string_'vs_id') string_'vs_id' (subscript (identifier_capture) identifier_capture (string_'guestId') string_'guestId' )subscript )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_table) identifier_table (identifier_add_row) identifier_add_row )attribute (argument_list (list (string_'date') string_'date' (subscript (subscript (identifier_capture) identifier_capture (string_'createDate') string_'createDate' )subscript (slice (colon) colon (integer_10) integer_10 )slice )subscript )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_table) identifier_table (identifier_add_row) identifier_add_row )attribute (argument_list (list (string_'time') string_'time' (subscript (subscript (identifier_capture) identifier_capture (string_'createDate') string_'createDate' )subscript (slice (integer_11) integer_11 (colon) colon (integer_19) integer_19 )slice )subscript )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_table) identifier_table (identifier_add_row) identifier_add_row )attribute (argument_list (list (string_'transaction') string_'transaction' (call (attribute (identifier_formatting) identifier_formatting (identifier_transaction_status) identifier_transaction_status )attribute (argument_list (identifier_capture) identifier_capture )argument_list )call )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_table) identifier_table (identifier_add_row) identifier_add_row )attribute (argument_list (list (string_'transaction_id') string_'transaction_id' (subscript (identifier_capture) identifier_capture (string_'id') string_'id' )subscript )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_table) identifier_table (identifier_add_row) identifier_add_row )attribute (argument_list (list (string_'all_disks') string_'all_disks' (identifier_all) identifier_all )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_env) identifier_env (identifier_fout) identifier_fout )attribute (argument_list (identifier_table) identifier_table )argument_list )call )expression_statement )block )function_definition )module
Capture one or all disks from a virtual server to a SoftLayer image.
(module (function_definition (function_name_get_FORCE_SETS_lines) function_name_get_FORCE_SETS_lines (parameters (identifier_dataset) identifier_dataset (default_parameter (identifier_forces) identifier_forces (None) None )default_parameter )parameters (block (if_statement (comparison_operator (string_'first_atoms') string_'first_atoms' (identifier_dataset) identifier_dataset )comparison_operator (block (return_statement (call (identifier__get_FORCE_SETS_lines_type1) identifier__get_FORCE_SETS_lines_type1 (argument_list (identifier_dataset) identifier_dataset (keyword_argument (identifier_forces) identifier_forces (identifier_forces) identifier_forces )keyword_argument )argument_list )call )return_statement )block (elif_clause (comparison_operator (string_'forces') string_'forces' (identifier_dataset) identifier_dataset )comparison_operator (block (return_statement (call (identifier__get_FORCE_SETS_lines_type2) identifier__get_FORCE_SETS_lines_type2 (argument_list (identifier_dataset) identifier_dataset )argument_list )call )return_statement )block )elif_clause )if_statement )block )function_definition )module
Generate FORCE_SETS string See the format of dataset in the docstring of Phonopy.set_displacement_dataset. Optionally for the type-1 (traditional) format, forces can be given. In this case, sets of forces are unnecessary to be stored in the dataset.
(module (function_definition (function_name_datasets) function_name_datasets (parameters (default_parameter (identifier_data) identifier_data (string_'all') string_'all' )default_parameter (default_parameter (identifier_type) identifier_type (None) None )default_parameter (default_parameter (identifier_uuid) identifier_uuid (None) None )default_parameter (default_parameter (identifier_query) identifier_query (None) None )default_parameter (default_parameter (identifier_id) identifier_id (None) None )default_parameter (default_parameter (identifier_limit) identifier_limit (integer_100) integer_100 )default_parameter (default_parameter (identifier_offset) identifier_offset (None) None )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_args) identifier_args (dictionary (pair (string_'q') string_'q' (identifier_query) identifier_query )pair (pair (string_'type') string_'type' (identifier_type) identifier_type )pair (pair (string_'limit') string_'limit' (identifier_limit) identifier_limit )pair (pair (string_'offset') string_'offset' (identifier_offset) identifier_offset )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_data_choices) identifier_data_choices (list (string_'all') string_'all' (string_'organization') string_'organization' (string_'contact') string_'contact' (string_'endpoint') string_'endpoint' (string_'identifier') string_'identifier' (string_'tag') string_'tag' (string_'machinetag') string_'machinetag' (string_'comment') string_'comment' (string_'constituents') string_'constituents' (string_'document') string_'document' (string_'metadata') string_'metadata' (string_'deleted') string_'deleted' (string_'duplicate') string_'duplicate' (string_'subDataset') string_'subDataset' (string_'withNoEndpoint') string_'withNoEndpoint' )list )assignment )expression_statement (expression_statement (call (identifier_check_data) identifier_check_data (argument_list (identifier_data) identifier_data (identifier_data_choices) identifier_data_choices )argument_list )call )expression_statement (if_statement (comparison_operator (call (identifier_len2) identifier_len2 (argument_list (identifier_data) identifier_data )argument_list )call (integer_1) integer_1 )comparison_operator (block (return_statement (call (identifier_datasets_fetch) identifier_datasets_fetch (argument_list (identifier_data) identifier_data (identifier_uuid) identifier_uuid (identifier_args) identifier_args (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (else_clause (block (return_statement (list_comprehension (call (identifier_datasets_fetch) identifier_datasets_fetch (argument_list (identifier_x) identifier_x (identifier_uuid) identifier_uuid (identifier_args) identifier_args (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call (for_in_clause (identifier_x) identifier_x (identifier_data) identifier_data )for_in_clause )list_comprehension )return_statement )block )else_clause )if_statement )block )function_definition )module
Search for datasets and dataset metadata. :param data: [str] The type of data to get. Default: ``all`` :param type: [str] Type of dataset, options include ``OCCURRENCE``, etc. :param uuid: [str] UUID of the data node provider. This must be specified if data is anything other than ``all``. :param query: [str] Query term(s). Only used when ``data = 'all'`` :param id: [int] A metadata document id. References http://www.gbif.org/developer/registry#datasets Usage:: from pygbif import registry registry.datasets(limit=5) registry.datasets(type="OCCURRENCE") registry.datasets(uuid="a6998220-7e3a-485d-9cd6-73076bd85657") registry.datasets(data='contact', uuid="a6998220-7e3a-485d-9cd6-73076bd85657") registry.datasets(data='metadata', uuid="a6998220-7e3a-485d-9cd6-73076bd85657") registry.datasets(data='metadata', uuid="a6998220-7e3a-485d-9cd6-73076bd85657", id=598) registry.datasets(data=['deleted','duplicate']) registry.datasets(data=['deleted','duplicate'], limit=1)
(module (function_definition (function_name_popen_multiple) function_name_popen_multiple (parameters (identifier_commands) identifier_commands (identifier_command_args) identifier_command_args (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (for_statement (pattern_list (identifier_i) identifier_i (identifier_command) identifier_command )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_commands) identifier_commands )argument_list )call (block (expression_statement (assignment (identifier_cmd) identifier_cmd (binary_operator (list (identifier_command) identifier_command )list (identifier_command_args) identifier_command_args )binary_operator )assignment )expression_statement (try_statement (block (return_statement (call (attribute (identifier_subprocess) identifier_subprocess (identifier_Popen) identifier_Popen )attribute (argument_list (identifier_cmd) identifier_cmd (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (except_clause (identifier_OSError) identifier_OSError (block (if_statement (comparison_operator (identifier_i) identifier_i (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_commands) identifier_commands )argument_list )call (integer_1) integer_1 )binary_operator )comparison_operator (block (raise_statement )raise_statement )block )if_statement )block )except_clause )try_statement )block )for_statement )block )function_definition )module
Like `subprocess.Popen`, but can try multiple commands in case some are not available. `commands` is an iterable of command names and `command_args` are the rest of the arguments that, when appended to the command name, make up the full first argument to `subprocess.Popen`. The other positional and keyword arguments are passed through.
(module (function_definition (function_name_setup) function_name_setup (parameters (identifier_app) identifier_app )parameters (block (expression_statement (call (attribute (identifier_app) identifier_app (identifier_add_domain) identifier_add_domain )attribute (argument_list (identifier_EverettDomain) identifier_EverettDomain )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_app) identifier_app (identifier_add_directive) identifier_add_directive )attribute (argument_list (string_'autocomponent') string_'autocomponent' (identifier_AutoComponentDirective) identifier_AutoComponentDirective )argument_list )call )expression_statement (return_statement (dictionary (pair (string_'version') string_'version' (identifier___version__) identifier___version__ )pair (pair (string_'parallel_read_safe') string_'parallel_read_safe' (True) True )pair (pair (string_'parallel_write_safe') string_'parallel_write_safe' (True) True )pair )dictionary )return_statement )block )function_definition )module
Register domain and directive in Sphinx.
(module (function_definition (function_name_received_new) function_name_received_new (parameters (identifier_self) identifier_self (identifier_msg) identifier_msg )parameters (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_info) identifier_info )attribute (argument_list (string_"Receiving msg, delivering to Lamson...") string_"Receiving msg, delivering to Lamson..." )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_"Relaying msg to lamson: From: %s, To: %s") string_"Relaying msg to lamson: From: %s, To: %s" (subscript (identifier_msg) identifier_msg (string_'From') string_'From' )subscript (subscript (identifier_msg) identifier_msg (string_'To') string_'To' )subscript )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__relay) identifier__relay )attribute (identifier_deliver) identifier_deliver )attribute (argument_list (identifier_msg) identifier_msg )argument_list )call )expression_statement )block )function_definition )module
As new messages arrive, deliver them to the lamson relay.
(module (function_definition (function_name_salt_call) function_name_salt_call (parameters )parameters (block (import_statement (dotted_name (identifier_salt) identifier_salt (identifier_cli) identifier_cli (identifier_call) identifier_call )dotted_name )import_statement (if_statement (comparison_operator (string_'') string_'' (attribute (identifier_sys) identifier_sys (identifier_path) identifier_path )attribute )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_sys) identifier_sys (identifier_path) identifier_path )attribute (identifier_remove) identifier_remove )attribute (argument_list (string_'') string_'' )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (identifier_client) identifier_client (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_cli) identifier_cli )attribute (identifier_call) identifier_call )attribute (identifier_SaltCall) identifier_SaltCall )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (identifier__install_signal_handlers) identifier__install_signal_handlers (argument_list (identifier_client) identifier_client )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_client) identifier_client (identifier_run) identifier_run )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Directly call a salt command in the modules, does not require a running salt minion to run.
(module (function_definition (function_name_read) function_name_read (parameters (identifier_self) identifier_self (identifier_filename) identifier_filename )parameters (block (try_statement (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_filename) identifier_filename (string_'r') string_'r' )argument_list )call (as_pattern_target (identifier__file) identifier__file )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__filename) identifier__filename )attribute (identifier_filename) identifier_filename )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_readstream) identifier_readstream )attribute (argument_list (identifier__file) identifier__file )argument_list )call )expression_statement )block )with_statement (return_statement (True) True )return_statement )block (except_clause (identifier_IOError) identifier_IOError (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__filename) identifier__filename )attribute (None) None )assignment )expression_statement (return_statement (False) False )return_statement )block )except_clause )try_statement )block )function_definition )module
Reads the file specified and tokenizes the data for parsing.
(module (function_definition (function_name_integrate_fluxes) function_name_integrate_fluxes (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_fluxes) identifier_fluxes (attribute (attribute (identifier_self) identifier_self (identifier_sequences) identifier_sequences )attribute (identifier_fluxes) identifier_fluxes )attribute )assignment )expression_statement (for_statement (identifier_flux) identifier_flux (attribute (identifier_fluxes) identifier_fluxes (identifier_numerics) identifier_numerics )attribute (block (expression_statement (assignment (identifier_points) identifier_points (call (identifier_getattr) identifier_getattr (argument_list (attribute (identifier_fluxes) identifier_fluxes (identifier_fastaccess) identifier_fastaccess )attribute (binary_operator (string_'_%s_points') string_'_%s_points' (attribute (identifier_flux) identifier_flux (identifier_name) identifier_name )attribute )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_coefs) identifier_coefs (subscript (attribute (attribute (identifier_self) identifier_self (identifier_numconsts) identifier_numconsts )attribute (identifier_a_coefs) identifier_a_coefs )attribute (binary_operator (attribute (attribute (identifier_self) identifier_self (identifier_numvars) identifier_numvars )attribute (identifier_idx_method) identifier_idx_method )attribute (integer_1) integer_1 )binary_operator (attribute (attribute (identifier_self) identifier_self (identifier_numvars) identifier_numvars )attribute (identifier_idx_stage) identifier_idx_stage )attribute (slice (colon) colon (attribute (attribute (identifier_self) identifier_self (identifier_numvars) identifier_numvars )attribute (identifier_idx_method) identifier_idx_method )attribute )slice )subscript )assignment )expression_statement (expression_statement (call (identifier_flux) identifier_flux (argument_list (binary_operator (attribute (attribute (identifier_self) identifier_self (identifier_numvars) identifier_numvars )attribute (identifier_dt) identifier_dt )attribute (call (attribute (identifier_numpy) identifier_numpy (identifier_dot) identifier_dot )attribute (argument_list (identifier_coefs) identifier_coefs (subscript (identifier_points) identifier_points (slice (colon) colon (attribute (attribute (identifier_self) identifier_self (identifier_numvars) identifier_numvars )attribute (identifier_idx_method) identifier_idx_method )attribute )slice )subscript )argument_list )call )binary_operator )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Perform a dot multiplication between the fluxes and the A coefficients associated with the different stages of the actual method. >>> from hydpy.models.test_v1 import * >>> parameterstep() >>> model.numvars.idx_method = 2 >>> model.numvars.idx_stage = 1 >>> model.numvars.dt = 0.5 >>> points = numpy.asarray(fluxes.fastaccess._q_points) >>> points[:4] = 15., 2., -999., 0. >>> model.integrate_fluxes() >>> from hydpy import round_ >>> from hydpy import pub >>> round_(numpy.asarray(model.numconsts.a_coefs)[1, 1, :2]) 0.375, 0.125 >>> fluxes.q q(2.9375)
(module (function_definition (function_name_put) function_name_put (parameters (identifier_self) identifier_self (identifier_key) identifier_key (identifier_value) identifier_value (default_parameter (identifier_format) identifier_format (None) None )default_parameter (default_parameter (identifier_append) identifier_append (False) False )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (identifier_format) identifier_format (None) None )comparison_operator (block (expression_statement (assignment (identifier_format) identifier_format (boolean_operator (call (identifier_get_option) identifier_get_option (argument_list (string_"io.hdf.default_format") string_"io.hdf.default_format" )argument_list )call (string_'fixed') string_'fixed' )boolean_operator )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_kwargs) identifier_kwargs (call (attribute (identifier_self) identifier_self (identifier__validate_format) identifier__validate_format )attribute (argument_list (identifier_format) identifier_format (identifier_kwargs) identifier_kwargs )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__write_to_group) identifier__write_to_group )attribute (argument_list (identifier_key) identifier_key (identifier_value) identifier_value (keyword_argument (identifier_append) identifier_append (identifier_append) identifier_append )keyword_argument (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement )block )function_definition )module
Store object in HDFStore Parameters ---------- key : object value : {Series, DataFrame} format : 'fixed(f)|table(t)', default is 'fixed' fixed(f) : Fixed format Fast writing/reading. Not-appendable, nor searchable table(t) : Table format Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data append : boolean, default False This will force Table format, append the input data to the existing. data_columns : list of columns to create as data columns, or True to use all columns. See `here <http://pandas.pydata.org/pandas-docs/stable/io.html#query-via-data-columns>`__ # noqa encoding : default None, provide an encoding for strings dropna : boolean, default False, do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table'
(module (function_definition (function_name__get_logging_id) function_name__get_logging_id (parameters (identifier_self) identifier_self )parameters (block (return_statement (call (attribute (string_"{}.{}/{}") string_"{}.{}/{}" (identifier_format) identifier_format )attribute (argument_list (attribute (attribute (attribute (identifier_self) identifier_self (identifier__request) identifier__request )attribute (identifier_viewset_class) identifier_viewset_class )attribute (identifier___module__) identifier___module__ )attribute (attribute (attribute (attribute (identifier_self) identifier_self (identifier__request) identifier__request )attribute (identifier_viewset_class) identifier_viewset_class )attribute (identifier___name__) identifier___name__ )attribute (attribute (attribute (identifier_self) identifier_self (identifier__request) identifier__request )attribute (identifier_viewset_method) identifier_viewset_method )attribute )argument_list )call )return_statement )block )function_definition )module
Get logging identifier.
(module (function_definition (function_name_select_token) function_name_select_token (parameters (identifier_request) identifier_request (default_parameter (identifier_scopes) identifier_scopes (string_'') string_'' )default_parameter (default_parameter (identifier_new) identifier_new (False) False )default_parameter )parameters (block (decorated_definition (decorator (call (identifier_tokens_required) identifier_tokens_required (argument_list (keyword_argument (identifier_scopes) identifier_scopes (identifier_scopes) identifier_scopes )keyword_argument (keyword_argument (identifier_new) identifier_new (identifier_new) identifier_new )keyword_argument )argument_list )call )decorator (function_definition (function_name__token_list) function_name__token_list (parameters (identifier_r) identifier_r (identifier_tokens) identifier_tokens )parameters (block (expression_statement (assignment (identifier_context) identifier_context (dictionary (pair (string_'tokens') string_'tokens' (identifier_tokens) identifier_tokens )pair (pair (string_'base_template') string_'base_template' (attribute (identifier_app_settings) identifier_app_settings (identifier_ESI_BASE_TEMPLATE) identifier_ESI_BASE_TEMPLATE )attribute )pair )dictionary )assignment )expression_statement (return_statement (call (identifier_render) identifier_render (argument_list (identifier_r) identifier_r (string_'esi/select_token.html') string_'esi/select_token.html' (keyword_argument (identifier_context) identifier_context (identifier_context) identifier_context )keyword_argument )argument_list )call )return_statement )block )function_definition )decorated_definition (return_statement (call (identifier__token_list) identifier__token_list (argument_list (identifier_request) identifier_request )argument_list )call )return_statement )block )function_definition )module
Presents the user with a selection of applicable tokens for the requested view.
(module (function_definition (function_name_is_format_selected) function_name_is_format_selected (parameters (identifier_image_format) identifier_image_format (identifier_formats) identifier_formats (identifier_progs) identifier_progs )parameters (block (expression_statement (assignment (identifier_intersection) identifier_intersection (binary_operator (identifier_formats) identifier_formats (attribute (identifier_Settings) identifier_Settings (identifier_formats) identifier_formats )attribute )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_mode) identifier_mode (call (identifier__is_program_selected) identifier__is_program_selected (argument_list (identifier_progs) identifier_progs )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (boolean_operator (parenthesized_expression (comparison_operator (identifier_image_format) identifier_image_format (identifier_intersection) identifier_intersection )comparison_operator )parenthesized_expression (identifier_mode) identifier_mode )boolean_operator )assignment )expression_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Determine if the image format is selected by command line arguments.
(module (function_definition (function_name_validate) function_name_validate (parameters (identifier_config) identifier_config )parameters (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_config) identifier_config (identifier_list) identifier_list )argument_list )call )not_operator (block (return_statement (expression_list (False) False (string_'Configuration for napalm beacon must be a list.') string_'Configuration for napalm beacon must be a list.' )expression_list )return_statement )block )if_statement (for_statement (identifier_mod) identifier_mod (identifier_config) identifier_config (block (expression_statement (assignment (identifier_fun) identifier_fun (subscript (call (attribute (identifier_mod) identifier_mod (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_fun_cfg) identifier_fun_cfg (subscript (call (attribute (identifier_mod) identifier_mod (identifier_values) identifier_values )attribute (argument_list )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_fun_cfg) identifier_fun_cfg (identifier_dict) identifier_dict )argument_list )call )not_operator (block (return_statement (expression_list (False) False (call (attribute (string_'The match structure for the {} execution function output must be a dictionary') string_'The match structure for the {} execution function output must be a dictionary' (identifier_format) identifier_format )attribute (argument_list (identifier_fun) identifier_fun )argument_list )call )expression_list )return_statement )block )if_statement (if_statement (comparison_operator (identifier_fun) identifier_fun (identifier___salt__) identifier___salt__ )comparison_operator (block (return_statement (expression_list (False) False (call (attribute (string_'Execution function {} is not availabe!') string_'Execution function {} is not availabe!' (identifier_format) identifier_format )attribute (argument_list (identifier_fun) identifier_fun )argument_list )call )expression_list )return_statement )block )if_statement )block )for_statement (return_statement (expression_list (True) True (string_'Valid configuration for the napal beacon!') string_'Valid configuration for the napal beacon!' )expression_list )return_statement )block )function_definition )module
Validate the beacon configuration.
(module (function_definition (function_name_truncate_rows) function_name_truncate_rows (parameters (identifier_A) identifier_A (identifier_nz_per_row) identifier_nz_per_row )parameters (block (if_statement (not_operator (call (identifier_isspmatrix) identifier_isspmatrix (argument_list (identifier_A) identifier_A )argument_list )call )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"Sparse matrix input needed") string_"Sparse matrix input needed" )argument_list )call )raise_statement )block )if_statement (if_statement (call (identifier_isspmatrix_bsr) identifier_isspmatrix_bsr (argument_list (identifier_A) identifier_A )argument_list )call (block (expression_statement (assignment (identifier_blocksize) identifier_blocksize (attribute (identifier_A) identifier_A (identifier_blocksize) identifier_blocksize )attribute )assignment )expression_statement )block )if_statement (if_statement (call (identifier_isspmatrix_csr) identifier_isspmatrix_csr (argument_list (identifier_A) identifier_A )argument_list )call (block (expression_statement (assignment (identifier_A) identifier_A (call (attribute (identifier_A) identifier_A (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_Aformat) identifier_Aformat (attribute (identifier_A) identifier_A (identifier_format) identifier_format )attribute )assignment )expression_statement (expression_statement (assignment (identifier_A) identifier_A (call (attribute (identifier_A) identifier_A (identifier_tocsr) identifier_tocsr )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_nz_per_row) identifier_nz_per_row (call (identifier_int) identifier_int (argument_list (identifier_nz_per_row) identifier_nz_per_row )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_pyamg) identifier_pyamg (identifier_amg_core) identifier_amg_core )attribute (identifier_truncate_rows_csr) identifier_truncate_rows_csr )attribute (argument_list (subscript (attribute (identifier_A) identifier_A (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript (identifier_nz_per_row) identifier_nz_per_row (attribute (identifier_A) identifier_A (identifier_indptr) identifier_indptr )attribute (attribute (identifier_A) identifier_A (identifier_indices) identifier_indices )attribute (attribute (identifier_A) identifier_A (identifier_data) identifier_data )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_A) identifier_A (identifier_eliminate_zeros) identifier_eliminate_zeros )attribute (argument_list )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_Aformat) identifier_Aformat (string_'bsr') string_'bsr' )comparison_operator (block (expression_statement (assignment (identifier_A) identifier_A (call (attribute (identifier_A) identifier_A (identifier_tobsr) identifier_tobsr )attribute (argument_list (identifier_blocksize) identifier_blocksize )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_A) identifier_A (call (attribute (identifier_A) identifier_A (identifier_asformat) identifier_asformat )attribute (argument_list (identifier_Aformat) identifier_Aformat )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (return_statement (identifier_A) identifier_A )return_statement )block )function_definition )module
Truncate the rows of A by keeping only the largest in magnitude entries in each row. Parameters ---------- A : sparse_matrix nz_per_row : int Determines how many entries in each row to keep Returns ------- A : sparse_matrix Each row has been truncated to at most nz_per_row entries Examples -------- >>> from pyamg.gallery import poisson >>> from pyamg.util.utils import truncate_rows >>> from scipy import array >>> from scipy.sparse import csr_matrix >>> A = csr_matrix( array([[-0.24, -0.5 , 0. , 0. ], ... [ 1. , -1.1 , 0.49, 0.1 ], ... [ 0. , 0.4 , 1. , 0.5 ]]) ) >>> truncate_rows(A, 2).todense() matrix([[-0.24, -0.5 , 0. , 0. ], [ 1. , -1.1 , 0. , 0. ], [ 0. , 0. , 1. , 0.5 ]])
(module (function_definition (function_name_difference) function_name_difference (parameters (identifier_self) identifier_self (identifier_other) identifier_other )parameters (block (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier_is_valid_range) identifier_is_valid_range )attribute (argument_list (identifier_other) identifier_other )argument_list )call )not_operator (block (expression_statement (assignment (identifier_msg) identifier_msg (string_"Unsupported type to test for difference '{.__class__.__name__}'") string_"Unsupported type to test for difference '{.__class__.__name__}'" )assignment )expression_statement (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (call (attribute (identifier_msg) identifier_msg (identifier_format) identifier_format )attribute (argument_list (identifier_other) identifier_other )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (boolean_operator (boolean_operator (not_operator (identifier_self) identifier_self )not_operator (not_operator (identifier_other) identifier_other )not_operator )boolean_operator (not_operator (call (attribute (identifier_self) identifier_self (identifier_overlap) identifier_overlap )attribute (argument_list (identifier_other) identifier_other )argument_list )call )not_operator )boolean_operator (block (return_statement (identifier_self) identifier_self )return_statement )block (elif_clause (comparison_operator (identifier_self) identifier_self (identifier_other) identifier_other )comparison_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_empty) identifier_empty )attribute (argument_list )argument_list )call )return_statement )block )elif_clause (elif_clause (boolean_operator (comparison_operator (identifier_other) identifier_other (identifier_self) identifier_self )comparison_operator (not_operator (parenthesized_expression (boolean_operator (call (attribute (identifier_self) identifier_self (identifier_startswith) identifier_startswith )attribute (argument_list (identifier_other) identifier_other )argument_list )call (call (attribute (identifier_self) identifier_self (identifier_endswith) identifier_endswith )attribute (argument_list (identifier_other) identifier_other )argument_list )call )boolean_operator )parenthesized_expression )not_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"Other range must not be within this range") string_"Other range must not be within this range" )argument_list )call )raise_statement )block )elif_clause (elif_clause (call (attribute (identifier_self) identifier_self (identifier_endsbefore) identifier_endsbefore )attribute (argument_list (identifier_other) identifier_other )argument_list )call (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_replace) identifier_replace )attribute (argument_list (keyword_argument (identifier_upper) identifier_upper (attribute (identifier_other) identifier_other (identifier_lower) identifier_lower )attribute )keyword_argument (keyword_argument (identifier_upper_inc) identifier_upper_inc (not_operator (attribute (identifier_other) identifier_other (identifier_lower_inc) identifier_lower_inc )attribute )not_operator )keyword_argument )argument_list )call )return_statement )block )elif_clause (elif_clause (call (attribute (identifier_self) identifier_self (identifier_startsafter) identifier_startsafter )attribute (argument_list (identifier_other) identifier_other )argument_list )call (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_replace) identifier_replace )attribute (argument_list (keyword_argument (identifier_lower) identifier_lower (attribute (identifier_other) identifier_other (identifier_upper) identifier_upper )attribute )keyword_argument (keyword_argument (identifier_lower_inc) identifier_lower_inc (not_operator (attribute (identifier_other) identifier_other (identifier_upper_inc) identifier_upper_inc )attribute )not_operator )keyword_argument )argument_list )call )return_statement )block )elif_clause (else_clause (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_empty) identifier_empty )attribute (argument_list )argument_list )call )return_statement )block )else_clause )if_statement )block )function_definition )module
Compute the difference between this and a given range. >>> intrange(1, 10).difference(intrange(10, 15)) intrange([1,10)) >>> intrange(1, 10).difference(intrange(5, 10)) intrange([1,5)) >>> intrange(1, 5).difference(intrange(5, 10)) intrange([1,5)) >>> intrange(1, 5).difference(intrange(1, 10)) intrange(empty) The difference can not be computed if the resulting range would be split in two separate ranges. This happens when the given range is completely within this range and does not start or end at the same value. >>> intrange(1, 15).difference(intrange(5, 10)) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: Other range must not be within this range This does not modify the range in place. This is the same as the ``-`` operator for two ranges in PostgreSQL. :param other: Range to difference against. :return: A new range that is the difference between this and `other`. :raises ValueError: If difference bethween this and `other` can not be computed.
(module (function_definition (function_name_get_backend_path) function_name_get_backend_path (parameters (identifier_service) identifier_service )parameters (block (for_statement (identifier_backend) identifier_backend (call (identifier__get_backends) identifier__get_backends (argument_list )argument_list )call (block (try_statement (block (if_statement (call (attribute (identifier_backend) identifier_backend (identifier_service_allowed) identifier_service_allowed )attribute (argument_list (identifier_service) identifier_service )argument_list )call (block (return_statement (binary_operator (string_"%s.%s") string_"%s.%s" (tuple (attribute (attribute (identifier_backend) identifier_backend (identifier___class__) identifier___class__ )attribute (identifier___module__) identifier___module__ )attribute (attribute (attribute (identifier_backend) identifier_backend (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute )tuple )binary_operator )return_statement )block )if_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (raise_statement (call (identifier_NotImplementedError) identifier_NotImplementedError (argument_list (binary_operator (string_"%s.%s.service_allowed() not implemented") string_"%s.%s.service_allowed() not implemented" (tuple (attribute (attribute (identifier_backend) identifier_backend (identifier___class__) identifier___class__ )attribute (identifier___module__) identifier___module__ )attribute (attribute (attribute (identifier_backend) identifier_backend (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute )tuple )binary_operator )argument_list )call )raise_statement )block )except_clause )try_statement )block )for_statement (return_statement (None) None )return_statement )block )function_definition )module
Return the dotted path of the matching backend.
(module (function_definition (function_name_setup_webserver) function_name_setup_webserver (parameters )parameters (block (expression_statement (call (identifier_run) identifier_run (argument_list (string_'sudo apt-get update') string_'sudo apt-get update' )argument_list )call )expression_statement (expression_statement (call (identifier_install_packages) identifier_install_packages (argument_list (identifier_packages_webserver) identifier_packages_webserver )argument_list )call )expression_statement (expression_statement (call (identifier_execute) identifier_execute (argument_list (attribute (identifier_custom) identifier_custom (identifier_latex) identifier_latex )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_execute) identifier_execute (argument_list (attribute (identifier_setup) identifier_setup (identifier_solarized) identifier_solarized )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_execute) identifier_execute (argument_list (attribute (identifier_setup) identifier_setup (identifier_vim) identifier_vim )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_execute) identifier_execute (argument_list (attribute (identifier_setup) identifier_setup (identifier_tmux) identifier_tmux )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_checkup_git_repo_legacy) identifier_checkup_git_repo_legacy (argument_list (keyword_argument (identifier_url) identifier_url (string_'git@github.com:letsencrypt/letsencrypt.git') string_'git@github.com:letsencrypt/letsencrypt.git' )keyword_argument )argument_list )call )expression_statement (expression_statement (call (identifier_execute) identifier_execute (argument_list (attribute (attribute (identifier_setup) identifier_setup (identifier_service) identifier_service )attribute (identifier_fdroid) identifier_fdroid )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_execute) identifier_execute (argument_list (attribute (attribute (identifier_setup) identifier_setup (identifier_service) identifier_service )attribute (identifier_owncloud) identifier_owncloud )attribute )argument_list )call )expression_statement (import_from_statement (dotted_name (identifier_fabfile) identifier_fabfile )dotted_name (dotted_name (identifier_dfh) identifier_dfh )dotted_name (dotted_name (identifier_check_reboot) identifier_check_reboot )dotted_name )import_from_statement (expression_statement (call (identifier_dfh) identifier_dfh (argument_list )argument_list )call )expression_statement (expression_statement (call (identifier_check_reboot) identifier_check_reboot (argument_list )argument_list )call )expression_statement )block )function_definition )module
Run setup tasks to set up a nicely configured webserver. Features: * owncloud service * fdroid repository * certificates via letsencrypt * and more The task is defined in file fabsetup_custom/fabfile_addtitions/__init__.py and could be customized by Your own needs. More info: README.md
(module (function_definition (function_name__from_string) function_name__from_string (parameters (identifier_cls) identifier_cls (identifier_serialized) identifier_serialized )parameters (block (expression_statement (assignment (identifier_course_key) identifier_course_key (call (attribute (identifier_CourseLocator) identifier_CourseLocator (identifier__from_string) identifier__from_string )attribute (argument_list (identifier_serialized) identifier_serialized )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_parsed_parts) identifier_parsed_parts (call (attribute (identifier_cls) identifier_cls (identifier_parse_url) identifier_parse_url )attribute (argument_list (identifier_serialized) identifier_serialized )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_block_id) identifier_block_id (call (attribute (identifier_parsed_parts) identifier_parsed_parts (identifier_get) identifier_get )attribute (argument_list (string_'block_id') string_'block_id' (None) None )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_block_id) identifier_block_id (None) None )comparison_operator (block (raise_statement (call (identifier_InvalidKeyError) identifier_InvalidKeyError (argument_list (identifier_cls) identifier_cls (identifier_serialized) identifier_serialized )argument_list )call )raise_statement )block )if_statement (return_statement (call (identifier_cls) identifier_cls (argument_list (identifier_course_key) identifier_course_key (call (attribute (identifier_parsed_parts) identifier_parsed_parts (identifier_get) identifier_get )attribute (argument_list (string_'block_type') string_'block_type' )argument_list )call (identifier_block_id) identifier_block_id )argument_list )call )return_statement )block )function_definition )module
Requests CourseLocator to deserialize its part and then adds the local deserialization of block
(module (function_definition (function_name_create) function_name_create (parameters (identifier_cls) identifier_cls (identifier_name) identifier_name (default_parameter (identifier_frame_type) identifier_frame_type (string_'eth2') string_'eth2' )default_parameter (default_parameter (identifier_value1) identifier_value1 (None) None )default_parameter (default_parameter (identifier_comment) identifier_comment (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_json) identifier_json (dictionary (pair (string_'frame_type') string_'frame_type' (identifier_frame_type) identifier_frame_type )pair (pair (string_'name') string_'name' (identifier_name) identifier_name )pair (pair (string_'value1') string_'value1' (call (identifier_int) identifier_int (argument_list (identifier_value1) identifier_value1 (integer_16) integer_16 )argument_list )call )pair (pair (string_'comment') string_'comment' (identifier_comment) identifier_comment )pair )dictionary )assignment )expression_statement (return_statement (call (identifier_ElementCreator) identifier_ElementCreator (argument_list (identifier_cls) identifier_cls (identifier_json) identifier_json )argument_list )call )return_statement )block )function_definition )module
Create an ethernet service :param str name: name of service :param str frame_type: ethernet frame type, eth2 :param str value1: hex code representing ethertype field :param str comment: optional comment :raises CreateElementFailed: failure creating element with reason :return: instance with meta :rtype: EthernetService
(module (function_definition (function_name_register_event) function_name_register_event (parameters (identifier_self) identifier_self (list_splat_pattern (identifier_names) identifier_names )list_splat_pattern )parameters (block (for_statement (identifier_name) identifier_name (identifier_names) identifier_names (block (if_statement (comparison_operator (identifier_name) identifier_name (attribute (identifier_self) identifier_self (identifier___events) identifier___events )attribute )comparison_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier___events) identifier___events )attribute (identifier_name) identifier_name )subscript (call (identifier_Event) identifier_Event (argument_list (identifier_name) identifier_name )argument_list )call )assignment )expression_statement )block )for_statement )block )function_definition )module
Registers new events after instance creation Args: *names (str): Name or names of the events to register
(module (function_definition (function_name_is_absolute) function_name_is_absolute (parameters (identifier_self) identifier_self )parameters (block (return_statement (boolean_operator (boolean_operator (boolean_operator (attribute (identifier_self) identifier_self (identifier_namespace) identifier_namespace )attribute (attribute (identifier_self) identifier_self (identifier_ext) identifier_ext )attribute )boolean_operator (attribute (identifier_self) identifier_self (identifier_scheme) identifier_scheme )attribute )boolean_operator (attribute (identifier_self) identifier_self (identifier_path) identifier_path )attribute )boolean_operator )return_statement )block )function_definition )module
Validates that uri contains all parts except version
(module (function_definition (function_name_pop) function_name_pop (parameters (identifier_self) identifier_self (identifier_option) identifier_option (default_parameter (identifier_default) identifier_default (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_val) identifier_val (subscript (identifier_self) identifier_self (identifier_option) identifier_option )subscript )assignment )expression_statement (delete_statement (subscript (identifier_self) identifier_self (identifier_option) identifier_option )subscript )delete_statement (return_statement (boolean_operator (parenthesized_expression (boolean_operator (comparison_operator (identifier_val) identifier_val (None) None )comparison_operator (identifier_default) identifier_default )boolean_operator )parenthesized_expression (identifier_val) identifier_val )boolean_operator )return_statement )block )function_definition )module
Just like `dict.pop`
(module (function_definition (function_name_get_downsample_pct) function_name_get_downsample_pct (parameters (identifier_in_bam) identifier_in_bam (identifier_target_counts) identifier_target_counts (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_total) identifier_total (call (identifier_sum) identifier_sum (generator_expression (attribute (identifier_x) identifier_x (identifier_aligned) identifier_aligned )attribute (for_in_clause (identifier_x) identifier_x (call (identifier_idxstats) identifier_idxstats (argument_list (identifier_in_bam) identifier_in_bam (identifier_data) identifier_data )argument_list )call )for_in_clause )generator_expression )call )assignment )expression_statement (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_pysam) identifier_pysam (identifier_Samfile) identifier_Samfile )attribute (argument_list (identifier_in_bam) identifier_in_bam (string_"rb") string_"rb" )argument_list )call (as_pattern_target (identifier_work_bam) identifier_work_bam )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_n_rgs) identifier_n_rgs (call (identifier_max) identifier_max (argument_list (integer_1) integer_1 (call (identifier_len) identifier_len (argument_list (call (attribute (attribute (identifier_work_bam) identifier_work_bam (identifier_header) identifier_header )attribute (identifier_get) identifier_get )attribute (argument_list (string_"RG") string_"RG" (list )list )argument_list )call )argument_list )call )argument_list )call )assignment )expression_statement )block )with_statement (expression_statement (assignment (identifier_rg_target) identifier_rg_target (binary_operator (identifier_n_rgs) identifier_n_rgs (identifier_target_counts) identifier_target_counts )binary_operator )assignment )expression_statement (if_statement (comparison_operator (identifier_total) identifier_total (identifier_rg_target) identifier_rg_target )comparison_operator (block (expression_statement (assignment (identifier_pct) identifier_pct (binary_operator (call (identifier_float) identifier_float (argument_list (identifier_rg_target) identifier_rg_target )argument_list )call (call (identifier_float) identifier_float (argument_list (identifier_total) identifier_total )argument_list )call )binary_operator )assignment )expression_statement (if_statement (comparison_operator (identifier_pct) identifier_pct (float_0.9) float_0.9 )comparison_operator (block (return_statement (identifier_pct) identifier_pct )return_statement )block )if_statement )block )if_statement )block )function_definition )module
Retrieve percentage of file to downsample to get to target counts. Avoids minimal downsample which is not especially useful for improving QC times; 90& or more of reads.
(module (function_definition (function_name_kinematic_flux) function_name_kinematic_flux (parameters (identifier_vel) identifier_vel (identifier_b) identifier_b (default_parameter (identifier_perturbation) identifier_perturbation (False) False )default_parameter (default_parameter (identifier_axis) identifier_axis (unary_operator (integer_1) integer_1 )unary_operator )default_parameter )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (expression_statement (assignment (identifier_kf) identifier_kf (call (attribute (identifier_np) identifier_np (identifier_mean) identifier_mean )attribute (argument_list (binary_operator (identifier_vel) identifier_vel (identifier_b) identifier_b )binary_operator (keyword_argument (identifier_axis) identifier_axis (identifier_axis) identifier_axis )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_perturbation) identifier_perturbation )not_operator (block (expression_statement (augmented_assignment (identifier_kf) identifier_kf (binary_operator (call (attribute (identifier_np) identifier_np (identifier_mean) identifier_mean )attribute (argument_list (identifier_vel) identifier_vel (keyword_argument (identifier_axis) identifier_axis (identifier_axis) identifier_axis )keyword_argument )argument_list )call (call (attribute (identifier_np) identifier_np (identifier_mean) identifier_mean )attribute (argument_list (identifier_b) identifier_b (keyword_argument (identifier_axis) identifier_axis (identifier_axis) identifier_axis )keyword_argument )argument_list )call )binary_operator )augmented_assignment )expression_statement )block )if_statement (return_statement (call (attribute (identifier_np) identifier_np (identifier_atleast_1d) identifier_atleast_1d )attribute (argument_list (identifier_kf) identifier_kf )argument_list )call )return_statement )block )function_definition )module
r"""Compute the kinematic flux from two time series. Compute the kinematic flux from the time series of two variables `vel` and b. Note that to be a kinematic flux, at least one variable must be a component of velocity. Parameters ---------- vel : array_like A component of velocity b : array_like May be a component of velocity or a scalar variable (e.g. Temperature) perturbation : bool, optional `True` if the `vel` and `b` variables are perturbations. If `False`, perturbations will be calculated by removing the mean value from each variable. Defaults to `False`. Returns ------- array_like The corresponding kinematic flux Other Parameters ---------------- axis : int, optional The index of the time axis, along which the calculations will be performed. Defaults to -1 Notes ----- A kinematic flux is computed as .. math:: \overline{u^{\prime} s^{\prime}} where at the prime notation denotes perturbation variables, and at least one variable is perturbation velocity. For example, the vertical kinematic momentum flux (two velocity components): .. math:: \overline{u^{\prime} w^{\prime}} or the vertical kinematic heat flux (one velocity component, and one scalar): .. math:: \overline{w^{\prime} T^{\prime}} If perturbation variables are passed into this function (i.e. `perturbation` is True), the kinematic flux is computed using the equation above. However, the equation above can be rewritten as .. math:: \overline{us} - \overline{u}~\overline{s} which is computationally more efficient. This is how the kinematic flux is computed in this function if `perturbation` is False. For more information on the subject, please see [Garratt1994]_.
(module (function_definition (function_name_remove_data_flows_with_data_port_id) function_name_remove_data_flows_with_data_port_id (parameters (identifier_self) identifier_self (identifier_data_port_id) identifier_data_port_id )parameters (block (if_statement (boolean_operator (not_operator (attribute (identifier_self) identifier_self (identifier_is_root_state) identifier_is_root_state )attribute )not_operator (not_operator (attribute (identifier_self) identifier_self (identifier_is_root_state_of_library) identifier_is_root_state_of_library )attribute )not_operator )boolean_operator (block (expression_statement (assignment (identifier_data_flow_ids_to_remove) identifier_data_flow_ids_to_remove (list )list )assignment )expression_statement (for_statement (pattern_list (identifier_data_flow_id) identifier_data_flow_id (identifier_data_flow) identifier_data_flow )pattern_list (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_parent) identifier_parent )attribute (identifier_data_flows) identifier_data_flows )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (if_statement (boolean_operator (boolean_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_from_state) identifier_from_state )attribute (attribute (identifier_self) identifier_self (identifier_state_id) identifier_state_id )attribute )comparison_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_from_key) identifier_from_key )attribute (identifier_data_port_id) identifier_data_port_id )comparison_operator )boolean_operator (line_continuation_\) line_continuation_\ (boolean_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_to_state) identifier_to_state )attribute (attribute (identifier_self) identifier_self (identifier_state_id) identifier_state_id )attribute )comparison_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_to_key) identifier_to_key )attribute (identifier_data_port_id) identifier_data_port_id )comparison_operator )boolean_operator )boolean_operator (block (expression_statement (call (attribute (identifier_data_flow_ids_to_remove) identifier_data_flow_ids_to_remove (identifier_append) identifier_append )attribute (argument_list (identifier_data_flow_id) identifier_data_flow_id )argument_list )call )expression_statement )block )if_statement )block )for_statement (for_statement (identifier_data_flow_id) identifier_data_flow_id (identifier_data_flow_ids_to_remove) identifier_data_flow_ids_to_remove (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_parent) identifier_parent )attribute (identifier_remove_data_flow) identifier_remove_data_flow )attribute (argument_list (identifier_data_flow_id) identifier_data_flow_id )argument_list )call )expression_statement )block )for_statement )block )if_statement (expression_statement (assignment (identifier_data_flow_ids_to_remove) identifier_data_flow_ids_to_remove (list )list )assignment )expression_statement (for_statement (pattern_list (identifier_data_flow_id) identifier_data_flow_id (identifier_data_flow) identifier_data_flow )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_data_flows) identifier_data_flows )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (if_statement (boolean_operator (boolean_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_from_state) identifier_from_state )attribute (attribute (identifier_self) identifier_self (identifier_state_id) identifier_state_id )attribute )comparison_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_from_key) identifier_from_key )attribute (identifier_data_port_id) identifier_data_port_id )comparison_operator )boolean_operator (line_continuation_\) line_continuation_\ (boolean_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_to_state) identifier_to_state )attribute (attribute (identifier_self) identifier_self (identifier_state_id) identifier_state_id )attribute )comparison_operator (comparison_operator (attribute (identifier_data_flow) identifier_data_flow (identifier_to_key) identifier_to_key )attribute (identifier_data_port_id) identifier_data_port_id )comparison_operator )boolean_operator )boolean_operator (block (expression_statement (call (attribute (identifier_data_flow_ids_to_remove) identifier_data_flow_ids_to_remove (identifier_append) identifier_append )attribute (argument_list (identifier_data_flow_id) identifier_data_flow_id )argument_list )call )expression_statement )block )if_statement )block )for_statement (for_statement (identifier_data_flow_id) identifier_data_flow_id (identifier_data_flow_ids_to_remove) identifier_data_flow_ids_to_remove (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_remove_data_flow) identifier_remove_data_flow )attribute (argument_list (identifier_data_flow_id) identifier_data_flow_id )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Remove an data ports whose from_key or to_key equals the passed data_port_id :param int data_port_id: the id of a data_port of which all data_flows should be removed, the id can be a input or output data port id
(module (function_definition (function_name_dummy_image) function_name_dummy_image (parameters (default_parameter (identifier_filetype) identifier_filetype (string_'gif') string_'gif' )default_parameter )parameters (block (expression_statement (assignment (identifier_GIF) identifier_GIF (string_'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7') string_'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' )assignment )expression_statement (expression_statement (assignment (identifier_tmp_file) identifier_tmp_file (call (attribute (identifier_tempfile) identifier_tempfile (identifier_NamedTemporaryFile) identifier_NamedTemporaryFile )attribute (argument_list (keyword_argument (identifier_suffix) identifier_suffix (binary_operator (string_'.%s') string_'.%s' (identifier_filetype) identifier_filetype )binary_operator )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_tmp_file) identifier_tmp_file (identifier_write) identifier_write )attribute (argument_list (call (attribute (identifier_base64) identifier_base64 (identifier_b64decode) identifier_b64decode )attribute (argument_list (identifier_GIF) identifier_GIF )argument_list )call )argument_list )call )expression_statement (return_statement (call (identifier_open) identifier_open (argument_list (attribute (identifier_tmp_file) identifier_tmp_file (identifier_name) identifier_name )attribute (string_'rb') string_'rb' )argument_list )call )return_statement )block )function_definition )module
Generate empty image in temporary file for testing
(module (function_definition (function_name_phi) function_name_phi (parameters (identifier_n) identifier_n )parameters (block (assert_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_n) identifier_n (identifier_integer_types) identifier_integer_types )argument_list )call )assert_statement (if_statement (comparison_operator (identifier_n) identifier_n (integer_3) integer_3 )comparison_operator (block (return_statement (integer_1) integer_1 )return_statement )block )if_statement (expression_statement (assignment (identifier_result) identifier_result (integer_1) integer_1 )assignment )expression_statement (expression_statement (assignment (identifier_ff) identifier_ff (call (identifier_factorization) identifier_factorization (argument_list (identifier_n) identifier_n )argument_list )call )assignment )expression_statement (for_statement (identifier_f) identifier_f (identifier_ff) identifier_ff (block (expression_statement (assignment (identifier_e) identifier_e (subscript (identifier_f) identifier_f (integer_1) integer_1 )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_e) identifier_e (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_result) identifier_result (binary_operator (binary_operator (identifier_result) identifier_result (binary_operator (subscript (identifier_f) identifier_f (integer_0) integer_0 )subscript (parenthesized_expression (binary_operator (identifier_e) identifier_e (integer_1) integer_1 )binary_operator )parenthesized_expression )binary_operator )binary_operator (parenthesized_expression (binary_operator (subscript (identifier_f) identifier_f (integer_0) integer_0 )subscript (integer_1) integer_1 )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_result) identifier_result (binary_operator (identifier_result) identifier_result (parenthesized_expression (binary_operator (subscript (identifier_f) identifier_f (integer_0) integer_0 )subscript (integer_1) integer_1 )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement )block )else_clause )if_statement )block )for_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Return the Euler totient function of n.
(module (function_definition (function_name_SetDecryptedStreamSize) function_name_SetDecryptedStreamSize (parameters (identifier_self) identifier_self (identifier_decrypted_stream_size) identifier_decrypted_stream_size )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier__is_open) identifier__is_open )attribute (block (raise_statement (call (identifier_IOError) identifier_IOError (argument_list (string_'Already open.') string_'Already open.' )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (identifier_decrypted_stream_size) identifier_decrypted_stream_size (integer_0) integer_0 )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (call (attribute (parenthesized_expression (concatenated_string (string_'Invalid decrypted stream size: {0:d} value out of ') string_'Invalid decrypted stream size: {0:d} value out of ' (string_'bounds.') string_'bounds.' )concatenated_string )parenthesized_expression (identifier_format) identifier_format )attribute (argument_list (identifier_decrypted_stream_size) identifier_decrypted_stream_size )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__decrypted_stream_size) identifier__decrypted_stream_size )attribute (identifier_decrypted_stream_size) identifier_decrypted_stream_size )assignment )expression_statement )block )function_definition )module
Sets the decrypted stream size. This function is used to set the decrypted stream size if it can be determined separately. Args: decrypted_stream_size (int): size of the decrypted stream in bytes. Raises: IOError: if the file-like object is already open. OSError: if the file-like object is already open. ValueError: if the decrypted stream size is invalid.
(module (function_definition (function_name_register_magnitude_model) function_name_register_magnitude_model (parameters (identifier_self) identifier_self (identifier_pid) identifier_pid )parameters (block (if_statement (comparison_operator (subscript (attribute (identifier_self) identifier_self (identifier_assignments) identifier_assignments )attribute (string_'forward_model') string_'forward_model' )subscript (None) None )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier_assignments) identifier_assignments )attribute (string_'forward_model') string_'forward_model' )subscript (list (None) None (None) None )list )assignment )expression_statement )block )if_statement (expression_statement (assignment (subscript (subscript (attribute (identifier_self) identifier_self (identifier_assignments) identifier_assignments )attribute (string_'forward_model') string_'forward_model' )subscript (integer_0) integer_0 )subscript (identifier_pid) identifier_pid )assignment )expression_statement )block )function_definition )module
Set a given parameter model to the forward magnitude model
(module (function_definition (function_name_get) function_name_get (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_email) identifier_email (dictionary )dictionary )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute (None) None )comparison_operator (block (expression_statement (assignment (subscript (identifier_email) identifier_email (string_"name") string_"name" )subscript (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_email) identifier_email )attribute (None) None )comparison_operator (block (expression_statement (assignment (subscript (identifier_email) identifier_email (string_"email") string_"email" )subscript (attribute (identifier_self) identifier_self (identifier_email) identifier_email )attribute )assignment )expression_statement )block )if_statement (return_statement (identifier_email) identifier_email )return_statement )block )function_definition )module
Get a JSON-ready representation of this Email. :returns: This Email, ready for use in a request body. :rtype: dict
(module (function_definition (function_name_iscomplex) function_name_iscomplex (parameters (identifier_polynomial) identifier_polynomial )parameters (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_polynomial) identifier_polynomial (tuple (identifier_int) identifier_int (identifier_float) identifier_float )tuple )argument_list )call (block (return_statement (False) False )return_statement )block )if_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_polynomial) identifier_polynomial (identifier_complex) identifier_complex )argument_list )call (block (return_statement (True) True )return_statement )block )if_statement (expression_statement (assignment (identifier_polynomial) identifier_polynomial (call (attribute (identifier_polynomial) identifier_polynomial (identifier_expand) identifier_expand )attribute (argument_list )argument_list )call )assignment )expression_statement (for_statement (identifier_monomial) identifier_monomial (call (attribute (identifier_polynomial) identifier_polynomial (identifier_as_coefficients_dict) identifier_as_coefficients_dict )attribute (argument_list )argument_list )call (block (for_statement (identifier_variable) identifier_variable (subscript (call (attribute (identifier_monomial) identifier_monomial (identifier_as_coeff_mul) identifier_as_coeff_mul )attribute (argument_list )argument_list )call (integer_1) integer_1 )subscript (block (if_statement (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_variable) identifier_variable (identifier_complex) identifier_complex )argument_list )call (comparison_operator (identifier_variable) identifier_variable (identifier_I) identifier_I )comparison_operator )boolean_operator (block (return_statement (True) True )return_statement )block )if_statement )block )for_statement )block )for_statement (return_statement (False) False )return_statement )block )function_definition )module
Returns whether the polynomial has complex coefficients :param polynomial: Polynomial of noncommutive variables. :type polynomial: :class:`sympy.core.expr.Expr`. :returns: bool -- whether there is a complex coefficient.
(module (function_definition (function_name_query_string_parser) function_name_query_string_parser (parameters (identifier_search_pattern) identifier_search_pattern )parameters (block (if_statement (not_operator (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_current_oaiserver) identifier_current_oaiserver (string_'query_parser') string_'query_parser' )argument_list )call )not_operator (block (expression_statement (assignment (identifier_query_parser) identifier_query_parser (subscript (attribute (identifier_current_app) identifier_current_app (identifier_config) identifier_config )attribute (string_'OAISERVER_QUERY_PARSER') string_'OAISERVER_QUERY_PARSER' )subscript )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_query_parser) identifier_query_parser (attribute (identifier_six) identifier_six (identifier_string_types) identifier_string_types )attribute )argument_list )call (block (expression_statement (assignment (identifier_query_parser) identifier_query_parser (call (identifier_import_string) identifier_import_string (argument_list (identifier_query_parser) identifier_query_parser )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_current_oaiserver) identifier_current_oaiserver (identifier_query_parser) identifier_query_parser )attribute (identifier_query_parser) identifier_query_parser )assignment )expression_statement )block )if_statement (return_statement (call (attribute (identifier_current_oaiserver) identifier_current_oaiserver (identifier_query_parser) identifier_query_parser )attribute (argument_list (string_'query_string') string_'query_string' (keyword_argument (identifier_query) identifier_query (identifier_search_pattern) identifier_search_pattern )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Elasticsearch query string parser.
(module (function_definition (function_name_prepare_request_uri) function_name_prepare_request_uri (parameters (identifier_self) identifier_self (identifier_uri) identifier_uri (default_parameter (identifier_redirect_uri) identifier_redirect_uri (None) None )default_parameter (default_parameter (identifier_scope) identifier_scope (None) None )default_parameter (default_parameter (identifier_state) identifier_state (None) None )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (return_statement (call (identifier_prepare_grant_uri) identifier_prepare_grant_uri (argument_list (identifier_uri) identifier_uri (attribute (identifier_self) identifier_self (identifier_client_id) identifier_client_id )attribute (attribute (identifier_self) identifier_self (identifier_response_type) identifier_response_type )attribute (keyword_argument (identifier_redirect_uri) identifier_redirect_uri (identifier_redirect_uri) identifier_redirect_uri )keyword_argument (keyword_argument (identifier_state) identifier_state (identifier_state) identifier_state )keyword_argument (keyword_argument (identifier_scope) identifier_scope (identifier_scope) identifier_scope )keyword_argument (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Prepare the implicit grant request URI. The client constructs the request URI by adding the following parameters to the query component of the authorization endpoint URI using the "application/x-www-form-urlencoded" format, per `Appendix B`_: :param redirect_uri: OPTIONAL. The redirect URI must be an absolute URI and it should have been registerd with the OAuth provider prior to use. As described in `Section 3.1.2`_. :param scope: OPTIONAL. The scope of the access request as described by Section 3.3`_. These may be any string but are commonly URIs or various categories such as ``videos`` or ``documents``. :param state: RECOMMENDED. An opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client. The parameter SHOULD be used for preventing cross-site request forgery as described in `Section 10.12`_. :param kwargs: Extra arguments to include in the request URI. In addition to supplied parameters, OAuthLib will append the ``client_id`` that was provided in the constructor as well as the mandatory ``response_type`` argument, set to ``token``:: >>> from oauthlib.oauth2 import MobileApplicationClient >>> client = MobileApplicationClient('your_id') >>> client.prepare_request_uri('https://example.com') 'https://example.com?client_id=your_id&response_type=token' >>> client.prepare_request_uri('https://example.com', redirect_uri='https://a.b/callback') 'https://example.com?client_id=your_id&response_type=token&redirect_uri=https%3A%2F%2Fa.b%2Fcallback' >>> client.prepare_request_uri('https://example.com', scope=['profile', 'pictures']) 'https://example.com?client_id=your_id&response_type=token&scope=profile+pictures' >>> client.prepare_request_uri('https://example.com', foo='bar') 'https://example.com?client_id=your_id&response_type=token&foo=bar' .. _`Appendix B`: https://tools.ietf.org/html/rfc6749#appendix-B .. _`Section 2.2`: https://tools.ietf.org/html/rfc6749#section-2.2 .. _`Section 3.1.2`: https://tools.ietf.org/html/rfc6749#section-3.1.2 .. _`Section 3.3`: https://tools.ietf.org/html/rfc6749#section-3.3 .. _`Section 10.12`: https://tools.ietf.org/html/rfc6749#section-10.12
(module (function_definition (function_name_save_as_nifti_file) function_name_save_as_nifti_file (parameters (typed_parameter (identifier_data) identifier_data (type (attribute (identifier_np) identifier_np (identifier_ndarray) identifier_ndarray )attribute )type )typed_parameter (typed_parameter (identifier_affine) identifier_affine (type (attribute (identifier_np) identifier_np (identifier_ndarray) identifier_ndarray )attribute )type )typed_parameter (typed_parameter (identifier_path) identifier_path (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (identifier_str) identifier_str )type (type (identifier_Path) identifier_Path )type )type_parameter )generic_type )type )typed_parameter )parameters (type (None) None )type (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_path) identifier_path (identifier_str) identifier_str )argument_list )call )not_operator (block (expression_statement (assignment (identifier_path) identifier_path (call (identifier_str) identifier_str (argument_list (identifier_path) identifier_path )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_img) identifier_img (call (identifier_Nifti1Pair) identifier_Nifti1Pair (argument_list (identifier_data) identifier_data (identifier_affine) identifier_affine )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_nib) identifier_nib (identifier_nifti1) identifier_nifti1 )attribute (identifier_save) identifier_save )attribute (argument_list (identifier_img) identifier_img (identifier_path) identifier_path )argument_list )call )expression_statement )block )function_definition )module
Create a Nifti file and save it. Parameters ---------- data Brain data. affine Affine of the image, usually inherited from an existing image. path Output filename.
(module (function_definition (function_name_create_or_update_group_by_name) function_name_create_or_update_group_by_name (parameters (identifier_self) identifier_self (identifier_name) identifier_name (default_parameter (identifier_group_type) identifier_group_type (string_"internal") string_"internal" )default_parameter (default_parameter (identifier_metadata) identifier_metadata (None) None )default_parameter (default_parameter (identifier_policies) identifier_policies (None) None )default_parameter (default_parameter (identifier_member_group_ids) identifier_member_group_ids (None) None )default_parameter (default_parameter (identifier_member_entity_ids) identifier_member_entity_ids (None) None )default_parameter (default_parameter (identifier_mount_point) identifier_mount_point (identifier_DEFAULT_MOUNT_POINT) identifier_DEFAULT_MOUNT_POINT )default_parameter )parameters (block (if_statement (comparison_operator (identifier_metadata) identifier_metadata (None) None )comparison_operator (block (expression_statement (assignment (identifier_metadata) identifier_metadata (dictionary )dictionary )assignment )expression_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_metadata) identifier_metadata (identifier_dict) identifier_dict )argument_list )call )not_operator (block (expression_statement (assignment (identifier_error_msg) identifier_error_msg (string_'unsupported metadata argument provided "{arg}" ({arg_type}), required type: dict"') string_'unsupported metadata argument provided "{arg}" ({arg_type}), required type: dict"' )assignment )expression_statement (raise_statement (call (attribute (identifier_exceptions) identifier_exceptions (identifier_ParamValidationError) identifier_ParamValidationError )attribute (argument_list (call (attribute (identifier_error_msg) identifier_error_msg (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_arg) identifier_arg (identifier_metadata) identifier_metadata )keyword_argument (keyword_argument (identifier_arg_type) identifier_arg_type (call (identifier_type) identifier_type (argument_list (identifier_metadata) identifier_metadata )argument_list )call )keyword_argument )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (identifier_group_type) identifier_group_type (identifier_ALLOWED_GROUP_TYPES) identifier_ALLOWED_GROUP_TYPES )comparison_operator (block (expression_statement (assignment (identifier_error_msg) identifier_error_msg (string_'unsupported group_type argument provided "{arg}", allowed values: ({allowed_values})') string_'unsupported group_type argument provided "{arg}", allowed values: ({allowed_values})' )assignment )expression_statement (raise_statement (call (attribute (identifier_exceptions) identifier_exceptions (identifier_ParamValidationError) identifier_ParamValidationError )attribute (argument_list (call (attribute (identifier_error_msg) identifier_error_msg (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_arg) identifier_arg (identifier_group_type) identifier_group_type )keyword_argument (keyword_argument (identifier_allowed_values) identifier_allowed_values (identifier_ALLOWED_GROUP_TYPES) identifier_ALLOWED_GROUP_TYPES )keyword_argument )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_params) identifier_params (dictionary (pair (string_'type') string_'type' (identifier_group_type) identifier_group_type )pair (pair (string_'metadata') string_'metadata' (identifier_metadata) identifier_metadata )pair (pair (string_'policies') string_'policies' (identifier_policies) identifier_policies )pair (pair (string_'member_group_ids') string_'member_group_ids' (identifier_member_group_ids) identifier_member_group_ids )pair (pair (string_'member_entity_ids') string_'member_entity_ids' (identifier_member_entity_ids) identifier_member_entity_ids )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_api_path) identifier_api_path (call (attribute (string_'/v1/{mount_point}/group/name/{name}') string_'/v1/{mount_point}/group/name/{name}' (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_mount_point) identifier_mount_point (identifier_mount_point) identifier_mount_point )keyword_argument (keyword_argument (identifier_name) identifier_name (identifier_name) identifier_name )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (identifier_self) identifier_self (identifier__adapter) identifier__adapter )attribute (identifier_post) identifier_post )attribute (argument_list (keyword_argument (identifier_url) identifier_url (identifier_api_path) identifier_api_path )keyword_argument (keyword_argument (identifier_json) identifier_json (identifier_params) identifier_params )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_response) identifier_response )return_statement )block )function_definition )module
Create or update a group by its name. Supported methods: POST: /{mount_point}/group/name/{name}. Produces: 200 application/json :param name: Name of the group. :type name: str | unicode :param group_type: Type of the group, internal or external. Defaults to internal. :type group_type: str | unicode :param metadata: Metadata to be associated with the group. :type metadata: dict :param policies: Policies to be tied to the group. :type policies: str | unicode :param member_group_ids: Group IDs to be assigned as group members. :type member_group_ids: str | unicode :param member_entity_ids: Entity IDs to be assigned as group members. :type member_entity_ids: str | unicode :param mount_point: The "path" the method/backend was mounted on. :type mount_point: str | unicode :return: The response of the request. :rtype: requests.Response
(module (function_definition (function_name_human_size_to_bytes) function_name_human_size_to_bytes (parameters (identifier_human_size) identifier_human_size )parameters (block (expression_statement (assignment (identifier_size_exp_map) identifier_size_exp_map (dictionary (pair (string_'K') string_'K' (integer_1) integer_1 )pair (pair (string_'M') string_'M' (integer_2) integer_2 )pair (pair (string_'G') string_'G' (integer_3) integer_3 )pair (pair (string_'T') string_'T' (integer_4) integer_4 )pair (pair (string_'P') string_'P' (integer_5) integer_5 )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_human_size_str) identifier_human_size_str (call (attribute (identifier_six) identifier_six (identifier_text_type) identifier_text_type )attribute (argument_list (identifier_human_size) identifier_human_size )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_match) identifier_match (call (attribute (identifier_re) identifier_re (identifier_match) identifier_match )attribute (argument_list (string_r'^(\d+)([KMGTP])?$') string_r'^(\d+)([KMGTP])?$' (identifier_human_size_str) identifier_human_size_str )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_match) identifier_match )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (concatenated_string (string_'Size must be all digits, with an optional unit type ') string_'Size must be all digits, with an optional unit type ' (string_'(K, M, G, T, or P)') string_'(K, M, G, T, or P)' )concatenated_string )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_size_num) identifier_size_num (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_match) identifier_match (identifier_group) identifier_group )attribute (argument_list (integer_1) integer_1 )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_unit_multiplier) identifier_unit_multiplier (binary_operator (integer_1024) integer_1024 (call (attribute (identifier_size_exp_map) identifier_size_exp_map (identifier_get) identifier_get )attribute (argument_list (call (attribute (identifier_match) identifier_match (identifier_group) identifier_group )attribute (argument_list (integer_2) integer_2 )argument_list )call (integer_0) integer_0 )argument_list )call )binary_operator )assignment )expression_statement (return_statement (binary_operator (identifier_size_num) identifier_size_num (identifier_unit_multiplier) identifier_unit_multiplier )binary_operator )return_statement )block )function_definition )module
Convert human-readable units to bytes
(module (function_definition (function_name_qset) function_name_qset (parameters (identifier_self) identifier_self (identifier_name) identifier_name (identifier_index) identifier_index (identifier_value) identifier_value )parameters (block (expression_statement (assignment (identifier_index) identifier_index (call (identifier_get_integer) identifier_get_integer (argument_list (string_'index') string_'index' (identifier_index) identifier_index )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier_execute_command) identifier_execute_command )attribute (argument_list (string_'qset') string_'qset' (identifier_name) identifier_name (identifier_index) identifier_index (identifier_value) identifier_value )argument_list )call )return_statement )block )function_definition )module
Set the list element at ``index`` to ``value``. :param string name: the queue name :param int index: the specified index, can < 0 :param string value: the element value :return: Unknown :rtype: True
(module (function_definition (function_name__save_states) function_name__save_states (parameters (identifier_self) identifier_self (identifier_state) identifier_state (identifier_serialized_readers_entity) identifier_serialized_readers_entity )parameters (block (expression_statement (assignment (identifier_mr_id) identifier_mr_id (call (attribute (call (attribute (identifier_state) identifier_state (identifier_key) identifier_key )attribute (argument_list )argument_list )call (identifier_id_or_name) identifier_id_or_name )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_fresh_state) identifier_fresh_state (call (attribute (attribute (identifier_model) identifier_model (identifier_MapreduceState) identifier_MapreduceState )attribute (identifier_get_by_job_id) identifier_get_by_job_id )attribute (argument_list (identifier_mr_id) identifier_mr_id )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier__check_mr_state) identifier__check_mr_state )attribute (argument_list (identifier_fresh_state) identifier_fresh_state (identifier_mr_id) identifier_mr_id )argument_list )call )not_operator (block (return_statement (False) False )return_statement )block )if_statement (if_statement (comparison_operator (attribute (identifier_fresh_state) identifier_fresh_state (identifier_active_shards) identifier_active_shards )attribute (integer_0) integer_0 )comparison_operator (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_warning) identifier_warning )attribute (argument_list (concatenated_string (string_"Mapreduce %s already has active shards. Looks like spurious task ") string_"Mapreduce %s already has active shards. Looks like spurious task " (string_"execution.") string_"execution." )concatenated_string (identifier_mr_id) identifier_mr_id )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_config) identifier_config (call (attribute (identifier_util) identifier_util (identifier_create_datastore_write_config) identifier_create_datastore_write_config )attribute (argument_list (attribute (identifier_state) identifier_state (identifier_mapreduce_spec) identifier_mapreduce_spec )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_db) identifier_db (identifier_put) identifier_put )attribute (argument_list (list (identifier_state) identifier_state (identifier_serialized_readers_entity) identifier_serialized_readers_entity )list (keyword_argument (identifier_config) identifier_config (identifier_config) identifier_config )keyword_argument )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )function_definition )module
Run transaction to save state. Args: state: a model.MapreduceState entity. serialized_readers_entity: a model._HugeTaskPayload entity containing json serialized input readers. Returns: False if a fatal error is encountered and this task should be dropped immediately. True if transaction is successful. None if a previous attempt of this same transaction has already succeeded.
(module (function_definition (function_name_get_default_version) function_name_get_default_version (parameters (identifier_env) identifier_env )parameters (block (if_statement (boolean_operator (comparison_operator (string_'MSVS') string_'MSVS' (identifier_env) identifier_env )comparison_operator (not_operator (call (attribute (attribute (identifier_SCons) identifier_SCons (identifier_Util) identifier_Util )attribute (identifier_is_Dict) identifier_is_Dict )attribute (argument_list (subscript (identifier_env) identifier_env (string_'MSVS') string_'MSVS' )subscript )argument_list )call )not_operator )boolean_operator (block (expression_statement (assignment (identifier_versions) identifier_versions (list_comprehension (attribute (identifier_vs) identifier_vs (identifier_version) identifier_version )attribute (for_in_clause (identifier_vs) identifier_vs (call (identifier_get_installed_visual_studios) identifier_get_installed_visual_studios (argument_list )argument_list )call )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (subscript (identifier_env) identifier_env (string_'MSVS') string_'MSVS' )subscript (dictionary (pair (string_'VERSIONS') string_'VERSIONS' (identifier_versions) identifier_versions )pair )dictionary )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_versions) identifier_versions (call (attribute (subscript (identifier_env) identifier_env (string_'MSVS') string_'MSVS' )subscript (identifier_get) identifier_get )attribute (argument_list (string_'VERSIONS') string_'VERSIONS' (list )list )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (if_statement (comparison_operator (string_'MSVS_VERSION') string_'MSVS_VERSION' (identifier_env) identifier_env )comparison_operator (block (if_statement (identifier_versions) identifier_versions (block (expression_statement (assignment (subscript (identifier_env) identifier_env (string_'MSVS_VERSION') string_'MSVS_VERSION' )subscript (subscript (identifier_versions) identifier_versions (integer_0) integer_0 )subscript )assignment )expression_statement )block (else_clause (block (expression_statement (call (identifier_debug) identifier_debug (argument_list (binary_operator (concatenated_string (string_'get_default_version: WARNING: no installed versions found, ') string_'get_default_version: WARNING: no installed versions found, ' (string_'using first in SupportedVSList (%s)') string_'using first in SupportedVSList (%s)' )concatenated_string (attribute (subscript (identifier_SupportedVSList) identifier_SupportedVSList (integer_0) integer_0 )subscript (identifier_version) identifier_version )attribute )binary_operator )argument_list )call )expression_statement (expression_statement (assignment (subscript (identifier_env) identifier_env (string_'MSVS_VERSION') string_'MSVS_VERSION' )subscript (attribute (subscript (identifier_SupportedVSList) identifier_SupportedVSList (integer_0) integer_0 )subscript (identifier_version) identifier_version )attribute )assignment )expression_statement )block )else_clause )if_statement )block )if_statement (expression_statement (assignment (subscript (subscript (identifier_env) identifier_env (string_'MSVS') string_'MSVS' )subscript (string_'VERSION') string_'VERSION' )subscript (subscript (identifier_env) identifier_env (string_'MSVS_VERSION') string_'MSVS_VERSION' )subscript )assignment )expression_statement (return_statement (subscript (identifier_env) identifier_env (string_'MSVS_VERSION') string_'MSVS_VERSION' )subscript )return_statement )block )function_definition )module
Returns the default version string to use for MSVS. If no version was requested by the user through the MSVS environment variable, query all the available visual studios through get_installed_visual_studios, and take the highest one. Return ------ version: str the default version.
(module (function_definition (function_name__setBatchSystemEnvVars) function_name__setBatchSystemEnvVars (parameters (identifier_self) identifier_self )parameters (block (for_statement (identifier_envDict) identifier_envDict (tuple (call (attribute (attribute (identifier_self) identifier_self (identifier__jobStore) identifier__jobStore )attribute (identifier_getEnv) identifier_getEnv )attribute (argument_list )argument_list )call (attribute (attribute (identifier_self) identifier_self (identifier_config) identifier_config )attribute (identifier_environment) identifier_environment )attribute )tuple (block (for_statement (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (call (identifier_iteritems) identifier_iteritems (argument_list (identifier_envDict) identifier_envDict )argument_list )call (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__batchSystem) identifier__batchSystem )attribute (identifier_setEnv) identifier_setEnv )attribute (argument_list (identifier_k) identifier_k (identifier_v) identifier_v )argument_list )call )expression_statement )block )for_statement )block )for_statement )block )function_definition )module
Sets the environment variables required by the job store and those passed on command line.
(module (function_definition (function_name_contains) function_name_contains (parameters (identifier_self) identifier_self (identifier_order) identifier_order (identifier_cell) identifier_cell (default_parameter (identifier_include_smaller) identifier_include_smaller (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_order) identifier_order (call (attribute (identifier_self) identifier_self (identifier__validate_order) identifier__validate_order )attribute (argument_list (identifier_order) identifier_order )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_cell) identifier_cell (call (attribute (identifier_self) identifier_self (identifier__validate_cell) identifier__validate_cell )attribute (argument_list (identifier_order) identifier_order (identifier_cell) identifier_cell )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__compare_operation) identifier__compare_operation )attribute (argument_list (identifier_order) identifier_order (identifier_cell) identifier_cell (identifier_include_smaller) identifier_include_smaller (string_'check') string_'check' )argument_list )call )return_statement )block )function_definition )module
Test whether the MOC contains the given cell. If the include_smaller argument is true then the MOC is considered to include a cell if it includes part of that cell (at a higher order). >>> m = MOC(1, (5,)) >>> m.contains(0, 0) False >>> m.contains(0, 1, True) True >>> m.contains(0, 1, False) False >>> m.contains(1, 4) False >>> m.contains(1, 5) True >>> m.contains(2, 19) False >>> m.contains(2, 21) True
(module (function_definition (function_name_iter_entry_points) function_name_iter_entry_points (parameters (identifier_self) identifier_self (identifier_group) identifier_group (default_parameter (identifier_name) identifier_name (None) None )default_parameter )parameters (block (return_statement (generator_expression (identifier_entry) identifier_entry (for_in_clause (identifier_dist) identifier_dist (identifier_self) identifier_self )for_in_clause (for_in_clause (identifier_entry) identifier_entry (call (attribute (call (attribute (identifier_dist) identifier_dist (identifier_get_entry_map) identifier_get_entry_map )attribute (argument_list (identifier_group) identifier_group )argument_list )call (identifier_values) identifier_values )attribute (argument_list )argument_list )call )for_in_clause (if_clause (boolean_operator (comparison_operator (identifier_name) identifier_name (None) None )comparison_operator (comparison_operator (identifier_name) identifier_name (attribute (identifier_entry) identifier_entry (identifier_name) identifier_name )attribute )comparison_operator )boolean_operator )if_clause )generator_expression )return_statement )block )function_definition )module
Yield entry point objects from `group` matching `name` If `name` is None, yields all entry points in `group` from all distributions in the working set, otherwise only ones matching both `group` and `name` are yielded (in distribution order).
(module (function_definition (function_name_flush) function_name_flush (parameters (identifier_self) identifier_self (default_parameter (identifier_multithread) identifier_multithread (True) True )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (call (attribute (attribute (identifier_self) identifier_self (identifier__write_buf) identifier__write_buf )attribute (identifier_tell) identifier_tell )attribute (argument_list )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (attribute (identifier_self) identifier_self (identifier__write_buf) identifier__write_buf )attribute (identifier_getvalue) identifier_getvalue )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__write_buf) identifier__write_buf )attribute (call (identifier_BytesIO) identifier_BytesIO (argument_list )argument_list )call )assignment )expression_statement (if_statement (identifier_multithread) identifier_multithread (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__async_upload_part_request) identifier__async_upload_part_request )attribute (argument_list (identifier_data) identifier_data (keyword_argument (identifier_index) identifier_index (attribute (identifier_self) identifier_self (identifier__cur_part) identifier__cur_part )attribute )keyword_argument (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_upload_part) identifier_upload_part )attribute (argument_list (identifier_data) identifier_data (attribute (identifier_self) identifier_self (identifier__cur_part) identifier__cur_part )attribute (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement )block )else_clause )if_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier__cur_part) identifier__cur_part )attribute (integer_1) integer_1 )augmented_assignment )expression_statement )block )if_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (attribute (identifier_self) identifier_self (identifier__http_threadpool_futures) identifier__http_threadpool_futures )attribute )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_dxpy) identifier_dxpy (identifier_utils) identifier_utils )attribute (identifier_wait_for_all_futures) identifier_wait_for_all_futures )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__http_threadpool_futures) identifier__http_threadpool_futures )attribute )argument_list )call )expression_statement (try_statement (block (for_statement (identifier_future) identifier_future (attribute (identifier_self) identifier_self (identifier__http_threadpool_futures) identifier__http_threadpool_futures )attribute (block (if_statement (comparison_operator (call (attribute (identifier_future) identifier_future (identifier_exception) identifier_exception )attribute (argument_list )argument_list )call (None) None )comparison_operator (block (raise_statement (call (attribute (identifier_future) identifier_future (identifier_exception) identifier_exception )attribute (argument_list )argument_list )call )raise_statement )block )if_statement )block )for_statement )block (finally_clause (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__http_threadpool_futures) identifier__http_threadpool_futures )attribute (call (identifier_set) identifier_set (argument_list )argument_list )call )assignment )expression_statement )block )finally_clause )try_statement )block )if_statement )block )function_definition )module
Flushes the internal write buffer.
(module (function_definition (function_name_write) function_name_write (parameters (identifier_self) identifier_self (default_parameter (identifier_path) identifier_path (None) None )default_parameter (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (identifier_path) identifier_path (None) None )comparison_operator (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (identifier_self) identifier_self (identifier_format) identifier_format )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )argument_list )call )expression_statement )block (else_clause (block (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_io) identifier_io (identifier_open) identifier_open )attribute (argument_list (identifier_path) identifier_path (string_'w') string_'w' (keyword_argument (identifier_newline) identifier_newline (string_"") string_"" )keyword_argument )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_f) identifier_f (identifier_write) identifier_write )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier_format) identifier_format )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )argument_list )call )expression_statement )block )with_statement )block )else_clause )if_statement )block )function_definition )module
Perform formatting and write the formatted string to a file or stdout. Optional arguments can be used to format the editor's contents. If no file path is given, prints to standard output. Args: path (str): Full file path (default None, prints to stdout) *args: Positional arguments to format the editor with **kwargs: Keyword arguments to format the editor with
(module (function_definition (function_name_kill) function_name_kill (parameters (identifier_self) identifier_self (default_parameter (identifier_exc_info) identifier_exc_info (None) None )default_parameter )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier__being_killed) identifier__being_killed )attribute (block (expression_statement (call (attribute (identifier__log) identifier__log (identifier_debug) identifier_debug )attribute (argument_list (string_'already killing %s ... waiting for death') string_'already killing %s ... waiting for death' (identifier_self) identifier_self )argument_list )call )expression_statement (try_statement (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__died) identifier__died )attribute (identifier_wait) identifier_wait )attribute (argument_list )argument_list )call )expression_statement )block (except_clause (block (pass_statement )pass_statement )block )except_clause )try_statement (return_statement )return_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__being_killed) identifier__being_killed )attribute (True) True )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__died) identifier__died )attribute (identifier_ready) identifier_ready )attribute (argument_list )argument_list )call (block (expression_statement (call (attribute (identifier__log) identifier__log (identifier_debug) identifier_debug )attribute (argument_list (string_'already stopped %s') string_'already stopped %s' (identifier_self) identifier_self )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (if_statement (comparison_operator (identifier_exc_info) identifier_exc_info (None) None )comparison_operator (block (expression_statement (call (attribute (identifier__log) identifier__log (identifier_info) identifier_info )attribute (argument_list (string_'killing %s due to %s') string_'killing %s due to %s' (identifier_self) identifier_self (subscript (identifier_exc_info) identifier_exc_info (integer_1) integer_1 )subscript )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier__log) identifier__log (identifier_info) identifier_info )attribute (argument_list (string_'killing %s') string_'killing %s' (identifier_self) identifier_self )argument_list )call )expression_statement )block )else_clause )if_statement (function_definition (function_name_safely_kill_extensions) function_name_safely_kill_extensions (parameters (identifier_ext_set) identifier_ext_set )parameters (block (try_statement (block (expression_statement (call (attribute (identifier_ext_set) identifier_ext_set (identifier_kill) identifier_kill )attribute (argument_list )argument_list )call )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_warning) identifier_warning )attribute (argument_list (string_'Extension raised `%s` during kill') string_'Extension raised `%s` during kill' (identifier_exc) identifier_exc )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition (expression_statement (call (identifier_safely_kill_extensions) identifier_safely_kill_extensions (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_entrypoints) identifier_entrypoints )attribute (identifier_all) identifier_all )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__kill_worker_threads) identifier__kill_worker_threads )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (identifier_safely_kill_extensions) identifier_safely_kill_extensions (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_extensions) identifier_extensions )attribute (identifier_all) identifier_all )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__kill_managed_threads) identifier__kill_managed_threads )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_started) identifier_started )attribute (False) False )assignment )expression_statement (if_statement (not_operator (call (attribute (attribute (identifier_self) identifier_self (identifier__died) identifier__died )attribute (identifier_ready) identifier_ready )attribute (argument_list )argument_list )call )not_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__died) identifier__died )attribute (identifier_send) identifier_send )attribute (argument_list (None) None (identifier_exc_info) identifier_exc_info )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Kill the container in a semi-graceful way. Entrypoints are killed, followed by any active worker threads. Next, dependencies are killed. Finally, any remaining managed threads are killed. If ``exc_info`` is provided, the exception will be raised by :meth:`~wait``.
(module (function_definition (function_name_get_agents) function_name_get_agents (parameters (identifier_self) identifier_self (default_parameter (identifier_addr) identifier_addr (True) True )default_parameter (default_parameter (identifier_agent_cls) identifier_agent_cls (None) None )default_parameter )parameters (block (return_statement (await (call (attribute (attribute (identifier_self) identifier_self (identifier_menv) identifier_menv )attribute (identifier_get_agents) identifier_get_agents )attribute (argument_list (keyword_argument (identifier_addr) identifier_addr (True) True )keyword_argument (keyword_argument (identifier_agent_cls) identifier_agent_cls (None) None )keyword_argument (keyword_argument (identifier_as_coro) identifier_as_coro (True) True )keyword_argument )argument_list )call )await )return_statement )block )function_definition )module
Get addresses of all agents in all the slave environments. This is a managing function for :meth:`creamas.mp.MultiEnvironment.get_agents`. .. note:: Since :class:`aiomas.rpc.Proxy` objects do not seem to handle (re)serialization, ``addr`` and ``agent_cls`` parameters are omitted from the call to underlying multi-environment's :meth:`get_agents`. If :class:`aiomas.rpc.Proxy` objects from all the agents are needed, call each slave environment manager's :meth:`get_agents` directly.
(module (function_definition (function_name_get_current_url) function_name_get_current_url (parameters )parameters (block (if_statement (boolean_operator (call (attribute (attribute (identifier_current_app) identifier_current_app (identifier_config) identifier_config )attribute (identifier_get) identifier_get )attribute (argument_list (string_'SERVER_NAME') string_'SERVER_NAME' )argument_list )call (parenthesized_expression (comparison_operator (subscript (call (attribute (subscript (attribute (identifier_request) identifier_request (identifier_environ) identifier_environ )attribute (string_'HTTP_HOST') string_'HTTP_HOST' )subscript (identifier_split) identifier_split )attribute (argument_list (string_':') string_':' (integer_1) integer_1 )argument_list )call (integer_0) integer_0 )subscript (subscript (call (attribute (subscript (attribute (identifier_current_app) identifier_current_app (identifier_config) identifier_config )attribute (string_'SERVER_NAME') string_'SERVER_NAME' )subscript (identifier_split) identifier_split )attribute (argument_list (string_':') string_':' (integer_1) integer_1 )argument_list )call (integer_0) integer_0 )subscript )comparison_operator )parenthesized_expression )boolean_operator (block (return_statement (attribute (identifier_request) identifier_request (identifier_url) identifier_url )attribute )return_statement )block )if_statement (expression_statement (assignment (identifier_url) identifier_url (call (identifier_url_for) identifier_url_for (argument_list (attribute (identifier_request) identifier_request (identifier_endpoint) identifier_endpoint )attribute (dictionary_splat (attribute (identifier_request) identifier_request (identifier_view_args) identifier_view_args )attribute )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_query) identifier_query (attribute (identifier_request) identifier_request (identifier_query_string) identifier_query_string )attribute )assignment )expression_statement (if_statement (identifier_query) identifier_query (block (return_statement (binary_operator (binary_operator (identifier_url) identifier_url (string_'?') string_'?' )binary_operator (call (attribute (identifier_query) identifier_query (identifier_decode) identifier_decode )attribute (argument_list )argument_list )call )binary_operator )return_statement )block (else_clause (block (return_statement (identifier_url) identifier_url )return_statement )block )else_clause )if_statement )block )function_definition )module
Return the current URL including the query string as a relative path. If the app uses subdomains, return an absolute path
(module (function_definition (function_name_get_dois) function_name_get_dois (parameters (identifier_query_str) identifier_query_str (default_parameter (identifier_count) identifier_count (integer_100) integer_100 )default_parameter )parameters (block (expression_statement (assignment (identifier_url) identifier_url (binary_operator (string_'%s/%s') string_'%s/%s' (tuple (identifier_elsevier_search_url) identifier_elsevier_search_url (identifier_query_str) identifier_query_str )tuple )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_params) identifier_params (dictionary (pair (string_'query') string_'query' (identifier_query_str) identifier_query_str )pair (pair (string_'count') string_'count' (identifier_count) identifier_count )pair (pair (string_'httpAccept') string_'httpAccept' (string_'application/xml') string_'application/xml' )pair (pair (string_'sort') string_'sort' (string_'-coverdate') string_'-coverdate' )pair (pair (string_'field') string_'field' (string_'doi') string_'doi' )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_res) identifier_res (call (attribute (identifier_requests) identifier_requests (identifier_get) identifier_get )attribute (argument_list (identifier_url) identifier_url (identifier_params) identifier_params )argument_list )call )assignment )expression_statement (if_statement (not_operator (comparison_operator (attribute (identifier_res) identifier_res (identifier_status_code) identifier_status_code )attribute (integer_200) integer_200 )comparison_operator )not_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_tree) identifier_tree (call (attribute (identifier_ET) identifier_ET (identifier_XML) identifier_XML )attribute (argument_list (attribute (identifier_res) identifier_res (identifier_content) identifier_content )attribute (keyword_argument (identifier_parser) identifier_parser (call (identifier_UTB) identifier_UTB (argument_list )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_doi_tags) identifier_doi_tags (call (attribute (identifier_tree) identifier_tree (identifier_findall) identifier_findall )attribute (argument_list (string_'atom:entry/prism:doi') string_'atom:entry/prism:doi' (identifier_elsevier_ns) identifier_elsevier_ns )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_dois) identifier_dois (list_comprehension (attribute (identifier_dt) identifier_dt (identifier_text) identifier_text )attribute (for_in_clause (identifier_dt) identifier_dt (identifier_doi_tags) identifier_doi_tags )for_in_clause )list_comprehension )assignment )expression_statement (return_statement (identifier_dois) identifier_dois )return_statement )block )function_definition )module
Search ScienceDirect through the API for articles. See http://api.elsevier.com/content/search/fields/scidir for constructing a query string to pass here. Example: 'abstract(BRAF) AND all("colorectal cancer")'
(module (function_definition (function_name_get_sentence) function_name_get_sentence (parameters (default_parameter (identifier_start) identifier_start (None) None )default_parameter (default_parameter (identifier_depth) identifier_depth (integer_7) integer_7 )default_parameter )parameters (block (if_statement (not_operator (identifier_GRAMMAR) identifier_GRAMMAR )not_operator (block (return_statement (string_'Please set a GRAMMAR file') string_'Please set a GRAMMAR file' )return_statement )block )if_statement (expression_statement (assignment (identifier_start) identifier_start (conditional_expression (identifier_start) identifier_start (identifier_start) identifier_start (call (attribute (identifier_GRAMMAR) identifier_GRAMMAR (identifier_start) identifier_start )attribute (argument_list )argument_list )call )conditional_expression )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_start) identifier_start (identifier_Nonterminal) identifier_Nonterminal )argument_list )call (block (expression_statement (assignment (identifier_productions) identifier_productions (call (attribute (identifier_GRAMMAR) identifier_GRAMMAR (identifier_productions) identifier_productions )attribute (argument_list (identifier_start) identifier_start )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_depth) identifier_depth )not_operator (block (expression_statement (assignment (identifier_terminals) identifier_terminals (list_comprehension (identifier_p) identifier_p (for_in_clause (identifier_p) identifier_p (identifier_productions) identifier_productions )for_in_clause (if_clause (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_start) identifier_start (identifier_Nonterminal) identifier_Nonterminal )argument_list )call )not_operator )if_clause )list_comprehension )assignment )expression_statement (if_statement (call (identifier_len) identifier_len (argument_list (identifier_terminals) identifier_terminals )argument_list )call (block (expression_statement (assignment (identifier_production) identifier_production (identifier_terminals) identifier_terminals )assignment )expression_statement )block )if_statement )block )if_statement (expression_statement (assignment (identifier_production) identifier_production (call (attribute (identifier_random) identifier_random (identifier_choice) identifier_choice )attribute (argument_list (identifier_productions) identifier_productions )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_sentence) identifier_sentence (list )list )assignment )expression_statement (for_statement (identifier_piece) identifier_piece (call (attribute (identifier_production) identifier_production (identifier_rhs) identifier_rhs )attribute (argument_list )argument_list )call (block (expression_statement (augmented_assignment (identifier_sentence) identifier_sentence (call (identifier_get_sentence) identifier_get_sentence (argument_list (keyword_argument (identifier_start) identifier_start (identifier_piece) identifier_piece )keyword_argument (keyword_argument (identifier_depth) identifier_depth (binary_operator (identifier_depth) identifier_depth (integer_1) integer_1 )binary_operator )keyword_argument )argument_list )call )augmented_assignment )expression_statement )block )for_statement (return_statement (identifier_sentence) identifier_sentence )return_statement )block (else_clause (block (return_statement (list (identifier_start) identifier_start )list )return_statement )block )else_clause )if_statement )block )function_definition )module
follow the grammatical patterns to generate a random sentence
(module (function_definition (function_name_get_fields) function_name_get_fields (parameters (identifier_model) identifier_model )parameters (block (try_statement (block (if_statement (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_model) identifier_model (string_"knockout_fields") string_"knockout_fields" )argument_list )call (block (expression_statement (assignment (identifier_fields) identifier_fields (call (attribute (identifier_model) identifier_model (identifier_knockout_fields) identifier_knockout_fields )attribute (argument_list )argument_list )call )assignment )expression_statement )block (else_clause (block (try_statement (block (expression_statement (assignment (identifier_fields) identifier_fields (call (attribute (call (identifier_model_to_dict) identifier_model_to_dict (argument_list (identifier_model) identifier_model )argument_list )call (identifier_keys) identifier_keys )attribute (argument_list )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 (assignment (identifier_fields) identifier_fields (call (attribute (attribute (identifier_model) identifier_model (identifier__meta) identifier__meta )attribute (identifier_get_fields) identifier_get_fields )attribute (argument_list )argument_list )call )assignment )expression_statement )block )except_clause )try_statement )block )else_clause )if_statement (return_statement (identifier_fields) identifier_fields )return_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_logger) identifier_logger (identifier_exception) identifier_exception )attribute (argument_list (identifier_e) identifier_e )argument_list )call )expression_statement (return_statement (list )list )return_statement )block )except_clause )try_statement )block )function_definition )module
Returns a Model's knockout_fields, or the default set of field names.
(module (function_definition (function_name_get) function_name_get (parameters (identifier_self) identifier_self (identifier_obj) identifier_obj (identifier_key) identifier_key )parameters (block (if_statement (comparison_operator (identifier_key) identifier_key (attribute (identifier_self) identifier_self (identifier__exposed) identifier__exposed )attribute )comparison_operator (block (raise_statement (call (identifier_MethodNotExposed) identifier_MethodNotExposed (argument_list )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_rightFuncs) identifier_rightFuncs (subscript (attribute (identifier_self) identifier_self (identifier__exposed) identifier__exposed )attribute (identifier_key) identifier_key )subscript )assignment )expression_statement (expression_statement (assignment (identifier_T) identifier_T (attribute (identifier_obj) identifier_obj (identifier___class__) identifier___class__ )attribute )assignment )expression_statement (expression_statement (assignment (identifier_seen) identifier_seen (dictionary )dictionary )assignment )expression_statement (for_statement (identifier_subT) identifier_subT (call (attribute (identifier_inspect) identifier_inspect (identifier_getmro) identifier_getmro )attribute (argument_list (identifier_T) identifier_T )argument_list )call (block (for_statement (pattern_list (identifier_name) identifier_name (identifier_value) identifier_value )pattern_list (call (attribute (attribute (identifier_subT) identifier_subT (identifier___dict__) identifier___dict__ )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (for_statement (identifier_rightFunc) identifier_rightFunc (identifier_rightFuncs) identifier_rightFuncs (block (if_statement (comparison_operator (identifier_value) identifier_value (identifier_rightFunc) identifier_rightFunc )comparison_operator (block (if_statement (comparison_operator (identifier_name) identifier_name (identifier_seen) identifier_seen )comparison_operator (block (raise_statement (call (identifier_MethodNotExposed) identifier_MethodNotExposed (argument_list )argument_list )call )raise_statement )block )if_statement (return_statement (call (attribute (identifier_value) identifier_value (identifier___get__) identifier___get__ )attribute (argument_list (identifier_obj) identifier_obj (identifier_T) identifier_T )argument_list )call )return_statement )block )if_statement )block )for_statement (expression_statement (assignment (subscript (identifier_seen) identifier_seen (identifier_name) identifier_name )subscript (True) True )assignment )expression_statement )block )for_statement )block )for_statement (raise_statement (call (identifier_MethodNotExposed) identifier_MethodNotExposed (argument_list )argument_list )call )raise_statement )block )function_definition )module
Retrieve 'key' from an instance of a class which previously exposed it. @param key: a hashable object, previously passed to L{Exposer.expose}. @return: the object which was exposed with the given name on obj's key. @raise MethodNotExposed: when the key in question was not exposed with this exposer.
(module (function_definition (function_name_clean_regex) function_name_clean_regex (parameters (identifier_regex) identifier_regex )parameters (block (expression_statement (assignment (identifier_ret_regex) identifier_ret_regex (identifier_regex) identifier_regex )assignment )expression_statement (expression_statement (assignment (identifier_escape_chars) identifier_escape_chars (string_'[^$.?*+(){}') string_'[^$.?*+(){}' )assignment )expression_statement (expression_statement (assignment (identifier_ret_regex) identifier_ret_regex (call (attribute (identifier_ret_regex) identifier_ret_regex (identifier_replace) identifier_replace )attribute (argument_list (string_'\\') string_'\\' (string_'') string_'' )argument_list )call )assignment )expression_statement (for_statement (identifier_c) identifier_c (identifier_escape_chars) identifier_escape_chars (block (expression_statement (assignment (identifier_ret_regex) identifier_ret_regex (call (attribute (identifier_ret_regex) identifier_ret_regex (identifier_replace) identifier_replace )attribute (argument_list (identifier_c) identifier_c (binary_operator (string_'\\') string_'\\' (identifier_c) identifier_c )binary_operator )argument_list )call )assignment )expression_statement )block )for_statement (while_statement (True) True (block (expression_statement (assignment (identifier_old_regex) identifier_old_regex (identifier_ret_regex) identifier_ret_regex )assignment )expression_statement (expression_statement (assignment (identifier_ret_regex) identifier_ret_regex (call (attribute (identifier_ret_regex) identifier_ret_regex (identifier_replace) identifier_replace )attribute (argument_list (string_'||') string_'||' (string_'|') string_'|' )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_old_regex) identifier_old_regex (identifier_ret_regex) identifier_ret_regex )comparison_operator (block (break_statement )break_statement )block )if_statement )block )while_statement (while_statement (boolean_operator (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_ret_regex) identifier_ret_regex )argument_list )call (integer_1) integer_1 )comparison_operator (comparison_operator (subscript (identifier_ret_regex) identifier_ret_regex (unary_operator (integer_1) integer_1 )unary_operator )subscript (string_'|') string_'|' )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_ret_regex) identifier_ret_regex (subscript (identifier_ret_regex) identifier_ret_regex (slice (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )assignment )expression_statement )block )while_statement (return_statement (identifier_ret_regex) identifier_ret_regex )return_statement )block )function_definition )module
Escape any regex special characters other than alternation. :param regex: regex from datatables interface :type regex: str :rtype: str with regex to use with database
(module (function_definition (function_name_authenticate) function_name_authenticate (parameters (identifier_self) identifier_self (identifier_request) identifier_request (dictionary_splat_pattern (identifier_credentials) identifier_credentials )dictionary_splat_pattern )parameters (block (import_from_statement (dotted_name (identifier_allauth) identifier_allauth (identifier_account) identifier_account (identifier_auth_backends) identifier_auth_backends )dotted_name (dotted_name (identifier_AuthenticationBackend) identifier_AuthenticationBackend )dotted_name )import_from_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_pre_authenticate) identifier_pre_authenticate )attribute (argument_list (identifier_request) identifier_request (dictionary_splat (identifier_credentials) identifier_credentials )dictionary_splat )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_AuthenticationBackend) identifier_AuthenticationBackend (identifier_unstash_authenticated_user) identifier_unstash_authenticated_user )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_user) identifier_user (call (identifier_authenticate) identifier_authenticate (argument_list (identifier_request) identifier_request (dictionary_splat (identifier_credentials) identifier_credentials )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_alt_user) identifier_alt_user (call (attribute (identifier_AuthenticationBackend) identifier_AuthenticationBackend (identifier_unstash_authenticated_user) identifier_unstash_authenticated_user )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_user) identifier_user (boolean_operator (identifier_user) identifier_user (identifier_alt_user) identifier_alt_user )boolean_operator )assignment )expression_statement (if_statement (boolean_operator (identifier_user) identifier_user (attribute (identifier_app_settings) identifier_app_settings (identifier_LOGIN_ATTEMPTS_LIMIT) identifier_LOGIN_ATTEMPTS_LIMIT )attribute )boolean_operator (block (expression_statement (assignment (identifier_cache_key) identifier_cache_key (call (attribute (identifier_self) identifier_self (identifier__get_login_attempts_cache_key) identifier__get_login_attempts_cache_key )attribute (argument_list (identifier_request) identifier_request (dictionary_splat (identifier_credentials) identifier_credentials )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_cache) identifier_cache (identifier_delete) identifier_delete )attribute (argument_list (identifier_cache_key) identifier_cache_key )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_authentication_failed) identifier_authentication_failed )attribute (argument_list (identifier_request) identifier_request (dictionary_splat (identifier_credentials) identifier_credentials )dictionary_splat )argument_list )call )expression_statement )block )else_clause )if_statement (return_statement (identifier_user) identifier_user )return_statement )block )function_definition )module
Only authenticates, does not actually login. See `login`
(module (function_definition (function_name__percent_match) function_name__percent_match (parameters (identifier_result) identifier_result (identifier_out) identifier_out (default_parameter (identifier_yP) identifier_yP (None) None )default_parameter (list_splat_pattern (identifier_argl) identifier_argl )list_splat_pattern )parameters (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_argl) identifier_argl )argument_list )call (integer_1) integer_1 )comparison_operator (block (if_statement (comparison_operator (identifier_yP) identifier_yP (None) None )comparison_operator (block (expression_statement (assignment (identifier_Xt) identifier_Xt (subscript (identifier_argl) identifier_argl (integer_1) integer_1 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_key) identifier_key (call (identifier_id) identifier_id (argument_list (identifier_Xt) identifier_Xt )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_key) identifier_key (identifier__splits) identifier__splits )comparison_operator (block (expression_statement (assignment (identifier_yP) identifier_yP (subscript (subscript (identifier__splits) identifier__splits (identifier_key) identifier_key )subscript (integer_3) integer_3 )subscript )assignment )expression_statement )block )if_statement )block )if_statement (if_statement (comparison_operator (identifier_yP) identifier_yP (None) None )comparison_operator (block (import_statement (dotted_name (identifier_math) identifier_math )dotted_name )import_statement (expression_statement (assignment (subscript (identifier_out) identifier_out (string_"%") string_"%" )subscript (call (identifier_round) identifier_round (argument_list (binary_operator (float_1.) float_1. (binary_operator (call (identifier_sum) identifier_sum (argument_list (call (identifier_abs) identifier_abs (argument_list (binary_operator (identifier_yP) identifier_yP (identifier_result) identifier_result )binary_operator )argument_list )call )argument_list )call (call (identifier_float) identifier_float (argument_list (call (identifier_len) identifier_len (argument_list (identifier_result) identifier_result )argument_list )call )argument_list )call )binary_operator )binary_operator (integer_3) integer_3 )argument_list )call )assignment )expression_statement )block )if_statement )block )if_statement )block )function_definition )module
Returns the percent match for the specified prediction call; requires that the data was split before using an analyzed method. Args: out (dict): output dictionary to save the result to.
(module (function_definition (function_name_upload) function_name_upload (parameters (identifier_ui) identifier_ui (identifier_repo) identifier_repo (identifier_name) identifier_name (dictionary_splat_pattern (identifier_opts) identifier_opts )dictionary_splat_pattern )parameters (block (if_statement (identifier_codereview_disabled) identifier_codereview_disabled (block (raise_statement (call (attribute (identifier_hg_util) identifier_hg_util (identifier_Abort) identifier_Abort )attribute (argument_list (identifier_codereview_disabled) identifier_codereview_disabled )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (attribute (attribute (identifier_repo) identifier_repo (identifier_ui) identifier_ui )attribute (identifier_quiet) identifier_quiet )attribute (True) True )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_cl) identifier_cl (identifier_err) identifier_err )pattern_list (call (identifier_LoadCL) identifier_LoadCL (argument_list (identifier_ui) identifier_ui (identifier_repo) identifier_repo (identifier_name) identifier_name (keyword_argument (identifier_web) identifier_web (True) True )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_err) identifier_err (string_"") string_"" )comparison_operator (block (raise_statement (call (attribute (identifier_hg_util) identifier_hg_util (identifier_Abort) identifier_Abort )attribute (argument_list (identifier_err) identifier_err )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (attribute (identifier_cl) identifier_cl (identifier_local) identifier_local )attribute )not_operator (block (raise_statement (call (attribute (identifier_hg_util) identifier_hg_util (identifier_Abort) identifier_Abort )attribute (argument_list (string_"cannot upload non-local change") string_"cannot upload non-local change" )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (identifier_cl) identifier_cl (identifier_Upload) identifier_Upload )attribute (argument_list (identifier_ui) identifier_ui (identifier_repo) identifier_repo )argument_list )call )expression_statement (print_statement (binary_operator (string_"%s%s\n") string_"%s%s\n" (tuple (identifier_server_url_base) identifier_server_url_base (attribute (identifier_cl) identifier_cl (identifier_name) identifier_name )attribute )tuple )binary_operator )print_statement (return_statement (integer_0) integer_0 )return_statement )block )function_definition )module
upload diffs to the code review server Uploads the current modifications for a given change to the server.
(module (function_definition (function_name_det_dataset) function_name_det_dataset (parameters (identifier_eb) identifier_eb (identifier_passband) identifier_passband (identifier_dataid) identifier_dataid (identifier_comp) identifier_comp (identifier_time) identifier_time )parameters (block (expression_statement (assignment (identifier_rvs) identifier_rvs (attribute (call (attribute (identifier_eb) identifier_eb (identifier_get_dataset) identifier_get_dataset )attribute (argument_list (keyword_argument (identifier_kind) identifier_kind (string_'rv') string_'rv' )keyword_argument )argument_list )call (identifier_datasets) identifier_datasets )attribute )assignment )expression_statement (if_statement (comparison_operator (identifier_dataid) identifier_dataid (string_'Undefined') string_'Undefined' )comparison_operator (block (expression_statement (assignment (identifier_dataid) identifier_dataid (None) None )assignment )expression_statement )block )if_statement (try_statement (block (expression_statement (call (attribute (identifier_eb) identifier_eb (identifier__check_label) identifier__check_label )attribute (argument_list (identifier_dataid) identifier_dataid )argument_list )call )expression_statement (expression_statement (assignment (identifier_rv_dataset) identifier_rv_dataset (call (attribute (identifier_eb) identifier_eb (identifier_add_dataset) identifier_add_dataset )attribute (argument_list (string_'rv') string_'rv' (keyword_argument (identifier_dataset) identifier_dataset (identifier_dataid) identifier_dataid )keyword_argument (keyword_argument (identifier_times) identifier_times (list )list )keyword_argument )argument_list )call )assignment )expression_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_warning) identifier_warning )attribute (argument_list (string_"The name picked for the radial velocity curve is forbidden. Applying default name instead") string_"The name picked for the radial velocity curve is forbidden. Applying default name instead" )argument_list )call )expression_statement (expression_statement (assignment (identifier_rv_dataset) identifier_rv_dataset (call (attribute (identifier_eb) identifier_eb (identifier_add_dataset) identifier_add_dataset )attribute (argument_list (string_'rv') string_'rv' (keyword_argument (identifier_times) identifier_times (list )list )keyword_argument )argument_list )call )assignment )expression_statement )block )except_clause )try_statement (return_statement (identifier_rv_dataset) identifier_rv_dataset )return_statement )block )function_definition )module
Since RV datasets can have values related to each component in phoebe2, but are component specific in phoebe1 , it is important to determine which dataset to add parameters to. This function will do that. eb - bundle rvpt - relevant phoebe 1 parameters
(module (function_definition (function_name__on_move) function_name__on_move (parameters (identifier_self) identifier_self (identifier_event) identifier_event )parameters (block (expression_statement (assignment (identifier_w) identifier_w (call (attribute (identifier_self) identifier_self (identifier_winfo_width) identifier_winfo_width )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_x) identifier_x (call (identifier_min) identifier_min (argument_list (call (identifier_max) identifier_max (argument_list (attribute (identifier_event) identifier_event (identifier_x) identifier_x )attribute (integer_0) integer_0 )argument_list )call (identifier_w) identifier_w )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_coords) identifier_coords )attribute (argument_list (string_'cursor') string_'cursor' (identifier_x) identifier_x (integer_0) integer_0 (identifier_x) identifier_x (call (attribute (identifier_self) identifier_self (identifier_winfo_height) identifier_winfo_height )attribute (argument_list )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__variable) identifier__variable )attribute (identifier_set) identifier_set )attribute (argument_list (call (identifier_round2) identifier_round2 (argument_list (binary_operator (parenthesized_expression (binary_operator (float_360.) float_360. (identifier_x) identifier_x )binary_operator )parenthesized_expression (identifier_w) identifier_w )binary_operator )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Make selection cursor follow the cursor.
(module (function_definition (function_name_match_any) function_name_match_any (parameters (identifier_patterns) identifier_patterns (identifier_name) identifier_name )parameters (block (if_statement (not_operator (identifier_patterns) identifier_patterns )not_operator (block (return_statement (True) True )return_statement )block )if_statement (return_statement (call (identifier_any) identifier_any (generator_expression (call (identifier_match) identifier_match (argument_list (identifier_pattern) identifier_pattern (identifier_name) identifier_name )argument_list )call (for_in_clause (identifier_pattern) identifier_pattern (identifier_patterns) identifier_patterns )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Test if a name matches any of a list of patterns. Will return `True` if ``patterns`` is an empty list. Arguments: patterns (list): A list of wildcard pattern, e.g ``["*.py", "*.pyc"]`` name (str): A filename. Returns: bool: `True` if the name matches at least one of the patterns.
(module (function_definition (function_name_update_room_name) function_name_update_room_name (parameters (identifier_self) identifier_self )parameters (block (try_statement (block (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (identifier_api) identifier_api )attribute (identifier_get_room_name) identifier_get_room_name )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_room_id) identifier_room_id )attribute )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (string_"name") string_"name" (identifier_response) identifier_response )comparison_operator (comparison_operator (subscript (identifier_response) identifier_response (string_"name") string_"name" )subscript (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )comparison_operator )boolean_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute (subscript (identifier_response) identifier_response (string_"name") string_"name" )subscript )assignment )expression_statement (return_statement (True) True )return_statement )block (else_clause (block (return_statement (False) False )return_statement )block )else_clause )if_statement )block (except_clause (identifier_MatrixRequestError) identifier_MatrixRequestError (block (return_statement (False) False )return_statement )block )except_clause )try_statement )block )function_definition )module
Updates self.name and returns True if room name has changed.
(module (function_definition (function_name_get_table_idbb_field) function_name_get_table_idbb_field (parameters (identifier_endianess) identifier_endianess (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_bfld) identifier_bfld (subscript (call (attribute (identifier_struct) identifier_struct (identifier_unpack) identifier_unpack )attribute (argument_list (binary_operator (identifier_endianess) identifier_endianess (string_'H') string_'H' )binary_operator (subscript (identifier_data) identifier_data (slice (colon) colon (integer_2) integer_2 )slice )subscript )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_proc_nbr) identifier_proc_nbr (binary_operator (identifier_bfld) identifier_bfld (integer_0x7ff) integer_0x7ff )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_std_vs_mfg) identifier_std_vs_mfg (call (identifier_bool) identifier_bool (argument_list (binary_operator (identifier_bfld) identifier_bfld (integer_0x800) integer_0x800 )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_selector) identifier_selector (binary_operator (parenthesized_expression (binary_operator (identifier_bfld) identifier_bfld (integer_0xf000) integer_0xf000 )binary_operator )parenthesized_expression (integer_12) integer_12 )binary_operator )assignment )expression_statement (return_statement (tuple (identifier_proc_nbr) identifier_proc_nbr (identifier_std_vs_mfg) identifier_std_vs_mfg (identifier_selector) identifier_selector )tuple )return_statement )block )function_definition )module
Return data from a packed TABLE_IDB_BFLD bit-field. :param str endianess: The endianess to use when packing values ('>' or '<') :param str data: The packed and machine-formatted data to parse :rtype: tuple :return: Tuple of (proc_nbr, std_vs_mfg)
(module (function_definition (function_name_ReadPathInfoHistory) function_name_ReadPathInfoHistory (parameters (identifier_self) identifier_self (identifier_client_id) identifier_client_id (identifier_path_type) identifier_path_type (identifier_components) identifier_components )parameters (block (expression_statement (assignment (identifier_histories) identifier_histories (call (attribute (identifier_self) identifier_self (identifier_ReadPathInfosHistories) identifier_ReadPathInfosHistories )attribute (argument_list (identifier_client_id) identifier_client_id (identifier_path_type) identifier_path_type (list (identifier_components) identifier_components )list )argument_list )call )assignment )expression_statement (return_statement (subscript (identifier_histories) identifier_histories (identifier_components) identifier_components )subscript )return_statement )block )function_definition )module
Reads a collection of hash and stat entry for given path. Args: client_id: An identifier string for a client. path_type: A type of a path to retrieve path history for. components: A tuple of path components corresponding to path to retrieve information for. Returns: A list of `rdf_objects.PathInfo` ordered by timestamp in ascending order.
(module (function_definition (function_name_find_by_content_type) function_name_find_by_content_type (parameters (identifier_content_type) identifier_content_type )parameters (block (for_statement (identifier_format) identifier_format (identifier_FORMATS) identifier_FORMATS (block (if_statement (comparison_operator (identifier_content_type) identifier_content_type (attribute (identifier_format) identifier_format (identifier_content_types) identifier_content_types )attribute )comparison_operator (block (return_statement (identifier_format) identifier_format )return_statement )block )if_statement )block )for_statement (raise_statement (call (identifier_UnknownFormat) identifier_UnknownFormat (argument_list (binary_operator (string_'No format found with content type "%s"') string_'No format found with content type "%s"' (identifier_content_type) identifier_content_type )binary_operator )argument_list )call )raise_statement )block )function_definition )module
Find and return a format by content type. :param content_type: A string describing the internet media type of the format.
(module (function_definition (function_name_complete) function_name_complete (parameters (identifier_self) identifier_self (identifier_query) identifier_query (identifier_current_url) identifier_current_url )parameters (block (expression_statement (assignment (identifier_endpoint) identifier_endpoint (call (attribute (attribute (identifier_self) identifier_self (identifier_session) identifier_session )attribute (identifier_get) identifier_get )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__token_key) identifier__token_key )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_message) identifier_message (call (attribute (identifier_Message) identifier_Message (identifier_fromPostArgs) identifier_fromPostArgs )attribute (argument_list (identifier_query) identifier_query )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (identifier_self) identifier_self (identifier_consumer) identifier_consumer )attribute (identifier_complete) identifier_complete )attribute (argument_list (identifier_message) identifier_message (identifier_endpoint) identifier_endpoint (identifier_current_url) identifier_current_url )argument_list )call )assignment )expression_statement (try_statement (block (delete_statement (subscript (attribute (identifier_self) identifier_self (identifier_session) identifier_session )attribute (attribute (identifier_self) identifier_self (identifier__token_key) identifier__token_key )attribute )subscript )delete_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (pass_statement )pass_statement )block )except_clause )try_statement (if_statement (parenthesized_expression (boolean_operator (comparison_operator (attribute (identifier_response) identifier_response (identifier_status) identifier_status )attribute (list (string_'success') string_'success' (string_'cancel') string_'cancel' )list )comparison_operator (comparison_operator (attribute (identifier_response) identifier_response (identifier_identity_url) identifier_identity_url )attribute (None) None )comparison_operator )boolean_operator )parenthesized_expression (block (expression_statement (assignment (identifier_disco) identifier_disco (call (identifier_Discovery) identifier_Discovery (argument_list (attribute (identifier_self) identifier_self (identifier_session) identifier_session )attribute (attribute (identifier_response) identifier_response (identifier_identity_url) identifier_identity_url )attribute (attribute (identifier_self) identifier_self (identifier_session_key_prefix) identifier_session_key_prefix )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_disco) identifier_disco (identifier_cleanup) identifier_cleanup )attribute (argument_list (keyword_argument (identifier_force) identifier_force (True) True )keyword_argument )argument_list )call )expression_statement )block )if_statement (return_statement (identifier_response) identifier_response )return_statement )block )function_definition )module
Called to interpret the server's response to an OpenID request. It is called in step 4 of the flow described in the consumer overview. @param query: A dictionary of the query parameters for this HTTP request. @param current_url: The URL used to invoke the application. Extract the URL from your application's web request framework and specify it here to have it checked against the openid.return_to value in the response. If the return_to URL check fails, the status of the completion will be FAILURE. @returns: a subclass of Response. The type of response is indicated by the status attribute, which will be one of SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED. @see: L{SuccessResponse<openid.consumer.consumer.SuccessResponse>} @see: L{CancelResponse<openid.consumer.consumer.CancelResponse>} @see: L{SetupNeededResponse<openid.consumer.consumer.SetupNeededResponse>} @see: L{FailureResponse<openid.consumer.consumer.FailureResponse>}
(module (function_definition (function_name_service_restarted) function_name_service_restarted (parameters (identifier_self) identifier_self (identifier_sentry_unit) identifier_sentry_unit (identifier_service) identifier_service (identifier_filename) identifier_filename (default_parameter (identifier_pgrep_full) identifier_pgrep_full (None) None )default_parameter (default_parameter (identifier_sleep_time) identifier_sleep_time (integer_20) integer_20 )default_parameter )parameters (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (identifier_warn) identifier_warn )attribute (argument_list (concatenated_string (string_'DEPRECATION WARNING: use ') string_'DEPRECATION WARNING: use ' (string_'validate_service_config_changed instead of ') string_'validate_service_config_changed instead of ' (string_'service_restarted due to known races.') string_'service_restarted due to known races.' )concatenated_string )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_time) identifier_time (identifier_sleep) identifier_sleep )attribute (argument_list (identifier_sleep_time) identifier_sleep_time )argument_list )call )expression_statement (if_statement (parenthesized_expression (comparison_operator (call (attribute (identifier_self) identifier_self (identifier__get_proc_start_time) identifier__get_proc_start_time )attribute (argument_list (identifier_sentry_unit) identifier_sentry_unit (identifier_service) identifier_service (identifier_pgrep_full) identifier_pgrep_full )argument_list )call (call (attribute (identifier_self) identifier_self (identifier__get_file_mtime) identifier__get_file_mtime )attribute (argument_list (identifier_sentry_unit) identifier_sentry_unit (identifier_filename) identifier_filename )argument_list )call )comparison_operator )parenthesized_expression (block (return_statement (True) True )return_statement )block (else_clause (block (return_statement (False) False )return_statement )block )else_clause )if_statement )block )function_definition )module
Check if service was restarted. Compare a service's start time vs a file's last modification time (such as a config file for that service) to determine if the service has been restarted.
(module (function_definition (function_name_get_oauth_token_secret_name) function_name_get_oauth_token_secret_name (parameters (identifier_self) identifier_self (identifier_provider) identifier_provider )parameters (block (for_statement (identifier__provider) identifier__provider (attribute (identifier_self) identifier_self (identifier_oauth_providers) identifier_oauth_providers )attribute (block (if_statement (comparison_operator (subscript (identifier__provider) identifier__provider (string_"name") string_"name" )subscript (identifier_provider) identifier_provider )comparison_operator (block (return_statement (call (attribute (identifier__provider) identifier__provider (identifier_get) identifier_get )attribute (argument_list (string_"token_secret") string_"token_secret" (string_"oauth_token_secret") string_"oauth_token_secret" )argument_list )call )return_statement )block )if_statement )block )for_statement )block )function_definition )module
Returns the token_secret name for the oauth provider if none is configured defaults to oauth_secret this is configured using OAUTH_PROVIDERS and token_secret
(module (function_definition (function_name__readfloatle) function_name__readfloatle (parameters (identifier_self) identifier_self (identifier_length) identifier_length (identifier_start) identifier_start )parameters (block (expression_statement (assignment (pattern_list (identifier_startbyte) identifier_startbyte (identifier_offset) identifier_offset )pattern_list (call (identifier_divmod) identifier_divmod (argument_list (binary_operator (identifier_start) identifier_start (attribute (identifier_self) identifier_self (identifier__offset) identifier__offset )attribute )binary_operator (integer_8) integer_8 )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_offset) identifier_offset )not_operator (block (if_statement (comparison_operator (identifier_length) identifier_length (integer_32) integer_32 )comparison_operator (block (expression_statement (assignment (pattern_list (identifier_f) identifier_f )pattern_list (call (attribute (identifier_struct) identifier_struct (identifier_unpack) identifier_unpack )attribute (argument_list (string_'<f') string_'<f' (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_startbyte) identifier_startbyte (integer_4) integer_4 )binary_operator )argument_list )call )argument_list )call )argument_list )call )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_length) identifier_length (integer_64) integer_64 )comparison_operator (block (expression_statement (assignment (pattern_list (identifier_f) identifier_f )pattern_list (call (attribute (identifier_struct) identifier_struct (identifier_unpack) identifier_unpack )attribute (argument_list (string_'<d') string_'<d' (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_startbyte) identifier_startbyte (integer_8) integer_8 )binary_operator )argument_list )call )argument_list )call )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement )block (else_clause (block (if_statement (comparison_operator (identifier_length) identifier_length (integer_32) integer_32 )comparison_operator (block (expression_statement (assignment (pattern_list (identifier_f) identifier_f )pattern_list (call (attribute (identifier_struct) identifier_struct (identifier_unpack) identifier_unpack )attribute (argument_list (string_'<f') string_'<f' (call (attribute (identifier_self) identifier_self (identifier__readbytes) identifier__readbytes )attribute (argument_list (integer_32) integer_32 (identifier_start) identifier_start )argument_list )call )argument_list )call )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_length) identifier_length (integer_64) integer_64 )comparison_operator (block (expression_statement (assignment (pattern_list (identifier_f) identifier_f )pattern_list (call (attribute (identifier_struct) identifier_struct (identifier_unpack) identifier_unpack )attribute (argument_list (string_'<d') string_'<d' (call (attribute (identifier_self) identifier_self (identifier__readbytes) identifier__readbytes )attribute (argument_list (integer_64) integer_64 (identifier_start) identifier_start )argument_list )call )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement )block )else_clause )if_statement (try_statement (block (return_statement (identifier_f) identifier_f )return_statement )block (except_clause (identifier_NameError) identifier_NameError (block (raise_statement (call (identifier_InterpretError) identifier_InterpretError (argument_list (concatenated_string (string_"floats can only be 32 or 64 bits long, ") string_"floats can only be 32 or 64 bits long, " (string_"not {0} bits") string_"not {0} bits" )concatenated_string (identifier_length) identifier_length )argument_list )call )raise_statement )block )except_clause )try_statement )block )function_definition )module
Read bits and interpret as a little-endian float.
(module (function_definition (function_name_build_tree_file_pathname) function_name_build_tree_file_pathname (parameters (identifier_filename) identifier_filename (default_parameter (identifier_directory_depth) identifier_directory_depth (integer_8) integer_8 )default_parameter (default_parameter (identifier_pathname_separator_character) identifier_pathname_separator_character (attribute (identifier_os) identifier_os (identifier_sep) identifier_sep )attribute )default_parameter )parameters (block (return_statement (binary_operator (call (identifier_build_tree_pathname) identifier_build_tree_pathname (argument_list (identifier_filename) identifier_filename (identifier_directory_depth) identifier_directory_depth (identifier_pathname_separator_character) identifier_pathname_separator_character )argument_list )call (identifier_filename) identifier_filename )binary_operator )return_statement )block )function_definition )module
Return a file pathname which pathname is built of the specified number of sub-directories, and where each directory is named after the nth letter of the filename corresponding to the directory depth. Examples:: >>> build_tree_file_pathname('foo.txt', 2, '/') 'f/o/foo.txt' >>> build_tree_file_pathname('0123456789abcdef') '0/1/2/3/4/5/6/7/0123456789abcdef' @param filename: name of a file, with or without extension. @param directory_depth: number of sub-directories to be generated. @param pathname_separator_character: character to be used to separate pathname components, such as '/' for POSIX and '\\' for Windows. If not defined, the default is the character used by the operating system ``os.sep``. @return: a file pathname.
(module (function_definition (function_name__special_value_size) function_name__special_value_size (parameters (identifier_em) identifier_em )parameters (block (if_statement (comparison_operator (attribute (identifier_em) identifier_em (identifier_tagName) identifier_tagName )attribute (string_'input') string_'input' )comparison_operator (block (return_statement (call (identifier_convertToPositiveInt) identifier_convertToPositiveInt (argument_list (call (attribute (identifier_em) identifier_em (identifier_getAttribute) identifier_getAttribute )attribute (argument_list (string_'size') string_'size' (integer_20) integer_20 )argument_list )call (keyword_argument (identifier_invalidDefault) identifier_invalidDefault (integer_20) integer_20 )keyword_argument )argument_list )call )return_statement )block )if_statement (return_statement (call (attribute (identifier_em) identifier_em (identifier_getAttribute) identifier_getAttribute )attribute (argument_list (string_'size') string_'size' (string_'') string_'' )argument_list )call )return_statement )block )function_definition )module
handle "size" property, which has different behaviour for input vs everything else
(module (function_definition (function_name_get_user_trades) function_name_get_user_trades (parameters (identifier_self) identifier_self (default_parameter (identifier_limit) identifier_limit (integer_0) integer_0 )default_parameter (default_parameter (identifier_offset) identifier_offset (integer_0) integer_0 )default_parameter (default_parameter (identifier_sort) identifier_sort (string_'desc') string_'desc' )default_parameter )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__log) identifier__log )attribute (argument_list (string_'get user trades') string_'get user trades' )argument_list )call )expression_statement (expression_statement (assignment (identifier_res) identifier_res (call (attribute (attribute (identifier_self) identifier_self (identifier__rest_client) identifier__rest_client )attribute (identifier_post) identifier_post )attribute (argument_list (keyword_argument (identifier_endpoint) identifier_endpoint (string_'/user_transactions') string_'/user_transactions' )keyword_argument (keyword_argument (identifier_payload) identifier_payload (dictionary (pair (string_'book') string_'book' (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )pair (pair (string_'limit') string_'limit' (identifier_limit) identifier_limit )pair (pair (string_'offset') string_'offset' (identifier_offset) identifier_offset )pair (pair (string_'sort') string_'sort' (identifier_sort) identifier_sort )pair )dictionary )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (conditional_expression (subscript (identifier_res) identifier_res (slice (colon) colon (identifier_limit) identifier_limit )slice )subscript (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_res) identifier_res )argument_list )call (identifier_limit) identifier_limit (integer_0) integer_0 )comparison_operator (identifier_res) identifier_res )conditional_expression )return_statement )block )function_definition )module
Return user's trade history. :param limit: Maximum number of trades to return. If set to 0 or lower, all trades are returned (default: 0). :type limit: int :param offset: Number of trades to skip. :type offset: int :param sort: Method used to sort the results by date and time. Allowed values are "desc" for descending order, and "asc" for ascending order (default: "desc"). :type sort: str | unicode :return: User's trade history. :rtype: [dict]