sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name_subtract_days) function_name_subtract_days (parameters (identifier_self) identifier_self (typed_parameter (identifier_days) identifier_days (type (identifier_int) identifier_int )type )typed_parameter )parameters (type (identifier_datetime) identifier_datetime )type (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute (binary_operator (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute (call (identifier_relativedelta) identifier_relativedelta (argument_list (keyword_argument (identifier_days) identifier_days (identifier_days) identifier_days )keyword_argument )argument_list )call )binary_operator )assignment )expression_statement (return_statement (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute )return_statement )block )function_definition )module
Subtracts dates from the given value
(module (function_definition (function_name_switch_state) function_name_switch_state (parameters (identifier_context) identifier_context (identifier_ain) identifier_ain )parameters (block (expression_statement (call (attribute (attribute (identifier_context) identifier_context (identifier_obj) identifier_obj )attribute (identifier_login) identifier_login )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_actor) identifier_actor (call (attribute (attribute (identifier_context) identifier_context (identifier_obj) identifier_obj )attribute (identifier_get_actor_by_ain) identifier_get_actor_by_ain )attribute (argument_list (identifier_ain) identifier_ain )argument_list )call )assignment )expression_statement (if_statement (identifier_actor) identifier_actor (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (call (attribute (string_"State for {} is: {}") string_"State for {} is: {}" (identifier_format) identifier_format )attribute (argument_list (identifier_ain) identifier_ain (conditional_expression (string_'ON') string_'ON' (call (attribute (identifier_actor) identifier_actor (identifier_get_state) identifier_get_state )attribute (argument_list )argument_list )call (string_'OFF') string_'OFF' )conditional_expression )argument_list )call )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (call (attribute (string_"Actor not found: {}") string_"Actor not found: {}" (identifier_format) identifier_format )attribute (argument_list (identifier_ain) identifier_ain )argument_list )call )argument_list )call )expression_statement )block )else_clause )if_statement )block )function_definition )module
Get an actor's power state
(module (function_definition (function_name_joinMeiUyir) function_name_joinMeiUyir (parameters (identifier_mei_char) identifier_mei_char (identifier_uyir_char) identifier_uyir_char )parameters (block (if_statement (not_operator (identifier_mei_char) identifier_mei_char )not_operator (block (return_statement (identifier_uyir_char) identifier_uyir_char )return_statement )block )if_statement (if_statement (not_operator (identifier_uyir_char) identifier_uyir_char )not_operator (block (return_statement (identifier_mei_char) identifier_mei_char )return_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_mei_char) identifier_mei_char (boolean_operator (boolean_operator (identifier_PYTHON3) identifier_PYTHON3 (identifier_str) identifier_str )boolean_operator (identifier_unicode) identifier_unicode )boolean_operator )argument_list )call )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_u"Passed input mei character '%s' must be unicode, not just string") string_u"Passed input mei character '%s' must be unicode, not just string" (identifier_mei_char) identifier_mei_char )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (boolean_operator (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_uyir_char) identifier_uyir_char (boolean_operator (boolean_operator (identifier_PYTHON3) identifier_PYTHON3 (identifier_str) identifier_str )boolean_operator (identifier_unicode) identifier_unicode )boolean_operator )argument_list )call )not_operator (comparison_operator (identifier_uyir_char) identifier_uyir_char (None) None )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_u"Passed input uyir character '%s' must be unicode, not just string") string_u"Passed input uyir character '%s' must be unicode, not just string" (identifier_uyir_char) identifier_uyir_char )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (identifier_mei_char) identifier_mei_char (identifier_grantha_mei_letters) identifier_grantha_mei_letters )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_u"Passed input character '%s' is not a tamil mei character") string_u"Passed input character '%s' is not a tamil mei character" (identifier_mei_char) identifier_mei_char )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (identifier_uyir_char) identifier_uyir_char (identifier_uyir_letters) identifier_uyir_letters )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_u"Passed input character '%s' is not a tamil uyir character") string_u"Passed input character '%s' is not a tamil uyir character" (identifier_uyir_char) identifier_uyir_char )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (identifier_uyir_char) identifier_uyir_char (block (expression_statement (assignment (identifier_uyiridx) identifier_uyiridx (call (attribute (identifier_uyir_letters) identifier_uyir_letters (identifier_index) identifier_index )attribute (argument_list (identifier_uyir_char) identifier_uyir_char )argument_list )call )assignment )expression_statement )block (else_clause (block (return_statement (identifier_mei_char) identifier_mei_char )return_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_meiidx) identifier_meiidx (call (attribute (identifier_grantha_mei_letters) identifier_grantha_mei_letters (identifier_index) identifier_index )attribute (argument_list (identifier_mei_char) identifier_mei_char )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_uyirmeiidx) identifier_uyirmeiidx (binary_operator (binary_operator (identifier_meiidx) identifier_meiidx (integer_12) integer_12 )binary_operator (identifier_uyiridx) identifier_uyiridx )binary_operator )assignment )expression_statement (return_statement (subscript (identifier_grantha_uyirmei_letters) identifier_grantha_uyirmei_letters (identifier_uyirmeiidx) identifier_uyirmeiidx )subscript )return_statement )block )function_definition )module
This function join mei character and uyir character, and retuns as compound uyirmei unicode character. Inputs: mei_char : It must be unicode tamil mei char. uyir_char : It must be unicode tamil uyir char. Written By : Arulalan.T Date : 22.09.2014
(module (function_definition (function_name__get_secret_with_context) function_name__get_secret_with_context (parameters (identifier_filename) identifier_filename (identifier_secret) identifier_secret (identifier_plugin_settings) identifier_plugin_settings (default_parameter (identifier_lines_of_context) identifier_lines_of_context (integer_5) integer_5 )default_parameter (default_parameter (identifier_force) identifier_force (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_snippet) identifier_snippet (call (attribute (call (identifier_CodeSnippetHighlighter) identifier_CodeSnippetHighlighter (argument_list )argument_list )call (identifier_get_code_snippet) identifier_get_code_snippet )attribute (argument_list (identifier_filename) identifier_filename (subscript (identifier_secret) identifier_secret (string_'line_number') string_'line_number' )subscript (keyword_argument (identifier_lines_of_context) identifier_lines_of_context (identifier_lines_of_context) identifier_lines_of_context )keyword_argument )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_raw_secret_value) identifier_raw_secret_value (call (identifier_get_raw_secret_value) identifier_get_raw_secret_value (argument_list (attribute (identifier_snippet) identifier_snippet (identifier_target_line) identifier_target_line )attribute (identifier_secret) identifier_secret (identifier_plugin_settings) identifier_plugin_settings (identifier_filename) identifier_filename )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_snippet) identifier_snippet (identifier_highlight_line) identifier_highlight_line )attribute (argument_list (identifier_raw_secret_value) identifier_raw_secret_value )argument_list )call )expression_statement )block (except_clause (identifier_SecretNotFoundOnSpecifiedLineError) identifier_SecretNotFoundOnSpecifiedLineError (block (if_statement (not_operator (identifier_force) identifier_force )not_operator (block (raise_statement )raise_statement )block )if_statement (expression_statement (assignment (attribute (identifier_snippet) identifier_snippet (identifier_target_line) identifier_target_line )attribute (call (identifier_colorize) identifier_colorize (argument_list (attribute (identifier_snippet) identifier_snippet (identifier_target_line) identifier_target_line )attribute (attribute (identifier_AnsiColor) identifier_AnsiColor (identifier_BOLD) identifier_BOLD )attribute )argument_list )call )assignment )expression_statement )block )except_clause )try_statement (return_statement (call (attribute (identifier_snippet) identifier_snippet (identifier_add_line_numbers) identifier_add_line_numbers )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Displays the secret, with surrounding lines of code for better context. :type filename: str :param filename: filename where secret resides in :type secret: dict, PotentialSecret.json() format :param secret: the secret listed in baseline :type plugin_settings: list :param plugin_settings: plugins used to create baseline. :type lines_of_context: int :param lines_of_context: number of lines displayed before and after secret. :type force: bool :param force: if True, will print the lines of code even if it doesn't find the secret expected :raises: SecretNotFoundOnSpecifiedLineError
(module (function_definition (function_name__get_registry_auth) function_name__get_registry_auth (parameters (identifier_registry_url) identifier_registry_url (identifier_config_path) identifier_config_path )parameters (block (expression_statement (assignment (identifier_username) identifier_username (None) None )assignment )expression_statement (expression_statement (assignment (identifier_password) identifier_password (None) None )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_docker_config) identifier_docker_config (call (attribute (identifier_json) identifier_json (identifier_load) identifier_load )attribute (argument_list (call (identifier_open) identifier_open (argument_list (identifier_config_path) identifier_config_path )argument_list )call )argument_list )call )assignment )expression_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (return_statement (expression_list (identifier_username) identifier_username (identifier_password) identifier_password )expression_list )return_statement )block )except_clause )try_statement (if_statement (call (attribute (identifier_docker_config) identifier_docker_config (identifier_get) identifier_get )attribute (argument_list (string_'auths') string_'auths' )argument_list )call (block (expression_statement (assignment (identifier_docker_config) identifier_docker_config (subscript (identifier_docker_config) identifier_docker_config (string_'auths') string_'auths' )subscript )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_auth_key) identifier_auth_key (call (attribute (call (attribute (identifier_docker_config) identifier_docker_config (identifier_get) identifier_get )attribute (argument_list (identifier_registry_url) identifier_registry_url (dictionary )dictionary )argument_list )call (identifier_get) identifier_get )attribute (argument_list (string_'auth') string_'auth' (None) None )argument_list )call )assignment )expression_statement (if_statement (identifier_auth_key) identifier_auth_key (block (expression_statement (assignment (pattern_list (identifier_username) identifier_username (identifier_password) identifier_password )pattern_list (call (attribute (call (attribute (identifier_base64) identifier_base64 (identifier_b64decode) identifier_b64decode )attribute (argument_list (identifier_auth_key) identifier_auth_key )argument_list )call (identifier_split) identifier_split )attribute (argument_list (string_':') string_':' (integer_1) integer_1 )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (expression_list (identifier_username) identifier_username (identifier_password) identifier_password )expression_list )return_statement )block )function_definition )module
Retrieve from the config file the current authentication for a given URL, and return the username, password
(module (function_definition (function_name_source_range_slices) function_name_source_range_slices (parameters (identifier_start) identifier_start (identifier_end) identifier_end (identifier_nr_var_dict) identifier_nr_var_dict )parameters (block (return_statement (call (identifier_OrderedDict) identifier_OrderedDict (generator_expression (tuple (identifier_k) identifier_k (call (identifier_slice) identifier_slice (argument_list (identifier_s) identifier_s (identifier_e) identifier_e (integer_1) integer_1 )argument_list )call )tuple (for_in_clause (pattern_list (identifier_k) identifier_k (tuple_pattern (identifier_s) identifier_s (identifier_e) identifier_e )tuple_pattern )pattern_list (call (attribute (call (identifier_source_range_tuple) identifier_source_range_tuple (argument_list (identifier_start) identifier_start (identifier_end) identifier_end (identifier_nr_var_dict) identifier_nr_var_dict )argument_list )call (identifier_iteritems) identifier_iteritems )attribute (argument_list )argument_list )call )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Given a range of source numbers, as well as a dictionary containing the numbers of each source, returns a dictionary containing slices for each source variable type.
(module (function_definition (function_name__get_stddevs) function_name__get_stddevs (parameters (identifier_self) identifier_self (identifier_coeffs) identifier_coeffs (identifier_stddev_types) identifier_stddev_types (identifier_num_sites) identifier_num_sites )parameters (block (expression_statement (assignment (identifier_stddevs) identifier_stddevs (list )list )assignment )expression_statement (for_statement (identifier_stddev_type) identifier_stddev_type (identifier_stddev_types) identifier_stddev_types (block (assert_statement (comparison_operator (identifier_stddev_type) identifier_stddev_type (attribute (identifier_self) identifier_self (identifier_DEFINED_FOR_STANDARD_DEVIATION_TYPES) identifier_DEFINED_FOR_STANDARD_DEVIATION_TYPES )attribute )comparison_operator )assert_statement (expression_statement (call (attribute (identifier_stddevs) identifier_stddevs (identifier_append) identifier_append )attribute (argument_list (binary_operator (subscript (identifier_coeffs) identifier_coeffs (string_'sigma') string_'sigma' )subscript (call (attribute (identifier_np) identifier_np (identifier_zeros) identifier_zeros )attribute (argument_list (identifier_num_sites) identifier_num_sites )argument_list )call )binary_operator )argument_list )call )expression_statement )block )for_statement (return_statement (call (attribute (identifier_np) identifier_np (identifier_array) identifier_array )attribute (argument_list (identifier_stddevs) identifier_stddevs )argument_list )call )return_statement )block )function_definition )module
Return total sigma as reported in Table 2, p. 1202.
(module (function_definition (function_name_state) function_name_state (parameters (identifier_self) identifier_self (identifier_value) identifier_value )parameters (block (if_statement (comparison_operator (call (attribute (identifier_value) identifier_value (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call (identifier_ON) identifier_ON )comparison_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_SOAPAction) identifier_SOAPAction )attribute (argument_list (string_'SetSocketSettings') string_'SetSocketSettings' (string_'SetSocketSettingsResult') string_'SetSocketSettingsResult' (call (attribute (identifier_self) identifier_self (identifier_controlParameters) identifier_controlParameters )attribute (argument_list (string_"1") string_"1" (string_"true") string_"true" )argument_list )call )argument_list )call )return_statement )block (elif_clause (comparison_operator (call (attribute (identifier_value) identifier_value (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call (identifier_OFF) identifier_OFF )comparison_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_SOAPAction) identifier_SOAPAction )attribute (argument_list (string_'SetSocketSettings') string_'SetSocketSettings' (string_'SetSocketSettingsResult') string_'SetSocketSettingsResult' (call (attribute (identifier_self) identifier_self (identifier_controlParameters) identifier_controlParameters )attribute (argument_list (string_"1") string_"1" (string_"false") string_"false" )argument_list )call )argument_list )call )return_statement )block )elif_clause (else_clause (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (binary_operator (string_"State %s is not valid.") string_"State %s is not valid." (call (identifier_str) identifier_str (argument_list (identifier_value) identifier_value )argument_list )call )binary_operator )argument_list )call )raise_statement )block )else_clause )if_statement )block )function_definition )module
Set device state. :type value: str :param value: Future state (either ON or OFF)
(module (function_definition (function_name__fast_write) function_name__fast_write (parameters (identifier_self) identifier_self (identifier_outfile) identifier_outfile (identifier_value) identifier_value )parameters (block (expression_statement (call (attribute (identifier_outfile) identifier_outfile (identifier_truncate) identifier_truncate )attribute (argument_list (integer_0) integer_0 )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_outfile) identifier_outfile (identifier_write) identifier_write )attribute (argument_list (call (identifier_str) identifier_str (argument_list (call (identifier_int) identifier_int (argument_list (identifier_value) identifier_value )argument_list )call )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_outfile) identifier_outfile (identifier_flush) identifier_flush )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Function for fast writing to motor files.
(module (function_definition (function_name_retrieveAcknowledge) function_name_retrieveAcknowledge (parameters )parameters (block (expression_statement (assignment (identifier_a) identifier_a (call (identifier_TpPd) identifier_TpPd (argument_list (keyword_argument (identifier_pd) identifier_pd (integer_0x3) integer_0x3 )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_b) identifier_b (call (identifier_MessageType) identifier_MessageType (argument_list (keyword_argument (identifier_mesType) identifier_mesType (integer_0x1d) integer_0x1d )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_packet) identifier_packet (binary_operator (identifier_a) identifier_a (identifier_b) identifier_b )binary_operator )assignment )expression_statement (return_statement (identifier_packet) identifier_packet )return_statement )block )function_definition )module
RETRIEVE ACKNOWLEDGE Section 9.3.21
(module (function_definition (function_name_uuid_constructor) function_name_uuid_constructor (parameters (identifier_loader) identifier_loader (identifier_node) identifier_node )parameters (block (expression_statement (assignment (identifier_value) identifier_value (call (attribute (identifier_loader) identifier_loader (identifier_construct_scalar) identifier_construct_scalar )attribute (argument_list (identifier_node) identifier_node )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_uuid) identifier_uuid (identifier_UUID) identifier_UUID )attribute (argument_list (identifier_value) identifier_value )argument_list )call )return_statement )block )function_definition )module
Construct a uuid.UUID object form a scalar YAML node. Tests: >>> yaml.add_constructor("!uuid", uuid_constructor, Loader=yaml.SafeLoader) >>> yaml.safe_load("{'test': !uuid 'cc3702ca-699a-4aa6-8226-4c938f294d9b'}") {'test': UUID('cc3702ca-699a-4aa6-8226-4c938f294d9b')}
(module (function_definition (function_name__check) function_name__check (parameters (identifier_user) identifier_user (identifier_topic) identifier_topic )parameters (block (if_statement (subscript (identifier_topic) identifier_topic (string_'export_control') string_'export_control' )subscript (block (expression_statement (assignment (identifier_product) identifier_product (call (attribute (identifier_v1_utils) identifier_v1_utils (identifier_verify_existence_and_get) identifier_verify_existence_and_get )attribute (argument_list (subscript (identifier_topic) identifier_topic (string_'product_id') string_'product_id' )subscript (attribute (identifier_models) identifier_models (identifier_PRODUCTS) identifier_PRODUCTS )attribute )argument_list )call )assignment )expression_statement (return_statement (parenthesized_expression (boolean_operator (call (attribute (identifier_user) identifier_user (identifier_is_in_team) identifier_is_in_team )attribute (argument_list (subscript (identifier_product) identifier_product (string_'team_id') string_'team_id' )subscript )argument_list )call (comparison_operator (subscript (identifier_product) identifier_product (string_'team_id') string_'team_id' )subscript (attribute (identifier_user) identifier_user (identifier_parent_teams_ids) identifier_parent_teams_ids )attribute )comparison_operator )boolean_operator )parenthesized_expression )return_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
If the topic has it's export_control set to True then all the teams under the product team can access to the topic's resources. :param user: :param topic: :return: True if check is ok, False otherwise
(module (function_definition (function_name_status) function_name_status (parameters (identifier_self) identifier_self )parameters (block (if_statement (not_operator (attribute (identifier_self) identifier_self (identifier_created) identifier_created )attribute )not_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (call (attribute (call (attribute (identifier_self) identifier_self (identifier_inner) identifier_inner )attribute (argument_list )argument_list )call (identifier_reload) identifier_reload )attribute (argument_list )argument_list )call )expression_statement (return_statement (attribute (call (attribute (identifier_self) identifier_self (identifier_inner) identifier_inner )attribute (argument_list )argument_list )call (identifier_status) identifier_status )attribute )return_statement )block )function_definition )module
Get the container's current status from Docker. If the container does not exist (before creation and after removal), the status is ``None``.
(module (function_definition (function_name__create_pax_generic_header) function_name__create_pax_generic_header (parameters (identifier_cls) identifier_cls (identifier_pax_headers) identifier_pax_headers (default_parameter (identifier_type) identifier_type (attribute (identifier_tarfile) identifier_tarfile (identifier_XHDTYPE) identifier_XHDTYPE )attribute )default_parameter )parameters (block (expression_statement (assignment (identifier_records) identifier_records (list )list )assignment )expression_statement (for_statement (pattern_list (identifier_keyword) identifier_keyword (identifier_value) identifier_value )pattern_list (call (attribute (identifier_pax_headers) identifier_pax_headers (identifier_iteritems) identifier_iteritems )attribute (argument_list )argument_list )call (block (try_statement (block (expression_statement (assignment (identifier_keyword) identifier_keyword (call (attribute (identifier_keyword) identifier_keyword (identifier_encode) identifier_encode )attribute (argument_list (string_"utf8") string_"utf8" )argument_list )call )assignment )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (pass_statement )pass_statement )block )except_clause )try_statement (try_statement (block (expression_statement (assignment (identifier_value) identifier_value (call (attribute (identifier_value) identifier_value (identifier_encode) identifier_encode )attribute (argument_list (string_"utf8") string_"utf8" )argument_list )call )assignment )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (pass_statement )pass_statement )block )except_clause )try_statement (expression_statement (assignment (identifier_l) identifier_l (binary_operator (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_keyword) identifier_keyword )argument_list )call (call (identifier_len) identifier_len (argument_list (identifier_value) identifier_value )argument_list )call )binary_operator (integer_3) integer_3 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_n) identifier_n (assignment (identifier_p) identifier_p (integer_0) integer_0 )assignment )assignment )expression_statement (while_statement (True) True (block (expression_statement (assignment (identifier_n) identifier_n (binary_operator (identifier_l) identifier_l (call (identifier_len) identifier_len (argument_list (call (identifier_str) identifier_str (argument_list (identifier_p) identifier_p )argument_list )call )argument_list )call )binary_operator )assignment )expression_statement (if_statement (comparison_operator (identifier_n) identifier_n (identifier_p) identifier_p )comparison_operator (block (break_statement )break_statement )block )if_statement (expression_statement (assignment (identifier_p) identifier_p (identifier_n) identifier_n )assignment )expression_statement )block )while_statement (expression_statement (call (attribute (identifier_records) identifier_records (identifier_append) identifier_append )attribute (argument_list (binary_operator (string_"%d %s=%s\n") string_"%d %s=%s\n" (tuple (identifier_p) identifier_p (identifier_keyword) identifier_keyword (identifier_value) identifier_value )tuple )binary_operator )argument_list )call )expression_statement )block )for_statement (expression_statement (assignment (identifier_records) identifier_records (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (argument_list (identifier_records) identifier_records )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_info) identifier_info (dictionary )dictionary )assignment )expression_statement (expression_statement (assignment (subscript (identifier_info) identifier_info (string_"name") string_"name" )subscript (string_"././@PaxHeader") string_"././@PaxHeader" )assignment )expression_statement (expression_statement (assignment (subscript (identifier_info) identifier_info (string_"type") string_"type" )subscript (identifier_type) identifier_type )assignment )expression_statement (expression_statement (assignment (subscript (identifier_info) identifier_info (string_"size") string_"size" )subscript (call (identifier_len) identifier_len (argument_list (identifier_records) identifier_records )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_info) identifier_info (string_"magic") string_"magic" )subscript (attribute (identifier_tarfile) identifier_tarfile (identifier_POSIX_MAGIC) identifier_POSIX_MAGIC )attribute )assignment )expression_statement (return_statement (binary_operator (call (attribute (identifier_cls) identifier_cls (identifier__create_header) identifier__create_header )attribute (argument_list (identifier_info) identifier_info (attribute (identifier_tarfile) identifier_tarfile (identifier_USTAR_FORMAT) identifier_USTAR_FORMAT )attribute )argument_list )call (line_continuation_\) line_continuation_\ (call (attribute (identifier_cls) identifier_cls (identifier__create_payload) identifier__create_payload )attribute (argument_list (identifier_records) identifier_records )argument_list )call )binary_operator )return_statement )block )function_definition )module
Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs. The values must be unicode objects.
(module (function_definition (function_name__best_res_pixels) function_name__best_res_pixels (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_factor) identifier_factor (binary_operator (integer_2) integer_2 (parenthesized_expression (binary_operator (attribute (identifier_AbstractMOC) identifier_AbstractMOC (identifier_HPY_MAX_NORDER) identifier_HPY_MAX_NORDER )attribute (attribute (identifier_self) identifier_self (identifier_max_order) identifier_max_order )attribute )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_pix_l) identifier_pix_l (list )list )assignment )expression_statement (for_statement (identifier_iv) identifier_iv (attribute (attribute (identifier_self) identifier_self (identifier__interval_set) identifier__interval_set )attribute (identifier__intervals) identifier__intervals )attribute (block (for_statement (identifier_val) identifier_val (call (identifier_range) identifier_range (argument_list (binary_operator (subscript (identifier_iv) identifier_iv (integer_0) integer_0 )subscript (identifier_factor) identifier_factor )binary_operator (binary_operator (subscript (identifier_iv) identifier_iv (integer_1) integer_1 )subscript (identifier_factor) identifier_factor )binary_operator )argument_list )call (block (expression_statement (call (attribute (identifier_pix_l) identifier_pix_l (identifier_append) identifier_append )attribute (argument_list (identifier_val) identifier_val )argument_list )call )expression_statement )block )for_statement )block )for_statement (return_statement (call (attribute (identifier_np) identifier_np (identifier_asarray) identifier_asarray )attribute (argument_list (identifier_pix_l) identifier_pix_l )argument_list )call )return_statement )block )function_definition )module
Returns a numpy array of all the HEALPix indexes contained in the MOC at its max order. Returns ------- result : `~numpy.ndarray` The array of HEALPix at ``max_order``
(module (function_definition (function_name_colors) function_name_colors (parameters (identifier_self) identifier_self (identifier_value) identifier_value )parameters (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (identifier_str) identifier_str )argument_list )call (block (import_from_statement (relative_import (import_prefix )import_prefix (dotted_name (identifier_palettes) identifier_palettes )dotted_name )relative_import (dotted_name (identifier_PALETTES) identifier_PALETTES )dotted_name )import_from_statement (if_statement (comparison_operator (identifier_value) identifier_value (identifier_PALETTES) identifier_PALETTES )comparison_operator (block (raise_statement (call (identifier_YellowbrickValueError) identifier_YellowbrickValueError (argument_list (call (attribute (string_"'{}' is not a registered color palette") string_"'{}' is not a registered color palette" (identifier_format) identifier_format )attribute (argument_list (identifier_value) identifier_value )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__colors) identifier__colors )attribute (call (identifier_copy) identifier_copy (argument_list (subscript (identifier_PALETTES) identifier_PALETTES (identifier_value) identifier_value )subscript )argument_list )call )assignment )expression_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (identifier_list) identifier_list )argument_list )call (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__colors) identifier__colors )attribute (identifier_value) identifier_value )assignment )expression_statement )block )elif_clause (else_clause (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__colors) identifier__colors )attribute (call (identifier_list) identifier_list (argument_list (identifier_value) identifier_value )argument_list )call )assignment )expression_statement )block )else_clause )if_statement )block )function_definition )module
Converts color strings into a color listing.
(module (function_definition (function_name_dr) function_name_dr (parameters (identifier_self) identifier_self (identifier_cell_lengths) identifier_cell_lengths )parameters (block (expression_statement (assignment (identifier_half_cell_lengths) identifier_half_cell_lengths (binary_operator (identifier_cell_lengths) identifier_cell_lengths (float_2.0) float_2.0 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_this_dr) identifier_this_dr (binary_operator (attribute (attribute (identifier_self) identifier_self (identifier_final_site) identifier_final_site )attribute (identifier_r) identifier_r )attribute (attribute (attribute (identifier_self) identifier_self (identifier_initial_site) identifier_initial_site )attribute (identifier_r) identifier_r )attribute )binary_operator )assignment )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (integer_3) integer_3 )argument_list )call (block (if_statement (comparison_operator (subscript (identifier_this_dr) identifier_this_dr (identifier_i) identifier_i )subscript (subscript (identifier_half_cell_lengths) identifier_half_cell_lengths (identifier_i) identifier_i )subscript )comparison_operator (block (expression_statement (augmented_assignment (subscript (identifier_this_dr) identifier_this_dr (identifier_i) identifier_i )subscript (subscript (identifier_cell_lengths) identifier_cell_lengths (identifier_i) identifier_i )subscript )augmented_assignment )expression_statement )block )if_statement (if_statement (comparison_operator (subscript (identifier_this_dr) identifier_this_dr (identifier_i) identifier_i )subscript (unary_operator (subscript (identifier_half_cell_lengths) identifier_half_cell_lengths (identifier_i) identifier_i )subscript )unary_operator )comparison_operator (block (expression_statement (augmented_assignment (subscript (identifier_this_dr) identifier_this_dr (identifier_i) identifier_i )subscript (subscript (identifier_cell_lengths) identifier_cell_lengths (identifier_i) identifier_i )subscript )augmented_assignment )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_this_dr) identifier_this_dr )return_statement )block )function_definition )module
Particle displacement vector for this jump Args: cell_lengths (np.array(x,y,z)): Cell lengths for the orthogonal simulation cell. Returns (np.array(x,y,z)): dr
(module (function_definition (function_name_ask_bool) function_name_ask_bool (parameters (typed_parameter (identifier_question) identifier_question (type (identifier_str) identifier_str )type )typed_parameter (typed_default_parameter (identifier_default) identifier_default (type (identifier_bool) identifier_bool )type (True) True )typed_default_parameter )parameters (type (identifier_bool) identifier_bool )type (block (expression_statement (assignment (identifier_default_q) identifier_default_q (conditional_expression (string_"Y/n") string_"Y/n" (identifier_default) identifier_default (string_"y/N") string_"y/N" )conditional_expression )assignment )expression_statement (expression_statement (assignment (identifier_answer) identifier_answer (call (identifier_input) identifier_input (argument_list (call (attribute (string_"{0} [{1}]: ") string_"{0} [{1}]: " (identifier_format) identifier_format )attribute (argument_list (identifier_question) identifier_question (identifier_default_q) identifier_default_q )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_lower) identifier_lower (call (attribute (identifier_answer) identifier_answer (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_lower) identifier_lower )not_operator (block (return_statement (identifier_default) identifier_default )return_statement )block )if_statement (return_statement (comparison_operator (identifier_lower) identifier_lower (string_"y") string_"y" )comparison_operator )return_statement )block )function_definition )module
Asks a question yes no style
(module (function_definition (function_name_collections) function_name_collections (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_iterator) identifier_iterator (call (attribute (attribute (identifier_self) identifier_self (identifier__firestore_api) identifier__firestore_api )attribute (identifier_list_collection_ids) identifier_list_collection_ids )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__database_string) identifier__database_string )attribute (keyword_argument (identifier_metadata) identifier_metadata (attribute (identifier_self) identifier_self (identifier__rpc_metadata) identifier__rpc_metadata )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_iterator) identifier_iterator (identifier_client) identifier_client )attribute (identifier_self) identifier_self )assignment )expression_statement (expression_statement (assignment (attribute (identifier_iterator) identifier_iterator (identifier_item_to_value) identifier_item_to_value )attribute (identifier__item_to_collection_ref) identifier__item_to_collection_ref )assignment )expression_statement (return_statement (identifier_iterator) identifier_iterator )return_statement )block )function_definition )module
List top-level collections of the client's database. Returns: Sequence[~.firestore_v1beta1.collection.CollectionReference]: iterator of subcollections of the current document.
(module (function_definition (function_name_get_parent_ids) function_name_get_parent_ids (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_id_list) identifier_id_list (list )list )assignment )expression_statement (import_from_statement (relative_import (import_prefix )import_prefix (dotted_name (identifier_id) identifier_id (identifier_objects) identifier_objects )dotted_name )relative_import (dotted_name (identifier_IdList) identifier_IdList )dotted_name )import_from_statement (for_statement (identifier_parent_node) identifier_parent_node (subscript (attribute (identifier_self) identifier_self (identifier__my_map) identifier__my_map )attribute (string_'parentNodes') string_'parentNodes' )subscript (block (expression_statement (call (attribute (identifier_id_list) identifier_id_list (identifier_append) identifier_append )attribute (argument_list (call (identifier_str) identifier_str (argument_list (attribute (identifier_parent_node) identifier_parent_node (identifier_ident) identifier_ident )attribute )argument_list )call )argument_list )call )expression_statement )block )for_statement (return_statement (call (identifier_IdList) identifier_IdList (argument_list (identifier_id_list) identifier_id_list )argument_list )call )return_statement )block )function_definition )module
Gets the parents of this node. return: (osid.id.IdList) - the parents of this node *compliance: mandatory -- This method must be implemented.*
(module (function_definition (function_name_ping) function_name_ping (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_last_ping) identifier_last_ping )attribute (call (attribute (identifier_time) identifier_time (identifier_time) identifier_time )attribute (argument_list )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_send_message) identifier_send_message )attribute (argument_list (dictionary (pair (identifier_MESSAGE_TYPE) identifier_MESSAGE_TYPE (identifier_TYPE_PING) identifier_TYPE_PING )pair )dictionary )argument_list )call )expression_statement )block (except_clause (identifier_NotConnected) identifier_NotConnected (block (expression_statement (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier__socket_client) identifier__socket_client )attribute (identifier_logger) identifier_logger )attribute (identifier_error) identifier_error )attribute (argument_list (binary_operator (string_"Chromecast is disconnected. ") string_"Chromecast is disconnected. " (string_"Cannot ping until reconnected.") string_"Cannot ping until reconnected." )binary_operator )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
Send a ping message.
(module (function_definition (function_name__is_nmrstar) function_name__is_nmrstar (parameters (identifier_string) identifier_string )parameters (block (if_statement (boolean_operator (parenthesized_expression (boolean_operator (comparison_operator (subscript (identifier_string) identifier_string (slice (integer_0) integer_0 (colon) colon (integer_5) integer_5 )slice )subscript (string_u"data_") string_u"data_" )comparison_operator (comparison_operator (string_u"save_") string_u"save_" (identifier_string) identifier_string )comparison_operator )boolean_operator )parenthesized_expression (parenthesized_expression (boolean_operator (comparison_operator (subscript (identifier_string) identifier_string (slice (integer_0) integer_0 (colon) colon (integer_5) integer_5 )slice )subscript (string_b"data_") string_b"data_" )comparison_operator (comparison_operator (string_b"save_") string_b"save_" (identifier_string) identifier_string )comparison_operator )boolean_operator )parenthesized_expression )boolean_operator (block (return_statement (identifier_string) identifier_string )return_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Test if input string is in NMR-STAR format. :param string: Input string. :type string: :py:class:`str` or :py:class:`bytes` :return: Input string if in NMR-STAR format or False otherwise. :rtype: :py:class:`str` or :py:obj:`False`
(module (function_definition (function_name_pdf) function_name_pdf (parameters (identifier_self) identifier_self (identifier_mu) identifier_mu )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_transform) identifier_transform )attribute (None) None )comparison_operator (block (expression_statement (assignment (identifier_mu) identifier_mu (call (attribute (identifier_self) identifier_self (identifier_transform) identifier_transform )attribute (argument_list (identifier_mu) identifier_mu )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (call (attribute (attribute (identifier_ss) identifier_ss (identifier_expon) identifier_expon )attribute (identifier_pdf) identifier_pdf )attribute (argument_list (identifier_mu) identifier_mu (attribute (identifier_self) identifier_self (identifier_lmd0) identifier_lmd0 )attribute )argument_list )call )return_statement )block )function_definition )module
PDF for Exponential prior Parameters ---------- mu : float Latent variable for which the prior is being formed over Returns ---------- - p(mu)
(module (function_definition (function_name_get_data_for_notifications) function_name_get_data_for_notifications (parameters (identifier_self) identifier_self (identifier_contact) identifier_contact (identifier_notif) identifier_notif (identifier_host_ref) identifier_host_ref )parameters (block (if_statement (not_operator (identifier_host_ref) identifier_host_ref )not_operator (block (return_statement (list (identifier_self) identifier_self (identifier_contact) identifier_contact (identifier_notif) identifier_notif )list )return_statement )block )if_statement (return_statement (list (identifier_host_ref) identifier_host_ref (identifier_self) identifier_self (identifier_contact) identifier_contact (identifier_notif) identifier_notif )list )return_statement )block )function_definition )module
Get data for a notification :param contact: The contact to return :type contact: :param notif: the notification to return :type notif: :return: list containing the service, the host and the given parameters :rtype: list
(module (function_definition (function_name_owner) function_name_owner (parameters (identifier_self) identifier_self (identifier_owner) identifier_owner )parameters (block (if_statement (comparison_operator (identifier_owner) identifier_owner (None) None )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"Invalid value for `owner`, must not be `None`") string_"Invalid value for `owner`, must not be `None`" )argument_list )call )raise_statement )block )if_statement (if_statement (boolean_operator (comparison_operator (identifier_owner) identifier_owner (None) None )comparison_operator (not_operator (call (attribute (identifier_re) identifier_re (identifier_search) identifier_search )attribute (argument_list (string_'[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]') string_'[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]' (identifier_owner) identifier_owner )argument_list )call )not_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"Invalid value for `owner`, must be a follow pattern or equal to `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`") string_"Invalid value for `owner`, must be a follow pattern or equal to `/[a-z0-9](?:-(?!-)|[a-z0-9])+[a-z0-9]/`" )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__owner) identifier__owner )attribute (identifier_owner) identifier_owner )assignment )expression_statement )block )function_definition )module
Sets the owner of this LinkedDatasetCreateOrUpdateRequest. User name and unique identifier of the creator of the dataset. :param owner: The owner of this LinkedDatasetCreateOrUpdateRequest. :type: str
(module (function_definition (function_name_visit_classdef) function_name_visit_classdef (parameters (identifier_self) identifier_self (identifier_node) identifier_node (identifier_parent) identifier_parent (default_parameter (identifier_newstyle) identifier_newstyle (None) None )default_parameter )parameters (block (expression_statement (assignment (pattern_list (identifier_node) identifier_node (identifier_doc) identifier_doc )pattern_list (call (attribute (identifier_self) identifier_self (identifier__get_doc) identifier__get_doc )attribute (argument_list (identifier_node) identifier_node )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_newnode) identifier_newnode (call (attribute (identifier_nodes) identifier_nodes (identifier_ClassDef) identifier_ClassDef )attribute (argument_list (attribute (identifier_node) identifier_node (identifier_name) identifier_name )attribute (identifier_doc) identifier_doc (attribute (identifier_node) identifier_node (identifier_lineno) identifier_lineno )attribute (attribute (identifier_node) identifier_node (identifier_col_offset) identifier_col_offset )attribute (identifier_parent) identifier_parent )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_metaclass) identifier_metaclass (None) None )assignment )expression_statement (if_statement (identifier_PY3) identifier_PY3 (block (for_statement (identifier_keyword) identifier_keyword (attribute (identifier_node) identifier_node (identifier_keywords) identifier_keywords )attribute (block (if_statement (comparison_operator (attribute (identifier_keyword) identifier_keyword (identifier_arg) identifier_arg )attribute (string_"metaclass") string_"metaclass" )comparison_operator (block (expression_statement (assignment (identifier_metaclass) identifier_metaclass (attribute (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_keyword) identifier_keyword (identifier_newnode) identifier_newnode )argument_list )call (identifier_value) identifier_value )attribute )assignment )expression_statement (break_statement )break_statement )block )if_statement )block )for_statement )block )if_statement (if_statement (attribute (identifier_node) identifier_node (identifier_decorator_list) identifier_decorator_list )attribute (block (expression_statement (assignment (identifier_decorators) identifier_decorators (call (attribute (identifier_self) identifier_self (identifier_visit_decorators) identifier_visit_decorators )attribute (argument_list (identifier_node) identifier_node (identifier_newnode) identifier_newnode )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_decorators) identifier_decorators (None) None )assignment )expression_statement )block )else_clause )if_statement (expression_statement (call (attribute (identifier_newnode) identifier_newnode (identifier_postinit) identifier_postinit )attribute (argument_list (list_comprehension (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_child) identifier_child (identifier_newnode) identifier_newnode )argument_list )call (for_in_clause (identifier_child) identifier_child (attribute (identifier_node) identifier_node (identifier_bases) identifier_bases )attribute )for_in_clause )list_comprehension (list_comprehension (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_child) identifier_child (identifier_newnode) identifier_newnode )argument_list )call (for_in_clause (identifier_child) identifier_child (attribute (identifier_node) identifier_node (identifier_body) identifier_body )attribute )for_in_clause )list_comprehension (identifier_decorators) identifier_decorators (identifier_newstyle) identifier_newstyle (identifier_metaclass) identifier_metaclass (conditional_expression (list_comprehension (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_kwd) identifier_kwd (identifier_newnode) identifier_newnode )argument_list )call (for_in_clause (identifier_kwd) identifier_kwd (attribute (identifier_node) identifier_node (identifier_keywords) identifier_keywords )attribute )for_in_clause (if_clause (comparison_operator (attribute (identifier_kwd) identifier_kwd (identifier_arg) identifier_arg )attribute (string_"metaclass") string_"metaclass" )comparison_operator )if_clause )list_comprehension (identifier_PY3) identifier_PY3 (list )list )conditional_expression )argument_list )call )expression_statement (return_statement (identifier_newnode) identifier_newnode )return_statement )block )function_definition )module
visit a ClassDef node to become astroid
(module (function_definition (function_name__get_config_files) function_name__get_config_files (parameters )parameters (block (expression_statement (assignment (identifier_config_paths) identifier_config_paths (list )list )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute (identifier_get) identifier_get )attribute (argument_list (string_'FEDMSG_CONFIG') string_'FEDMSG_CONFIG' )argument_list )call (block (expression_statement (assignment (identifier_config_location) identifier_config_location (subscript (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute (string_'FEDMSG_CONFIG') string_'FEDMSG_CONFIG' )subscript )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_config_location) identifier_config_location (string_'/etc/fedmsg.d') string_'/etc/fedmsg.d' )assignment )expression_statement )block )else_clause )if_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isfile) identifier_isfile )attribute (argument_list (identifier_config_location) identifier_config_location )argument_list )call (block (expression_statement (call (attribute (identifier_config_paths) identifier_config_paths (identifier_append) identifier_append )attribute (argument_list (identifier_config_location) identifier_config_location )argument_list )call )expression_statement )block (elif_clause (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_config_location) identifier_config_location )argument_list )call (block (expression_statement (assignment (identifier_possible_config_files) identifier_possible_config_files (list_comprehension (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_config_location) identifier_config_location (identifier_p) identifier_p )argument_list )call (for_in_clause (identifier_p) identifier_p (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (identifier_config_location) identifier_config_location )argument_list )call )for_in_clause (if_clause (call (attribute (identifier_p) identifier_p (identifier_endswith) identifier_endswith )attribute (argument_list (string_'.py') string_'.py' )argument_list )call )if_clause )list_comprehension )assignment )expression_statement (for_statement (identifier_p) identifier_p (identifier_possible_config_files) identifier_possible_config_files (block (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isfile) identifier_isfile )attribute (argument_list (identifier_p) identifier_p )argument_list )call (block (expression_statement (call (attribute (identifier_config_paths) identifier_config_paths (identifier_append) identifier_append )attribute (argument_list (identifier_p) identifier_p )argument_list )call )expression_statement )block )if_statement )block )for_statement )block )elif_clause )if_statement (if_statement (not_operator (identifier_config_paths) identifier_config_paths )not_operator (block (expression_statement (call (attribute (identifier__log) identifier__log (identifier_info) identifier_info )attribute (argument_list (string_'No configuration files found in %s') string_'No configuration files found in %s' (identifier_config_location) identifier_config_location )argument_list )call )expression_statement )block )if_statement (return_statement (identifier_config_paths) identifier_config_paths )return_statement )block )function_definition )module
Load the list of file paths for fedmsg configuration files. Returns: list: List of files containing fedmsg configuration.
(module (function_definition (function_name__get_cache_plus_key) function_name__get_cache_plus_key (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_key) identifier_key (call (identifier_getattr) identifier_getattr (argument_list (identifier_self) identifier_self (string_'_cache_key') string_'_cache_key' (call (attribute (identifier_self) identifier_self (identifier_key_from_query) identifier_key_from_query )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (expression_list (attribute (attribute (identifier_self) identifier_self (identifier__cache) identifier__cache )attribute (identifier_cache) identifier_cache )attribute (identifier_key) identifier_key )expression_list )return_statement )block )function_definition )module
Return a cache region plus key.
(module (function_definition (function_name_tomorrow) function_name_tomorrow (parameters (default_parameter (identifier_date) identifier_date (None) None )default_parameter )parameters (block (if_statement (not_operator (identifier_date) identifier_date )not_operator (block (return_statement (binary_operator (identifier__date) identifier__date (call (attribute (identifier_datetime) identifier_datetime (identifier_timedelta) identifier_timedelta )attribute (argument_list (keyword_argument (identifier_days) identifier_days (integer_1) integer_1 )keyword_argument )argument_list )call )binary_operator )return_statement )block (else_clause (block (expression_statement (assignment (identifier_current_date) identifier_current_date (call (identifier_parse) identifier_parse (argument_list (identifier_date) identifier_date )argument_list )call )assignment )expression_statement (return_statement (binary_operator (identifier_current_date) identifier_current_date (call (attribute (identifier_datetime) identifier_datetime (identifier_timedelta) identifier_timedelta )attribute (argument_list (keyword_argument (identifier_days) identifier_days (integer_1) integer_1 )keyword_argument )argument_list )call )binary_operator )return_statement )block )else_clause )if_statement )block )function_definition )module
tomorrow is another day
(module (function_definition (function_name_add_account_to_group) function_name_add_account_to_group (parameters (identifier_self) identifier_self (identifier_account) identifier_account (identifier_group) identifier_group )parameters (block (expression_statement (assignment (identifier_lgroup) identifier_lgroup (type (identifier_OpenldapGroup) identifier_OpenldapGroup )type (call (attribute (identifier_self) identifier_self (identifier__get_group) identifier__get_group )attribute (argument_list (attribute (identifier_group) identifier_group (identifier_name) identifier_name )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_person) identifier_person (type (identifier_OpenldapAccount) identifier_OpenldapAccount )type (call (attribute (identifier_self) identifier_self (identifier__get_account) identifier__get_account )attribute (argument_list (attribute (identifier_account) identifier_account (identifier_username) identifier_username )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_changes) identifier_changes (call (identifier_changeset) identifier_changeset (argument_list (identifier_lgroup) identifier_lgroup (dictionary )dictionary )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_changes) identifier_changes (call (attribute (identifier_lgroup) identifier_lgroup (identifier_add_member) identifier_add_member )attribute (argument_list (identifier_changes) identifier_changes (identifier_person) identifier_person )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_save) identifier_save (argument_list (identifier_changes) identifier_changes (keyword_argument (identifier_database) identifier_database (attribute (identifier_self) identifier_self (identifier__database) identifier__database )attribute )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
Add account to group.
(module (function_definition (function_name_calc_observable_fraction) function_name_calc_observable_fraction (parameters (identifier_self) identifier_self (identifier_distance_modulus) identifier_distance_modulus )parameters (block (expression_statement (assignment (identifier_observable_fraction) identifier_observable_fraction (call (attribute (attribute (identifier_self) identifier_self (identifier_isochrone) identifier_isochrone )attribute (identifier_observableFraction) identifier_observableFraction )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_mask) identifier_mask )attribute (identifier_distance_modulus) identifier_distance_modulus )argument_list )call )assignment )expression_statement (if_statement (not_operator (comparison_operator (call (attribute (identifier_observable_fraction) identifier_observable_fraction (identifier_sum) identifier_sum )attribute (argument_list )argument_list )call (integer_0) integer_0 )comparison_operator )not_operator (block (expression_statement (assignment (identifier_msg) identifier_msg (string_"No observable fraction") string_"No observable fraction" )assignment )expression_statement (expression_statement (augmented_assignment (identifier_msg) identifier_msg (parenthesized_expression (binary_operator (string_"\n") string_"\n" (call (identifier_str) identifier_str (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_source) identifier_source )attribute (identifier_params) identifier_params )attribute )argument_list )call )binary_operator )parenthesized_expression )augmented_assignment )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_error) identifier_error )attribute (argument_list (identifier_msg) identifier_msg )argument_list )call )expression_statement (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (identifier_msg) identifier_msg )argument_list )call )raise_statement )block )if_statement (return_statement (identifier_observable_fraction) identifier_observable_fraction )return_statement )block )function_definition )module
Calculated observable fraction within each pixel of the target region.
(module (function_definition (function_name__guess_vc) function_name__guess_vc (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_vc_ver) identifier_vc_ver )attribute (float_14.0) float_14.0 )comparison_operator (block (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_default) identifier_default (string_r'VC\Tools\MSVC') string_r'VC\Tools\MSVC' )assignment )expression_statement (expression_statement (assignment (identifier_guess_vc) identifier_guess_vc (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_VSInstallDir) identifier_VSInstallDir )attribute (identifier_default) identifier_default )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_vc_exact_ver) identifier_vc_exact_ver (subscript (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (identifier_guess_vc) identifier_guess_vc )argument_list )call (unary_operator (integer_1) integer_1 )unary_operator )subscript )assignment )expression_statement (return_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_guess_vc) identifier_guess_vc (identifier_vc_exact_ver) identifier_vc_exact_ver )argument_list )call )return_statement )block (except_clause (tuple (identifier_OSError) identifier_OSError (identifier_IOError) identifier_IOError (identifier_IndexError) identifier_IndexError )tuple (block (pass_statement )pass_statement )block )except_clause )try_statement )block )function_definition )module
Locate Visual C for 2017
(module (function_definition (function_name_create_client) function_name_create_client (parameters (identifier_addr) identifier_addr (identifier_port) identifier_port )parameters (block (expression_statement (assignment (identifier_sock) identifier_sock (call (attribute (identifier_socket) identifier_socket (identifier_socket) identifier_socket )attribute (argument_list (attribute (identifier_socket) identifier_socket (identifier_AF_INET) identifier_AF_INET )attribute (attribute (identifier_socket) identifier_socket (identifier_SOCK_STREAM) identifier_SOCK_STREAM )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_sock) identifier_sock (identifier_connect_ex) identifier_connect_ex )attribute (argument_list (tuple (identifier_addr) identifier_addr (identifier_port) identifier_port )tuple )argument_list )call )expression_statement (expression_statement (assignment (identifier_spin) identifier_spin (call (identifier_Spin) identifier_Spin (argument_list (identifier_sock) identifier_sock )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_Client) identifier_Client (argument_list (identifier_spin) identifier_spin )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_spin) identifier_spin (identifier_add_map) identifier_add_map )attribute (argument_list (identifier_CONNECT) identifier_CONNECT (identifier_install_basic_handles) identifier_install_basic_handles )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_spin) identifier_spin (identifier_add_map) identifier_add_map )attribute (argument_list (identifier_CONNECT_ERR) identifier_CONNECT_ERR (lambda (lambda_parameters (identifier_con) identifier_con (identifier_err) identifier_err )lambda_parameters (call (identifier_lose) identifier_lose (argument_list (identifier_con) identifier_con )argument_list )call )lambda )argument_list )call )expression_statement (return_statement (identifier_spin) identifier_spin )return_statement )block )function_definition )module
Set up a TCP client and installs the basic handles Stdin, Stdout. def send_data(client): client.dump('GET / HTTP/1.1\r\n') xmap(client, LOAD, iostd.put) client = create_client('www.google.com.br', 80) xmap(client, CONNECT, send_data)
(module (function_definition (function_name_rustcall) function_name_rustcall (parameters (identifier_func) identifier_func (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (block (expression_statement (call (attribute (identifier_lib) identifier_lib (identifier_semaphore_err_clear) identifier_semaphore_err_clear )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_rv) identifier_rv (call (identifier_func) identifier_func (argument_list (list_splat (identifier_args) identifier_args )list_splat )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_err) identifier_err (call (attribute (identifier_lib) identifier_lib (identifier_semaphore_err_get_last_code) identifier_semaphore_err_get_last_code )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_err) identifier_err )not_operator (block (return_statement (identifier_rv) identifier_rv )return_statement )block )if_statement (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (identifier_lib) identifier_lib (identifier_semaphore_err_get_last_message) identifier_semaphore_err_get_last_message )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_cls) identifier_cls (call (attribute (identifier_exceptions_by_code) identifier_exceptions_by_code (identifier_get) identifier_get )attribute (argument_list (identifier_err) identifier_err (identifier_SemaphoreError) identifier_SemaphoreError )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_exc) identifier_exc (call (identifier_cls) identifier_cls (argument_list (call (identifier_decode_str) identifier_decode_str (argument_list (identifier_msg) identifier_msg )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_backtrace) identifier_backtrace (call (identifier_decode_str) identifier_decode_str (argument_list (call (attribute (identifier_lib) identifier_lib (identifier_semaphore_err_get_backtrace) identifier_semaphore_err_get_backtrace )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (identifier_backtrace) identifier_backtrace (block (expression_statement (assignment (attribute (identifier_exc) identifier_exc (identifier_rust_info) identifier_rust_info )attribute (identifier_backtrace) identifier_backtrace )assignment )expression_statement )block )if_statement (raise_statement (identifier_exc) identifier_exc )raise_statement )block )function_definition )module
Calls rust method and does some error handling.
(module (function_definition (function_name_generate_json_docs) function_name_generate_json_docs (parameters (identifier_module) identifier_module (default_parameter (identifier_pretty_print) identifier_pretty_print (False) False )default_parameter (default_parameter (identifier_user) identifier_user (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_indent) identifier_indent (None) None )assignment )expression_statement (expression_statement (assignment (identifier_separators) identifier_separators (tuple (string_',') string_',' (string_':') string_':' )tuple )assignment )expression_statement (if_statement (identifier_pretty_print) identifier_pretty_print (block (expression_statement (assignment (identifier_indent) identifier_indent (integer_4) integer_4 )assignment )expression_statement (expression_statement (assignment (identifier_separators) identifier_separators (tuple (string_',') string_',' (string_': ') string_': ' )tuple )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_module_doc_dict) identifier_module_doc_dict (call (identifier_generate_doc_dict) identifier_generate_doc_dict (argument_list (identifier_module) identifier_module (identifier_user) identifier_user )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_json_str) identifier_json_str (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (identifier_module_doc_dict) identifier_module_doc_dict (keyword_argument (identifier_indent) identifier_indent (identifier_indent) identifier_indent )keyword_argument (keyword_argument (identifier_separators) identifier_separators (identifier_separators) identifier_separators )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_json_str) identifier_json_str )return_statement )block )function_definition )module
Return a JSON string format of a Pale module's documentation. This string can either be printed out, written to a file, or piped to some other tool. This method is a shorthand for calling `generate_doc_dict` and passing it into a json serializer. The user argument is optional. If included, it expects the user to be an object with an "is_admin" boolean attribute. Any endpoint protected with a "@requires_permission" decorator will require user.is_admin == True to display documentation on that endpoint.
(module (function_definition (function_name_error) function_name_error (parameters (identifier_self) identifier_self (identifier_error) identifier_error )parameters (block (if_statement (boolean_operator (comparison_operator (attribute (identifier_self) identifier_self (identifier_direction) identifier_direction )attribute (list (string_'x') string_'x' (string_'y') string_'y' (string_'z') string_'z' )list )comparison_operator (comparison_operator (identifier_error) identifier_error (None) None )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"error only accepted for x, y, z dimensions") string_"error only accepted for x, y, z dimensions" )argument_list )call )raise_statement )block )if_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_error) identifier_error (attribute (identifier_u) identifier_u (identifier_Quantity) identifier_Quantity )attribute )argument_list )call (block (expression_statement (assignment (identifier_error) identifier_error (attribute (call (attribute (identifier_error) identifier_error (identifier_to) identifier_to )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_unit) identifier_unit )attribute )argument_list )call (identifier_value) identifier_value )attribute )assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__error) identifier__error )attribute (identifier_error) identifier_error )assignment )expression_statement )block )function_definition )module
set the error
(module (function_definition (function_name_prettify) function_name_prettify (parameters (identifier_amount) identifier_amount (default_parameter (identifier_separator) identifier_separator (string_',') string_',' )default_parameter )parameters (block (expression_statement (assignment (identifier_orig) identifier_orig (call (identifier_str) identifier_str (argument_list (identifier_amount) identifier_amount )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_new) identifier_new (call (attribute (identifier_re) identifier_re (identifier_sub) identifier_sub )attribute (argument_list (string_"^(-?\d+)(\d{3})") string_"^(-?\d+)(\d{3})" (call (attribute (string_"\g<1>{0}\g<2>") string_"\g<1>{0}\g<2>" (identifier_format) identifier_format )attribute (argument_list (identifier_separator) identifier_separator )argument_list )call (call (identifier_str) identifier_str (argument_list (identifier_amount) identifier_amount )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_orig) identifier_orig (identifier_new) identifier_new )comparison_operator (block (return_statement (identifier_new) identifier_new )return_statement )block (else_clause (block (return_statement (call (identifier_prettify) identifier_prettify (argument_list (identifier_new) identifier_new )argument_list )call )return_statement )block )else_clause )if_statement )block )function_definition )module
Separate with predefined separator.
(module (function_definition (function_name_expand) function_name_expand (parameters (identifier_self) identifier_self )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier_slurm) identifier_slurm )attribute (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__introspect_slurm_cluster) identifier__introspect_slurm_cluster )attribute (argument_list )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (attribute (attribute (identifier_self) identifier_self (identifier_network) identifier_network )attribute (identifier_nodes) identifier_nodes )attribute (call (attribute (identifier_self) identifier_self (identifier__expand_nodes) identifier__expand_nodes )attribute (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_network) identifier_network )attribute (identifier_nodes) identifier_nodes )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__expand_tags) identifier__expand_tags )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Perform node expansion of network section.
(module (function_definition (function_name_timezone) function_name_timezone (parameters (identifier_self) identifier_self (identifier_value) identifier_value )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__timezone) identifier__timezone )attribute (parenthesized_expression (conditional_expression (identifier_value) identifier_value (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (attribute (identifier_datetime) identifier_datetime (identifier_tzinfo) identifier_tzinfo )attribute )argument_list )call (call (attribute (identifier_tz) identifier_tz (identifier_gettz) identifier_gettz )attribute (argument_list (identifier_value) identifier_value )argument_list )call )conditional_expression )parenthesized_expression )assignment )expression_statement )block )function_definition )module
Set the timezone.
(module (function_definition (function_name_get_device_model) function_name_get_device_model (parameters (identifier_self) identifier_self )parameters (type (identifier_str) identifier_str )type (block (expression_statement (assignment (pattern_list (identifier_output) identifier_output (identifier__) identifier__ )pattern_list (call (attribute (identifier_self) identifier_self (identifier__execute) identifier__execute )attribute (argument_list (string_'-s') string_'-s' (attribute (identifier_self) identifier_self (identifier_device_sn) identifier_device_sn )attribute (string_'shell') string_'shell' (string_'getprop') string_'getprop' (string_'ro.product.model') string_'ro.product.model' )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_output) identifier_output (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Show device model.
(module (function_definition (function_name_validate) function_name_validate (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_has_more_nodes) identifier_has_more_nodes (True) True )assignment )expression_statement (expression_statement (assignment (identifier_visited) identifier_visited (call (identifier_set) identifier_set (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_to_visit) identifier_to_visit (list (identifier_self) identifier_self )list )assignment )expression_statement (expression_statement (assignment (identifier_index) identifier_index (integer_0) integer_0 )assignment )expression_statement (while_statement (identifier_has_more_nodes) identifier_has_more_nodes (block (expression_statement (assignment (identifier_has_more_nodes) identifier_has_more_nodes (False) False )assignment )expression_statement (expression_statement (assignment (identifier_next_nodes) identifier_next_nodes (list )list )assignment )expression_statement (for_statement (identifier_node) identifier_node (identifier_to_visit) identifier_to_visit (block (if_statement (comparison_operator (identifier_node) identifier_node (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_next_nodes) identifier_next_nodes (identifier_extend) identifier_extend )attribute (argument_list (tuple (None) None (None) None )tuple )argument_list )call )expression_statement )block (else_clause (block (if_statement (comparison_operator (identifier_node) identifier_node (identifier_visited) identifier_visited )comparison_operator (block (raise_statement (call (identifier_NodeReferenceError) identifier_NodeReferenceError (argument_list (call (attribute (string_'cyclic node reference at index {}') string_'cyclic node reference at index {}' (identifier_format) identifier_format )attribute (argument_list (identifier_index) identifier_index )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_node) identifier_node (identifier_Node) identifier_Node )argument_list )call )not_operator (block (raise_statement (call (identifier_NodeTypeError) identifier_NodeTypeError (argument_list (call (attribute (string_'invalid node instance at index {}') string_'invalid node instance at index {}' (identifier_format) identifier_format )attribute (argument_list (identifier_index) identifier_index )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_node) identifier_node (identifier_value) identifier_value )attribute (attribute (identifier_numbers) identifier_numbers (identifier_Number) identifier_Number )attribute )argument_list )call )not_operator (block (raise_statement (call (identifier_NodeValueError) identifier_NodeValueError (argument_list (call (attribute (string_'invalid node value at index {}') string_'invalid node value at index {}' (identifier_format) identifier_format )attribute (argument_list (identifier_index) identifier_index )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (boolean_operator (comparison_operator (attribute (identifier_node) identifier_node (identifier_left) identifier_left )attribute (None) None )comparison_operator (comparison_operator (attribute (identifier_node) identifier_node (identifier_right) identifier_right )attribute (None) None )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_has_more_nodes) identifier_has_more_nodes (True) True )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_visited) identifier_visited (identifier_add) identifier_add )attribute (argument_list (identifier_node) identifier_node )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_next_nodes) identifier_next_nodes (identifier_extend) identifier_extend )attribute (argument_list (tuple (attribute (identifier_node) identifier_node (identifier_left) identifier_left )attribute (attribute (identifier_node) identifier_node (identifier_right) identifier_right )attribute )tuple )argument_list )call )expression_statement )block )else_clause )if_statement (expression_statement (augmented_assignment (identifier_index) identifier_index (integer_1) integer_1 )augmented_assignment )expression_statement )block )for_statement (expression_statement (assignment (identifier_to_visit) identifier_to_visit (identifier_next_nodes) identifier_next_nodes )assignment )expression_statement )block )while_statement )block )function_definition )module
Check if the binary tree is malformed. :raise binarytree.exceptions.NodeReferenceError: If there is a cyclic reference to a node in the binary tree. :raise binarytree.exceptions.NodeTypeError: If a node is not an instance of :class:`binarytree.Node`. :raise binarytree.exceptions.NodeValueError: If a node value is not a number (e.g. int, float). **Example**: .. doctest:: >>> from binarytree import Node >>> >>> root = Node(1) >>> root.left = Node(2) >>> root.right = root # Cyclic reference to root >>> >>> root.validate() # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... NodeReferenceError: cyclic node reference at index 0
(module (function_definition (function_name_parse_get_revoc_reg_response) function_name_parse_get_revoc_reg_response (parameters (typed_parameter (identifier_get_revoc_reg_response) identifier_get_revoc_reg_response (type (identifier_str) identifier_str )type )typed_parameter )parameters (type (tuple (identifier_str) identifier_str (identifier_str) identifier_str (identifier_int) identifier_int )tuple )type (block (expression_statement (assignment (identifier_logger) identifier_logger (call (attribute (identifier_logging) identifier_logging (identifier_getLogger) identifier_getLogger )attribute (argument_list (identifier___name__) identifier___name__ )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_"parse_get_revoc_reg_response: >>> get_revoc_reg_response: %r") string_"parse_get_revoc_reg_response: >>> get_revoc_reg_response: %r" (identifier_get_revoc_reg_response) identifier_get_revoc_reg_response )argument_list )call )expression_statement (if_statement (not_operator (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_parse_get_revoc_reg_response) identifier_parse_get_revoc_reg_response (string_"cb") string_"cb" )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_"parse_get_revoc_reg_response: Creating callback") string_"parse_get_revoc_reg_response: Creating callback" )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_parse_get_revoc_reg_response) identifier_parse_get_revoc_reg_response (identifier_cb) identifier_cb )attribute (call (identifier_create_cb) identifier_create_cb (argument_list (call (identifier_CFUNCTYPE) identifier_CFUNCTYPE (argument_list (None) None (identifier_c_int32) identifier_c_int32 (identifier_c_int32) identifier_c_int32 (identifier_c_char_p) identifier_c_char_p (identifier_c_char_p) identifier_c_char_p (identifier_c_uint64) identifier_c_uint64 )argument_list )call )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_c_get_revoc_reg_response) identifier_c_get_revoc_reg_response (call (identifier_c_char_p) identifier_c_char_p (argument_list (call (attribute (identifier_get_revoc_reg_response) identifier_get_revoc_reg_response (identifier_encode) identifier_encode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (tuple_pattern (identifier_revoc_reg_def_id) identifier_revoc_reg_def_id (identifier_revoc_reg_json) identifier_revoc_reg_json (identifier_timestamp) identifier_timestamp )tuple_pattern (await (call (identifier_do_call) identifier_do_call (argument_list (string_'indy_parse_get_revoc_reg_response') string_'indy_parse_get_revoc_reg_response' (identifier_c_get_revoc_reg_response) identifier_c_get_revoc_reg_response (attribute (identifier_parse_get_revoc_reg_response) identifier_parse_get_revoc_reg_response (identifier_cb) identifier_cb )attribute )argument_list )call )await )assignment )expression_statement (expression_statement (assignment (identifier_res) identifier_res (tuple (call (attribute (identifier_revoc_reg_def_id) identifier_revoc_reg_def_id (identifier_decode) identifier_decode )attribute (argument_list )argument_list )call (call (attribute (identifier_revoc_reg_json) identifier_revoc_reg_json (identifier_decode) identifier_decode )attribute (argument_list )argument_list )call (identifier_timestamp) identifier_timestamp )tuple )assignment )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_"parse_get_revoc_reg_response: <<< res: %r") string_"parse_get_revoc_reg_response: <<< res: %r" (identifier_res) identifier_res )argument_list )call )expression_statement (return_statement (identifier_res) identifier_res )return_statement )block )function_definition )module
Parse a GET_REVOC_REG response to get Revocation Registry in the format compatible with Anoncreds API. :param get_revoc_reg_response: response of GET_REVOC_REG request. :return: Revocation Registry Definition Id, Revocation Registry json and Timestamp. { "value": Registry-specific data { "accum": string - current accumulator value. }, "ver": string - version revocation registry json }
(module (function_definition (function_name__write) function_name__write (parameters (identifier_self) identifier_self (identifier_session) identifier_session (identifier_openFile) identifier_openFile (identifier_replaceParamFile) identifier_replaceParamFile )parameters (block (expression_statement (call (attribute (identifier_openFile) identifier_openFile (identifier_write) identifier_write )attribute (argument_list (string_'GRIDPIPEFILE\n') string_'GRIDPIPEFILE\n' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_openFile) identifier_openFile (identifier_write) identifier_write )attribute (argument_list (binary_operator (string_'PIPECELLS %s\n') string_'PIPECELLS %s\n' (attribute (identifier_self) identifier_self (identifier_pipeCells) identifier_pipeCells )attribute )binary_operator )argument_list )call )expression_statement (for_statement (identifier_cell) identifier_cell (attribute (identifier_self) identifier_self (identifier_gridPipeCells) identifier_gridPipeCells )attribute (block (expression_statement (call (attribute (identifier_openFile) identifier_openFile (identifier_write) identifier_write )attribute (argument_list (binary_operator (string_'CELLIJ %s %s\n') string_'CELLIJ %s %s\n' (tuple (attribute (identifier_cell) identifier_cell (identifier_cellI) identifier_cellI )attribute (attribute (identifier_cell) identifier_cell (identifier_cellJ) identifier_cellJ )attribute )tuple )binary_operator )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_openFile) identifier_openFile (identifier_write) identifier_write )attribute (argument_list (binary_operator (string_'NUMPIPES %s\n') string_'NUMPIPES %s\n' (attribute (identifier_cell) identifier_cell (identifier_numPipes) identifier_numPipes )attribute )binary_operator )argument_list )call )expression_statement (for_statement (identifier_node) identifier_node (attribute (identifier_cell) identifier_cell (identifier_gridPipeNodes) identifier_gridPipeNodes )attribute (block (expression_statement (call (attribute (identifier_openFile) identifier_openFile (identifier_write) identifier_write )attribute (argument_list (binary_operator (string_'SPIPE %s %s %.6f\n') string_'SPIPE %s %s %.6f\n' (tuple (attribute (identifier_node) identifier_node (identifier_linkNumber) identifier_linkNumber )attribute (attribute (identifier_node) identifier_node (identifier_nodeNumber) identifier_nodeNumber )attribute (attribute (identifier_node) identifier_node (identifier_fractPipeLength) identifier_fractPipeLength )attribute )tuple )binary_operator )argument_list )call )expression_statement )block )for_statement )block )for_statement )block )function_definition )module
Grid Pipe File Write to File Method
(module (function_definition (function_name_swap_yaml_string) function_name_swap_yaml_string (parameters (identifier_file_path) identifier_file_path (identifier_swaps) identifier_swaps )parameters (block (expression_statement (assignment (identifier_original_file) identifier_original_file (call (identifier_file_to_string) identifier_file_to_string (argument_list (identifier_file_path) identifier_file_path )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_new_file) identifier_new_file (identifier_original_file) identifier_original_file )assignment )expression_statement (expression_statement (assignment (identifier_changed) identifier_changed (False) False )assignment )expression_statement (for_statement (identifier_item) identifier_item (identifier_swaps) identifier_swaps (block (expression_statement (assignment (identifier_match) identifier_match (call (attribute (identifier_re) identifier_re (identifier_compile) identifier_compile )attribute (argument_list (call (attribute (string_r'(?<={0}: )(["\']?)(.*)\1') string_r'(?<={0}: )(["\']?)(.*)\1' (identifier_format) identifier_format )attribute (argument_list (subscript (identifier_item) identifier_item (integer_0) integer_0 )subscript )argument_list )call (attribute (identifier_re) identifier_re (identifier_MULTILINE) identifier_MULTILINE )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_new_file) identifier_new_file (call (attribute (identifier_re) identifier_re (identifier_sub) identifier_sub )attribute (argument_list (identifier_match) identifier_match (subscript (identifier_item) identifier_item (integer_1) integer_1 )subscript (identifier_new_file) identifier_new_file )argument_list )call )assignment )expression_statement )block )for_statement (if_statement (comparison_operator (identifier_new_file) identifier_new_file (identifier_original_file) identifier_original_file )comparison_operator (block (expression_statement (assignment (identifier_changed) identifier_changed (True) True )assignment )expression_statement )block )if_statement (expression_statement (call (identifier_string_to_file) identifier_string_to_file (argument_list (identifier_file_path) identifier_file_path (identifier_new_file) identifier_new_file )argument_list )call )expression_statement (return_statement (tuple (identifier_new_file) identifier_new_file (identifier_changed) identifier_changed )tuple )return_statement )block )function_definition )module
Swap a string in a yaml file without touching the existing formatting.
(module (function_definition (function_name_CompressStream) function_name_CompressStream (parameters (identifier_in_stream) identifier_in_stream (default_parameter (identifier_length) identifier_length (None) None )default_parameter (default_parameter (identifier_compresslevel) identifier_compresslevel (integer_2) integer_2 )default_parameter (default_parameter (identifier_chunksize) identifier_chunksize (integer_16777216) integer_16777216 )default_parameter )parameters (block (expression_statement (assignment (identifier_in_read) identifier_in_read (integer_0) integer_0 )assignment )expression_statement (expression_statement (assignment (identifier_in_exhausted) identifier_in_exhausted (False) False )assignment )expression_statement (expression_statement (assignment (identifier_out_stream) identifier_out_stream (call (identifier_StreamingBuffer) identifier_StreamingBuffer (argument_list )argument_list )call )assignment )expression_statement (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_gzip) identifier_gzip (identifier_GzipFile) identifier_GzipFile )attribute (argument_list (keyword_argument (identifier_mode) identifier_mode (string_'wb') string_'wb' )keyword_argument (keyword_argument (identifier_fileobj) identifier_fileobj (identifier_out_stream) identifier_out_stream )keyword_argument (keyword_argument (identifier_compresslevel) identifier_compresslevel (identifier_compresslevel) identifier_compresslevel )keyword_argument )argument_list )call (as_pattern_target (identifier_compress_stream) identifier_compress_stream )as_pattern_target )as_pattern )with_item )with_clause (block (while_statement (boolean_operator (not_operator (identifier_length) identifier_length )not_operator (comparison_operator (attribute (identifier_out_stream) identifier_out_stream (identifier_length) identifier_length )attribute (identifier_length) identifier_length )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_in_stream) identifier_in_stream (identifier_read) identifier_read )attribute (argument_list (identifier_chunksize) identifier_chunksize )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_data_length) identifier_data_length (call (identifier_len) identifier_len (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_compress_stream) identifier_compress_stream (identifier_write) identifier_write )attribute (argument_list (identifier_data) identifier_data )argument_list )call )expression_statement (expression_statement (augmented_assignment (identifier_in_read) identifier_in_read (identifier_data_length) identifier_data_length )augmented_assignment )expression_statement (if_statement (comparison_operator (identifier_data_length) identifier_data_length (identifier_chunksize) identifier_chunksize )comparison_operator (block (expression_statement (assignment (identifier_in_exhausted) identifier_in_exhausted (True) True )assignment )expression_statement (break_statement )break_statement )block )if_statement )block )while_statement )block )with_statement (return_statement (expression_list (identifier_out_stream) identifier_out_stream (identifier_in_read) identifier_in_read (identifier_in_exhausted) identifier_in_exhausted )expression_list )return_statement )block )function_definition )module
Compresses an input stream into a file-like buffer. This reads from the input stream until either we've stored at least length compressed bytes, or the input stream has been exhausted. This supports streams of unknown size. Args: in_stream: The input stream to read from. length: The target number of compressed bytes to buffer in the output stream. If length is none, the input stream will be compressed until it's exhausted. The actual length of the output buffer can vary from the target. If the input stream is exhaused, the output buffer may be smaller than expected. If the data is incompressible, the maximum length can be exceeded by can be calculated to be: chunksize + 5 * (floor((chunksize - 1) / 16383) + 1) + 17 This accounts for additional header data gzip adds. For the default 16MiB chunksize, this results in the max size of the output buffer being: length + 16Mib + 5142 bytes compresslevel: Optional, defaults to 2. The desired compression level. chunksize: Optional, defaults to 16MiB. The chunk size used when reading data from the input stream to write into the output buffer. Returns: A file-like output buffer of compressed bytes, the number of bytes read from the input stream, and a flag denoting if the input stream was exhausted.
(module (function_definition (function_name__range) function_name__range (parameters (identifier_self) identifier_self (identifier_xloc) identifier_xloc (identifier_cache) identifier_cache )parameters (block (expression_statement (assignment (identifier_uloc) identifier_uloc (call (attribute (identifier_numpy) identifier_numpy (identifier_zeros) identifier_zeros )attribute (argument_list (tuple (integer_2) integer_2 (call (identifier_len) identifier_len (argument_list (identifier_self) identifier_self )argument_list )call )tuple )argument_list )call )assignment )expression_statement (for_statement (identifier_dist) identifier_dist (call (attribute (identifier_evaluation) identifier_evaluation (identifier_sorted_dependencies) identifier_sorted_dependencies )attribute (argument_list (identifier_self) identifier_self (keyword_argument (identifier_reverse) identifier_reverse (True) True )keyword_argument )argument_list )call (block (if_statement (comparison_operator (identifier_dist) identifier_dist (attribute (identifier_self) identifier_self (identifier_inverse_map) identifier_inverse_map )attribute )comparison_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (identifier_idx) identifier_idx (subscript (attribute (identifier_self) identifier_self (identifier_inverse_map) identifier_inverse_map )attribute (identifier_dist) identifier_dist )subscript )assignment )expression_statement (expression_statement (assignment (identifier_xloc_) identifier_xloc_ (call (attribute (subscript (identifier_xloc) identifier_xloc (identifier_idx) identifier_idx )subscript (identifier_reshape) identifier_reshape )attribute (argument_list (integer_1) integer_1 (unary_operator (integer_1) integer_1 )unary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_uloc) identifier_uloc (slice (colon) colon )slice (identifier_idx) identifier_idx )subscript (call (attribute (call (attribute (identifier_evaluation) identifier_evaluation (identifier_evaluate_bound) identifier_evaluate_bound )attribute (argument_list (identifier_dist) identifier_dist (identifier_xloc_) identifier_xloc_ (keyword_argument (identifier_cache) identifier_cache (identifier_cache) identifier_cache )keyword_argument )argument_list )call (identifier_flatten) identifier_flatten )attribute (argument_list )argument_list )call )assignment )expression_statement )block )for_statement (return_statement (identifier_uloc) identifier_uloc )return_statement )block )function_definition )module
Special handle for finding bounds on constrained dists. Example: >>> d0 = chaospy.Uniform() >>> dist = chaospy.J(d0, d0+chaospy.Uniform()) >>> print(dist.range()) [[0. 0.] [1. 2.]]
(module (function_definition (function_name_burst_range_spectrum) function_name_burst_range_spectrum (parameters (identifier_psd) identifier_psd (default_parameter (identifier_snr) identifier_snr (integer_8) integer_8 )default_parameter (default_parameter (identifier_energy) identifier_energy (float_1e-2) float_1e-2 )default_parameter )parameters (block (expression_statement (assignment (identifier_a) identifier_a (binary_operator (parenthesized_expression (binary_operator (binary_operator (binary_operator (binary_operator (attribute (identifier_constants) identifier_constants (identifier_G) identifier_G )attribute (identifier_energy) identifier_energy )binary_operator (attribute (identifier_constants) identifier_constants (identifier_M_sun) identifier_M_sun )attribute )binary_operator (float_0.4) float_0.4 )binary_operator (parenthesized_expression (binary_operator (binary_operator (identifier_pi) identifier_pi (integer_2) integer_2 )binary_operator (attribute (identifier_constants) identifier_constants (identifier_c) identifier_c )attribute )binary_operator )parenthesized_expression )binary_operator )parenthesized_expression (parenthesized_expression (binary_operator (integer_1) integer_1 (float_2.) float_2. )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_dspec) identifier_dspec (binary_operator (binary_operator (binary_operator (identifier_psd) identifier_psd (parenthesized_expression (binary_operator (unary_operator (integer_1) integer_1 )unary_operator (float_2.) float_2. )binary_operator )parenthesized_expression )binary_operator (identifier_a) identifier_a )binary_operator (parenthesized_expression (binary_operator (identifier_snr) identifier_snr (attribute (identifier_psd) identifier_psd (identifier_frequencies) identifier_frequencies )attribute )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_rspec) identifier_rspec (call (attribute (identifier_dspec) identifier_dspec (identifier_to) identifier_to )attribute (argument_list (string_'Mpc') string_'Mpc' )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (attribute (identifier_rspec) identifier_rspec (identifier_f0) identifier_f0 )attribute (identifier_value) identifier_value )attribute (float_0.0) float_0.0 )comparison_operator (block (expression_statement (assignment (subscript (identifier_rspec) identifier_rspec (integer_0) integer_0 )subscript (float_0.0) float_0.0 )assignment )expression_statement )block )if_statement (return_statement (identifier_rspec) identifier_rspec )return_statement )block )function_definition )module
Calculate the frequency-dependent GW burst range from a strain PSD Parameters ---------- psd : `~gwpy.frequencyseries.FrequencySeries` the instrumental power-spectral-density data snr : `float`, optional the signal-to-noise ratio for which to calculate range, default: `8` energy : `float`, optional the relative energy output of the GW burst, default: `0.01` (GRB-like burst) Returns ------- rangespec : `~gwpy.frequencyseries.FrequencySeries` the burst range `FrequencySeries` [Mpc (default)]
(module (function_definition (function_name_thumb) function_name_thumb (parameters (identifier_self) identifier_self (default_parameter (identifier_size) identifier_size (identifier_BIGTHUMB) identifier_BIGTHUMB )default_parameter )parameters (block (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier_is_image) identifier_is_image )attribute (argument_list )argument_list )call )not_operator (block (return_statement (None) None )return_statement )block )if_statement (if_statement (not_operator (comparison_operator (identifier_size) identifier_size (tuple (attribute (identifier_self) identifier_self (identifier_BIGTHUMB) identifier_BIGTHUMB )attribute (attribute (identifier_self) identifier_self (identifier_MEDIUMTHUMB) identifier_MEDIUMTHUMB )attribute (attribute (identifier_self) identifier_self (identifier_SMALLTHUMB) identifier_SMALLTHUMB )attribute (attribute (identifier_self) identifier_self (identifier_XLTHUMB) identifier_XLTHUMB )attribute )tuple )comparison_operator )not_operator (block (raise_statement (call (identifier_JFSError) identifier_JFSError (argument_list (binary_operator (string_'Invalid thumbnail size: %s for image %s') string_'Invalid thumbnail size: %s for image %s' (tuple (identifier_size) identifier_size (attribute (identifier_self) identifier_self (identifier_path) identifier_path )attribute )tuple )binary_operator )argument_list )call )raise_statement )block )if_statement (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_jfs) identifier_jfs )attribute (identifier_raw) identifier_raw )attribute (argument_list (keyword_argument (identifier_url) identifier_url (attribute (identifier_self) identifier_self (identifier_path) identifier_path )attribute )keyword_argument (keyword_argument (identifier_params) identifier_params (dictionary (pair (string_'mode') string_'mode' (string_'thumb') string_'thumb' )pair (pair (string_'ts') string_'ts' (identifier_size) identifier_size )pair )dictionary )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Get a thumbnail as string or None if the file isnt an image size would be one of JFSFile.BIGTHUMB, .MEDIUMTHUMB, .SMALLTHUMB or .XLTHUMB
(module (function_definition (function_name_getpeptides) function_name_getpeptides (parameters (identifier_self) identifier_self (identifier_chain) identifier_chain )parameters (block (expression_statement (assignment (identifier_all_from_chain) identifier_all_from_chain (list_comprehension (identifier_o) identifier_o (for_in_clause (identifier_o) identifier_o (call (attribute (attribute (identifier_pybel) identifier_pybel (identifier_ob) identifier_ob )attribute (identifier_OBResidueIter) identifier_OBResidueIter )attribute (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_proteincomplex) identifier_proteincomplex )attribute (identifier_OBMol) identifier_OBMol )attribute )argument_list )call )for_in_clause (if_clause (comparison_operator (call (attribute (identifier_o) identifier_o (identifier_GetChain) identifier_GetChain )attribute (argument_list )argument_list )call (identifier_chain) identifier_chain )comparison_operator )if_clause )list_comprehension )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_all_from_chain) identifier_all_from_chain )argument_list )call (integer_0) integer_0 )comparison_operator (block (return_statement (None) None )return_statement )block (else_clause (block (expression_statement (assignment (identifier_non_water) identifier_non_water (list_comprehension (identifier_o) identifier_o (for_in_clause (identifier_o) identifier_o (identifier_all_from_chain) identifier_all_from_chain )for_in_clause (if_clause (not_operator (call (attribute (identifier_o) identifier_o (identifier_GetResidueProperty) identifier_GetResidueProperty )attribute (argument_list (integer_9) integer_9 )argument_list )call )not_operator )if_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_ligand) identifier_ligand (call (attribute (identifier_self) identifier_self (identifier_extract_ligand) identifier_extract_ligand )attribute (argument_list (identifier_non_water) identifier_non_water )argument_list )call )assignment )expression_statement (return_statement (identifier_ligand) identifier_ligand )return_statement )block )else_clause )if_statement )block )function_definition )module
If peptide ligand chains are defined via the command line options, try to extract the underlying ligand formed by all residues in the given chain without water
(module (function_definition (function_name_select) function_name_select (parameters (identifier_self) identifier_self (identifier_names) identifier_names )parameters (block (return_statement (call (identifier_PolicyCollection) identifier_PolicyCollection (argument_list (list_comprehension (identifier_p) identifier_p (for_in_clause (identifier_p) identifier_p (attribute (identifier_self) identifier_self (identifier_policies) identifier_policies )attribute )for_in_clause (if_clause (comparison_operator (attribute (identifier_p) identifier_p (identifier_name) identifier_name )attribute (identifier_names) identifier_names )comparison_operator )if_clause )list_comprehension (attribute (identifier_self) identifier_self (identifier_options) identifier_options )attribute )argument_list )call )return_statement )block )function_definition )module
return the named subset of policies
(module (function_definition (function_name_getMonitorByName) function_name_getMonitorByName (parameters (identifier_self) identifier_self (identifier_monitorFriendlyName) identifier_monitorFriendlyName )parameters (block (expression_statement (assignment (identifier_url) identifier_url (attribute (identifier_self) identifier_self (identifier_baseUrl) identifier_baseUrl )attribute )assignment )expression_statement (expression_statement (augmented_assignment (identifier_url) identifier_url (binary_operator (string_"getMonitors?apiKey=%s") string_"getMonitors?apiKey=%s" (attribute (identifier_self) identifier_self (identifier_apiKey) identifier_apiKey )attribute )binary_operator )augmented_assignment )expression_statement (expression_statement (augmented_assignment (identifier_url) identifier_url (string_"&noJsonCallback=1&format=json") string_"&noJsonCallback=1&format=json" )augmented_assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_success) identifier_success (identifier_response) identifier_response )pattern_list (call (attribute (identifier_self) identifier_self (identifier_requestApi) identifier_requestApi )attribute (argument_list (identifier_url) identifier_url )argument_list )call )assignment )expression_statement (if_statement (identifier_success) identifier_success (block (expression_statement (assignment (identifier_monitors) identifier_monitors (call (attribute (call (attribute (identifier_response) identifier_response (identifier_get) identifier_get )attribute (argument_list (string_'monitors') string_'monitors' )argument_list )call (identifier_get) identifier_get )attribute (argument_list (string_'monitor') string_'monitor' )argument_list )call )assignment )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (call (identifier_len) identifier_len (argument_list (identifier_monitors) identifier_monitors )argument_list )call )argument_list )call (block (expression_statement (assignment (identifier_monitor) identifier_monitor (subscript (identifier_monitors) identifier_monitors (identifier_i) identifier_i )subscript )assignment )expression_statement (if_statement (comparison_operator (call (attribute (identifier_monitor) identifier_monitor (identifier_get) identifier_get )attribute (argument_list (string_'friendlyname') string_'friendlyname' )argument_list )call (identifier_monitorFriendlyName) identifier_monitorFriendlyName )comparison_operator (block (expression_statement (assignment (identifier_status) identifier_status (call (attribute (identifier_monitor) identifier_monitor (identifier_get) identifier_get )attribute (argument_list (string_'status') string_'status' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_alltimeuptimeratio) identifier_alltimeuptimeratio (call (attribute (identifier_monitor) identifier_monitor (identifier_get) identifier_get )attribute (argument_list (string_'alltimeuptimeratio') string_'alltimeuptimeratio' )argument_list )call )assignment )expression_statement (return_statement (expression_list (identifier_status) identifier_status (identifier_alltimeuptimeratio) identifier_alltimeuptimeratio )expression_list )return_statement )block )if_statement )block )for_statement )block )if_statement (return_statement (expression_list (None) None (None) None )expression_list )return_statement )block )function_definition )module
Returns monitor status and alltimeuptimeratio for a MonitorFriendlyName.
(module (function_definition (function_name_add) function_name_add (parameters (identifier_self) identifier_self (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (for_statement (identifier_arg) identifier_arg (identifier_args) identifier_args (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_arg) identifier_arg (identifier_str) identifier_str )argument_list )call (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__operations) identifier__operations )attribute (identifier_append) identifier_append )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__from_str) identifier__from_str )attribute (argument_list (identifier_arg) identifier_arg )argument_list )call )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__operations) identifier__operations )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_arg) identifier_arg )argument_list )call )expression_statement )block )else_clause )if_statement )block )for_statement (if_statement (identifier_kwargs) identifier_kwargs (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__operations) identifier__operations )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_kwargs) identifier_kwargs )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Add new mapping from args and kwargs >>> om = OperationIdMapping() >>> om.add( ... OperationIdMapping(), ... 'aiohttp_apiset.swagger.operations', # any module ... getPets='mymod.handler', ... getPet='mymod.get_pet', ... ) >>> om['getPets'] 'mymod.handler' :param args: str, Mapping, module or obj :param kwargs: operationId='handler' or operationId=handler
(module (function_definition (function_name_add_string) function_name_add_string (parameters (identifier_self) identifier_self (identifier_s) identifier_s )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_add_int) identifier_add_int )attribute (argument_list (call (identifier_len) identifier_len (argument_list (identifier_s) identifier_s )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_packet) identifier_packet )attribute (identifier_write) identifier_write )attribute (argument_list (identifier_s) identifier_s )argument_list )call )expression_statement (return_statement (identifier_self) identifier_self )return_statement )block )function_definition )module
Add a string to the stream. @param s: string to add @type s: str
(module (function_definition (function_name_result) function_name_result (parameters (identifier_self) identifier_self (typed_default_parameter (identifier_timeout) identifier_timeout (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_float) identifier_float )type )type_parameter )generic_type )type (None) None )typed_default_parameter (keyword_separator )keyword_separator (typed_default_parameter (identifier_pole_delay) identifier_pole_delay (type (identifier_float) identifier_float )type (float_0.5) float_0.5 )typed_default_parameter )parameters (type (identifier_Any) identifier_Any )type (block (for_statement (identifier_delay) identifier_delay (call (identifier_poll) identifier_poll (argument_list (identifier_pole_delay) identifier_pole_delay )argument_list )call (block (expression_statement (assignment (identifier_info) identifier_info (await (call (attribute (identifier_self) identifier_self (identifier_result_info) identifier_result_info )attribute (argument_list )argument_list )call )await )assignment )expression_statement (if_statement (identifier_info) identifier_info (block (expression_statement (assignment (identifier_result) identifier_result (attribute (identifier_info) identifier_info (identifier_result) identifier_result )attribute )assignment )expression_statement (if_statement (attribute (identifier_info) identifier_info (identifier_success) identifier_success )attribute (block (return_statement (identifier_result) identifier_result )return_statement )block (else_clause (block (raise_statement (identifier_result) identifier_result )raise_statement )block )else_clause )if_statement )block )if_statement (if_statement (boolean_operator (comparison_operator (identifier_timeout) identifier_timeout (None) None )comparison_operator (comparison_operator (identifier_delay) identifier_delay (identifier_timeout) identifier_timeout )comparison_operator )boolean_operator (block (raise_statement (call (attribute (identifier_asyncio) identifier_asyncio (identifier_TimeoutError) identifier_TimeoutError )attribute (argument_list )argument_list )call )raise_statement )block )if_statement )block )for_statement )block )function_definition )module
Get the result of the job, including waiting if it's not yet available. If the job raised an exception, it will be raised here. :param timeout: maximum time to wait for the job result before raising ``TimeoutError``, will wait forever :param pole_delay: how often to poll redis for the job result
(module (function_definition (function_name_disaggregate_wind) function_name_disaggregate_wind (parameters (identifier_self) identifier_self (default_parameter (identifier_method) identifier_method (string_'equal') string_'equal' )default_parameter )parameters (block (expression_statement (assignment (attribute (attribute (identifier_self) identifier_self (identifier_data_disagg) identifier_data_disagg )attribute (identifier_wind) identifier_wind )attribute (call (attribute (identifier_melodist) identifier_melodist (identifier_disaggregate_wind) identifier_disaggregate_wind )attribute (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_data_daily) identifier_data_daily )attribute (identifier_wind) identifier_wind )attribute (keyword_argument (identifier_method) identifier_method (identifier_method) identifier_method )keyword_argument (dictionary_splat (attribute (attribute (identifier_self) identifier_self (identifier_statistics) identifier_statistics )attribute (identifier_wind) identifier_wind )attribute )dictionary_splat )argument_list )call )assignment )expression_statement )block )function_definition )module
Disaggregate wind speed. Parameters ---------- method : str, optional Disaggregation method. ``equal`` Mean daily wind speed is duplicated for the 24 hours of the day. (Default) ``cosine`` Distributes daily mean wind speed using a cosine function derived from hourly observations. ``random`` Draws random numbers to distribute wind speed (usually not conserving the daily average).
(module (function_definition (function_name_normalizeIdentifier) function_name_normalizeIdentifier (parameters (identifier_value) identifier_value )parameters (block (if_statement (comparison_operator (identifier_value) identifier_value (None) None )comparison_operator (block (return_statement (identifier_value) identifier_value )return_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (identifier_basestring) identifier_basestring )argument_list )call )not_operator (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (binary_operator (string_"Identifiers must be strings, not %s.") string_"Identifiers must be strings, not %s." (attribute (call (identifier_type) identifier_type (argument_list (identifier_value) identifier_value )argument_list )call (identifier___name__) identifier___name__ )attribute )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_value) identifier_value )argument_list )call (integer_0) integer_0 )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"The identifier string is empty.") string_"The identifier string is empty." )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_value) identifier_value )argument_list )call (integer_100) integer_100 )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (concatenated_string (string_"The identifier string has a length (%d) greater ") string_"The identifier string has a length (%d) greater " (string_"than the maximum allowed (100).") string_"than the maximum allowed (100)." )concatenated_string (call (identifier_len) identifier_len (argument_list (identifier_value) identifier_value )argument_list )call )binary_operator )argument_list )call )raise_statement )block )if_statement (for_statement (identifier_c) identifier_c (identifier_value) identifier_value (block (expression_statement (assignment (identifier_v) identifier_v (call (identifier_ord) identifier_ord (argument_list (identifier_c) identifier_c )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_v) identifier_v (integer_0x20) integer_0x20 )comparison_operator (comparison_operator (identifier_v) identifier_v (integer_0x7E) integer_0x7E )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (concatenated_string (string_"The identifier string ('%s') contains a ") string_"The identifier string ('%s') contains a " (string_"character out size of the range 0x20 - 0x7E.") string_"character out size of the range 0x20 - 0x7E." )concatenated_string (identifier_value) identifier_value )binary_operator )argument_list )call )raise_statement )block )if_statement )block )for_statement (return_statement (call (identifier_unicode) identifier_unicode (argument_list (identifier_value) identifier_value )argument_list )call )return_statement )block )function_definition )module
Normalizes identifier. * **value** must be an :ref:`type-string` or `None`. * **value** must not be longer than 100 characters. * **value** must not contain a character out the range of 0x20 - 0x7E. * Returned value is an unencoded ``unicode`` string.
(module (function_definition (function_name_register) function_name_register (parameters (identifier_self) identifier_self (identifier_cls) identifier_cls )parameters (block (expression_statement (assignment (identifier_doc_type) identifier_doc_type (attribute (attribute (attribute (identifier_cls) identifier_cls (identifier_search_objects) identifier_search_objects )attribute (identifier_mapping) identifier_mapping )attribute (identifier_doc_type) identifier_doc_type )attribute )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier_all_models) identifier_all_models )attribute (identifier_doc_type) identifier_doc_type )subscript (identifier_cls) identifier_cls )assignment )expression_statement (expression_statement (assignment (identifier_base_class) identifier_base_class (call (attribute (identifier_cls) identifier_cls (identifier_get_base_class) identifier_get_base_class )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_base_class) identifier_base_class (attribute (identifier_self) identifier_self (identifier_families) identifier_families )attribute )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier_families) identifier_families )attribute (identifier_base_class) identifier_base_class )subscript (dictionary )dictionary )assignment )expression_statement )block )if_statement (expression_statement (assignment (subscript (subscript (attribute (identifier_self) identifier_self (identifier_families) identifier_families )attribute (identifier_base_class) identifier_base_class )subscript (identifier_doc_type) identifier_doc_type )subscript (identifier_cls) identifier_cls )assignment )expression_statement (if_statement (comparison_operator (attribute (attribute (attribute (identifier_cls) identifier_cls (identifier_search_objects) identifier_search_objects )attribute (identifier_mapping) identifier_mapping )attribute (identifier_index) identifier_index )attribute (attribute (identifier_self) identifier_self (identifier_indexes) identifier_indexes )attribute )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier_indexes) identifier_indexes )attribute (attribute (attribute (attribute (identifier_cls) identifier_cls (identifier_search_objects) identifier_search_objects )attribute (identifier_mapping) identifier_mapping )attribute (identifier_index) identifier_index )attribute )subscript (list )list )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_indexes) identifier_indexes )attribute (attribute (attribute (attribute (identifier_cls) identifier_cls (identifier_search_objects) identifier_search_objects )attribute (identifier_mapping) identifier_mapping )attribute (identifier_index) identifier_index )attribute )subscript (identifier_append) identifier_append )attribute (argument_list (identifier_cls) identifier_cls )argument_list )call )expression_statement )block )function_definition )module
Adds a new PolymorphicIndexable to the registry.
(module (function_definition (function_name_taf) function_name_taf (parameters (typed_parameter (identifier_data) identifier_data (type (identifier_TafData) identifier_TafData )type )typed_parameter (typed_parameter (identifier_units) identifier_units (type (identifier_Units) identifier_Units )type )typed_parameter )parameters (type (identifier_str) identifier_str )type (block (try_statement (block (expression_statement (assignment (identifier_month) identifier_month (call (attribute (attribute (attribute (identifier_data) identifier_data (identifier_start_time) identifier_start_time )attribute (identifier_dt) identifier_dt )attribute (identifier_strftime) identifier_strftime )attribute (argument_list (string_r'%B') string_r'%B' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_day) identifier_day (call (identifier_ordinal) identifier_ordinal (argument_list (attribute (attribute (attribute (identifier_data) identifier_data (identifier_start_time) identifier_start_time )attribute (identifier_dt) identifier_dt )attribute (identifier_day) identifier_day )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_ret) identifier_ret (string_f"Starting on {month} {day} - ") string_f"Starting on {month} {day} - " )assignment )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (expression_statement (assignment (identifier_ret) identifier_ret (string_'') string_'' )assignment )expression_statement )block )except_clause )try_statement (return_statement (binary_operator (identifier_ret) identifier_ret (call (attribute (string_'. ') string_'. ' (identifier_join) identifier_join )attribute (argument_list (list_comprehension (call (identifier_taf_line) identifier_taf_line (argument_list (identifier_line) identifier_line (identifier_units) identifier_units )argument_list )call (for_in_clause (identifier_line) identifier_line (attribute (identifier_data) identifier_data (identifier_forecast) identifier_forecast )attribute )for_in_clause )list_comprehension )argument_list )call )binary_operator )return_statement )block )function_definition )module
Convert TafData into a string for text-to-speech
(module (function_definition (function_name_remove) function_name_remove (parameters (identifier_text) identifier_text (identifier_what) identifier_what (default_parameter (identifier_count) identifier_count (None) None )default_parameter (default_parameter (identifier_strip) identifier_strip (False) False )default_parameter )parameters (block (return_statement (call (identifier_replace) identifier_replace (argument_list (identifier_text) identifier_text (identifier_what) identifier_what (string_'') string_'' (keyword_argument (identifier_count) identifier_count (identifier_count) identifier_count )keyword_argument (keyword_argument (identifier_strip) identifier_strip (identifier_strip) identifier_strip )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Like ``replace``, where ``new`` replacement is an empty string.
(module (function_definition (function_name_param_set) function_name_param_set (parameters (identifier_name) identifier_name (identifier_value) identifier_value (default_parameter (identifier_retries) identifier_retries (integer_3) integer_3 )default_parameter )parameters (block (expression_statement (assignment (identifier_name) identifier_name (call (attribute (identifier_name) identifier_name (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call )assignment )expression_statement (return_statement (call (attribute (attribute (identifier_mpstate) identifier_mpstate (identifier_mav_param) identifier_mav_param )attribute (identifier_mavset) identifier_mavset )attribute (argument_list (call (attribute (identifier_mpstate) identifier_mpstate (identifier_master) identifier_master )attribute (argument_list )argument_list )call (identifier_name) identifier_name (identifier_value) identifier_value (keyword_argument (identifier_retries) identifier_retries (identifier_retries) identifier_retries )keyword_argument )argument_list )call )return_statement )block )function_definition )module
set a parameter
(module (function_definition (function_name__dns_lookup) function_name__dns_lookup (parameters (identifier_name) identifier_name (identifier_rdtype) identifier_rdtype (default_parameter (identifier_nameservers) identifier_nameservers (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_rrset) identifier_rrset (call (attribute (attribute (identifier_dns) identifier_dns (identifier_rrset) identifier_rrset )attribute (identifier_from_text) identifier_from_text )attribute (argument_list (identifier_name) identifier_name (integer_0) integer_0 (integer_1) integer_1 (identifier_rdtype) identifier_rdtype )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_resolver) identifier_resolver (call (attribute (attribute (identifier_dns) identifier_dns (identifier_resolver) identifier_resolver )attribute (identifier_Resolver) identifier_Resolver )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_resolver) identifier_resolver (identifier_lifetime) identifier_lifetime )attribute (integer_1) integer_1 )assignment )expression_statement (if_statement (identifier_nameservers) identifier_nameservers (block (expression_statement (assignment (attribute (identifier_resolver) identifier_resolver (identifier_nameservers) identifier_nameservers )attribute (identifier_nameservers) identifier_nameservers )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_rrset) identifier_rrset (call (attribute (identifier_resolver) identifier_resolver (identifier_query) identifier_query )attribute (argument_list (identifier_name) identifier_name (identifier_rdtype) identifier_rdtype )argument_list )call )assignment )expression_statement (for_statement (identifier_rdata) identifier_rdata (identifier_rrset) identifier_rrset (block (expression_statement (call (attribute (identifier_LOGGER) identifier_LOGGER (identifier_debug) identifier_debug )attribute (argument_list (string_'DNS Lookup => %s %s %s %s') string_'DNS Lookup => %s %s %s %s' (call (attribute (attribute (identifier_rrset) identifier_rrset (identifier_name) identifier_name )attribute (identifier_to_text) identifier_to_text )attribute (argument_list )argument_list )call (call (attribute (attribute (identifier_dns) identifier_dns (identifier_rdataclass) identifier_rdataclass )attribute (identifier_to_text) identifier_to_text )attribute (argument_list (attribute (identifier_rrset) identifier_rrset (identifier_rdclass) identifier_rdclass )attribute )argument_list )call (call (attribute (attribute (identifier_dns) identifier_dns (identifier_rdatatype) identifier_rdatatype )attribute (identifier_to_text) identifier_to_text )attribute (argument_list (attribute (identifier_rrset) identifier_rrset (identifier_rdtype) identifier_rdtype )attribute )argument_list )call (call (attribute (identifier_rdata) identifier_rdata (identifier_to_text) identifier_to_text )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block )for_statement )block (except_clause (as_pattern (attribute (attribute (identifier_dns) identifier_dns (identifier_exception) identifier_exception )attribute (identifier_DNSException) identifier_DNSException )attribute (as_pattern_target (identifier_error) identifier_error )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_LOGGER) identifier_LOGGER (identifier_debug) identifier_debug )attribute (argument_list (string_'DNS Lookup => %s') string_'DNS Lookup => %s' (identifier_error) identifier_error )argument_list )call )expression_statement )block )except_clause )try_statement (return_statement (identifier_rrset) identifier_rrset )return_statement )block )function_definition )module
Looks on specified or default system domain nameservers to resolve record type & name and returns record set. The record set is empty if no propagated record found.
(module (function_definition (function_name_list_azure_containers) function_name_list_azure_containers (parameters (identifier_config_fpath) identifier_config_fpath )parameters (block (expression_statement (assignment (identifier_config_content) identifier_config_content (call (identifier__get_config_dict_from_file) identifier__get_config_dict_from_file (argument_list (identifier_config_fpath) identifier_config_fpath )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_az_container_names) identifier_az_container_names (list )list )assignment )expression_statement (for_statement (identifier_key) identifier_key (call (attribute (identifier_config_content) identifier_config_content (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call (block (if_statement (call (attribute (identifier_key) identifier_key (identifier_startswith) identifier_startswith )attribute (argument_list (identifier_AZURE_KEY_PREFIX) identifier_AZURE_KEY_PREFIX )argument_list )call (block (expression_statement (assignment (identifier_name) identifier_name (subscript (identifier_key) identifier_key (slice (call (identifier_len) identifier_len (argument_list (identifier_AZURE_KEY_PREFIX) identifier_AZURE_KEY_PREFIX )argument_list )call (colon) colon )slice )subscript )assignment )expression_statement (expression_statement (call (attribute (identifier_az_container_names) identifier_az_container_names (identifier_append) identifier_append )attribute (argument_list (identifier_name) identifier_name )argument_list )call )expression_statement )block )if_statement )block )for_statement (return_statement (call (identifier_sorted) identifier_sorted (argument_list (identifier_az_container_names) identifier_az_container_names )argument_list )call )return_statement )block )function_definition )module
List the azure storage containers in the config file. :param config_fpath: path to the dtool config file :returns: the list of azure storage container names
(module (function_definition (function_name_get_random_url) function_name_get_random_url (parameters (default_parameter (identifier_ltd) identifier_ltd (string_"com") string_"com" )default_parameter )parameters (block (expression_statement (assignment (identifier_url) identifier_url (list (string_"https://") string_"https://" (call (attribute (identifier_RandomInputHelper) identifier_RandomInputHelper (identifier_get_random_value) identifier_get_random_value )attribute (argument_list (integer_8) integer_8 (list (attribute (identifier_string) identifier_string (identifier_ascii_lowercase) identifier_ascii_lowercase )attribute )list )argument_list )call (string_".") string_"." (identifier_ltd) identifier_ltd )list )assignment )expression_statement (return_statement (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (argument_list (identifier_url) identifier_url )argument_list )call )return_statement )block )function_definition )module
Get a random url with the given ltd. Args: ltd (str): The ltd to use (e.g. com). Returns: str: The random url.
(module (function_definition (function_name__convert_to_lexicon) function_name__convert_to_lexicon (parameters (identifier_self) identifier_self (identifier_record) identifier_record )parameters (block (expression_statement (assignment (identifier_name) identifier_name (subscript (identifier_record) identifier_record (string_'Name') string_'Name' )subscript )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_domain) identifier_domain )attribute (identifier_name) identifier_name )comparison_operator (block (expression_statement (assignment (identifier_name) identifier_name (call (attribute (string_"{}.{}") string_"{}.{}" (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name (attribute (identifier_self) identifier_self (identifier_domain) identifier_domain )attribute )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_processed_record) identifier_processed_record (dictionary (pair (string_'type') string_'type' (subscript (identifier_record) identifier_record (string_'Type') string_'Type' )subscript )pair (pair (string_'name') string_'name' (call (attribute (string_'{0}.{1}') string_'{0}.{1}' (identifier_format) identifier_format )attribute (argument_list (subscript (identifier_record) identifier_record (string_'Name') string_'Name' )subscript (attribute (identifier_self) identifier_self (identifier_domain) identifier_domain )attribute )argument_list )call )pair (pair (string_'ttl') string_'ttl' (subscript (identifier_record) identifier_record (string_'TTL') string_'TTL' )subscript )pair (pair (string_'content') string_'content' (subscript (identifier_record) identifier_record (string_'Address') string_'Address' )subscript )pair (pair (string_'id') string_'id' (subscript (identifier_record) identifier_record (string_'HostId') string_'HostId' )subscript )pair )dictionary )assignment )expression_statement (return_statement (identifier_processed_record) identifier_processed_record )return_statement )block )function_definition )module
converts from namecheap raw record format to lexicon format record
(module (function_definition (function_name_strip_column_names) function_name_strip_column_names (parameters (identifier_cols) identifier_cols (default_parameter (identifier_keep_paren_contents) identifier_keep_paren_contents (True) True )default_parameter )parameters (block (expression_statement (assignment (identifier_new_cols) identifier_new_cols (list_comprehension (call (identifier__strip_column_name) identifier__strip_column_name (argument_list (identifier_col) identifier_col (keyword_argument (identifier_keep_paren_contents) identifier_keep_paren_contents (identifier_keep_paren_contents) identifier_keep_paren_contents )keyword_argument )argument_list )call (for_in_clause (identifier_col) identifier_col (identifier_cols) identifier_cols )for_in_clause )list_comprehension )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_new_cols) identifier_new_cols )argument_list )call (call (identifier_len) identifier_len (argument_list (call (identifier_set) identifier_set (argument_list (identifier_new_cols) identifier_new_cols )argument_list )call )argument_list )call )comparison_operator (block (expression_statement (assignment (identifier_warn_str) identifier_warn_str (string_'Warning: strip_column_names (if run) would introduce duplicate names.') string_'Warning: strip_column_names (if run) would introduce duplicate names.' )assignment )expression_statement (expression_statement (augmented_assignment (identifier_warn_str) identifier_warn_str (string_' Reverting column names to the original.') string_' Reverting column names to the original.' )augmented_assignment )expression_statement (expression_statement (call (attribute (identifier_warnings) identifier_warnings (identifier_warn) identifier_warn )attribute (argument_list (identifier_warn_str) identifier_warn_str (identifier_Warning) identifier_Warning )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_'Warning: strip_column_names would introduce duplicate names. Please fix & try again.') string_'Warning: strip_column_names would introduce duplicate names. Please fix & try again.' )argument_list )call )expression_statement (return_statement (call (identifier_dict) identifier_dict (argument_list (call (identifier_zip) identifier_zip (argument_list (identifier_cols) identifier_cols (identifier_cols) identifier_cols )argument_list )call )argument_list )call )return_statement )block )if_statement (return_statement (call (identifier_dict) identifier_dict (argument_list (call (identifier_zip) identifier_zip (argument_list (identifier_cols) identifier_cols (identifier_new_cols) identifier_new_cols )argument_list )call )argument_list )call )return_statement )block )function_definition )module
Utility script for renaming pandas columns to patsy-friendly names. Revised names have been: - stripped of all punctuation and whitespace (converted to text or `_`) - converted to lower case Takes a list of column names, returns a dict mapping names to revised names. If there are any concerns with the conversion, this will print a warning & return original column names. Parameters ---------- cols (list): list of strings containing column names keep_paren_contents (logical): controls behavior of within-paren elements of text - if True, (the default) all text within parens retained - if False, text within parens will be removed from the field name Returns ------- dict mapping col_names -> new_col_names Example ------- > df = {'one' : pd.Series([1., 2., 3.], index=['a', 'b', 'c']), 'two' : pd.Series([1., 2., 3., 4.], index=['a', 'b', 'c', 'd']), 'PD L1 (value)': pd.Series([1., 2., 3., 4.], index=['a', 'b', 'c', 'd']), 'PD L1 (>1)': pd.Series([0., 1., 1., 0.], index=['a', 'b', 'c', 'd']), } > df = pd.DataFrame(df) > df = df.rename(columns = strip_column_names(df.columns)) ## observe, by comparison > df2 = df.rename(columns = strip_column_names(df.columns, keep_paren_contents=False))
(module (function_definition (function_name_parse) function_name_parse (parameters (identifier_log_file) identifier_log_file )parameters (block (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_io) identifier_io (identifier_open) identifier_open )attribute (argument_list (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_expanduser) identifier_expanduser )attribute (argument_list (identifier_log_file) identifier_log_file )argument_list )call (keyword_argument (identifier_encoding) identifier_encoding (string_"utf-8") string_"utf-8" )keyword_argument )argument_list )call (as_pattern_target (identifier_input_file) identifier_input_file )as_pattern_target )as_pattern )with_item )with_clause (block (for_statement (identifier_line) identifier_line (identifier_input_file) identifier_input_file (block (if_statement (comparison_operator (string_"Starting import of XUnit results") string_"Starting import of XUnit results" (identifier_line) identifier_line )comparison_operator (block (expression_statement (assignment (identifier_obj) identifier_obj (identifier_XUnitParser) identifier_XUnitParser )assignment )expression_statement (break_statement )break_statement )block (elif_clause (comparison_operator (string_"Starting import of test cases") string_"Starting import of test cases" (identifier_line) identifier_line )comparison_operator (block (expression_statement (assignment (identifier_obj) identifier_obj (identifier_TestcasesParser) identifier_TestcasesParser )assignment )expression_statement (break_statement )break_statement )block )elif_clause (elif_clause (comparison_operator (string_"Starting import of requirements") string_"Starting import of requirements" (identifier_line) identifier_line )comparison_operator (block (expression_statement (assignment (identifier_obj) identifier_obj (identifier_RequirementsParser) identifier_RequirementsParser )assignment )expression_statement (break_statement )break_statement )block )elif_clause )if_statement )block (else_clause (block (raise_statement (call (identifier_Dump2PolarionException) identifier_Dump2PolarionException (argument_list (call (attribute (string_"No valid data found in the log file '{}'") string_"No valid data found in the log file '{}'" (identifier_format) identifier_format )attribute (argument_list (identifier_log_file) identifier_log_file )argument_list )call )argument_list )call )raise_statement )block )else_clause )for_statement (return_statement (call (attribute (call (identifier_obj) identifier_obj (argument_list (identifier_input_file) identifier_input_file (identifier_log_file) identifier_log_file )argument_list )call (identifier_parse) identifier_parse )attribute (argument_list )argument_list )call )return_statement )block )with_statement )block )function_definition )module
Parse log file.
(module (function_definition (function_name_dispatch_sockets) function_name_dispatch_sockets (parameters (identifier_self) identifier_self (default_parameter (identifier_timeout) identifier_timeout (None) None )default_parameter )parameters (block (for_statement (identifier_sock) identifier_sock (call (attribute (identifier_self) identifier_self (identifier_select_sockets) identifier_select_sockets )attribute (argument_list (keyword_argument (identifier_timeout) identifier_timeout (identifier_timeout) identifier_timeout )keyword_argument )argument_list )call (block (if_statement (comparison_operator (identifier_sock) identifier_sock (attribute (identifier_self) identifier_self (identifier_listener) identifier_listener )attribute )comparison_operator (block (expression_statement (assignment (identifier_listener) identifier_listener (identifier_sock) identifier_sock )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_sock) identifier_sock (identifier_addr) identifier_addr )pattern_list (call (attribute (identifier_listener) identifier_listener (identifier_accept) identifier_accept )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_connected) identifier_connected )attribute (argument_list (identifier_sock) identifier_sock )argument_list )call )expression_statement )block (else_clause (block (try_statement (block (expression_statement (call (attribute (identifier_sock) identifier_sock (identifier_recv) identifier_recv )attribute (argument_list (integer_1) integer_1 )argument_list )call )expression_statement )block (except_clause (as_pattern (attribute (identifier_socket) identifier_socket (identifier_error) identifier_error )attribute (as_pattern_target (identifier_exc) identifier_exc )as_pattern_target )as_pattern (block (if_statement (comparison_operator (attribute (identifier_exc) identifier_exc (identifier_errno) identifier_errno )attribute (identifier_ECONNRESET) identifier_ECONNRESET )comparison_operator (block (raise_statement )raise_statement )block )if_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_disconnected) identifier_disconnected )attribute (argument_list (identifier_sock) identifier_sock )argument_list )call )expression_statement )block )else_clause )if_statement )block )for_statement )block )function_definition )module
Dispatches incoming sockets.
(module (function_definition (function_name_translate) function_name_translate (parameters (identifier_self) identifier_self (identifier_package) identifier_package (default_parameter (identifier_into) identifier_into (None) None )default_parameter )parameters (block (if_statement (not_operator (attribute (identifier_package) identifier_package (identifier_local) identifier_local )attribute )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'BinaryTranslator cannot translate remote packages.') string_'BinaryTranslator cannot translate remote packages.' )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_package) identifier_package (attribute (identifier_self) identifier_self (identifier__package_type) identifier__package_type )attribute )argument_list )call )not_operator (block (return_statement (None) None )return_statement )block )if_statement (if_statement (not_operator (call (attribute (identifier_package) identifier_package (identifier_compatible) identifier_compatible )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__supported_tags) identifier__supported_tags )attribute )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_TRACER) identifier_TRACER (identifier_log) identifier_log )attribute (argument_list (binary_operator (string_'Target package %s is not compatible with %s') string_'Target package %s is not compatible with %s' (tuple (identifier_package) identifier_package (attribute (identifier_self) identifier_self (identifier__supported_tags) identifier__supported_tags )attribute )tuple )binary_operator )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_into) identifier_into (boolean_operator (identifier_into) identifier_into (call (identifier_safe_mkdtemp) identifier_safe_mkdtemp (argument_list )argument_list )call )boolean_operator )assignment )expression_statement (expression_statement (assignment (identifier_target_path) identifier_target_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_into) identifier_into (attribute (identifier_package) identifier_package (identifier_filename) identifier_filename )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_safe_copy) identifier_safe_copy (argument_list (attribute (identifier_package) identifier_package (identifier_local_path) identifier_local_path )attribute (identifier_target_path) identifier_target_path )argument_list )call )expression_statement (return_statement (call (attribute (identifier_DistributionHelper) identifier_DistributionHelper (identifier_distribution_from_path) identifier_distribution_from_path )attribute (argument_list (identifier_target_path) identifier_target_path )argument_list )call )return_statement )block )function_definition )module
From a binary package, translate to a local binary distribution.
(module (function_definition (function_name_change_status) function_name_change_status (parameters (identifier_request) identifier_request (identifier_page_id) identifier_page_id )parameters (block (expression_statement (assignment (identifier_perm) identifier_perm (call (attribute (attribute (identifier_request) identifier_request (identifier_user) identifier_user )attribute (identifier_has_perm) identifier_has_perm )attribute (argument_list (string_'pages.change_page') string_'pages.change_page' )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (identifier_perm) identifier_perm (comparison_operator (attribute (identifier_request) identifier_request (identifier_method) identifier_method )attribute (string_'POST') string_'POST' )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_page) identifier_page (call (attribute (attribute (identifier_Page) identifier_Page (identifier_objects) identifier_objects )attribute (identifier_get) identifier_get )attribute (argument_list (keyword_argument (identifier_pk) identifier_pk (identifier_page_id) identifier_page_id )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_page) identifier_page (identifier_status) identifier_status )attribute (call (identifier_int) identifier_int (argument_list (subscript (attribute (identifier_request) identifier_request (identifier_POST) identifier_POST )attribute (string_'status') string_'status' )subscript )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_page) identifier_page (identifier_invalidate) identifier_invalidate )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_page) identifier_page (identifier_save) identifier_save )attribute (argument_list )argument_list )call )expression_statement (return_statement (call (identifier_HttpResponse) identifier_HttpResponse (argument_list (call (identifier_str) identifier_str (argument_list (attribute (identifier_page) identifier_page (identifier_status) identifier_status )attribute )argument_list )call )argument_list )call )return_statement )block )if_statement (raise_statement (identifier_Http404) identifier_Http404 )raise_statement )block )function_definition )module
Switch the status of a page.
(module (function_definition (function_name_get_consumer_cfg) function_name_get_consumer_cfg (parameters (identifier_config) identifier_config (identifier_only) identifier_only (identifier_qty) identifier_qty )parameters (block (expression_statement (assignment (identifier_consumers) identifier_consumers (call (identifier_dict) identifier_dict (argument_list (boolean_operator (attribute (attribute (identifier_config) identifier_config (identifier_application) identifier_application )attribute (identifier_Consumers) identifier_Consumers )attribute (dictionary )dictionary )boolean_operator )argument_list )call )assignment )expression_statement (if_statement (identifier_only) identifier_only (block (for_statement (identifier_key) identifier_key (call (identifier_list) identifier_list (argument_list (call (attribute (identifier_consumers) identifier_consumers (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call )argument_list )call (block (if_statement (comparison_operator (identifier_key) identifier_key (identifier_only) identifier_only )comparison_operator (block (delete_statement (subscript (identifier_consumers) identifier_consumers (identifier_key) identifier_key )subscript )delete_statement )block )if_statement )block )for_statement (if_statement (identifier_qty) identifier_qty (block (expression_statement (assignment (subscript (subscript (identifier_consumers) identifier_consumers (identifier_only) identifier_only )subscript (string_'qty') string_'qty' )subscript (identifier_qty) identifier_qty )assignment )expression_statement )block )if_statement )block )if_statement (return_statement (identifier_consumers) identifier_consumers )return_statement )block )function_definition )module
Get the consumers config, possibly filtering the config if only or qty is set. :param config: The consumers config section :type config: helper.config.Config :param str only: When set, filter to run only this consumer :param int qty: When set, set the consumer qty to this value :rtype: dict
(module (function_definition (function_name__add_action) function_name__add_action (parameters (identifier_self) identifier_self (identifier_notification) identifier_notification (identifier_action) identifier_action (identifier_label) identifier_label (identifier_callback) identifier_callback (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (block (expression_statement (assignment (identifier_on_action_click) identifier_on_action_click (call (identifier_run_bg) identifier_run_bg (argument_list (lambda (lambda_parameters (list_splat_pattern (identifier__) identifier__ )list_splat_pattern )lambda_parameters (call (identifier_callback) identifier_callback (argument_list (list_splat (identifier_args) identifier_args )list_splat )argument_list )call )lambda )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (identifier_notification) identifier_notification (identifier_add_action) identifier_add_action )attribute (argument_list (identifier_action) identifier_action (identifier_label) identifier_label (identifier_on_action_click) identifier_on_action_click (None) None )argument_list )call )expression_statement )block (except_clause (identifier_TypeError) identifier_TypeError (block (expression_statement (call (attribute (identifier_notification) identifier_notification (identifier_add_action) identifier_add_action )attribute (argument_list (identifier_action) identifier_action (identifier_label) identifier_label (identifier_on_action_click) identifier_on_action_click (None) None (None) None )argument_list )call )expression_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_notification) identifier_notification (identifier_connect) identifier_connect )attribute (argument_list (string_'closed') string_'closed' (attribute (attribute (identifier_self) identifier_self (identifier__notifications) identifier__notifications )attribute (identifier_remove) identifier_remove )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__notifications) identifier__notifications )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_notification) identifier_notification )argument_list )call )expression_statement )block )function_definition )module
Show an action button button in mount notifications. Note, this only works with some libnotify services.
(module (function_definition (function_name_match) function_name_match (parameters (identifier_self) identifier_self (identifier_name) identifier_name )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_method) identifier_method )attribute (attribute (attribute (identifier_Ex) identifier_Ex (identifier_Method) identifier_Method )attribute (identifier_PREFIX) identifier_PREFIX )attribute )comparison_operator (block (return_statement (call (attribute (identifier_name) identifier_name (identifier_startswith) identifier_startswith )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute )argument_list )call )return_statement )block (elif_clause (comparison_operator (attribute (identifier_self) identifier_self (identifier_method) identifier_method )attribute (attribute (attribute (identifier_Ex) identifier_Ex (identifier_Method) identifier_Method )attribute (identifier_SUFFIX) identifier_SUFFIX )attribute )comparison_operator (block (return_statement (call (attribute (identifier_name) identifier_name (identifier_endswith) identifier_endswith )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute )argument_list )call )return_statement )block )elif_clause (elif_clause (comparison_operator (attribute (identifier_self) identifier_self (identifier_method) identifier_method )attribute (attribute (attribute (identifier_Ex) identifier_Ex (identifier_Method) identifier_Method )attribute (identifier_CONTAINS) identifier_CONTAINS )attribute )comparison_operator (block (return_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute (identifier_name) identifier_name )comparison_operator )return_statement )block )elif_clause (elif_clause (comparison_operator (attribute (identifier_self) identifier_self (identifier_method) identifier_method )attribute (attribute (attribute (identifier_Ex) identifier_Ex (identifier_Method) identifier_Method )attribute (identifier_EXACT) identifier_EXACT )attribute )comparison_operator (block (return_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute (identifier_name) identifier_name )comparison_operator )return_statement )block )elif_clause (elif_clause (comparison_operator (attribute (identifier_self) identifier_self (identifier_method) identifier_method )attribute (attribute (attribute (identifier_Ex) identifier_Ex (identifier_Method) identifier_Method )attribute (identifier_REGEX) identifier_REGEX )attribute )comparison_operator (block (return_statement (call (attribute (identifier_re) identifier_re (identifier_search) identifier_search )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_value) identifier_value )attribute (identifier_name) identifier_name )argument_list )call )return_statement )block )elif_clause )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Check if given name matches. Args: name (str): name to check. Returns: bool: matches name.
(module (function_definition (function_name__process_file_continue_ftp_response) function_name__process_file_continue_ftp_response (parameters (identifier_self) identifier_self (typed_parameter (identifier_response) identifier_response (type (identifier_FTPResponse) identifier_FTPResponse )type )typed_parameter )parameters (block (if_statement (boolean_operator (attribute (attribute (identifier_response) identifier_response (identifier_request) identifier_request )attribute (identifier_restart_value) identifier_restart_value )attribute (attribute (identifier_response) identifier_response (identifier_restart_value) identifier_restart_value )attribute )boolean_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_open_file) identifier_open_file )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__filename) identifier__filename )attribute (identifier_response) identifier_response (keyword_argument (identifier_mode) identifier_mode (string_'ab+') string_'ab+' )keyword_argument )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__raise_cannot_continue_error) identifier__raise_cannot_continue_error )attribute (argument_list )argument_list )call )expression_statement )block )else_clause )if_statement )block )function_definition )module
Process a restarted content response.
(module (function_definition (function_name_uninstall) function_name_uninstall (parameters (identifier_self) identifier_self )parameters (block (if_statement (call (attribute (identifier_self) identifier_self (identifier_is_installed) identifier_is_installed )attribute (argument_list )argument_list )call (block (expression_statement (assignment (identifier_installed) identifier_installed (call (attribute (identifier_self) identifier_self (identifier_installed_dir) identifier_installed_dir )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (call (attribute (identifier_installed) identifier_installed (identifier_is_symlink) identifier_is_symlink )attribute (argument_list )argument_list )call (block (expression_statement (call (attribute (identifier_installed) identifier_installed (identifier_unlink) identifier_unlink )attribute (argument_list )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_shutil) identifier_shutil (identifier_rmtree) identifier_rmtree )attribute (argument_list (call (identifier_str) identifier_str (argument_list (identifier_installed) identifier_installed )argument_list )call )argument_list )call )expression_statement )block )else_clause )if_statement )block )if_statement )block )function_definition )module
Delete code inside NApp directory, if existent.
(module (function_definition (function_name_preassemble) function_name_preassemble (parameters (identifier_self) identifier_self (default_parameter (identifier_filters) identifier_filters (None) None )default_parameter (default_parameter (identifier_grounding_map) identifier_grounding_map (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_self) identifier_self (identifier_get_statements) identifier_get_statements )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_filter_no_hypothesis) identifier_filter_no_hypothesis )attribute (argument_list (identifier_stmts) identifier_stmts )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_grounding_map) identifier_grounding_map (None) None )comparison_operator (block (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_map_grounding) identifier_map_grounding )attribute (argument_list (identifier_stmts) identifier_stmts (keyword_argument (identifier_grounding_map) identifier_grounding_map (identifier_grounding_map) identifier_grounding_map )keyword_argument )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_map_grounding) identifier_map_grounding )attribute (argument_list (identifier_stmts) identifier_stmts )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (if_statement (boolean_operator (identifier_filters) identifier_filters (parenthesized_expression (comparison_operator (string_'grounding') string_'grounding' (identifier_filters) identifier_filters )comparison_operator )parenthesized_expression )boolean_operator (block (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_filter_grounded_only) identifier_filter_grounded_only )attribute (argument_list (identifier_stmts) identifier_stmts )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_map_sequence) identifier_map_sequence )attribute (argument_list (identifier_stmts) identifier_stmts )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (identifier_filters) identifier_filters (comparison_operator (string_'human_only') string_'human_only' (identifier_filters) identifier_filters )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_filter_human_only) identifier_filter_human_only )attribute (argument_list (identifier_stmts) identifier_stmts )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_ac) identifier_ac (identifier_run_preassembly) identifier_run_preassembly )attribute (argument_list (identifier_stmts) identifier_stmts (keyword_argument (identifier_return_toplevel) identifier_return_toplevel (False) False )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_stmts) identifier_stmts (call (attribute (identifier_self) identifier_self (identifier__relevance_filter) identifier__relevance_filter )attribute (argument_list (identifier_stmts) identifier_stmts (identifier_filters) identifier_filters )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_assembled_stmts) identifier_assembled_stmts )attribute (identifier_stmts) identifier_stmts )assignment )expression_statement )block )function_definition )module
Preassemble the Statements collected in the model. Use INDRA's GroundingMapper, Preassembler and BeliefEngine on the IncrementalModel and save the unique statements and the top level statements in class attributes. Currently the following filter options are implemented: - grounding: require that all Agents in statements are grounded - human_only: require that all proteins are human proteins - prior_one: require that at least one Agent is in the prior model - prior_all: require that all Agents are in the prior model Parameters ---------- filters : Optional[list[str]] A list of filter options to apply when choosing the statements. See description above for more details. Default: None grounding_map : Optional[dict] A user supplied grounding map which maps a string to a dictionary of database IDs (in the format used by Agents' db_refs).
(module (function_definition (function_name_write_report) function_name_write_report (parameters (identifier_self) identifier_self (identifier_session) identifier_session (identifier_filename) identifier_filename )parameters (block (if_statement (not_operator (attribute (identifier_self) identifier_self (identifier___report) identifier___report )attribute )not_operator (block (expression_statement (call (attribute (identifier_session) identifier_session (identifier_write_line) identifier_write_line )attribute (argument_list (string_"No report to write down") string_"No report to write down" )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (try_statement (block (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_out_file) identifier_out_file )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_out_file) identifier_out_file (identifier_write) identifier_write )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier_to_json) identifier_to_json )attribute (argument_list (attribute (identifier_self) identifier_self (identifier___report) identifier___report )attribute )argument_list )call )argument_list )call )expression_statement )block )with_statement )block (except_clause (as_pattern (identifier_IOError) identifier_IOError (as_pattern_target (identifier_ex) identifier_ex )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_session) identifier_session (identifier_write_line) identifier_write_line )attribute (argument_list (string_"Error writing to file: {0}") string_"Error writing to file: {0}" (identifier_ex) identifier_ex )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
Writes the report in JSON format to the given file
(module (function_definition (function_name__create_record) function_name__create_record (parameters (identifier_self) identifier_self (identifier_rtype) identifier_rtype (identifier_name) identifier_name (identifier_content) identifier_content )parameters (block (expression_statement (assignment (identifier_opts) identifier_opts (dictionary (pair (string_'domain') string_'domain' (attribute (identifier_self) identifier_self (identifier__domain) identifier__domain )attribute )pair (pair (string_'type') string_'type' (call (attribute (identifier_rtype) identifier_rtype (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call )pair (pair (string_'name') string_'name' (call (attribute (identifier_self) identifier_self (identifier__full_name) identifier__full_name )attribute (argument_list (identifier_name) identifier_name )argument_list )call )pair (pair (string_'content') string_'content' (identifier_content) identifier_content )pair )dictionary )assignment )expression_statement (if_statement (call (attribute (identifier_self) identifier_self (identifier__get_lexicon_option) identifier__get_lexicon_option )attribute (argument_list (string_'ttl') string_'ttl' )argument_list )call (block (expression_statement (assignment (subscript (identifier_opts) identifier_opts (string_'ttl') string_'ttl' )subscript (call (attribute (identifier_self) identifier_self (identifier__get_lexicon_option) identifier__get_lexicon_option )attribute (argument_list (string_'ttl') string_'ttl' )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_opts) identifier_opts (identifier_update) identifier_update )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__auth) identifier__auth )attribute )argument_list )call )expression_statement (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier__api) identifier__api )attribute (identifier_nameserver) identifier_nameserver )attribute (identifier_createRecord) identifier_createRecord )attribute (argument_list (identifier_opts) identifier_opts )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__validate_response) identifier__validate_response )attribute (argument_list (keyword_argument (identifier_response) identifier_response (identifier_response) identifier_response )keyword_argument (keyword_argument (identifier_message) identifier_message (string_'Failed to create record') string_'Failed to create record' )keyword_argument (keyword_argument (identifier_exclude_code) identifier_exclude_code (integer_2302) integer_2302 )keyword_argument )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )function_definition )module
create a record does nothing if the record already exists :param str rtype: type of record :param str name: name of record :param mixed content: value of record :return bool: success status :raises Exception: on error
(module (function_definition (function_name_reduce_memory_demand) function_name_reduce_memory_demand (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_prev_gwmem) identifier_prev_gwmem (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_self) identifier_self (identifier_get_inpvar) identifier_get_inpvar )attribute (argument_list (string_"gwmem") string_"gwmem" (keyword_argument (identifier_default) identifier_default (integer_11) integer_11 )keyword_argument )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_first_dig) identifier_first_dig (identifier_second_dig) identifier_second_dig )pattern_list (expression_list (binary_operator (identifier_prev_gwmem) identifier_prev_gwmem (integer_10) integer_10 )binary_operator (binary_operator (identifier_prev_gwmem) identifier_prev_gwmem (integer_10) integer_10 )binary_operator )expression_list )assignment )expression_statement (if_statement (comparison_operator (identifier_second_dig) identifier_second_dig (integer_1) integer_1 )comparison_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_set_vars) identifier_set_vars )attribute (argument_list (keyword_argument (identifier_gwmem) identifier_gwmem (binary_operator (string_"%.2d") string_"%.2d" (parenthesized_expression (binary_operator (integer_10) integer_10 (identifier_first_dig) identifier_first_dig )binary_operator )parenthesized_expression )binary_operator )keyword_argument )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )if_statement (if_statement (comparison_operator (identifier_first_dig) identifier_first_dig (integer_1) integer_1 )comparison_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_set_vars) identifier_set_vars )attribute (argument_list (keyword_argument (identifier_gwmem) identifier_gwmem (binary_operator (string_"%.2d") string_"%.2d" (integer_00) integer_00 )binary_operator )keyword_argument )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Method that can be called by the scheduler to decrease the memory demand of a specific task. Returns True in case of success, False in case of Failure.
(module (function_definition (function_name__get_conn) function_name__get_conn (parameters (default_parameter (identifier_ret) identifier_ret (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier__options) identifier__options (call (identifier__get_options) identifier__get_options (argument_list (identifier_ret) identifier_ret )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_database) identifier_database (call (attribute (identifier__options) identifier__options (identifier_get) identifier_get )attribute (argument_list (string_'database') string_'database' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_timeout) identifier_timeout (call (attribute (identifier__options) identifier__options (identifier_get) identifier_get )attribute (argument_list (string_'timeout') string_'timeout' )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_database) identifier_database )not_operator (block (raise_statement (call (identifier_Exception) identifier_Exception (argument_list (string_'sqlite3 config option "sqlite3.database" is missing') string_'sqlite3 config option "sqlite3.database" is missing' )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (identifier_timeout) identifier_timeout )not_operator (block (raise_statement (call (identifier_Exception) identifier_Exception (argument_list (string_'sqlite3 config option "sqlite3.timeout" is missing') string_'sqlite3 config option "sqlite3.timeout" is missing' )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_'Connecting the sqlite3 database: %s timeout: %s') string_'Connecting the sqlite3 database: %s timeout: %s' (identifier_database) identifier_database (identifier_timeout) identifier_timeout )argument_list )call )expression_statement (expression_statement (assignment (identifier_conn) identifier_conn (call (attribute (identifier_sqlite3) identifier_sqlite3 (identifier_connect) identifier_connect )attribute (argument_list (identifier_database) identifier_database (keyword_argument (identifier_timeout) identifier_timeout (call (identifier_float) identifier_float (argument_list (identifier_timeout) identifier_timeout )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_conn) identifier_conn )return_statement )block )function_definition )module
Return a sqlite3 database connection
(module (function_definition (function_name_connect) function_name_connect (parameters (identifier_self) identifier_self (identifier_fedora_url) identifier_fedora_url (default_parameter (identifier_data) identifier_data (None) None )default_parameter (default_parameter (identifier_method) identifier_method (string_'Get') string_'Get' )default_parameter )parameters (block (if_statement (comparison_operator (identifier_data) identifier_data (None) None )comparison_operator (block (expression_statement (assignment (identifier_data) identifier_data (dictionary )dictionary )assignment )expression_statement )block )if_statement (if_statement (not_operator (call (attribute (identifier_fedora_url) identifier_fedora_url (identifier_startswith) identifier_startswith )attribute (argument_list (string_"http") string_"http" )argument_list )call )not_operator (block (expression_statement (assignment (identifier_fedora_url) identifier_fedora_url (call (attribute (attribute (identifier_urllib) identifier_urllib (identifier_parse) identifier_parse )attribute (identifier_urljoin) identifier_urljoin )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_base_url) identifier_base_url )attribute (identifier_fedora_url) identifier_fedora_url )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_request) identifier_request (call (attribute (attribute (identifier_urllib) identifier_urllib (identifier_request) identifier_request )attribute (identifier_Request) identifier_Request )attribute (argument_list (identifier_fedora_url) identifier_fedora_url (keyword_argument (identifier_method) identifier_method (identifier_method) identifier_method )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_request) identifier_request (identifier_add_header) identifier_add_header )attribute (argument_list (string_'Accept') string_'Accept' (string_'text/turtle') string_'text/turtle' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_request) identifier_request (identifier_add_header) identifier_add_header )attribute (argument_list (string_'Content-Type') string_'Content-Type' (string_'text/turtle') string_'text/turtle' )argument_list )call )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_data) identifier_data )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (assignment (attribute (identifier_request) identifier_request (identifier_data) identifier_data )attribute (identifier_data) identifier_data )assignment )expression_statement )block )if_statement (try_statement (block (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (identifier_urllib) identifier_urllib (identifier_request) identifier_request )attribute (identifier_urlopen) identifier_urlopen )attribute (argument_list (identifier_request) identifier_request )argument_list )call )assignment )expression_statement )block (except_clause (as_pattern (attribute (attribute (identifier_urllib) identifier_urllib (identifier_error) identifier_error )attribute (identifier_URLError) identifier_URLError )attribute (as_pattern_target (identifier_err) identifier_err )as_pattern_target )as_pattern (block (if_statement (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_err) identifier_err (string_'reason') string_'reason' )argument_list )call (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (string_"failed to reach server at {} with {} method") string_"failed to reach server at {} with {} method" (identifier_format) identifier_format )attribute (argument_list (identifier_fedora_url) identifier_fedora_url (attribute (identifier_request) identifier_request (identifier_method) identifier_method )attribute )argument_list )call )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_"Reason: ") string_"Reason: " (attribute (identifier_err) identifier_err (identifier_reason) identifier_reason )attribute )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_"Data: ") string_"Data: " (identifier_data) identifier_data )argument_list )call )expression_statement )block (elif_clause (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_err) identifier_err (string_'code') string_'code' )argument_list )call (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (string_"Server error {}") string_"Server error {}" (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_err) identifier_err (identifier_code) identifier_code )attribute )argument_list )call )argument_list )call )expression_statement )block )elif_clause )if_statement (raise_statement (identifier_err) identifier_err )raise_statement )block )except_clause )try_statement (return_statement (identifier_response) identifier_response )return_statement )block )function_definition )module
Method attempts to connect to REST servers of the Fedora Commons repository using optional data parameter. Args: fedora_url(string): Fedora URL data(dict): Data to through to REST endpoint method(str): REST Method, defaults to GET Returns: result(string): Response string from Fedora
(module (function_definition (function_name__granule_identifier_to_xml_name) function_name__granule_identifier_to_xml_name (parameters (identifier_granule_identifier) identifier_granule_identifier )parameters (block (expression_statement (assignment (identifier_changed_item_type) identifier_changed_item_type (call (attribute (identifier_re) identifier_re (identifier_sub) identifier_sub )attribute (argument_list (string_"_MSI_") string_"_MSI_" (string_"_MTD_") string_"_MTD_" (identifier_granule_identifier) identifier_granule_identifier )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_split_by_underscores) identifier_split_by_underscores (call (attribute (identifier_changed_item_type) identifier_changed_item_type (identifier_split) identifier_split )attribute (argument_list (string_"_") string_"_" )argument_list )call )assignment )expression_statement (delete_statement (subscript (identifier_split_by_underscores) identifier_split_by_underscores (unary_operator (integer_1) integer_1 )unary_operator )subscript )delete_statement (expression_statement (assignment (identifier_cleaned) identifier_cleaned (call (identifier_str) identifier_str (argument_list )argument_list )call )assignment )expression_statement (for_statement (identifier_i) identifier_i (identifier_split_by_underscores) identifier_split_by_underscores (block (expression_statement (augmented_assignment (identifier_cleaned) identifier_cleaned (parenthesized_expression (binary_operator (identifier_i) identifier_i (string_"_") string_"_" )binary_operator )parenthesized_expression )augmented_assignment )expression_statement )block )for_statement (expression_statement (assignment (identifier_out_xml) identifier_out_xml (binary_operator (subscript (identifier_cleaned) identifier_cleaned (slice (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript (string_".xml") string_".xml" )binary_operator )assignment )expression_statement (return_statement (identifier_out_xml) identifier_out_xml )return_statement )block )function_definition )module
Very ugly way to convert the granule identifier. e.g. From Granule Identifier: S2A_OPER_MSI_L1C_TL_SGS__20150817T131818_A000792_T28QBG_N01.03 To Granule Metadata XML name: S2A_OPER_MTD_L1C_TL_SGS__20150817T131818_A000792_T28QBG.xml
(module (function_definition (function_name_normalize_genotypes) function_name_normalize_genotypes (parameters (identifier_genotypes) identifier_genotypes )parameters (block (expression_statement (assignment (identifier_genotypes) identifier_genotypes (attribute (identifier_genotypes) identifier_genotypes (identifier_genotypes) identifier_genotypes )attribute )assignment )expression_statement (return_statement (binary_operator (parenthesized_expression (binary_operator (identifier_genotypes) identifier_genotypes (call (attribute (identifier_np) identifier_np (identifier_nanmean) identifier_nanmean )attribute (argument_list (identifier_genotypes) identifier_genotypes )argument_list )call )binary_operator )parenthesized_expression (call (attribute (identifier_np) identifier_np (identifier_nanstd) identifier_nanstd )attribute (argument_list (identifier_genotypes) identifier_genotypes )argument_list )call )binary_operator )return_statement )block )function_definition )module
Normalize the genotypes. Args: genotypes (Genotypes): The genotypes to normalize. Returns: numpy.array: The normalized genotypes.
(module (function_definition (function_name_irafconvert) function_name_irafconvert (parameters (identifier_iraffilename) identifier_iraffilename )parameters (block (expression_statement (assignment (identifier_convertdict) identifier_convertdict (identifier_CONVERTDICT) identifier_CONVERTDICT )assignment )expression_statement (if_statement (not_operator (call (attribute (call (attribute (identifier_iraffilename) identifier_iraffilename (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call (identifier_startswith) identifier_startswith )attribute (argument_list (tuple (string_'http') string_'http' (string_'ftp') string_'ftp' )tuple )argument_list )call )not_operator (block (expression_statement (assignment (identifier_iraffilename) identifier_iraffilename (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_normpath) identifier_normpath )attribute (argument_list (identifier_iraffilename) identifier_iraffilename )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (call (attribute (identifier_iraffilename) identifier_iraffilename (identifier_startswith) identifier_startswith )attribute (argument_list (string_'$') string_'$' )argument_list )call (block (expression_statement (assignment (identifier_pat) identifier_pat (call (attribute (identifier_re) identifier_re (identifier_compile) identifier_compile )attribute (argument_list (string_r'\$(\w*)') string_r'\$(\w*)' )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 (identifier_pat) identifier_pat (identifier_iraffilename) identifier_iraffilename )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_dirname) identifier_dirname (call (attribute (identifier_match) identifier_match (identifier_group) identifier_group )attribute (argument_list (integer_1) integer_1 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_unixdir) identifier_unixdir (subscript (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute (identifier_dirname) identifier_dirname )subscript )assignment )expression_statement (expression_statement (assignment (identifier_basename) identifier_basename (subscript (identifier_iraffilename) identifier_iraffilename (slice (binary_operator (call (attribute (identifier_match) identifier_match (identifier_end) identifier_end )attribute (argument_list )argument_list )call (integer_1) integer_1 )binary_operator (colon) colon )slice )subscript )assignment )expression_statement (expression_statement (assignment (identifier_unixfilename) identifier_unixfilename (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_unixdir) identifier_unixdir (identifier_basename) identifier_basename )argument_list )call )assignment )expression_statement (return_statement (identifier_unixfilename) identifier_unixfilename )return_statement )block (elif_clause (comparison_operator (string_'$') string_'$' (identifier_iraffilename) identifier_iraffilename )comparison_operator (block (expression_statement (assignment (pattern_list (identifier_irafdir) identifier_irafdir (identifier_basename) identifier_basename )pattern_list (call (attribute (identifier_iraffilename) identifier_iraffilename (identifier_split) identifier_split )attribute (argument_list (string_'$') string_'$' )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_irafdir) identifier_irafdir (string_'synphot') string_'synphot' )comparison_operator (block (return_statement (call (identifier_get_data_filename) identifier_get_data_filename (argument_list (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_basename) identifier_basename )attribute (argument_list (identifier_basename) identifier_basename )argument_list )call )argument_list )call )return_statement )block )if_statement (expression_statement (assignment (identifier_unixdir) identifier_unixdir (subscript (identifier_convertdict) identifier_convertdict (identifier_irafdir) identifier_irafdir )subscript )assignment )expression_statement (expression_statement (assignment (identifier_unixfilename) identifier_unixfilename (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_unixdir) identifier_unixdir (identifier_basename) identifier_basename )argument_list )call )assignment )expression_statement (return_statement (identifier_unixfilename) identifier_unixfilename )return_statement )block )elif_clause (else_clause (block (return_statement (identifier_iraffilename) identifier_iraffilename )return_statement )block )else_clause )if_statement )block )function_definition )module
Convert the IRAF file name to its Unix equivalent. Input can be in ``directory$file`` or ``$directory/file`` format. If ``'$'`` is not found in the input string, it is returned as-is. Parameters ---------- iraffilename : str Filename in IRAF format. Returns ------- unixfilename : str Filename in Unix format. Raises ------ AttributeError Input is not a string.
(module (function_definition (function_name_get_body_encoding) function_name_get_body_encoding (parameters (identifier_self) identifier_self )parameters (block (assert_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_body_encoding) identifier_body_encoding )attribute (identifier_SHORTEST) identifier_SHORTEST )comparison_operator )assert_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_body_encoding) identifier_body_encoding )attribute (identifier_QP) identifier_QP )comparison_operator (block (return_statement (string_'quoted-printable') string_'quoted-printable' )return_statement )block (elif_clause (comparison_operator (attribute (identifier_self) identifier_self (identifier_body_encoding) identifier_body_encoding )attribute (identifier_BASE64) identifier_BASE64 )comparison_operator (block (return_statement (string_'base64') string_'base64' )return_statement )block )elif_clause (else_clause (block (return_statement (identifier_encode_7or8bit) identifier_encode_7or8bit )return_statement )block )else_clause )if_statement )block )function_definition )module
Return the content-transfer-encoding used for body encoding. This is either the string `quoted-printable' or `base64' depending on the encoding used, or it is a function in which case you should call the function with a single argument, the Message object being encoded. The function should then set the Content-Transfer-Encoding header itself to whatever is appropriate. Returns "quoted-printable" if self.body_encoding is QP. Returns "base64" if self.body_encoding is BASE64. Returns conversion function otherwise.
(module (function_definition (function_name_not0) function_name_not0 (parameters (identifier_a) identifier_a )parameters (block (return_statement (call (identifier_matrix) identifier_matrix (argument_list (call (identifier_list) identifier_list (argument_list (call (identifier_map) identifier_map (argument_list (lambda (lambda_parameters (identifier_x) identifier_x )lambda_parameters (conditional_expression (integer_1) integer_1 (comparison_operator (identifier_x) identifier_x (integer_0) integer_0 )comparison_operator (identifier_x) identifier_x )conditional_expression )lambda (identifier_a) identifier_a )argument_list )call )argument_list )call (attribute (identifier_a) identifier_a (identifier_size) identifier_size )attribute )argument_list )call )return_statement )block )function_definition )module
Return u if u!= 0, return 1 if u == 0
(module (function_definition (function_name_attention_bias_prepend_inputs_full_attention) function_name_attention_bias_prepend_inputs_full_attention (parameters (identifier_padding) identifier_padding )parameters (block (expression_statement (assignment (identifier_in_target) identifier_in_target (call (attribute (identifier_tf) identifier_tf (identifier_cumsum) identifier_cumsum )attribute (argument_list (identifier_padding) identifier_padding (keyword_argument (identifier_axis) identifier_axis (integer_1) integer_1 )keyword_argument (keyword_argument (identifier_exclusive) identifier_exclusive (True) True )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_target_pos) identifier_target_pos (call (attribute (identifier_tf) identifier_tf (identifier_cumsum) identifier_cumsum )attribute (argument_list (identifier_in_target) identifier_in_target (keyword_argument (identifier_axis) identifier_axis (integer_1) integer_1 )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_illegal_connections) identifier_illegal_connections (call (attribute (identifier_tf) identifier_tf (identifier_greater) identifier_greater )attribute (argument_list (call (attribute (identifier_tf) identifier_tf (identifier_expand_dims) identifier_expand_dims )attribute (argument_list (identifier_target_pos) identifier_target_pos (integer_1) integer_1 )argument_list )call (call (attribute (identifier_tf) identifier_tf (identifier_expand_dims) identifier_expand_dims )attribute (argument_list (identifier_target_pos) identifier_target_pos (integer_2) integer_2 )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_bias) identifier_bias (binary_operator (call (attribute (identifier_tf) identifier_tf (identifier_to_float) identifier_to_float )attribute (argument_list (identifier_illegal_connections) identifier_illegal_connections )argument_list )call (unary_operator (float_1e9) float_1e9 )unary_operator )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_bias) identifier_bias (call (attribute (identifier_tf) identifier_tf (identifier_expand_dims) identifier_expand_dims )attribute (argument_list (identifier_bias) identifier_bias (integer_1) integer_1 )argument_list )call )assignment )expression_statement (return_statement (identifier_bias) identifier_bias )return_statement )block )function_definition )module
Create a bias tensor for prepend_mode="prepend_inputs_full_attention". See prepend_inputs in common_hparams.py. Produces a bias tensor to be used in self-attention. This bias tensor allows for full connectivity in the "inputs" part of the sequence and masked connectivity in the targets part. Args: padding: a float `Tensor` with shape [batch, length] with ones in positions corresponding to padding. In each row, a single padding position separates the input part from the target part. Returns: a `Tensor` with shape [batch, 1, length, length].
(module (function_definition (function_name_xpathRegisterNs) function_name_xpathRegisterNs (parameters (identifier_self) identifier_self (identifier_prefix) identifier_prefix (identifier_ns_uri) identifier_ns_uri )parameters (block (expression_statement (assignment (identifier_ret) identifier_ret (call (attribute (identifier_libxml2mod) identifier_libxml2mod (identifier_xmlXPathRegisterNs) identifier_xmlXPathRegisterNs )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__o) identifier__o )attribute (identifier_prefix) identifier_prefix (identifier_ns_uri) identifier_ns_uri )argument_list )call )assignment )expression_statement (return_statement (identifier_ret) identifier_ret )return_statement )block )function_definition )module
Register a new namespace. If @ns_uri is None it unregisters the namespace
(module (function_definition (function_name_get_tab_tip) function_name_get_tab_tip (parameters (identifier_self) identifier_self (identifier_filename) identifier_filename (default_parameter (identifier_is_modified) identifier_is_modified (None) None )default_parameter (default_parameter (identifier_is_readonly) identifier_is_readonly (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_text) identifier_text (string_u"%s — %s") string_u"%s — %s" )assignment )expression_statement (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_self) identifier_self (identifier___modified_readonly_title) identifier___modified_readonly_title )attribute (argument_list (identifier_text) identifier_text (identifier_is_modified) identifier_is_modified (identifier_is_readonly) identifier_is_readonly )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (attribute (identifier_self) identifier_self (identifier_tempfile_path) identifier_tempfile_path )attribute (None) None )comparison_operator (line_continuation_\) line_continuation_\ (comparison_operator (identifier_filename) identifier_filename (call (attribute (identifier_encoding) identifier_encoding (identifier_to_unicode_from_fs) identifier_to_unicode_from_fs )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_tempfile_path) identifier_tempfile_path )attribute )argument_list )call )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_temp_file_str) identifier_temp_file_str (call (identifier_to_text_string) identifier_to_text_string (argument_list (call (identifier__) identifier__ (argument_list (string_"Temporary file") string_"Temporary file" )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (binary_operator (identifier_text) identifier_text (tuple (identifier_temp_file_str) identifier_temp_file_str (attribute (identifier_self) identifier_self (identifier_tempfile_path) identifier_tempfile_path )attribute )tuple )binary_operator )return_statement )block (else_clause (block (return_statement (binary_operator (identifier_text) identifier_text (tuple (call (attribute (identifier_osp) identifier_osp (identifier_basename) identifier_basename )attribute (argument_list (identifier_filename) identifier_filename )argument_list )call (call (attribute (identifier_osp) identifier_osp (identifier_dirname) identifier_dirname )attribute (argument_list (identifier_filename) identifier_filename )argument_list )call )tuple )binary_operator )return_statement )block )else_clause )if_statement )block )function_definition )module
Return tab menu title
(module (function_definition (function_name__make_tuple) function_name__make_tuple (parameters (identifier_self) identifier_self (identifier_env) identifier_env )parameters (block (expression_statement (assignment (identifier_t) identifier_t (call (attribute (identifier_runtime) identifier_runtime (identifier_Tuple) identifier_Tuple )attribute (argument_list (identifier_self) identifier_self (identifier_env) identifier_env (identifier_dict2tuple) identifier_dict2tuple )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_schema) identifier_schema (call (identifier_schema_spec_from_tuple) identifier_schema_spec_from_tuple (argument_list (identifier_t) identifier_t )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_t) identifier_t (identifier_attach_schema) identifier_attach_schema )attribute (argument_list (identifier_schema) identifier_schema )argument_list )call )expression_statement (return_statement (identifier_t) identifier_t )return_statement )block )function_definition )module
Instantiate the Tuple based on this TupleNode.
(module (function_definition (function_name_getDirSizeRecursively) function_name_getDirSizeRecursively (parameters (identifier_dirPath) identifier_dirPath )parameters (block (return_statement (binary_operator (call (identifier_int) identifier_int (argument_list (subscript (call (attribute (call (attribute (call (attribute (identifier_subprocess) identifier_subprocess (identifier_check_output) identifier_check_output )attribute (argument_list (list (string_'du') string_'du' (string_'-s') string_'-s' (identifier_dirPath) identifier_dirPath )list (keyword_argument (identifier_env) identifier_env (call (identifier_dict) identifier_dict (argument_list (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute (keyword_argument (identifier_BLOCKSIZE) identifier_BLOCKSIZE (string_'512') string_'512' )keyword_argument )argument_list )call )keyword_argument )argument_list )call (identifier_decode) identifier_decode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call (identifier_split) identifier_split )attribute (argument_list )argument_list )call (integer_0) integer_0 )subscript )argument_list )call (integer_512) integer_512 )binary_operator )return_statement )block )function_definition )module
This method will return the cumulative number of bytes occupied by the files on disk in the directory and its subdirectories. This method will raise a 'subprocess.CalledProcessError' if it is unable to access a folder or file because of insufficient permissions. Therefore this method should only be called on the jobStore, and will alert the user if some portion is inaccessible. Everything in the jobStore should have appropriate permissions as there is no way to read the filesize without permissions. The environment variable 'BLOCKSIZE'='512' is set instead of the much cleaner --block-size=1 because Apple can't handle it. :param str dirPath: A valid path to a directory or file. :return: Total size, in bytes, of the file or directory at dirPath.
(module (function_definition (function_name_delete) function_name_delete (parameters (identifier_self) identifier_self (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (try_statement (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_remove) identifier_remove )attribute (argument_list (attribute (attribute (attribute (identifier_self) identifier_self (identifier_file) identifier_file )attribute (identifier_file) identifier_file )attribute (identifier_name) identifier_name )attribute )argument_list )call )expression_statement )block (except_clause (tuple (identifier_OSError) identifier_OSError (identifier_IOError) identifier_IOError )tuple (block (pass_statement )pass_statement )block )except_clause )try_statement (expression_statement (call (attribute (call (identifier_super) identifier_super (argument_list (identifier_Image) identifier_Image (identifier_self) identifier_self )argument_list )call (identifier_delete) identifier_delete )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement )block )function_definition )module
delete image when an image record is deleted
(module (function_definition (function_name_write_empty) function_name_write_empty (parameters (identifier_self) identifier_self (identifier_size) identifier_size )parameters (block (if_statement (comparison_operator (identifier_size) identifier_size (integer_1) integer_1 )comparison_operator (block (return_statement )return_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__fh) identifier__fh )attribute (identifier_seek) identifier_seek )attribute (argument_list (binary_operator (identifier_size) identifier_size (integer_1) integer_1 )binary_operator (integer_1) integer_1 )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__fh) identifier__fh )attribute (identifier_write) identifier_write )attribute (argument_list (string_b'\x00') string_b'\x00' )argument_list )call )expression_statement )block )function_definition )module
Append size bytes to file. Position must be at end of file.
(module (function_definition (function_name_fetch) function_name_fetch (parameters (identifier_self) identifier_self (default_parameter (identifier_only_ref) identifier_only_ref (False) False )default_parameter )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier_ref) identifier_ref )attribute (block (expression_statement (assignment (identifier_reply) identifier_reply (call (attribute (attribute (identifier_self) identifier_self (identifier_connector) identifier_connector )attribute (identifier_get_object) identifier_get_object )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_ref) identifier_ref )attribute (keyword_argument (identifier_return_fields) identifier_return_fields (attribute (identifier_self) identifier_self (identifier_return_fields) identifier_return_fields )attribute )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (identifier_reply) identifier_reply (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_update_from_dict) identifier_update_from_dict )attribute (argument_list (identifier_reply) identifier_reply )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )if_statement )block )if_statement (expression_statement (assignment (identifier_search_dict) identifier_search_dict (call (attribute (identifier_self) identifier_self (identifier_to_dict) identifier_to_dict )attribute (argument_list (keyword_argument (identifier_search_fields) identifier_search_fields (string_'update') string_'update' )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_return_fields) identifier_return_fields (conditional_expression (list )list (identifier_only_ref) identifier_only_ref (attribute (identifier_self) identifier_self (identifier_return_fields) identifier_return_fields )attribute )conditional_expression )assignment )expression_statement (expression_statement (assignment (identifier_reply) identifier_reply (call (attribute (attribute (identifier_self) identifier_self (identifier_connector) identifier_connector )attribute (identifier_get_object) identifier_get_object )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_infoblox_type) identifier_infoblox_type )attribute (identifier_search_dict) identifier_search_dict (keyword_argument (identifier_return_fields) identifier_return_fields (identifier_return_fields) identifier_return_fields )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (identifier_reply) identifier_reply (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_update_from_dict) identifier_update_from_dict )attribute (argument_list (subscript (identifier_reply) identifier_reply (integer_0) integer_0 )subscript (keyword_argument (identifier_only_ref) identifier_only_ref (identifier_only_ref) identifier_only_ref )keyword_argument )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Fetch object from NIOS by _ref or searchfields Update existent object with fields returned from NIOS Return True on successful object fetch
(module (function_definition (function_name_extern_store_bool) function_name_extern_store_bool (parameters (identifier_self) identifier_self (identifier_context_handle) identifier_context_handle (identifier_b) identifier_b )parameters (block (expression_statement (assignment (identifier_c) identifier_c (call (attribute (attribute (identifier_self) identifier_self (identifier__ffi) identifier__ffi )attribute (identifier_from_handle) identifier_from_handle )attribute (argument_list (identifier_context_handle) identifier_context_handle )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_c) identifier_c (identifier_to_value) identifier_to_value )attribute (argument_list (identifier_b) identifier_b )argument_list )call )return_statement )block )function_definition )module
Given a context and _Bool, return a new Handle to represent the _Bool.
(module (function_definition (function_name_unixtimestamp) function_name_unixtimestamp (parameters (identifier_datetime) identifier_datetime )parameters (block (expression_statement (assignment (identifier_epoch) identifier_epoch (call (attribute (identifier_UTC) identifier_UTC (identifier_localize) identifier_localize )attribute (argument_list (call (attribute (identifier_datetime) identifier_datetime (identifier_utcfromtimestamp) identifier_utcfromtimestamp )attribute (argument_list (integer_0) integer_0 )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (not_operator (attribute (identifier_datetime) identifier_datetime (identifier_tzinfo) identifier_tzinfo )attribute )not_operator (block (expression_statement (assignment (identifier_dt) identifier_dt (call (attribute (identifier_UTC) identifier_UTC (identifier_localize) identifier_localize )attribute (argument_list (identifier_datetime) identifier_datetime )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_dt) identifier_dt (call (attribute (identifier_UTC) identifier_UTC (identifier_normalize) identifier_normalize )attribute (argument_list (identifier_datetime) identifier_datetime )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_delta) identifier_delta (binary_operator (identifier_dt) identifier_dt (identifier_epoch) identifier_epoch )binary_operator )assignment )expression_statement (return_statement (call (identifier_total_seconds) identifier_total_seconds (argument_list (identifier_delta) identifier_delta )argument_list )call )return_statement )block )function_definition )module
Get unix time stamp from that given datetime. If datetime is not tzaware then it's assumed that it is UTC
(module (function_definition (function_name_snapshot_name_to_id) function_name_snapshot_name_to_id (parameters (identifier_name) identifier_name (identifier_snap_name) identifier_snap_name (default_parameter (identifier_strict) identifier_strict (False) False )default_parameter (default_parameter (identifier_runas) identifier_runas (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_name) identifier_name (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_utils) identifier_utils )attribute (identifier_data) identifier_data )attribute (identifier_decode) identifier_decode )attribute (argument_list (identifier_name) identifier_name )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_snap_name) identifier_snap_name (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_utils) identifier_utils )attribute (identifier_data) identifier_data )attribute (identifier_decode) identifier_decode )attribute (argument_list (identifier_snap_name) identifier_snap_name )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_info) identifier_info (call (identifier_prlctl) identifier_prlctl (argument_list (string_'snapshot-list') string_'snapshot-list' (identifier_name) identifier_name (keyword_argument (identifier_runas) identifier_runas (identifier_runas) identifier_runas )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_snap_ids) identifier_snap_ids (call (identifier__find_guids) identifier__find_guids (argument_list (identifier_info) identifier_info )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_named_ids) identifier_named_ids (list )list )assignment )expression_statement (for_statement (identifier_snap_id) identifier_snap_id (identifier_snap_ids) identifier_snap_ids (block (if_statement (comparison_operator (call (identifier_snapshot_id_to_name) identifier_snapshot_id_to_name (argument_list (identifier_name) identifier_name (identifier_snap_id) identifier_snap_id (keyword_argument (identifier_runas) identifier_runas (identifier_runas) identifier_runas )keyword_argument )argument_list )call (identifier_snap_name) identifier_snap_name )comparison_operator (block (expression_statement (call (attribute (identifier_named_ids) identifier_named_ids (identifier_append) identifier_append )attribute (argument_list (identifier_snap_id) identifier_snap_id )argument_list )call )expression_statement )block )if_statement )block )for_statement (if_statement (not_operator (identifier_named_ids) identifier_named_ids )not_operator (block (raise_statement (call (identifier_SaltInvocationError) identifier_SaltInvocationError (argument_list (call (attribute (string_'No snapshots for VM "{0}" have name "{1}"') string_'No snapshots for VM "{0}" have name "{1}"' (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name (identifier_snap_name) identifier_snap_name )argument_list )call )argument_list )call )raise_statement )block (elif_clause (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_named_ids) identifier_named_ids )argument_list )call (integer_1) integer_1 )comparison_operator (block (return_statement (subscript (identifier_named_ids) identifier_named_ids (integer_0) integer_0 )subscript )return_statement )block )elif_clause (else_clause (block (expression_statement (assignment (identifier_multi_msg) identifier_multi_msg (parenthesized_expression (call (attribute (concatenated_string (string_'Multiple snapshots for VM "{0}" have name ') string_'Multiple snapshots for VM "{0}" have name ' (string_'"{1}"') string_'"{1}"' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_name) identifier_name (identifier_snap_name) identifier_snap_name )argument_list )call )parenthesized_expression )assignment )expression_statement (if_statement (identifier_strict) identifier_strict (block (raise_statement (call (identifier_SaltInvocationError) identifier_SaltInvocationError (argument_list (identifier_multi_msg) identifier_multi_msg )argument_list )call )raise_statement )block (else_clause (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_warning) identifier_warning )attribute (argument_list (identifier_multi_msg) identifier_multi_msg )argument_list )call )expression_statement )block )else_clause )if_statement (return_statement (identifier_named_ids) identifier_named_ids )return_statement )block )else_clause )if_statement )block )function_definition )module
Attempt to convert a snapshot name to a snapshot ID. If the name is not found an empty string is returned. If multiple snapshots share the same name, a list will be returned :param str name: Name/ID of VM whose snapshots are inspected :param str snap_name: Name of the snapshot :param bool strict: Raise an exception if multiple snapshot IDs are found :param str runas: The user that the prlctl command will be run as CLI Example: .. code-block:: bash salt '*' parallels.snapshot_id_to_name macvm original runas=macdev
(module (function_definition (function_name_sg_lookup) function_name_sg_lookup (parameters (identifier_tensor) identifier_tensor (identifier_opt) identifier_opt )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (assert_statement (comparison_operator (attribute (identifier_opt) identifier_opt (identifier_emb) identifier_emb )attribute (None) None )comparison_operator (string_'emb is mandatory.') string_'emb is mandatory.' )assert_statement (return_statement (call (attribute (attribute (identifier_tf) identifier_tf (identifier_nn) identifier_nn )attribute (identifier_embedding_lookup) identifier_embedding_lookup )attribute (argument_list (attribute (identifier_opt) identifier_opt (identifier_emb) identifier_emb )attribute (identifier_tensor) identifier_tensor (keyword_argument (identifier_name) identifier_name (attribute (identifier_opt) identifier_opt (identifier_name) identifier_name )attribute )keyword_argument )argument_list )call )return_statement )block )function_definition )module
r"""Looks up the `tensor`, which is the embedding matrix. Args: tensor: A tensor ( automatically given by chain ) opt: emb: A 2-D `Tensor`. An embedding matrix. name: If provided, replace current tensor's name. Returns: A `Tensor`.
(module (function_definition (function_name_remove_supervisor_app) function_name_remove_supervisor_app (parameters (identifier_app_name) identifier_app_name )parameters (block (expression_statement (assignment (identifier_app) identifier_app (binary_operator (string_u'/etc/supervisor/conf.d/%s.conf') string_u'/etc/supervisor/conf.d/%s.conf' (identifier_app_name) identifier_app_name )binary_operator )assignment )expression_statement (if_statement (call (attribute (identifier_files) identifier_files (identifier_exists) identifier_exists )attribute (argument_list (identifier_app) identifier_app )argument_list )call (block (expression_statement (call (identifier_sudo) identifier_sudo (argument_list (binary_operator (string_u'rm %s') string_u'rm %s' (identifier_app) identifier_app )binary_operator )argument_list )call )expression_statement (expression_statement (call (identifier_supervisor_command) identifier_supervisor_command (argument_list (string_u'update') string_u'update' )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Remove Supervisor app configuration.
(module (function_definition (function_name_copytree) function_name_copytree (parameters (identifier_src) identifier_src (identifier_dst) identifier_dst (default_parameter (identifier_symlinks) identifier_symlinks (False) False )default_parameter (default_parameter (identifier_ignore) identifier_ignore (None) None )default_parameter )parameters (block (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_dst) identifier_dst )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_mkdir) identifier_mkdir )attribute (argument_list (identifier_dst) identifier_dst )argument_list )call )expression_statement )block )if_statement (try_statement (block (for_statement (identifier_item) identifier_item (call (attribute (identifier_os) identifier_os (identifier_listdir) identifier_listdir )attribute (argument_list (identifier_src) identifier_src )argument_list )call (block (expression_statement (assignment (identifier_s) identifier_s (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_src) identifier_src (identifier_item) identifier_item )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_d) identifier_d (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_dst) identifier_dst (identifier_item) identifier_item )argument_list )call )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_s) identifier_s )argument_list )call (block (expression_statement (call (attribute (identifier_shutil) identifier_shutil (identifier_copytree) identifier_copytree )attribute (argument_list (identifier_s) identifier_s (identifier_d) identifier_d (identifier_symlinks) identifier_symlinks (identifier_ignore) identifier_ignore )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_shutil) identifier_shutil (identifier_copy2) identifier_copy2 )attribute (argument_list (identifier_s) identifier_s (identifier_d) identifier_d )argument_list )call )expression_statement )block )else_clause )if_statement )block )for_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (raise_statement (call (identifier_FolderExistsError) identifier_FolderExistsError (argument_list (binary_operator (string_"Folder already exists in %s") string_"Folder already exists in %s" (identifier_dst) identifier_dst )binary_operator )argument_list )call )raise_statement )block )except_clause )try_statement )block )function_definition )module
Function recursively copies from directory to directory. Args ---- src (string): the full path of source directory dst (string): the full path of destination directory symlinks (boolean): the switch for tracking symlinks ignore (list): the ignore list
(module (function_definition (function_name_bin_b64_type) function_name_bin_b64_type (parameters (identifier_arg) identifier_arg )parameters (block (try_statement (block (expression_statement (assignment (identifier_arg) identifier_arg (call (attribute (identifier_base64) identifier_base64 (identifier_standard_b64decode) identifier_standard_b64decode )attribute (argument_list (identifier_arg) identifier_arg )argument_list )call )assignment )expression_statement )block (except_clause (tuple (attribute (identifier_binascii) identifier_binascii (identifier_Error) identifier_Error )attribute (identifier_TypeError) identifier_TypeError )tuple (block (raise_statement (call (attribute (identifier_argparse) identifier_argparse (identifier_ArgumentTypeError) identifier_ArgumentTypeError )attribute (argument_list (call (attribute (string_"{0} is invalid base64 data") string_"{0} is invalid base64 data" (identifier_format) identifier_format )attribute (argument_list (call (identifier_repr) identifier_repr (argument_list (identifier_arg) identifier_arg )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )except_clause )try_statement (return_statement (identifier_arg) identifier_arg )return_statement )block )function_definition )module
An argparse type representing binary data encoded in base64.