sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name__set_dict_translations) function_name__set_dict_translations (parameters (identifier_instance) identifier_instance (identifier_dict_translations) identifier_dict_translations )parameters (block (if_statement (not_operator (call (identifier_hasattr) identifier_hasattr (argument_list (attribute (identifier_instance) identifier_instance (identifier__meta) identifier__meta )attribute (string_"translatable_fields") string_"translatable_fields" )argument_list )call )not_operator (block (return_statement (False) False )return_statement )block )if_statement (if_statement (call (identifier_site_is_monolingual) identifier_site_is_monolingual (argument_list )argument_list )call (block (return_statement (False) False )return_statement )block )if_statement (expression_statement (assignment (identifier_translatable_fields) identifier_translatable_fields (attribute (attribute (identifier_instance) identifier_instance (identifier__meta) identifier__meta )attribute (identifier_translatable_fields) identifier_translatable_fields )attribute )assignment )expression_statement (for_statement (identifier_field) identifier_field (identifier_translatable_fields) identifier_translatable_fields (block (for_statement (identifier_lang) identifier_lang (attribute (identifier_settings) identifier_settings (identifier_LANGUAGES) identifier_LANGUAGES )attribute (block (expression_statement (assignment (identifier_lang) identifier_lang (subscript (identifier_lang) identifier_lang (integer_0) integer_0 )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_lang) identifier_lang (attribute (identifier_settings) identifier_settings (identifier_LANGUAGE_CODE) identifier_LANGUAGE_CODE )attribute )comparison_operator (block (expression_statement (assignment (identifier_trans_field) identifier_trans_field (call (identifier_trans_attr) identifier_trans_attr (argument_list (identifier_field) identifier_field (identifier_lang) identifier_lang )argument_list )call )assignment )expression_statement (if_statement (call (attribute (identifier_dict_translations) identifier_dict_translations (identifier_has_key) identifier_has_key )attribute (argument_list (identifier_trans_field) identifier_trans_field )argument_list )call (block (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_instance) identifier_instance (identifier_trans_field) identifier_trans_field (subscript (identifier_dict_translations) identifier_dict_translations (identifier_trans_field) identifier_trans_field )subscript )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (identifier_trans_isfuzzy) identifier_trans_isfuzzy (call (identifier_trans_is_fuzzy_attr) identifier_trans_is_fuzzy_attr (argument_list (identifier_field) identifier_field (identifier_lang) identifier_lang )argument_list )call )assignment )expression_statement (if_statement (call (attribute (identifier_dict_translations) identifier_dict_translations (identifier_has_key) identifier_has_key )attribute (argument_list (identifier_trans_isfuzzy) identifier_trans_isfuzzy )argument_list )call (block (expression_statement (assignment (identifier_is_fuzzy_value) identifier_is_fuzzy_value (boolean_operator (parenthesized_expression (comparison_operator (subscript (identifier_dict_translations) identifier_dict_translations (identifier_trans_isfuzzy) identifier_trans_isfuzzy )subscript (string_"1") string_"1" )comparison_operator )parenthesized_expression (parenthesized_expression (comparison_operator (subscript (identifier_dict_translations) identifier_dict_translations (identifier_trans_isfuzzy) identifier_trans_isfuzzy )subscript (integer_1) integer_1 )comparison_operator )parenthesized_expression )boolean_operator )assignment )expression_statement (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_instance) identifier_instance (identifier_trans_isfuzzy) identifier_trans_isfuzzy (identifier_is_fuzzy_value) identifier_is_fuzzy_value )argument_list )call )expression_statement )block )if_statement )block )if_statement )block )for_statement )block )for_statement )block )function_definition )module
Establece los atributos de traducciones a partir de una dict que contiene todas las traducciones.
(module (function_definition (function_name_escape_string) function_name_escape_string (parameters (identifier_string) identifier_string )parameters (block (expression_statement (assignment (identifier_result) identifier_result (identifier_string) identifier_string )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_result) identifier_result (identifier_replace) identifier_replace )attribute (argument_list (string_'\\') string_'\\' (string_'\\\\') string_'\\\\' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_result) identifier_result (identifier_replace) identifier_replace )attribute (argument_list (string_'"') string_'"' (string_'\\"') string_'\\"' )argument_list )call )assignment )expression_statement (return_statement (binary_operator (binary_operator (string_'"') string_'"' (identifier_result) identifier_result )binary_operator (string_'"') string_'"' )binary_operator )return_statement )block )function_definition )module
Escape a string for use in Gerrit commands. :arg str string: The string to escape. :returns: The string with necessary escapes and surrounding double quotes so that it can be passed to any of the Gerrit commands that require double-quoted strings.
(module (function_definition (function_name__request_process_json_standard) function_name__request_process_json_standard (parameters (identifier_self) identifier_self (identifier_response_data) identifier_response_data )parameters (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (call (attribute (identifier_response_data) identifier_response_data (identifier_get) identifier_get )attribute (argument_list (string_'data') string_'data' (dictionary )dictionary )argument_list )call (identifier_get) identifier_get )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_request_entity) identifier_request_entity )attribute (list )list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_status) identifier_status (call (attribute (identifier_response_data) identifier_response_data (identifier_get) identifier_get )attribute (argument_list (string_'status') string_'status' (string_'Failure') string_'Failure' )argument_list )call )assignment )expression_statement (return_statement (expression_list (identifier_data) identifier_data (identifier_status) identifier_status )expression_list )return_statement )block )function_definition )module
Handle JSON response This should be the most common response from the ThreatConnect API. Return: (string): The response data (string): The response status
(module (function_definition (function_name_any_contains_any) function_name_any_contains_any (parameters (identifier_strings) identifier_strings (identifier_candidates) identifier_candidates )parameters (block (for_statement (identifier_string) identifier_string (identifier_strings) identifier_strings (block (for_statement (identifier_c) identifier_c (identifier_candidates) identifier_candidates (block (if_statement (comparison_operator (identifier_c) identifier_c (identifier_string) identifier_string )comparison_operator (block (return_statement (True) True )return_statement )block )if_statement )block )for_statement )block )for_statement )block )function_definition )module
Whether any of the strings contains any of the candidates.
(module (function_definition (function_name_media_type_str) function_name_media_type_str (parameters (identifier_mediatype) identifier_mediatype )parameters (block (if_statement (comparison_operator (identifier_mediatype) identifier_mediatype (attribute (identifier_const) identifier_const (identifier_MEDIA_TYPE_UNKNOWN) identifier_MEDIA_TYPE_UNKNOWN )attribute )comparison_operator (block (return_statement (string_'Unknown') string_'Unknown' )return_statement )block )if_statement (if_statement (comparison_operator (identifier_mediatype) identifier_mediatype (attribute (identifier_const) identifier_const (identifier_MEDIA_TYPE_VIDEO) identifier_MEDIA_TYPE_VIDEO )attribute )comparison_operator (block (return_statement (string_'Video') string_'Video' )return_statement )block )if_statement (if_statement (comparison_operator (identifier_mediatype) identifier_mediatype (attribute (identifier_const) identifier_const (identifier_MEDIA_TYPE_MUSIC) identifier_MEDIA_TYPE_MUSIC )attribute )comparison_operator (block (return_statement (string_'Music') string_'Music' )return_statement )block )if_statement (if_statement (comparison_operator (identifier_mediatype) identifier_mediatype (attribute (identifier_const) identifier_const (identifier_MEDIA_TYPE_TV) identifier_MEDIA_TYPE_TV )attribute )comparison_operator (block (return_statement (string_'TV') string_'TV' )return_statement )block )if_statement (return_statement (string_'Unsupported') string_'Unsupported' )return_statement )block )function_definition )module
Convert internal API media type to string.
(module (function_definition (function_name__set_comment) function_name__set_comment (parameters (identifier_self) identifier_self (identifier_section) identifier_section (identifier_comment) identifier_comment (default_parameter (identifier_key) identifier_key (None) None )default_parameter )parameters (block (if_statement (comparison_operator (string_'\n') string_'\n' (identifier_comment) identifier_comment )comparison_operator (block (expression_statement (assignment (identifier_comment) identifier_comment (string_'\n comment = ') string_'\n comment = ' )assignment )expression_statement )block )if_statement (if_statement (identifier_key) identifier_key (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__comments) identifier__comments )attribute (tuple (identifier_section) identifier_section (identifier_key) identifier_key )tuple )subscript (identifier_comment) identifier_comment )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__comments) identifier__comments )attribute (identifier_section) identifier_section )subscript (identifier_comment) identifier_comment )assignment )expression_statement )block )else_clause )if_statement )block )function_definition )module
Set a comment for section or key :param str section: Section to add comment to :param str comment: Comment to add :param str key: Key to add comment to
(module (function_definition (function_name_get_canonical_headers) function_name_get_canonical_headers (parameters (identifier_headers) identifier_headers )parameters (block (if_statement (comparison_operator (identifier_headers) identifier_headers (None) None )comparison_operator (block (expression_statement (assignment (identifier_headers) identifier_headers (list )list )assignment )expression_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_headers) identifier_headers (identifier_dict) identifier_dict )argument_list )call (block (expression_statement (assignment (identifier_headers) identifier_headers (call (identifier_list) identifier_list (argument_list (call (attribute (identifier_headers) identifier_headers (identifier_items) identifier_items )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement (if_statement (not_operator (identifier_headers) identifier_headers )not_operator (block (return_statement (expression_list (list )list (list )list )expression_list )return_statement )block )if_statement (expression_statement (assignment (identifier_normalized) identifier_normalized (call (attribute (identifier_collections) identifier_collections (identifier_defaultdict) identifier_defaultdict )attribute (argument_list (identifier_list) identifier_list )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_key) identifier_key (identifier_val) identifier_val )pattern_list (identifier_headers) identifier_headers (block (expression_statement (assignment (identifier_key) identifier_key (call (attribute (call (attribute (identifier_key) identifier_key (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_val) identifier_val (call (attribute (identifier_MULTIPLE_SPACES) identifier_MULTIPLE_SPACES (identifier_sub) identifier_sub )attribute (argument_list (string_" ") string_" " (call (attribute (identifier_val) identifier_val (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (subscript (identifier_normalized) identifier_normalized (identifier_key) identifier_key )subscript (identifier_append) identifier_append )attribute (argument_list (identifier_val) identifier_val )argument_list )call )expression_statement )block )for_statement (expression_statement (assignment (identifier_ordered_headers) identifier_ordered_headers (call (identifier_sorted) identifier_sorted (generator_expression (tuple (identifier_key) identifier_key (call (attribute (string_",") string_"," (identifier_join) identifier_join )attribute (argument_list (identifier_val) identifier_val )argument_list )call )tuple (for_in_clause (pattern_list (identifier_key) identifier_key (identifier_val) identifier_val )pattern_list (call (attribute (identifier_normalized) identifier_normalized (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause )generator_expression )call )assignment )expression_statement (expression_statement (assignment (identifier_canonical_headers) identifier_canonical_headers (list_comprehension (call (attribute (string_"{}:{}") string_"{}:{}" (identifier_format) identifier_format )attribute (argument_list (list_splat (identifier_item) identifier_item )list_splat )argument_list )call (for_in_clause (identifier_item) identifier_item (identifier_ordered_headers) identifier_ordered_headers )for_in_clause )list_comprehension )assignment )expression_statement (return_statement (expression_list (identifier_canonical_headers) identifier_canonical_headers (identifier_ordered_headers) identifier_ordered_headers )expression_list )return_statement )block )function_definition )module
Canonicalize headers for signing. See: https://cloud.google.com/storage/docs/access-control/signed-urls#about-canonical-extension-headers :type headers: Union[dict|List(Tuple(str,str))] :param headers: (Optional) Additional HTTP headers to be included as part of the signed URLs. See: https://cloud.google.com/storage/docs/xml-api/reference-headers Requests using the signed URL *must* pass the specified header (name and value) with each request for the URL. :rtype: str :returns: List of headers, normalized / sortted per the URL refernced above.
(module (function_definition (function_name_write_bytes) function_name_write_bytes (parameters (identifier_out_data) identifier_out_data (default_parameter (identifier_encoding) identifier_encoding (string_"ascii") string_"ascii" )default_parameter )parameters (block (if_statement (comparison_operator (subscript (attribute (identifier_sys) identifier_sys (identifier_version_info) identifier_version_info )attribute (integer_0) integer_0 )subscript (integer_3) integer_3 )comparison_operator (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_out_data) identifier_out_data (call (identifier_type) identifier_type (argument_list (string_"") string_"" )argument_list )call )argument_list )call (block (if_statement (comparison_operator (identifier_encoding) identifier_encoding (string_"utf-8") string_"utf-8" )comparison_operator (block (return_statement (call (attribute (identifier_out_data) identifier_out_data (identifier_encode) identifier_encode )attribute (argument_list (string_"utf-8") string_"utf-8" )argument_list )call )return_statement )block (else_clause (block (return_statement (call (attribute (identifier_out_data) identifier_out_data (identifier_encode) identifier_encode )attribute (argument_list (string_"ascii") string_"ascii" (string_"ignore") string_"ignore" )argument_list )call )return_statement )block )else_clause )if_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_out_data) identifier_out_data (call (identifier_type) identifier_type (argument_list (string_b"") string_b"" )argument_list )call )argument_list )call (block (return_statement (identifier_out_data) identifier_out_data )return_statement )block )elif_clause )if_statement )block (else_clause (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_out_data) identifier_out_data (call (identifier_type) identifier_type (argument_list (string_"") string_"" )argument_list )call )argument_list )call (block (if_statement (comparison_operator (identifier_encoding) identifier_encoding (string_"utf-8") string_"utf-8" )comparison_operator (block (return_statement (call (attribute (identifier_out_data) identifier_out_data (identifier_encode) identifier_encode )attribute (argument_list (string_"utf-8") string_"utf-8" )argument_list )call )return_statement )block (else_clause (block (return_statement (call (attribute (identifier_out_data) identifier_out_data (identifier_encode) identifier_encode )attribute (argument_list (string_"ascii") string_"ascii" (string_"ignore") string_"ignore" )argument_list )call )return_statement )block )else_clause )if_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_out_data) identifier_out_data (call (identifier_type) identifier_type (argument_list (call (identifier_str) identifier_str (argument_list (string_"") string_"" )argument_list )call )argument_list )call )argument_list )call (block (return_statement (identifier_out_data) identifier_out_data )return_statement )block )elif_clause )if_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (string_"Invalid value for out_data neither unicode nor byte string: {}") string_"Invalid value for out_data neither unicode nor byte string: {}" (identifier_format) identifier_format )attribute (argument_list (identifier_out_data) identifier_out_data )argument_list )call )assignment )expression_statement (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (identifier_msg) identifier_msg )argument_list )call )raise_statement )block )function_definition )module
Write Python2 and Python3 compatible byte stream.
(module (function_definition (function_name_materialize) function_name_materialize (parameters (identifier_datasets) identifier_datasets )parameters (block (import_from_statement (relative_import (import_prefix )import_prefix )relative_import (dotted_name (identifier_GMQLDataset) identifier_GMQLDataset )dotted_name )import_from_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_datasets) identifier_datasets (identifier_dict) identifier_dict )argument_list )call (block (expression_statement (assignment (identifier_result) identifier_result (call (identifier_dict) identifier_dict (argument_list )argument_list )call )assignment )expression_statement (for_statement (identifier_output_path) identifier_output_path (call (attribute (identifier_datasets) identifier_datasets (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call (block (expression_statement (assignment (identifier_dataset) identifier_dataset (subscript (identifier_datasets) identifier_datasets (identifier_output_path) identifier_output_path )subscript )assignment )expression_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_dataset) identifier_dataset (attribute (identifier_GMQLDataset) identifier_GMQLDataset (identifier_GMQLDataset) identifier_GMQLDataset )attribute )argument_list )call )not_operator (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (call (attribute (concatenated_string (string_"The values of the dictionary must be GMQLDataset.") string_"The values of the dictionary must be GMQLDataset." (string_" {} was given") string_" {} was given" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (call (identifier_type) identifier_type (argument_list (identifier_dataset) identifier_dataset )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_gframe) identifier_gframe (call (attribute (identifier_dataset) identifier_dataset (identifier_materialize) identifier_materialize )attribute (argument_list (identifier_output_path) identifier_output_path )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_result) identifier_result (identifier_output_path) identifier_output_path )subscript (identifier_gframe) identifier_gframe )assignment )expression_statement )block )for_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_datasets) identifier_datasets (identifier_list) identifier_list )argument_list )call (block (expression_statement (assignment (identifier_result) identifier_result (list )list )assignment )expression_statement (for_statement (identifier_dataset) identifier_dataset (identifier_datasets) identifier_datasets (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_dataset) identifier_dataset (attribute (identifier_GMQLDataset) identifier_GMQLDataset (identifier_GMQLDataset) identifier_GMQLDataset )attribute )argument_list )call )not_operator (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (call (attribute (concatenated_string (string_"The values of the list must be GMQLDataset.") string_"The values of the list must be GMQLDataset." (string_" {} was given") string_" {} was given" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (call (identifier_type) identifier_type (argument_list (identifier_dataset) identifier_dataset )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_gframe) identifier_gframe (call (attribute (identifier_dataset) identifier_dataset (identifier_materialize) identifier_materialize )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_result) identifier_result (identifier_append) identifier_append )attribute (argument_list (identifier_gframe) identifier_gframe )argument_list )call )expression_statement )block )for_statement )block )elif_clause (else_clause (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (call (attribute (concatenated_string (string_"The input must be a dictionary of a list. ") string_"The input must be a dictionary of a list. " (string_"{} was given") string_"{} was given" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (call (identifier_type) identifier_type (argument_list (identifier_datasets) identifier_datasets )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )else_clause )if_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Multiple materializations. Enables the user to specify a set of GMQLDataset to be materialized. The engine will perform all the materializations at the same time, if an output path is provided, while will perform each operation separately if the output_path is not specified. :param datasets: it can be a list of GMQLDataset or a dictionary {'output_path' : GMQLDataset} :return: a list of GDataframe or a dictionary {'output_path' : GDataframe}
(module (function_definition (function_name__has_method) function_name__has_method (parameters (identifier_arg) identifier_arg (identifier_method) identifier_method )parameters (block (return_statement (boolean_operator (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_arg) identifier_arg (identifier_method) identifier_method )argument_list )call (call (identifier_callable) identifier_callable (argument_list (call (identifier_getattr) identifier_getattr (argument_list (identifier_arg) identifier_arg (identifier_method) identifier_method )argument_list )call )argument_list )call )boolean_operator )return_statement )block )function_definition )module
Returns true if the given object has a method with the given name. :param arg: the object :param method: the method name :type method: string :rtype: bool
(module (function_definition (function_name_covariance) function_name_covariance (parameters (identifier_self) identifier_self (identifier_param_1) identifier_param_1 (identifier_param_2) identifier_param_2 )parameters (block (expression_statement (assignment (identifier_param_1_number) identifier_param_1_number (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_model) identifier_model )attribute (identifier_params) identifier_params )attribute (identifier_index) identifier_index )attribute (argument_list (identifier_param_1) identifier_param_1 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_param_2_number) identifier_param_2_number (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_model) identifier_model )attribute (identifier_params) identifier_params )attribute (identifier_index) identifier_index )attribute (argument_list (identifier_param_2) identifier_param_2 )argument_list )call )assignment )expression_statement (return_statement (subscript (attribute (identifier_self) identifier_self (identifier_covariance_matrix) identifier_covariance_matrix )attribute (identifier_param_1_number) identifier_param_1_number (identifier_param_2_number) identifier_param_2_number )subscript )return_statement )block )function_definition )module
Return the covariance between param_1 and param_2. :param param_1: ``Parameter`` Instance. :param param_2: ``Parameter`` Instance. :return: Covariance of the two params.
(module (function_definition (function_name_non_existing_path) function_name_non_existing_path (parameters (identifier_path_) identifier_path_ (default_parameter (identifier_dpath) identifier_dpath (None) None )default_parameter (default_parameter (identifier_offset) identifier_offset (integer_0) integer_0 )default_parameter (default_parameter (identifier_suffix) identifier_suffix (None) None )default_parameter (default_parameter (identifier_force_fmt) identifier_force_fmt (False) False )default_parameter )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (import_statement (aliased_import (dotted_name (identifier_utool) identifier_utool )dotted_name (identifier_ut) identifier_ut )aliased_import )import_statement (import_from_statement (dotted_name (identifier_os) identifier_os (identifier_path) identifier_path )dotted_name (dotted_name (identifier_basename) identifier_basename )dotted_name (dotted_name (identifier_dirname) identifier_dirname )dotted_name )import_from_statement (if_statement (comparison_operator (identifier_dpath) identifier_dpath (None) None )comparison_operator (block (expression_statement (assignment (identifier_dpath) identifier_dpath (call (identifier_dirname) identifier_dirname (argument_list (identifier_path_) identifier_path_ )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_base_fmtstr) identifier_base_fmtstr (call (identifier_basename) identifier_basename (argument_list (identifier_path_) identifier_path_ )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_suffix) identifier_suffix (None) None )comparison_operator (block (expression_statement (assignment (identifier_base_fmtstr) identifier_base_fmtstr (call (attribute (identifier_ut) identifier_ut (identifier_augpath) identifier_augpath )attribute (argument_list (identifier_base_fmtstr) identifier_base_fmtstr (identifier_suffix) identifier_suffix )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (string_'%') string_'%' (identifier_base_fmtstr) identifier_base_fmtstr )comparison_operator (block (if_statement (not_operator (identifier_force_fmt) identifier_force_fmt )not_operator (block (expression_statement (assignment (identifier_first_choice) identifier_first_choice (call (identifier_join) identifier_join (argument_list (identifier_dpath) identifier_dpath (identifier_base_fmtstr) identifier_base_fmtstr )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (identifier_exists) identifier_exists (argument_list (identifier_first_choice) identifier_first_choice )argument_list )call )not_operator (block (return_statement (identifier_first_choice) identifier_first_choice )return_statement )block )if_statement )block )if_statement (expression_statement (assignment (identifier_base_fmtstr) identifier_base_fmtstr (call (attribute (identifier_ut) identifier_ut (identifier_augpath) identifier_augpath )attribute (argument_list (identifier_base_fmtstr) identifier_base_fmtstr (string_'%d') string_'%d' )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_dname_list) identifier_dname_list (call (attribute (identifier_ut) identifier_ut (identifier_glob) identifier_glob )attribute (argument_list (identifier_dpath) identifier_dpath (keyword_argument (identifier_pattern) identifier_pattern (string_'*') string_'*' )keyword_argument (keyword_argument (identifier_recursive) identifier_recursive (False) False )keyword_argument (keyword_argument (identifier_with_files) identifier_with_files (True) True )keyword_argument (keyword_argument (identifier_with_dirs) identifier_with_dirs (True) True )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_conflict_set) identifier_conflict_set (call (identifier_set) identifier_set (generator_expression (call (identifier_basename) identifier_basename (argument_list (identifier_dname) identifier_dname )argument_list )call (for_in_clause (identifier_dname) identifier_dname (identifier_dname_list) identifier_dname_list )for_in_clause )generator_expression )call )assignment )expression_statement (expression_statement (assignment (identifier_newname) identifier_newname (call (attribute (identifier_ut) identifier_ut (identifier_get_nonconflicting_string) identifier_get_nonconflicting_string )attribute (argument_list (identifier_base_fmtstr) identifier_base_fmtstr (identifier_conflict_set) identifier_conflict_set (keyword_argument (identifier_offset) identifier_offset (identifier_offset) identifier_offset )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_newpath) identifier_newpath (call (identifier_join) identifier_join (argument_list (identifier_dpath) identifier_dpath (identifier_newname) identifier_newname )argument_list )call )assignment )expression_statement (return_statement (identifier_newpath) identifier_newpath )return_statement )block )function_definition )module
r""" Searches for and finds a path garuenteed to not exist. Args: path_ (str): path string. If may include a "%" formatstr. dpath (str): directory path(default = None) offset (int): (default = 0) suffix (None): (default = None) Returns: str: path_ - path string CommandLine: python -m utool.util_path non_existing_path Example: >>> # ENABLE_DOCTEST >>> from utool.util_path import * # NOQA >>> import utool as ut >>> base = ut.ensure_app_resource_dir('utool', 'tmp') >>> ut.touch(base + '/tmp.txt') >>> ut.touch(base + '/tmp0.txt') >>> ut.delete(base + '/tmp1.txt') >>> path_ = base + '/tmp.txt' >>> newpath = ut.non_existing_path(path_) >>> assert basename(newpath) == 'tmp1.txt' Example: >>> # ENABLE_DOCTEST >>> from utool.util_path import * # NOQA >>> import utool as ut >>> base = ut.ensure_app_resource_dir('utool', 'tmp') >>> ut.ensurepath(base + '/dir_old') >>> ut.ensurepath(base + '/dir_old0') >>> ut.ensurepath(base + '/dir_old1') >>> ut.delete(base + '/dir_old2') >>> path_ = base + '/dir' >>> suffix = '_old' >>> newpath = ut.non_existing_path(path_, suffix=suffix) >>> ut.assert_eq(basename(newpath), 'dir_old2')
(module (function_definition (function_name_libvlc_media_list_player_event_manager) function_name_libvlc_media_list_player_event_manager (parameters (identifier_p_mlp) identifier_p_mlp )parameters (block (expression_statement (assignment (identifier_f) identifier_f (boolean_operator (call (attribute (identifier__Cfunctions) identifier__Cfunctions (identifier_get) identifier_get )attribute (argument_list (string_'libvlc_media_list_player_event_manager') string_'libvlc_media_list_player_event_manager' (None) None )argument_list )call (line_continuation_\) line_continuation_\ (call (identifier__Cfunction) identifier__Cfunction (argument_list (string_'libvlc_media_list_player_event_manager') string_'libvlc_media_list_player_event_manager' (tuple (tuple (integer_1) integer_1 )tuple )tuple (call (identifier_class_result) identifier_class_result (argument_list (identifier_EventManager) identifier_EventManager )argument_list )call (attribute (identifier_ctypes) identifier_ctypes (identifier_c_void_p) identifier_c_void_p )attribute (identifier_MediaListPlayer) identifier_MediaListPlayer )argument_list )call )boolean_operator )assignment )expression_statement (return_statement (call (identifier_f) identifier_f (argument_list (identifier_p_mlp) identifier_p_mlp )argument_list )call )return_statement )block )function_definition )module
Return the event manager of this media_list_player. @param p_mlp: media list player instance. @return: the event manager.
(module (function_definition (function_name__expand_place_ids) function_name__expand_place_ids (parameters (identifier_self) identifier_self (identifier_terms) identifier_terms )parameters (block (expression_statement (assignment (identifier_place_vids) identifier_place_vids (list )list )assignment )expression_statement (expression_statement (assignment (identifier_first_type) identifier_first_type (None) None )assignment )expression_statement (for_statement (identifier_result) identifier_result (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_backend) identifier_backend )attribute (identifier_identifier_index) identifier_identifier_index )attribute (identifier_search) identifier_search )attribute (argument_list (identifier_terms) identifier_terms )argument_list )call (block (if_statement (not_operator (identifier_first_type) identifier_first_type )not_operator (block (expression_statement (assignment (identifier_first_type) identifier_first_type (attribute (identifier_result) identifier_result (identifier_type) identifier_type )attribute )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (attribute (identifier_result) identifier_result (identifier_type) identifier_type )attribute (identifier_first_type) identifier_first_type )comparison_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (call (attribute (identifier_place_vids) identifier_place_vids (identifier_append) identifier_append )attribute (argument_list (attribute (identifier_result) identifier_result (identifier_vid) identifier_vid )attribute )argument_list )call )expression_statement )block )for_statement (if_statement (identifier_place_vids) identifier_place_vids (block (expression_statement (assignment (identifier_all_set) identifier_all_set (call (identifier_set) identifier_set (argument_list (call (attribute (attribute (identifier_itertools) identifier_itertools (identifier_chain) identifier_chain )attribute (identifier_from_iterable) identifier_from_iterable )attribute (generator_expression (call (identifier_iallval) identifier_iallval (argument_list (call (attribute (identifier_GVid) identifier_GVid (identifier_parse) identifier_parse )attribute (argument_list (identifier_x) identifier_x )argument_list )call )argument_list )call (for_in_clause (identifier_x) identifier_x (identifier_place_vids) identifier_place_vids )for_in_clause )generator_expression )call )argument_list )call )assignment )expression_statement (expression_statement (augmented_assignment (identifier_place_vids) identifier_place_vids (call (identifier_list) identifier_list (generator_expression (call (identifier_str) identifier_str (argument_list (identifier_x) identifier_x )argument_list )call (for_in_clause (identifier_x) identifier_x (identifier_all_set) identifier_all_set )for_in_clause )generator_expression )call )augmented_assignment )expression_statement (return_statement (identifier_place_vids) identifier_place_vids )return_statement )block (else_clause (block (return_statement (identifier_terms) identifier_terms )return_statement )block )else_clause )if_statement )block )function_definition )module
Lookups all of the place identifiers to get gvids Args: terms (str or unicode): terms to lookup Returns: str or list: given terms if no identifiers found, otherwise list of identifiers.
(module (function_definition (function_name_extract_arguments) function_name_extract_arguments (parameters (identifier_args) identifier_args (identifier_defaults) identifier_defaults )parameters (block (expression_statement (assignment (identifier_out_dict) identifier_out_dict (call (identifier_convert_option_dict_to_dict) identifier_convert_option_dict_to_dict (argument_list (identifier_defaults) identifier_defaults )argument_list )call )assignment )expression_statement (for_statement (identifier_key) identifier_key (call (attribute (identifier_defaults) identifier_defaults (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call (block (expression_statement (assignment (identifier_mapped_val) identifier_mapped_val (call (attribute (identifier_args) identifier_args (identifier_get) identifier_get )attribute (argument_list (identifier_key) identifier_key (None) None )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_mapped_val) identifier_mapped_val (None) None )comparison_operator (block (pass_statement )pass_statement )block (else_clause (block (expression_statement (assignment (subscript (identifier_out_dict) identifier_out_dict (identifier_key) identifier_key )subscript (identifier_mapped_val) identifier_mapped_val )assignment )expression_statement )block )else_clause )if_statement )block )for_statement (return_statement (identifier_out_dict) identifier_out_dict )return_statement )block )function_definition )module
Extract a set of arguments from a large dictionary Parameters ---------- args : dict Dictionary with the arguments values to use defaults : dict Dictionary with all the argument to extract, and default values for each Returns ------- out_dict : dict A dictionary with only the extracted arguments
(module (function_definition (function_name_restore_image_options) function_name_restore_image_options (parameters (identifier_cli) identifier_cli (identifier_image) identifier_image (identifier_options) identifier_options )parameters (block (expression_statement (assignment (identifier_dockerfile) identifier_dockerfile (call (attribute (identifier_io) identifier_io (identifier_StringIO) identifier_StringIO )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_dockerfile) identifier_dockerfile (identifier_write) identifier_write )attribute (argument_list (call (attribute (string_u'FROM {image}\nCMD {cmd}') string_u'FROM {image}\nCMD {cmd}' (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_image) identifier_image (identifier_image) identifier_image )keyword_argument (keyword_argument (identifier_cmd) identifier_cmd (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (subscript (identifier_options) identifier_options (string_'cmd') string_'cmd' )subscript )argument_list )call )keyword_argument )argument_list )call )argument_list )call )expression_statement (if_statement (subscript (identifier_options) identifier_options (string_'entrypoint') string_'entrypoint' )subscript (block (expression_statement (call (attribute (identifier_dockerfile) identifier_dockerfile (identifier_write) identifier_write )attribute (argument_list (call (attribute (string_'\nENTRYPOINT {}') string_'\nENTRYPOINT {}' (identifier_format) identifier_format )attribute (argument_list (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (subscript (identifier_options) identifier_options (string_'entrypoint') string_'entrypoint' )subscript )argument_list )call )argument_list )call )argument_list )call )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_cli) identifier_cli (identifier_build) identifier_build )attribute (argument_list (keyword_argument (identifier_tag) identifier_tag (identifier_image) identifier_image )keyword_argument (keyword_argument (identifier_fileobj) identifier_fileobj (identifier_dockerfile) identifier_dockerfile )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
Restores CMD and ENTRYPOINT values of the image This is needed because we force the overwrite of ENTRYPOINT and CMD in the `run_code_in_container` function, to be able to run the code in the container, through /bin/bash.
(module (function_definition (function_name_fetch_defense_data) function_name_fetch_defense_data (parameters (identifier_self) identifier_self )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier_defenses_data_initialized) identifier_defenses_data_initialized )attribute (block (return_statement )return_statement )block )if_statement (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_info) identifier_info )attribute (argument_list (string_'Fetching defense data from datastore') string_'Fetching defense data from datastore' )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_submissions) identifier_submissions )attribute (identifier_init_from_datastore) identifier_init_from_datastore )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_dataset_batches) identifier_dataset_batches )attribute (identifier_init_from_datastore) identifier_init_from_datastore )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_adv_batches) identifier_adv_batches )attribute (identifier_init_from_datastore) identifier_init_from_datastore )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_read_dataset_metadata) identifier_read_dataset_metadata )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_defenses_data_initialized) identifier_defenses_data_initialized )attribute (True) True )assignment )expression_statement )block )function_definition )module
Lazy initialization of data necessary to execute defenses.
(module (function_definition (function_name__pad) function_name__pad (parameters (identifier_self) identifier_self (identifier_text) identifier_text )parameters (block (expression_statement (assignment (identifier_top_bottom) identifier_top_bottom (binary_operator (parenthesized_expression (binary_operator (string_"\n") string_"\n" (attribute (identifier_self) identifier_self (identifier__padding) identifier__padding )attribute )binary_operator )parenthesized_expression (string_" ") string_" " )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_right_left) identifier_right_left (binary_operator (binary_operator (string_" ") string_" " (attribute (identifier_self) identifier_self (identifier__padding) identifier__padding )attribute )binary_operator (attribute (identifier_self) identifier_self (identifier_PAD_WIDTH) identifier_PAD_WIDTH )attribute )binary_operator )assignment )expression_statement (return_statement (binary_operator (binary_operator (binary_operator (binary_operator (identifier_top_bottom) identifier_top_bottom (identifier_right_left) identifier_right_left )binary_operator (identifier_text) identifier_text )binary_operator (identifier_right_left) identifier_right_left )binary_operator (identifier_top_bottom) identifier_top_bottom )binary_operator )return_statement )block )function_definition )module
Pad the text.
(module (function_definition (function_name_rule_match) function_name_rule_match (parameters (identifier_component) identifier_component (identifier_cmd) identifier_cmd )parameters (block (if_statement (comparison_operator (identifier_component) identifier_component (identifier_cmd) identifier_cmd )comparison_operator (block (return_statement (True) True )return_statement )block )if_statement (expression_statement (assignment (identifier_expanded) identifier_expanded (call (identifier_rule_expand) identifier_rule_expand (argument_list (identifier_component) identifier_component (identifier_cmd) identifier_cmd )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_cmd) identifier_cmd (identifier_expanded) identifier_expanded )comparison_operator (block (return_statement (True) True )return_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
see if one rule component matches
(module (function_definition (function_name_generic_path_not_found) function_name_generic_path_not_found (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (block (expression_statement (assignment (identifier_exception_tuple) identifier_exception_tuple (attribute (identifier_LambdaErrorResponses) identifier_LambdaErrorResponses (identifier_PathNotFoundException) identifier_PathNotFoundException )attribute )assignment )expression_statement (return_statement (call (attribute (identifier_BaseLocalService) identifier_BaseLocalService (identifier_service_response) identifier_service_response )attribute (argument_list (call (attribute (identifier_LambdaErrorResponses) identifier_LambdaErrorResponses (identifier__construct_error_response_body) identifier__construct_error_response_body )attribute (argument_list (attribute (identifier_LambdaErrorResponses) identifier_LambdaErrorResponses (identifier_LOCAL_SERVICE_ERROR) identifier_LOCAL_SERVICE_ERROR )attribute (string_"PathNotFoundException") string_"PathNotFoundException" )argument_list )call (call (attribute (identifier_LambdaErrorResponses) identifier_LambdaErrorResponses (identifier__construct_headers) identifier__construct_headers )attribute (argument_list (subscript (identifier_exception_tuple) identifier_exception_tuple (integer_0) integer_0 )subscript )argument_list )call (subscript (identifier_exception_tuple) identifier_exception_tuple (integer_1) integer_1 )subscript )argument_list )call )return_statement )block )function_definition )module
Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representing the GenericPathNotFound Error
(module (function_definition (function_name_build) function_name_build (parameters (identifier_self) identifier_self )parameters (block (if_statement (boolean_operator (comparison_operator (call (identifier_len) identifier_len (argument_list (attribute (identifier_self) identifier_self (identifier_dutinformation) identifier_dutinformation )attribute )argument_list )call (integer_0) integer_0 )comparison_operator (parenthesized_expression (comparison_operator (attribute (call (attribute (attribute (identifier_self) identifier_self (identifier_dutinformation) identifier_dutinformation )attribute (identifier_get) identifier_get )attribute (argument_list (integer_0) integer_0 )argument_list )call (identifier_build) identifier_build )attribute (None) None )comparison_operator )parenthesized_expression )boolean_operator (block (return_statement (attribute (attribute (call (attribute (attribute (identifier_self) identifier_self (identifier_dutinformation) identifier_dutinformation )attribute (identifier_get) identifier_get )attribute (argument_list (integer_0) integer_0 )argument_list )call (identifier_build) identifier_build )attribute (identifier_name) identifier_name )attribute )return_statement )block )if_statement (return_statement (None) None )return_statement )block )function_definition )module
get build name. :return: build name. None if not found
(module (function_definition (function_name_epoch_cb) function_name_epoch_cb (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_metrics) identifier_metrics (dictionary )dictionary )assignment )expression_statement (expression_statement (assignment (subscript (identifier_metrics) identifier_metrics (string_'elapsed') string_'elapsed' )subscript (call (attribute (identifier_self) identifier_self (identifier_elapsed) identifier_elapsed )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_now) identifier_now (call (attribute (attribute (identifier_datetime) identifier_datetime (identifier_datetime) identifier_datetime )attribute (identifier_now) identifier_now )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_metrics) identifier_metrics (string_'epoch_time') string_'epoch_time' )subscript (binary_operator (identifier_now) identifier_now (attribute (identifier_self) identifier_self (identifier_last_epoch_time) identifier_last_epoch_time )attribute )binary_operator )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_append_metrics) identifier_append_metrics )attribute (argument_list (identifier_metrics) identifier_metrics (string_'epoch') string_'epoch' )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_last_epoch_time) identifier_last_epoch_time )attribute (identifier_now) identifier_now )assignment )expression_statement )block )function_definition )module
Callback function after each epoch. Now it records each epoch time and append it to epoch dataframe.
(module (function_definition (function_name_get_js) function_name_get_js (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_js_file) identifier_js_file (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_theme_dir) identifier_theme_dir )attribute (string_'js') string_'js' (string_'slides.js') string_'slides.js' )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_js_file) identifier_js_file )argument_list )call )not_operator (block (expression_statement (assignment (identifier_js_file) identifier_js_file (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_THEMES_DIR) identifier_THEMES_DIR (string_'default') string_'default' (string_'js') string_'js' (string_'slides.js') string_'slides.js' )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_js_file) identifier_js_file )argument_list )call )not_operator (block (raise_statement (call (identifier_IOError) identifier_IOError (argument_list (string_u"Cannot find slides.js in default theme") string_u"Cannot find slides.js in default theme" )argument_list )call )raise_statement )block )if_statement )block )if_statement (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_codecs) identifier_codecs (identifier_open) identifier_open )attribute (argument_list (identifier_js_file) identifier_js_file (keyword_argument (identifier_encoding) identifier_encoding (attribute (identifier_self) identifier_self (identifier_encoding) identifier_encoding )attribute )keyword_argument )argument_list )call (as_pattern_target (identifier_js_file_obj) identifier_js_file_obj )as_pattern_target )as_pattern )with_item )with_clause (block (return_statement (dictionary (pair (string_'path_url') string_'path_url' (call (attribute (identifier_utils) identifier_utils (identifier_get_path_url) identifier_get_path_url )attribute (argument_list (identifier_js_file) identifier_js_file (attribute (identifier_self) identifier_self (identifier_relative) identifier_relative )attribute )argument_list )call )pair (pair (string_'contents') string_'contents' (call (attribute (identifier_js_file_obj) identifier_js_file_obj (identifier_read) identifier_read )attribute (argument_list )argument_list )call )pair )dictionary )return_statement )block )with_statement )block )function_definition )module
Fetches and returns javascript file path or contents, depending if we want a standalone presentation or not.
(module (function_definition (function_name__get_index_class_name) function_name__get_index_class_name (parameters (identifier_self) identifier_self (identifier_index_cls) identifier_index_cls )parameters (block (expression_statement (assignment (identifier_cls_name) identifier_cls_name (attribute (identifier_index_cls) identifier_index_cls (identifier___name__) identifier___name__ )attribute )assignment )expression_statement (expression_statement (assignment (identifier_aliases) identifier_aliases (attribute (attribute (identifier_self) identifier_self (identifier_Meta) identifier_Meta )attribute (identifier_index_aliases) identifier_index_aliases )attribute )assignment )expression_statement (return_statement (call (attribute (identifier_aliases) identifier_aliases (identifier_get) identifier_get )attribute (argument_list (identifier_cls_name) identifier_cls_name (subscript (call (attribute (identifier_cls_name) identifier_cls_name (identifier_split) identifier_split )attribute (argument_list (string_'.') string_'.' )argument_list )call (unary_operator (integer_1) integer_1 )unary_operator )subscript )argument_list )call )return_statement )block )function_definition )module
Converts in index model class to a name suitable for use as a field name prefix. A user may optionally specify custom aliases via an 'index_aliases' attribute on the Meta class
(module (function_definition (function_name__urlnorm) function_name__urlnorm (parameters (identifier_cls) identifier_cls (identifier_uri) identifier_uri )parameters (block (expression_statement (assignment (tuple_pattern (identifier_scheme) identifier_scheme (identifier_authority) identifier_authority (identifier_path) identifier_path (identifier_query) identifier_query (identifier_fragment) identifier_fragment )tuple_pattern (call (identifier_parse_uri) identifier_parse_uri (argument_list (identifier_uri) identifier_uri )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (not_operator (identifier_scheme) identifier_scheme )not_operator (not_operator (identifier_authority) identifier_authority )not_operator )boolean_operator (block (raise_statement (call (identifier_Exception) identifier_Exception (argument_list (binary_operator (string_"Only absolute URIs are allowed. uri = %s") string_"Only absolute URIs are allowed. uri = %s" (identifier_uri) identifier_uri )binary_operator )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_scheme) identifier_scheme (call (attribute (identifier_scheme) identifier_scheme (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_authority) identifier_authority (call (attribute (identifier_authority) identifier_authority (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_path) identifier_path )not_operator (block (expression_statement (assignment (identifier_path) identifier_path (string_"/") string_"/" )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_request_uri) identifier_request_uri (boolean_operator (boolean_operator (identifier_query) identifier_query (call (attribute (string_"?") string_"?" (identifier_join) identifier_join )attribute (argument_list (list (identifier_path) identifier_path (identifier_query) identifier_query )list )argument_list )call )boolean_operator (identifier_path) identifier_path )boolean_operator )assignment )expression_statement (expression_statement (assignment (identifier_defrag_uri) identifier_defrag_uri (binary_operator (binary_operator (binary_operator (identifier_scheme) identifier_scheme (string_"://") string_"://" )binary_operator (identifier_authority) identifier_authority )binary_operator (identifier_request_uri) identifier_request_uri )binary_operator )assignment )expression_statement (return_statement (identifier_defrag_uri) identifier_defrag_uri )return_statement )block )function_definition )module
Normalize the URL to create a safe key for the cache
(module (function_definition (function_name_get_options) function_name_get_options (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_query) identifier_query (string_'SET') string_'SET' )assignment )expression_statement (return_statement (call (identifier_dict) identifier_dict (generator_expression (subscript (identifier_row) identifier_row (slice (colon) colon (integer_2) integer_2 )slice )subscript (for_in_clause (identifier_row) identifier_row (call (attribute (attribute (identifier_self) identifier_self (identifier_con) identifier_con )attribute (identifier_fetchall) identifier_fetchall )attribute (argument_list (identifier_query) identifier_query )argument_list )call )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Return current query options for the Impala session
(module (function_definition (function_name_cyclic) function_name_cyclic (parameters (identifier_self) identifier_self )parameters (block (expression_statement (string_"Returns True if the options cycle, otherwise False") string_"Returns True if the options cycle, otherwise False" )expression_statement (return_statement (call (identifier_any) identifier_any (generator_expression (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_val) identifier_val (identifier_Cycle) identifier_Cycle )argument_list )call (for_in_clause (identifier_val) identifier_val (call (attribute (attribute (identifier_self) identifier_self (identifier_kwargs) identifier_kwargs )attribute (identifier_values) identifier_values )attribute (argument_list )argument_list )call )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Returns True if the options cycle, otherwise False
(module (function_definition (function_name_set) function_name_set (parameters (identifier_self) identifier_self (identifier_name) identifier_name (identifier_msg) identifier_msg )parameters (block (expression_statement (string_"fills in the error name and message.") string_"fills in the error name and message." )expression_statement (expression_statement (call (attribute (identifier_dbus) identifier_dbus (identifier_dbus_set_error) identifier_dbus_set_error )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__dbobj) identifier__dbobj )attribute (call (attribute (identifier_name) identifier_name (identifier_encode) identifier_encode )attribute (argument_list )argument_list )call (string_b"%s") string_b"%s" (call (attribute (identifier_msg) identifier_msg (identifier_encode) identifier_encode )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
fills in the error name and message.
(module (function_definition (function_name_logo_element) function_name_logo_element (parameters )parameters (block (expression_statement (assignment (identifier_path) identifier_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (call (identifier_resources_path) identifier_resources_path (argument_list )argument_list )call (string_'img') string_'img' (string_'logos') string_'logos' (string_'inasafe-logo.png') string_'inasafe-logo.png' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_url) identifier_url (call (attribute (attribute (identifier_urllib) identifier_urllib (identifier_parse) identifier_parse )attribute (identifier_urljoin) identifier_urljoin )attribute (argument_list (string_'file:') string_'file:' (call (attribute (attribute (identifier_urllib) identifier_urllib (identifier_request) identifier_request )attribute (identifier_pathname2url) identifier_pathname2url )attribute (argument_list (identifier_path) identifier_path )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (identifier_url) identifier_url )return_statement )block )function_definition )module
Create a sanitised local url to the logo for insertion into html. :returns: A sanitised local url to the logo prefixed with file://. :rtype: str ..note:: We are not using QUrl here because on Windows 10 it returns an empty path if using QUrl.toLocalPath
(module (function_definition (function_name_download_dataset) function_name_download_dataset (parameters (identifier_self) identifier_self (identifier_dataset_name) identifier_dataset_name (identifier_local_path) identifier_local_path (default_parameter (identifier_how) identifier_how (string_"stream") string_"stream" )default_parameter )parameters (block (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_local_path) identifier_local_path )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_local_path) identifier_local_path )argument_list )call )expression_statement )block (else_clause (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (call (attribute (string_"Path {} already exists!") string_"Path {} already exists!" (identifier_format) identifier_format )attribute (argument_list (identifier_local_path) identifier_local_path )argument_list )call )argument_list )call )raise_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_local_path) identifier_local_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_local_path) identifier_local_path (identifier_FILES_FOLDER) identifier_FILES_FOLDER )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_local_path) identifier_local_path )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_how) identifier_how (string_'zip') string_'zip' )comparison_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_download_as_zip) identifier_download_as_zip )attribute (argument_list (identifier_dataset_name) identifier_dataset_name (identifier_local_path) identifier_local_path )argument_list )call )return_statement )block (elif_clause (comparison_operator (identifier_how) identifier_how (string_'stream') string_'stream' )comparison_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_download_as_stream) identifier_download_as_stream )attribute (argument_list (identifier_dataset_name) identifier_dataset_name (identifier_local_path) identifier_local_path )argument_list )call )return_statement )block )elif_clause (else_clause (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_"how must be {'zip', 'stream'}") string_"how must be {'zip', 'stream'}" )argument_list )call )raise_statement )block )else_clause )if_statement )block )function_definition )module
It downloads from the repository the specified dataset and puts it in the specified local folder :param dataset_name: the name the dataset has in the repository :param local_path: where you want to save the dataset :param how: 'zip' downloads the whole dataset as a zip file and decompress it; 'stream' downloads the dataset sample by sample :return: None
(module (function_definition (function_name_volume) function_name_volume (parameters (typed_parameter (identifier_dev) identifier_dev (type (identifier_Device) identifier_Device )type )typed_parameter (identifier_volume) identifier_volume (identifier_output) identifier_output )parameters (block (expression_statement (assignment (identifier_vol) identifier_vol (None) None )assignment )expression_statement (expression_statement (assignment (identifier_vol_controls) identifier_vol_controls (await (call (attribute (identifier_dev) identifier_dev (identifier_get_volume_information) identifier_get_volume_information )attribute (argument_list )argument_list )call )await )assignment )expression_statement (if_statement (comparison_operator (identifier_output) identifier_output (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (binary_operator (string_"Using output: %s") string_"Using output: %s" (identifier_output) identifier_output )binary_operator )argument_list )call )expression_statement (expression_statement (assignment (identifier_output_uri) identifier_output_uri (attribute (parenthesized_expression (await (call (attribute (identifier_dev) identifier_dev (identifier_get_zone) identifier_get_zone )attribute (argument_list (identifier_output) identifier_output )argument_list )call )await )parenthesized_expression (identifier_uri) identifier_uri )attribute )assignment )expression_statement (for_statement (identifier_v) identifier_v (identifier_vol_controls) identifier_vol_controls (block (if_statement (comparison_operator (attribute (identifier_v) identifier_v (identifier_output) identifier_output )attribute (identifier_output_uri) identifier_output_uri )comparison_operator (block (expression_statement (assignment (identifier_vol) identifier_vol (identifier_v) identifier_v )assignment )expression_statement (break_statement )break_statement )block )if_statement )block )for_statement )block (else_clause (block (expression_statement (assignment (identifier_vol) identifier_vol (subscript (identifier_vol_controls) identifier_vol_controls (integer_0) integer_0 )subscript )assignment )expression_statement )block )else_clause )if_statement (if_statement (comparison_operator (identifier_vol) identifier_vol (None) None )comparison_operator (block (expression_statement (call (identifier_err) identifier_err (argument_list (binary_operator (string_"Unable to find volume controller: %s") string_"Unable to find volume controller: %s" (identifier_output) identifier_output )binary_operator )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (if_statement (boolean_operator (identifier_volume) identifier_volume (comparison_operator (identifier_volume) identifier_volume (string_"mute") string_"mute" )comparison_operator )boolean_operator (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (string_"Muting") string_"Muting" )argument_list )call )expression_statement (expression_statement (await (call (attribute (identifier_vol) identifier_vol (identifier_set_mute) identifier_set_mute )attribute (argument_list (True) True )argument_list )call )await )expression_statement )block (elif_clause (boolean_operator (identifier_volume) identifier_volume (comparison_operator (identifier_volume) identifier_volume (string_"unmute") string_"unmute" )comparison_operator )boolean_operator (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (string_"Unmuting") string_"Unmuting" )argument_list )call )expression_statement (expression_statement (await (call (attribute (identifier_vol) identifier_vol (identifier_set_mute) identifier_set_mute )attribute (argument_list (False) False )argument_list )call )await )expression_statement )block )elif_clause (elif_clause (identifier_volume) identifier_volume (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (binary_operator (string_"Setting volume to %s") string_"Setting volume to %s" (identifier_volume) identifier_volume )binary_operator )argument_list )call )expression_statement (expression_statement (await (call (attribute (identifier_vol) identifier_vol (identifier_set_volume) identifier_set_volume )attribute (argument_list (identifier_volume) identifier_volume )argument_list )call )await )expression_statement )block )elif_clause )if_statement (if_statement (comparison_operator (identifier_output) identifier_output (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (identifier_vol) identifier_vol )argument_list )call )expression_statement )block (else_clause (block (expression_statement (list_comprehension (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (identifier_x) identifier_x )argument_list )call (for_in_clause (identifier_x) identifier_x (identifier_vol_controls) identifier_vol_controls )for_in_clause )list_comprehension )expression_statement )block )else_clause )if_statement )block )function_definition )module
Get and set the volume settings. Passing 'mute' as new volume will mute the volume, 'unmute' removes it.
(module (function_definition (function_name_query_band) function_name_query_band (parameters (identifier_self) identifier_self (identifier_value) identifier_value )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__query_band) identifier__query_band )attribute (identifier_value) identifier_value )assignment )expression_statement (if_statement (comparison_operator (identifier_value) identifier_value (None) None )comparison_operator (block (try_statement (block (delete_statement (subscript (attribute (attribute (identifier_self) identifier_self (identifier__connectionXML) identifier__connectionXML )attribute (identifier_attrib) identifier_attrib )attribute (string_'query-band-spec') string_'query-band-spec' )subscript )delete_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (pass_statement )pass_statement )block )except_clause )try_statement )block (else_clause (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__connectionXML) identifier__connectionXML )attribute (identifier_set) identifier_set )attribute (argument_list (string_'query-band-spec') string_'query-band-spec' (identifier_value) identifier_value )argument_list )call )expression_statement )block )else_clause )if_statement )block )function_definition )module
Set the connection's query_band property. Args: value: New query_band value. String. Returns: Nothing.
(module (function_definition (function_name_signup) function_name_signup (parameters (identifier_remote_app) identifier_remote_app )parameters (block (if_statement (comparison_operator (identifier_remote_app) identifier_remote_app (attribute (identifier_current_oauthclient) identifier_current_oauthclient (identifier_signup_handlers) identifier_signup_handlers )attribute )comparison_operator (block (return_statement (call (identifier_abort) identifier_abort (argument_list (integer_404) integer_404 )argument_list )call )return_statement )block )if_statement (expression_statement (assignment (identifier_res) identifier_res (call (subscript (subscript (attribute (identifier_current_oauthclient) identifier_current_oauthclient (identifier_signup_handlers) identifier_signup_handlers )attribute (identifier_remote_app) identifier_remote_app )subscript (string_'view') string_'view' )subscript (argument_list )argument_list )call )assignment )expression_statement (return_statement (conditional_expression (call (identifier_abort) identifier_abort (argument_list (integer_404) integer_404 )argument_list )call (comparison_operator (identifier_res) identifier_res (None) None )comparison_operator (identifier_res) identifier_res )conditional_expression )return_statement )block )function_definition )module
Extra signup step.
(module (function_definition (function_name_CreateFromDOM) function_name_CreateFromDOM (parameters (identifier_node) identifier_node (default_parameter (identifier_default_namespace) identifier_default_namespace (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_default_namespace) identifier_default_namespace (None) None )comparison_operator (block (expression_statement (assignment (identifier_default_namespace) identifier_default_namespace (call (attribute (identifier_Namespace) identifier_Namespace (identifier_fallbackNamespace) identifier_fallbackNamespace )attribute (argument_list )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (call (attribute (attribute (attribute (attribute (identifier_pyxb) identifier_pyxb (identifier_binding) identifier_binding )attribute (identifier_basis) identifier_basis )attribute (identifier_element) identifier_element )attribute (identifier_AnyCreateFromDOM) identifier_AnyCreateFromDOM )attribute (argument_list (identifier_node) identifier_node (identifier_default_namespace) identifier_default_namespace )argument_list )call )return_statement )block )function_definition )module
Create a Python instance from the given DOM node. The node tag must correspond to an element declaration in this module. @deprecated: Forcing use of DOM interface is unnecessary; use L{CreateFromDocument}.
(module (function_definition (function_name_expect_column_values_to_be_in_set) function_name_expect_column_values_to_be_in_set (parameters (identifier_self) identifier_self (identifier_column) identifier_column (identifier_value_set) identifier_value_set (default_parameter (identifier_mostly) identifier_mostly (None) None )default_parameter (default_parameter (identifier_parse_strings_as_datetimes) identifier_parse_strings_as_datetimes (None) None )default_parameter (default_parameter (identifier_result_format) identifier_result_format (None) None )default_parameter (default_parameter (identifier_include_config) identifier_include_config (False) False )default_parameter (default_parameter (identifier_catch_exceptions) identifier_catch_exceptions (None) None )default_parameter (default_parameter (identifier_meta) identifier_meta (None) None )default_parameter )parameters (block (raise_statement (identifier_NotImplementedError) identifier_NotImplementedError )raise_statement )block )function_definition )module
Expect each column value to be in a given set. For example: :: # my_df.my_col = [1,2,2,3,3,3] >>> my_df.expect_column_values_to_be_in_set( "my_col", [2,3] ) { "success": false "result": { "unexpected_count": 1 "unexpected_percent": 0.16666666666666666, "unexpected_percent_nonmissing": 0.16666666666666666, "partial_unexpected_list": [ 1 ], }, } expect_column_values_to_be_in_set is a :func:`column_map_expectation <great_expectations.data_asset.dataset.Dataset.column_map_expectation>`. Args: column (str): \ The column name. value_set (set-like): \ A set of objects used for comparison. Keyword Args: mostly (None or a float between 0 and 1): \ Return `"success": True` if at least mostly percent of values match the expectation. \ For more detail, see :ref:`mostly`. parse_strings_as_datetimes (boolean or None) : If True values provided in value_set will be parsed as \ datetimes before making comparisons. Other Parameters: result_format (str or None): \ Which output mode to use: `BOOLEAN_ONLY`, `BASIC`, `COMPLETE`, or `SUMMARY`. For more detail, see :ref:`result_format <result_format>`. include_config (boolean): \ If True, then include the expectation config as part of the result object. \ For more detail, see :ref:`include_config`. catch_exceptions (boolean or None): \ If True, then catch exceptions and include them as part of the result object. \ For more detail, see :ref:`catch_exceptions`. meta (dict or None): \ A JSON-serializable dictionary (nesting allowed) that will be included in the output without modification. \ For more detail, see :ref:`meta`. Returns: A JSON-serializable expectation result object. Exact fields vary depending on the values passed to :ref:`result_format <result_format>` and :ref:`include_config`, :ref:`catch_exceptions`, and :ref:`meta`. See Also: expect_column_values_to_not_be_in_set
(module (function_definition (function_name_add_line) function_name_add_line (parameters (identifier_self) identifier_self (default_parameter (identifier_line) identifier_line (string_'') string_'' )default_parameter (keyword_separator )keyword_separator (default_parameter (identifier_empty) identifier_empty (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_max_page_size) identifier_max_page_size (binary_operator (binary_operator (attribute (identifier_self) identifier_self (identifier_max_size) identifier_max_size )attribute (attribute (identifier_self) identifier_self (identifier__prefix_len) identifier__prefix_len )attribute )binary_operator (integer_2) integer_2 )binary_operator )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_line) identifier_line )argument_list )call (identifier_max_page_size) identifier_max_page_size )comparison_operator (block (raise_statement (call (identifier_RuntimeError) identifier_RuntimeError (argument_list (binary_operator (string_'Line exceeds maximum page size %s') string_'Line exceeds maximum page size %s' (parenthesized_expression (identifier_max_page_size) identifier_max_page_size )parenthesized_expression )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (binary_operator (binary_operator (attribute (identifier_self) identifier_self (identifier__count) identifier__count )attribute (call (identifier_len) identifier_len (argument_list (identifier_line) identifier_line )argument_list )call )binary_operator (integer_1) integer_1 )binary_operator (attribute (identifier_self) identifier_self (identifier_max_size) identifier_max_size )attribute )comparison_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_close_page) identifier_close_page )attribute (argument_list )argument_list )call )expression_statement )block )if_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier__count) identifier__count )attribute (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_line) identifier_line )argument_list )call (integer_1) integer_1 )binary_operator )augmented_assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__current_page) identifier__current_page )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_line) identifier_line )argument_list )call )expression_statement (if_statement (identifier_empty) identifier_empty (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__current_page) identifier__current_page )attribute (identifier_append) identifier_append )attribute (argument_list (string_'') string_'' )argument_list )call )expression_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier__count) identifier__count )attribute (integer_1) integer_1 )augmented_assignment )expression_statement )block )if_statement )block )function_definition )module
Adds a line to the current page. If the line exceeds the :attr:`max_size` then an exception is raised. Parameters ----------- line: :class:`str` The line to add. empty: :class:`bool` Indicates if another empty line should be added. Raises ------ RuntimeError The line was too big for the current :attr:`max_size`.
(module (function_definition (function_name_render) function_name_render (parameters (identifier_data) identifier_data (default_parameter (identifier_saltenv) identifier_saltenv (string_'base') string_'base' )default_parameter (default_parameter (identifier_sls) identifier_sls (string_'') string_'' )default_parameter (default_parameter (identifier_argline) identifier_argline (string_'') string_'' )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_translate_newlines) identifier_translate_newlines (call (attribute (identifier_kwargs) identifier_kwargs (identifier_get) identifier_get )attribute (argument_list (string_'translate_newlines') string_'translate_newlines' (False) False )argument_list )call )assignment )expression_statement (return_statement (call (identifier__decrypt_object) identifier__decrypt_object (argument_list (identifier_data) identifier_data (keyword_argument (identifier_translate_newlines) identifier_translate_newlines (identifier_translate_newlines) identifier_translate_newlines )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Decrypt the data to be rendered that was encrypted using AWS KMS envelope encryption.
(module (function_definition (function_name_toggle_rules) function_name_toggle_rules (parameters (identifier_self) identifier_self (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (block (if_statement (boolean_operator (comparison_operator (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_manager) identifier_manager )attribute (identifier_current) identifier_current )attribute (string_'rules') string_'rules' )comparison_operator (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_selected_proxy) identifier_selected_proxy )attribute (identifier_CharStatProxy) identifier_CharStatProxy )argument_list )call )not_operator )boolean_operator (block (expression_statement (assignment (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_rules) identifier_rules )attribute (identifier_entity) identifier_entity )attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_selected_proxy) identifier_selected_proxy )attribute )assignment )expression_statement (expression_statement (assignment (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_rules) identifier_rules )attribute (identifier_rulebook) identifier_rulebook )attribute (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_selected_proxy) identifier_selected_proxy )attribute (identifier_rulebook) identifier_rulebook )attribute )assignment )expression_statement )block )if_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_selected_proxy) identifier_selected_proxy )attribute (identifier_CharStatProxy) identifier_CharStatProxy )argument_list )call (block (expression_statement (assignment (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_charrules) identifier_charrules )attribute (identifier_character) identifier_character )attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_selected_proxy) identifier_selected_proxy )attribute )assignment )expression_statement (expression_statement (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_charrules) identifier_charrules )attribute (identifier_toggle) identifier_toggle )attribute (argument_list )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_app) identifier_app )attribute (identifier_rules) identifier_rules )attribute (identifier_toggle) identifier_toggle )attribute (argument_list )argument_list )call )expression_statement )block )else_clause )if_statement )block )function_definition )module
Display or hide the view for constructing rules out of cards.
(module (function_definition (function_name__summary_matching_gos) function_name__summary_matching_gos (parameters (identifier_prt) identifier_prt (identifier_pattern) identifier_pattern (identifier_matching_gos) identifier_matching_gos (identifier_all_gos) identifier_all_gos )parameters (block (expression_statement (assignment (identifier_msg) identifier_msg (string_'Found {N} GO(s) out of {M} matching pattern("{P}")\n') string_'Found {N} GO(s) out of {M} matching pattern("{P}")\n' )assignment )expression_statement (expression_statement (assignment (identifier_num_gos) identifier_num_gos (call (identifier_len) identifier_len (argument_list (identifier_matching_gos) identifier_matching_gos )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_num_all) identifier_num_all (call (identifier_len) identifier_len (argument_list (identifier_all_gos) identifier_all_gos )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_prt) identifier_prt (identifier_write) identifier_write )attribute (argument_list (call (attribute (identifier_msg) identifier_msg (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_N) identifier_N (identifier_num_gos) identifier_num_gos )keyword_argument (keyword_argument (identifier_M) identifier_M (identifier_num_all) identifier_num_all )keyword_argument (keyword_argument (identifier_P) identifier_P (identifier_pattern) identifier_pattern )keyword_argument )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Print summary for get_matching_gos.
(module (function_definition (function_name_set_scan_parameters) function_name_set_scan_parameters (parameters (identifier_self) identifier_self (default_parameter (identifier_scan_type) identifier_scan_type (attribute (identifier_ScanType) identifier_ScanType (identifier_ACTIVE) identifier_ACTIVE )attribute )default_parameter (default_parameter (identifier_interval_ms) identifier_interval_ms (integer_10) integer_10 )default_parameter (default_parameter (identifier_window_ms) identifier_window_ms (integer_10) integer_10 )default_parameter (default_parameter (identifier_address_type) identifier_address_type (attribute (identifier_BluetoothAddressType) identifier_BluetoothAddressType (identifier_RANDOM) identifier_RANDOM )attribute )default_parameter (default_parameter (identifier_filter_type) identifier_filter_type (attribute (identifier_ScanFilter) identifier_ScanFilter (identifier_ALL) identifier_ALL )attribute )default_parameter )parameters (block (expression_statement (assignment (identifier_interval_fractions) identifier_interval_fractions (binary_operator (identifier_interval_ms) identifier_interval_ms (identifier_MS_FRACTION_DIVIDER) identifier_MS_FRACTION_DIVIDER )binary_operator )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_interval_fractions) identifier_interval_fractions (integer_0x0004) integer_0x0004 )comparison_operator (comparison_operator (identifier_interval_fractions) identifier_interval_fractions (integer_0x4000) integer_0x4000 )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (call (attribute (string_"Invalid interval given {}, must be in range of 2.5ms to 10240ms!") string_"Invalid interval given {}, must be in range of 2.5ms to 10240ms!" (identifier_format) identifier_format )attribute (argument_list (identifier_interval_fractions) identifier_interval_fractions )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_window_fractions) identifier_window_fractions (binary_operator (identifier_window_ms) identifier_window_ms (identifier_MS_FRACTION_DIVIDER) identifier_MS_FRACTION_DIVIDER )binary_operator )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_window_fractions) identifier_window_fractions (integer_0x0004) integer_0x0004 )comparison_operator (comparison_operator (identifier_window_fractions) identifier_window_fractions (integer_0x4000) integer_0x4000 )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (call (attribute (string_"Invalid window given {}, must be in range of 2.5ms to 10240ms!") string_"Invalid window given {}, must be in range of 2.5ms to 10240ms!" (identifier_format) identifier_format )attribute (argument_list (identifier_window_fractions) identifier_window_fractions )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (pattern_list (identifier_interval_fractions) identifier_interval_fractions (identifier_window_fractions) identifier_window_fractions )pattern_list (expression_list (call (identifier_int) identifier_int (argument_list (identifier_interval_fractions) identifier_interval_fractions )argument_list )call (call (identifier_int) identifier_int (argument_list (identifier_window_fractions) identifier_window_fractions )argument_list )call )expression_list )assignment )expression_statement (expression_statement (assignment (identifier_scan_parameter_pkg) identifier_scan_parameter_pkg (call (attribute (identifier_struct) identifier_struct (identifier_pack) identifier_pack )attribute (argument_list (string_">BHHBB") string_">BHHBB" (identifier_scan_type) identifier_scan_type (identifier_interval_fractions) identifier_interval_fractions (identifier_window_fractions) identifier_window_fractions (identifier_address_type) identifier_address_type (identifier_filter_type) identifier_filter_type )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_bluez) identifier_bluez )attribute (identifier_hci_send_cmd) identifier_hci_send_cmd )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_socket) identifier_socket )attribute (identifier_OGF_LE_CTL) identifier_OGF_LE_CTL (identifier_OCF_LE_SET_SCAN_PARAMETERS) identifier_OCF_LE_SET_SCAN_PARAMETERS (identifier_scan_parameter_pkg) identifier_scan_parameter_pkg )argument_list )call )expression_statement )block )function_definition )module
sets the le scan parameters Args: scan_type: ScanType.(PASSIVE|ACTIVE) interval: ms (as float) between scans (valid range 2.5ms - 10240ms) ..note:: when interval and window are equal, the scan runs continuos window: ms (as float) scan duration (valid range 2.5ms - 10240ms) address_type: Bluetooth address type BluetoothAddressType.(PUBLIC|RANDOM) * PUBLIC = use device MAC address * RANDOM = generate a random MAC address and use that filter: ScanFilter.(ALL|WHITELIST_ONLY) only ALL is supported, which will return all fetched bluetooth packets (WHITELIST_ONLY is not supported, because OCF_LE_ADD_DEVICE_TO_WHITE_LIST command is not implemented) Raises: ValueError: A value had an unexpected format or was not in range
(module (function_definition (function_name__extend_data) function_name__extend_data (parameters (identifier_self) identifier_self (identifier_datapoint) identifier_datapoint (identifier_new_data) identifier_new_data )parameters (block (if_statement (identifier_new_data) identifier_new_data (block (try_statement (block (expression_statement (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_data) identifier_data )attribute (identifier_datapoint) identifier_datapoint )subscript (identifier_extend) identifier_extend )attribute (argument_list (identifier_new_data) identifier_new_data )argument_list )call )expression_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier_data) identifier_data )attribute (identifier_datapoint) identifier_datapoint )subscript (identifier_new_data) identifier_new_data )assignment )expression_statement )block )except_clause )try_statement )block )if_statement )block )function_definition )module
extend or assign new data to datapoint
(module (function_definition (function_name_apply_conditions) function_name_apply_conditions (parameters (identifier_self) identifier_self (identifier_value) identifier_value )parameters (block (expression_statement (assignment (identifier_retval) identifier_retval (identifier_value) identifier_value )assignment )expression_statement (if_statement (attribute (identifier_self) identifier_self (identifier__cyclic) identifier__cyclic )attribute (block (expression_statement (assignment (identifier_retval) identifier_retval (call (identifier_apply_cyclic) identifier_apply_cyclic (argument_list (identifier_value) identifier_value (identifier_self) identifier_self )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_retval) identifier_retval (call (attribute (identifier_self) identifier_self (identifier__reflect) identifier__reflect )attribute (argument_list (identifier_retval) identifier_retval )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_retval) identifier_retval (attribute (identifier_numpy) identifier_numpy (identifier_ndarray) identifier_ndarray )attribute )argument_list )call (comparison_operator (attribute (identifier_retval) identifier_retval (identifier_size) identifier_size )attribute (integer_1) integer_1 )comparison_operator )boolean_operator (block (try_statement (block (expression_statement (assignment (identifier_retval) identifier_retval (subscript (identifier_retval) identifier_retval (integer_0) integer_0 )subscript )assignment )expression_statement )block (except_clause (identifier_IndexError) identifier_IndexError (block (expression_statement (assignment (identifier_retval) identifier_retval (call (identifier_float) identifier_float (argument_list (identifier_retval) identifier_retval )argument_list )call )assignment )expression_statement )block )except_clause )try_statement )block )if_statement (return_statement (identifier_retval) identifier_retval )return_statement )block )function_definition )module
Applies any boundary conditions to the given value. The value is manipulated according based on the following conditions: * If `self.cyclic` is True then `value` is wrapped around to the minimum (maximum) bound if `value` is `>= self.max` (`< self.min`) bound. For example, if the minimum and maximum bounds are `0, 2*pi` and `value = 5*pi`, then the returned value will be `pi`. * If `self.min` is a reflected boundary then `value` will be reflected to the right if it is `< self.min`. For example, if `self.min = 10` and `value = 3`, then the returned value will be 17. * If `self.max` is a reflected boundary then `value` will be reflected to the left if it is `> self.max`. For example, if `self.max = 20` and `value = 27`, then the returned value will be 13. * If `self.min` and `self.max` are both reflected boundaries, then `value` will be reflected between the two boundaries until it falls within the bounds. The first reflection occurs off of the maximum boundary. For example, if `self.min = 10`, `self.max = 20`, and `value = 42`, the returned value will be 18 ( the first reflection yields -2, the second 22, and the last 18). * If neither bounds are reflected and cyclic is False, then the value is just returned as-is. Parameters ---------- value : float The value to apply the conditions to. Returns ------- float The value after the conditions are applied; see above for details.
(module (function_definition (function_name_get_or_create) function_name_get_or_create (parameters (identifier_self) identifier_self (identifier_db_name) identifier_db_name )parameters (block (if_statement (not_operator (comparison_operator (identifier_db_name) identifier_db_name (identifier_self) identifier_self )comparison_operator )not_operator (block (expression_statement (assignment (identifier_res) identifier_res (call (attribute (attribute (identifier_self) identifier_self (identifier_resource) identifier_resource )attribute (identifier_put) identifier_put )attribute (argument_list (identifier_db_name) identifier_db_name )argument_list )call )assignment )expression_statement (if_statement (not_operator (comparison_operator (subscript (identifier_res) identifier_res (integer_0) integer_0 )subscript (integer_201) integer_201 )comparison_operator )not_operator (block (raise_statement (call (identifier_RuntimeError) identifier_RuntimeError (argument_list (call (attribute (string_'Failed to create database "{}"') string_'Failed to create database "{}"' (identifier_format) identifier_format )attribute (argument_list (identifier_db_name) identifier_db_name )argument_list )call )argument_list )call )raise_statement )block )if_statement )block )if_statement (return_statement (subscript (identifier_self) identifier_self (identifier_db_name) identifier_db_name )subscript )return_statement )block )function_definition )module
Creates the database named `db_name` if it doesn't already exist and return it
(module (function_definition (function_name_clear) function_name_clear (parameters (identifier_self) identifier_self )parameters (block (if_statement (boolean_operator (boolean_operator (call (identifier_hasattr) identifier_hasattr (argument_list (attribute (identifier_self) identifier_self (identifier_stdout) identifier_stdout )attribute (string_'isatty') string_'isatty' )argument_list )call (call (attribute (attribute (identifier_self) identifier_self (identifier_stdout) identifier_stdout )attribute (identifier_isatty) identifier_isatty )attribute (argument_list )argument_list )call )boolean_operator (comparison_operator (attribute (identifier_self) identifier_self (identifier_term_type) identifier_term_type )attribute (string_'mintty') string_'mintty' )comparison_operator )boolean_operator (block (expression_statement (assignment (pattern_list (identifier_cmd) identifier_cmd (identifier_shell) identifier_shell )pattern_list (subscript (dictionary (pair (string_'posix') string_'posix' (tuple (string_'clear') string_'clear' (False) False )tuple )pair (pair (string_'nt') string_'nt' (tuple (string_'cls') string_'cls' (True) True )tuple )pair (pair (string_'cygwin') string_'cygwin' (tuple (list (string_'echo') string_'echo' (string_'-en') string_'-en' (string_r'\ec') string_r'\ec' )list (False) False )tuple )pair (pair (string_'mintty') string_'mintty' (tuple (string_r'echo -en "\ec') string_r'echo -en "\ec' (False) False )tuple )pair )dictionary (attribute (identifier_self) identifier_self (identifier_term_type) identifier_term_type )attribute )subscript )assignment )expression_statement (expression_statement (call (attribute (identifier_subprocess) identifier_subprocess (identifier_call) identifier_call )attribute (argument_list (identifier_cmd) identifier_cmd (keyword_argument (identifier_shell) identifier_shell (identifier_shell) identifier_shell )keyword_argument (keyword_argument (identifier_stdin) identifier_stdin (attribute (identifier_self) identifier_self (identifier_stdin) identifier_stdin )attribute )keyword_argument (keyword_argument (identifier_stdout) identifier_stdout (attribute (identifier_self) identifier_self (identifier_stdout) identifier_stdout )attribute )keyword_argument (keyword_argument (identifier_stderr) identifier_stderr (attribute (identifier_self) identifier_self (identifier_stderr) identifier_stderr )attribute )keyword_argument )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Clear the terminal screen.
(module (function_definition (function_name_getlist) function_name_getlist (parameters (identifier_self) identifier_self (identifier_event) identifier_event )parameters (block (try_statement (block (expression_statement (assignment (identifier_componentlist) identifier_componentlist (call (attribute (call (identifier_model_factory) identifier_model_factory (argument_list (identifier_Schema) identifier_Schema )argument_list )call (identifier_find) identifier_find )attribute (argument_list (dictionary )dictionary )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_data) identifier_data (list )list )assignment )expression_statement (for_statement (identifier_comp) identifier_comp (identifier_componentlist) identifier_componentlist (block (try_statement (block (expression_statement (call (attribute (identifier_data) identifier_data (identifier_append) identifier_append )attribute (argument_list (dictionary (pair (string_'name') string_'name' (attribute (identifier_comp) identifier_comp (identifier_name) identifier_name )attribute )pair (pair (string_'uuid') string_'uuid' (attribute (identifier_comp) identifier_comp (identifier_uuid) identifier_uuid )attribute )pair (pair (string_'class') string_'class' (attribute (identifier_comp) identifier_comp (identifier_componentclass) identifier_componentclass )attribute )pair (pair (string_'active') string_'active' (attribute (identifier_comp) identifier_comp (identifier_active) identifier_active )attribute )pair )dictionary )argument_list )call )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (string_'Bad component without component class encountered:') string_'Bad component without component class encountered:' (keyword_argument (identifier_lvl) identifier_lvl (identifier_warn) identifier_warn )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (call (attribute (identifier_comp) identifier_comp (identifier_serializablefields) identifier_serializablefields )attribute (argument_list )argument_list )call (keyword_argument (identifier_pretty) identifier_pretty (True) True )keyword_argument (keyword_argument (identifier_lvl) identifier_lvl (identifier_warn) identifier_warn )keyword_argument )argument_list )call )expression_statement )block )except_clause )try_statement )block )for_statement (expression_statement (assignment (identifier_data) identifier_data (call (identifier_sorted) identifier_sorted (argument_list (identifier_data) identifier_data (keyword_argument (identifier_key) identifier_key (lambda (lambda_parameters (identifier_x) identifier_x )lambda_parameters (subscript (identifier_x) identifier_x (string_'name') string_'name' )subscript )lambda )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_response) identifier_response (dictionary (pair (string_'component') string_'component' (string_'hfos.ui.configurator') string_'hfos.ui.configurator' )pair (pair (string_'action') string_'action' (string_'getlist') string_'getlist' )pair (pair (string_'data') string_'data' (identifier_data) identifier_data )pair )dictionary )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_fireEvent) identifier_fireEvent )attribute (argument_list (call (identifier_send) identifier_send (argument_list (attribute (attribute (identifier_event) identifier_event (identifier_client) identifier_client )attribute (identifier_uuid) identifier_uuid )attribute (identifier_response) identifier_response )argument_list )call )argument_list )call )expression_statement (return_statement )return_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (string_"List error: ") string_"List error: " (identifier_e) identifier_e (call (identifier_type) identifier_type (argument_list (identifier_e) identifier_e )argument_list )call (keyword_argument (identifier_lvl) identifier_lvl (identifier_error) identifier_error )keyword_argument (keyword_argument (identifier_exc) identifier_exc (True) True )keyword_argument )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
Processes configuration list requests :param event:
(module (function_definition (function_name_prt_goids) function_name_prt_goids (parameters (identifier_self) identifier_self (identifier_prt) identifier_prt )parameters (block (expression_statement (assignment (identifier_fmt) identifier_fmt (subscript (attribute (attribute (identifier_self) identifier_self (identifier_gosubdag) identifier_gosubdag )attribute (identifier_prt_attr) identifier_prt_attr )attribute (string_'fmta') string_'fmta' )subscript )assignment )expression_statement (expression_statement (assignment (identifier_nts) identifier_nts (call (identifier_sorted) identifier_sorted (argument_list (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_gosubdag) identifier_gosubdag )attribute (identifier_go2nt) identifier_go2nt )attribute (identifier_values) identifier_values )attribute (argument_list )argument_list )call (keyword_argument (identifier_key) identifier_key (lambda (lambda_parameters (identifier_nt) identifier_nt )lambda_parameters (list (attribute (identifier_nt) identifier_nt (identifier_NS) identifier_NS )attribute (attribute (identifier_nt) identifier_nt (identifier_depth) identifier_depth )attribute (attribute (identifier_nt) identifier_nt (identifier_alt) identifier_alt )attribute )list )lambda )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier__get_color) identifier__get_color (attribute (attribute (attribute (identifier_self) identifier_self (identifier_pydotnodego) identifier_pydotnodego )attribute (identifier_go2color) identifier_go2color )attribute (identifier_get) identifier_get )attribute )assignment )expression_statement (for_statement (identifier_ntgo) identifier_ntgo (identifier_nts) identifier_nts (block (expression_statement (assignment (identifier_gostr) identifier_gostr (call (attribute (identifier_fmt) identifier_fmt (identifier_format) identifier_format )attribute (argument_list (dictionary_splat (call (attribute (identifier_ntgo) identifier_ntgo (identifier__asdict) identifier__asdict )attribute (argument_list )argument_list )call )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_col) identifier_col (call (identifier__get_color) identifier__get_color (argument_list (attribute (identifier_ntgo) identifier_ntgo (identifier_GO) identifier_GO )attribute (string_"") string_"" )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_prt) identifier_prt (identifier_write) identifier_write )attribute (argument_list (call (attribute (string_"{COLOR:7} {GO}\n") string_"{COLOR:7} {GO}\n" (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_COLOR) identifier_COLOR (identifier_col) identifier_col )keyword_argument (keyword_argument (identifier_GO) identifier_GO (identifier_gostr) identifier_gostr )keyword_argument )argument_list )call )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Print all GO IDs in the plot, plus their color.
(module (function_definition (function_name__get_preferred_cipher_suite) function_name__get_preferred_cipher_suite (parameters (identifier_cls) identifier_cls (typed_parameter (identifier_server_connectivity_info) identifier_server_connectivity_info (type (identifier_ServerConnectivityInfo) identifier_ServerConnectivityInfo )type )typed_parameter (typed_parameter (identifier_ssl_version) identifier_ssl_version (type (identifier_OpenSslVersionEnum) identifier_OpenSslVersionEnum )type )typed_parameter (typed_parameter (identifier_accepted_cipher_list) identifier_accepted_cipher_list (type (generic_type (identifier_List) identifier_List (type_parameter (type (string_'AcceptedCipherSuite') string_'AcceptedCipherSuite' )type )type_parameter )generic_type )type )typed_parameter )parameters (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (string_'AcceptedCipherSuite') string_'AcceptedCipherSuite' )type )type_parameter )generic_type )type (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_accepted_cipher_list) identifier_accepted_cipher_list )argument_list )call (integer_2) integer_2 )comparison_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_accepted_cipher_names) identifier_accepted_cipher_names (list_comprehension (attribute (identifier_cipher) identifier_cipher (identifier_openssl_name) identifier_openssl_name )attribute (for_in_clause (identifier_cipher) identifier_cipher (identifier_accepted_cipher_list) identifier_accepted_cipher_list )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_should_use_legacy_openssl) identifier_should_use_legacy_openssl (None) None )assignment )expression_statement (if_statement (comparison_operator (identifier_ssl_version) identifier_ssl_version (attribute (identifier_OpenSslVersionEnum) identifier_OpenSslVersionEnum (identifier_TLSV1_2) identifier_TLSV1_2 )attribute )comparison_operator (block (expression_statement (assignment (identifier_should_use_legacy_openssl) identifier_should_use_legacy_openssl (True) True )assignment )expression_statement (for_statement (identifier_cipher_name) identifier_cipher_name (identifier_accepted_cipher_names) identifier_accepted_cipher_names (block (expression_statement (assignment (identifier_modern_supported_cipher_count) identifier_modern_supported_cipher_count (integer_0) integer_0 )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_WorkaroundForTls12ForCipherSuites) identifier_WorkaroundForTls12ForCipherSuites (identifier_requires_legacy_openssl) identifier_requires_legacy_openssl )attribute (argument_list (identifier_cipher_name) identifier_cipher_name )argument_list )call )not_operator (block (expression_statement (augmented_assignment (identifier_modern_supported_cipher_count) identifier_modern_supported_cipher_count (integer_1) integer_1 )augmented_assignment )expression_statement )block )if_statement (if_statement (comparison_operator (identifier_modern_supported_cipher_count) identifier_modern_supported_cipher_count (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_should_use_legacy_openssl) identifier_should_use_legacy_openssl (False) False )assignment )expression_statement (break_statement )break_statement )block )if_statement )block )for_statement )block )if_statement (expression_statement (assignment (identifier_first_cipher_str) identifier_first_cipher_str (call (attribute (string_', ') string_', ' (identifier_join) identifier_join )attribute (argument_list (identifier_accepted_cipher_names) identifier_accepted_cipher_names )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_second_cipher_str) identifier_second_cipher_str (call (attribute (string_', ') string_', ' (identifier_join) identifier_join )attribute (argument_list (binary_operator (list (subscript (identifier_accepted_cipher_names) identifier_accepted_cipher_names (integer_1) integer_1 )subscript (subscript (identifier_accepted_cipher_names) identifier_accepted_cipher_names (integer_0) integer_0 )subscript )list (subscript (identifier_accepted_cipher_names) identifier_accepted_cipher_names (slice (integer_2) integer_2 (colon) colon )slice )subscript )binary_operator )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_first_cipher) identifier_first_cipher (call (attribute (identifier_cls) identifier_cls (identifier__get_selected_cipher_suite) identifier__get_selected_cipher_suite )attribute (argument_list (identifier_server_connectivity_info) identifier_server_connectivity_info (identifier_ssl_version) identifier_ssl_version (identifier_first_cipher_str) identifier_first_cipher_str (identifier_should_use_legacy_openssl) identifier_should_use_legacy_openssl )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_second_cipher) identifier_second_cipher (call (attribute (identifier_cls) identifier_cls (identifier__get_selected_cipher_suite) identifier__get_selected_cipher_suite )attribute (argument_list (identifier_server_connectivity_info) identifier_server_connectivity_info (identifier_ssl_version) identifier_ssl_version (identifier_second_cipher_str) identifier_second_cipher_str (identifier_should_use_legacy_openssl) identifier_should_use_legacy_openssl )argument_list )call )assignment )expression_statement )block (except_clause (tuple (identifier_SslHandshakeRejected) identifier_SslHandshakeRejected (identifier_ConnectionError) identifier_ConnectionError )tuple (block (return_statement (None) None )return_statement )block )except_clause )try_statement (if_statement (comparison_operator (attribute (identifier_first_cipher) identifier_first_cipher (identifier_name) identifier_name )attribute (attribute (identifier_second_cipher) identifier_second_cipher (identifier_name) identifier_name )attribute )comparison_operator (block (return_statement (identifier_first_cipher) identifier_first_cipher )return_statement )block (else_clause (block (return_statement (None) None )return_statement )block )else_clause )if_statement )block )function_definition )module
Try to detect the server's preferred cipher suite among all cipher suites supported by SSLyze.
(module (function_definition (function_name_add_ihex) function_name_add_ihex (parameters (identifier_self) identifier_self (identifier_records) identifier_records (default_parameter (identifier_overwrite) identifier_overwrite (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_extended_segment_address) identifier_extended_segment_address (integer_0) integer_0 )assignment )expression_statement (expression_statement (assignment (identifier_extended_linear_address) identifier_extended_linear_address (integer_0) integer_0 )assignment )expression_statement (for_statement (identifier_record) identifier_record (call (identifier_StringIO) identifier_StringIO (argument_list (identifier_records) identifier_records )argument_list )call (block (expression_statement (assignment (pattern_list (identifier_type_) identifier_type_ (identifier_address) identifier_address (identifier_size) identifier_size (identifier_data) identifier_data )pattern_list (call (identifier_unpack_ihex) identifier_unpack_ihex (argument_list (call (attribute (identifier_record) identifier_record (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_type_) identifier_type_ (identifier_IHEX_DATA) identifier_IHEX_DATA )comparison_operator (block (expression_statement (assignment (identifier_address) identifier_address (parenthesized_expression (binary_operator (binary_operator (identifier_address) identifier_address (identifier_extended_segment_address) identifier_extended_segment_address )binary_operator (identifier_extended_linear_address) identifier_extended_linear_address )binary_operator )parenthesized_expression )assignment )expression_statement (expression_statement (augmented_assignment (identifier_address) identifier_address (attribute (identifier_self) identifier_self (identifier_word_size_bytes) identifier_word_size_bytes )attribute )augmented_assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__segments) identifier__segments )attribute (identifier_add) identifier_add )attribute (argument_list (call (identifier__Segment) identifier__Segment (argument_list (identifier_address) identifier_address (binary_operator (identifier_address) identifier_address (identifier_size) identifier_size )binary_operator (call (identifier_bytearray) identifier_bytearray (argument_list (identifier_data) identifier_data )argument_list )call (attribute (identifier_self) identifier_self (identifier_word_size_bytes) identifier_word_size_bytes )attribute )argument_list )call (identifier_overwrite) identifier_overwrite )argument_list )call )expression_statement )block (elif_clause (comparison_operator (identifier_type_) identifier_type_ (identifier_IHEX_END_OF_FILE) identifier_IHEX_END_OF_FILE )comparison_operator (block (pass_statement )pass_statement )block )elif_clause (elif_clause (comparison_operator (identifier_type_) identifier_type_ (identifier_IHEX_EXTENDED_SEGMENT_ADDRESS) identifier_IHEX_EXTENDED_SEGMENT_ADDRESS )comparison_operator (block (expression_statement (assignment (identifier_extended_segment_address) identifier_extended_segment_address (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_binascii) identifier_binascii (identifier_hexlify) identifier_hexlify )attribute (argument_list (identifier_data) identifier_data )argument_list )call (integer_16) integer_16 )argument_list )call )assignment )expression_statement (expression_statement (augmented_assignment (identifier_extended_segment_address) identifier_extended_segment_address (integer_16) integer_16 )augmented_assignment )expression_statement )block )elif_clause (elif_clause (comparison_operator (identifier_type_) identifier_type_ (identifier_IHEX_EXTENDED_LINEAR_ADDRESS) identifier_IHEX_EXTENDED_LINEAR_ADDRESS )comparison_operator (block (expression_statement (assignment (identifier_extended_linear_address) identifier_extended_linear_address (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_binascii) identifier_binascii (identifier_hexlify) identifier_hexlify )attribute (argument_list (identifier_data) identifier_data )argument_list )call (integer_16) integer_16 )argument_list )call )assignment )expression_statement (expression_statement (augmented_assignment (identifier_extended_linear_address) identifier_extended_linear_address (integer_16) integer_16 )augmented_assignment )expression_statement )block )elif_clause (elif_clause (comparison_operator (identifier_type_) identifier_type_ (list (identifier_IHEX_START_SEGMENT_ADDRESS) identifier_IHEX_START_SEGMENT_ADDRESS (identifier_IHEX_START_LINEAR_ADDRESS) identifier_IHEX_START_LINEAR_ADDRESS )list )comparison_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_execution_start_address) identifier_execution_start_address )attribute (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_binascii) identifier_binascii (identifier_hexlify) identifier_hexlify )attribute (argument_list (identifier_data) identifier_data )argument_list )call (integer_16) integer_16 )argument_list )call )assignment )expression_statement )block )elif_clause (else_clause (block (raise_statement (call (identifier_Error) identifier_Error (argument_list (call (attribute (string_"expected type 1..5 in record {}, but got {}") string_"expected type 1..5 in record {}, but got {}" (identifier_format) identifier_format )attribute (argument_list (identifier_record) identifier_record (identifier_type_) identifier_type_ )argument_list )call )argument_list )call )raise_statement )block )else_clause )if_statement )block )for_statement )block )function_definition )module
Add given Intel HEX records string. Set `overwrite` to ``True`` to allow already added data to be overwritten.
(module (function_definition (function_name__url_params) function_name__url_params (parameters (typed_default_parameter (identifier_size) identifier_size (type (identifier_str) identifier_str )type (string_'>400*300') string_'>400*300' )typed_default_parameter (typed_default_parameter (identifier_format) identifier_format (type (identifier_str) identifier_str )type (string_'jpg') string_'jpg' )typed_default_parameter )parameters (type (identifier_str) identifier_str )type (block (expression_statement (string_"Build Google Images Search Url params and return them as a string.") string_"Build Google Images Search Url params and return them as a string." )expression_statement (expression_statement (assignment (identifier__fmts) identifier__fmts (dictionary (pair (string_'jpg') string_'jpg' (string_'ift:jpg') string_'ift:jpg' )pair (pair (string_'gif') string_'gif' (string_'ift:gif') string_'ift:gif' )pair (pair (string_'png') string_'png' (string_'ift:png') string_'ift:png' )pair (pair (string_'bmp') string_'bmp' (string_'ift:bmp') string_'ift:bmp' )pair (pair (string_'svg') string_'svg' (string_'ift:svg') string_'ift:svg' )pair (pair (string_'webp') string_'webp' (string_'webp') string_'webp' )pair (pair (string_'ico') string_'ico' (string_'ift:ico') string_'ift:ico' )pair )dictionary )assignment )expression_statement (if_statement (comparison_operator (identifier_size) identifier_size (identifier__img_sizes) identifier__img_sizes )comparison_operator (block (raise_statement (call (identifier_RuntimeError) identifier_RuntimeError (argument_list (identifier_f) identifier_f )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (identifier_format) identifier_format (identifier__fmts) identifier__fmts )comparison_operator (block (raise_statement (call (identifier_RuntimeError) identifier_RuntimeError (argument_list (string_f"Unexpected image file format: {format}. Use jpg, gif, png, bmp, svg, webp, or ico.") string_f"Unexpected image file format: {format}. Use jpg, gif, png, bmp, svg, webp, or ico." )argument_list )call )raise_statement )block )if_statement (return_statement (binary_operator (binary_operator (binary_operator (string_"&tbs=") string_"&tbs=" (subscript (identifier__img_sizes) identifier__img_sizes (identifier_size) identifier_size )subscript )binary_operator (string_",") string_"," )binary_operator (subscript (identifier__fmts) identifier__fmts (identifier_format) identifier_format )subscript )binary_operator )return_statement )block )function_definition )module
Build Google Images Search Url params and return them as a string.
(module (function_definition (function_name_signature) function_name_signature (parameters (identifier_self) identifier_self (identifier_name) identifier_name (identifier_file_name) identifier_file_name (identifier_file_type) identifier_file_type (identifier_file_content) identifier_file_content (default_parameter (identifier_owner) identifier_owner (None) None )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (return_statement (call (identifier_Signature) identifier_Signature (argument_list (attribute (identifier_self) identifier_self (identifier_tcex) identifier_tcex )attribute (identifier_name) identifier_name (identifier_file_name) identifier_file_name (identifier_file_type) identifier_file_type (identifier_file_content) identifier_file_content (keyword_argument (identifier_owner) identifier_owner (identifier_owner) identifier_owner )keyword_argument (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Create the Signature TI object. Args: owner: file_content: file_name: file_type: name: **kwargs: Return:
(module (function_definition (function_name_get_value) function_name_get_value (parameters (identifier_self) identifier_self (identifier_class_name) identifier_class_name (identifier_attr) identifier_attr (default_parameter (identifier_default_value) identifier_default_value (None) None )default_parameter (default_parameter (identifier_state) identifier_state (string_'normal') string_'normal' )default_parameter (default_parameter (identifier_base_name) identifier_base_name (string_'View') string_'View' )default_parameter )parameters (block (expression_statement (assignment (identifier_styles) identifier_styles (call (attribute (identifier_self) identifier_self (identifier_get_dict_for_class) identifier_get_dict_for_class )attribute (argument_list (identifier_class_name) identifier_class_name (identifier_state) identifier_state (identifier_base_name) identifier_base_name )argument_list )call )assignment )expression_statement (try_statement (block (return_statement (subscript (identifier_styles) identifier_styles (identifier_attr) identifier_attr )subscript )return_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (return_statement (identifier_default_value) identifier_default_value )return_statement )block )except_clause )try_statement )block )function_definition )module
Get a single style attribute value for the given class.
(module (function_definition (function_name_update) function_name_update (parameters (identifier_self) identifier_self (default_parameter (identifier_dt) identifier_dt (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_dt) identifier_dt (conditional_expression (identifier_dt) identifier_dt (parenthesized_expression (boolean_operator (comparison_operator (identifier_dt) identifier_dt (None) None )comparison_operator (comparison_operator (identifier_dt) identifier_dt (integer_0) integer_0 )comparison_operator )boolean_operator )parenthesized_expression (attribute (identifier_self) identifier_self (identifier_dt) identifier_dt )attribute )conditional_expression )assignment )expression_statement (expression_statement (assignment (identifier_tspan) identifier_tspan (list (integer_0) integer_0 (identifier_dt) identifier_dt )list )assignment )expression_statement (expression_statement (assignment (identifier_res) identifier_res (call (attribute (attribute (identifier_self) identifier_self (identifier_sim) identifier_sim )attribute (identifier_run) identifier_run )attribute (argument_list (keyword_argument (identifier_tspan) identifier_tspan (identifier_tspan) identifier_tspan )keyword_argument (keyword_argument (identifier_initials) identifier_initials (attribute (identifier_self) identifier_self (identifier_state) identifier_state )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_state) identifier_state )attribute (subscript (attribute (identifier_res) identifier_res (identifier_species) identifier_species )attribute (unary_operator (integer_1) integer_1 )unary_operator )subscript )assignment )expression_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier_time) identifier_time )attribute (identifier_dt) identifier_dt )augmented_assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_time) identifier_time )attribute (attribute (identifier_self) identifier_self (identifier_stop_time) identifier_stop_time )attribute )comparison_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_DONE) identifier_DONE )attribute (True) True )assignment )expression_statement )block )if_statement (expression_statement (call (identifier_print) identifier_print (argument_list (tuple (attribute (identifier_self) identifier_self (identifier_time) identifier_time )attribute (attribute (identifier_self) identifier_self (identifier_state) identifier_state )attribute )tuple )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_time_course) identifier_time_course )attribute (identifier_append) identifier_append )attribute (argument_list (tuple (call (attribute (attribute (identifier_self) identifier_self (identifier_time) identifier_time )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call (call (attribute (attribute (identifier_self) identifier_self (identifier_state) identifier_state )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )tuple )argument_list )call )expression_statement )block )function_definition )module
Simulate the model for a given time interval. Parameters ---------- dt : Optional[float] The time step to simulate, if None, the default built-in time step is used.
(module (function_definition (function_name_task_add_user) function_name_task_add_user (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 (if_statement (not_operator (attribute (identifier_self) identifier_self (identifier_cur_task) identifier_cur_task )attribute )not_operator (block (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_dialog) identifier_dialog (call (identifier_UserAdderDialog) identifier_UserAdderDialog (argument_list (keyword_argument (identifier_task) identifier_task (attribute (identifier_self) identifier_self (identifier_cur_task) identifier_cur_task )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_dialog) identifier_dialog (identifier_exec_) identifier_exec_ )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_users) identifier_users (attribute (identifier_dialog) identifier_dialog (identifier_users) identifier_users )attribute )assignment )expression_statement (for_statement (identifier_user) identifier_user (identifier_users) identifier_users (block (expression_statement (assignment (identifier_userdata) identifier_userdata (call (attribute (identifier_djitemdata) identifier_djitemdata (identifier_UserItemData) identifier_UserItemData )attribute (argument_list (identifier_user) identifier_user )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_treemodel) identifier_treemodel (identifier_TreeItem) identifier_TreeItem )attribute (argument_list (identifier_userdata) identifier_userdata (attribute (attribute (identifier_self) identifier_self (identifier_task_user_model) identifier_task_user_model )attribute (identifier_root) identifier_root )attribute )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Add users to the current task :returns: None :rtype: None :raises: None
(module (function_definition (function_name_run_sphinx) function_name_run_sphinx (parameters )parameters (block (expression_statement (assignment (identifier_old_dir) identifier_old_dir (call (identifier_here_directory) identifier_here_directory (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_os) identifier_os (identifier_chdir) identifier_chdir )attribute (argument_list (call (identifier_str) identifier_str (argument_list (call (identifier_doc_directory) identifier_doc_directory (argument_list )argument_list )call )argument_list )call )argument_list )call )expression_statement (expression_statement (assignment (identifier_doc_status) identifier_doc_status (call (attribute (identifier_subprocess) identifier_subprocess (identifier_check_call) identifier_check_call )attribute (argument_list (list (string_'make') string_'make' (string_'html') string_'html' )list (keyword_argument (identifier_shell) identifier_shell (True) True )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_os) identifier_os (identifier_chdir) identifier_chdir )attribute (argument_list (call (identifier_str) identifier_str (argument_list (identifier_old_dir) identifier_old_dir )argument_list )call )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_doc_status) identifier_doc_status (integer_0) integer_0 )comparison_operator (block (expression_statement (call (identifier_exit) identifier_exit (argument_list (binary_operator (attribute (identifier_Fore) identifier_Fore (identifier_RED) identifier_RED )attribute (string_'Something broke generating your documentation...') string_'Something broke generating your documentation...' )binary_operator )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Runs Sphinx via it's `make html` command
(module (function_definition (function_name_add_text) function_name_add_text (parameters (identifier_self) identifier_self (identifier_tag) identifier_tag (identifier_text) identifier_text (default_parameter (identifier_global_step) identifier_global_step (None) None )default_parameter )parameters (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__file_writer) identifier__file_writer )attribute (identifier_add_summary) identifier_add_summary )attribute (argument_list (call (identifier_text_summary) identifier_text_summary (argument_list (identifier_tag) identifier_tag (identifier_text) identifier_text )argument_list )call (identifier_global_step) identifier_global_step )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_tag) identifier_tag (attribute (identifier_self) identifier_self (identifier__text_tags) identifier__text_tags )attribute )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__text_tags) identifier__text_tags )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_tag) identifier_tag )argument_list )call )expression_statement (expression_statement (assignment (identifier_extension_dir) identifier_extension_dir (binary_operator (call (attribute (identifier_self) identifier_self (identifier_get_logdir) identifier_get_logdir )attribute (argument_list )argument_list )call (string_'/plugins/tensorboard_text/') string_'/plugins/tensorboard_text/' )binary_operator )assignment )expression_statement (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_extension_dir) identifier_extension_dir )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_extension_dir) identifier_extension_dir )argument_list )call )expression_statement )block )if_statement (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (binary_operator (identifier_extension_dir) identifier_extension_dir (string_'tensors.json') string_'tensors.json' )binary_operator (string_'w') string_'w' )argument_list )call (as_pattern_target (identifier_fp) identifier_fp )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_json) identifier_json (identifier_dump) identifier_dump )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__text_tags) identifier__text_tags )attribute (identifier_fp) identifier_fp )argument_list )call )expression_statement )block )with_statement )block )if_statement )block )function_definition )module
Add text data to the event file. Parameters ---------- tag : str Name for the `text`. text : str Text to be saved to the event file. global_step : int Global step value to record.
(module (function_definition (function_name_profile_update) function_name_profile_update (parameters (identifier_request) identifier_request (default_parameter (identifier_template) identifier_template (string_"accounts/account_profile_update.html") string_"accounts/account_profile_update.html" )default_parameter (default_parameter (identifier_extra_context) identifier_extra_context (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_profile_form) identifier_profile_form (call (identifier_get_profile_form) identifier_get_profile_form (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_form) identifier_form (call (identifier_profile_form) identifier_profile_form (argument_list (boolean_operator (attribute (identifier_request) identifier_request (identifier_POST) identifier_POST )attribute (None) None )boolean_operator (boolean_operator (attribute (identifier_request) identifier_request (identifier_FILES) identifier_FILES )attribute (None) None )boolean_operator (keyword_argument (identifier_instance) identifier_instance (attribute (identifier_request) identifier_request (identifier_user) identifier_user )attribute )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (attribute (identifier_request) identifier_request (identifier_method) identifier_method )attribute (string_"POST") string_"POST" )comparison_operator (call (attribute (identifier_form) identifier_form (identifier_is_valid) identifier_is_valid )attribute (argument_list )argument_list )call )boolean_operator (block (expression_statement (assignment (identifier_user) identifier_user (call (attribute (identifier_form) identifier_form (identifier_save) identifier_save )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_info) identifier_info (argument_list (identifier_request) identifier_request (call (identifier__) identifier__ (argument_list (string_"Profile updated") string_"Profile updated" )argument_list )call )argument_list )call )expression_statement (try_statement (block (return_statement (call (identifier_redirect) identifier_redirect (argument_list (string_"profile") string_"profile" (keyword_argument (identifier_username) identifier_username (attribute (identifier_user) identifier_user (identifier_username) identifier_username )attribute )keyword_argument )argument_list )call )return_statement )block (except_clause (identifier_NoReverseMatch) identifier_NoReverseMatch (block (return_statement (call (identifier_redirect) identifier_redirect (argument_list (string_"profile_update") string_"profile_update" )argument_list )call )return_statement )block )except_clause )try_statement )block )if_statement (expression_statement (assignment (identifier_context) identifier_context (dictionary (pair (string_"form") string_"form" (identifier_form) identifier_form )pair (pair (string_"title") string_"title" (call (identifier__) identifier__ (argument_list (string_"Update Profile") string_"Update Profile" )argument_list )call )pair )dictionary )assignment )expression_statement (expression_statement (call (attribute (identifier_context) identifier_context (identifier_update) identifier_update )attribute (argument_list (boolean_operator (identifier_extra_context) identifier_extra_context (dictionary )dictionary )boolean_operator )argument_list )call )expression_statement (return_statement (call (identifier_TemplateResponse) identifier_TemplateResponse (argument_list (identifier_request) identifier_request (identifier_template) identifier_template (identifier_context) identifier_context )argument_list )call )return_statement )block )function_definition )module
Profile update form.
(module (function_definition (function_name__build_processor) function_name__build_processor (parameters (identifier_cls) identifier_cls (typed_parameter (identifier_session) identifier_session (type (identifier_AppSession) identifier_AppSession )type )typed_parameter )parameters (block (expression_statement (assignment (identifier_web_processor) identifier_web_processor (call (attribute (identifier_cls) identifier_cls (identifier__build_web_processor) identifier__build_web_processor )attribute (argument_list (identifier_session) identifier_session )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_ftp_processor) identifier_ftp_processor (call (attribute (identifier_cls) identifier_cls (identifier__build_ftp_processor) identifier__build_ftp_processor )attribute (argument_list (identifier_session) identifier_session )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_delegate_processor) identifier_delegate_processor (call (attribute (attribute (identifier_session) identifier_session (identifier_factory) identifier_factory )attribute (identifier_new) identifier_new )attribute (argument_list (string_'Processor') string_'Processor' )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_delegate_processor) identifier_delegate_processor (identifier_register) identifier_register )attribute (argument_list (string_'http') string_'http' (identifier_web_processor) identifier_web_processor )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_delegate_processor) identifier_delegate_processor (identifier_register) identifier_register )attribute (argument_list (string_'https') string_'https' (identifier_web_processor) identifier_web_processor )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_delegate_processor) identifier_delegate_processor (identifier_register) identifier_register )attribute (argument_list (string_'ftp') string_'ftp' (identifier_ftp_processor) identifier_ftp_processor )argument_list )call )expression_statement )block )function_definition )module
Create the Processor Returns: Processor: An instance of :class:`.processor.BaseProcessor`.
(module (function_definition (function_name_analyze_async) function_name_analyze_async (parameters (identifier_output_dir) identifier_output_dir (identifier_dataset) identifier_dataset (default_parameter (identifier_cloud) identifier_cloud (False) False )default_parameter (default_parameter (identifier_project_id) identifier_project_id (None) None )default_parameter )parameters (block (import_statement (aliased_import (dotted_name (identifier_google) identifier_google (identifier_datalab) identifier_datalab (identifier_utils) identifier_utils )dotted_name (identifier_du) identifier_du )aliased_import )import_statement (with_statement (with_clause (with_item (call (attribute (identifier_warnings) identifier_warnings (identifier_catch_warnings) identifier_catch_warnings )attribute (argument_list )argument_list )call )with_item )with_clause (block (expression_statement (call (attribute (identifier_warnings) identifier_warnings (identifier_simplefilter) identifier_simplefilter )attribute (argument_list (string_"ignore") string_"ignore" )argument_list )call )expression_statement (expression_statement (assignment (identifier_fn) identifier_fn (lambda (call (identifier__analyze) identifier__analyze (argument_list (identifier_output_dir) identifier_output_dir (identifier_dataset) identifier_dataset (identifier_cloud) identifier_cloud (identifier_project_id) identifier_project_id )argument_list )call )lambda )assignment )expression_statement (return_statement (call (attribute (identifier_du) identifier_du (identifier_LambdaJob) identifier_LambdaJob )attribute (argument_list (identifier_fn) identifier_fn (keyword_argument (identifier_job_id) identifier_job_id (None) None )keyword_argument )argument_list )call )return_statement )block )with_statement )block )function_definition )module
Analyze data locally or in the cloud with BigQuery. Produce analysis used by training. This can take a while, even for small datasets. For small datasets, it may be faster to use local_analysis. Args: output_dir: The output directory to use. dataset: only CsvDataSet is supported currently. cloud: If False, runs analysis locally with Pandas. If Ture, runs analysis in the cloud with BigQuery. project_id: Uses BigQuery with this project id. Default is datalab's default project id. Returns: A google.datalab.utils.Job object that can be used to query state from or wait.
(module (function_definition (function_name_create_router) function_name_create_router (parameters (identifier_self) identifier_self (identifier_context) identifier_context (identifier_router) identifier_router )parameters (block (if_statement (identifier_router) identifier_router (block (expression_statement (assignment (identifier_router_name) identifier_router_name (call (attribute (identifier_self) identifier_self (identifier__arista_router_name) identifier__arista_router_name )attribute (argument_list (subscript (identifier_router) identifier_router (string_'id') string_'id' )subscript (subscript (identifier_router) identifier_router (string_'name') string_'name' )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_hashed) identifier_hashed (call (attribute (identifier_hashlib) identifier_hashlib (identifier_sha256) identifier_sha256 )attribute (argument_list (call (attribute (identifier_router_name) identifier_router_name (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 (identifier_rdm) identifier_rdm (call (identifier_str) identifier_str (argument_list (binary_operator (call (identifier_int) identifier_int (argument_list (call (attribute (identifier_hashed) identifier_hashed (identifier_hexdigest) identifier_hexdigest )attribute (argument_list )argument_list )call (integer_16) integer_16 )argument_list )call (integer_65536) integer_65536 )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_mlag_peer_failed) identifier_mlag_peer_failed (False) False )assignment )expression_statement (for_statement (identifier_s) identifier_s (attribute (identifier_self) identifier_self (identifier__servers) identifier__servers )attribute (block (try_statement (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_create_router_on_eos) identifier_create_router_on_eos )attribute (argument_list (identifier_router_name) identifier_router_name (identifier_rdm) identifier_rdm (identifier_s) identifier_s )argument_list )call )expression_statement (expression_statement (assignment (identifier_mlag_peer_failed) identifier_mlag_peer_failed (False) False )assignment )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (if_statement (boolean_operator (attribute (identifier_self) identifier_self (identifier__mlag_configured) identifier__mlag_configured )attribute (not_operator (identifier_mlag_peer_failed) identifier_mlag_peer_failed )not_operator )boolean_operator (block (expression_statement (assignment (identifier_mlag_peer_failed) identifier_mlag_peer_failed (True) True )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_msg) identifier_msg (parenthesized_expression (binary_operator (call (identifier__) identifier__ (argument_list (string_'Failed to create router %s on EOS') string_'Failed to create router %s on EOS' )argument_list )call (identifier_router_name) identifier_router_name )binary_operator )parenthesized_expression )assignment )expression_statement (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_exception) identifier_exception )attribute (argument_list (identifier_msg) identifier_msg )argument_list )call )expression_statement (raise_statement (call (attribute (identifier_arista_exc) identifier_arista_exc (identifier_AristaServicePluginRpcError) identifier_AristaServicePluginRpcError )attribute (argument_list (keyword_argument (identifier_msg) identifier_msg (identifier_msg) identifier_msg )keyword_argument )argument_list )call )raise_statement )block )else_clause )if_statement )block )except_clause )try_statement )block )for_statement )block )if_statement )block )function_definition )module
Creates a router on Arista Switch. Deals with multiple configurations - such as Router per VRF, a router in default VRF, Virtual Router in MLAG configurations
(module (function_definition (function_name_ls) function_name_ls (parameters (identifier_ctx) identifier_ctx (identifier_name) identifier_name (identifier_list_formatted) identifier_list_formatted )parameters (block (expression_statement (assignment (identifier_session) identifier_session (call (identifier_create_session) identifier_create_session (argument_list (subscript (attribute (identifier_ctx) identifier_ctx (identifier_obj) identifier_obj )attribute (string_'AWS_PROFILE_NAME') string_'AWS_PROFILE_NAME' )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_client) identifier_client (call (attribute (identifier_session) identifier_session (identifier_client) identifier_client )attribute (argument_list (string_'autoscaling') string_'autoscaling' )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_name) identifier_name (string_"*") string_"*" )comparison_operator (block (expression_statement (assignment (identifier_groups) identifier_groups (call (attribute (identifier_client) identifier_client (identifier_describe_auto_scaling_groups) identifier_describe_auto_scaling_groups )attribute (argument_list )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_groups) identifier_groups (call (attribute (identifier_client) identifier_client (identifier_describe_auto_scaling_groups) identifier_describe_auto_scaling_groups )attribute (argument_list (keyword_argument (identifier_AutoScalingGroupNames) identifier_AutoScalingGroupNames (list (identifier_name) identifier_name )list )keyword_argument )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_out) identifier_out (call (identifier_format_output) identifier_format_output (argument_list (identifier_groups) identifier_groups (identifier_list_formatted) identifier_list_formatted )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_click) identifier_click (identifier_echo) identifier_echo )attribute (argument_list (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (argument_list (identifier_out) identifier_out )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
List AutoScaling groups
(module (function_definition (function_name_create_tc_pool) function_name_create_tc_pool (parameters (identifier_self) identifier_self (identifier_zone_name) identifier_zone_name (identifier_owner_name) identifier_owner_name (identifier_ttl) identifier_ttl (identifier_pool_info) identifier_pool_info (identifier_rdata_info) identifier_rdata_info (identifier_backup_record) identifier_backup_record )parameters (block (expression_statement (assignment (identifier_rrset) identifier_rrset (call (attribute (identifier_self) identifier_self (identifier__build_tc_rrset) identifier__build_tc_rrset )attribute (argument_list (identifier_backup_record) identifier_backup_record (identifier_pool_info) identifier_pool_info (identifier_rdata_info) identifier_rdata_info (identifier_ttl) identifier_ttl )argument_list )call )assignment )expression_statement (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_rest_api_connection) identifier_rest_api_connection )attribute (identifier_post) identifier_post )attribute (argument_list (binary_operator (binary_operator (binary_operator (string_"/v1/zones/") string_"/v1/zones/" (identifier_zone_name) identifier_zone_name )binary_operator (string_"/rrsets/A/") string_"/rrsets/A/" )binary_operator (identifier_owner_name) identifier_owner_name )binary_operator (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (identifier_rrset) identifier_rrset )argument_list )call )argument_list )call )return_statement )block )function_definition )module
Creates a new TC Pool. Arguments: zone_name -- The zone that contains the RRSet. The trailing dot is optional. owner_name -- The owner name for the RRSet. If no trailing dot is supplied, the owner_name is assumed to be relative (foo). If a trailing dot is supplied, the owner name is assumed to be absolute (foo.zonename.com.) ttl -- The updated TTL value for the RRSet. pool_info -- dict of information about the pool rdata_info -- dict of information about the records in the pool. The keys in the dict are the A and CNAME records that make up the pool. The values are the rdataInfo for each of the records backup_record -- dict of information about the backup (all-fail) records in the pool. There are two key/value in the dict: rdata - the A or CNAME for the backup record failoverDelay - the time to wait to fail over (optional, defaults to 0)
(module (function_definition (function_name_exception_to_unicode) function_name_exception_to_unicode (parameters (identifier_e) identifier_e (default_parameter (identifier_traceback) identifier_traceback (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_message) identifier_message (binary_operator (string_'%s: %s') string_'%s: %s' (tuple (attribute (attribute (identifier_e) identifier_e (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute (call (identifier_to_unicode) identifier_to_unicode (argument_list (identifier_e) identifier_e )argument_list )call )tuple )binary_operator )assignment )expression_statement (if_statement (identifier_traceback) identifier_traceback (block (import_from_statement (dotted_name (identifier_docido_sdk) identifier_docido_sdk (identifier_toolbox) identifier_toolbox )dotted_name (dotted_name (identifier_get_last_traceback) identifier_get_last_traceback )dotted_name )import_from_statement (expression_statement (assignment (identifier_traceback_only) identifier_traceback_only (subscript (call (attribute (call (identifier_get_last_traceback) identifier_get_last_traceback (argument_list )argument_list )call (identifier_split) identifier_split )attribute (argument_list (string_'\n') string_'\n' )argument_list )call (slice (colon) colon (unary_operator (integer_2) integer_2 )unary_operator )slice )subscript )assignment )expression_statement (expression_statement (assignment (identifier_message) identifier_message (binary_operator (string_'\n%s\n%s') string_'\n%s\n%s' (tuple (call (identifier_to_unicode) identifier_to_unicode (argument_list (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (argument_list (identifier_traceback_only) identifier_traceback_only )argument_list )call )argument_list )call (identifier_message) identifier_message )tuple )binary_operator )assignment )expression_statement )block )if_statement (return_statement (identifier_message) identifier_message )return_statement )block )function_definition )module
Convert an `Exception` to an `unicode` object. In addition to `to_unicode`, this representation of the exception also contains the class name and optionally the traceback.
(module (function_definition (function_name_from_settings) function_name_from_settings (parameters (identifier_settings) identifier_settings )parameters (block (expression_statement (assignment (identifier_connection_type) identifier_connection_type (call (attribute (identifier_settings) identifier_settings (identifier_get) identifier_get )attribute (argument_list (string_'RABBITMQ_CONNECTION_TYPE') string_'RABBITMQ_CONNECTION_TYPE' (identifier_RABBITMQ_CONNECTION_TYPE) identifier_RABBITMQ_CONNECTION_TYPE )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_queue_name) identifier_queue_name (call (attribute (identifier_settings) identifier_settings (identifier_get) identifier_get )attribute (argument_list (string_'RABBITMQ_QUEUE_NAME') string_'RABBITMQ_QUEUE_NAME' (identifier_RABBITMQ_QUEUE_NAME) identifier_RABBITMQ_QUEUE_NAME )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_connection_parameters) identifier_connection_parameters (call (attribute (identifier_settings) identifier_settings (identifier_get) identifier_get )attribute (argument_list (string_'RABBITMQ_CONNECTION_PARAMETERS') string_'RABBITMQ_CONNECTION_PARAMETERS' (identifier_RABBITMQ_CONNECTION_PARAMETERS) identifier_RABBITMQ_CONNECTION_PARAMETERS )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_connection) identifier_connection (call (subscript (dictionary (pair (string_'blocking') string_'blocking' (attribute (identifier_pika) identifier_pika (identifier_BlockingConnection) identifier_BlockingConnection )attribute )pair (pair (string_'libev') string_'libev' (attribute (identifier_pika) identifier_pika (identifier_LibevConnection) identifier_LibevConnection )attribute )pair (pair (string_'select') string_'select' (attribute (identifier_pika) identifier_pika (identifier_SelectConnection) identifier_SelectConnection )attribute )pair (pair (string_'tornado') string_'tornado' (attribute (identifier_pika) identifier_pika (identifier_TornadoConnection) identifier_TornadoConnection )attribute )pair (pair (string_'twisted') string_'twisted' (attribute (identifier_pika) identifier_pika (identifier_TwistedConnection) identifier_TwistedConnection )attribute )pair )dictionary (identifier_connection_type) identifier_connection_type )subscript (argument_list (call (attribute (identifier_pika) identifier_pika (identifier_ConnectionParameters) identifier_ConnectionParameters )attribute (argument_list (dictionary_splat (identifier_connection_parameters) identifier_connection_parameters )dictionary_splat )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_channel) identifier_channel (call (attribute (identifier_connection) identifier_connection (identifier_channel) identifier_channel )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_channel) identifier_channel (identifier_queue_declare) identifier_queue_declare )attribute (argument_list (keyword_argument (identifier_queue) identifier_queue (identifier_queue_name) identifier_queue_name )keyword_argument (keyword_argument (identifier_durable) identifier_durable (True) True )keyword_argument )argument_list )call )expression_statement (return_statement (identifier_channel) identifier_channel )return_statement )block )function_definition )module
Factory method that returns an instance of channel :param str connection_type: This field can be `blocking` `asyncore`, `libev`, `select`, `tornado`, or `twisted` See pika documentation for more details: TODO: put pika url regarding connection type Parameters is a dictionary that can include the following values: :param str host: Hostname or IP Address to connect to :param int port: TCP port to connect to :param str virtual_host: RabbitMQ virtual host to use :param pika.credentials.Credentials credentials: auth credentials :param int channel_max: Maximum number of channels to allow :param int frame_max: The maximum byte size for an AMQP frame :param int heartbeat_interval: How often to send heartbeats :param bool ssl: Enable SSL :param dict ssl_options: Arguments passed to ssl.wrap_socket as :param int connection_attempts: Maximum number of retry attempts :param int|float retry_delay: Time to wait in seconds, before the next :param int|float socket_timeout: Use for high latency networks :param str locale: Set the locale value :param bool backpressure_detection: Toggle backpressure detection :return: Channel object
(module (function_definition (function_name_state) function_name_state (parameters (identifier_self) identifier_self (default_parameter (identifier_states) identifier_states (None) None )default_parameter )parameters (block (if_statement (boolean_operator (comparison_operator (identifier_states) identifier_states (None) None )comparison_operator (not_operator (identifier_states) identifier_states )not_operator )boolean_operator (block (return_statement (identifier_self) identifier_self )return_statement )block )if_statement (expression_statement (assignment (identifier_nodes) identifier_nodes (list )list )assignment )expression_statement (for_statement (identifier_node) identifier_node (attribute (identifier_self) identifier_self (identifier_nodes) identifier_nodes )attribute (block (if_statement (call (identifier_any) identifier_any (generator_expression (comparison_operator (call (attribute (identifier_state) identifier_state (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call (call (attribute (attribute (identifier_node) identifier_node (identifier_state) identifier_state )attribute (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )comparison_operator (for_in_clause (identifier_state) identifier_state (identifier_states) identifier_states )for_in_clause )generator_expression )call (block (expression_statement (call (attribute (identifier_nodes) identifier_nodes (identifier_append) identifier_append )attribute (argument_list (identifier_node) identifier_node )argument_list )call )expression_statement )block )if_statement )block )for_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_nodes) identifier_nodes )attribute (identifier_nodes) identifier_nodes )assignment )expression_statement (return_statement (identifier_self) identifier_self )return_statement )block )function_definition )module
Filter by state. :param tags: States to filter. :type tags: ``list`` :return: A list of Node objects. :rtype: ``list`` of :class:`Node`
(module (function_definition (function_name_equal) function_name_equal (parameters (identifier_list1) identifier_list1 (identifier_list2) identifier_list2 )parameters (block (return_statement (list_comprehension (comparison_operator (identifier_item1) identifier_item1 (identifier_item2) identifier_item2 )comparison_operator (for_in_clause (pattern_list (identifier_item1) identifier_item1 (identifier_item2) identifier_item2 )pattern_list (call (identifier_broadcast_zip) identifier_broadcast_zip (argument_list (identifier_list1) identifier_list1 (identifier_list2) identifier_list2 )argument_list )call )for_in_clause )list_comprehension )return_statement )block )function_definition )module
takes flags returns indexes of True values
(module (function_definition (function_name__newline_tokenize) function_name__newline_tokenize (parameters (identifier_self) identifier_self (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_parts) identifier_parts (call (attribute (identifier_data) identifier_data (identifier_split) identifier_split )attribute (argument_list (string_'\n') string_'\n' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_tokens) identifier_tokens (list )list )assignment )expression_statement (for_statement (pattern_list (identifier_num) identifier_num (identifier_part) identifier_part )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_parts) identifier_parts )argument_list )call (block (if_statement (identifier_part) identifier_part (block (expression_statement (call (attribute (identifier_tokens) identifier_tokens (identifier_append) identifier_append )attribute (argument_list (tuple (attribute (identifier_self) identifier_self (identifier_TOKEN_DATA) identifier_TOKEN_DATA )attribute (None) None (None) None (identifier_part) identifier_part )tuple )argument_list )call )expression_statement )block )if_statement (if_statement (comparison_operator (identifier_num) identifier_num (parenthesized_expression (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_parts) identifier_parts )argument_list )call (integer_1) integer_1 )binary_operator )parenthesized_expression )comparison_operator (block (expression_statement (call (attribute (identifier_tokens) identifier_tokens (identifier_append) identifier_append )attribute (argument_list (tuple (attribute (identifier_self) identifier_self (identifier_TOKEN_NEWLINE) identifier_TOKEN_NEWLINE )attribute (None) None (None) None (string_'\n') string_'\n' )tuple )argument_list )call )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_tokens) identifier_tokens )return_statement )block )function_definition )module
Given a string that does not contain any tags, this function will return a list of NEWLINE and DATA tokens such that if you concatenate their data, you will have the original string.
(module (function_definition (function_name_set_dwelling_current) function_name_set_dwelling_current (parameters (identifier_self) identifier_self (identifier_settings) identifier_settings )parameters (block (expression_statement (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier__dwelling_current_settings) identifier__dwelling_current_settings )attribute (string_'now') string_'now' )subscript (identifier_update) identifier_update )attribute (argument_list (identifier_settings) identifier_settings )argument_list )call )expression_statement (expression_statement (assignment (identifier_dwelling_axes_to_update) identifier_dwelling_axes_to_update (dictionary_comprehension (pair (identifier_axis) identifier_axis (identifier_amps) identifier_amps )pair (for_in_clause (pattern_list (identifier_axis) identifier_axis (identifier_amps) identifier_amps )pattern_list (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier__dwelling_current_settings) identifier__dwelling_current_settings )attribute (string_'now') string_'now' )subscript (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause (if_clause (comparison_operator (call (attribute (attribute (identifier_self) identifier_self (identifier__active_axes) identifier__active_axes )attribute (identifier_get) identifier_get )attribute (argument_list (identifier_axis) identifier_axis )argument_list )call (False) False )comparison_operator )if_clause (if_clause (comparison_operator (subscript (attribute (identifier_self) identifier_self (identifier_current) identifier_current )attribute (identifier_axis) identifier_axis )subscript (identifier_amps) identifier_amps )comparison_operator )if_clause )dictionary_comprehension )assignment )expression_statement (if_statement (identifier_dwelling_axes_to_update) identifier_dwelling_axes_to_update (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__save_current) identifier__save_current )attribute (argument_list (identifier_dwelling_axes_to_update) identifier_dwelling_axes_to_update (keyword_argument (identifier_axes_active) identifier_axes_active (False) False )keyword_argument )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Sets the amperage of each motor for when it is dwelling. Values are initialized from the `robot_config.log_current` values, and can then be changed through this method by other parts of the API. For example, `Pipette` setting the dwelling-current of it's pipette, depending on what model pipette it is. settings Dict with axes as valies (e.g.: 'X', 'Y', 'Z', 'A', 'B', or 'C') and floating point number for current (generally between 0.1 and 2)
(module (function_definition (function_name_create_delete_model) function_name_create_delete_model (parameters (identifier_record) identifier_record )parameters (block (expression_statement (assignment (identifier_arn) identifier_arn (string_f"arn:aws:s3:::{cloudwatch.filter_request_parameters('bucketName', record)}") string_f"arn:aws:s3:::{cloudwatch.filter_request_parameters('bucketName', record)}" )assignment )expression_statement (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_debug) identifier_debug )attribute (argument_list (string_f'[-] Deleting Dynamodb Records. Hash Key: {arn}') string_f'[-] Deleting Dynamodb Records. Hash Key: {arn}' )argument_list )call )expression_statement (expression_statement (assignment (identifier_data) identifier_data (dictionary (pair (string_'arn') string_'arn' (identifier_arn) identifier_arn )pair (pair (string_'principalId') string_'principalId' (call (attribute (identifier_cloudwatch) identifier_cloudwatch (identifier_get_principal) identifier_get_principal )attribute (argument_list (identifier_record) identifier_record )argument_list )call )pair (pair (string_'userIdentity') string_'userIdentity' (call (attribute (identifier_cloudwatch) identifier_cloudwatch (identifier_get_user_identity) identifier_get_user_identity )attribute (argument_list (identifier_record) identifier_record )argument_list )call )pair (pair (string_'accountId') string_'accountId' (subscript (identifier_record) identifier_record (string_'account') string_'account' )subscript )pair (pair (string_'eventTime') string_'eventTime' (subscript (subscript (identifier_record) identifier_record (string_'detail') string_'detail' )subscript (string_'eventTime') string_'eventTime' )subscript )pair (pair (string_'BucketName') string_'BucketName' (call (attribute (identifier_cloudwatch) identifier_cloudwatch (identifier_filter_request_parameters) identifier_filter_request_parameters )attribute (argument_list (string_'bucketName') string_'bucketName' (identifier_record) identifier_record )argument_list )call )pair (pair (string_'Region') string_'Region' (call (attribute (identifier_cloudwatch) identifier_cloudwatch (identifier_get_region) identifier_get_region )attribute (argument_list (identifier_record) identifier_record )argument_list )call )pair (pair (string_'Tags') string_'Tags' (dictionary )dictionary )pair (pair (string_'configuration') string_'configuration' (dictionary )dictionary )pair (pair (string_'eventSource') string_'eventSource' (subscript (subscript (identifier_record) identifier_record (string_'detail') string_'detail' )subscript (string_'eventSource') string_'eventSource' )subscript )pair (pair (string_'version') string_'version' (identifier_VERSION) identifier_VERSION )pair )dictionary )assignment )expression_statement (return_statement (call (identifier_CurrentS3Model) identifier_CurrentS3Model (argument_list (dictionary_splat (identifier_data) identifier_data )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Create an S3 model from a record.
(module (function_definition (function_name_get_total_ram) function_name_get_total_ram (parameters )parameters (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (string_'/proc/meminfo') string_'/proc/meminfo' (string_'r') string_'r' )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (for_statement (identifier_line) identifier_line (call (attribute (identifier_f) identifier_f (identifier_readlines) identifier_readlines )attribute (argument_list )argument_list )call (block (if_statement (identifier_line) identifier_line (block (expression_statement (assignment (pattern_list (identifier_key) identifier_key (identifier_value) identifier_value (identifier_unit) identifier_unit )pattern_list (call (attribute (identifier_line) identifier_line (identifier_split) identifier_split )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_key) identifier_key (string_'MemTotal:') string_'MemTotal:' )comparison_operator (block (assert_statement (comparison_operator (identifier_unit) identifier_unit (string_'kB') string_'kB' )comparison_operator (string_'Unknown unit') string_'Unknown unit' )assert_statement (return_statement (binary_operator (call (identifier_int) identifier_int (argument_list (identifier_value) identifier_value )argument_list )call (integer_1024) integer_1024 )binary_operator )return_statement )block )if_statement )block )if_statement )block )for_statement (raise_statement (call (identifier_NotImplementedError) identifier_NotImplementedError (argument_list )argument_list )call )raise_statement )block )with_statement )block )function_definition )module
The total amount of system RAM in bytes. This is what is reported by the OS, and may be overcommitted when there are multiple containers hosted on the same machine.
(module (function_definition (function_name_read_byte_data) function_name_read_byte_data (parameters (identifier_self) identifier_self (identifier_i2c_addr) identifier_i2c_addr (identifier_register) identifier_register (default_parameter (identifier_force) identifier_force (None) None )default_parameter )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__set_address) identifier__set_address )attribute (argument_list (identifier_i2c_addr) identifier_i2c_addr (keyword_argument (identifier_force) identifier_force (identifier_force) identifier_force )keyword_argument )argument_list )call )expression_statement (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (identifier_i2c_smbus_ioctl_data) identifier_i2c_smbus_ioctl_data (identifier_create) identifier_create )attribute (argument_list (keyword_argument (identifier_read_write) identifier_read_write (identifier_I2C_SMBUS_READ) identifier_I2C_SMBUS_READ )keyword_argument (keyword_argument (identifier_command) identifier_command (identifier_register) identifier_register )keyword_argument (keyword_argument (identifier_size) identifier_size (identifier_I2C_SMBUS_BYTE_DATA) identifier_I2C_SMBUS_BYTE_DATA )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_ioctl) identifier_ioctl (argument_list (attribute (identifier_self) identifier_self (identifier_fd) identifier_fd )attribute (identifier_I2C_SMBUS) identifier_I2C_SMBUS (identifier_msg) identifier_msg )argument_list )call )expression_statement (return_statement (attribute (attribute (attribute (identifier_msg) identifier_msg (identifier_data) identifier_data )attribute (identifier_contents) identifier_contents )attribute (identifier_byte) identifier_byte )attribute )return_statement )block )function_definition )module
Read a single byte from a designated register. :param i2c_addr: i2c address :type i2c_addr: int :param register: Register to read :type register: int :param force: :type force: Boolean :return: Read byte value :rtype: int
(module (function_definition (function_name_update_nodes) function_name_update_nodes (parameters (identifier_nodes) identifier_nodes (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_user_id) identifier_user_id (call (attribute (identifier_kwargs) identifier_kwargs (identifier_get) identifier_get )attribute (argument_list (string_'user_id') string_'user_id' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_updated_nodes) identifier_updated_nodes (list )list )assignment )expression_statement (for_statement (identifier_n) identifier_n (identifier_nodes) identifier_nodes (block (expression_statement (assignment (identifier_updated_node_i) identifier_updated_node_i (call (identifier_update_node) identifier_update_node (argument_list (identifier_n) identifier_n (keyword_argument (identifier_flush) identifier_flush (False) False )keyword_argument (keyword_argument (identifier_user_id) identifier_user_id (identifier_user_id) identifier_user_id )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_updated_nodes) identifier_updated_nodes (identifier_append) identifier_append )attribute (argument_list (identifier_updated_node_i) identifier_updated_node_i )argument_list )call )expression_statement )block )for_statement (expression_statement (call (attribute (attribute (identifier_db) identifier_db (identifier_DBSession) identifier_DBSession )attribute (identifier_flush) identifier_flush )attribute (argument_list )argument_list )call )expression_statement (return_statement (identifier_updated_nodes) identifier_updated_nodes )return_statement )block )function_definition )module
Update multiple nodes. If new attributes are present, they will be added to the node. The non-presence of attributes does not remove them. %TODO:merge this with the 'update_nodes' functionality in the 'update_netework' function, so we're not duplicating functionality. D.R.Y! returns: a list of updated nodes
(module (function_definition (function_name_fit_transform) function_name_fit_transform (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 (expression_statement (call (attribute (identifier_self) identifier_self (identifier_fit) identifier_fit )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier_transform) identifier_transform )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Performs fit followed by transform. This method simply combines fit and transform. Args: args: positional arguments (can be anything) kwargs: keyword arguments (can be anything) Returns: dict: output
(module (function_definition (function_name__has_fr_route) function_name__has_fr_route (parameters (identifier_self) identifier_self )parameters (block (if_statement (call (attribute (identifier_self) identifier_self (identifier__should_use_fr_error_handler) identifier__should_use_fr_error_handler )attribute (argument_list )argument_list )call (block (return_statement (True) True )return_statement )block )if_statement (if_statement (not_operator (attribute (identifier_request) identifier_request (identifier_url_rule) identifier_url_rule )attribute )not_operator (block (return_statement (False) False )return_statement )block )if_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier_owns_endpoint) identifier_owns_endpoint )attribute (argument_list (attribute (attribute (identifier_request) identifier_request (identifier_url_rule) identifier_url_rule )attribute (identifier_endpoint) identifier_endpoint )attribute )argument_list )call )return_statement )block )function_definition )module
Encapsulating the rules for whether the request was to a Flask endpoint
(module (function_definition (function_name_dirty_fields) function_name_dirty_fields (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_dirty_fields) identifier_dirty_fields (list )list )assignment )expression_statement (for_statement (identifier_field) identifier_field (attribute (identifier_self) identifier_self (identifier_all_fields) identifier_all_fields )attribute (block (if_statement (comparison_operator (identifier_field) identifier_field (attribute (identifier_self) identifier_self (identifier__original) identifier__original )attribute )comparison_operator (block (expression_statement (call (attribute (identifier_dirty_fields) identifier_dirty_fields (identifier_append) identifier_append )attribute (argument_list (identifier_field) identifier_field )argument_list )call )expression_statement )block (elif_clause (comparison_operator (subscript (attribute (identifier_self) identifier_self (identifier__original) identifier__original )attribute (identifier_field) identifier_field )subscript (call (identifier_getattr) identifier_getattr (argument_list (identifier_self) identifier_self (identifier_field) identifier_field )argument_list )call )comparison_operator (block (expression_statement (call (attribute (identifier_dirty_fields) identifier_dirty_fields (identifier_append) identifier_append )attribute (argument_list (identifier_field) identifier_field )argument_list )call )expression_statement )block )elif_clause )if_statement )block )for_statement (return_statement (identifier_dirty_fields) identifier_dirty_fields )return_statement )block )function_definition )module
Return an array of field names that are dirty Dirty means if a model was hydrated first from the store & then had field values changed they are now considered dirty. For new models all fields are considered dirty. :return: list
(module (function_definition (function_name_get_known_topics) function_name_get_known_topics (parameters (identifier_self) identifier_self (identifier_lang) identifier_lang )parameters (block (return_statement (list_comprehension (subscript (identifier_topic) identifier_topic (string_'title') string_'title' )subscript (for_in_clause (identifier_topic) identifier_topic (subscript (subscript (attribute (attribute (identifier_self) identifier_self (identifier_user_data) identifier_user_data )attribute (identifier_language_data) identifier_language_data )attribute (identifier_lang) identifier_lang )subscript (string_'skills') string_'skills' )subscript )for_in_clause (if_clause (subscript (identifier_topic) identifier_topic (string_'learned') string_'learned' )subscript )if_clause )list_comprehension )return_statement )block )function_definition )module
Return the topics learned by a user in a language.
(module (function_definition (function_name_set_duration) function_name_set_duration (parameters (identifier_self) identifier_self (identifier_duration) identifier_duration )parameters (block (if_statement (call (attribute (call (attribute (identifier_self) identifier_self (identifier_get_duration_metadata) identifier_get_duration_metadata )attribute (argument_list )argument_list )call (identifier_is_read_only) identifier_is_read_only )attribute (argument_list )argument_list )call (block (raise_statement (call (attribute (identifier_errors) identifier_errors (identifier_NoAccess) identifier_NoAccess )attribute (argument_list )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier__is_valid_duration) identifier__is_valid_duration )attribute (argument_list (identifier_duration) identifier_duration (call (attribute (identifier_self) identifier_self (identifier_get_duration_metadata) identifier_get_duration_metadata )attribute (argument_list )argument_list )call )argument_list )call )not_operator (block (raise_statement (call (attribute (identifier_errors) identifier_errors (identifier_InvalidArgument) identifier_InvalidArgument )attribute (argument_list )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_map) identifier_map (call (identifier_dict) identifier_dict (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_map) identifier_map (string_'days') string_'days' )subscript (attribute (identifier_duration) identifier_duration (identifier_days) identifier_days )attribute )assignment )expression_statement (expression_statement (assignment (subscript (identifier_map) identifier_map (string_'seconds') string_'seconds' )subscript (attribute (identifier_duration) identifier_duration (identifier_seconds) identifier_seconds )attribute )assignment )expression_statement (expression_statement (assignment (subscript (identifier_map) identifier_map (string_'microseconds') string_'microseconds' )subscript (attribute (identifier_duration) identifier_duration (identifier_microseconds) identifier_microseconds )attribute )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__my_map) identifier__my_map )attribute (string_'duration') string_'duration' )subscript (identifier_map) identifier_map )assignment )expression_statement )block )function_definition )module
Sets the assessment duration. arg: duration (osid.calendaring.Duration): assessment duration raise: InvalidArgument - ``duration`` is invalid raise: NoAccess - ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.*
(module (function_definition (function_name_authGenders) function_name_authGenders (parameters (identifier_self) identifier_self (default_parameter (identifier_countsOnly) identifier_countsOnly (False) False )default_parameter (default_parameter (identifier_fractionsMode) identifier_fractionsMode (False) False )default_parameter (default_parameter (identifier__countsTuple) identifier__countsTuple (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_authDict) identifier_authDict (call (identifier_recordGenders) identifier_recordGenders (argument_list (identifier_self) identifier_self )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (boolean_operator (identifier__countsTuple) identifier__countsTuple (identifier_countsOnly) identifier_countsOnly )boolean_operator (identifier_fractionsMode) identifier_fractionsMode )boolean_operator (block (expression_statement (assignment (identifier_rawList) identifier_rawList (call (identifier_list) identifier_list (argument_list (call (attribute (identifier_authDict) identifier_authDict (identifier_values) identifier_values )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_countsList) identifier_countsList (list )list )assignment )expression_statement (for_statement (identifier_k) identifier_k (tuple (string_'Male') string_'Male' (string_'Female') string_'Female' (string_'Unknown') string_'Unknown' )tuple (block (expression_statement (call (attribute (identifier_countsList) identifier_countsList (identifier_append) identifier_append )attribute (argument_list (call (attribute (identifier_rawList) identifier_rawList (identifier_count) identifier_count )attribute (argument_list (identifier_k) identifier_k )argument_list )call )argument_list )call )expression_statement )block )for_statement (if_statement (identifier_fractionsMode) identifier_fractionsMode (block (expression_statement (assignment (identifier_tot) identifier_tot (call (identifier_sum) identifier_sum (argument_list (identifier_countsList) identifier_countsList )argument_list )call )assignment )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (integer_3) integer_3 )argument_list )call (block (expression_statement (call (attribute (identifier_countsList) identifier_countsList (identifier_append) identifier_append )attribute (argument_list (binary_operator (call (attribute (identifier_countsList) identifier_countsList (identifier_pop) identifier_pop )attribute (argument_list (integer_0) integer_0 )argument_list )call (identifier_tot) identifier_tot )binary_operator )argument_list )call )expression_statement )block )for_statement )block )if_statement (if_statement (identifier__countsTuple) identifier__countsTuple (block (return_statement (call (identifier_tuple) identifier_tuple (argument_list (identifier_countsList) identifier_countsList )argument_list )call )return_statement )block (else_clause (block (return_statement (dictionary (pair (string_'Male') string_'Male' (subscript (identifier_countsList) identifier_countsList (integer_0) integer_0 )subscript )pair (pair (string_'Female') string_'Female' (subscript (identifier_countsList) identifier_countsList (integer_1) integer_1 )subscript )pair (pair (string_'Unknown') string_'Unknown' (subscript (identifier_countsList) identifier_countsList (integer_2) integer_2 )subscript )pair )dictionary )return_statement )block )else_clause )if_statement )block (else_clause (block (return_statement (identifier_authDict) identifier_authDict )return_statement )block )else_clause )if_statement )block )function_definition )module
Creates a dict mapping `'Male'`, `'Female'` and `'Unknown'` to lists of the names of all the authors. # Parameters _countsOnly_ : `optional bool` > Default `False`, if `True` the counts (lengths of the lists) will be given instead of the lists of names _fractionsMode_ : `optional bool` > Default `False`, if `True` the fraction counts (lengths of the lists divided by the total number of authors) will be given instead of the lists of names. This supersedes _countsOnly_ # Returns `dict[str:str or int]` > The mapping of genders to author's names or counts
(module (function_definition (function_name_translate_gitlab_exception) function_name_translate_gitlab_exception (parameters (identifier_func) identifier_func )parameters (block (decorated_definition (decorator (call (attribute (identifier_functools) identifier_functools (identifier_wraps) identifier_wraps )attribute (argument_list (identifier_func) identifier_func )argument_list )call )decorator (function_definition (function_name__wrapper) function_name__wrapper (parameters (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 (return_statement (call (identifier_func) identifier_func (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (except_clause (as_pattern (attribute (identifier_gitlab) identifier_gitlab (identifier_GitlabError) identifier_GitlabError )attribute (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (expression_statement (assignment (identifier_status_to_exception) identifier_status_to_exception (dictionary (pair (integer_401) integer_401 (identifier_UnauthorizedError) identifier_UnauthorizedError )pair (pair (integer_404) integer_404 (identifier_NotFoundError) identifier_NotFoundError )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_exc_class) identifier_exc_class (call (attribute (identifier_status_to_exception) identifier_status_to_exception (identifier_get) identifier_get )attribute (argument_list (attribute (identifier_e) identifier_e (identifier_response_code) identifier_response_code )attribute (identifier_GitClientError) identifier_GitClientError )argument_list )call )assignment )expression_statement (raise_statement (call (identifier_exc_class) identifier_exc_class (argument_list (call (identifier_str) identifier_str (argument_list (identifier_e) identifier_e )argument_list )call (keyword_argument (identifier_status_code) identifier_status_code (attribute (identifier_e) identifier_e (identifier_response_code) identifier_response_code )attribute )keyword_argument )argument_list )call )raise_statement )block )except_clause )try_statement )block )function_definition )decorated_definition (return_statement (identifier__wrapper) identifier__wrapper )return_statement )block )function_definition )module
Decorator to catch GitLab-specific exceptions and raise them as GitClientError exceptions.
(module (function_definition (function_name__get_color_from_config) function_name__get_color_from_config (parameters (identifier_config) identifier_config (identifier_option) identifier_option )parameters (block (if_statement (not_operator (call (attribute (identifier_config) identifier_config (identifier_has_option) identifier_has_option )attribute (argument_list (identifier_COLOR_SECTION) identifier_COLOR_SECTION (identifier_option) identifier_option )argument_list )call )not_operator (block (return_statement (None) None )return_statement )block (else_clause (block (return_statement (call (attribute (identifier_ast) identifier_ast (identifier_literal_eval) identifier_literal_eval )attribute (argument_list (call (attribute (identifier_config) identifier_config (identifier_get) identifier_get )attribute (argument_list (identifier_COLOR_SECTION) identifier_COLOR_SECTION (identifier_option) identifier_option )argument_list )call )argument_list )call )return_statement )block )else_clause )if_statement )block )function_definition )module
Helper method to uet an option from the COLOR_SECTION of the config. Returns None if the value is not present. If the value is present, it tries to parse the value as a raw string literal, allowing escape sequences in the egrc.
(module (function_definition (function_name_append) function_name_append (parameters (identifier_self) identifier_self (identifier_clause) identifier_clause )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_nv) identifier_nv )attribute (call (identifier_max) identifier_max (argument_list (binary_operator (list_comprehension (call (identifier_abs) identifier_abs (argument_list (identifier_l) identifier_l )argument_list )call (for_in_clause (identifier_l) identifier_l (identifier_clause) identifier_clause )for_in_clause )list_comprehension (list (attribute (identifier_self) identifier_self (identifier_nv) identifier_nv )attribute )list )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_clauses) identifier_clauses )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_clause) identifier_clause )argument_list )call )expression_statement )block )function_definition )module
Add one more clause to CNF formula. This method additionally updates the number of variables, i.e. variable ``self.nv``, used in the formula. :param clause: a new clause to add. :type clause: list(int) .. code-block:: python >>> from pysat.formula import CNF >>> cnf = CNF(from_clauses=[[-1, 2], [3]]) >>> cnf.append([-3, 4]) >>> print cnf.clauses [[-1, 2], [3], [-3, 4]]
(module (function_definition (function_name_update_unit) function_name_update_unit (parameters (identifier_self) identifier_self (identifier_unit_id) identifier_unit_id (identifier_unit_dict) identifier_unit_dict )parameters (block (return_statement (call (attribute (identifier_self) identifier_self (identifier__create_put_request) identifier__create_put_request )attribute (argument_list (keyword_argument (identifier_resource) identifier_resource (identifier_UNITS) identifier_UNITS )keyword_argument (keyword_argument (identifier_billomat_id) identifier_billomat_id (identifier_unit_id) identifier_unit_id )keyword_argument (keyword_argument (identifier_send_data) identifier_send_data (identifier_unit_dict) identifier_unit_dict )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Updates an unit :param unit_id: the unit id :param unit_dict: dict :return: dict
(module (function_definition (function_name_save_vip_request) function_name_save_vip_request (parameters (identifier_self) identifier_self (identifier_vip_request) identifier_vip_request )parameters (block (expression_statement (assignment (identifier_uri) identifier_uri (string_'api/v3/vip-request/') string_'api/v3/vip-request/' )assignment )expression_statement (expression_statement (assignment (identifier_data) identifier_data (call (identifier_dict) identifier_dict (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_data) identifier_data (string_'vips') string_'vips' )subscript (call (identifier_list) identifier_list (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (subscript (identifier_data) identifier_data (string_'vips') string_'vips' )subscript (identifier_append) identifier_append )attribute (argument_list (identifier_vip_request) identifier_vip_request )argument_list )call )expression_statement (return_statement (call (attribute (call (identifier_super) identifier_super (argument_list (identifier_ApiVipRequest) identifier_ApiVipRequest (identifier_self) identifier_self )argument_list )call (identifier_post) identifier_post )attribute (argument_list (identifier_uri) identifier_uri (identifier_data) identifier_data )argument_list )call )return_statement )block )function_definition )module
Method to save vip request param vip_request: vip_request object
(module (function_definition (function_name_hardware_info) function_name_hardware_info (parameters (identifier_self) identifier_self (default_parameter (identifier_mask) identifier_mask (integer_0xFFFFFFFF) integer_0xFFFFFFFF )default_parameter )parameters (block (expression_statement (assignment (identifier_buf) identifier_buf (call (parenthesized_expression (binary_operator (attribute (identifier_ctypes) identifier_ctypes (identifier_c_uint32) identifier_c_uint32 )attribute (integer_32) integer_32 )binary_operator )parenthesized_expression (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_res) identifier_res (call (attribute (attribute (identifier_self) identifier_self (identifier__dll) identifier__dll )attribute (identifier_JLINKARM_GetHWInfo) identifier_JLINKARM_GetHWInfo )attribute (argument_list (identifier_mask) identifier_mask (call (attribute (identifier_ctypes) identifier_ctypes (identifier_byref) identifier_byref )attribute (argument_list (identifier_buf) identifier_buf )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_res) identifier_res (integer_0) integer_0 )comparison_operator (block (raise_statement (call (attribute (identifier_errors) identifier_errors (identifier_JLinkException) identifier_JLinkException )attribute (argument_list (identifier_res) identifier_res )argument_list )call )raise_statement )block )if_statement (return_statement (call (identifier_list) identifier_list (argument_list (identifier_buf) identifier_buf )argument_list )call )return_statement )block )function_definition )module
Returns a list of 32 integer values corresponding to the bitfields specifying the power consumption of the target. The values returned by this function only have significance if the J-Link is powering the target. The words, indexed, have the following significance: 0. If ``1``, target is powered via J-Link. 1. Overcurrent bitfield: 0: No overcurrent. 1: Overcurrent happened. 2ms @ 3000mA 2: Overcurrent happened. 10ms @ 1000mA 3: Overcurrent happened. 40ms @ 400mA 2. Power consumption of target (mA). 3. Peak of target power consumption (mA). 4. Peak of target power consumption during J-Link operation (mA). Args: self (JLink): the ``JLink`` instance mask (int): bit mask to decide which hardware information words are returned (defaults to all the words). Returns: List of bitfields specifying different states based on their index within the list and their value. Raises: JLinkException: on hardware error.
(module (function_definition (function_name_unregister) function_name_unregister (parameters (identifier_self) identifier_self (identifier_id) identifier_id )parameters (block (expression_statement (assignment (identifier_result) identifier_result (call (attribute (call (attribute (call (attribute (call (attribute (attribute (identifier_self) identifier_self (identifier_rr) identifier_rr )attribute (identifier_table) identifier_table )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_table) identifier_table )attribute )argument_list )call (identifier_get) identifier_get )attribute (argument_list (identifier_id) identifier_id )argument_list )call (identifier_delete) identifier_delete )attribute (argument_list )argument_list )call (identifier_run) identifier_run )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_result) identifier_result (dictionary (pair (string_'deleted') string_'deleted' (integer_1) integer_1 )pair (pair (string_'errors') string_'errors' (integer_0) integer_0 )pair (pair (string_'inserted') string_'inserted' (integer_0) integer_0 )pair (pair (string_'replaced') string_'replaced' (integer_0) integer_0 )pair (pair (string_'skipped') string_'skipped' (integer_0) integer_0 )pair (pair (string_'unchanged') string_'unchanged' (integer_0) integer_0 )pair )dictionary )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_warn) identifier_warn )attribute (argument_list (concatenated_string (string_'unexpected result attempting to delete id=%s from ') string_'unexpected result attempting to delete id=%s from ' (string_'rethinkdb services table: %s') string_'rethinkdb services table: %s' )concatenated_string (identifier_id) identifier_id (identifier_result) identifier_result )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Remove the service with id `id` from the service registry.
(module (function_definition (function_name_common_update_sys) function_name_common_update_sys (parameters (identifier_self) identifier_self )parameters (block (try_statement (block (expression_statement (call (identifier_sudo) identifier_sudo (argument_list (string_'apt-get update -y --fix-missing') string_'apt-get update -y --fix-missing' )argument_list )call )expression_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (expression_statement (call (identifier_print) identifier_print (argument_list (identifier_e) identifier_e )argument_list )call )expression_statement )block )except_clause )try_statement (expression_statement (call (identifier_print) identifier_print (argument_list (call (identifier_green) identifier_green (argument_list (string_'System package is up to date.') string_'System package is up to date.' )argument_list )call )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list )argument_list )call )expression_statement )block )function_definition )module
update system package
(module (function_definition (function_name__stamp_and_update_hook) function_name__stamp_and_update_hook (parameters (identifier_method) identifier_method (identifier_dependencies) identifier_dependencies (identifier_stampfile) identifier_stampfile (identifier_func) identifier_func (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_result) identifier_result (call (identifier__stamp) identifier__stamp (argument_list (identifier_stampfile) identifier_stampfile (identifier_func) identifier_func (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_method) identifier_method (identifier_update_stampfile_hook) identifier_update_stampfile_hook )attribute (argument_list (identifier_dependencies) identifier_dependencies )argument_list )call )expression_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Write stamp and call update_stampfile_hook on method.
(module (function_definition (function_name_install) function_name_install (parameters (identifier_self) identifier_self (identifier_opener) identifier_opener )parameters (block (expression_statement (assignment (identifier__opener) identifier__opener (conditional_expression (identifier_opener) identifier_opener (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_opener) identifier_opener (identifier_Opener) identifier_Opener )argument_list )call (call (identifier_opener) identifier_opener (argument_list )argument_list )call )conditional_expression )assignment )expression_statement (assert_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier__opener) identifier__opener (identifier_Opener) identifier_Opener )argument_list )call (string_"Opener instance required") string_"Opener instance required" )assert_statement (assert_statement (attribute (identifier__opener) identifier__opener (identifier_protocols) identifier_protocols )attribute (string_"must list one or more protocols") string_"must list one or more protocols" )assert_statement (for_statement (identifier_protocol) identifier_protocol (attribute (identifier__opener) identifier__opener (identifier_protocols) identifier_protocols )attribute (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__protocols) identifier__protocols )attribute (identifier_protocol) identifier_protocol )subscript (identifier__opener) identifier__opener )assignment )expression_statement )block )for_statement (return_statement (identifier_opener) identifier_opener )return_statement )block )function_definition )module
Install an opener. Arguments: opener (`Opener`): an `Opener` instance, or a callable that returns an opener instance. Note: May be used as a class decorator. For example:: registry = Registry() @registry.install class ArchiveOpener(Opener): protocols = ['zip', 'tar']
(module (function_definition (function_name_install_from_pypi) function_name_install_from_pypi (parameters (identifier_context) identifier_context )parameters (block (expression_statement (assignment (identifier_tmp_dir) identifier_tmp_dir (call (attribute (identifier_venv) identifier_venv (identifier_create_venv) identifier_create_venv )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_install_cmd) identifier_install_cmd (binary_operator (string_'%s/bin/pip install %s') string_'%s/bin/pip install %s' (tuple (identifier_tmp_dir) identifier_tmp_dir (attribute (identifier_context) identifier_context (identifier_module_name) identifier_module_name )attribute )tuple )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_package_index) identifier_package_index (string_'pypi') string_'pypi' )assignment )expression_statement (if_statement (attribute (identifier_context) identifier_context (identifier_pypi) identifier_pypi )attribute (block (expression_statement (augmented_assignment (identifier_install_cmd) identifier_install_cmd (binary_operator (string_'-i %s') string_'-i %s' (attribute (identifier_context) identifier_context (identifier_pypi) identifier_pypi )attribute )binary_operator )augmented_assignment )expression_statement (expression_statement (assignment (identifier_package_index) identifier_package_index (attribute (identifier_context) identifier_context (identifier_pypi) identifier_pypi )attribute )assignment )expression_statement )block )if_statement (try_statement (block (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_shell) identifier_shell (identifier_dry_run) identifier_dry_run )attribute (argument_list (identifier_install_cmd) identifier_install_cmd (attribute (identifier_context) identifier_context (identifier_dry_run) identifier_dry_run )attribute )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (not_operator (attribute (identifier_context) identifier_context (identifier_dry_run) identifier_dry_run )attribute )not_operator (not_operator (identifier_result) identifier_result )not_operator )boolean_operator (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_error) identifier_error )attribute (argument_list (string_'Failed to install %s from %s') string_'Failed to install %s from %s' (attribute (identifier_context) identifier_context (identifier_module_name) identifier_module_name )attribute (identifier_package_index) identifier_package_index )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_info) identifier_info )attribute (argument_list (string_'Successfully installed %s from %s') string_'Successfully installed %s from %s' (attribute (identifier_context) identifier_context (identifier_module_name) identifier_module_name )attribute (identifier_package_index) identifier_package_index )argument_list )call )expression_statement )block )else_clause )if_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (expression_statement (assignment (identifier_error_msg) identifier_error_msg (binary_operator (string_'Error installing %s from %s') string_'Error installing %s from %s' (tuple (attribute (identifier_context) identifier_context (identifier_module_name) identifier_module_name )attribute (identifier_package_index) identifier_package_index )tuple )binary_operator )assignment )expression_statement (expression_statement (call (attribute (identifier_log) identifier_log (identifier_exception) identifier_exception )attribute (argument_list (identifier_error_msg) identifier_error_msg )argument_list )call )expression_statement (raise_statement (call (identifier_Exception) identifier_Exception (argument_list (identifier_error_msg) identifier_error_msg (identifier_e) identifier_e )argument_list )call )raise_statement )block )except_clause )try_statement )block )function_definition )module
Attempts to install your package from pypi.
(module (function_definition (function_name_run_git_shell) function_name_run_git_shell (parameters (identifier_cls) identifier_cls (identifier_cmd) identifier_cmd (default_parameter (identifier_cwd) identifier_cwd (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_p) identifier_p (call (identifier_Popen) identifier_Popen (argument_list (identifier_cmd) identifier_cmd (keyword_argument (identifier_shell) identifier_shell (True) True )keyword_argument (keyword_argument (identifier_stdout) identifier_stdout (identifier_PIPE) identifier_PIPE )keyword_argument (keyword_argument (identifier_cwd) identifier_cwd (identifier_cwd) identifier_cwd )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_output) identifier_output (identifier__) identifier__ )pattern_list (call (attribute (identifier_p) identifier_p (identifier_communicate) identifier_communicate )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_output) identifier_output (call (attribute (identifier_cls) identifier_cls (identifier_decode_git_output) identifier_decode_git_output )attribute (argument_list (identifier_output) identifier_output )argument_list )call )assignment )expression_statement (if_statement (attribute (identifier_p) identifier_p (identifier_returncode) identifier_returncode )attribute (block (if_statement (comparison_operator (attribute (identifier_sys) identifier_sys (identifier_version_info) identifier_version_info )attribute (tuple (integer_2) integer_2 (integer_6) integer_6 )tuple )comparison_operator (block (raise_statement (call (identifier_CalledProcessError) identifier_CalledProcessError (argument_list (keyword_argument (identifier_returncode) identifier_returncode (attribute (identifier_p) identifier_p (identifier_returncode) identifier_returncode )attribute )keyword_argument (keyword_argument (identifier_cmd) identifier_cmd (identifier_cmd) identifier_cmd )keyword_argument (keyword_argument (identifier_output) identifier_output (identifier_output) identifier_output )keyword_argument )argument_list )call )raise_statement )block (else_clause (block (raise_statement (call (identifier_CalledProcessError) identifier_CalledProcessError (argument_list (keyword_argument (identifier_returncode) identifier_returncode (attribute (identifier_p) identifier_p (identifier_returncode) identifier_returncode )attribute )keyword_argument (keyword_argument (identifier_cmd) identifier_cmd (identifier_cmd) identifier_cmd )keyword_argument )argument_list )call )raise_statement )block )else_clause )if_statement )block )if_statement (return_statement (identifier_output) identifier_output )return_statement )block )function_definition )module
Runs git shell command, reads output and decodes it into unicode string. @param cmd: Command to be executed. @type cmd: str @type cwd: str @param cwd: Working directory. @rtype: str @return: Output of the command. @raise CalledProcessError: Raises exception if return code of the command is non-zero.
(module (function_definition (function_name_write_sample) function_name_write_sample (parameters (identifier_binary) identifier_binary (identifier_payload) identifier_payload (identifier_path) identifier_path (identifier_filename) identifier_filename )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_path) identifier_path )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_path) identifier_path )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (identifier_sample) identifier_sample (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_path) identifier_path (identifier_filename) identifier_filename )argument_list )call )assignment )expression_statement (if_statement (identifier_binary) identifier_binary (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_sample) identifier_sample (string_"wb") string_"wb" )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_f) identifier_f (identifier_write) identifier_write )attribute (argument_list (call (attribute (identifier_base64) identifier_base64 (identifier_b64decode) identifier_b64decode )attribute (argument_list (identifier_payload) identifier_payload )argument_list )call )argument_list )call )expression_statement )block )with_statement )block (else_clause (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_sample) identifier_sample (string_"w") string_"w" )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_f) identifier_f (identifier_write) identifier_write )attribute (argument_list (identifier_payload) identifier_payload )argument_list )call )expression_statement )block )with_statement )block )else_clause )if_statement )block )function_definition )module
This function writes a sample on file system. Args: binary (bool): True if it's a binary file payload: payload of sample, in base64 if it's a binary path (string): path of file filename (string): name of file hash_ (string): file hash
(module (function_definition (function_name_canonical_uri_path) function_name_canonical_uri_path (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_result) identifier_result (call (identifier_getattr) identifier_getattr (argument_list (identifier_self) identifier_self (string_"_canonical_uri_path") string_"_canonical_uri_path" (None) None )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_result) identifier_result (None) None )comparison_operator (block (expression_statement (assignment (identifier_result) identifier_result (assignment (attribute (identifier_self) identifier_self (identifier__canonical_uri_path) identifier__canonical_uri_path )attribute (call (identifier_get_canonical_uri_path) identifier_get_canonical_uri_path (argument_list (attribute (identifier_self) identifier_self (identifier_uri_path) identifier_uri_path )attribute )argument_list )call )assignment )assignment )expression_statement )block )if_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
The canonicalized URI path from the request.
(module (function_definition (function_name_u2handlers) function_name_u2handlers (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_handlers) identifier_handlers (list )list )assignment )expression_statement (expression_statement (call (attribute (identifier_handlers) identifier_handlers (identifier_append) identifier_append )attribute (argument_list (call (attribute (identifier_u2) identifier_u2 (identifier_ProxyHandler) identifier_ProxyHandler )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_proxy) identifier_proxy )attribute )argument_list )call )argument_list )call )expression_statement (return_statement (identifier_handlers) identifier_handlers )return_statement )block )function_definition )module
Get a collection of urllib handlers. @return: A list of handlers to be installed in the opener. @rtype: [Handler,...]
(module (function_definition (function_name__calc_adu) function_name__calc_adu (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_res) identifier_res (call (attribute (call (identifier_super) identifier_super (argument_list )argument_list )call (identifier__calc_adu) identifier__calc_adu )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_ensure_one) identifier_ensure_one )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_dafs_to_apply) identifier_dafs_to_apply (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_env) identifier_env )attribute (string_'ddmrp.adjustment') string_'ddmrp.adjustment' )subscript (identifier_search) identifier_search )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__daf_to_apply_domain) identifier__daf_to_apply_domain )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (identifier_dafs_to_apply) identifier_dafs_to_apply (block (expression_statement (assignment (identifier_daf) identifier_daf (integer_1) integer_1 )assignment )expression_statement (expression_statement (assignment (identifier_values) identifier_values (call (attribute (identifier_dafs_to_apply) identifier_dafs_to_apply (identifier_mapped) identifier_mapped )attribute (argument_list (string_'value') string_'value' )argument_list )call )assignment )expression_statement (for_statement (identifier_val) identifier_val (identifier_values) identifier_values (block (expression_statement (augmented_assignment (identifier_daf) identifier_daf (identifier_val) identifier_val )augmented_assignment )expression_statement )block )for_statement (expression_statement (assignment (identifier_prev) identifier_prev (attribute (identifier_self) identifier_self (identifier_adu) identifier_adu )attribute )assignment )expression_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier_adu) identifier_adu )attribute (identifier_daf) identifier_daf )augmented_assignment )expression_statement (expression_statement (call (attribute (identifier__logger) identifier__logger (identifier_debug) identifier_debug )attribute (argument_list (binary_operator (string_"DAF=%s applied to %s. ADU: %s -> %s") string_"DAF=%s applied to %s. ADU: %s -> %s" (tuple (identifier_daf) identifier_daf (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute (identifier_prev) identifier_prev (attribute (identifier_self) identifier_self (identifier_adu) identifier_adu )attribute )tuple )binary_operator )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (identifier_dafs_to_explode) identifier_dafs_to_explode (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_env) identifier_env )attribute (string_'ddmrp.adjustment') string_'ddmrp.adjustment' )subscript (identifier_search) identifier_search )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__daf_to_apply_domain) identifier__daf_to_apply_domain )attribute (argument_list (False) False )argument_list )call )argument_list )call )assignment )expression_statement (for_statement (identifier_daf) identifier_daf (identifier_dafs_to_explode) identifier_dafs_to_explode (block (expression_statement (assignment (identifier_prev) identifier_prev (attribute (identifier_self) identifier_self (identifier_adu) identifier_adu )attribute )assignment )expression_statement (expression_statement (assignment (identifier_increased_demand) identifier_increased_demand (binary_operator (binary_operator (identifier_prev) identifier_prev (attribute (identifier_daf) identifier_daf (identifier_value) identifier_value )attribute )binary_operator (identifier_prev) identifier_prev )binary_operator )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_explode_demand_to_components) identifier_explode_demand_to_components )attribute (argument_list (identifier_daf) identifier_daf (identifier_increased_demand) identifier_increased_demand (attribute (identifier_self) identifier_self (identifier_product_uom) identifier_product_uom )attribute )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_res) identifier_res )return_statement )block )function_definition )module
Apply DAFs if existing for the buffer.
(module (function_definition (function_name_human_time) function_name_human_time (parameters (identifier_seconds) identifier_seconds )parameters (block (expression_statement (assignment (identifier_units) identifier_units (list (tuple (string_'y') string_'y' (binary_operator (binary_operator (binary_operator (binary_operator (integer_60) integer_60 (integer_60) integer_60 )binary_operator (integer_24) integer_24 )binary_operator (integer_7) integer_7 )binary_operator (integer_52) integer_52 )binary_operator )tuple (tuple (string_'w') string_'w' (binary_operator (binary_operator (binary_operator (integer_60) integer_60 (integer_60) integer_60 )binary_operator (integer_24) integer_24 )binary_operator (integer_7) integer_7 )binary_operator )tuple (tuple (string_'d') string_'d' (binary_operator (binary_operator (integer_60) integer_60 (integer_60) integer_60 )binary_operator (integer_24) integer_24 )binary_operator )tuple (tuple (string_'h') string_'h' (binary_operator (integer_60) integer_60 (integer_60) integer_60 )binary_operator )tuple (tuple (string_'m') string_'m' (integer_60) integer_60 )tuple (tuple (string_'s') string_'s' (integer_1) integer_1 )tuple )list )assignment )expression_statement (expression_statement (assignment (identifier_seconds) identifier_seconds (call (identifier_int) identifier_int (argument_list (identifier_seconds) identifier_seconds )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_seconds) identifier_seconds (integer_60) integer_60 )comparison_operator (block (return_statement (call (attribute (string_' {0:2d}s') string_' {0:2d}s' (identifier_format) identifier_format )attribute (argument_list (identifier_seconds) identifier_seconds )argument_list )call )return_statement )block )if_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_units) identifier_units )argument_list )call (integer_1) integer_1 )binary_operator )argument_list )call (block (expression_statement (assignment (pattern_list (identifier_unit1) identifier_unit1 (identifier_limit1) identifier_limit1 )pattern_list (subscript (identifier_units) identifier_units (identifier_i) identifier_i )subscript )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_unit2) identifier_unit2 (identifier_limit2) identifier_limit2 )pattern_list (subscript (identifier_units) identifier_units (binary_operator (identifier_i) identifier_i (integer_1) integer_1 )binary_operator )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_seconds) identifier_seconds (identifier_limit1) identifier_limit1 )comparison_operator (block (return_statement (call (attribute (string_'{0:2d}{1}{2:2d}{3}') string_'{0:2d}{1}{2:2d}{3}' (identifier_format) identifier_format )attribute (argument_list (binary_operator (identifier_seconds) identifier_seconds (identifier_limit1) identifier_limit1 )binary_operator (identifier_unit1) identifier_unit1 (binary_operator (parenthesized_expression (binary_operator (identifier_seconds) identifier_seconds (identifier_limit1) identifier_limit1 )binary_operator )parenthesized_expression (identifier_limit2) identifier_limit2 )binary_operator (identifier_unit2) identifier_unit2 )argument_list )call )return_statement )block )if_statement )block )for_statement (return_statement (string_' ~inf') string_' ~inf' )return_statement )block )function_definition )module
Returns a human-friendly time string that is always exactly 6 characters long. Depending on the number of seconds given, can be one of:: 1w 3d 2d 4h 1h 5m 1m 4s 15s Will be in color if console coloring is turned on. Parameters ---------- seconds : int The number of seconds to represent Returns ------- time : str A human-friendly representation of the given number of seconds that is always exactly 6 characters.
(module (function_definition (function_name_save_id_to_path_mapping) function_name_save_id_to_path_mapping (parameters (identifier_self) identifier_self )parameters (block (if_statement (not_operator (attribute (identifier_self) identifier_self (identifier_id_to_path_mapping) identifier_id_to_path_mapping )attribute )not_operator (block (return_statement )return_statement )block )if_statement (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (attribute (identifier_self) identifier_self (identifier_local_id_to_path_mapping_file) identifier_local_id_to_path_mapping_file )attribute (string_'w') string_'w' )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_writer) identifier_writer (call (attribute (identifier_csv) identifier_csv (identifier_writer) identifier_writer )attribute (argument_list (identifier_f) identifier_f )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_writer) identifier_writer (identifier_writerow) identifier_writerow )attribute (argument_list (list (string_'id') string_'id' (string_'path') string_'path' )list )argument_list )call )expression_statement (for_statement (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (call (identifier_sorted) identifier_sorted (argument_list (call (identifier_iteritems) identifier_iteritems (argument_list (attribute (identifier_self) identifier_self (identifier_id_to_path_mapping) identifier_id_to_path_mapping )attribute )argument_list )call )argument_list )call (block (expression_statement (call (attribute (identifier_writer) identifier_writer (identifier_writerow) identifier_writerow )attribute (argument_list (list (identifier_k) identifier_k (identifier_v) identifier_v )list )argument_list )call )expression_statement )block )for_statement )block )with_statement (expression_statement (assignment (identifier_cmd) identifier_cmd (list (string_'gsutil') string_'gsutil' (string_'cp') string_'cp' (attribute (identifier_self) identifier_self (identifier_local_id_to_path_mapping_file) identifier_local_id_to_path_mapping_file )attribute (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_target_dir) identifier_target_dir )attribute (string_'id_to_path_mapping.csv') string_'id_to_path_mapping.csv' )argument_list )call )list )assignment )expression_statement (if_statement (comparison_operator (call (attribute (identifier_subprocess) identifier_subprocess (identifier_call) identifier_call )attribute (argument_list (identifier_cmd) identifier_cmd )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_error) identifier_error )attribute (argument_list (string_'Can\'t copy id_to_path_mapping.csv to target directory') string_'Can\'t copy id_to_path_mapping.csv to target directory' )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Saves mapping from submission IDs to original filenames. This mapping is saved as CSV file into target directory.
(module (function_definition (function_name_send_raw_email) function_name_send_raw_email (parameters (identifier_self) identifier_self (identifier_raw_message) identifier_raw_message (default_parameter (identifier_source) identifier_source (None) None )default_parameter (default_parameter (identifier_destinations) identifier_destinations (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_params) identifier_params (dictionary (pair (string_'RawMessage.Data') string_'RawMessage.Data' (call (attribute (identifier_base64) identifier_base64 (identifier_b64encode) identifier_b64encode )attribute (argument_list (identifier_raw_message) identifier_raw_message )argument_list )call )pair )dictionary )assignment )expression_statement (if_statement (identifier_source) identifier_source (block (expression_statement (assignment (subscript (identifier_params) identifier_params (string_'Source') string_'Source' )subscript (identifier_source) identifier_source )assignment )expression_statement )block )if_statement (if_statement (identifier_destinations) identifier_destinations (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__build_list_params) identifier__build_list_params )attribute (argument_list (identifier_params) identifier_params (identifier_destinations) identifier_destinations (string_'Destinations.member') string_'Destinations.member' )argument_list )call )expression_statement )block )if_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__make_request) identifier__make_request )attribute (argument_list (string_'SendRawEmail') string_'SendRawEmail' (identifier_params) identifier_params )argument_list )call )return_statement )block )function_definition )module
Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails, with attachments or inline content. The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent. :type source: string :param source: The sender's email address. Amazon's docs say: If you specify the Source parameter, then bounce notifications and complaints will be sent to this email address. This takes precedence over any Return-Path header that you might include in the raw text of the message. :type raw_message: string :param raw_message: The raw text of the message. The client is responsible for ensuring the following: - Message must contain a header and a body, separated by a blank line. - All required header fields must be present. - Each part of a multipart MIME message must be formatted properly. - MIME content types must be among those supported by Amazon SES. Refer to the Amazon SES Developer Guide for more details. - Content must be base64-encoded, if MIME requires it. :type destinations: list of strings or string :param destinations: A list of destinations for the message.
(module (function_definition (function_name_resolve_alias) function_name_resolve_alias (parameters (identifier_self) identifier_self (identifier_path_str) identifier_path_str )parameters (block (if_statement (comparison_operator (identifier_path_str) identifier_path_str (attribute (identifier_self) identifier_self (identifier_aliases) identifier_aliases )attribute )comparison_operator (block (return_statement (subscript (attribute (identifier_self) identifier_self (identifier_aliases) identifier_aliases )attribute (identifier_path_str) identifier_path_str )subscript )return_statement )block )if_statement (return_statement (identifier_path_str) identifier_path_str )return_statement )block )function_definition )module
Returns the actual command name. Uses the alias mapping.
(module (function_definition (function_name__bottom) function_name__bottom (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (pattern_list (identifier__) identifier__ (identifier_top) identifier_top (identifier__) identifier__ (identifier_height) identifier_height )pattern_list (attribute (identifier_self) identifier_self (identifier__extents) identifier__extents )attribute )assignment )expression_statement (return_statement (binary_operator (identifier_top) identifier_top (identifier_height) identifier_height )binary_operator )return_statement )block )function_definition )module
Index of row following last row of range
(module (function_definition (function_name_decrypt) function_name_decrypt (parameters (identifier_key) identifier_key (identifier_ciphertext) identifier_ciphertext (default_parameter (identifier_shift_function) identifier_shift_function (identifier_shift_case_english) identifier_shift_case_english )default_parameter )parameters (block (return_statement (list_comprehension (call (identifier_shift_function) identifier_shift_function (argument_list (identifier_key) identifier_key (identifier_symbol) identifier_symbol )argument_list )call (for_in_clause (identifier_symbol) identifier_symbol (identifier_ciphertext) identifier_ciphertext )for_in_clause )list_comprehension )return_statement )block )function_definition )module
Decrypt Shift enciphered ``ciphertext`` using ``key``. Examples: >>> ''.join(decrypt(3, "KHOOR")) HELLO >> decrypt(15, [0xcf, 0x9e, 0xaf, 0xe0], shift_bytes) [0xde, 0xad, 0xbe, 0xef] Args: key (int): The shift to use ciphertext (iterable): The symbols to decrypt shift_function (function (shift, symbol)): Shift function to apply to symbols in the ciphertext Returns: Decrypted ciphertext, list of plaintext symbols
(module (function_definition (function_name_search_indicators_page) function_name_search_indicators_page (parameters (identifier_self) identifier_self (default_parameter (identifier_search_term) identifier_search_term (None) None )default_parameter (default_parameter (identifier_enclave_ids) identifier_enclave_ids (None) None )default_parameter (default_parameter (identifier_from_time) identifier_from_time (None) None )default_parameter (default_parameter (identifier_to_time) identifier_to_time (None) None )default_parameter (default_parameter (identifier_indicator_types) identifier_indicator_types (None) None )default_parameter (default_parameter (identifier_tags) identifier_tags (None) None )default_parameter (default_parameter (identifier_excluded_tags) identifier_excluded_tags (None) None )default_parameter (default_parameter (identifier_page_size) identifier_page_size (None) None )default_parameter (default_parameter (identifier_page_number) identifier_page_number (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_body) identifier_body (dictionary (pair (string_'searchTerm') string_'searchTerm' (identifier_search_term) identifier_search_term )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_params) identifier_params (dictionary (pair (string_'enclaveIds') string_'enclaveIds' (identifier_enclave_ids) identifier_enclave_ids )pair (pair (string_'from') string_'from' (identifier_from_time) identifier_from_time )pair (pair (string_'to') string_'to' (identifier_to_time) identifier_to_time )pair (pair (string_'entityTypes') string_'entityTypes' (identifier_indicator_types) identifier_indicator_types )pair (pair (string_'tags') string_'tags' (identifier_tags) identifier_tags )pair (pair (string_'excludedTags') string_'excludedTags' (identifier_excluded_tags) identifier_excluded_tags )pair (pair (string_'pageSize') string_'pageSize' (identifier_page_size) identifier_page_size )pair (pair (string_'pageNumber') string_'pageNumber' (identifier_page_number) identifier_page_number )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_resp) identifier_resp (call (attribute (attribute (identifier_self) identifier_self (identifier__client) identifier__client )attribute (identifier_post) identifier_post )attribute (argument_list (string_"indicators/search") string_"indicators/search" (keyword_argument (identifier_params) identifier_params (identifier_params) identifier_params )keyword_argument (keyword_argument (identifier_data) identifier_data (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (identifier_body) identifier_body )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_Page) identifier_Page (identifier_from_dict) identifier_from_dict )attribute (argument_list (call (attribute (identifier_resp) identifier_resp (identifier_json) identifier_json )attribute (argument_list )argument_list )call (keyword_argument (identifier_content_type) identifier_content_type (identifier_Indicator) identifier_Indicator )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Search for indicators containing a search term. :param str search_term: The term to search for. If empty, no search term will be applied. Otherwise, must be at least 3 characters. :param list(str) enclave_ids: list of enclave ids used to restrict to indicators found in reports in specific enclaves (optional - by default reports from all of the user's enclaves are used) :param int from_time: start of time window in milliseconds since epoch (optional) :param int to_time: end of time window in milliseconds since epoch (optional) :param list(str) indicator_types: a list of indicator types to filter by (optional) :param list(str) tags: Name (or list of names) of tag(s) to filter indicators by. Only indicators containing ALL of these tags will be returned. (optional) :param list(str) excluded_tags: Indicators containing ANY of these tags will be excluded from the results. :param int page_number: the page number to get. :param int page_size: the size of the page to be returned. :return: a |Page| of |Indicator| objects.