hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
af7a2e72cacc3ea9052916a109167109ed620205
122,459
py
Python
hemlock/test_hemlock.py
Lab41/Hemlock
2c53cfc11bfbe1e4f901b519db578090fe7a17dd
[ "Apache-2.0" ]
4
2015-05-14T18:59:44.000Z
2017-03-09T12:49:36.000Z
hemlock/test_hemlock.py
Lab41/Hemlock
2c53cfc11bfbe1e4f901b519db578090fe7a17dd
[ "Apache-2.0" ]
null
null
null
hemlock/test_hemlock.py
Lab41/Hemlock
2c53cfc11bfbe1e4f901b519db578090fe7a17dd
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # # Copyright (c) 2013 In-Q-Tel, Inc/Lab41, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Test module for hemlock.py Created on 19 August 2013 @author: Charlie Lewis """ from clients.hemlock_runner import Hemlock_Runner from clients.hemlock_base import Hemlock_Base from clients.hfs_old import HFs as hfs_old from clients.hfs import HFs as hfs from clients.hmongo import HMongo from clients.hmysql import HMysql from clients.hredis import HRedis from clients.hrest import HRest from clients.hstream_odd import HStream_Odd from clients.hstream_odd import handle from clients.file_types.hcsv import Hcsv from clients.file_types.hdoc import Hdoc from clients.file_types.hgeneric import Hgeneric from clients.file_types.hjson import Hjson from clients.file_types.hpcap import Hpcap from clients.file_types.hpdf import Hpdf from clients.file_types.hppt import Hppt from clients.file_types.htext import Htext from clients.file_types.hxls import Hxls from clients.file_types.hxml import Hxml from www.hemlock_web import test from hemlock_scheduler import Hemlock_Scheduler import conftest import hemlock import MySQLdb as mdb import pymongo import pytest import re import redis import socket import sys class TestClass: """ Test class for hemlock.py """ def process_print_help(self): """ Tests printing help. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() a.HELP_COUNTER = 2 a.print_help("foo") def process_print_help_specific(self): """ Tests printing help. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() a.HELP_COUNTER = 2 a.print_help("user-tenants-list") def process_debug(self): """ Tests debugging. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") x, error2 = a.process_action(1, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) return x, error def process_client_get(self): """ Tests client-get action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':d[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "client-get", {'--uuid':e[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) return x, error def process_client_list(self): """ Tests client-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "client-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':d[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "client-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) return x, error def process_client_systems_list(self): """ Tests client-systems-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "client-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':d[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "client-systems-list", {'--uuid':e[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) return x, error def process_system_clients_list(self): """ Tests system-clients-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "client-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':d[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "system-clients-list", {'--uuid':d[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) return x, error def process_client_purge(self): """ Tests client-purge action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':d[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "client-purge", {'--uuid':e[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) return x, error def process_client_run(self): """ Tests client-run action. :return: returns any data and a list of any errors """ error = [] hemlock.raw_input = lambda _: 'y' a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':d[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "hemlock-server-store", {'--credential_file':'hemlock/hemlock_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "client-run", {'--uuid':e[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) return x, error def process_client_schedule(self): """ Tests client-schedule action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) return x, error def process_schedule_delete(self): """ Tests schedule-delete action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "schedule-delete", {'--uuid':f[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error6) return x, error def process_client_schedules_list(self): """ Tests client-schedules_list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "client-schedules-list", {'--uuid':d[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error6) return x, error def process_schedule_clients_list(self): """ Tests schedule_clients_list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "schedule-clients-list", {'--uuid':f[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error6) return x, error def process_client_store(self): """ Tests client-store action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) x, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) cur = m_server.cursor() str = "select * from clients where uuid = '"+x[2][1]+"'" cur.execute(str) y = cur.fetchall() return x, y, error def process_schedule_get(self): """ Tests schedule-get action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "schedule-get", {'--uuid':f[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error6) return x, error def process_schedule_list(self): """ Tests schedule-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "schedule-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error6) return x, error def process_role_create(self): """ Tests role-create action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") x, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) cur = m_server.cursor() str = "select * from roles where uuid = '"+x[2][1]+"'" cur.execute(str) y = cur.fetchall() return x, y, error def process_tenant_create(self): """ Tests tenant-create action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") x, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) cur = m_server.cursor() str = "select * from tenants where uuid = '"+x[2][1]+"'" cur.execute(str) y = cur.fetchall() return x, y, error def process_user_create(self): error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' x, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':c[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) cur = m_server.cursor() str = "select * from users where uuid = '"+x[7][1]+"'" cur.execute(str) y = cur.fetchall() return x, y, error def process_register_local_system(self): error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) cur = m_server.cursor() str = "select * from systems where uuid = '"+x[9][1]+"'" cur.execute(str) y = cur.fetchall() return x, y, error def process_register_remote_system(self): """ Tests register-remote-system action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "register-remote-system", {'--name':'remote-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--port':'80', '--remote_uri':'http://remote.uri/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) cur = m_server.cursor() str = "select * from systems where uuid = '"+x[10][1]+"'" cur.execute(str) y = cur.fetchall() return x, y, error def process_role_list(self): """ Tests role-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "role-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "role-create", {'--name':'role2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "role-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) # !! TODO fix what is returned return x, error def process_tenant_list(self): """ Tests tenant-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "tenant-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "tenant-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) # !! TODO fix what is returned return x, error def process_user_list(self): """ Tests user-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "user-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) hemlock.getpass.getpass = lambda _: 'boguspw' e, error4 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':d[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "user-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "role-create", {'--name':'role2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) h, error7 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) hemlock.getpass.getpass = lambda _: 'boguspw' i, error8 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':g[2][1], '--tenant_id':h[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error8) x, error9 = a.process_action(0, "user-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error9) # !! TODO fix what is returned return x, error def process_system_list(self): """ Tests system-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "system-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "system-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':f[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "system-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) # !! TODO fix what is returned return x, error def process_list_all(self): """ Tests list-all action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "list-all", {}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) hemlock.getpass.getpass = lambda _: 'boguspw' e, error4 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':d[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':f[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) # !! TODO fix what is returned return x, error def process_role_users_list(self): """ Tests role-users-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-users-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) hemlock.getpass.getpass = lambda _: 'boguspw' e, error4 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':d[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "role-users-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) hemlock.getpass.getpass = lambda _: 'boguspw' h, error7 = a.process_action(0, "user-create", {'--name':'user2', '--username':'username2', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':g[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) x, error8 = a.process_action(0, "role-users-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error8) # !! TODO fix what is returned return x, error def process_system_tenants_list(self): """ Tests system-tenants-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "system-tenants-list", {'--uuid':c[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "system-add-tenant", {'--uuid':c[9][1], '--tenant_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "system-tenants-list", {'--uuid':c[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) # !! TODO fix what is returned return x, error def process_tenant_systems_list(self): """ Tests tenant-systems-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-systems-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "tenant-systems-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "register-local-system", {'--name':'local-system2', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "tenant-systems-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) # !! TODO fix what is returned return x, error def process_tenant_users_list(self): """ Tests tenant-users-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-users-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) hemlock.getpass.getpass = lambda _: 'boguspw' e, error4 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':d[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "tenant-users-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "role-create", {'--name':'role2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) hemlock.getpass.getpass = lambda _: 'boguspw' h, error7 = a.process_action(0, "user-create", {'--name':'user2', '--username':'username2', '--email':'email@dot.com', '--role_id':g[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) x, error8 = a.process_action(0, "tenant-users-list", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error8) # !! TODO fix what is returned return x, error def process_user_roles_list(self): """ Tests user-roles-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "user-roles-list", {'--uuid':d[7][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "role-create", {'--name':'role2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "user-add-role", {'--uuid':d[7][1], '--role_id':f[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "user-roles-list", {'--uuid':d[7][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) # !! TODO fix what is returned return x, error def process_user_tenants_list(self): """ Tests user-tenants-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "user-tenants-list", {'--uuid':d[7][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "user-add-tenant", {'--uuid':d[7][1], '--tenant_id':f[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "user-tenants-list", {'--uuid':d[7][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) # !! TODO fix what is returned return x, error def process_deregister_local_system(self): """ Tests deregister-local-system action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) x, error3 = a.process_action(0, "deregister-local-system", {'--uuid':c[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) # !! TODO fix what is returned return x, error def process_deregister_remote_system(self): """ Tests deregister-remote-system action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) x, error3 = a.process_action(0, "deregister-remote-system", {'--uuid':c[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) # !! TODO fix what is returned return x, error def process_role_delete(self): """ Tests role-delete action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "role-delete", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) # !! TODO fix what is returned return x, error def process_system_add_tenant(self): """ Tests system-add-tenant action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) x, error4 = a.process_action(0, "system-add-tenant", {'--uuid':c[9][1], '--tenant_id':d[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) # !! TODO fix what is returned return x, error def process_system_get(self): """ Tests system-get action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) x, error3 = a.process_action(0, "system-get", {'--uuid':c[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) # !! TODO fix what is returned return x, error def process_system_remove_tenant(self): """ Tests system-remove-tenant action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) #d, error3 = a.process_action(0, "system-remove-tenant", {'--uuid':c[9][1], '--tenant_id':b[2][1]}, m_server) #error.append(error3) e, error4 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "system-add-tenant", {'--uuid':c[9][1], '--tenant_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) x, error6 = a.process_action(0, "system-remove-tenant", {'--uuid':c[9][1], '--tenant_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) # !! TODO fix what is returned return x, error def process_tenant_delete(self): """ Tests tenant-delete action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "tenant-delete", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) # !! TODO fix what is returned return x, error def process_tenant_get(self): """ Tests tenant-get action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "tenant-get", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) # !! TODO fix what is returned return x, error def process_user_add_role(self): """ Tests user-add-role action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "role-create", {'--name':'role2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "user-add-role", {'--uuid':d[7][1], '--role_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) # !! TODO fix what is returned return x, error def process_user_add_tenant(self): """ Tests user-add-tenant action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':c[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) x, error5 = a.process_action(0, "user-add-tenant", {'--uuid':d[7][1], '--tenant_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) # !! TODO fix what is returned return x, error def process_user_delete(self): """ Tests user-delete action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) x, error4 = a.process_action(0, "user-delete", {'--uuid':d[7][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) # !! TODO fix what is returned return x, error def process_user_get(self): """ Tests user-get action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) x, error4 = a.process_action(0, "user-get", {'--uuid':d[7][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) # !! TODO fix what is returned return x, error def process_user_remove_role(self): """ Tests user-remove-role action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':c[2][1], '--tenant_id':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) #e, error4 = a.process_action(0, "user-remove-role", {'--uuid':d[7][1], '--role_id':c[2][1]}, m_server) #error.append(error4) f, error5 = a.process_action(0, "role-create", {'--name':'role2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "user-add-role", {'--uuid':d[7][1], '--role_id':f[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "user-remove-role", {'--uuid':d[7][1], '--role_id':f[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) # !! TODO fix what is returned return x, error def process_user_remove_tenant(self): """ Tests user-remove-tenant action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':c[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) #e, error4 = a.process_action(0, "user-remove-tenant", {'--uuid':d[7][1], '--tenant_id':c[2][1]}, m_server) #error.append(error4) f, error5 = a.process_action(0, "tenant-create", {'--name':'tenant2'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "user-add-tenant", {'--uuid':d[7][1], '--tenant_id':f[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "user-remove-tenant", {'--uuid':d[7][1], '--tenant_id':f[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) # !! TODO fix what is returned return x, error def process_start_scheduler(self): """ Tests start-scheduler action. :return: returns any data and a list of any errors """ # !! TODO x = "" error = "" return x, error def process_query_data_couchbase(self): """ Tests query-data action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':c[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) hemlock.getpass.getpass = lambda _: 'boguspw' #x, error5 = a.process_action(0, "query-data", {'--user':d[7][1], '--query':'foo'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") #error.append(error5) x = "" return x, error def process_query_data_elasticsearch(self): """ Tests query-data action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "role-create", {'--name':'role1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) hemlock.getpass.getpass = lambda _: 'boguspw' d, error3 = a.process_action(0, "user-create", {'--name':'user1', '--username':'username1', '--email':'email@dot.com', '--role_id':b[2][1], '--tenant_id':c[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':c[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) hemlock.getpass.getpass = lambda _: 'boguspw' x, error5 = a.process_action(0, "query-data", {'--user':d[7][1], '--query':'foo'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) return x, error def process_schedule_change_server(self): """ Tests schedule-change-server action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "schedule-change-server", {'--uuid':f[9][1], '--schedule_server_id':g[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error7) return x, error def process_schedule_server_create(self): """ Tests schedule-server-create action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") x, error1 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error1) return x, error def process_schedule_server_delete(self): """ Tests schedule-server-delete action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "schedule-server-delete", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error2) return x, error def process_schedule_server_get(self): """ Tests schedule-server-get action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "schedule-server-get", {'--uuid':b[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error2) return x, error def process_schedule_server_list(self): """ Tests schedule-server-list action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error1) x, error2 = a.process_action(0, "schedule-server-list", {}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error2) return x, error def process_schedule_add_client(self): """ Tests schedule-add-client action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) x, error7 = a.process_action(0, "schedule-add-client", {'--uuid':f[9][1], '--client_id':g[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) return x, error def process_client_add_schedule(self): """ Tests client-add-schedule action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) h, error7 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':g[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) x, error8 = a.process_action(0, "client-add-schedule", {'--uuid':d[5][1], '--schedule_id':h[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error8) return x, error def process_schedule_remove_client(self): """ Tests schedule-remove-client action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) h, error7 = a.process_action(0, "schedule-add-client", {'--uuid':f[9][1], '--client_id':g[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) x, error8 = a.process_action(0, "schedule-remove-client", {'--uuid':f[9][1], '--client_id':g[5][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error8) return x, error def process_client_remove_schedule(self): """ Tests client-remove-schedule action. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") b, error1 = a.process_action(0, "tenant-create", {'--name':'tenant1'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error1) c, error2 = a.process_action(0, "register-local-system", {'--name':'local-system1', '--data_type':'data-type1', '--description': 'description1', '--tenant_id':b[2][1], '--hostname':'hostname1', '--endpoint':'http://endpoint.com/', '--poc_name':'poc-name1', '--poc_email':'poc-email@dot.com'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error2) d, error3 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error3) e, error4 = a.process_action(0, "schedule-server-create", {'--name':'asdf'}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error4) f, error5 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':d[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 1, "http://127.0.0.1:9200") error.append(error5) g, error6 = a.process_action(0, "client-store", {'--name':'client1', '--type':'mysql', '--system_id':c[9][1], '--credential_file':'hemlock/clients/mysql_creds_sample'}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error6) h, error7 = a.process_action(0, "client-schedule", {'--name':'asdf', '--minute':'1', '--hour':'1', '--day_of_month':'1', '--month':'1', '--day_of_week':'1', '--client_id':g[5][1], '--schedule_server_id':e[2][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error7) i, error8 = a.process_action(0, "client-add-schedule", {'--uuid':d[5][1], '--schedule_id':h[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error8) x, error9 = a.process_action(0, "client-remove-schedule", {'--uuid':d[5][1], '--schedule_id':h[9][1]}, m_server, "localhost", "hemlock", "hemlock", "password", 0, "http://127.0.0.1:9200") error.append(error9) return x, error def process_hemlock_scheduler(self): """ Tests hemlock_scheduler.py. """ sys.argv = ["", "hemlock_creds", "asdf"] a = Hemlock_Scheduler() a.init_schedule() a.check_schedules() def process_hemlock_scheduler2(self): """ Tests hemlock_scheduler.py. """ sys.argv = ["", "hemlock_creds", "asdf"] b = Hemlock_Base() b.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = b.get_creds(0, "hemlock/clients/mysql_creds_sample") sys.argv = ["", "hemlock_creds", "asdf"] a = Hemlock_Scheduler() a.job_work(server_dict, "foo") def connect_mysql(self, debug, server, user, pw, db): """ Makes a connection to the test Hemlock MySQL server. :return: returns an instance of the MySQL connection """ a = hemlock.Hemlock() m_server = a.mysql_server(debug, server, user, pw, db) return m_server def process_hemlock_process_args(self): """ Tests hemlock process_args. :return: returns any data and a list of any errors """ error = [] a = hemlock.Hemlock() x = a.process_args(0, ["client"]) def process_base_args1(self): """ Tests hemlock_base without args. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() x = a.process_args(0, []) def process_base_args2(self): """ Tests hemlock_base with args. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a, b, c = a.process_args(0, ['--uuid', 'asdf', '--client', 'asdf', '--splits',10]) x = a+b+str(c) return x, error def process_base_send_data(self): """ Tests hemlock_base send_data. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") h_server = a.connect_server(0, server_dict, 1) x = a.send_data(0, [[]], [], h_server, "asdf", 1) return x, error def process_base_connect_server_couchbase(self): """ Tests hemlock_base connect_server with couchbase. :return: returns any data and a list of any errors """ error = [] x = "" a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") h_server = a.connect_server(0, server_dict, 0) def process_hfs_old_process_files(self): """ Tests hfs_old process_files. :return: returns any data and a list of any errors """ error = [] x = "" a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = hfs_old() a.process_files(0, "docs/_build/", h_server, "asdf", 0) return x, error def process_hfs_connect_client(self): """ Tests hfs connect_client. :return: returns any data and a list of any errors """ error = [] a = hfs() x = a.connect_client(0, {'FILE_PATH':'docs/_build/'}) x = a.connect_client(0, {}) def process_hfs_get_data(self): """ Tests hfs get_data. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/fs_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = hfs() c_server = a.connect_client(0, {'FILE_PATH':'docs/_build/'}) x = a.get_data(0, client_dict, c_server, h_server, "asdf", 0) return x, error def process_hfs_format_lists(self): """ Tests hfs format_lists. :return: returns any data and a list of any errors """ error = [] x = "" a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/fs_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = hfs() a.format_lists(0, ["'[0]'"], h_server, "asdf", 0) return x, error def process_hstream_odd_start(self): """ Tests hstream_odd start. :return: returns any data and a list of any errors """ error = [] x = "" a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/stream_odd_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = HStream_Odd() a.flag = 0 a.connect_client(0, client_dict, h_server, "asdf", 0) a.start(0, "localhost", 50000, h_server, "asdf", 0, 0) handle(0, "bogus-conn", "bogus-address", h_server, "asdf", 0, 0) return x, error def process_hmysql_connect_client(self): """ Tests hmysql connect_client. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = HMysql() c_server = a.connect_client(0, client_dict) x = a.get_data(0, client_dict, c_server, h_server, "asdf", 0) return x, error def process_hmysql_connect_client2(self): """ Tests hmysql connect_client. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") client_dict['MYSQL_TABLE'] = "tenants" h_server = a.connect_server(0, server_dict, 1) a = HMysql() c_server = a.connect_client(0, client_dict) x = a.get_data(0, client_dict, c_server, h_server, "asdf", 0) return x, error def process_hredis_connect_client(self): """ Tests hredis connect_client. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/redis_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = HRedis() c_server = a.connect_client(0, client_dict) x = a.get_data(0, client_dict, c_server, h_server, "asdf", 0) return x, error def process_hmongo_connect_client(self): """ Tests hmongo connect_client. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mongo_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = HMongo() c_server = a.connect_client(0, client_dict) x = a.get_data(0, client_dict, c_server, h_server, "asdf", 0) return x, error def process_hrest_connect_client(self): """ Tests hrest connect_client. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/rest_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = HRest() a.connect_client(0, client_dict) def process_hrest_get_data(self): """ Tests hrest get_data. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/rest_creds_sample") h_server = a.connect_server(0, server_dict, 1) a = HRest() a.get_data(0, client_dict, "bogus", h_server, "asdf", 0) def process_hemlock_base_update_hemlock(self): """ Tests hemlock_base update_hemlock. :return: returns any data and a list of any errors """ error = [] a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") a.update_hemlock(0, "asdf", server_dict) def process_hemlock_runner_mysql_server(self): """ Tests hemlock_runner mysql_server. :return: returns any data and a list of any errors """ error = [] x = "" a = Hemlock_Runner() x = a.mysql_server(0, "localhost", "travis", "password", "hemlock_test") return x, error def process_hemlock_runner_mysql_server2(self): """ Tests hemlock_runner mysql_server. :return: returns any data and a list of any errors """ error = [] x = "" a = Hemlock_Runner() x = a.mysql_server(0, "localhost", "travis", "bad_password", "hemlock_test") # call tests def test_instanciate(self): """ Calls the test function for instanciation. """ a = hemlock.Hemlock() a.check_args(["tenant-list"], [], {}) a.check_args(["tenant-list"], ["tenant-list"], {}) a.client_add_schedule([], {}) a.client_get([], {}) a.client_list([], {}) a.client_purge([], {}) a.client_remove_schedule([], {}) a.client_run([], {}) a.client_schedule([], {}) a.client_schedules_list([], {}) a.client_store([], {}) a.client_systems_list([], {}) a.deregister_local_system([], {}) a.deregister_remote_system([], {}) a.hemlock_server_store([], {}) a.list_all([], {}) a.query_data([], {}) a.register_local_system([], {}) a.register_remote_system([], {}) a.role_create([], {}) a.role_delete([], {}) a.role_get([], {}) a.role_list([], {}) a.role_users_list([], {}) a.schedule_add_client([], {}) a.schedule_clients_list([], {}) a.schedule_delete([], {}) a.schedule_get([], {}) a.schedule_list([], {}) a.schedule_remove_client([], {}) a.schedule_change_server([], {}) a.schedule_server_create([], {}) a.schedule_server_delete([], {}) a.schedule_server_get([], {}) a.schedule_server_list([], {}) a.start_scheduler([], {}) a.system_add_tenant([], {}) a.system_clients_list([], {}) a.system_get([], {}) a.system_list([], {}) a.system_remove_tenant([], {}) a.system_tenants_list([], {}) a.tenant_create([], {}) a.tenant_delete([], {}) a.tenant_get([], {}) a.tenant_list([], {}) a.tenant_systems_list([], {}) a.tenant_users_list([], {}) a.user_add_role([], {}) a.user_add_tenant([], {}) a.user_create([], {}) a.user_delete([], {}) a.user_get([], {}) a.user_list([], {}) a.user_remove_role([], {}) a.user_remove_tenant([], {}) a.user_roles_list([], {}) a.user_tenants_list([], {}) a.parse_auth() a.read_creds(0) a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" a.client_import(0, "mysql") client_dict, server_dict = a.get_creds(0, "hemlock/clients/mysql_creds_sample") a.stream_callback("data") a.get_args(0) a = Hemlock_Runner() b = hfs_old() a = Hemlock_Base() a.SERVER_CREDS_FILE = "hemlock/hemlock_creds_sample" client_dict, server_dict = a.get_creds(0, "hemlock/clients/fs_creds_sample") b.connect_client(0, client_dict) a = hfs() a = HMongo() a = HMysql() a = HRedis() a = HRest() a = HStream_Odd() a = Hcsv() a = Hdoc() a = Hgeneric() a = Hjson() a = Hpcap() a = Hpdf() a = Hppt() a = Htext() a = Hxls() a = Hxml() a = test() a.GET() def test_process_hemlock_scheduler(self): """ Calls the test function for hemlock_scheduler. """ #with pytest.raises(SystemExit): self.process_hemlock_scheduler() def test_process_hemlock_scheduler2(self): """ Calls the test function for hemlock_scheduler. """ with pytest.raises(SystemExit): self.process_hemlock_scheduler2() def test_connect_mysql(self): """ Calls the test function for connecting to MySQL. """ m_server = self.connect_mysql(0, "localhost", "travis", "password", "hemlock_test") cur = m_server.cursor() cur.execute("DROP TABLE IF EXISTS users_tenants") cur.execute("DROP TABLE IF EXISTS users_roles") cur.execute("DROP TABLE IF EXISTS systems_tenants") cur.execute("DROP TABLE IF EXISTS systems_clients") cur.execute("DROP TABLE IF EXISTS schedules_clients") cur.execute("DROP TABLE IF EXISTS users") cur.execute("DROP TABLE IF EXISTS tenants") cur.execute("DROP TABLE IF EXISTS systems") cur.execute("DROP TABLE IF EXISTS roles") cur.execute("DROP TABLE IF EXISTS schedules") cur.execute("DROP TABLE IF EXISTS hemlock_server") cur.execute("DROP TABLE IF EXISTS clients") cur.execute("DROP TABLE IF EXISTS schedule_servers") m_server.commit() m_server.close() assert 1 def test_connect_redis(self): """ Ensures that redis is running on the server running the tests. """ r = redis.Redis(host='localhost', port=6379, db=0) assert r.set('foo', 'bar') r.hset('test-hash', 'test-field', 'test') b = r.get('foo') c = r.hget('test-hash', 'test-field') assert b == "bar" assert c == "test" def test_connect_mongo(self): """ Ensures that mongo is running on the server running the tests. """ connection = pymongo.MongoClient("127.0.0.1", 27017) db = connection['local'] collection = db['collection'] collection.insert([{"foo":"bar"}]) assert 1 def test_process_print_help(self): """ Calls the test function for print_help. """ with pytest.raises(SystemExit): self.process_print_help() def test_process_print_help_specific(self): """ Calls the test function for print_help. """ with pytest.raises(SystemExit): self.process_print_help_specific() def test_process_debug(self): """ Calls the test function for debugging. """ x, error = self.process_debug() for err in error: assert err == 0 def test_process_role_create(self): """ Calls the test function for the role-create action. """ x, y, error = self.process_role_create() for err in error: assert err == 0 assert x[1][1] == 'role1' a = re.match('[0-f]{8}-[0-f]{4}-[0-f]{4}-[0-f]{4}-[0-f]{12}',x[2][1]) assert a assert len(y) def test_process_tenant_create(self): """ Calls the test function for the tenant-create action. """ x, y, error = self.process_tenant_create() for err in error: assert err == 0 assert x[1][1] == 'tenant1' a = re.match('[0-f]{8}-[0-f]{4}-[0-f]{4}-[0-f]{4}-[0-f]{12}',x[2][1]) assert a assert len(y) def test_process_user_create(self): """ Calls the test function for the user-create action. """ x, y, error = self.process_user_create() for err in error: assert err == 0 assert x[1][1] == 'user1' assert x[4][1] == 'username1' assert x[5][1] == 'email@dot.com' a = re.match('[0-f]{8}-[0-f]{4}-[0-f]{4}-[0-f]{4}-[0-f]{12}',x[7][1]) assert a assert len(y) def test_process_register_local_system(self): """ Calls the test function for the register-local-system action. """ x, y, error = self.process_register_local_system() for err in error: assert err == 0 assert x[2][1] == 'data-type1' assert x[3][1] == 'hostname1' assert x[4][1] == 'poc-name1' assert x[5][1] == 'local-system1' assert x[6][1] == 'poc-email@dot.com' assert x[7][1] == 'http://endpoint.com/' assert x[8][1] == 'description1' assert x[11][1] == '0' a = re.match('[0-f]{8}-[0-f]{4}-[0-f]{4}-[0-f]{4}-[0-f]{12}',x[9][1]) assert a assert len(y) def test_process_register_remote_system(self): """ Calls the test function for the register-remote-system action. """ x, y, error = self.process_register_remote_system() for err in error: assert err == 0 assert x[2][1] == 'data-type1' assert x[3][1] == 'hostname1' assert x[4][1] == 'poc-name1' assert x[5][1] == '80' assert x[6][1] == 'http://remote.uri/' assert x[7][1] == 'remote-system1' assert x[8][1] == 'poc-email@dot.com' assert x[9][1] == 'description1' assert x[12][1] == '1' a = re.match('[0-f]{8}-[0-f]{4}-[0-f]{4}-[0-f]{4}-[0-f]{12}',x[10][1]) assert a assert len(y) def test_process_role_list(self): """ Calls the test function for the role-list action. """ x, error = self.process_role_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_tenant_list(self): """ Calls the test function for the tenant-list action. """ x, error = self.process_tenant_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_system_list(self): """ Calls the test function for the system-list action. """ x, error = self.process_system_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_user_list(self): """ Calls the test function for the user-list action. """ x, error = self.process_user_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_tenant_systems_list(self): """ Calls the test function for the tenant-systems-list action. """ x, error = self.process_tenant_systems_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_tenant_users_list(self): """ Calls the test function for the tenant-users-list action. """ x, error = self.process_tenant_users_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_system_tenants_list(self): """ Calls the test function for the system-tenants-list action. """ x, error = self.process_system_tenants_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_role_users_list(self): """ Calls the test function for the role-users-list action. """ x, error = self.process_role_users_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_user_roles_list(self): """ Calls the test function for the user-roles-list action. """ x, error = self.process_user_roles_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_user_tenants_list(self): """ Calls the test function for the user-tenants-list action. """ x, error = self.process_user_tenants_list() # !! TODO - handle case with nothing, one, and more than one for err in error: assert err == 0 def test_process_deregister_local_system(self): """ Calls the test function for the deregister-local-system action. """ x, error = self.process_deregister_local_system() for err in error: assert err == 0 def test_process_deregister_remote_system(self): """ Calls the test function for the deregister-remote-system action. """ x, error = self.process_deregister_remote_system() for err in error: assert err == 0 def test_process_role_delete(self): """ Calls the test function for the role-delete action. """ x, error = self.process_role_delete() for err in error: assert err == 0 def test_process_system_add_tenant(self): """ Calls the test function for the system-add-tenant action. """ x, error = self.process_system_add_tenant() for err in error: assert err == 0 def test_process_system_get(self): """ Calls the test function for the system-get action. """ x, error = self.process_system_get() for err in error: assert err == 0 def test_process_system_remove_tenant(self): """ Calls the test function for the system-remove-tenant action. """ x, error = self.process_system_remove_tenant() for err in error: assert err == 0 def test_process_tenant_delete(self): """ Calls the test function for the tenant-delete action. """ x, error = self.process_tenant_delete() for err in error: assert err == 0 def test_process_tenant_get(self): """ Calls the test function for the tenant-get action. """ x, error = self.process_tenant_get() for err in error: assert err == 0 def test_process_user_add_role(self): """ Calls the test function for the user-add-role action. """ x, error = self.process_user_add_role() for err in error: assert err == 0 def test_process_user_add_tenant(self): """ Calls the test function for the user-add-tenant action. """ x, error = self.process_user_add_tenant() for err in error: assert err == 0 def test_process_user_delete(self): """ Calls the test function for the user-delete action. """ x, error = self.process_user_delete() for err in error: assert err == 0 def test_process_user_get(self): """ Calls the test function for the user-get action. """ x, error = self.process_user_get() for err in error: assert err == 0 def test_process_user_remove_role(self): """ Calls the test function for the user-remove-role action. """ x, error = self.process_user_remove_role() for err in error: assert err == 0 def test_process_user_remove_tenant(self): """ Calls the test function for the user-remove-tenant action. """ x, error = self.process_user_remove_tenant() for err in error: assert err == 0 def test_process_list_all(self): """ Calls the test function for list-all action. """ x, error = self.process_list_all() for err in error: assert err == 0 def test_process_client_get(self): """ Calls the test function for the client-get action. """ x, error = self.process_client_get() for err in error: assert err == 0 def test_process_client_list(self): """ Calls the test function for the client-list action. """ x, error = self.process_client_list() for err in error: assert err == 0 def test_process_client_systems_list(self): """ Calls the test function for the client-systems-list action. """ x, error = self.process_client_systems_list() for err in error: assert err == 0 def test_process_system_clients_list(self): """ Calls the test function for the system_clients-list action. """ x, error = self.process_system_clients_list() for err in error: assert err == 0 def test_process_client_purge(self): """ Calls the test function for the client-purge action. """ x, error = self.process_client_purge() for err in error: assert err == 0 def test_process_client_run(self): """ Calls the test function for the client-run action. """ with pytest.raises(SystemExit): x, error = self.process_client_run() def test_process_client_schedule(self): """ Calls the test function for the client-schedule action. """ x, error = self.process_client_schedule() for err in error: assert err == 0 def test_process_schedule_delete(self): """ Calls the test function for the schedule-delete action. """ x, error = self.process_schedule_delete() for err in error: assert err == 0 def test_process_client_schedules_list(self): """ Calls the test function for the client-schedules-list action. """ x, error = self.process_client_schedules_list() for err in error: assert err == 0 def test_process_schedule_clients_list(self): """ Calls the test function for the schedule_clients-list action. """ x, error = self.process_schedule_clients_list() for err in error: assert err == 0 def test_process_client_store(self): """ Calls the test function for the client-store action. """ x, y, error = self.process_client_store() for err in error: assert err == 0 def test_process_schedule_get(self): """ Calls the test function for the schedule-get action. """ x, error = self.process_schedule_get() for err in error: assert err == 0 def test_process_schedule_list(self): """ Calls the test function for the schedule-list action. """ x, error = self.process_schedule_list() for err in error: assert err == 0 def test_process_start_scheduler(self): """ Calls the test function for the start-scheduler action. """ x, error = self.process_start_scheduler() for err in error: assert err == 0 def test_process_query_data_couchbase(self): """ Calls the test function for the query-data action. """ x, error = self.process_query_data_couchbase() for err in error: assert err == 0 def test_process_query_data_elasticsearch(self): """ Calls the test function for the query-data action. """ with pytest.raises(SystemExit): x, error = self.process_query_data_elasticsearch() def test_process_schedule_change_server(self): """ Calls the test function for the schedule-change-server action. """ x, error = self.process_schedule_change_server() for err in error: assert err == 0 def test_process_schedule_server_create(self): """ Calls the test function for the schedule-server-create action. """ x, error = self.process_schedule_server_create() for err in error: assert err == 0 def test_process_schedule_server_delete(self): """ Calls the test function for the schedule-server-delete action. """ x, error = self.process_schedule_server_delete() for err in error: assert err == 0 def test_process_schedule_server_get(self): """ Calls the test function for the schedule-server-get action. """ x, error = self.process_schedule_server_get() for err in error: assert err == 0 def test_process_schedule_server_list(self): """ Calls the test function for the schedule-server-list action. """ x, error = self.process_schedule_server_list() for err in error: assert err == 0 def test_process_schedule_add_client(self): """ Calls the test function for the schedule-add-client action. """ x, error = self.process_schedule_add_client() for err in error: assert err == 0 def test_process_client_add_schedule(self): """ Calls the test function for the client-add-schedule action. """ x, error = self.process_client_add_schedule() for err in error: assert err == 0 def test_process_schedule_remove_client(self): """ Calls the test function for the schedule-remove-client action. """ x, error = self.process_schedule_remove_client() for err in error: assert err == 0 def test_process_client_remove_schedule(self): """ Calls the test function for the client-remove-schedule action. """ x, error = self.process_client_remove_schedule() for err in error: assert err == 0 def test_process_base_args1(self): """ Calls the test function for the hemlock_base without arguments. """ with pytest.raises(SystemExit): x, error = self.process_base_args1() def test_process_base_args2(self): """ Calls the test function for the hemlock_base with arguments. """ x, error = self.process_base_args2() for err in error: assert err == 0 def test_process_base_send_data(self): """ Calls the test function for the hemlock_base send_data. """ x, error = self.process_base_send_data() for err in error: assert err == 0 def test_process_base_connect_server_couchbase(self): """ Calls the test function for the hemlock_base connect_server with couchbase. """ with pytest.raises(SystemExit): x, error = self.process_base_connect_server_couchbase() def test_process_hemlock_process_args(self): """ Calls the test function for the hemlock process_args. """ with pytest.raises(SystemExit): x, error = self.process_hemlock_process_args() def test_process_hfs_old_process_files(self): """ Calls the test function for the hfs_old process_files. """ x, error = self.process_hfs_old_process_files() for err in error: assert err == 0 def test_process_hfs_connect_client(self): """ Calls the test function for the hfs connect_client. """ with pytest.raises(SystemExit): x, error = self.process_hfs_connect_client() def test_process_hfs_get_data(self): """ Calls the test function for the hfs get_data. """ x, error = self.process_hfs_get_data() for err in error: assert err == 0 def test_process_hfs_format_lists(self): """ Calls the test function for the hfs format_lists. """ x, error = self.process_hfs_format_lists() for err in error: assert err == 0 def test_process_hstream_odd_start(self): """ Calls the test function for the hstream_odd start. """ x, error = self.process_hstream_odd_start() for err in error: assert err == 0 def test_process_hemlock_runner_mysql_server(self): """ Calls the test function for the hemlock_runner mysql_server. """ x, error = self.process_hemlock_runner_mysql_server() for err in error: assert err == 0 def test_process_hemlock_runner_mysql_server2(self): """ Calls the test function for the hemlock_runner mysql_server. """ with pytest.raises(SystemExit): x, error = self.process_hemlock_runner_mysql_server2() def test_process_hmysql_connect_client(self): """ Calls the test function for the hmysql connect_client. """ x, error = self.process_hmysql_connect_client() for err in error: assert err == 0 def test_process_hmysql_connect_client2(self): """ Calls the test function for the hmysql connect_client. """ x, error = self.process_hmysql_connect_client2() for err in error: assert err == 0 def test_process_hredis_connect_client(self): """ Calls the test function for the hredis connect_client. """ x, error = self.process_hredis_connect_client() for err in error: assert err == 0 def test_process_hmongo_connect_client(self): """ Calls the test function for the hmongo connect_client. """ x, error = self.process_hmongo_connect_client() for err in error: assert err == 0 def test_process_hrest_connect_client(self): """ Calls the test function for the hrest connect_client. """ with pytest.raises(SystemExit): x, error = self.process_hrest_connect_client() def test_process_hrest_get_data(self): """ Calls the test function for the hrest get_data. """ with pytest.raises(SystemExit): x, error = self.process_hrest_get_data() def test_process_hemlock_base_update_hemlock(self): """ Calls the test function for the hemlock_base update_hemlock. """ self.process_hemlock_base_update_hemlock() def test_process_hemlock_get_auth(self, server_mysql, database, mysql_username, mysql_password, couchbase_server, couchbase_bucket, couchbase_username, couchbase_password, elasticsearch_endpoint, hemlock_debug, no_couchbase, hemlock_version): """ Calls the test function for process_hemlock_get_auth. """ a = hemlock.Hemlock() a.get_auth()
52.444968
402
0.598233
16,288
122,459
4.355661
0.021181
0.0667
0.051899
0.055395
0.912989
0.891085
0.874678
0.847586
0.832983
0.795955
0
0.049993
0.212038
122,459
2,334
403
52.467438
0.685241
0.111131
0
0.634549
0
0.003441
0.323783
0.030738
0
0
0
0.015424
0.0702
1
0.11287
false
0.232622
0.022023
0
0.182381
0.005506
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
1
0
0
0
0
0
8
bb8a8156e29b9564a30ac647747098799e0ace2c
2,382
py
Python
2017/day1/puzzle1.py
tcmitchell/AdventOfCode
caaac1aa37c999d4804f9f4154bf7033a06e98af
[ "MIT" ]
null
null
null
2017/day1/puzzle1.py
tcmitchell/AdventOfCode
caaac1aa37c999d4804f9f4154bf7033a06e98af
[ "MIT" ]
null
null
null
2017/day1/puzzle1.py
tcmitchell/AdventOfCode
caaac1aa37c999d4804f9f4154bf7033a06e98af
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 input = '5255443714755555317777152441826784321918285999594221531636242944998363716119294845838579943562543247239969555791772392681567883449837982119239536325341263524415397123824358467891963762948723327774545715851542429832119179139914471523515332247317441719184556891362179267368325486642376685657759623876854958721636574219871249645773738597751429959437466876166273755524873351452951411628479352522367714269718514838933283861425982562854845471512652555633922878128558926123935941858532446378815929573452775348599693982834699757734714187831337546474515678577158721751921562145591166634279699299418269158557557996583881642468274618196335267342897498486869925262896125146867124596587989531495891646681528259624674792728146526849711139146268799436334618974547539561587581268886449291817335232859391493839167111246376493191985145848531829344198536568987996894226585837348372958959535969651573516542581144462536574953764413723147957237298324458181291167587791714172674717898567269547766636143732438694473231473258452166457194797819423528139157452148236943283374193561963393846385622218535952591588353565319432285579711881559343544515461962846879685879431767963975654347569385354482226341261768547328749947163864645168428953445396361398873536434931823635522467754782422557998262858297563862492652464526366171218276176258582444923497181776129436396397333976215976731542182878979389362297155819461685361676414725597335759976285597713332688275241271664658286868697167515329811831234324698345159949135474463624749624626518247831448143876183133814263977611564339865466321244399177464822649611969896344874381978986453566979762911155931362394192663943526834148596342268321563885255765614418141828934971927998994739769141789185165461976425151855846739959338649499379657223196885539386154935586794548365861759354865453211721551776997576289811595654171672259129335243531518228282393326395241242185795828261319215164262237957743232558971289145639852148197184265766291885259847236646615935963759631145338159257538114359781854685695429348428884248972177278361353814766653996675994784195827214295462389532422825696456457332417366426619555' # Make the list circular (for our purposes) input += input[0] prev = input[0] captcha_sum = 0 for i in range(1, len(input)): curr = input[i] if prev == curr: captcha_sum += int(prev) prev = curr print(captcha_sum)
140.117647
2,120
0.956759
44
2,382
51.727273
0.590909
0.013181
0
0
0
0
0
0
0
0
0
0.912818
0.027288
2,382
16
2,121
148.875
0.069486
0.026448
0
0
0
0
0.91066
0.91066
0
1
0
0
0
1
0
false
0
0
0
0
0.1
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
8
bbc4fab43198ec15a1fe9f07874c171b330a672b
270,417
py
Python
bin/lib/Astro_Libraries/old_versions/Abundances_Class_old.py
Delosari/dazer
7078895d7b2f3029944c354b687d739152fceef2
[ "MIT" ]
null
null
null
bin/lib/Astro_Libraries/old_versions/Abundances_Class_old.py
Delosari/dazer
7078895d7b2f3029944c354b687d739152fceef2
[ "MIT" ]
null
null
null
bin/lib/Astro_Libraries/old_versions/Abundances_Class_old.py
Delosari/dazer
7078895d7b2f3029944c354b687d739152fceef2
[ "MIT" ]
null
null
null
from scipy.stats import truncnorm from uncertainties import ufloat, umath, unumpy, UFloat from pyneb import RecAtom, Atom, atomicData, Diagnostics from numpy import ndarray, zeros, mean, median, where, std, log10, power, random, exp, loadtxt, nan as np_nan, isnan, savetxt, transpose, copy, vstack, nanmean, nanstd, empty, all as np_all, sum as np_sum from collections import OrderedDict from pandas import Series, isnull, notnull from lmfit import Parameters, minimize as lmfit_minimmize, report_fit, models import numexpr from timeit import default_timer as timer def residual_Y_v3(pars, x, y): return (y - pars['Y'] * x) class Chemical_Analysis_pyneb(): def __init__(self): self.MC_array_len = 1000 self.MC_warning_limit = self.MC_array_len * 0.1 self.Hbeta_label = 'H1_4861A' def load_elements(self): #Set atomic data atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') atomicData.setDataFile('s_iii_coll_HRS12.dat') #Default: 's_iii_atom_PKW09.dat' 'S3: All energy and A values: Podobedova, Kelleher, and Wiese 2009, J. Phys. Chem. Ref. Data, Vol.' 'S3: collision strengths: Tayal & Gupta 1999, ApJ, 526, 544' #New Atomic data s_iii_coll_HRS12.dat 'S3: All energy and A values: Podobedova, Kelleher, and Wiese 2009, J. Phys. Chem. Ref. Data, Vol.' 'S3: collision strengths: Hudson, Ramsbottom & Scott 2012, ApJ, 750, 65' #Declare ions self.S2_atom = Atom('S', 2) self.S3_atom = Atom('S', 3) self.Ar3_atom = Atom('Ar', 3) self.Ar4_atom = Atom('Ar', 4) self.N2_atom = Atom('N', 2) self.O2_atom = Atom('O', 2) self.O3_atom = Atom('O', 3) self.H1_atom = RecAtom('H', 1) self.He1_atom = RecAtom('He', 1) self.He2_atom = RecAtom('He', 2) #Pyneb objects self.diags = Diagnostics() #Ohrs 2016 relation for the OI_SI gradient self.logSI_OI_Gradient = random.normal(-1.53, 0.05, size = self.MC_array_len) # random.normal(-1.78, 0.03, size = self.MC_array_len) self.OI_SI = power(10, -self.logSI_OI_Gradient) #Theoretical ratios self.S3_ratio = self.S3_atom.getEmissivity(10000, 1000, wave = 9531) / self.S3_atom.getEmissivity(10000, 1000, wave = 9069) self.S3_9000_ratio = random.normal(self.S3_atom.getEmissivity(10000, 1000, wave = 9531) / self.S3_atom.getEmissivity(10000, 1000, wave = 9069), 0.01, size = self.MC_array_len) self.N2_6000_ratio = self.N2_atom.getEmissivity(10000, 1000, wave = 6584) / self.N2_atom.getEmissivity(10000, 1000, wave = 6548) #Factors to speed calculations self.lines_factors = {} self.lines_factors['S3_9069A'] = 1 + self.S3_ratio self.lines_factors['S3_9531A'] = 1 + 1/self.S3_ratio #Cloudy models for the SIV contribution self.m_SIV_correction = random.normal(1.1628, 0.00559, size = self.MC_array_len) self.n_SIV_correction = random.normal(0.0470, 0.0097, size = self.MC_array_len) #self.m_SIV_correction = random.normal(1.109, 0.01, size = self.MC_array_len) #self.n_SIV_correction = random.normal(0.135, 0.0173, size = self.MC_array_len) #Truncated gaussian for the density lower_trunc, upper_trunc = (1.0 - 50.0) / 25.0, (100 - 50) / 25.0 self.Truncated_gaussian = truncnorm(lower_trunc, upper_trunc, loc = 50, scale = 25) print '-Elements loaded\n' return def declare_object(self, lines_log_frame): #List of all parameters # lineRatios = ['R_SII', 'R_SII_prime', 'R_SIII', 'R_NII', 'R_OII', 'R_OII_prime', 'R_OIII'] # elecProperties = ['neSII', 'neOII', 'TeOII', 'TeSII', 'TeNII', 'TeOIII', 'TeSIII', 'TeOII_from_TeOIII', 'TeNII_from_TeOIII', 'TeSIII_from_TeOIII', 'TeOIII_from_TeSIII'] # ionicAbund = ['SII_HII', 'SIII_HII', 'SIV_HII', 'OII_HII', 'OII_HII_3279A', 'OII_HII_7319A', 'NII_HII', 'ArIII_HII', 'ArIV_HII', 'HeII_HII_from_O', # 'HeIII_HII_from_O', 'HeII_HII_from_S', 'HeIII_HII_from_S'] # elemAbund = ['SI_HI', 'OI_HI', 'NI_OI', 'NI_HI', 'HeI_HI_from_O', 'HeI_HI_from_S', 'Ymass_O', 'Ymass_S'] self.abunData = Series() self.Hbeta_flux = random.normal(lines_log_frame.loc['H1_4861A', 'line_Int'].nominal_value, lines_log_frame.loc['H1_4861A', 'line_Int'].std_dev, size = self.MC_array_len) self.low_density_dist = self.Truncated_gaussian.rvs(self.MC_array_len) #Generate a dictionary to store the random array for all lines self.lines_dict = OrderedDict() #Dictionary with lines which my need special treatements Blended_lines = {} Blended_lines['O2_3726A'] = ('O2_3726A', 'O2_3729A') Blended_lines['O2_7319A'] = ('O2_7319A', 'O2_7330A') NoError_lines = {} NoError_lines['N2_6548A'] = ('N2_6548A') #Generate for line in lines_log_frame.index.values: #Start with the particular cases: Blended lines if line in Blended_lines: blended_lines = Blended_lines[line] if set(lines_log_frame.index) >= set(blended_lines): label_line = line + '+' #Lines are blended we use integrated flux else we add the individual integrated if lines_log_frame.loc[blended_lines[0], 'flux_intg'] == lines_log_frame.loc[blended_lines[1]]['flux_intg']: flux_line = lines_log_frame.loc[blended_lines[0], 'line_IntBrute_dered'].nominal_value error_line = lines_log_frame.loc[blended_lines[0], 'line_IntBrute_dered'].std_dev else: line_sum = lines_log_frame.loc[blended_lines[0], 'line_IntBrute_dered'] + lines_log_frame.loc[blended_lines[1], 'line_IntBrute_dered'] flux_line = line_sum.nominal_value error_line = line_sum.std_dev #Case only one of the lines was measured else: label_line = line flux_line = lines_log_frame.loc[line, 'line_Int'].nominal_value error_line = lines_log_frame.loc[line, 'line_Int'].std_dev #Lines with not error elif (line in NoError_lines) and (lines_log_frame.loc[line, 'line_Int'].std_dev == 0.0): label_line = line flux_line = lines_log_frame.loc[line, 'line_Int'].nominal_value error_line = lines_log_frame.loc['N2_6584A', 'line_Int'].std_dev / self.N2_6000_ratio #None-issue lines else: label_line = line flux_line = lines_log_frame.loc[line, 'line_Int'].nominal_value error_line = lines_log_frame.loc[line, 'line_Int'].std_dev #Generate line gaussian shaped array self.lines_dict[label_line] = random.normal(flux_line, error_line, size = self.MC_array_len) return def den_temp_diagnostic_pair(self, diagProperties, den_distribution = None, atom_temp = None): #Check if all necessary lines are there if self.lines_dict.viewkeys() >= set(diagProperties['required_denlines'] + diagProperties['required_temlines']): if den_distribution is None: den_ratio = numexpr.evaluate(diagProperties['den_ratio'], self.lines_dict) tem_ratio = numexpr.evaluate(diagProperties['tem_ratio'], self.lines_dict) Te, ne = self.diags.getCrossTemDen(diag_tem = diagProperties['diag_tem'], diag_den = diagProperties['diag_den'], value_tem = tem_ratio, value_den = den_ratio) else: tem_ratio = numexpr.evaluate(diagProperties['tem_ratio'], self.lines_dict) Te = atom_temp.getTemDen(tem_ratio, den = den_distribution, to_eval = diagProperties['atom_temdiag']) ne = den_distribution #else empty (nan) arrays else: Te, ne = empty(self.MC_array_len), empty(self.MC_array_len) Te[:], ne[:] = np_nan, np_nan return Te, ne def determine_electron_parameters(self, objectData): #----------To start make sure we are not in the very low density regimes, low_density_dist = None if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: S2_ratio = mean(self.lines_dict['S2_6716A']) / mean(self.lines_dict['S2_6731A']) if S2_ratio > 1.35: print '--Low density object' lower, upper, mu, sigma = 1.0, 100.0, 50.0, 25.0 X_func = truncnorm((lower - mu) / sigma, (upper - mu) / sigma, loc=mu, scale=sigma) low_density_dist = X_func.rvs(self.MC_array_len) self.abunData['neSII'] = low_density_dist if low_density_dist is None: print 'WARNING: QUE PASA!!!!!!' print lower, upper, mu, sigma print xrange #-----------Sulfur diagProperties = {} diagProperties['required_denlines'] = ['S2_6716A', 'S2_6731A'] diagProperties['required_temlines'] = ['S3_9069A', 'S3_9531A', 'S3_6312A'] if objectData.SIII_lines == 'BOTH' else [objectData.SIII_lines] + ['S3_6312A'] diagProperties['diag_den'] = '[SII] 6731/6716' diagProperties['diag_tem'] = '[SIII] 6312/9200+' diagProperties['atom_temdiag'] = 'L(6312)/(L(9069)+L(9531))' diagProperties['den_ratio'] = 'S2_6731A/S2_6716A' diagProperties['tem_ratio'] = 'S3_6312A/(S3_9069A+S3_9531A)' if objectData.SIII_lines == 'BOTH' else 'S3_6312A/({valid_line} * {line_factor})'.format(valid_line = objectData.SIII_lines, line_factor=self.lines_factors[objectData.SIII_lines]) if '*' in diagProperties['tem_ratio']: print '-- Using factor', diagProperties['tem_ratio'] S3_lines = ['S3_9069A', 'S3_9531A', 'S3_6312A'] if objectData.SIII_lines == 'BOTH' else [objectData.SIII_lines] + ['S3_6312A'] #--Calculate NeSII and TeSIII self.abunData['TeSIII'], neSII_TSIII = self.den_temp_diagnostic_pair(diagProperties, low_density_dist, atom_temp=self.S3_atom) #--Determine empirical TOIII from TSIII #Epm & Diaz 2005 self.abunData['TeOIII_from_TeSIII'] = (0.95 * self.abunData.TeSIII/10000 + 0.076) * 10000 diagProperties = {} diagProperties['required_denlines'] = ['S2_6716A', 'S2_6731A'] diagProperties['required_temlines'] = ['S2_4069A', 'S2_4076A'] diagProperties['diag_den'] = '[SII] 6731/6716' diagProperties['diag_tem'] = '[SII] 4069/4076' diagProperties['atom_temdiag'] = 'L(4069)/L(4076)' diagProperties['den_ratio'] = 'S2_6731A/S2_6716A' diagProperties['tem_ratio'] = 'S2_4069A/S2_4076A' # #--Calculate NeSII and TeSII self.abunData['TeSII'], neSII_TSII = self.den_temp_diagnostic_pair(diagProperties, low_density_dist, atom_temp=self.S2_atom) #-----------Oxygen diagProperties = {} diagProperties['required_denlines'] = ['S2_6716A', 'S2_6731A'] diagProperties['required_temlines'] = ['O3_4363A', 'O3_4959A', 'O3_5007A'] diagProperties['diag_den'] = '[SII] 6731/6716' diagProperties['diag_tem'] = '[OIII] 4363/5007+' diagProperties['atom_temdiag'] = 'L(4363)/(L(5007)+L(4959))' diagProperties['den_ratio'] = 'S2_6731A/S2_6716A' diagProperties['tem_ratio'] = 'O3_4363A/(O3_4959A+O3_5007A)' #--Calculate NeSII and TeOIII self.abunData['TeOIII'], neSII_OIII = self.den_temp_diagnostic_pair(diagProperties, low_density_dist, atom_temp=self.O3_atom) #--Determine empirical TOIII from TSIII #Epm & Diaz 2005 self.abunData['TeSIII_from_TeOIII'] = (1.05 * self.abunData.TeOIII/10000 - 0.08) * 10000 #--Determine empirical TOII from TOIII #Dors Jr 2006 self.abunData['TeOII_from_TeOIII'] = (1.397 / ((1/(self.abunData.TeOIII/10000)) + 0.385) ) * 10000 #--Determine empirical TNII from TOIII #Epm 2014 self.abunData['TeNII_from_TeOIII'] = (1.452 / ((1/(self.abunData.TeOIII/10000)) + 0.479) ) * 10000 #-----------Nitrogen diagProperties = {} diagProperties['required_denlines'] = ['S2_6716A', 'S2_6731A'] diagProperties['required_temlines'] = ['N2_5755A', 'N2_6548A', 'N2_6584A'] diagProperties['diag_den'] = '[SII] 6731/6716' diagProperties['diag_tem'] = '[NII] 5755/6584+' diagProperties['atom_temdiag'] = '(L(6584) + L(6548)) / L(5755)' diagProperties['den_ratio'] = 'S2_6731A/S2_6716A' diagProperties['tem_ratio'] = '(N2_6548A+N2_6584A)/N2_5755A' #--Calculate Ne_SII and Te_NII self.abunData['TeNII'], neSII_TNII = self.den_temp_diagnostic_pair(diagProperties, low_density_dist, atom_temp=self.N2_atom) #Assign object density from lines or from the low density distribution #--This code favors the neSII calculated from SIII-SII line pai+ if 'neSII' not in self.abunData: if np_sum(isnan(neSII_TSIII)) < self.MC_array_len: self.abunData['neSII'] = neSII_TSIII elif np_sum(isnan(neSII_OIII)) < self.MC_array_len: self.abunData['neSII'] = neSII_OIII else: self.abunData['neSII'] = neSII_TSIII #--Check if some results contain nan entries nanCount = OrderedDict() for electron_parameter in self.abunData.index: variable_array = self.abunData[electron_parameter] nan_count = np_sum(isnan(variable_array)) if nan_count > self.MC_array_len * 0.90: self.abunData.drop(electron_parameter, inplace=True) elif nan_count > 0: mag, error = nanmean(self.abunData[electron_parameter]), nanstd(self.abunData[electron_parameter]) self.abunData[electron_parameter] = random.normal(mag, error, size = self.MC_array_len) if nan_count > self.MC_warning_limit: nanCount[electron_parameter] = nan_count #Display calculations with issues if len(nanCount) > 0: print '-Issues calculating:' for element in nanCount: print '--', element, nanCount[element] return def determine_ionic_abundance(self, abund_code, atom, diagnos_eval, diagnos_mag, tem, den): try: hbeta_flux = self.Hbeta_flux except AttributeError: hbeta_flux = self.H1_atom.getEmissivity(tem=tem, den=den, label = '4_2', product = False) print '--Warning using theoretical Hbeta emissivity' #Ionic abundance calculation using pyneb ionic_abund = atom.getIonAbundance(int_ratio = diagnos_mag, tem=tem, den=den, to_eval = diagnos_eval, Hbeta = hbeta_flux) #Evaluate the nan array nan_idcs = isnan(ionic_abund) nan_count = np_sum(nan_idcs) #Directly save if not nan if nan_count == 0: self.abunData[abund_code] = ionic_abund #Remove the nan entries performing a normal distribution elif nan_count < 0.90 * self.MC_array_len: mag, error = nanmean(ionic_abund), nanstd(ionic_abund) #Generate truncated array to store the data a, b = (0 - mag) / error, (1000 * mag - mag) / error new_samples = truncnorm(a, b, loc = mag, scale=error).rvs(size = nan_count) #Replace nan entries ionic_abund[nan_idcs] = new_samples self.abunData[abund_code] = ionic_abund if nan_count > self.MC_warning_limit: print '-- {} calculated with {}'.format(abund_code, nan_count) return def check_obsLines(self, lines_list, just_one_line = False): #WARNING it would be better something that reads a standard preference over some. eval_lines = map(lambda x : 'L({})'.format(x[x.find('_') + 1 :len(x)-1]), lines_list) #Right format for pyneb eval: Ar3_7751A -> L(7751) diagnos_eval = None #Case all lines are there if self.lines_dict.viewkeys() >= set(lines_list): diagnos_mag = zeros(self.MC_array_len) for i in range(len(lines_list)): diagnos_mag += self.lines_dict[lines_list[i]] diagnos_eval = '+'.join(eval_lines) #Case we can use any line: #WARNING last line is favoured elif just_one_line: diagnos_mag = zeros(self.MC_array_len) for i in range(len(lines_list)): if lines_list[i] in self.lines_dict: diagnos_mag = self.lines_dict[lines_list[i]] diagnos_eval = eval_lines[i] #Case none of the lines if diagnos_eval is None: diagnos_mag = self.generate_nan_array() diagnos_eval = '+'.join(eval_lines) return diagnos_eval, diagnos_mag def argon_abundance_scheme(self, Tlow, Thigh, ne): #Calculate the Ar_+2 abundance according to the lines observed Ar3_lines = ['Ar3_7136A', 'Ar3_7751A'] diagnos_eval, diagnos_mag = self.check_obsLines(Ar3_lines, just_one_line = True) self.determine_ionic_abundance('ArIII_HII', self.Ar3_atom, diagnos_eval, diagnos_mag, Tlow, ne) #Calculate the Ar_+3 abundance according to the lines observed Ar4_lines = ['Ar4_4740A', 'Ar4_4711A'] diagnos_eval, diagnos_mag = self.check_obsLines(Ar4_lines, just_one_line = True) self.determine_ionic_abundance('ArIV_HII', self.Ar4_atom, diagnos_eval, diagnos_mag, Thigh, ne) def oxygen_abundance_scheme(self, Tlow, Thigh, ne): #Calculate the O_+1 abundances from 3200+ lines O2_lines = ['O2_3726A+'] diagnos_eval, diagnos_mag = self.check_obsLines(O2_lines) diagnos_eval = 'L(3726)+L(3729)' self.determine_ionic_abundance('OII_HII_3279A', self.O2_atom, diagnos_eval, diagnos_mag, Tlow, ne) #Calculate the O_+1 abundances from 7300+ lines O2_lines = ['O2_7319A+'] diagnos_eval, diagnos_mag = self.check_obsLines(O2_lines) diagnos_eval = 'L(7319)+L(7330)' self.determine_ionic_abundance('OII_HII_7319A', self.O2_atom, diagnos_eval, diagnos_mag, Tlow, ne) #Get the ratios for empirical relation between OII lines if 'O2_3726A+' in self.lines_dict: self.abunData['O_R3200'] = self.lines_dic / self.Hbeta_flux if 'O2_7319A+' in self.lines_dict: self.abunData['O_R7300'] = self.lines_dic / self.Hbeta_flux if self.lines_dict.viewkeys() >= ('O3_4959A', 'O3_5007A'): self.abunData['O_R3'] = self.lines_dic / self.Hbeta_flux Blended_lines['O2_3726A'] = ('O2_3726A', 'O2_3729A') Blended_lines['O2_7319A'] = ('O2_7319A', 'O2_7330A') #--Correction for recombination contribution Liu2000 if 'OII_HII_7319A' in self.abunData: try: hbeta_flux = self.Hbeta_flux except AttributeError: hbeta_flux = self.H1_atom.getEmissivity(tem=Tlow, den=ne, label = '4_2', product = False) print '--Warning using theoretical Hbeta emissivity' Lines_Correction = (9.36 * power((Tlow/10000), 0.44) * self.abunData.OII_HII_7319A) * hbeta_flux ratio = self.lines_dict['O2_7319A+'] - Lines_Correction self.determine_ionic_abundance('OII_HII_7319A', self.O2_atom, diagnos_eval, ratio, Tlow, ne) #Calculate the O_+2 abundance O3_lines = ['O3_4959A', 'O3_5007A'] diagnos_eval, diagnos_mag = self.check_obsLines(O3_lines) self.determine_ionic_abundance('OIII_HII', self.O3_atom, diagnos_eval, diagnos_mag, Thigh, ne) #Determine the O/H abundance (favoring the value from OII_HII if set(self.abunData.index) >= {'OII_HII_3279A', 'OIII_HII'}: self.abunData['OII_HII'] = self.abunData['OII_HII_3279A'] self.abunData['OI_HI'] = self.abunData['OII_HII_3279A'] + self.abunData['OIII_HII'] elif set(self.abunData.index) >= {'OII_HII_7319A', 'OIII_HII'}: self.abunData['OII_HII'] = self.abunData['OII_HII_7319A'] self.abunData['OI_HI'] = self.abunData['OII_HII_7319A'] + self.abunData['OIII_HII'] return def nitrogen_abundance_scheme(self, Thigh, ne): #Calculate the N+1 abundance N2_lines = ['N2_6548A', 'N2_6584A'] diagnos_eval, diagnos_mag = self.check_obsLines(N2_lines) self.determine_ionic_abundance('NII_HII', self.N2_atom, diagnos_eval, diagnos_mag, Thigh, ne) #Calculate NI_HI using the OI_HI if set(self.abunData.index) >= {'NII_HII', 'OI_HI'}: #Compute NI_OI self.abunData['NI_OI'] = self.abunData['NII_HII'] / self.abunData['OII_HII'] self.abunData['NI_HI'] = self.abunData['NI_OI'] * self.abunData['OI_HI'] # #Repeat calculation if 5755 line was observed to include the recombination contribution # if self.lines_dict.viewkeys() >= {'N2_5755A'}: # # NIII_HI = self.abunData.NI_HI - self.abunData['NII_HII'] # Lines_Correction = 3.19 * power((Thigh/10000), 0.30) * NIII_HI * self.Hbeta_flux # self.abunData['TNII'], nSII = self.diags.getCrossTemDen(diag_tem = '[NII] 5755/6584+', # diag_den = '[SII] 6731/6716', # value_tem = (self.lines_dict['N2_5755A'] - Lines_Correction)/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.determine_ionic_abundance('NII_HII', self.N2_atom, Ratio, diagnos_mag, self.abunData['TNII'], ne) # # self.abunData['NI_OI'] = self.abunData['NII_HII'] / self.abunData['OII_HII'] # self.abunData['NI_HI'] = self.abunData['NI_OI'] * self.abunData['OI_HI'] return def sulfur_abundance_scheme(self, Tlow, ne, SIII_lines_to_use): #Calculate the S+1 abundance S2_lines = ['S2_6716A', 'S2_6731A'] diagnos_eval, diagnos_mag = self.check_obsLines(S2_lines) self.determine_ionic_abundance('SII_HII', self.S2_atom, diagnos_eval, diagnos_mag, Tlow, ne) #Calculate the S+2 abundance S3_lines = ['S3_9069A', 'S3_9531A'] if SIII_lines_to_use == 'BOTH' else [SIII_lines_to_use] diagnos_eval, diagnos_mag = self.check_obsLines(S3_lines) if set(S3_lines) != set(['S3_9069A', 'S3_9531A']): print '-- Using SIII lines', diagnos_eval self.determine_ionic_abundance('SIII_HII', self.S3_atom, diagnos_eval, diagnos_mag, Tlow, ne) #Calculate the total sulfur abundance if set(self.abunData.index) >= {'SII_HII', 'SIII_HII'}: self.abunData['SI_HI'] = self.abunData['SII_HII'] + self.abunData['SIII_HII'] #Add the S+3 component if the argon correction is found if set(self.abunData.index) >= {'ArIII_HII', 'ArIV_HII'}: logAr2Ar3 = log10(self.abunData['ArIII_HII'] / self.abunData['ArIV_HII']) logSIV = log10(self.abunData['SIII_HII']) - (logAr2Ar3 - self.n_SIV_correction) / self.m_SIV_correction self.abunData['SIV_HII'] = power(10, logSIV) self.abunData['SI_HI'] = self.abunData['SII_HII'] + self.abunData['SIII_HII'] + self.abunData['SIV_HII'] self.abunData['ICF_SIV'] = self.abunData['SI_HI'] / (self.abunData['SII_HII'] + self.abunData['SIII_HII']) return def helium_abundance_elementalScheme(self, Te, ne, lineslog_frame, metal_ext = ''): #Check temperatures are not nan before starting the treatment if (not isinstance(Te, float)) and (not isinstance(ne, float)): #HeI_indices = (lineslog_frame.Ion.str.contains('HeI_')) & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') & (lineslog_frame.index != 'He1_5016A') HeI_indices = (lineslog_frame.Ion.str.contains('HeI_')) & (lineslog_frame.index.isin(['He1_4472A','He1_5876A','He1_6678A'])) HeI_labels = lineslog_frame.loc[HeI_indices].index.values HeI_ions = lineslog_frame.loc[HeI_indices].Ion.values Emis_Hbeta = self.H1_atom.getEmissivity(tem=Te, den=ne, label = '4_2', product = False) #--Generating matrices with fluxes and emissivities for i in range(len(HeI_labels)): pyneb_code = float(HeI_ions[i][HeI_ions[i].find('_')+1:len(HeI_ions[i])]) line_relative_Flux = self.lines_dict[HeI_labels[i]] / self.Hbeta_flux line_relative_emissivity = self.He1_atom.getEmissivity(tem = Te, den = ne, wave = pyneb_code, product = False) / Emis_Hbeta line_relative_emissivity = self.check_nan_entries(line_relative_emissivity) if i == 0: matrix_HeI_fluxes = copy(line_relative_Flux) matrix_HeI_emis = copy(line_relative_emissivity) else: matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) matrix_HeI_emis = transpose(matrix_HeI_emis) #Perform the fit params = Parameters() params.add('Y', value = 0.01) HeII_HII_array = zeros(len(matrix_HeI_fluxes)) HeII_HII_error = zeros(len(matrix_HeI_fluxes)) for i in range(len(matrix_HeI_fluxes)): fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) HeII_HII_array[i] = fit_Output.params['Y'].value HeII_HII_error[i] = fit_Output.params['Y'].stderr #NO SUMANDO LOS ERRORES CORRECTOS? #self.abunData['HeII_HII_from_' + metal_ext] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) ionic_abund = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) #Evaluate the nan array nan_count = np_sum(isnan(ionic_abund)) if nan_count == 0: self.abunData['HeII_HII_from_' + metal_ext] = ionic_abund #Remove the nan entries performing a normal distribution elif nan_count < 0.90 * self.MC_array_len: mag, error = nanmean(ionic_abund), nanstd(ionic_abund) self.abunData['HeII_HII_from_' + metal_ext] = random.normal(mag, error, size = self.MC_array_len) if nan_count > self.MC_warning_limit: print '-- {} calculated with {}'.format('HeII_HII_from_' + metal_ext, nan_count) #Calculate the He+2 abundance if self.lines_dict.viewkeys() >= {'He2_4686A'}: #self.abunData['HeIII_HII_from_' + metal_ext] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=Te, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) self.determine_ionic_abundance('HeIII_HII_from_' + metal_ext, self.He2_atom, 'L(4685)', self.lines_dict['He2_4686A'], Te, ne) #Calculate elemental abundance Helium_element_keys = ['HeII_HII_from_' + metal_ext, 'HeIII_HII_from_' + metal_ext] if set(self.abunData.index) >= set(Helium_element_keys): self.abunData['HeI_HI_from_' + metal_ext] = self.abunData[Helium_element_keys[0]] + self.abunData[Helium_element_keys[1]] else: self.abunData['HeI_HI_from_' + metal_ext] = self.abunData[Helium_element_keys[0]] #Proceed to get the Helium mass fraction Y Element_abund = metal_ext + 'I_HI' Y_fraction, Helium_abund = 'Ymass_' + metal_ext, 'HeI_HI_from_' + metal_ext if set(self.abunData.index) >= {Helium_abund, Element_abund}: self.abunData[Y_fraction] = (4 * self.abunData[Helium_abund] * (1 - 20 * self.abunData[Element_abund])) / (1 + 4 * self.abunData[Helium_abund]) def store_abundances_excel(self, objCode, catalogue_df, extension = ''): #Store the values using the mean and the std from the array for parameter in self.abunData.index: mean_value, std_value = mean(self.abunData[parameter]), std(self.abunData[parameter]) if (~isnan(mean_value)) & (~isnan(std_value)): catalogue_df.loc[objCode, parameter + extension] = ufloat(mean_value, std_value) else: catalogue_df.loc[objCode, parameter + extension] = np_nan return def generate_nan_array(self): nan_array = empty(self.MC_array_len) nan_array[:] = np_nan return nan_array # def store_dict_ObjLog(self, FileFolder, CodeName, verbose = False): # # keys, values = self.abunData.keys(), self.abunData.values() # # for i in range(len(keys)): # if values[i] is not None: # # #This removes the nan elements from the treatment values[i][~isnan(values[i])] # Median_Value = median(values[i][~isnan(values[i])]) # error = std(values[i][~isnan(values[i])]) # self.SaveParameter_ObjLog(CodeName, FileFolder, keys[i], ufloat(Median_Value, error)) # # if verbose == True: # print i, keys[i], Median_Value, error # # else: # self.SaveParameter_ObjLog(CodeName, FileFolder, keys[i], values[i]) # if verbose == True: # print i, keys[i], values[i] # return # # def abundances_to_catalogueDf(self, objCode, catalogue_df): # # for parameter in self.abunData.index: # # mean_value, std_value = mean(self.abunData[parameter]), std(self.abunData[parameter]) # if (~isnan(mean_value)) & (~isnan(std_value)): # catalogue_df.loc[objCode, parameter] = ufloat(mean_value, std_value) # else: # catalogue_df.loc[objCode, parameter] = np_nan # # return # # def store_abundances(self, objCode, catalogue_df, catalogue_address): # # for parameter in self.abunData.index: # # mean_value, std_value = mean(self.abunData[parameter]), std(self.abunData[parameter]) # if (~isnan(mean_value)) & (~isnan(std_value)): # catalogue_df.loc[objCode, parameter] = ufloat(mean_value, std_value) # else: # catalogue_df.loc[objCode, parameter] = np_nan # # catalogue_df.to_pickle(catalogue_address) # # return # # def low_density_function(self, density_array): # # inds_nan = where(isnan(density_array)) # # if len(inds_nan[0]) > 0: # # if len(inds_nan[0]) > (0.1 * self.MC_array_len): # print '--WARNING 10% boundary: ', len(inds_nan[0]), 'values with nan' # elif len(inds_nan[0]) > (0.05 * self.MC_array_len): # print '--WARNING 5% boundary: ', len(inds_nan[0]), 'values with nan' # # density_array[inds_nan]= self.low_density_dist[inds_nan] # # mean_density = mean(density_array) # std_density = std(density_array) # # if isnan(mean_density): # print '--WARNING: Density array cannot be treated numerically' # # if mean_density < 75: # #print '--WARNING: Low density', mean_density, '+/-', std_density, 'Points below limit', len(where(density_array < 75)[0]) # return self.low_density_dist # else: # return density_array # # def high_temp_function(self, temperature_array): # # inds_nan = where(isnan(temperature_array)) # n_nan = len(inds_nan[0]) # if n_nan > 0: # # Te_mean = mean(temperature_array) # Te_std = std(temperature_array) # # # if n_nan > (0.1 * self.MC_array_len): # print '--WARNING 10% boundary: ', n_nan, 'values with nan' # elif n_nan > (0.05 * self.MC_array_len): # print '--WARNING 5% boundary: ', n_nan, 'values with nan' # # temperature_array[inds_nan] = random.normal(Te_mean, Te_std, size = n_nan) # # return temperature_array # # def argon_abundance_scheme_old(self): # # #Physical parameters # TSIII, TOIII, ne = None, None, None # # #Select the physical parameters # if 'TeSIII' in self.abunData: # TSIII = self.abunData.TeSIII # TOIII = self.abunData.TeOIII_from_TeSIII # elif 'TeOIII' in self.abunData: # TSIII = self.abunData.TeSIII_from_TeOIII # TOIII = self.abunData.TeOIII # # #Select the density # if 'neSII' in self.abunData: # ne = self.abunData.neSII # elif 'neOII' in self.abunData: # ne = self.abunData.neOII # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the Ar_+2 abundance # if TSIII is not None: # if self.lines_dict.viewkeys() >= {'Ar3_7136A', 'Ar3_7751'}: # Ratio = self.lines_dict['Ar3_7751A'] + self.lines_dict['Ar3_7136A'] # self.abunData['ArIII_HII'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, to_eval = 'L(7751) + L(7136)', Hbeta = self.Hbeta_flux) # # elif self.lines_dict.viewkeys() >= {'Ar3_7136A'}: # Ratio = self.lines_dict['Ar3_7136A'] # self.abunData['ArIII_HII'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, wave = 7136, Hbeta = self.Hbeta_flux) # # elif self.lines_dict.viewkeys() >= {'Ar3_7751A'}: # Ratio = self.lines_dict['Ar3_7751A'] # self.abunData['ArIII_HII'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, wave = 7751, Hbeta = self.Hbeta_flux) # # #Calculate the Ar_+3 abundance # if TOIII is not None: # if self.lines_dict.viewkeys() >= {'Ar4_4740A', 'Ar4_4711A'}: # Ratio = self.lines_dict['Ar4_4740A'] + self.lines_dict['Ar4_4711A'] # self.abunData['ArIV_HII'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, to_eval = 'L(4740) + L(4711)', Hbeta = self.Hbeta_flux) # # elif self.lines_dict.viewkeys() >= {'Ar4_4740A'}: # Ratio = self.lines_dict['Ar4_4740A'] # self.abunData['ArIV_HII'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, wave = 4740, Hbeta = self.Hbeta_flux) # # elif self.lines_dict.viewkeys() >= {'Ar4_4711A'}: # Ratio = self.lines_dict['Ar4_4711A'] # self.abunData['ArIV_HII'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, wave = 4711, Hbeta = self.Hbeta_flux) # def sulfur_abundance_scheme_old(self): # # #Physical parameters # Te, ne = None, None # # #Select the temperature # if 'TeSIII' in self.abunData: # Te = self.abunData.TeSIII # elif 'TeSIII_from_TeOIII' in self.abunData: # Te = self.abunData.TeSIII_from_TeOIII # # #Select the density # if 'neSII' in self.abunData: # ne = self.abunData.neSII # # #Calculating the R_S2 ratio # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # self.abunData['R_SII_abund'] = self.lines_dict['S2_6716A'] + self.lines_dict['S2_6731A'] # # #Calculating the R_S3 ratio # if self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_9531A'}: # self.abunData['R_SIII_abund'] = self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A'] # # elif self.lines_dict.viewkeys() >= {'S3_9069A'}: # self.abunData['R_SIII_abund'] = self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio) # # elif self.lines_dict.viewkeys() >= {'S3_9531A'}: # self.abunData['R_SIII_abund'] = self.lines_dict['S3_9531A'] * (1 + 1/self.S3_9000_ratio) # # #Determine ionic abundances # if (Te is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the S+1 abundance # if 'R_SII_abund' in self.abunData: # self.abunData['SII_HII'] = self.S2_atom.getIonAbundance(int_ratio=self.abunData.R_SII_abund, tem=Te, den=ne, to_eval = 'L(6731)+L(6716)', Hbeta = self.Hbeta_flux) # # #Calculate the S+2 abundance # if 'R_SIII_abund' in self.abunData: # self.abunData['SIII_HII'] = self.S3_atom.getIonAbundance(int_ratio=self.abunData.R_SIII_abund, tem=Te, den=ne, to_eval = 'L(9069)+L(9531)', Hbeta = self.Hbeta_flux) # # #Calculating Sulfur abundance # if ('SII_HII' in self.abunData) and ('SIII_HII' in self.abunData): # # self.abunData['SI_HI'] = self.abunData['SII_HII'] + self.abunData['SIII_HII'] # # #Calculating the S+3 abundance from Ar - Sulfur from Popstar - Cloudy models if Argon metallicity previously measured # if ('ArIII_HII' in self.abunData) and ('ArIV_HII' in self.abunData): # logAr2Ar3 = log10(self.abunData['ArIII_HII'] / self.abunData['ArIV_HII']) # logSIV = log10(self.abunData['SIII_HII']) - (logAr2Ar3 - self.n_SIV_correction) / self.m_SIV_correction # # #Saving S+3 value # self.abunData['SIV_HII'] = power(10, logSIV) # # #Adding S+3 value to S total value # self.abunData['SI_HI'] = self.abunData['SI_HI'] + self.abunData['SIV_HII'] # # return # def oxygen_abundance_scheme_old(self): # # #Physical parameters # TOII, TOIII, ne = None, None, None # # #Select the physical parameters # if 'TeOIII' in self.abunData: # TOIII = self.abunData.TeOIII # elif 'TeOIII_from_TeSIII' in self.abunData: # TOIII = self.abunData.TeOIII_from_TeSIII # # if 'TeSIII' in self.abunData: # TOII = self.abunData.TeSIII # elif 'TeSIII_from_TeOIII' in self.abunData: # TOII = self.abunData.TeSIII_from_TeOIII # # #Select the density # if 'neSII' in self.abunData: # ne = self.abunData.neSII # elif 'neOII' in self.abunData: # ne = self.abunData.neOII # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the O+1 ion abundance (If O2_3726A, O2_3729A are available we prioritize them) # if TOII is not None: # # if self.lines_dict.viewkeys() >= {'O2_3726A+'}: #WE ASSUME THEY ARE BLENDED # ratio = self.lines_dict['O2_3726A+'] # self.abunData['OII_HII_3279A'] = self.O2_atom.getIonAbundance(int_ratio = ratio, tem=TOII, den=ne, to_eval = 'L(3726)+L(3729)', Hbeta = self.Hbeta_flux) # # if self.lines_dict.viewkeys() >= {'O2_7319A+'}: #WE ASSUME THEY ARE BLENDED # ratio = self.lines_dict['O2_7319A+'] # OII_HII_7319_initial = self.O2_atom.getIonAbundance(int_ratio = ratio, tem=TOII, den=ne, to_eval = 'L(7319)+L(7330)', Hbeta = self.Hbeta_flux) # # #Correction for recombination contribution Liu2000 # Lines_Correction = (9.36 * power((TOII/10000), 0.44) * OII_HII_7319_initial) * self.Hbeta_flux # ratio = self.lines_dict['O2_7319A+'] - Lines_Correction # self.abunData['OII_HII_7319A'] = self.O2_atom.getIonAbundance(int_ratio = ratio, tem=TOII, den=ne, to_eval = 'L(7319)+L(7330)', Hbeta = self.Hbeta_flux) # # #Calculate the O+2 ion abundance # if TOIII is not None: # if self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A'}: # ratio = self.lines_dict['O3_4959A'] + self.lines_dict['O3_5007A'] # self.abunData['OIII_HII'] = self.O3_atom.getIonAbundance(int_ratio = ratio, tem=TOIII, den=ne, to_eval = 'L(4959)+L(5007)', Hbeta = self.Hbeta_flux) # # #Determine the O/H abundance # if ('OII_HII_3279A' in self.abunData) and ('OIII_HII' in self.abunData): # self.abunData['OI_HI'] = self.abunData['OII_HII_3279A'] + self.abunData['OIII_HII'] # self.abunData['OII_HII'] = self.abunData['OII_HII_3279A'] # # elif ('OII_HII_7319A' in self.abunData) and ('OIII_HII' in self.abunData): # self.abunData['OI_HI'] = self.abunData['OII_HII_7319A'] + self.abunData['OIII_HII'] # self.abunData['OII_HII'] = self.abunData['OII_HII_7319A'] # # return # class pyneb_tools(): # # def __init__(self): # # #Set atomic data # atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') # atomicData.setDataFile('s_iii_coll_HRS12.dat') # # #Declare hydrogen atom so it becomes readily available: # self.H1_atom = RecAtom('H', 1) # self.S2_atom = Atom('S', 2) # self.S3_atom = Atom('S', 3) # self.He1_atom = RecAtom('He', 1) # self.He2_atom = RecAtom('He', 2) # # def density_pyneb(self, Ion, Temp): # # element = Ion[0:-1] # ion_n = int(Ion[-1]) # # if Ion == 'S2': # # Ion_Atom = Atom(element, ion_n) # # emLine = ["S2_6716A","S2_6731A"] # Flux_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # # FluxRatio = Flux_dict['S2_6716A'] / Flux_dict['S2_6731A'] # # Den = Ion_Atom.getTemDen(FluxRatio, tem = Temp, wave1=6716, wave2=6731) # # return Den # # def temperature_pyneb(self, Ion, Den): # # element = Ion[0:-1] # ion_n = int(Ion[-1]) # # if Ion == 'O3': # # Ion_Atom = Atom(element, ion_n) # # emLine = ["S2_6716A","S2_6731A"] # Flux_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # # FluxRatio = (Flux_dict['O3_4959A'] + Flux_dict['O3_5007A']) / Flux_dict['O3_4363A'] # # Temp = Ion_Atom.getTemDen(FluxRatio, den = Den, to_eval = "(L(4959) + L(5007)) / L(4363)") # # return Temp # # class direct_Method(ReddeningLaws, pyneb_tools): # # def __init__(self): # # pyneb_tools.__init__(self) # ReddeningLaws.__init__(self) # # self.den_Methodology = None # self.tem_Methodology = None # # self.m_SIV_correction = ufloat(1.008,0.037) # self.n_SIV_correction = ufloat(1.576,0.066) # # def DeclareObject(self, FileFolder, FileName, CodeName, AbundancesFileExtension = '_WHT_LinesLog_v3.txt', cHbeta_type = 'cHBeta_red'): # #WARNING: This method should be define at a lower level # # self.FileFolder = FileFolder # self.FileName = FileName # self.CodeName = CodeName # # EmLine_List = ['R_SII', 'R_SIIprime', 'R_SIII', 'R_NII', 'R_OII', 'R_OIII'] # Den_List = ['nSII'] # Temp_List = ['TOIII', 'TOII', 'TSII', 'TSIII','TNII', 'TOII_approx_TOIII', 'TSIII_approx_TOIII', 'TOIII_approx_TSIII', 'TNII_approx_TOIII'] # IonicAbund_List = ['SII_HII', 'SIII_HII', 'SIV_HII', 'OII_HII', 'OII_HII_3279A', 'OII_HII_7319A', 'NII_HII', 'HeII_HII', 'HeIII_HII', 'ArIII_HII', 'ArIV_HII'] # Element_List = ['SI_HI', 'SI_HI_ArCorr', 'OI_HI', 'NI_OI', 'NI_HI', 'HeI_HI'] # # self.Properties_dict = dict.fromkeys(Element_List + IonicAbund_List + Den_List + Temp_List + EmLine_List) # # self.cHbeta = self.GetParameter_ObjLog(self.CodeName, self.FileFolder, Parameter = cHbeta_type, Assumption = 'float') # # self.AbundancesExtension = AbundancesFileExtension # # def density_determination(self, Ion, Temp = None, methodology = None): # # #Paremetric approach # if methodology == 'Epm2014': # if Ion == 'S2': # # emLine = ["S2_6716A", "S2_6731A"] # Flux_dict = self.getLinesFlux_dered(emLine, self.cHbeta) # Flux_dict['Temp'] = Temp # den = self.empiric_formulae(Flux_dict, methodology, Ion, 'nSII') # # #Check for non physical output # den = self.check_issues(magnitude = den, parameter_type = 'density') # return den # # #Using pyneb # if methodology == 'pyneb': # # #Calculate density using pyneb # den = self.density_pyneb(Ion, Temp) # # #Check for non physical output #WARNING: For pyneb this is too general # den = self.check_issues(magnitude = den, parameter_type = 'density') # # return den # # def temperature_determination(self, Ion, dens = None, methodology = None, Temp = None, RecCorr = None): # # #Direct methods # if methodology == 'Epm2014': # # if Ion == 'O3': # # emLine = ["O3_4959A","O3_5007A","O3_4363A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TOIII') # # if Ion == 'O2': # data_dict = {'Temp': Temp} # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TOII_approx_TOIII') # # if Ion == 'S3': # # emLine = ["S3_9069A","S3_9531A","S3_6312A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TSIII') # # if Ion == 'N2': # # emLine = ["N2_6548A","N2_6584A", "N2_5755A", 'H1_4861A'] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # if RecCorr != None: # if data_dict["N2_5755A"] != None: # data_dict["N2_5755A"] = data_dict["N2_5755A"] - RecCorr * data_dict['H1_4861A'] # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TNII') # # if methodology == 'Haegele2008': # # if Ion == 'S2': # # emLine = ["S2_6716A","S2_6731A", "S2_4069A", 'S2_4076A'] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TSII') # # if Ion == 'O2': # # emLine = ['O2_3726A',"O2_3729A","O2_7319A",'O2_7330A'] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TOII') # # # #Using pyneb # if methodology == 'pyneb': # # temp = self.temperature_pyneb(Ion, dens) # # return temp # # def argon_IonAbundance(self, Temp, Den, Ion, methodology = 'Haegele2008'): # # if methodology == 'Haegele2008': # # if Ion == 'Ar3': # # emLine = ["Ar3_7136A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['ArIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'ArIII_HII') # print 'The argon thing III', self.Properties_dict['ArIII_HII'] # return # # if Ion == 'Ar4': # # emLine = ["Ar4_4740A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['ArIV_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'ArIV_HII') # print 'The argon thing IV', self.Properties_dict['ArIV_HII'] # return # # def oxygen_IonAbundance(self, Temp, Den, Ion, methodology = 'Epm2014', RecCorr = None): # # if methodology == 'Epm2014': # # if Ion == 'O3': # # emLine = ["O3_4959A","O3_5007A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['OIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'OIII_HII') # # return # # if Ion == 'O2': # #This assumes both lines are blended # emLine = ["O2_3726A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta, Mode='Integrated') # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['OII_HII_3279A'] = self.empiric_formulae(data_dict, methodology, Ion, 'OII_HII') # # if methodology == 'Fabian2006': # # if Ion == 'O2': # # emLine = ["O2_7319A","O2_7330A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # # if RecCorr == None: # self.Properties_dict['OII_HII_7319A'] = self.empiric_formulae(data_dict, methodology, Ion, 'OII_HII_7319A') # else: # data_dict["O2_7319A"] = data_dict["O2_7319A"] - RecCorr # self.Properties_dict['OII_HII_7319A'] = self.empiric_formulae(data_dict, methodology, Ion, 'OII_HII_7319A') # # return # # def nitrogen_IonAbundance(self, Temp, Den, Ion, methodology = 'Epm2014'): # # if methodology == 'Epm2014': # # if Ion == 'N2': # # emLine = ["N2_6548A","N2_6584A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['NII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'NII_HII') # # return # # def sulfur_IonAbundance(self, Temp, Den, Ion, methodology = 'Haegele2008'): # # if methodology == 'Haegele2008': # # if Ion == 'S3': # # emLine = ["S3_9069A","S3_9531A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['SIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SIII_HII') # # return # # if Ion == 'S2': # # emLine = ["S2_6716A","S2_6731A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['SII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SII_HII') # # if methodology == 'Vital2015': # if Ion == 'S3': # emLine = ["S3_9069A","S3_9531A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['SIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SIII_HII') # # return # # if Ion == 'S2': # methodology = 'Haegele2008' # emLine = ["S2_6716A","S2_6731A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['SII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SII_HII') # # # return # # def helium_IonAbundance(self, Temp, Den, Ion, methodology = 'Fabian2006'): # # if methodology == 'Fabian2006': # # if Ion == 'He1': # emLine = ["He1_4472A", "He1_5876A", "He1_6678A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['HeII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeII_HII') # # return # # if Ion == 'He2': # emLine = ["He2_4686A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['HeIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeIII_HII') # # return # # if methodology == 'Vital2015': # # if Ion == 'He1': # emLine = ["He1_4472A", "He1_5876A", "He1_6678A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['HeII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeII_HII') # # if Ion == 'He2': # emLine = ["He2_4686A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['HeIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeIII_HII') # # if methodology == 'PyNeb': # # if Ion == 'He1': # emLine = ["He1_4472A", "He1_5876A", "He1_6678A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['HeII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeII_HII') # # return # # if Ion == 'He2': # # return # # def empiric_formulae(self, data_dict, methodology, Ion, Parameter): # # Magnitude = None # if data_dict != None: # if (None not in data_dict.values()): # if methodology == 'Epm2014': # if Parameter == 'nSII': # # self.Properties_dict['R_SII'] = data_dict['S2_6716A'] / data_dict['S2_6731A'] # t4 = data_dict['Temp'] / 10000.0 # a_0 = 16.054 - 7.79 / t4 - 11.32 * t4 # a_1 = -22.66 + 11.08 / t4 + 16.02 * t4 # b_0 = -21.61 + 11.89 / t4 + 14.59 * t4 # b_1 = 9.17 - 5.09 / t4 - 6.18 * t4 # Magnitude = 1000.0 * (self.Properties_dict['R_SII']*a_0 + a_1) / (self.Properties_dict['R_SII']*b_0 + b_1) # #self.Properties_dict['nSII'] = 1000.0 * (self.Properties_dict['R_SII']*a_0 + a_1) / (self.Properties_dict['R_SII']*b_0 + b_1) # # elif Parameter == 'TOIII': # self.Properties_dict['R_OIII'] = (data_dict['O3_4959A'] + data_dict['O3_5007A']) / data_dict['O3_4363A'] # self.Properties_dict['TOIII'] = (0.7840 - 0.0001357 * self.Properties_dict['R_OIII'] + (48.44 / self.Properties_dict['R_OIII'])) * 10000 # Magnitude = self.Properties_dict['TOIII'] # # elif Parameter == 'TOII_approx_TOIII': # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TOII_approx_TOIII'] = (1.397 /( (1/t4) + 0.385) ) * 10000 # Magnitude = self.Properties_dict['TOII_approx_TOIII'] # # elif Parameter == 'TSIII_approx_TOIII': # #From equation TOIII = 1.0807 * TSIII - 0.0846 # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TSIII_approx_TOIII'] = ((t4 + 0.0846) / 1.0807)*10000 # # elif Parameter == 'TOIII_approx_TSIII': # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TOIII_approx_TSIII'] = (1.0807 * t4 - 0.0846)*10000 # Magnitude = self.Properties_dict['TOIII_approx_TSIII'] # # elif Parameter == 'TSIII': # self.Properties_dict['R_SIII'] = (data_dict['S3_9069A'] + data_dict['S3_9531A']) / data_dict['S3_6312A'] # self.Properties_dict['TSIII'] = (0.5147 + 0.0003187 * self.Properties_dict['R_SIII'] + (23.6404 / self.Properties_dict['R_SIII'])) * 10000 # Magnitude = self.Properties_dict['TSIII'] # # elif Parameter == 'TNII': # self.Properties_dict['R_NII'] = (data_dict['N2_6548A'] + data_dict['N2_6584A']) / data_dict['N2_5755A'] # self.Properties_dict['TNII'] = (0.6153 - 0.0001529 * self.Properties_dict['R_NII'] + (35.3641 / self.Properties_dict['R_NII'])) * 10000 # Magnitude = self.Properties_dict['TNII'] # # elif Parameter == 'TNII_approx_TOIII': # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TNII_approx_TOIII'] = (1.452 /( (1/t4) + 0.479))*10000 # Magnitude = self.Properties_dict['TNII_approx_TOIII'] # # elif Parameter == 'OIII_HII': # t4 = data_dict['Temp'] / 10000 # logOIII_logHII = -12 + umath.log10((data_dict['O3_4959A'] + data_dict['O3_5007A']) / data_dict['H1_4861A']) + 6.1868 + 1.2491 / t4 - 0.5816 * umath.log10(t4) # Magnitude = umath.pow(10, logOIII_logHII) # # elif Parameter == 'OII_HII_3279A': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # logOII_logHII = -12 + umath.log10((data_dict['O2_3726A']) / data_dict['H1_4861A']) + 5.887 + 1.641 / t4 - 0.543 * umath.log10(t4) + 0.000114 * ne # Magnitude = umath.pow(10, logOII_logHII) # # elif Parameter == 'NII_HII': # t4 = data_dict['Temp'] / 10000 # logNII_logHII = -12 + umath.log10((data_dict['N2_6548A'] + data_dict['N2_6584A']) / data_dict['H1_4861A']) + 6.291 + 0.90221 / t4 - 0.5511 * umath.log10(t4) # Magnitude = umath.pow(10, logNII_logHII) # # elif methodology == 'Angeles2015': # # if Parameter == 'SIV_HII': # # ArIII_HII = data_dict['ArIII_HII'] # ArIV_HII = data_dict['ArIV_HII'] # SIII_HII = data_dict['SIII_HII'] # # if (ArIII_HII != None) and (ArIV_HII != None) and (ArIV_HII != 0.0): #Somehow ArIV should be saved as None # logAr2Ar3 = umath.log10(ArIII_HII/ArIV_HII) # # else: # logAr2Ar3 = ufloat(0.0, 0.0) # # logSIV = umath.log10(SIII_HII) - (logAr2Ar3 - self.n_SIV_correction) / self.m_SIV_correction # # # self.Properties_dict['SIV_HII'] = umath.pow(10, logSIV) # Magnitude = self.Properties_dict['SIV_HII'] # # # Old formulation # # ArIII_HII = data_dict['ArIII_HII'] # # ArIV_HII = data_dict['ArIV_HII'] # # SIII_HII = data_dict['SIII_HII'] # # # # if (ArIII_HII != None) and (ArIV_HII != 0.0): # # y_Ar = umath.log10(ArIII_HII/ArIV_HII) # # else: # # y_Ar = ufloat(0.0, 0.0) # # # # x_S = (y_Ar - 0.126) / 1.192 # # # # self.Properties_dict['SIV_HII'] = SIII_HII / umath.pow(10, x_S) # # Magnitude = self.Properties_dict['SIV_HII'] # # elif methodology == 'Haegele2008': # # if Parameter == 'TSII': # self.Properties_dict['R_SIIprime'] = (data_dict['S2_6716A'] + data_dict['S2_6731A']) / (data_dict['S2_4069A'] + data_dict['S2_4076A']) # self.Properties_dict['TSII'] = (1.92 - 0.0375 *self.Properties_dict['R_SIIprime'] - 14.5 / self.Properties_dict['R_SIIprime'] + 105.64 / (self.Properties_dict['R_SIIprime'] * self.Properties_dict['R_SIIprime'])) * 10000 # Magnitude = self.Properties_dict['TSII'] # # if Parameter == 'TOII': # ne = data_dict['Den'] # self.Properties_dict['R_OII'] = (data_dict['O2_3726A'] + data_dict['O2_3729A']) / (data_dict['O2_7319A'] + data_dict['O2_7330A']) # self.Properties_dict['TOII'] = (0.23 + 0.0017 * self.Properties_dict['R_OII'] + 38.3 / self.Properties_dict['R_OII'] + umath.log10(1 + 0.0001 * ne)) * 10000 # Magnitude = self.Properties_dict['TOII'] # # elif Parameter == 'ArIII_HII': # t4 = data_dict['Temp'] / 10000 # logArIII_logHII = -12 + umath.log10(data_dict['Ar3_7136A'] / data_dict['H1_4861A']) + 6.157 + 0.808/t4 - 0.508 * umath.log10(t4) # Magnitude = umath.pow(10, logArIII_logHII) # # elif Parameter == 'ArIV_HII': # t4 = data_dict['Temp'] / 10000 # logArIV_logHII = -12 + umath.log10(data_dict['Ar4_4740A'] / data_dict['H1_4861A']) + 5.705 + 1.246/t4 - 0.156 * umath.log10(t4) # Magnitude = umath.pow(10, logArIV_logHII) # # elif Parameter == 'SII_HII': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # logSII_logHII = -12 + umath.log10((data_dict['S2_6716A'] + data_dict['S2_6731A']) / data_dict['H1_4861A']) + 5.423 + 0.929/t4 - 0.280 * umath.log10(t4) + umath.log10(1 + 0.0001 * ne) # Magnitude = umath.pow(10, logSII_logHII) # # elif Parameter == 'SIII_HII': # t4 = data_dict['Temp'] / 10000 # logSIII_logHII = -12 + umath.log10((data_dict['S3_9069A'] + data_dict['S3_9531A']) / data_dict['H1_4861A']) + 5.8 + 0.77 / t4 - 0.22 * umath.log10(t4) # Magnitude = umath.pow(10, logSIII_logHII) # # elif methodology == 'Vital2015': # # if Parameter == 'SIII_HII': # t4 = data_dict['Temp'] / 10000 # logSIII_logHII = -12 + umath.log10((data_dict['S3_9069A'] + data_dict['S3_9531A']) / data_dict['H1_4861A']) + 6.012 + 0.6309 / t4 - 0.5722 * umath.log10(t4) # Magnitude = umath.pow(10, logSIII_logHII) # # if Parameter == 'HeIII_HII': # t4 = data_dict['Temp'] / 10000 # y_PPI4686 = 0.081 * umath.pow(t4, 0.15) * data_dict['He2_4686A'] / data_dict['H1_4861A'] # Magnitude = y_PPI4686 # # if Parameter == 'HeII_HII': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # # y0_I4471 = 2.039 * umath.pow(t4,0.102) * data_dict['He1_4472A'] / data_dict['H1_4861A'] # y0_I5876 = 0.732 * umath.pow(t4,0.171) * data_dict['He1_5876A'] / data_dict['H1_4861A'] # y0_I6678 = 2.573 * umath.pow(t4,0.18) * data_dict['He1_6678A'] / data_dict['H1_4861A'] # # D = 1.0 + 3110.0 * umath.pow(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * umath.pow(t4,0.02) * (umath.exp(-4.544)) / D # g_I5876 = (7.12 * umath.pow(t4,0.14) * (umath.exp(-3.776/t4)) + 1.47 * umath.pow(t4,-0.28) * (umath.exp(-4.544/t4))) / D # g_I6678 = (3.27 * umath.pow(t4,-0.41) * (umath.exp(-3.777/t4)) + 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # elif methodology == 'Liu2000': # # if Parameter == 'O2_RecombCorr': # t4 = data_dict['Temp'] / 10000 # OII_HII = data_dict['OII_HII_7319A'] # OII_RecombCor = 9.36 * umath.pow(t4, 0.44) * OII_HII # Magnitude = OII_RecombCor # # if Parameter == 'N2_RecombCorr': # t4 = data_dict['Temp'] / 10000 # NIII_HII = data_dict['NIII_HII'] # NII_RecombCor = 3.19 * umath.pow(t4, 0.30) * NIII_HII # Magnitude = NII_RecombCor # # elif methodology == 'Epm2007': # # if Parameter == 'O2': # ne = data_dict['Den'] # t4 = data_dict['Temp'] / 10000 # O2plus_Hplus = data_dict['OIII_HII'] # I7320_IBeta_R = 9.36 * umath.pow(t4, 0.44) * O2plus_Hplus # logOII_logHII = -12 + umath.log10((data_dict['O2_7319A'] + data_dict['O2_7330A']) / data_dict['H1_4861A'] - I7320_IBeta_R) + 6.895 + 2.44/t4 - 0.58*umath.log10(t4) - umath.log10(1.0 + 0.0047 * ne) # Magnitude = umath.pow(10, logOII_logHII) # # elif methodology == 'Fabian2006': # # if Parameter == 'HeII_HII': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # # y0_I4471 = 2.04 * umath.pow(t4,0.13) * data_dict['He1_4472A'] / data_dict['H1_4861A'] # y0_I5876 = 0.738 * umath.pow(t4,0.23) * data_dict['He1_5876A'] / data_dict['H1_4861A'] # y0_I6678 = 2.58 * umath.pow(t4,0.25) * data_dict['He1_6678A'] / data_dict['H1_4861A'] # # D = 1.0 + 3110.0 * umath.pow(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * umath.pow(t4,0.02) * (umath.exp(-4.544)) / D # g_I5876 = (7.12 * umath.pow(t4,0.14) * (umath.exp(-3.776/t4)) + 1.47 * umath.pow(t4,-0.28) * (umath.exp(-4.544/t4))) / D # g_I6678 = (3.27 * umath.pow(t4,-0.41) * (umath.exp(-3.777/t4)) + 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # elif Parameter == 'HeIII_HII': # t4 = data_dict['Temp'] / 10000 # y_PPI4686 = 0.084 * umath.pow(t4, 0.14) * data_dict['He2_4686A'] / data_dict['H1_4861A'] # Magnitude = y_PPI4686 # # elif Parameter == 'OII_HII_7319A': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # logOII_logHII = -12 + umath.log10((data_dict['O2_7319A'] + data_dict['O2_7330A']) / data_dict['H1_4861A']) + 6.895 + 2.44 / t4 - 0.58 * umath.log10(t4) - umath.log10(1 + 0.0047 * ne) # Magnitude = umath.pow(10, logOII_logHII) # # elif methodology == 'PyNeb': # # if Parameter == 'HeII_HII': # # te = data_dict['Temp'] # ne = data_dict['Den'] # # self.He1.getIonAbundance() # # y0_I4471 = self.He1_atom.getIonAbundance(int_ratio = 100 * data_dict['He1_4472A']/data_dict['H1_4861A'] , tem=te, den=ne, label='He1_4472A') # y0_I5876 = self.He1_atom.getIonAbundance(int_ratio = 100 * data_dict['He1_5876A']/data_dict['H1_4861A'] , tem=te, den=ne, label='He1_5876A') # y0_I6678 = self.He1_atom.getIonAbundance(int_ratio = 100 * data_dict['He1_6678A']/data_dict['H1_4861A'] , tem=te, den=ne, label='He1_6678A') # # # y0_I4471 = 2.04 * umath.pow(t4,0.13) * data_dict['He1_4472A'] / data_dict['H1_4861A'] # # y0_I5876 = 0.738 * umath.pow(t4,0.23) * data_dict['He1_5876A'] / data_dict['H1_4861A'] # # y0_I6678 = 2.58 * umath.pow(t4,0.25) * data_dict['He1_6678A'] / data_dict['H1_4861A'] # # D = 1.0 + 3110.0 * umath.pow(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * umath.pow(t4,0.02) * (umath.exp(-4.544)) / D # g_I5876 = (7.12 * umath.pow(t4,0.14) * (umath.exp(-3.776/t4)) + 1.47 * umath.pow(t4,-0.28) * (umath.exp(-4.544/t4))) / D # g_I6678 = (3.27 * umath.pow(t4,-0.41) * (umath.exp(-3.777/t4)) + 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # # return Magnitude # # def check_issues(self, magnitude, parameter_type): # # #Security check in the case we are getting a negative density: # if parameter_type == 'density': # if magnitude != None: # # if magnitude <= 0: # return ufloat(50.0, 50.0) # else: # return magnitude # return magnitude # # #Security check in case some flux is missing # elif parameter_type == 'EmFlux': # if magnitude[1] == None: # return None # else: # return ufloat(magnitude[1], magnitude[2]) # # class Chemical_Analysis(direct_Method): # # def __init__(self): # # direct_Method.__init__(self) # # #logSI_OI_Gradient = ufloat(-1.53, 0.05) # logSI_OI_Gradient = ufloat(-1.78, 0.03) # # self.OI_SI = umath.pow(10, -logSI_OI_Gradient) # self.He1 = RecAtom('He', 1) # atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') # # def set_element(self, element): # # if element == 'Argon': # # self.argon_abundance_scheme() # # elif element == 'Oxygen': # # self.oxygen_abundance_scheme() # # elif element == 'Nitrogen': # # self.nitrogen_abundance_scheme() # # elif element == 'Sulfur': # # self.sulfur_abundance_scheme() # # elif element == 'Helium': # # self.helium_abundance_scheme() # # return # # def argon_abundance_scheme(self): # # #Determine the sulfur density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #We try to calculate the T_ArIII from the sulfur lines # T_ArIII = T_SIII # T_ArIV = T_OIII # # #We try to calculate the T_ArIV from the sulfur lines, if not we use the Oxygen ones # if (T_OIII == None) and (T_SIII != None): # data_dict = {'Temp' : T_SIII} # T_OIII_approx = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion='O3', Parameter = 'TOIII_approx_TSIII') # T_ArIV = T_OIII_approx # # elif (T_SIII == None) and (T_OIII != None): # data_dict = {'Temp' : T_OIII} # T_SIII_approx = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion='S3', Parameter = 'TSIII_approx_TOIII') # T_ArIV = T_SIII_approx # # #Calculate the ArIII abundance # self.argon_IonAbundance(T_ArIII, ne_SII, Ion = 'Ar3', methodology = 'Haegele2008') # # #Calculate the ArIV abundance # self.argon_IonAbundance(T_ArIV, ne_SII, Ion = 'Ar4', methodology = 'Haegele2008') # # def sulfur_density_scheme(self, TempIn = None): # # #We use this set up mechanism to calculate the electron density for other elements # if TempIn == None: # #Determine the Te[SII] and Te[SIII] # T_SII = self.temperature_determination(Ion = 'S2', methodology = 'Haegele2008') # T_SIII = self.temperature_determination(Ion = 'S3', methodology = 'Epm2014') # else: # T_SII = None # T_SIII = TempIn # # #Determine ne_SII using the TSIII. If not available use TOIII to calculate TSIII # #If a TempIn is not available it will use the standard procedure # if T_SIII != None: # ne_SII = self.density_determination(Ion = 'S2', Temp = T_SIII, methodology='Epm2014') # else: # T_OIII, T_OII = self.oxygen_temperature_scheme() # data_dict = {} # data_dict['Temp'] = T_OIII # T_SIII = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion = 'S3', Parameter='TSIII_approx_TOIII') # ne_SII = self.density_determination(Ion = 'S2', Temp = T_SIII, methodology='Epm2014') # # return T_SII, T_SIII, ne_SII # # def sulfur_abundance_scheme(self): # # #Get the sulfur electron density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = None) # # self.Properties_dict['nSII'] = ne_SII # # #Determine the SII/HII abundance. # #If the T_SII temperature is available use it. If not T_SII = T_SIII: # if T_SII != None: # self.sulfur_IonAbundance(T_SII, ne_SII, Ion = 'S2', methodology = 'Haegele2008') # else: # self.sulfur_IonAbundance(T_SIII, ne_SII, Ion = 'S2', methodology = 'Haegele2008') # # #Determine the SIII/HII abundance # # self.sulfur_IonAbundance(T_SIII, ne_SII, Ion = 'S3', methodology = 'Haegele2008') # self.sulfur_IonAbundance(T_SIII, ne_SII, Ion = 'S3', methodology = 'Vital2015') # # #Determine the S/H abundance # #Include the Argon correction if the ArIV lines were observed # if (self.Properties_dict['SII_HII'] != None) and (self.Properties_dict['SIII_HII'] != None): # self.Properties_dict['SI_HI'] = self.Properties_dict['SII_HII'] + self.Properties_dict['SIII_HII'] # # #Calculate the [SIV] correction factor from the Argon abundance # #This structures enforces the calculation of the Argon apriori # data_dict = {} # data_dict['ArIII_HII'] = self.Properties_dict['ArIII_HII'] # data_dict['ArIV_HII'] = self.Properties_dict['ArIV_HII'] # data_dict['SIII_HII'] = self.Properties_dict['SIII_HII'] # # #The code does not work if we introduce a None entry. However, in this correction there is still a quantity even if the ArIV is no there # if data_dict['ArIV_HII'] == None: # data_dict['ArIV_HII'] = ufloat(0.0,0.0) # # #Compute the SIV_HII component # SIV_HII = self.empiric_formulae(data_dict, methodology = 'Angeles2015', Ion = 'S4', Parameter='SIV_HII') # # self.Properties_dict['SI_HI_ArCorr'] = self.Properties_dict['SII_HII'] + self.Properties_dict['SIII_HII'] + SIV_HII # # def oxygen_temperature_scheme(self): # # #Determine the Te[OIII] # T_OIII = self.temperature_determination(Ion = 'O3', methodology = 'Epm2014') # # #Determine the Te[OII] using all the [OII] lines # T_OII = self.temperature_determination(Ion = 'O2', methodology = 'Epm2014') # # #If lines not observed use approximation from T[OIII] # if T_OII == None: # T_OII = self.temperature_determination(Ion = 'O2', methodology = 'Epm2014', Temp = T_OIII) # # return T_OIII, T_OII # # def oxygen_abundance_scheme(self): # # #Determine the oxygen temperatures # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #Get the electron density from the sulfur lines using the oxigen temperature if observed. If not used sulfur lines # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # # #Calculate the OIII ion abundance # self.oxygen_IonAbundance(Temp = T_OIII, Den = ne_SII, Ion = 'O3', methodology = 'Epm2014') # # #Calculate the OII ion abundance # self.oxygen_IonAbundance(Temp = T_OII, Den = ne_SII, Ion = 'O2', methodology = 'Epm2014') # self.oxygen_IonAbundance(Temp = T_OII, Den = ne_SII, Ion = 'O2', methodology = 'Fabian2006') # # #Correct the OII from 7319A, 7330A lines from the recombination contribution # if self.Properties_dict['OII_HII_7319A'] != None: # OII_HII_7319A = self.Properties_dict['OII_HII_7319A'] # data_dict = {'Temp' : T_OII, # 'OII_HII_7319A' : OII_HII_7319A} # # RecCorr_O2_7319 = self.empiric_formulae(data_dict, methodology = 'Liu2000', Ion = 'O2', Parameter='O2_RecombCorr') # self.oxygen_IonAbundance(Temp = T_OII, Den = ne_SII, Ion = 'O2', methodology = 'Epm2014', RecCorr = RecCorr_O2_7319) # # #If O2_3726A, O2_3729A lines are not available we use O2_7319A, O2_7330A lines # if self.Properties_dict['OII_HII_3279A'] != None: # self.Properties_dict['OII_HII'] = self.Properties_dict['OII_HII_3279A'] # # elif (self.Properties_dict['OII_HII_7319A'] != None): # self.Properties_dict['OII_HII'] = self.Properties_dict['OII_HII_7319A'] # # #Determine the S/H abundance # #Include the Argon correction if the ArIV lines were observed # if (self.Properties_dict['OII_HII'] != None) and (self.Properties_dict['OIII_HII'] != None): # self.Properties_dict['OI_HI'] = self.Properties_dict['OII_HII'] + self.Properties_dict['OIII_HII'] # # def nitrogen_abundance_scheme(self): # #WARNING: THIS COULD BE FASTER WITH A MECHANISM WITH PRELOADS ALL THE EMISSION LINES # # #Determine the Te[NSII] # T_NII = self.temperature_determination(Ion = 'N2', methodology = 'Epm2014') # # if T_NII != None: # #YOU CAN TEST THIS WITH OBJECT 51959-092 # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = T_NII) # self.nitrogen_IonAbundance(Temp = T_NII, Den = ne_SII, Ion = 'N2', methodology = 'Epm2014') # # #If Te[NSII] cannot be calculated try to determine the Te[OII] # elif T_NII == None: # T_OIII, T_OII = self.oxygen_temperature_scheme() # data_dict = {'Temp' : T_OIII} # TNII_approx = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion='N2', Parameter = 'TNII_approx_TOIII') # # #Get the sulfur electron density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = TNII_approx) # self.nitrogen_IonAbundance(Temp = TNII_approx, Den = ne_SII, Ion = 'N2', methodology = 'Epm2014') # # #Determine the N/H abundance # #We need O/H abundance in order to calculate N/H abundance # if (self.Properties_dict['OI_HI'] != None) and (self.Properties_dict['NII_HII'] != None): # self.Properties_dict['NI_OI'] = self.Properties_dict['NII_HII'] / self.Properties_dict['OII_HII'] # self.Properties_dict['NI_HI'] = self.Properties_dict['NI_OI'] * self.Properties_dict['OI_HI'] # # #Take into account the recombination contribution from the # if T_NII != None: # NIII_HI = self.Properties_dict['NI_HI'] - self.Properties_dict['NII_HII'] # # data_dict = {'Temp' : T_NII, # 'NIII_HII' : NIII_HI} # # RecCorr_N2_5755 = self.empiric_formulae(data_dict, methodology = 'Liu2000', Ion = 'N2', Parameter = 'N2_RecombCorr') # # #Repeat the previous steps starting with the calculation of TNII # T_NII = self.temperature_determination(Ion = 'N2', methodology = 'Epm2014', RecCorr = RecCorr_N2_5755) # # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = T_NII) # self.nitrogen_IonAbundance(Temp = T_NII, Den = ne_SII, Ion = 'N2', methodology = 'Epm2014') # self.Properties_dict['NI_OI'] = self.Properties_dict['NII_HII'] / self.Properties_dict['OII_HII'] # self.Properties_dict['NI_HI'] = self.Properties_dict['NI_OI'] * self.Properties_dict['OI_HI'] # # def helium_abundance_scheme(self): # # #Determine the sulfur density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # # #In case we do not have the sulfur temperature we use the oxygen one # if T_SIII != None: # data_dict = {'Temp' : T_SIII} # T_OIII = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion = 'O3', Parameter = 'TOIII_approx_TSIII') # # else: # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #Calculate the HeII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He1', methodology = 'Vital2015') # # #Calculate the HeIII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He2', methodology = 'Vital2015') # # if self.Properties_dict['HeII_HII'] != None: # if self.Properties_dict['HeIII_HII'] != None: # self.Properties_dict['HeI_HI'] = self.Properties_dict['HeII_HII'] + self.Properties_dict['HeIII_HII'] # elif self.Properties_dict['HeIII_HII'] == None: # self.Properties_dict['HeI_HI'] = self.Properties_dict['HeII_HII'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI'] != None): # # #From Oxygen: # if self.Properties_dict['OI_HI'] != None: # self.Properties_dict['Y_Mass_O'] = (4 * self.Properties_dict['HeI_HI'] * (1 - 20 * self.Properties_dict['OI_HI'])) / (1 + 4 * self.Properties_dict['HeI_HI']) # # #From Sulfur # if self.Properties_dict['SI_HI'] != None: # self.Properties_dict['Y_Mass_S'] = (4 * self.Properties_dict['HeI_HI'] * (1 - 20 * self.OI_SI * self.Properties_dict['SI_HI_ArCorr'])) / (1 + 4 * self.Properties_dict['HeI_HI']) # # def heliumPyneb_abundance_scheme(self): # # #Determine the sulfur density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # # #In case we do not have the sulfur temperature we use the oxygen one # if T_SIII != None: # data_dict = {'Temp' : T_SIII} # T_OIII = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion = 'O3', Parameter = 'TOIII_approx_TSIII') # # else: # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #Calculate the HeII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He1', methodology = 'PyNeb') # # #Calculate the HeIII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He2', methodology = 'PyNeb') # # return # # def store_dict_ObjLog(self, varaiables_dict, verbose = False): # # keys, values = varaiables_dict.keys(), varaiables_dict.values() # # for i in range(len(keys)): # if verbose: # print i, keys[i], values[i] # self.SaveParameter_ObjLog(self.CodeName, self.FileFolder, keys[i], values[i]) # # return # # class Parametrized_Emissivities(Txt_Files_Manager): # # def __init__(self): # # self.LiteratureParametrization = None # Txt_Files_Manager.__init__(self) # # def AOS2010(self, Te, ne): # # #phi has the shape : phi_lambda = Em(Hbeta) / E(He_lambda) * (1) / (1 + C/R(lambda)) # #Hence Em(He_lambda)/Em(H\beta) = 1 / phi_lambda # # Phi3889 = power(0.8779 * Te, -0.128 -0.00041 * ne ) # Phi4026 = power(4.233 * Te, 0.085 - 0.00012 * ne ) # Phi4471 = power(2.021 * Te, 0.121 - 0.00020 * ne ) # Phi5876 = power(0.754 * Te, 0.212 - 0.00051 * ne ) # Phi6678 = power(2.639 * Te, 0.244 - 0.00054 * ne ) # Phi7065 = power(5.903 * Te, -0.519) / (1.462 - Te * (0.127 - 0.00076 * ne * + 0.000000255 * ne*ne)) # # Em_He3889 = 1/Phi3889 # Em_He4026 = 1/Phi4026 # Em_He4471 = 1/Phi4471 # Em_He5876 = 1/Phi5876 # Em_He6678 = 1/Phi6678 # Em_He7065 = 1/Phi7065 # # return Em_He3889, Em_He4026, Em_He4471, Em_He4471, Em_He5876, Em_He5876, Em_He6678, Em_He7065 # # def Haegele2008_Fluxes(self): # #SDSS J1729 # Flux_dict = {} # # Flux_dict["H1_4861A"] = ufloat(10000, 83) # # Flux_dict["O2_3726A"] = ufloat(17622, 243) # Flux_dict["O2_3729A"] = ufloat(0.0, 0.0) # Flux_dict["O2_7319A"] = ufloat(233,8) # Flux_dict['O2_7330A'] = ufloat(194,9) # # Flux_dict["O3_4363A"] = ufloat(660, 30) # Flux_dict["O3_4959A"] = ufloat(17097, 146) # Flux_dict["O3_5007A"] = ufloat(51541, 418) # # Flux_dict["N2_5755A"] = ufloat(60, 6) # Flux_dict["N2_6548A"] = ufloat(771, 21) # Flux_dict["N2_6584A"] = ufloat(2189, 52) # # Flux_dict['Ar3_7136A'] = ufloat(864,41) # Flux_dict['Ar4_4740A'] = ufloat(40,0.06) # # Flux_dict["S2_6716A"] = ufloat(1286, 32) # Flux_dict["S2_6731A"] = ufloat(1009, 30) # Flux_dict["S2_4069A"] = ufloat(122, 11) # Flux_dict['S2_4076A'] = ufloat(0.0,0.0) # # Flux_dict["S3_6312A"] = ufloat(176, 11) # Flux_dict["S3_9069A"] = ufloat(2092, 95) # Flux_dict["S3_9531A"] = ufloat(4718, 250) # # Flux_dict["He1_4472A"] = ufloat(516, 24) # Flux_dict["He1_5876A"] = ufloat(1261, 37) # Flux_dict["He1_6678A"] = ufloat(355, 2) # Flux_dict['He2_4686A'] = ufloat(329,43) # # def Abundances_FabianSample(self): # # Table_Address = '/home/vital/Workspace/Dazer/Astro_Libraries/Fabian2006_CatalogueAbundances.txt' # # Headers_List = ['O/H_10^5_Flux', 'O/H_0^5_Error', 'N/H_10^6_Flux', 'N/H_10^6_Error', 'Y_magnitude', 'Y_error', 'y_magnitude', 'y_error'] # # Oxygen_Flux, Oxygen_Error, Nitrogen_Flux, Nitrogen_Error, Y, Yerror, y_magnitude, y_error = self.get_ColumnData(Headers_List, Table_Address, HeaderSize=1, unpack_check = True) # # return Oxygen_Flux * 1e-5, Oxygen_Error*1e-5, Nitrogen_Flux*1e-6, Nitrogen_Error*1e-6, Y, Yerror, y_magnitude, y_error # def residual_Y_v3(pars, x, y): # return (y - pars['Y'] * x) # # class Chemical_Analysis_pyneb(): # # def __init__(self): # # self.MC_array_len = 100 # # self.Hbeta_label = 'H1_4861A' # # def load_elements(self): # # #Set atomic data # atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') # atomicData.setDataFile('s_iii_coll_HRS12.dat') # # #Declare hydrogen atom so it becomes readily available: # self.S2_atom = Atom('S', 2) # self.S3_atom = Atom('S', 3) # self.Ar3_atom = Atom('Ar', 3) # self.Ar4_atom = Atom('Ar', 4) # self.N2_atom = Atom('N', 2) # self.O2_atom = Atom('O', 2) # self.O3_atom = Atom('O', 3) # # self.H1_atom = RecAtom('H', 1) # self.He1_atom = RecAtom('He', 1) # self.He2_atom = RecAtom('He', 2) # # self.diags = Diagnostics() # # self.logSI_OI_Gradient = random.normal(-1.53, 0.05, size = self.MC_array_len) # random.normal(-1.78, 0.03, size = self.MC_array_len) # # self.OI_SI = power(10, -self.logSI_OI_Gradient) # # self.S3_9000_ratio = random.normal(self.S3_atom.getEmissivity(10000, 1000, wave = 9531) / self.S3_atom.getEmissivity(10000, 1000, wave = 9069), 0.01, size = self.MC_array_len) # # self.m_SIV_correction = random.normal(1.109, 0.1109, size = self.MC_array_len) # self.n_SIV_correction = random.normal(0.135, 0.013, size = self.MC_array_len) # # lower_trunc, upper_trunc = (0.0 - 50.0) / 25.0, (100 - 50) / 25.0 # self.Truncated_gaussian = truncnorm(lower_trunc, upper_trunc, loc = 50, scale = 25) # # return # # def DeclareObject(self, lines_log_frame): # # #List of all parameters # lineRatios = ['R_SII', 'R_SII_prime', 'R_SIII', 'R_NII', 'R_OII', 'R_OII_prime', 'R_OIII'] # elecProperties = ['neSII', 'neOII', 'TeOII', 'TeSII', 'TeNII', 'TeOIII', 'TeSIII', 'TeOII_from_TeOIII', 'TeNII_from_TeOIII', 'TeSIII_from_TeOIII', 'TeOIII_from_TeSIII'] # ionicAbund = ['SII_HII', 'SIII_HII', 'SIV_HII', 'OII_HII', 'OII_HII_3279A', 'OII_HII_7319A', 'NII_HII', 'ArIII_HII', 'ArIV_HII', 'HeII_HII_from_O', 'HeIII_HII_from_O', 'HeII_HII_from_S', 'HeIII_HII_from_S'] # elemAbund = ['SI_HI', 'OI_HI', 'NI_OI', 'NI_HI', 'HeI_HI_from_O', 'HeI_HI_from_S', 'Ymass_O', 'Ymass_S'] # # self.data = OrderedDict.fromkeys(lineRatios + elecProperties + ionicAbund + elemAbund) # # self.Hbeta_flux = random.normal(lines_log_frame.loc['H1_4861A']['line_Int'].nominal_value, lines_log_frame.loc['H1_4861A']['line_Int'].std_dev, size = self.MC_array_len) # # self.low_density_dist = self.Truncated_gaussian.rvs(self.MC_array_len) # # #Generate a dictionary to store the random array for all lines # self.lines_dict = OrderedDict() # # #Generate # for line in lines_log_frame.index.values: # if line == 'O2_3726A': # if lines_log_frame.loc['O2_3726A']['flux_intg'] == lines_log_frame.loc['O2_3726A']['flux_intg']: # flux, error = lines_log_frame.loc[line]['line_IntBrute_dered'].nominal_value, lines_log_frame.loc[line]['line_IntBrute_dered'].std_dev # # elif line == 'O2_7319A': # if lines_log_frame.loc['O2_7319A']['flux_intg'] == lines_log_frame.loc['O2_7330A']['flux_intg']: # flux, error = lines_log_frame.loc[line]['line_IntBrute_dered'].nominal_value, lines_log_frame.loc[line]['line_IntBrute_dered'].std_dev # else: # line_sum = lines_log_frame.loc['O2_7319A']['line_IntBrute_dered'] + lines_log_frame.loc['O2_7330A']['line_IntBrute_dered'] # flux, error = line_sum.nominal_value, line_sum.std_dev # # else: # flux, error = lines_log_frame.loc[line]['line_Int'].nominal_value, lines_log_frame.loc[line]['line_Int'].std_dev # # self.lines_dict[line] = random.normal(flux, error, size = self.MC_array_len) # # return # # def low_density_function(self, density_array): # # inds_nan = where(isnan(density_array)) # # if len(inds_nan[0]) > 0: # # if len(inds_nan[0]) > (0.1 * self.MC_array_len): # print '--WARNING 10% boundary: ', len(inds_nan[0]), 'values with nan' # elif len(inds_nan[0]) > (0.05 * self.MC_array_len): # print '--WARNING 5% boundary: ', len(inds_nan[0]), 'values with nan' # # density_array[inds_nan]= self.low_density_dist[inds_nan] # # mean_density = mean(density_array) # std_density = std(density_array) # # if isnan(mean_density): # print '--WARNING: Density array cannot be treated numerically' # # if mean_density < 75: # print '--WARNING: Low density', mean_density, '+/-', std_density, 'Points below limit', len(where(density_array < 75)[0]) # return self.low_density_dist # else: # return density_array # # def determine_electron_parameters(self): # # #-------Starting with the Sulfur # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # # #Check TSIII lines # if self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_9531A', 'S3_6312A'}: # # self.Properties_dict['TSIII_pn'], self.Properties_dict['nSII_pn'] = self.diags.getCrossTemDen(diag_tem = '[SIII] 6312/9200+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Missing S3_9531A line # elif self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_6312A'}: # # self.Properties_dict['TSIII_pn'], self.Properties_dict['nSII_pn'] = self.diags.getCrossTemDen(diag_tem = '[SIII] 6312/9200+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio)), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Missing S3_9069A line # elif self.lines_dict.viewkeys() >= {'S3_9531A', 'S3_6312A'}: # self.Properties_dict['TSIII_pn'], self.Properties_dict['nSII_pn'] = self.diags.getCrossTemDen(diag_tem = '[SIII] 6312/9200+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9531A'] * (1 + 1/self.S3_9000_ratio)), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Missing the sulfur lines we use the ones from oxygen # elif self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A', 'O3_4363A'}: # # self.Properties_dict['TOIII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[OIII] 4363/5007+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # self.Properties_dict['TSIII_approxfrom_TOIII_pn'] = ((self.Properties_dict['TOIII_pn']/10000 + 0.0846) / 1.0807) * 10000 # self.Properties_dict['nSII_pn'] = self.S2_atom.getTemDen((self.lines_dict['S2_6731A'])/(self.lines_dict['S2_6716A']), tem = self.Properties_dict['TSIII_approxfrom_TOIII_pn'], to_eval = 'L(6731) / L(6716)') # # # #Try to measure the TSII temperature # if self.lines_dict.viewkeys() >= {'S2_4069A', 'S2_4076A'}: # # self.Properties_dict['TSII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[SII] 4069/4076', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S2_4069A']/self.lines_dict['S2_4076A'], # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #-------Following with the oxygen # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # # #Missing the sulfur lines we use the ones from oxygen # if self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A', 'O3_4363A'}: # self.Properties_dict['TOIII_pn'], nSII_x = self.diags.getCrossTemDen(diag_tem = '[OIII] 4363/5007+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Determine the TOIII from the sulfur temperature as a proxy # if self.Properties_dict['TSIII_pn'] is not None: # # self.Properties_dict['TOIII_approxfrom_TSIII_pn'] = (1.0807 * self.Properties_dict['TSIII_pn']/10000 - 0.0846) * 10000 # # #Determine the TOII value from the TOIII proxy # if self.Properties_dict['TOIII_pn'] is not None: # self.Properties_dict['TOII_approxfrom_TOIII_pn'] = (1.397 /( (1/(self.Properties_dict['TOIII_pn']/10000)) + 0.385) ) * 10000 # # # #Calculate the oxygen density if the 3721A+ lines can be measured # # if self.lines_dict.viewkeys() >= {'O2_3726A', 'O2_3729A', 'O2_7319A', 'O2_7330A', 'O3_4959A', 'O3_5007A', 'O3_4363A'}: # # # # self.Properties_dict['TOIII_pn'], self.Properties_dict['nOII_pn'] = self.diags.getCrossTemDen(diag_tem = '[OIII] 4363/5007+', # # diag_den = '[OII] 3726/3729', # # value_tem = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']), # # value_den = (self.lines_dict['O2_3726A']/self.lines_dict['O2_3729A'])) # # #Calculate the oxygen temperature cannot be measure use the SIII approximation # elif self.lines_dict.viewkeys() >= {'O2_3726A', 'O2_3729A', 'O2_7319A', 'O2_7330A'}: # if self.Properties_dict['TOIII_approxfrom_TSIII_pn'] is not None: # self.Properties_dict['nOII_pn'] = self.O2_atom.getTemDen((self.lines_dict['O2_3726A']/self.lines_dict['O2_3729A']), # tem = self.Properties_dict['TOIII_approxfrom_TSIII_pn'], # to_eval = '(L(3726))/(L(3729))') # # #-------Following with the Nitrogen # if self.lines_dict.viewkeys() >= {'N2_5755A', 'N2_6548A', 'N2_6584A'}: # # self.Properties_dict['TNII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[NII] 5755/6584+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['N2_5755A']/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # if self.Properties_dict['TOIII_pn'] is not None: # self.Properties_dict['TNII_approxfrom_TOIII_pn'] = (1.452 /( (1/(self.Properties_dict['TOIII_pn']/10000)) + 0.479)) * 10000 # # return # # def argon_abundance_scheme(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TSIII_pn'] is not None: # TSIII = self.Properties_dict['TSIII_pn'] # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # # else: # TSIII = self.Properties_dict['TSIII_approxfrom_TOIII_pn'] # TOIII = self.Properties_dict['TOIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the Ar_+2 abundance # if (TSIII is not None): # if self.lines_dict.viewkeys() >= {'Ar3_7136A', 'Ar3_7751'}: # Ratio = self.lines_dict['Ar3_7751A'] + self.lines_dict['Ar3_7136A'] # self.Properties_dict['ArIII_HII_pn'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, to_eval = 'L(7751) + L(7136)', Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar3_7136A'}: # Ratio = self.lines_dict['Ar3_7136A'] # self.Properties_dict['ArIII_HII_pn'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, wave = 7136, Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar3_7751A'}: # Ratio = self.lines_dict['Ar3_7751A'] # self.Properties_dict['ArIII_HII_pn'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, wave = 7751, Hbeta = self.Hbeta_flux) # # #Calculate the Ar_+3 abundance # if (TOIII is not None): # if self.lines_dict.viewkeys() >= {'Ar4_4740A', 'Ar4_4711A'}: # Ratio = self.lines_dict['Ar4_4740A'] + self.lines_dict['Ar4_4711A'] # self.Properties_dict['ArIV_HII_pn'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, to_eval = 'L(4740) + L(4711)', Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar4_4740A'}: # Ratio = self.lines_dict['Ar4_4740A'] # self.Properties_dict['ArIV_HII_pn'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, wave = 4740, Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar4_4711A'}: # Ratio = self.lines_dict['Ar4_4711A'] # self.Properties_dict['ArIV_HII_pn'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, wave = 4711, Hbeta = self.Hbeta_flux) # # def sulfur_abundance_scheme(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TSIII_pn'] is not None: # Te = self.Properties_dict['TSIII_pn'] # else: # Te = self.Properties_dict['TSIII_approxfrom_TOIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # #Calculating the R_S2 ratio # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # self.Properties_dict['R_SII_pn'] = self.lines_dict['S2_6716A'] + self.lines_dict['S2_6731A'] # # #Calculating the R_S3 ratio # if self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_9531A'}: # self.Properties_dict['R_SIII_pn'] = self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A'] # # elif self.lines_dict.viewkeys() >= {'S3_9069A'}: # self.Properties_dict['R_SIII_pn'] = self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio) # # elif self.lines_dict.viewkeys() >= {'S3_9531A'}: # self.Properties_dict['R_SIII_pn'] = self.lines_dict['S3_9531A'] * (1 + 1/self.S3_9000_ratio) # # #Determine ionic abundances # if (Te is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the S+1 abundance # if self.Properties_dict['R_SIII_pn'] is not None: # self.Properties_dict['SII_HII_pn'] = self.S2_atom.getIonAbundance(int_ratio=self.Properties_dict['R_SII_pn'], tem=Te, den=ne, to_eval = 'L(6731)+L(6716)', Hbeta = self.Hbeta_flux) # # #Calculate the S_+2 abundance # if self.Properties_dict['R_SIII_pn'] is not None: # self.Properties_dict['SIII_HII_pn'] = self.S3_atom.getIonAbundance(int_ratio=self.Properties_dict['R_SIII_pn'], tem=Te, den=ne, to_eval = 'L(9069)+L(9531)', Hbeta = self.Hbeta_flux) # # #Calculating the S_+3 abundance # if (self.Properties_dict['SII_HII_pn'] is not None) and (self.Properties_dict['SIII_HII_pn'] is not None): # # #Apply correction from Ar - Sulfur from Popstar - Cloudy models if Argon metallicity previously measured # if (self.Properties_dict['ArIII_HII_pn'] is not None) and (self.Properties_dict['ArIV_HII_pn'] is not None): # logAr2Ar3 = log10(self.Properties_dict['ArIII_HII_pn']/self.Properties_dict['ArIV_HII_pn']) # logSIV = log10(self.Properties_dict['SIII_HII_pn']) - (logAr2Ar3 - self.n_SIV_correction) / self.m_SIV_correction # self.Properties_dict['SIV_HII_pn'] = power(10, logSIV) # # else: # self.Properties_dict['SIV_HII_pn'] = zeros(self.MC_array_len) # # #Determine elemental abundance # if (self.Properties_dict['SII_HII_pn'] is not None) and (self.Properties_dict['SIII_HII_pn'] is not None) and (self.Properties_dict['SIV_HII_pn'] is not None): # self.Properties_dict['SI_HI_pn'] = self.Properties_dict['SII_HII_pn'] + self.Properties_dict['SIII_HII_pn'] + self.Properties_dict['SIV_HII_pn'] # # if (self.Properties_dict['SII_HII_pn'] is not None) and (self.Properties_dict['SIII_HII_pn'] is not None): # self.Properties_dict['SI_HI_pn'] = self.Properties_dict['SII_HII_pn'] + self.Properties_dict['SIII_HII_pn'] # # return # # def oxygen_abundance_scheme(self): # # #Select the temperature and density for the procedure49 # if self.Properties_dict['TOIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_pn'] # TOII = self.Properties_dict['TOII_approxfrom_TOIII_pn'] # else: # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # TOII = self.Properties_dict['TSIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the O+1 ion abundance (If O2_3726A, O2_3729A are available we prioritize them) # if TOII is not None: # # if self.lines_dict.viewkeys() >= {'O2_3726A'}: #WE ASSUME THEY ARE BLENDED # Ratio = self.lines_dict['O2_3726A'] # self.Properties_dict['OII_HII_3279A_pn'] = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(3726)+L(3729)', Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'O2_3726A'}: # Ratio = self.lines_dict['O2_3726A'] # self.Properties_dict['OII_HII_3279A_pn'] = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(3726)+L(3729)', Hbeta = self.Hbeta_flux) # # if self.lines_dict.viewkeys() >= {'O2_7319A'}: # #Initial value # Ratio = self.lines_dict['O2_7319A'] #WE ASSUME THEY ARE BLENDED # OII_HII_pn_7319_initial = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(7319)+L(7330)', Hbeta = self.Hbeta_flux) # #Correction for recombination contribution Liu2000 # Lines_Correction = (9.36 * power((TOII/10000), 0.44) * OII_HII_pn_7319_initial) * self.Hbeta_flux # Ratio = self.lines_dict['O2_7319A'] - Lines_Correction # self.Properties_dict['OII_HII_7319A_pn'] = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(7319)+L(7330)', Hbeta = self.Hbeta_flux) # # #Calculate the O+2 ion abundance # if (TOIII is not None): # if self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A'}: # Ratio = self.lines_dict['O3_4959A'] + self.lines_dict['O3_5007A'] # self.Properties_dict['OIII_HII_pn'] = self.O3_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, to_eval = 'L(4959)+L(5007)', Hbeta = self.Hbeta_flux) # # #Determine the O/H abundance # if (self.Properties_dict['OII_HII_3279A_pn'] is not None) and (self.Properties_dict['OIII_HII_pn'] is not None): # self.Properties_dict['OI_HI_pn'] = self.Properties_dict['OII_HII_3279A_pn'] + self.Properties_dict['OIII_HII_pn'] # self.Properties_dict['OII_HII_pn'] = self.Properties_dict['OII_HII_3279A_pn'] # elif (self.Properties_dict['OII_HII_7319A_pn'] is not None) and (self.Properties_dict['OIII_HII_pn'] is not None): # self.Properties_dict['OI_HI_pn'] = self.Properties_dict['OII_HII_7319A_pn'] + self.Properties_dict['OIII_HII_pn'] # self.Properties_dict['OII_HII_pn'] = self.Properties_dict['OII_HII_7319A_pn'] # # return # # def nitrogen_abundance_scheme(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TSIII_pn'] is not None: # Te = self.Properties_dict['TSIII_pn'] #YOU CAN TEST THIS WITH OBJECT 51959-092 # else: # Te = self.Properties_dict['TNII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the N+1 ion abundance (If O2_3726A, O2_3729A are available we prioritize them) # if Te is not None: # # if self.lines_dict.viewkeys() >= {'N2_6548A', 'N2_6584A'}: # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.Properties_dict['NII_HII_pn'] = self.N2_atom.getIonAbundance(int_ratio = Ratio, tem=Te, den=ne, to_eval = 'L(6548)+L(6584)', Hbeta = self.Hbeta_flux) # # # #Calculate the elemental abundance # if (self.Properties_dict['OI_HI_pn'] is not None) and (self.Properties_dict['NII_HII_pn'] is not None): # # #Standard method # self.Properties_dict['NI_OI_pn'] = self.Properties_dict['NII_HII_pn'] / self.Properties_dict['OII_HII_pn'] # NI_HI_initial = self.Properties_dict['NI_OI_pn'] * self.Properties_dict['OI_HI_pn'] # # #Repeat calculation if 5755 line was observed to include the recombination contribution # if self.lines_dict.viewkeys() >= {'N2_5755A'}: # # NIII_HI = NI_HI_initial - self.Properties_dict['NII_HII_pn'] # Lines_Correction = 3.19 * power((Te/10000), 0.30) * NIII_HI * self.Hbeta_flux # # self.Properties_dict['TNII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[NII] 5755/6584+', # diag_den = '[SII] 6731/6716', # value_tem = (self.lines_dict['N2_5755A'] - Lines_Correction)/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.Properties_dict['NII_HII_pn'] = self.N2_atom.getIonAbundance(int_ratio = Ratio, tem=self.Properties_dict['TNII_pn'], den=ne, to_eval = 'L(6548)+L(6584)', Hbeta = self.Hbeta_flux) # self.Properties_dict['NI_OI_pn'] = self.Properties_dict['NII_HII_pn'] / self.Properties_dict['OII_HII_pn'] # self.Properties_dict['NI_HI_pn'] = self.Properties_dict['NI_OI_pn'] * self.Properties_dict['OI_HI_pn'] # # else: # self.Properties_dict['NI_HI_pn'] = NI_HI_initial # # return # # def helium_abundance_scheme_fab(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TOIII_approxfrom_TSIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # else: # TOIII = self.Properties_dict['TOIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the He+1 abundance # if self.lines_dict.viewkeys() >= {'He1_4472A', 'He1_5876A', 'He1_6678A'}: # # y0_I4471 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_4472A'], tem=TOIII, den=ne, wave = 4471, Hbeta = self.Hbeta_flux) # y0_I5876 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_5876A'], tem=TOIII, den=ne, wave = 5876, Hbeta = self.Hbeta_flux) # y0_I6678 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_6678A'], tem=TOIII, den=ne, wave = 6678, Hbeta = self.Hbeta_flux) # # t4 = TOIII / 10000 # # D = 1.0 + 3110.0 * power(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * power(t4,0.02) * (exp(-4.544)) / D # g_I5876 = (7.12 * power(t4,0.14) * (exp(-3.776/t4)) + 1.47 * power(t4,-0.28) * (exp(-4.544/t4))) / D # g_I6678 = (3.27 * power(t4,-0.41) * (exp(-3.777/t4)) + 0.49 * power(t4,-0.52) * (exp(-4.544/t4))) / D # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # self.Properties_dict['HeII_HII_pn'] = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.Properties_dict['HeIII_HII_pn'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # #Calculate elemental abundance # if (self.Properties_dict['HeII_HII_pn'] is not None) and (self.Properties_dict['HeIII_HII_pn'] is not None): # self.Properties_dict['HeI_HI_pn'] = self.Properties_dict['HeII_HII_pn'] + self.Properties_dict['HeIII_HII_pn'] # elif (self.Properties_dict['HeII_HII_pn'] is not None): # self.Properties_dict['HeI_HI_pn'] = self.Properties_dict['HeII_HII_pn'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI_pn'] is not None): # #From Oxygen: # if self.Properties_dict['OI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_O_pn'] = (4 * self.Properties_dict['HeI_HI_pn'] * (1 - 20 * self.Properties_dict['OI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_pn']) # #From Sulfur # if self.Properties_dict['SI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_S_pn'] = (4 * self.Properties_dict['HeI_HI_pn'] * (1 - 20 * self.OI_SI * self.Properties_dict['SI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_pn']) # # return # # def helium_abundance_scheme_Oxygen(self, lineslog_frame): # # #Select the temperature and density for the procedure # if self.Properties_dict['TOIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_pn'] # else: # TOIII = None # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = None # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # HeI_indices = (lineslog_frame.Ion.str.contains('HeI_')) & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') # HeI_labels = lineslog_frame.loc[HeI_indices].index.values # HeI_waves = lineslog_frame.loc[HeI_indices].TheoWavelength.values # # Flux_Hbeta = self.lines_dict['H1_4861A'] # Emis_Hbeta = self.H1_atom.getEmissivity(tem=TOIII, den=ne, label = '4_2', product = False) # # for i in range(len(HeI_labels)): # # print 'Esta es', HeI_labels[i] # print 'HeI_waves[i]', round(HeI_waves[i]) # # line_relative_Flux = self.lines_dict[HeI_labels[i]] / Flux_Hbeta # line_relative_emissivity = self.He1_atom.getEmissivity(tem = TOIII, den = ne, wave = round(HeI_waves[i]), product = False) / Emis_Hbeta # # if i == 0: # matrix_HeI_fluxes = copy(line_relative_Flux) # matrix_HeI_emis = copy(line_relative_emissivity) # # else: # matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) # matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) # # matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) # matrix_HeI_emis = transpose(matrix_HeI_emis) # # #Perform the fits # params = Parameters() # params.add('Y', value = 0.01) # HeII_HII_array = zeros(len(matrix_HeI_fluxes)) # HeII_HII_error = zeros(len(matrix_HeI_fluxes)) # # for i in range(len(matrix_HeI_fluxes)): # fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) # HeII_HII_array[i] = fit_Output.params['Y'].value # HeII_HII_error[i] = fit_Output.params['Y'].stderr # # #NO SUMANDO LOS ERRORES CORRECTOS? # # self.Properties_dict['HeII_HII_from_O_pn'] = unumpy.uarray(HeII_HII_array, mean(HeII_HII_error)) # # self.Properties_dict['HeII_HII_from_O_pn'] = HeII_HII_array # self.Properties_dict['HeII_HII_from_O_pn'] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) # # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.Properties_dict['HeIII_HII_from_O_pn'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # # #Calculate elemental abundance # if (self.Properties_dict['HeII_HII_from_O_pn'] is not None) and (self.Properties_dict['HeIII_HII_from_O_pn'] is not None): # self.Properties_dict['HeI_HI_from_O_pn'] = self.Properties_dict['HeII_HII_from_O_pn'] + self.Properties_dict['HeIII_HII_from_O_pn'] # elif (self.Properties_dict['HeII_HII_from_O_pn'] is not None): # self.Properties_dict['HeI_HI_from_O_pn'] = self.Properties_dict['HeII_HII_from_O_pn'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI_from_O_pn'] is not None): # #From Oxygen: # if self.Properties_dict['OI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_O_pn'] = (4 * self.Properties_dict['HeI_HI_from_O_pn'] * (1 - 20 * self.Properties_dict['OI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_from_O_pn']) # # return # # def helium_abundance_scheme_Sulfur(self, lineslog_frame): # # #Select the temperature and density for the procedure # if self.Properties_dict['TOIII_approxfrom_TSIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # else: # TOIII = None # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = None # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # HeI_indices = lineslog_frame.Ion.str.contains('HeI_') & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') # HeI_labels = lineslog_frame.loc[HeI_indices].index.values # HeI_waves = lineslog_frame.loc[HeI_indices].TheoWavelength.values # # Flux_Hbeta = self.lines_dict['H1_4861A'] # Emis_Hbeta = self.H1_atom.getEmissivity(tem=TOIII, den=ne, label = '4_2', product = False) # # for i in range(len(HeI_labels)): # # line_relative_Flux = self.lines_dict[HeI_labels[i]] / Flux_Hbeta # line_relative_emissivity = self.He1_atom.getEmissivity(tem = TOIII, den = ne, wave = round(HeI_waves[i]), product = False) / Emis_Hbeta # # if i == 0: # matrix_HeI_fluxes = copy(line_relative_Flux) # matrix_HeI_emis = copy(line_relative_emissivity) # # else: # matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) # matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) # # matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) # matrix_HeI_emis = transpose(matrix_HeI_emis) # # #Perform the fits # params = Parameters() # params.add('Y', value = 0.01) # HeII_HII_array = zeros(len(matrix_HeI_fluxes)) # HeII_HII_error = zeros(len(matrix_HeI_fluxes)) # # for i in range(len(matrix_HeI_fluxes)): # fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) # HeII_HII_array[i] = fit_Output.params['Y'].value # HeII_HII_error[i] = fit_Output.params['Y'].stderr # # #NO SUMANDO LOS ERRORES CORRECTOS? # # self.Properties_dict['HeII_HII_from_S_pn'] = unumpy.uarray(HeII_HII_array, mean(HeII_HII_error)) # # self.Properties_dict['HeII_HII_from_S_pn'] = HeII_HII_array # self.Properties_dict['HeII_HII_from_S_pn'] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.Properties_dict['HeIII_HII_from_S_pn'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # # #Calculate elemental abundance # if (self.Properties_dict['HeII_HII_from_S_pn'] is not None) and (self.Properties_dict['HeIII_HII_from_S_pn'] is not None): # self.Properties_dict['HeI_HI_from_S_pn'] = self.Properties_dict['HeII_HII_from_S_pn'] + self.Properties_dict['HeIII_HII_from_S_pn'] # elif (self.Properties_dict['HeII_HII_from_S_pn'] is not None): # self.Properties_dict['HeI_HI_from_S_pn'] = self.Properties_dict['HeII_HII_from_S_pn'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI_from_S_pn'] is not None): # #From Oxygen: # if self.Properties_dict['SI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_S_pn'] = (4 * self.Properties_dict['HeI_HI_from_S_pn'] * (1 - 20 * self.OI_SI * self.Properties_dict['SI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_from_S_pn']) # # return # # def store_dict_ObjLog(self, FileFolder, CodeName, verbose = False): # # keys, values = self.Properties_dict.keys(), self.Properties_dict.values() # # for i in range(len(keys)): # if values[i] is not None: # #This removes the nan elements from the treatment values[i][~isnan(values[i])] # Median_Value = median(values[i][~isnan(values[i])]) # error = std(values[i][~isnan(values[i])]) # self.SaveParameter_ObjLog(CodeName, FileFolder, keys[i], ufloat(Median_Value, error)) # # if verbose == True: # print i, keys[i], Median_Value, error # # else: # self.SaveParameter_ObjLog(CodeName, FileFolder, keys[i], values[i]) # if verbose == True: # print i, keys[i], values[i] # return # # def SaveParameter_ObjLog(self, CodeName, FileFolder, Parameter, Magnitude, Error = None, Assumption = None, Log_extension = None): # # if Log_extension == None: # Log_extension = self.ObjectLog_extension # ObjLog_Address = FileFolder + CodeName + Log_extension # ObjLog_Parameters, ObjLog_Magnitudes, ObjLog_Errors, ObjLog_Comments = loadtxt(ObjLog_Address, dtype=str, usecols = [0,1,2,3], unpack = True) # # else: # ObjLog_Address = FileFolder + CodeName # ObjLog_Parameters, ObjLog_Magnitudes, ObjLog_Errors, ObjLog_Comments = loadtxt(ObjLog_Address, dtype=str, usecols = [0,1,2,3], unpack = True) # # #Saving the new value for the given parameter # Parameter_Index = where(ObjLog_Parameters == Parameter)[0][0] # # #Save the error in the case of a nparray # if isinstance(Magnitude, UFloat) and (Error == None): # ObjLog_Magnitudes[Parameter_Index] = Magnitude.nominal_value # ObjLog_Errors[Parameter_Index] = Magnitude.std_dev # elif Error != None: # ObjLog_Magnitudes[Parameter_Index] = str(Magnitude) # ObjLog_Errors[Parameter_Index] = str(Error) # elif Magnitude != None: # ObjLog_Magnitudes[Parameter_Index] = str(Magnitude) # elif Magnitude == None: # ObjLog_Magnitudes[Parameter_Index] = 'None' # ObjLog_Errors[Parameter_Index] = '-' # # #Saving the text file # savetxt(ObjLog_Address, transpose((ObjLog_Parameters, ObjLog_Magnitudes, ObjLog_Errors, ObjLog_Comments)), fmt='%s') # # return # class pyneb_tools(): # # def __init__(self): # # #Set atomic data # atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') # atomicData.setDataFile('s_iii_coll_HRS12.dat') # # #Declare hydrogen atom so it becomes readily available: # self.H1_atom = RecAtom('H', 1) # self.S2_atom = Atom('S', 2) # self.S3_atom = Atom('S', 3) # self.He1_atom = RecAtom('He', 1) # self.He2_atom = RecAtom('He', 2) # # def density_pyneb(self, Ion, Temp): # # element = Ion[0:-1] # ion_n = int(Ion[-1]) # # if Ion == 'S2': # # Ion_Atom = Atom(element, ion_n) # # emLine = ["S2_6716A","S2_6731A"] # Flux_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # # FluxRatio = Flux_dict['S2_6716A'] / Flux_dict['S2_6731A'] # # Den = Ion_Atom.getTemDen(FluxRatio, tem = Temp, wave1=6716, wave2=6731) # # return Den # # def temperature_pyneb(self, Ion, Den): # # element = Ion[0:-1] # ion_n = int(Ion[-1]) # # if Ion == 'O3': # # Ion_Atom = Atom(element, ion_n) # # emLine = ["S2_6716A","S2_6731A"] # Flux_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # # FluxRatio = (Flux_dict['O3_4959A'] + Flux_dict['O3_5007A']) / Flux_dict['O3_4363A'] # # Temp = Ion_Atom.getTemDen(FluxRatio, den = Den, to_eval = "(L(4959) + L(5007)) / L(4363)") # # return Temp # # class direct_Method(ReddeningLaws, pyneb_tools): # # def __init__(self): # # pyneb_tools.__init__(self) # ReddeningLaws.__init__(self) # # self.den_Methodology = None # self.tem_Methodology = None # # self.m_SIV_correction = ufloat(1.008,0.037) # self.n_SIV_correction = ufloat(1.576,0.066) # # def DeclareObject(self, FileFolder, FileName, CodeName, AbundancesFileExtension = '_WHT_LinesLog_v3.txt', cHbeta_type = 'cHBeta_red'): # #WARNING: This method should be define at a lower level # # self.FileFolder = FileFolder # self.FileName = FileName # self.CodeName = CodeName # # EmLine_List = ['R_SII', 'R_SIIprime', 'R_SIII', 'R_NII', 'R_OII', 'R_OIII'] # Den_List = ['nSII'] # Temp_List = ['TOIII', 'TOII', 'TSII', 'TSIII','TNII', 'TOII_approx_TOIII', 'TSIII_approx_TOIII', 'TOIII_approx_TSIII', 'TNII_approx_TOIII'] # IonicAbund_List = ['SII_HII', 'SIII_HII', 'SIV_HII', 'OII_HII', 'OII_HII_3279A', 'OII_HII_7319A', 'NII_HII', 'HeII_HII', 'HeIII_HII', 'ArIII_HII', 'ArIV_HII'] # Element_List = ['SI_HI', 'SI_HI_ArCorr', 'OI_HI', 'NI_OI', 'NI_HI', 'HeI_HI'] # # self.Properties_dict = dict.fromkeys(Element_List + IonicAbund_List + Den_List + Temp_List + EmLine_List) # # self.cHbeta = self.GetParameter_ObjLog(self.CodeName, self.FileFolder, Parameter = cHbeta_type, Assumption = 'float') # # self.AbundancesExtension = AbundancesFileExtension # # def density_determination(self, Ion, Temp = None, methodology = None): # # #Paremetric approach # if methodology == 'Epm2014': # if Ion == 'S2': # # emLine = ["S2_6716A", "S2_6731A"] # Flux_dict = self.getLinesFlux_dered(emLine, self.cHbeta) # Flux_dict['Temp'] = Temp # den = self.empiric_formulae(Flux_dict, methodology, Ion, 'nSII') # # #Check for non physical output # den = self.check_issues(magnitude = den, parameter_type = 'density') # return den # # #Using pyneb # if methodology == 'pyneb': # # #Calculate density using pyneb # den = self.density_pyneb(Ion, Temp) # # #Check for non physical output #WARNING: For pyneb this is too general # den = self.check_issues(magnitude = den, parameter_type = 'density') # # return den # # def temperature_determination(self, Ion, dens = None, methodology = None, Temp = None, RecCorr = None): # # #Direct methods # if methodology == 'Epm2014': # # if Ion == 'O3': # # emLine = ["O3_4959A","O3_5007A","O3_4363A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TOIII') # # if Ion == 'O2': # data_dict = {'Temp': Temp} # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TOII_approx_TOIII') # # if Ion == 'S3': # # emLine = ["S3_9069A","S3_9531A","S3_6312A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TSIII') # # if Ion == 'N2': # # emLine = ["N2_6548A","N2_6584A", "N2_5755A", 'H1_4861A'] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # if RecCorr != None: # if data_dict["N2_5755A"] != None: # data_dict["N2_5755A"] = data_dict["N2_5755A"] - RecCorr * data_dict['H1_4861A'] # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TNII') # # if methodology == 'Haegele2008': # # if Ion == 'S2': # # emLine = ["S2_6716A","S2_6731A", "S2_4069A", 'S2_4076A'] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TSII') # # if Ion == 'O2': # # emLine = ['O2_3726A',"O2_3729A","O2_7319A",'O2_7330A'] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # temp = self.empiric_formulae(data_dict, methodology, Ion, 'TOII') # # # #Using pyneb # if methodology == 'pyneb': # # temp = self.temperature_pyneb(Ion, dens) # # return temp # # def argon_IonAbundance(self, Temp, Den, Ion, methodology = 'Haegele2008'): # # if methodology == 'Haegele2008': # # if Ion == 'Ar3': # # emLine = ["Ar3_7136A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['ArIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'ArIII_HII') # print 'The argon thing III', self.Properties_dict['ArIII_HII'] # return # # if Ion == 'Ar4': # # emLine = ["Ar4_4740A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['ArIV_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'ArIV_HII') # print 'The argon thing IV', self.Properties_dict['ArIV_HII'] # return # # def oxygen_IonAbundance(self, Temp, Den, Ion, methodology = 'Epm2014', RecCorr = None): # # if methodology == 'Epm2014': # # if Ion == 'O3': # # emLine = ["O3_4959A","O3_5007A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['OIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'OIII_HII') # # return # # if Ion == 'O2': # #This assumes both lines are blended # emLine = ["O2_3726A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta, Mode='Integrated') # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['OII_HII_3279A'] = self.empiric_formulae(data_dict, methodology, Ion, 'OII_HII') # # if methodology == 'Fabian2006': # # if Ion == 'O2': # # emLine = ["O2_7319A","O2_7330A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # # if RecCorr == None: # self.Properties_dict['OII_HII_7319A'] = self.empiric_formulae(data_dict, methodology, Ion, 'OII_HII_7319A') # else: # data_dict["O2_7319A"] = data_dict["O2_7319A"] - RecCorr # self.Properties_dict['OII_HII_7319A'] = self.empiric_formulae(data_dict, methodology, Ion, 'OII_HII_7319A') # # return # # def nitrogen_IonAbundance(self, Temp, Den, Ion, methodology = 'Epm2014'): # # if methodology == 'Epm2014': # # if Ion == 'N2': # # emLine = ["N2_6548A","N2_6584A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['NII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'NII_HII') # # return # # def sulfur_IonAbundance(self, Temp, Den, Ion, methodology = 'Haegele2008'): # # if methodology == 'Haegele2008': # # if Ion == 'S3': # # emLine = ["S3_9069A","S3_9531A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['SIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SIII_HII') # # return # # if Ion == 'S2': # # emLine = ["S2_6716A","S2_6731A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['SII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SII_HII') # # if methodology == 'Vital2015': # if Ion == 'S3': # emLine = ["S3_9069A","S3_9531A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['SIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SIII_HII') # # return # # if Ion == 'S2': # methodology = 'Haegele2008' # emLine = ["S2_6716A","S2_6731A","H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['SII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'SII_HII') # # # return # # def helium_IonAbundance(self, Temp, Den, Ion, methodology = 'Fabian2006'): # # if methodology == 'Fabian2006': # # if Ion == 'He1': # emLine = ["He1_4472A", "He1_5876A", "He1_6678A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['HeII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeII_HII') # # return # # if Ion == 'He2': # emLine = ["He2_4686A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['HeIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeIII_HII') # # return # # if methodology == 'Vital2015': # # if Ion == 'He1': # emLine = ["He1_4472A", "He1_5876A", "He1_6678A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['HeII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeII_HII') # # if Ion == 'He2': # emLine = ["He2_4686A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'] = Temp # self.Properties_dict['HeIII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeIII_HII') # # if methodology == 'PyNeb': # # if Ion == 'He1': # emLine = ["He1_4472A", "He1_5876A", "He1_6678A", "H1_4861A"] # data_dict = self.getLinesFlux_dered(Lines_List = emLine, cHbeta = self.cHbeta) # data_dict['Temp'], data_dict['Den'] = Temp, Den # self.Properties_dict['HeII_HII'] = self.empiric_formulae(data_dict, methodology, Ion, 'HeII_HII') # # return # # if Ion == 'He2': # # return # # def empiric_formulae(self, data_dict, methodology, Ion, Parameter): # # Magnitude = None # if data_dict != None: # if (None not in data_dict.values()): # if methodology == 'Epm2014': # if Parameter == 'nSII': # # self.Properties_dict['R_SII'] = data_dict['S2_6716A'] / data_dict['S2_6731A'] # t4 = data_dict['Temp'] / 10000.0 # a_0 = 16.054 - 7.79 / t4 - 11.32 * t4 # a_1 = -22.66 + 11.08 / t4 + 16.02 * t4 # b_0 = -21.61 + 11.89 / t4 + 14.59 * t4 # b_1 = 9.17 - 5.09 / t4 - 6.18 * t4 # Magnitude = 1000.0 * (self.Properties_dict['R_SII']*a_0 + a_1) / (self.Properties_dict['R_SII']*b_0 + b_1) # #self.Properties_dict['nSII'] = 1000.0 * (self.Properties_dict['R_SII']*a_0 + a_1) / (self.Properties_dict['R_SII']*b_0 + b_1) # # elif Parameter == 'TOIII': # self.Properties_dict['R_OIII'] = (data_dict['O3_4959A'] + data_dict['O3_5007A']) / data_dict['O3_4363A'] # self.Properties_dict['TOIII'] = (0.7840 - 0.0001357 * self.Properties_dict['R_OIII'] + (48.44 / self.Properties_dict['R_OIII'])) * 10000 # Magnitude = self.Properties_dict['TOIII'] # # elif Parameter == 'TOII_approx_TOIII': # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TOII_approx_TOIII'] = (1.397 /( (1/t4) + 0.385) ) * 10000 # Magnitude = self.Properties_dict['TOII_approx_TOIII'] # # elif Parameter == 'TSIII_approx_TOIII': # #From equation TOIII = 1.0807 * TSIII - 0.0846 # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TSIII_approx_TOIII'] = ((t4 + 0.0846) / 1.0807)*10000 # # elif Parameter == 'TOIII_approx_TSIII': # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TOIII_approx_TSIII'] = (1.0807 * t4 - 0.0846)*10000 # Magnitude = self.Properties_dict['TOIII_approx_TSIII'] # # elif Parameter == 'TSIII': # self.Properties_dict['R_SIII'] = (data_dict['S3_9069A'] + data_dict['S3_9531A']) / data_dict['S3_6312A'] # self.Properties_dict['TSIII'] = (0.5147 + 0.0003187 * self.Properties_dict['R_SIII'] + (23.6404 / self.Properties_dict['R_SIII'])) * 10000 # Magnitude = self.Properties_dict['TSIII'] # # elif Parameter == 'TNII': # self.Properties_dict['R_NII'] = (data_dict['N2_6548A'] + data_dict['N2_6584A']) / data_dict['N2_5755A'] # self.Properties_dict['TNII'] = (0.6153 - 0.0001529 * self.Properties_dict['R_NII'] + (35.3641 / self.Properties_dict['R_NII'])) * 10000 # Magnitude = self.Properties_dict['TNII'] # # elif Parameter == 'TNII_approx_TOIII': # t4 = data_dict['Temp'] / 10000 # self.Properties_dict['TNII_approx_TOIII'] = (1.452 /( (1/t4) + 0.479))*10000 # Magnitude = self.Properties_dict['TNII_approx_TOIII'] # # elif Parameter == 'OIII_HII': # t4 = data_dict['Temp'] / 10000 # logOIII_logHII = -12 + umath.log10((data_dict['O3_4959A'] + data_dict['O3_5007A']) / data_dict['H1_4861A']) + 6.1868 + 1.2491 / t4 - 0.5816 * umath.log10(t4) # Magnitude = umath.pow(10, logOIII_logHII) # # elif Parameter == 'OII_HII_3279A': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # logOII_logHII = -12 + umath.log10((data_dict['O2_3726A']) / data_dict['H1_4861A']) + 5.887 + 1.641 / t4 - 0.543 * umath.log10(t4) + 0.000114 * ne # Magnitude = umath.pow(10, logOII_logHII) # # elif Parameter == 'NII_HII': # t4 = data_dict['Temp'] / 10000 # logNII_logHII = -12 + umath.log10((data_dict['N2_6548A'] + data_dict['N2_6584A']) / data_dict['H1_4861A']) + 6.291 + 0.90221 / t4 - 0.5511 * umath.log10(t4) # Magnitude = umath.pow(10, logNII_logHII) # # elif methodology == 'Angeles2015': # # if Parameter == 'SIV_HII': # # ArIII_HII = data_dict['ArIII_HII'] # ArIV_HII = data_dict['ArIV_HII'] # SIII_HII = data_dict['SIII_HII'] # # if (ArIII_HII != None) and (ArIV_HII != None) and (ArIV_HII != 0.0): #Somehow ArIV should be saved as None # logAr2Ar3 = umath.log10(ArIII_HII/ArIV_HII) # # else: # logAr2Ar3 = ufloat(0.0, 0.0) # # logSIV = umath.log10(SIII_HII) - (logAr2Ar3 - self.n_SIV_correction) / self.m_SIV_correction # # # self.Properties_dict['SIV_HII'] = umath.pow(10, logSIV) # Magnitude = self.Properties_dict['SIV_HII'] # # # Old formulation # # ArIII_HII = data_dict['ArIII_HII'] # # ArIV_HII = data_dict['ArIV_HII'] # # SIII_HII = data_dict['SIII_HII'] # # # # if (ArIII_HII != None) and (ArIV_HII != 0.0): # # y_Ar = umath.log10(ArIII_HII/ArIV_HII) # # else: # # y_Ar = ufloat(0.0, 0.0) # # # # x_S = (y_Ar - 0.126) / 1.192 # # # # self.Properties_dict['SIV_HII'] = SIII_HII / umath.pow(10, x_S) # # Magnitude = self.Properties_dict['SIV_HII'] # # elif methodology == 'Haegele2008': # # if Parameter == 'TSII': # self.Properties_dict['R_SIIprime'] = (data_dict['S2_6716A'] + data_dict['S2_6731A']) / (data_dict['S2_4069A'] + data_dict['S2_4076A']) # self.Properties_dict['TSII'] = (1.92 - 0.0375 *self.Properties_dict['R_SIIprime'] - 14.5 / self.Properties_dict['R_SIIprime'] + 105.64 / (self.Properties_dict['R_SIIprime'] * self.Properties_dict['R_SIIprime'])) * 10000 # Magnitude = self.Properties_dict['TSII'] # # if Parameter == 'TOII': # ne = data_dict['Den'] # self.Properties_dict['R_OII'] = (data_dict['O2_3726A'] + data_dict['O2_3729A']) / (data_dict['O2_7319A'] + data_dict['O2_7330A']) # self.Properties_dict['TOII'] = (0.23 + 0.0017 * self.Properties_dict['R_OII'] + 38.3 / self.Properties_dict['R_OII'] + umath.log10(1 + 0.0001 * ne)) * 10000 # Magnitude = self.Properties_dict['TOII'] # # elif Parameter == 'ArIII_HII': # t4 = data_dict['Temp'] / 10000 # logArIII_logHII = -12 + umath.log10(data_dict['Ar3_7136A'] / data_dict['H1_4861A']) + 6.157 + 0.808/t4 - 0.508 * umath.log10(t4) # Magnitude = umath.pow(10, logArIII_logHII) # # elif Parameter == 'ArIV_HII': # t4 = data_dict['Temp'] / 10000 # logArIV_logHII = -12 + umath.log10(data_dict['Ar4_4740A'] / data_dict['H1_4861A']) + 5.705 + 1.246/t4 - 0.156 * umath.log10(t4) # Magnitude = umath.pow(10, logArIV_logHII) # # elif Parameter == 'SII_HII': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # logSII_logHII = -12 + umath.log10((data_dict['S2_6716A'] + data_dict['S2_6731A']) / data_dict['H1_4861A']) + 5.423 + 0.929/t4 - 0.280 * umath.log10(t4) + umath.log10(1 + 0.0001 * ne) # Magnitude = umath.pow(10, logSII_logHII) # # elif Parameter == 'SIII_HII': # t4 = data_dict['Temp'] / 10000 # logSIII_logHII = -12 + umath.log10((data_dict['S3_9069A'] + data_dict['S3_9531A']) / data_dict['H1_4861A']) + 5.8 + 0.77 / t4 - 0.22 * umath.log10(t4) # Magnitude = umath.pow(10, logSIII_logHII) # # elif methodology == 'Vital2015': # # if Parameter == 'SIII_HII': # t4 = data_dict['Temp'] / 10000 # logSIII_logHII = -12 + umath.log10((data_dict['S3_9069A'] + data_dict['S3_9531A']) / data_dict['H1_4861A']) + 6.012 + 0.6309 / t4 - 0.5722 * umath.log10(t4) # Magnitude = umath.pow(10, logSIII_logHII) # # if Parameter == 'HeIII_HII': # t4 = data_dict['Temp'] / 10000 # y_PPI4686 = 0.081 * umath.pow(t4, 0.15) * data_dict['He2_4686A'] / data_dict['H1_4861A'] # Magnitude = y_PPI4686 # # if Parameter == 'HeII_HII': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # # y0_I4471 = 2.039 * umath.pow(t4,0.102) * data_dict['He1_4472A'] / data_dict['H1_4861A'] # y0_I5876 = 0.732 * umath.pow(t4,0.171) * data_dict['He1_5876A'] / data_dict['H1_4861A'] # y0_I6678 = 2.573 * umath.pow(t4,0.18) * data_dict['He1_6678A'] / data_dict['H1_4861A'] # # D = 1.0 + 3110.0 * umath.pow(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * umath.pow(t4,0.02) * (umath.exp(-4.544)) / D # g_I5876 = (7.12 * umath.pow(t4,0.14) * (umath.exp(-3.776/t4)) + 1.47 * umath.pow(t4,-0.28) * (umath.exp(-4.544/t4))) / D # g_I6678 = (3.27 * umath.pow(t4,-0.41) * (umath.exp(-3.777/t4)) + 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # elif methodology == 'Liu2000': # # if Parameter == 'O2_RecombCorr': # t4 = data_dict['Temp'] / 10000 # OII_HII = data_dict['OII_HII_7319A'] # OII_RecombCor = 9.36 * umath.pow(t4, 0.44) * OII_HII # Magnitude = OII_RecombCor # # if Parameter == 'N2_RecombCorr': # t4 = data_dict['Temp'] / 10000 # NIII_HII = data_dict['NIII_HII'] # NII_RecombCor = 3.19 * umath.pow(t4, 0.30) * NIII_HII # Magnitude = NII_RecombCor # # elif methodology == 'Epm2007': # # if Parameter == 'O2': # ne = data_dict['Den'] # t4 = data_dict['Temp'] / 10000 # O2plus_Hplus = data_dict['OIII_HII'] # I7320_IBeta_R = 9.36 * umath.pow(t4, 0.44) * O2plus_Hplus # logOII_logHII = -12 + umath.log10((data_dict['O2_7319A'] + data_dict['O2_7330A']) / data_dict['H1_4861A'] - I7320_IBeta_R) + 6.895 + 2.44/t4 - 0.58*umath.log10(t4) - umath.log10(1.0 + 0.0047 * ne) # Magnitude = umath.pow(10, logOII_logHII) # # elif methodology == 'Fabian2006': # # if Parameter == 'HeII_HII': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # # y0_I4471 = 2.04 * umath.pow(t4,0.13) * data_dict['He1_4472A'] / data_dict['H1_4861A'] # y0_I5876 = 0.738 * umath.pow(t4,0.23) * data_dict['He1_5876A'] / data_dict['H1_4861A'] # y0_I6678 = 2.58 * umath.pow(t4,0.25) * data_dict['He1_6678A'] / data_dict['H1_4861A'] # # D = 1.0 + 3110.0 * umath.pow(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * umath.pow(t4,0.02) * (umath.exp(-4.544)) / D # g_I5876 = (7.12 * umath.pow(t4,0.14) * (umath.exp(-3.776/t4)) + 1.47 * umath.pow(t4,-0.28) * (umath.exp(-4.544/t4))) / D # g_I6678 = (3.27 * umath.pow(t4,-0.41) * (umath.exp(-3.777/t4)) + 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # elif Parameter == 'HeIII_HII': # t4 = data_dict['Temp'] / 10000 # y_PPI4686 = 0.084 * umath.pow(t4, 0.14) * data_dict['He2_4686A'] / data_dict['H1_4861A'] # Magnitude = y_PPI4686 # # elif Parameter == 'OII_HII_7319A': # t4 = data_dict['Temp'] / 10000 # ne = data_dict['Den'] # logOII_logHII = -12 + umath.log10((data_dict['O2_7319A'] + data_dict['O2_7330A']) / data_dict['H1_4861A']) + 6.895 + 2.44 / t4 - 0.58 * umath.log10(t4) - umath.log10(1 + 0.0047 * ne) # Magnitude = umath.pow(10, logOII_logHII) # # elif methodology == 'PyNeb': # # if Parameter == 'HeII_HII': # # te = data_dict['Temp'] # ne = data_dict['Den'] # # self.He1.getIonAbundance() # # y0_I4471 = self.He1_atom.getIonAbundance(int_ratio = 100 * data_dict['He1_4472A']/data_dict['H1_4861A'] , tem=te, den=ne, label='He1_4472A') # y0_I5876 = self.He1_atom.getIonAbundance(int_ratio = 100 * data_dict['He1_5876A']/data_dict['H1_4861A'] , tem=te, den=ne, label='He1_5876A') # y0_I6678 = self.He1_atom.getIonAbundance(int_ratio = 100 * data_dict['He1_6678A']/data_dict['H1_4861A'] , tem=te, den=ne, label='He1_6678A') # # # y0_I4471 = 2.04 * umath.pow(t4,0.13) * data_dict['He1_4472A'] / data_dict['H1_4861A'] # # y0_I5876 = 0.738 * umath.pow(t4,0.23) * data_dict['He1_5876A'] / data_dict['H1_4861A'] # # y0_I6678 = 2.58 * umath.pow(t4,0.25) * data_dict['He1_6678A'] / data_dict['H1_4861A'] # # D = 1.0 + 3110.0 * umath.pow(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * umath.pow(t4,0.02) * (umath.exp(-4.544)) / D # g_I5876 = (7.12 * umath.pow(t4,0.14) * (umath.exp(-3.776/t4)) + 1.47 * umath.pow(t4,-0.28) * (umath.exp(-4.544/t4))) / D # g_I6678 = (3.27 * umath.pow(t4,-0.41) * (umath.exp(-3.777/t4)) + 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # # return Magnitude # # def check_issues(self, magnitude, parameter_type): # # #Security check in the case we are getting a negative density: # if parameter_type == 'density': # if magnitude != None: # # if magnitude <= 0: # return ufloat(50.0, 50.0) # else: # return magnitude # return magnitude # # #Security check in case some flux is missing # elif parameter_type == 'EmFlux': # if magnitude[1] == None: # return None # else: # return ufloat(magnitude[1], magnitude[2]) # # class Chemical_Analysis(direct_Method): # # def __init__(self): # # direct_Method.__init__(self) # # #logSI_OI_Gradient = ufloat(-1.53, 0.05) # logSI_OI_Gradient = ufloat(-1.78, 0.03) # # self.OI_SI = umath.pow(10, -logSI_OI_Gradient) # self.He1 = RecAtom('He', 1) # atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') # # def set_element(self, element): # # if element == 'Argon': # # self.argon_abundance_scheme() # # elif element == 'Oxygen': # # self.oxygen_abundance_scheme() # # elif element == 'Nitrogen': # # self.nitrogen_abundance_scheme() # # elif element == 'Sulfur': # # self.sulfur_abundance_scheme() # # elif element == 'Helium': # # self.helium_abundance_scheme() # # return # # def argon_abundance_scheme(self): # # #Determine the sulfur density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #We try to calculate the T_ArIII from the sulfur lines # T_ArIII = T_SIII # T_ArIV = T_OIII # # #We try to calculate the T_ArIV from the sulfur lines, if not we use the Oxygen ones # if (T_OIII == None) and (T_SIII != None): # data_dict = {'Temp' : T_SIII} # T_OIII_approx = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion='O3', Parameter = 'TOIII_approx_TSIII') # T_ArIV = T_OIII_approx # # elif (T_SIII == None) and (T_OIII != None): # data_dict = {'Temp' : T_OIII} # T_SIII_approx = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion='S3', Parameter = 'TSIII_approx_TOIII') # T_ArIV = T_SIII_approx # # #Calculate the ArIII abundance # self.argon_IonAbundance(T_ArIII, ne_SII, Ion = 'Ar3', methodology = 'Haegele2008') # # #Calculate the ArIV abundance # self.argon_IonAbundance(T_ArIV, ne_SII, Ion = 'Ar4', methodology = 'Haegele2008') # # def sulfur_density_scheme(self, TempIn = None): # # #We use this set up mechanism to calculate the electron density for other elements # if TempIn == None: # #Determine the Te[SII] and Te[SIII] # T_SII = self.temperature_determination(Ion = 'S2', methodology = 'Haegele2008') # T_SIII = self.temperature_determination(Ion = 'S3', methodology = 'Epm2014') # else: # T_SII = None # T_SIII = TempIn # # #Determine ne_SII using the TSIII. If not available use TOIII to calculate TSIII # #If a TempIn is not available it will use the standard procedure # if T_SIII != None: # ne_SII = self.density_determination(Ion = 'S2', Temp = T_SIII, methodology='Epm2014') # else: # T_OIII, T_OII = self.oxygen_temperature_scheme() # data_dict = {} # data_dict['Temp'] = T_OIII # T_SIII = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion = 'S3', Parameter='TSIII_approx_TOIII') # ne_SII = self.density_determination(Ion = 'S2', Temp = T_SIII, methodology='Epm2014') # # return T_SII, T_SIII, ne_SII # # def sulfur_abundance_scheme(self): # # #Get the sulfur electron density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = None) # # self.Properties_dict['nSII'] = ne_SII # # #Determine the SII/HII abundance. # #If the T_SII temperature is available use it. If not T_SII = T_SIII: # if T_SII != None: # self.sulfur_IonAbundance(T_SII, ne_SII, Ion = 'S2', methodology = 'Haegele2008') # else: # self.sulfur_IonAbundance(T_SIII, ne_SII, Ion = 'S2', methodology = 'Haegele2008') # # #Determine the SIII/HII abundance # # self.sulfur_IonAbundance(T_SIII, ne_SII, Ion = 'S3', methodology = 'Haegele2008') # self.sulfur_IonAbundance(T_SIII, ne_SII, Ion = 'S3', methodology = 'Vital2015') # # #Determine the S/H abundance # #Include the Argon correction if the ArIV lines were observed # if (self.Properties_dict['SII_HII'] != None) and (self.Properties_dict['SIII_HII'] != None): # self.Properties_dict['SI_HI'] = self.Properties_dict['SII_HII'] + self.Properties_dict['SIII_HII'] # # #Calculate the [SIV] correction factor from the Argon abundance # #This structures enforces the calculation of the Argon apriori # data_dict = {} # data_dict['ArIII_HII'] = self.Properties_dict['ArIII_HII'] # data_dict['ArIV_HII'] = self.Properties_dict['ArIV_HII'] # data_dict['SIII_HII'] = self.Properties_dict['SIII_HII'] # # #The code does not work if we introduce a None entry. However, in this correction there is still a quantity even if the ArIV is no there # if data_dict['ArIV_HII'] == None: # data_dict['ArIV_HII'] = ufloat(0.0,0.0) # # #Compute the SIV_HII component # SIV_HII = self.empiric_formulae(data_dict, methodology = 'Angeles2015', Ion = 'S4', Parameter='SIV_HII') # # self.Properties_dict['SI_HI_ArCorr'] = self.Properties_dict['SII_HII'] + self.Properties_dict['SIII_HII'] + SIV_HII # # def oxygen_temperature_scheme(self): # # #Determine the Te[OIII] # T_OIII = self.temperature_determination(Ion = 'O3', methodology = 'Epm2014') # # #Determine the Te[OII] using all the [OII] lines # T_OII = self.temperature_determination(Ion = 'O2', methodology = 'Epm2014') # # #If lines not observed use approximation from T[OIII] # if T_OII == None: # T_OII = self.temperature_determination(Ion = 'O2', methodology = 'Epm2014', Temp = T_OIII) # # return T_OIII, T_OII # # def oxygen_abundance_scheme(self): # # #Determine the oxygen temperatures # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #Get the electron density from the sulfur lines using the oxigen temperature if observed. If not used sulfur lines # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # # #Calculate the OIII ion abundance # self.oxygen_IonAbundance(Temp = T_OIII, Den = ne_SII, Ion = 'O3', methodology = 'Epm2014') # # #Calculate the OII ion abundance # self.oxygen_IonAbundance(Temp = T_OII, Den = ne_SII, Ion = 'O2', methodology = 'Epm2014') # self.oxygen_IonAbundance(Temp = T_OII, Den = ne_SII, Ion = 'O2', methodology = 'Fabian2006') # # #Correct the OII from 7319A, 7330A lines from the recombination contribution # if self.Properties_dict['OII_HII_7319A'] != None: # OII_HII_7319A = self.Properties_dict['OII_HII_7319A'] # data_dict = {'Temp' : T_OII, # 'OII_HII_7319A' : OII_HII_7319A} # # RecCorr_O2_7319 = self.empiric_formulae(data_dict, methodology = 'Liu2000', Ion = 'O2', Parameter='O2_RecombCorr') # self.oxygen_IonAbundance(Temp = T_OII, Den = ne_SII, Ion = 'O2', methodology = 'Epm2014', RecCorr = RecCorr_O2_7319) # # #If O2_3726A, O2_3729A lines are not available we use O2_7319A, O2_7330A lines # if self.Properties_dict['OII_HII_3279A'] != None: # self.Properties_dict['OII_HII'] = self.Properties_dict['OII_HII_3279A'] # # elif (self.Properties_dict['OII_HII_7319A'] != None): # self.Properties_dict['OII_HII'] = self.Properties_dict['OII_HII_7319A'] # # #Determine the S/H abundance # #Include the Argon correction if the ArIV lines were observed # if (self.Properties_dict['OII_HII'] != None) and (self.Properties_dict['OIII_HII'] != None): # self.Properties_dict['OI_HI'] = self.Properties_dict['OII_HII'] + self.Properties_dict['OIII_HII'] # # def nitrogen_abundance_scheme(self): # #WARNING: THIS COULD BE FASTER WITH A MECHANISM WITH PRELOADS ALL THE EMISSION LINES # # #Determine the Te[NSII] # T_NII = self.temperature_determination(Ion = 'N2', methodology = 'Epm2014') # # if T_NII != None: # #YOU CAN TEST THIS WITH OBJECT 51959-092 # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = T_NII) # self.nitrogen_IonAbundance(Temp = T_NII, Den = ne_SII, Ion = 'N2', methodology = 'Epm2014') # # #If Te[NSII] cannot be calculated try to determine the Te[OII] # elif T_NII == None: # T_OIII, T_OII = self.oxygen_temperature_scheme() # data_dict = {'Temp' : T_OIII} # TNII_approx = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion='N2', Parameter = 'TNII_approx_TOIII') # # #Get the sulfur electron density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = TNII_approx) # self.nitrogen_IonAbundance(Temp = TNII_approx, Den = ne_SII, Ion = 'N2', methodology = 'Epm2014') # # #Determine the N/H abundance # #We need O/H abundance in order to calculate N/H abundance # if (self.Properties_dict['OI_HI'] != None) and (self.Properties_dict['NII_HII'] != None): # self.Properties_dict['NI_OI'] = self.Properties_dict['NII_HII'] / self.Properties_dict['OII_HII'] # self.Properties_dict['NI_HI'] = self.Properties_dict['NI_OI'] * self.Properties_dict['OI_HI'] # # #Take into account the recombination contribution from the # if T_NII != None: # NIII_HI = self.Properties_dict['NI_HI'] - self.Properties_dict['NII_HII'] # # data_dict = {'Temp' : T_NII, # 'NIII_HII' : NIII_HI} # # RecCorr_N2_5755 = self.empiric_formulae(data_dict, methodology = 'Liu2000', Ion = 'N2', Parameter = 'N2_RecombCorr') # # #Repeat the previous steps starting with the calculation of TNII # T_NII = self.temperature_determination(Ion = 'N2', methodology = 'Epm2014', RecCorr = RecCorr_N2_5755) # # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme(TempIn = T_NII) # self.nitrogen_IonAbundance(Temp = T_NII, Den = ne_SII, Ion = 'N2', methodology = 'Epm2014') # self.Properties_dict['NI_OI'] = self.Properties_dict['NII_HII'] / self.Properties_dict['OII_HII'] # self.Properties_dict['NI_HI'] = self.Properties_dict['NI_OI'] * self.Properties_dict['OI_HI'] # # def helium_abundance_scheme(self): # # #Determine the sulfur density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # # #In case we do not have the sulfur temperature we use the oxygen one # if T_SIII != None: # data_dict = {'Temp' : T_SIII} # T_OIII = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion = 'O3', Parameter = 'TOIII_approx_TSIII') # # else: # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #Calculate the HeII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He1', methodology = 'Vital2015') # # #Calculate the HeIII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He2', methodology = 'Vital2015') # # if self.Properties_dict['HeII_HII'] != None: # if self.Properties_dict['HeIII_HII'] != None: # self.Properties_dict['HeI_HI'] = self.Properties_dict['HeII_HII'] + self.Properties_dict['HeIII_HII'] # elif self.Properties_dict['HeIII_HII'] == None: # self.Properties_dict['HeI_HI'] = self.Properties_dict['HeII_HII'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI'] != None): # # #From Oxygen: # if self.Properties_dict['OI_HI'] != None: # self.Properties_dict['Y_Mass_O'] = (4 * self.Properties_dict['HeI_HI'] * (1 - 20 * self.Properties_dict['OI_HI'])) / (1 + 4 * self.Properties_dict['HeI_HI']) # # #From Sulfur # if self.Properties_dict['SI_HI'] != None: # self.Properties_dict['Y_Mass_S'] = (4 * self.Properties_dict['HeI_HI'] * (1 - 20 * self.OI_SI * self.Properties_dict['SI_HI_ArCorr'])) / (1 + 4 * self.Properties_dict['HeI_HI']) # # def heliumPyneb_abundance_scheme(self): # # #Determine the sulfur density and temperature # T_SII, T_SIII, ne_SII = self.sulfur_density_scheme() # # #In case we do not have the sulfur temperature we use the oxygen one # if T_SIII != None: # data_dict = {'Temp' : T_SIII} # T_OIII = self.empiric_formulae(data_dict, methodology = 'Epm2014', Ion = 'O3', Parameter = 'TOIII_approx_TSIII') # # else: # T_OIII, T_OII = self.oxygen_temperature_scheme() # # #Calculate the HeII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He1', methodology = 'PyNeb') # # #Calculate the HeIII ion abundance # self.helium_IonAbundance(Temp = T_OIII, Den = ne_SII , Ion = 'He2', methodology = 'PyNeb') # # return # # def store_dict_ObjLog(self, varaiables_dict, verbose = False): # # keys, values = varaiables_dict.keys(), varaiables_dict.values() # # for i in range(len(keys)): # if verbose: # print i, keys[i], values[i] # self.SaveParameter_ObjLog(self.CodeName, self.FileFolder, keys[i], values[i]) # # return # # class Parametrized_Emissivities(Txt_Files_Manager): # # def __init__(self): # # self.LiteratureParametrization = None # Txt_Files_Manager.__init__(self) # # def AOS2010(self, Te, ne): # # #phi has the shape : phi_lambda = Em(Hbeta) / E(He_lambda) * (1) / (1 + C/R(lambda)) # #Hence Em(He_lambda)/Em(H\beta) = 1 / phi_lambda # # Phi3889 = power(0.8779 * Te, -0.128 -0.00041 * ne ) # Phi4026 = power(4.233 * Te, 0.085 - 0.00012 * ne ) # Phi4471 = power(2.021 * Te, 0.121 - 0.00020 * ne ) # Phi5876 = power(0.754 * Te, 0.212 - 0.00051 * ne ) # Phi6678 = power(2.639 * Te, 0.244 - 0.00054 * ne ) # Phi7065 = power(5.903 * Te, -0.519) / (1.462 - Te * (0.127 - 0.00076 * ne * + 0.000000255 * ne*ne)) # # Em_He3889 = 1/Phi3889 # Em_He4026 = 1/Phi4026 # Em_He4471 = 1/Phi4471 # Em_He5876 = 1/Phi5876 # Em_He6678 = 1/Phi6678 # Em_He7065 = 1/Phi7065 # # return Em_He3889, Em_He4026, Em_He4471, Em_He4471, Em_He5876, Em_He5876, Em_He6678, Em_He7065 # # def Haegele2008_Fluxes(self): # #SDSS J1729 # Flux_dict = {} # # Flux_dict["H1_4861A"] = ufloat(10000, 83) # # Flux_dict["O2_3726A"] = ufloat(17622, 243) # Flux_dict["O2_3729A"] = ufloat(0.0, 0.0) # Flux_dict["O2_7319A"] = ufloat(233,8) # Flux_dict['O2_7330A'] = ufloat(194,9) # # Flux_dict["O3_4363A"] = ufloat(660, 30) # Flux_dict["O3_4959A"] = ufloat(17097, 146) # Flux_dict["O3_5007A"] = ufloat(51541, 418) # # Flux_dict["N2_5755A"] = ufloat(60, 6) # Flux_dict["N2_6548A"] = ufloat(771, 21) # Flux_dict["N2_6584A"] = ufloat(2189, 52) # # Flux_dict['Ar3_7136A'] = ufloat(864,41) # Flux_dict['Ar4_4740A'] = ufloat(40,0.06) # # Flux_dict["S2_6716A"] = ufloat(1286, 32) # Flux_dict["S2_6731A"] = ufloat(1009, 30) # Flux_dict["S2_4069A"] = ufloat(122, 11) # Flux_dict['S2_4076A'] = ufloat(0.0,0.0) # # Flux_dict["S3_6312A"] = ufloat(176, 11) # Flux_dict["S3_9069A"] = ufloat(2092, 95) # Flux_dict["S3_9531A"] = ufloat(4718, 250) # # Flux_dict["He1_4472A"] = ufloat(516, 24) # Flux_dict["He1_5876A"] = ufloat(1261, 37) # Flux_dict["He1_6678A"] = ufloat(355, 2) # Flux_dict['He2_4686A'] = ufloat(329,43) # # def Abundances_FabianSample(self): # # Table_Address = '/home/vital/Workspace/Dazer/Astro_Libraries/Fabian2006_CatalogueAbundances.txt' # # Headers_List = ['O/H_10^5_Flux', 'O/H_0^5_Error', 'N/H_10^6_Flux', 'N/H_10^6_Error', 'Y_magnitude', 'Y_error', 'y_magnitude', 'y_error'] # # Oxygen_Flux, Oxygen_Error, Nitrogen_Flux, Nitrogen_Error, Y, Yerror, y_magnitude, y_error = self.get_ColumnData(Headers_List, Table_Address, HeaderSize=1, unpack_check = True) # # return Oxygen_Flux * 1e-5, Oxygen_Error*1e-5, Nitrogen_Flux*1e-6, Nitrogen_Error*1e-6, Y, Yerror, y_magnitude, y_erro # def helium_abundance_scheme_fab(self): # # #Select the temperature and density for the procedure # if self.abunData['TOIII_approxfrom_TSIII'] is not None: # TOIII = self.abunData['TOIII_approxfrom_TSIII'] # else: # TOIII = self.abunData['TOIII'] # # if self.abunData['nSII'] is not None: # ne = self.abunData['nSII'] # else: # ne = self.abunData['nOII'] # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the He+1 abundance # if self.lines_dict.viewkeys() >= {'He1_4472A', 'He1_5876A', 'He1_6678A'}: # # y0_I4471 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_4472A'], tem=TOIII, den=ne, wave = 4471, Hbeta = self.Hbeta_flux) # y0_I5876 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_5876A'], tem=TOIII, den=ne, wave = 5876, Hbeta = self.Hbeta_flux) # y0_I6678 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_6678A'], tem=TOIII, den=ne, wave = 6678, Hbeta = self.Hbeta_flux) # # t4 = TOIII / 10000 # # D = 1.0 + 3110.0 * power(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * power(t4,0.02) * (exp(-4.544)) / D # g_I5876 = (7.12 * power(t4,0.14) * (exp(-3.776/t4)) + 1.47 * power(t4,-0.28) * (exp(-4.544/t4))) / D # g_I6678 = (3.27 * power(t4,-0.41) * (exp(-3.777/t4)) + 0.49 * power(t4,-0.52) * (exp(-4.544/t4))) / D # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # self.abunData['HeII_HII'] = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.abunData['HeIII_HII'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # #Calculate elemental abundance # if (self.abunData['HeII_HII'] is not None) and (self.abunData['HeIII_HII'] is not None): # self.abunData['HeI_HI'] = self.abunData['HeII_HII'] + self.abunData['HeIII_HII'] # elif (self.abunData['HeII_HII'] is not None): # self.abunData['HeI_HI'] = self.abunData['HeII_HII'] # # #Proceed to get the Helium mass fraction Y # if (self.abunData['HeI_HI'] is not None): # #From Oxygen: # if self.abunData['OI_HI'] is not None: # self.abunData['Y_Mass_O'] = (4 * self.abunData['HeI_HI'] * (1 - 20 * self.abunData['OI_HI'])) / (1 + 4 * self.abunData['HeI_HI']) # #From Sulfur # if self.abunData['SI_HI'] is not None: # self.abunData['Y_Mass_S'] = (4 * self.abunData['HeI_HI'] * (1 - 20 * self.OI_SI * self.abunData['SI_HI'])) / (1 + 4 * self.abunData['HeI_HI']) # # return # class Chemical_Analysis_pyneb_old(): # # def __init__(self): # # self.MC_array_len = 100 # # self.Hbeta_label = 'H1_4861A' # # def load_elements(self): # # #Set atomic data # atomicData.setDataFile('he_i_rec_Pal12-Pal13.fits') # atomicData.setDataFile('s_iii_coll_HRS12.dat') # # #Declare hydrogen atom so it becomes readily available: # self.S2_atom = Atom('S', 2) # self.S3_atom = Atom('S', 3) # self.Ar3_atom = Atom('Ar', 3) # self.Ar4_atom = Atom('Ar', 4) # self.N2_atom = Atom('N', 2) # self.O2_atom = Atom('O', 2) # self.O3_atom = Atom('O', 3) # # self.H1_atom = RecAtom('H', 1) # self.He1_atom = RecAtom('He', 1) # self.He2_atom = RecAtom('He', 2) # # self.diags = Diagnostics() # # self.logSI_OI_Gradient = random.normal(-1.53, 0.05, size = self.MC_array_len) # random.normal(-1.78, 0.03, size = self.MC_array_len) # # self.OI_SI = power(10, -self.logSI_OI_Gradient) # # self.S3_9000_ratio = random.normal(self.S3_atom.getEmissivity(10000, 1000, wave = 9531) / self.S3_atom.getEmissivity(10000, 1000, wave = 9069), 0.01, size = self.MC_array_len) # # self.m_SIV_correction = random.normal(1.109, 0.1109, size = self.MC_array_len) # self.n_SIV_correction = random.normal(0.135, 0.013, size = self.MC_array_len) # # return # # def DeclareObject(self, lines_log_frame): # # #List of all parameters # EmLine_List = ['R_SII_pn', 'R_SIIprime_pn', 'R_SIII_pn', 'R_NII_pn', 'R_OII_pn', 'R_OIII_pn'] # Den_List = ['nSII_pn', 'nOII_pn'] # Temp_List = ['TOIII_pn', 'TOII_pn', 'TSII_pn', 'TSIII_pn','TNII_pn', 'TOII_approxfrom_TOIII_pn', 'TSIII_approxfrom_TOIII_pn', 'TOIII_approxfrom_TSIII_pn', 'TNII_approxfrom_TOIII_pn'] # IonicAbund_List = ['SII_HII_pn', 'SIII_HII_pn', 'SIV_HII_pn', 'OII_HII_pn', 'OII_HII_3279A_pn', 'OII_HII_7319A_pn', 'NII_HII_pn', 'HeII_HII_from_O_pn', 'HeIII_HII_from_O_pn', 'HeII_HII_from_S_pn', 'HeIII_HII_from_S_pn' ,'ArIII_HII_pn', 'ArIV_HII_pn'] # Element_List = ['SI_HI_pn', 'OI_HI_pn', 'NI_OI_pn', 'NI_HI_pn', 'HeI_HI_from_O_pn', 'HeI_HI_from_S_pn', 'Y_Mass_O_pn', 'Y_Mass_S_pn'] # # self.Properties_dict = OrderedDict.fromkeys(Element_List + IonicAbund_List + Den_List + Temp_List + EmLine_List) # # self.Hbeta_flux = random.normal(lines_log_frame.loc['H1_4861A']['line_Int'].nominal_value, lines_log_frame.loc['H1_4861A']['line_Int'].std_dev, size = self.MC_array_len) # # self.low_density_dist = self.Truncated_gaussian.rvs(self.MC_array_len) # # #Generate a dictionary to store the random array for all lines # self.lines_dict = OrderedDict() # # #Generate # for line in lines_log_frame.index.values: # if line == 'O2_3726A': # if lines_log_frame.loc['O2_3726A']['flux_intg'] == lines_log_frame.loc['O2_3726A']['flux_intg']: # flux, error = lines_log_frame.loc[line]['line_IntBrute_dered'].nominal_value, lines_log_frame.loc[line]['line_IntBrute_dered'].std_dev # # elif line == 'O2_7319A': # if lines_log_frame.loc['O2_7319A']['flux_intg'] == lines_log_frame.loc['O2_7330A']['flux_intg']: # flux, error = lines_log_frame.loc[line]['line_IntBrute_dered'].nominal_value, lines_log_frame.loc[line]['line_IntBrute_dered'].std_dev # else: # line_sum = lines_log_frame.loc['O2_7319A']['line_IntBrute_dered'] + lines_log_frame.loc['O2_7330A']['line_IntBrute_dered'] # flux, error = line_sum.nominal_value, line_sum.std_dev # # else: # flux, error = lines_log_frame.loc[line]['line_Int'].nominal_value, lines_log_frame.loc[line]['line_Int'].std_dev # # # self.lines_dict[line] = random.normal(flux, error, size = self.MC_array_len) # # self.lines_dict[line] = random.normal(flux, error, size = self.MC_array_len) # # return # # def low_density_function(self, density_array): # # inds_nan = where(isnan(density_array)) # # if len(inds_nan[0]) > 0: # # if len(inds_nan[0]) > (0.1 * self.MC_array_len): # print '--WARNING 10% boundary: ', len(inds_nan[0]), 'values with nan' # elif len(inds_nan[0]) > (0.05 * self.MC_array_len): # print '--WARNING 5% boundary: ', len(inds_nan[0]), 'values with nan' # # density_array[inds_nan]= self.low_density_dist[inds_nan] # # mean_density = mean(density_array) # std_density = std(density_array) # # if isnan(mean_density): # print '--WARNING: Density array cannot be treated numerically' # # if mean_density < 75: # #print '--WARNING: Low density', mean_density, '+/-', std_density, 'Points below limit', len(where(density_array < 75)[0]) # return self.low_density_dist # else: # return density_array # # def determine_electron_parameters(self): # # #-------Starting with the Sulfur # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # # #Check TSIII lines # if self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_9531A', 'S3_6312A'}: # # self.Properties_dict['TSIII_pn'], self.Properties_dict['nSII_pn'] = self.diags.getCrossTemDen(diag_tem = '[SIII] 6312/9200+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Missing S3_9531A line # elif self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_6312A'}: # # self.Properties_dict['TSIII_pn'], self.Properties_dict['nSII_pn'] = self.diags.getCrossTemDen(diag_tem = '[SIII] 6312/9200+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio)), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Missing S3_9069A line # elif self.lines_dict.viewkeys() >= {'S3_9531A', 'S3_6312A'}: # self.Properties_dict['TSIII_pn'], self.Properties_dict['nSII_pn'] = self.diags.getCrossTemDen(diag_tem = '[SIII] 6312/9200+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9531A'] * (1 + 1/self.S3_9000_ratio)), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Missing the sulfur lines we use the ones from oxygen # elif self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A', 'O3_4363A'}: # # self.Properties_dict['TOIII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[OIII] 4363/5007+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # self.Properties_dict['TSIII_approxfrom_TOIII_pn'] = ((self.Properties_dict['TOIII_pn']/10000 + 0.0846) / 1.0807) * 10000 # self.Properties_dict['nSII_pn'] = self.S2_atom.getTemDen((self.lines_dict['S2_6731A'])/(self.lines_dict['S2_6716A']), tem = self.Properties_dict['TSIII_approxfrom_TOIII_pn'], to_eval = 'L(6731) / L(6716)') # # # #Try to measure the TSII temperature # if self.lines_dict.viewkeys() >= {'S2_4069A', 'S2_4076A'}: # # self.Properties_dict['TSII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[SII] 4069/4076', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['S2_4069A']/self.lines_dict['S2_4076A'], # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #-------Following with the oxygen # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # # #Missing the sulfur lines we use the ones from oxygen # if self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A', 'O3_4363A'}: # self.Properties_dict['TOIII_pn'], nSII_x = self.diags.getCrossTemDen(diag_tem = '[OIII] 4363/5007+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # #Determine the TOIII from the sulfur temperature as a proxy # if self.Properties_dict['TSIII_pn'] is not None: # # self.Properties_dict['TOIII_approxfrom_TSIII_pn'] = (1.0807 * self.Properties_dict['TSIII_pn']/10000 - 0.0846) * 10000 # # #Determine the TOII value from the TOIII proxy # if self.Properties_dict['TOIII_pn'] is not None: # self.Properties_dict['TOII_approxfrom_TOIII_pn'] = (1.397 /( (1/(self.Properties_dict['TOIII_pn']/10000)) + 0.385) ) * 10000 # # # #Calculate the oxygen density if the 3721A+ lines can be measured # # if self.lines_dict.viewkeys() >= {'O2_3726A', 'O2_3729A', 'O2_7319A', 'O2_7330A', 'O3_4959A', 'O3_5007A', 'O3_4363A'}: # # # # self.Properties_dict['TOIII_pn'], self.Properties_dict['nOII_pn'] = self.diags.getCrossTemDen(diag_tem = '[OIII] 4363/5007+', # # diag_den = '[OII] 3726/3729', # # value_tem = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']), # # value_den = (self.lines_dict['O2_3726A']/self.lines_dict['O2_3729A'])) # # #Calculate the oxygen temperature cannot be measure use the SIII approximation # elif self.lines_dict.viewkeys() >= {'O2_3726A', 'O2_3729A', 'O2_7319A', 'O2_7330A'}: # if self.Properties_dict['TOIII_approxfrom_TSIII_pn'] is not None: # self.Properties_dict['nOII_pn'] = self.O2_atom.getTemDen((self.lines_dict['O2_3726A']/self.lines_dict['O2_3729A']), # tem = self.Properties_dict['TOIII_approxfrom_TSIII_pn'], # to_eval = '(L(3726))/(L(3729))') # # #-------Following with the Nitrogen # if self.lines_dict.viewkeys() >= {'N2_5755A', 'N2_6548A', 'N2_6584A'}: # # self.Properties_dict['TNII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[NII] 5755/6584+', # diag_den = '[SII] 6731/6716', # value_tem = self.lines_dict['N2_5755A']/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # if self.Properties_dict['TOIII_pn'] is not None: # self.Properties_dict['TNII_approxfrom_TOIII_pn'] = (1.452 /( (1/(self.Properties_dict['TOIII_pn']/10000)) + 0.479)) * 10000 # # return # # def argon_abundance_scheme(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TSIII_pn'] is not None: # TSIII = self.Properties_dict['TSIII_pn'] # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # # else: # TSIII = self.Properties_dict['TSIII_approxfrom_TOIII_pn'] # TOIII = self.Properties_dict['TOIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the Ar_+2 abundance # if (TSIII is not None): # if self.lines_dict.viewkeys() >= {'Ar3_7136A', 'Ar3_7751'}: # Ratio = self.lines_dict['Ar3_7751A'] + self.lines_dict['Ar3_7136A'] # self.Properties_dict['ArIII_HII_pn'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, to_eval = 'L(7751) + L(7136)', Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar3_7136A'}: # Ratio = self.lines_dict['Ar3_7136A'] # self.Properties_dict['ArIII_HII_pn'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, wave = 7136, Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar3_7751A'}: # Ratio = self.lines_dict['Ar3_7751A'] # self.Properties_dict['ArIII_HII_pn'] = self.Ar3_atom.getIonAbundance(int_ratio = Ratio, tem=TSIII, den=ne, wave = 7751, Hbeta = self.Hbeta_flux) # # #Calculate the Ar_+3 abundance # if (TOIII is not None): # if self.lines_dict.viewkeys() >= {'Ar4_4740A', 'Ar4_4711A'}: # Ratio = self.lines_dict['Ar4_4740A'] + self.lines_dict['Ar4_4711A'] # self.Properties_dict['ArIV_HII_pn'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, to_eval = 'L(4740) + L(4711)', Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar4_4740A'}: # Ratio = self.lines_dict['Ar4_4740A'] # self.Properties_dict['ArIV_HII_pn'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, wave = 4740, Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'Ar4_4711A'}: # Ratio = self.lines_dict['Ar4_4711A'] # self.Properties_dict['ArIV_HII_pn'] = self.Ar4_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, wave = 4711, Hbeta = self.Hbeta_flux) # # def sulfur_abundance_scheme(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TSIII_pn'] is not None: # Te = self.Properties_dict['TSIII_pn'] # else: # Te = self.Properties_dict['TSIII_approxfrom_TOIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # #Calculating the R_S2 ratio # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # self.Properties_dict['R_SII_pn'] = self.lines_dict['S2_6716A'] + self.lines_dict['S2_6731A'] # # #Calculating the R_S3 ratio # if self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_9531A'}: # self.Properties_dict['R_SIII_pn'] = self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A'] # # elif self.lines_dict.viewkeys() >= {'S3_9069A'}: # self.Properties_dict['R_SIII_pn'] = self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio) # # elif self.lines_dict.viewkeys() >= {'S3_9531A'}: # self.Properties_dict['R_SIII_pn'] = self.lines_dict['S3_9531A'] * (1 + 1/self.S3_9000_ratio) # # #Determine ionic abundances # if (Te is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the S+1 abundance # if self.Properties_dict['R_SIII_pn'] is not None: # self.Properties_dict['SII_HII_pn'] = self.S2_atom.getIonAbundance(int_ratio=self.Properties_dict['R_SII_pn'], tem=Te, den=ne, to_eval = 'L(6731)+L(6716)', Hbeta = self.Hbeta_flux) # # #Calculate the S_+2 abundance # if self.Properties_dict['R_SIII_pn'] is not None: # self.Properties_dict['SIII_HII_pn'] = self.S3_atom.getIonAbundance(int_ratio=self.Properties_dict['R_SIII_pn'], tem=Te, den=ne, to_eval = 'L(9069)+L(9531)', Hbeta = self.Hbeta_flux) # # #Calculating the S_+3 abundance # if (self.Properties_dict['SII_HII_pn'] is not None) and (self.Properties_dict['SIII_HII_pn'] is not None): # # #Apply correction from Ar - Sulfur from Popstar - Cloudy models if Argon metallicity previously measured # if (self.Properties_dict['ArIII_HII_pn'] is not None) and (self.Properties_dict['ArIV_HII_pn'] is not None): # logAr2Ar3 = log10(self.Properties_dict['ArIII_HII_pn']/self.Properties_dict['ArIV_HII_pn']) # logSIV = log10(self.Properties_dict['SIII_HII_pn']) - (logAr2Ar3 - self.n_SIV_correction) / self.m_SIV_correction # self.Properties_dict['SIV_HII_pn'] = power(10, logSIV) # # else: # self.Properties_dict['SIV_HII_pn'] = zeros(self.MC_array_len) # # #Determine elemental abundance # if (self.Properties_dict['SII_HII_pn'] is not None) and (self.Properties_dict['SIII_HII_pn'] is not None) and (self.Properties_dict['SIV_HII_pn'] is not None): # self.Properties_dict['SI_HI_pn'] = self.Properties_dict['SII_HII_pn'] + self.Properties_dict['SIII_HII_pn'] + self.Properties_dict['SIV_HII_pn'] # # if (self.Properties_dict['SII_HII_pn'] is not None) and (self.Properties_dict['SIII_HII_pn'] is not None): # self.Properties_dict['SI_HI_pn'] = self.Properties_dict['SII_HII_pn'] + self.Properties_dict['SIII_HII_pn'] # # return # # def oxygen_abundance_scheme(self): # # #Select the temperature and density for the procedure49 # if self.Properties_dict['TOIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_pn'] # TOII = self.Properties_dict['TOII_approxfrom_TOIII_pn'] # else: # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # TOII = self.Properties_dict['TSIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the O+1 ion abundance (If O2_3726A, O2_3729A are available we prioritize them) # if TOII is not None: # # if self.lines_dict.viewkeys() >= {'O2_3726A'}: #WE ASSUME THEY ARE BLENDED # Ratio = self.lines_dict['O2_3726A'] # self.Properties_dict['OII_HII_3279A_pn'] = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(3726)+L(3729)', Hbeta = self.Hbeta_flux) # elif self.lines_dict.viewkeys() >= {'O2_3726A'}: # Ratio = self.lines_dict['O2_3726A'] # self.Properties_dict['OII_HII_3279A_pn'] = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(3726)+L(3729)', Hbeta = self.Hbeta_flux) # # if self.lines_dict.viewkeys() >= {'O2_7319A'}: # #Initial value # Ratio = self.lines_dict['O2_7319A'] #WE ASSUME THEY ARE BLENDED # OII_HII_pn_7319_initial = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(7319)+L(7330)', Hbeta = self.Hbeta_flux) # #Correction for recombination contribution Liu2000 # Lines_Correction = (9.36 * power((TOII/10000), 0.44) * OII_HII_pn_7319_initial) * self.Hbeta_flux # Ratio = self.lines_dict['O2_7319A'] - Lines_Correction # self.Properties_dict['OII_HII_7319A_pn'] = self.O2_atom.getIonAbundance(int_ratio = Ratio, tem=TOII, den=ne, to_eval = 'L(7319)+L(7330)', Hbeta = self.Hbeta_flux) # # #Calculate the O+2 ion abundance # if (TOIII is not None): # if self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A'}: # Ratio = self.lines_dict['O3_4959A'] + self.lines_dict['O3_5007A'] # self.Properties_dict['OIII_HII_pn'] = self.O3_atom.getIonAbundance(int_ratio = Ratio, tem=TOIII, den=ne, to_eval = 'L(4959)+L(5007)', Hbeta = self.Hbeta_flux) # # #Determine the O/H abundance # if (self.Properties_dict['OII_HII_3279A_pn'] is not None) and (self.Properties_dict['OIII_HII_pn'] is not None): # self.Properties_dict['OI_HI_pn'] = self.Properties_dict['OII_HII_3279A_pn'] + self.Properties_dict['OIII_HII_pn'] # self.Properties_dict['OII_HII_pn'] = self.Properties_dict['OII_HII_3279A_pn'] # elif (self.Properties_dict['OII_HII_7319A_pn'] is not None) and (self.Properties_dict['OIII_HII_pn'] is not None): # self.Properties_dict['OI_HI_pn'] = self.Properties_dict['OII_HII_7319A_pn'] + self.Properties_dict['OIII_HII_pn'] # self.Properties_dict['OII_HII_pn'] = self.Properties_dict['OII_HII_7319A_pn'] # # return # # def nitrogen_abundance_scheme(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TSIII_pn'] is not None: # Te = self.Properties_dict['TSIII_pn'] #YOU CAN TEST THIS WITH OBJECT 51959-092 # else: # Te = self.Properties_dict['TNII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the N+1 ion abundance (If O2_3726A, O2_3729A are available we prioritize them) # if Te is not None: # # if self.lines_dict.viewkeys() >= {'N2_6548A', 'N2_6584A'}: # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.Properties_dict['NII_HII_pn'] = self.N2_atom.getIonAbundance(int_ratio = Ratio, tem=Te, den=ne, to_eval = 'L(6548)+L(6584)', Hbeta = self.Hbeta_flux) # # # #Calculate the elemental abundance # if (self.Properties_dict['OI_HI_pn'] is not None) and (self.Properties_dict['NII_HII_pn'] is not None): # # #Standard method # self.Properties_dict['NI_OI_pn'] = self.Properties_dict['NII_HII_pn'] / self.Properties_dict['OII_HII_pn'] # NI_HI_initial = self.Properties_dict['NI_OI_pn'] * self.Properties_dict['OI_HI_pn'] # # #Repeat calculation if 5755 line was observed to include the recombination contribution # if self.lines_dict.viewkeys() >= {'N2_5755A'}: # # NIII_HI = NI_HI_initial - self.Properties_dict['NII_HII_pn'] # Lines_Correction = 3.19 * power((Te/10000), 0.30) * NIII_HI * self.Hbeta_flux # # self.Properties_dict['TNII_pn'], nSII = self.diags.getCrossTemDen(diag_tem = '[NII] 5755/6584+', # diag_den = '[SII] 6731/6716', # value_tem = (self.lines_dict['N2_5755A'] - Lines_Correction)/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.Properties_dict['NII_HII_pn'] = self.N2_atom.getIonAbundance(int_ratio = Ratio, tem=self.Properties_dict['TNII_pn'], den=ne, to_eval = 'L(6548)+L(6584)', Hbeta = self.Hbeta_flux) # self.Properties_dict['NI_OI_pn'] = self.Properties_dict['NII_HII_pn'] / self.Properties_dict['OII_HII_pn'] # self.Properties_dict['NI_HI_pn'] = self.Properties_dict['NI_OI_pn'] * self.Properties_dict['OI_HI_pn'] # # else: # self.Properties_dict['NI_HI_pn'] = NI_HI_initial # # return # # def helium_abundance_scheme_fab(self): # # #Select the temperature and density for the procedure # if self.Properties_dict['TOIII_approxfrom_TSIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # else: # TOIII = self.Properties_dict['TOIII_pn'] # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = self.Properties_dict['nOII_pn'] # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the He+1 abundance # if self.lines_dict.viewkeys() >= {'He1_4472A', 'He1_5876A', 'He1_6678A'}: # # y0_I4471 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_4472A'], tem=TOIII, den=ne, wave = 4471, Hbeta = self.Hbeta_flux) # y0_I5876 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_5876A'], tem=TOIII, den=ne, wave = 5876, Hbeta = self.Hbeta_flux) # y0_I6678 = self.He1_atom.getIonAbundance(int_ratio = self.lines_dict['He1_6678A'], tem=TOIII, den=ne, wave = 6678, Hbeta = self.Hbeta_flux) # # t4 = TOIII / 10000 # # D = 1.0 + 3110.0 * power(t4,-0.51) * (1.0/ne) # g_I4471 = 6.11 * power(t4,0.02) * (exp(-4.544)) / D # g_I5876 = (7.12 * power(t4,0.14) * (exp(-3.776/t4)) + 1.47 * power(t4,-0.28) * (exp(-4.544/t4))) / D # g_I6678 = (3.27 * power(t4,-0.41) * (exp(-3.777/t4)) + 0.49 * power(t4,-0.52) * (exp(-4.544/t4))) / D # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # self.Properties_dict['HeII_HII_pn'] = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.Properties_dict['HeIII_HII_pn'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # #Calculate elemental abundance # if (self.Properties_dict['HeII_HII_pn'] is not None) and (self.Properties_dict['HeIII_HII_pn'] is not None): # self.Properties_dict['HeI_HI_pn'] = self.Properties_dict['HeII_HII_pn'] + self.Properties_dict['HeIII_HII_pn'] # elif (self.Properties_dict['HeII_HII_pn'] is not None): # self.Properties_dict['HeI_HI_pn'] = self.Properties_dict['HeII_HII_pn'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI_pn'] is not None): # #From Oxygen: # if self.Properties_dict['OI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_O_pn'] = (4 * self.Properties_dict['HeI_HI_pn'] * (1 - 20 * self.Properties_dict['OI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_pn']) # #From Sulfur # if self.Properties_dict['SI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_S_pn'] = (4 * self.Properties_dict['HeI_HI_pn'] * (1 - 20 * self.OI_SI * self.Properties_dict['SI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_pn']) # # return # # def helium_abundance_scheme_Oxygen(self, lineslog_frame): # # #Select the temperature and density for the procedure # if self.Properties_dict['TOIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_pn'] # else: # TOIII = None # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = None # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # HeI_indices = (lineslog_frame.Ion.str.contains('HeI_')) & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') # HeI_labels = lineslog_frame.loc[HeI_indices].index.values # HeI_waves = lineslog_frame.loc[HeI_indices].TheoWavelength.values # # Flux_Hbeta = self.lines_dict['H1_4861A'] # Emis_Hbeta = self.H1_atom.getEmissivity(tem=TOIII, den=ne, label = '4_2', product = False) # # for i in range(len(HeI_labels)): # # print 'Esta es', HeI_labels[i] # print 'HeI_waves[i]', round(HeI_waves[i]) # # line_relative_Flux = self.lines_dict[HeI_labels[i]] / Flux_Hbeta # line_relative_emissivity = self.He1_atom.getEmissivity(tem = TOIII, den = ne, wave = round(HeI_waves[i]), product = False) / Emis_Hbeta # # if i == 0: # matrix_HeI_fluxes = copy(line_relative_Flux) # matrix_HeI_emis = copy(line_relative_emissivity) # # else: # matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) # matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) # # matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) # matrix_HeI_emis = transpose(matrix_HeI_emis) # # #Perform the fits # params = Parameters() # params.add('Y', value = 0.01) # HeII_HII_array = zeros(len(matrix_HeI_fluxes)) # HeII_HII_error = zeros(len(matrix_HeI_fluxes)) # # for i in range(len(matrix_HeI_fluxes)): # fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) # HeII_HII_array[i] = fit_Output.params['Y'].value # HeII_HII_error[i] = fit_Output.params['Y'].stderr # # #NO SUMANDO LOS ERRORES CORRECTOS? # # self.Properties_dict['HeII_HII_from_O_pn'] = unumpy.uarray(HeII_HII_array, mean(HeII_HII_error)) # # self.Properties_dict['HeII_HII_from_O_pn'] = HeII_HII_array # self.Properties_dict['HeII_HII_from_O_pn'] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) # # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.Properties_dict['HeIII_HII_from_O_pn'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # # #Calculate elemental abundance # if (self.Properties_dict['HeII_HII_from_O_pn'] is not None) and (self.Properties_dict['HeIII_HII_from_O_pn'] is not None): # self.Properties_dict['HeI_HI_from_O_pn'] = self.Properties_dict['HeII_HII_from_O_pn'] + self.Properties_dict['HeIII_HII_from_O_pn'] # elif (self.Properties_dict['HeII_HII_from_O_pn'] is not None): # self.Properties_dict['HeI_HI_from_O_pn'] = self.Properties_dict['HeII_HII_from_O_pn'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI_from_O_pn'] is not None): # #From Oxygen: # if self.Properties_dict['OI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_O_pn'] = (4 * self.Properties_dict['HeI_HI_from_O_pn'] * (1 - 20 * self.Properties_dict['OI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_from_O_pn']) # # return # # def helium_abundance_scheme_Sulfur(self, lineslog_frame): # # #Select the temperature and density for the procedure # if self.Properties_dict['TOIII_approxfrom_TSIII_pn'] is not None: # TOIII = self.Properties_dict['TOIII_approxfrom_TSIII_pn'] # else: # TOIII = None # # if self.Properties_dict['nSII_pn'] is not None: # ne = self.Properties_dict['nSII_pn'] # else: # ne = None # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # HeI_indices = lineslog_frame.Ion.str.contains('HeI_') & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') # HeI_labels = lineslog_frame.loc[HeI_indices].index.values # HeI_waves = lineslog_frame.loc[HeI_indices].TheoWavelength.values # # Flux_Hbeta = self.lines_dict['H1_4861A'] # Emis_Hbeta = self.H1_atom.getEmissivity(tem=TOIII, den=ne, label = '4_2', product = False) # # for i in range(len(HeI_labels)): # # line_relative_Flux = self.lines_dict[HeI_labels[i]] / Flux_Hbeta # line_relative_emissivity = self.He1_atom.getEmissivity(tem = TOIII, den = ne, wave = round(HeI_waves[i]), product = False) / Emis_Hbeta # # if i == 0: # matrix_HeI_fluxes = copy(line_relative_Flux) # matrix_HeI_emis = copy(line_relative_emissivity) # # else: # matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) # matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) # # matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) # matrix_HeI_emis = transpose(matrix_HeI_emis) # # #Perform the fits # params = Parameters() # params.add('Y', value = 0.01) # HeII_HII_array = zeros(len(matrix_HeI_fluxes)) # HeII_HII_error = zeros(len(matrix_HeI_fluxes)) # # for i in range(len(matrix_HeI_fluxes)): # fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) # HeII_HII_array[i] = fit_Output.params['Y'].value # HeII_HII_error[i] = fit_Output.params['Y'].stderr # # #NO SUMANDO LOS ERRORES CORRECTOS? # # self.Properties_dict['HeII_HII_from_S_pn'] = unumpy.uarray(HeII_HII_array, mean(HeII_HII_error)) # # self.Properties_dict['HeII_HII_from_S_pn'] = HeII_HII_array # self.Properties_dict['HeII_HII_from_S_pn'] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.Properties_dict['HeIII_HII_from_S_pn'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # # #Calculate elemental abundance # if (self.Properties_dict['HeII_HII_from_S_pn'] is not None) and (self.Properties_dict['HeIII_HII_from_S_pn'] is not None): # self.Properties_dict['HeI_HI_from_S_pn'] = self.Properties_dict['HeII_HII_from_S_pn'] + self.Properties_dict['HeIII_HII_from_S_pn'] # elif (self.Properties_dict['HeII_HII_from_S_pn'] is not None): # self.Properties_dict['HeI_HI_from_S_pn'] = self.Properties_dict['HeII_HII_from_S_pn'] # # #Proceed to get the Helium mass fraction Y # if (self.Properties_dict['HeI_HI_from_S_pn'] is not None): # #From Oxygen: # if self.Properties_dict['SI_HI_pn'] is not None: # self.Properties_dict['Y_Mass_S_pn'] = (4 * self.Properties_dict['HeI_HI_from_S_pn'] * (1 - 20 * self.OI_SI * self.Properties_dict['SI_HI_pn'])) / (1 + 4 * self.Properties_dict['HeI_HI_from_S_pn']) # # return # # def store_dict_ObjLog(self, FileFolder, CodeName, verbose = False): # # keys, values = self.Properties_dict.keys(), self.Properties_dict.values() # # for i in range(len(keys)): # if values[i] is not None: # #This removes the nan elements from the treatment values[i][~isnan(values[i])] # Median_Value = median(values[i][~isnan(values[i])]) # error = std(values[i][~isnan(values[i])]) # self.SaveParameter_ObjLog(CodeName, FileFolder, keys[i], ufloat(Median_Value, error)) # # if verbose == True: # print i, keys[i], Median_Value, error # # else: # self.SaveParameter_ObjLog(CodeName, FileFolder, keys[i], values[i]) # if verbose == True: # print i, keys[i], values[i] # return # # def SaveParameter_ObjLog(self, CodeName, FileFolder, Parameter, Magnitude, Error = None, Assumption = None, Log_extension = None): # # if Log_extension == None: # Log_extension = self.ObjectLog_extension # ObjLog_Address = FileFolder + CodeName + Log_extension # ObjLog_Parameters, ObjLog_Magnitudes, ObjLog_Errors, ObjLog_Comments = loadtxt(ObjLog_Address, dtype=str, usecols = [0,1,2,3], unpack = True) # # else: # ObjLog_Address = FileFolder + CodeName # ObjLog_Parameters, ObjLog_Magnitudes, ObjLog_Errors, ObjLog_Comments = loadtxt(ObjLog_Address, dtype=str, usecols = [0,1,2,3], unpack = True) # # #Saving the new value for the given parameter # Parameter_Index = where(ObjLog_Parameters == Parameter)[0][0] # # #Save the error in the case of a nparray # if isinstance(Magnitude, UFloat) and (Error == None): # ObjLog_Magnitudes[Parameter_Index] = Magnitude.nominal_value # ObjLog_Errors[Parameter_Index] = Magnitude.std_dev # elif Error != None: # ObjLog_Magnitudes[Parameter_Index] = str(Magnitude) # ObjLog_Errors[Parameter_Index] = str(Error) # elif Magnitude != None: # ObjLog_Magnitudes[Parameter_Index] = str(Magnitude) # elif Magnitude == None: # ObjLog_Magnitudes[Parameter_Index] = 'None' # ObjLog_Errors[Parameter_Index] = '-' # # #Saving the text file # savetxt(ObjLog_Address, transpose((ObjLog_Parameters, ObjLog_Magnitudes, ObjLog_Errors, ObjLog_Comments)), fmt='%s') # # return # def determine_electron_parameters_old(self): # # #-------Starting with the Sulfur # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # # self.abunData['R_SII'] = self.lines_dict['S2_6716A']/self.lines_dict['S2_6731A'] # # #Check TSIII lines # if self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_9531A', 'S3_6312A'}: # # if self.low_density_obj: # temp_diag = 'L(6312)/(L(9069)+L(9531))' # temp_ratio = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A']) # Te = self.S3_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # ne = self.den_dist # else: # den_diag = '[SII] 6731/6716' # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # temp_diag = '[SIII] 6312/9200+' # temp_ratio = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] + self.lines_dict['S3_9531A']) # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # self.abunData['TeSIII'], self.abunData['neSII'] = Te, ne # # #Missing S3_9531A line # elif self.lines_dict.viewkeys() >= {'S3_9069A', 'S3_6312A'}: # # if self.low_density_obj: # temp_diag = 'L(6312)/(L(9069)+L(9531))' # temp_ratio = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio)) # Te = self.S3_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # ne = self.den_dist # else: # den_diag = '[SII] 6731/6716' # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # temp_diag = '[SIII] 6312/9200+' # temp_ratio = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio)) # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # self.abunData['TeSIII'], self.abunData['neSII'] = Te, ne # # #Missing S3_9069A line # elif self.lines_dict.viewkeys() >= {'S3_9531A', 'S3_6312A'}: # # if self.low_density_obj: # temp_diag = 'L(6312)/(L(9069)+L(9531))' # temp_ratio = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9069A'] * (1 + self.S3_9000_ratio)) # Te = self.S3_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # ne = self.den_dist # # else: # den_diag = '[SII] 6731/6716' # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # temp_diag = '[SIII] 6312/9200+' # temp_ratio = self.lines_dict['S3_6312A']/(self.lines_dict['S3_9531A'] * (1 + 1/self.S3_9000_ratio)) # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # self.abunData['TeSIII'], self.abunData['neSII'] = Te, ne # # #Missing the sulfur lines we use the ones from oxygen # elif self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A', 'O3_4363A'}: # # if self.low_density_obj: # temp_diag = 'L(4363)/(L(5007)+L(4959))' # temp_ratio = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']) # Te = self.O3_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # ne = self.den_dist # # else: # den_diag = '[SII] 6731/6716' # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # temp_diag = '[OIII] 4363/5007+' # temp_ratio = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']) # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # self.abunData['TeSIII_from_TeOIII'] = ((Te/10000 + 0.0846) / 1.0807) * 10000 # self.abunData['neSII'] = ne # # # #Try to measure the TSII temperature # # if self.lines_dict.viewkeys() >= {'S2_4069A', 'S2_4076A'}: # # # # if self.low_density_obj: # # temp_diag = 'L(4069)/L(4076)' # # temp_ratio = self.lines_dict['S2_4069A']/self.lines_dict['S2_4076A'] # # Te = self.S2_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # # ne = self.den_dist # # # # else: # # den_diag = '[SII] 6731/6716' # # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # # temp_diag = '[SII] 4069/4076' # # temp_ratio = self.lines_dict['S2_4069A']/self.lines_dict['S2_4076A'] # # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # # # self.abunData['TeSII'] = Te # # #-------Following with the oxygen # if self.lines_dict.viewkeys() >= {'S2_6716A', 'S2_6731A'}: # # #Missing the sulfur lines we use the ones from oxygen # if self.lines_dict.viewkeys() >= {'O3_4959A', 'O3_5007A', 'O3_4363A'}: # # if self.low_density_obj: # # temp_diag = 'L(4363)/(L(5007)+L(4959))' # temp_ratio = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']) # Te = self.O3_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # ne = self.den_dist # else: # den_diag = '[SII] 6731/6716' # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # temp_diag = '[OIII] 4363/5007+' # temp_ratio = self.lines_dict['O3_4363A']/(self.lines_dict['O3_5007A'] + self.lines_dict['O3_4959A']) # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # self.abunData['TeOIII'] = Te # self.abunData['TeSIII_from_TeOIII'] = ((Te/10000 + 0.0846) / 1.0807) * 10000 # # # #Determine the TOIII from the sulfur temperature as a proxy # if 'TeSIII' in self.abunData: # self.abunData['TeOIII_from_TeSIII'] = (1.0807 * self.abunData.TeSIII/10000 - 0.0846) * 10000 # # #Determine the TOII value from the TOIII proxy # if 'TeOIII' in self.abunData: # self.abunData['TeOII_from_TeOIII'] = (1.397 /( (1/(self.abunData.TeOIII/10000)) + 0.385) ) * 10000 # # #Calculate the oxygen temperature cannot be measure use the SIII approximation # elif self.lines_dict.viewkeys() >= {'O2_3726A', 'O2_3729A'}: # if ('TeOII_from_TeOIII' in self.abunData): # den_diag = '(L(3726))/(L(3729))' # den_ratio = self.lines_dict['O2_3726A'] / self.lines_dict['O2_3729A'] # self.abunData['neOII'] = self.O2_atom.getTemDen(den_ratio, tem = self.abunData['TeOII_from_TeOIII'], to_eval = den_diag) # # #-------Following with the Nitrogen # if self.lines_dict.viewkeys() >= {'N2_5755A', 'N2_6548A', 'N2_6584A'}: # # if self.low_density_obj: # temp_diag = '(L(6584) + L(6548)) / L(5755)' # temp_ratio = self.lines_dict['N2_5755A']/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']) # Te = self.N2_atom.getTemDen(temp_ratio, den = self.den_dist, to_eval = temp_diag) # # else: # den_diag = '[SII] 6731/6716' # den_ratio = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A'] # temp_diag = '[NII] 5755/6584+' # temp_ratio = self.lines_dict['N2_5755A']/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']) # Te, ne = self.diags.getCrossTemDen(diag_tem = temp_diag, diag_den = den_diag, value_tem = temp_ratio, value_den = den_ratio) # # self.abunData['TNII']= Te # # if 'TeOIII' in self.abunData: # self.abunData['TeNII_from_TeOIII'] = (1.452 /( (1/(self.abunData.TeOIII/10000)) + 0.479)) * 10000 # # #Avoid nan values # for variable in ['TeOII', 'TeSII', 'TeNII', 'TeOIII', 'TeSIII', 'TeOII_from_TeOIII', 'TeNII_from_TeOIII', 'TeSIII_from_TeOIII', 'TeOIII_from_TeSIII']: # if variable in self.abunData.index: # if isnan(self.abunData[variable]).any(): # print variable, isnan(self.abunData[variable]).sum() # mag, error = nanmean(self.abunData[variable]), nanstd(self.abunData[variable]) # print variable, mag, error # self.abunData[variable] = random.normal(mag, error, size = self.MC_array_len) # return # def nitrogen_abundance_scheme_old(self): # # #Physical parameters # Te, ne = None, None # # #Select the temperature # if 'TeOIII' in self.abunData: # Te = self.abunData.TeOIII # elif 'TeOIII_from_TeSIII' in self.abunData: # Te = self.abunData.TeOIII_from_TeSIII # # #Select the density # if 'neSII' in self.abunData: # ne = self.abunData.neSII # elif 'neOII' in self.abunData: # ne = self.abunData.neOII # # if ne is not None: # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # # #Calculate the N+1 ion abundance (If O2_3726A, O2_3729A are available we prioritize them) # if (Te is not None): # # if self.lines_dict.viewkeys() >= {'N2_6548A', 'N2_6584A'}: # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.abunData['NII_HII'] = self.N2_atom.getIonAbundance(int_ratio = Ratio, tem=Te, den=ne, to_eval = 'L(6548)+L(6584)', Hbeta = self.Hbeta_flux) # # # #Calculate the elemental abundance # if ('OI_HI' in self.abunData) and ('NII_HII' in self.abunData): # # #Standard method # self.abunData['NI_OI'] = self.abunData['NII_HII'] / self.abunData['OII_HII'] # NI_HI_initial = self.abunData['NI_OI'] * self.abunData['OI_HI'] # # #Repeat calculation if 5755 line was observed to include the recombination contribution # if self.lines_dict.viewkeys() >= {'N2_5755A'}: # # NIII_HI = NI_HI_initial - self.abunData['NII_HII'] # Lines_Correction = 3.19 * power((Te/10000), 0.30) * NIII_HI * self.Hbeta_flux # # self.abunData['TNII'], nSII = self.diags.getCrossTemDen(diag_tem = '[NII] 5755/6584+', # diag_den = '[SII] 6731/6716', # value_tem = (self.lines_dict['N2_5755A'] - Lines_Correction)/(self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A']), # value_den = self.lines_dict['S2_6731A']/self.lines_dict['S2_6716A']) # # Ratio = self.lines_dict['N2_6548A'] + self.lines_dict['N2_6584A'] # self.abunData['NII_HII'] = self.N2_atom.getIonAbundance(int_ratio = Ratio, tem=self.abunData['TNII'], den=ne, to_eval = 'L(6548)+L(6584)', Hbeta = self.Hbeta_flux) # self.abunData['NI_OI'] = self.abunData['NII_HII'] / self.abunData['OII_HII'] # self.abunData['NI_HI'] = self.abunData['NI_OI'] * self.abunData['OI_HI'] # # else: # self.abunData['NI_HI'] = NI_HI_initial # # return # def helium_abundance_scheme_Oxygen_old(self, lineslog_frame): # # #Physical parameters # TOIII, ne = None, None # # #Select the temperature # if 'TeOIII' in self.abunData: # TOIII = self.abunData.TeOIII # # #Select the density # if 'neSII' in self.abunData: # ne = self.abunData.neSII # # if (TOIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # TOIII = self.high_temp_function(TOIII) # # HeI_indices = (lineslog_frame.Ion.str.contains('HeI_')) & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') & (lineslog_frame.index != 'He1_5016A') # HeI_labels = lineslog_frame.loc[HeI_indices].index.values # HeI_ions = lineslog_frame.loc[HeI_indices].Ion.values # # Flux_Hbeta = self.lines_dict['H1_4861A'] # Emis_Hbeta = self.H1_atom.getEmissivity(tem=TOIII, den=ne, label = '4_2', product = False) # # for i in range(len(HeI_labels)): # # pyneb_code = float(HeI_ions[i][HeI_ions[i].find('_')+1:len(HeI_ions[i])]) # line_relative_Flux = self.lines_dict[HeI_labels[i]] / Flux_Hbeta # line_relative_emissivity = self.He1_atom.getEmissivity(tem = TOIII, den = ne, wave = pyneb_code, product = False) / Emis_Hbeta # # if isnan(line_relative_emissivity).any(): # print HeI_labels[i], isnan(line_relative_emissivity).sum() # mag, error = nanmean(line_relative_emissivity), nanstd(line_relative_emissivity) # line_relative_emissivity = random.normal(mag, error, size = self.MC_array_len) # # if i == 0: # matrix_HeI_fluxes = copy(line_relative_Flux) # matrix_HeI_emis = copy(line_relative_emissivity) # # else: # matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) # matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) # # # # # # # # # # print HeI_labels[i] # # print 'fluxes', line_relative_Flux # # print 'Emissivities', line_relative_emissivity # # print # # print # # matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) # matrix_HeI_emis = transpose(matrix_HeI_emis) # # #Perform the fits # params = Parameters() # params.add('Y', value = 0.01) # HeII_HII_array = zeros(len(matrix_HeI_fluxes)) # HeII_HII_error = zeros(len(matrix_HeI_fluxes)) # # for i in range(len(matrix_HeI_fluxes)): # fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) # HeII_HII_array[i] = fit_Output.params['Y'].value # HeII_HII_error[i] = fit_Output.params['Y'].stderr # # #NO SUMANDO LOS ERRORES CORRECTOS? # # self.abunData['HeII_HII_from_O'] = unumpy.uarray(HeII_HII_array, mean(HeII_HII_error)) # # self.abunData['HeII_HII_from_O'] = HeII_HII_array # self.abunData['HeII_HII_from_O'] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.abunData['HeIII_HII_from_O'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TOIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # #Calculate elemental abundance # if ('HeII_HII_from_O' in self.abunData) and ('HeIII_HII_from_O' in self.abunData): # self.abunData['HeI_HI_from_O'] = self.abunData['HeII_HII_from_O'] + self.abunData['HeIII_HII_from_O'] # elif ('HeII_HII_from_O' in self.abunData): # self.abunData['HeI_HI_from_O'] = self.abunData['HeII_HII_from_O'] # # #Proceed to get the Helium mass fraction Y # if ('HeI_HI_from_O' in self.abunData) and ('OI_HI' in self.abunData): # self.abunData['Ymass_O'] = (4 * self.abunData['HeI_HI_from_O'] * (1 - 20 * self.abunData['OI_HI'])) / (1 + 4 * self.abunData['HeI_HI_from_O']) # # return # # def helium_abundance_scheme_Sulfur_old(self, lineslog_frame): # # #Physical parameters # TSIII, ne = None, None # # #Select the temperature # if 'TeSIII' in self.abunData: # TSIII = self.abunData.TeSIII # # #Select the density # if 'neSII' in self.abunData: # ne = self.abunData.neSII # # if (TSIII is not None) and (ne is not None): # # #Security check for objects with density below 75 cm-3 # ne = self.low_density_function(ne) # TSIII = self.high_temp_function(TSIII) # # HeI_indices = lineslog_frame.Ion.str.contains('HeI_') & (lineslog_frame.index != 'He1_8446A') & (lineslog_frame.index != 'He1_7818A') & (lineslog_frame.index != 'He1_5016A') # HeI_labels = lineslog_frame.loc[HeI_indices].index.values # HeI_ions = lineslog_frame.loc[HeI_indices].Ion.values # # Flux_Hbeta = self.lines_dict['H1_4861A'] # Emis_Hbeta = self.H1_atom.getEmissivity(tem=TSIII, den=ne, label = '4_2', product = False) # # for i in range(len(HeI_labels)): # # pyneb_code = float(HeI_ions[i][HeI_ions[i].find('_')+1:len(HeI_ions[i])]) # line_relative_Flux = self.lines_dict[HeI_labels[i]] / Flux_Hbeta # line_relative_emissivity = self.He1_atom.getEmissivity(tem = TSIII, den = ne, wave = pyneb_code, product = False) / Emis_Hbeta # # if isnan(line_relative_emissivity).any(): # print HeI_labels[i], isnan(line_relative_emissivity).sum() # mag, error = nanmean(line_relative_emissivity), nanstd(line_relative_emissivity) # line_relative_emissivity = random.normal(mag, error, size = self.MC_array_len) # # if i == 0: # matrix_HeI_fluxes = copy(line_relative_Flux) # matrix_HeI_emis = copy(line_relative_emissivity) # # else: # matrix_HeI_fluxes = vstack((matrix_HeI_fluxes, line_relative_Flux)) # matrix_HeI_emis = vstack((matrix_HeI_emis, line_relative_emissivity)) # # matrix_HeI_fluxes = transpose(matrix_HeI_fluxes) # matrix_HeI_emis = transpose(matrix_HeI_emis) # # #Perform the fits # params = Parameters() # params.add('Y', value = 0.01) # HeII_HII_array = zeros(len(matrix_HeI_fluxes)) # HeII_HII_error = zeros(len(matrix_HeI_fluxes)) # # for i in range(len(matrix_HeI_fluxes)): # fit_Output = lmfit_minimmize(residual_Y_v3, params, args=(matrix_HeI_emis[i], matrix_HeI_fluxes[i])) # HeII_HII_array[i] = fit_Output.params['Y'].value # HeII_HII_error[i] = fit_Output.params['Y'].stderr # # #NO SUMANDO LOS ERRORES CORRECTOS? # # self.abunData['HeII_HII_from_S'] = unumpy.uarray(HeII_HII_array, mean(HeII_HII_error)) # # self.abunData['HeII_HII_from_S'] = HeII_HII_array # self.abunData['HeII_HII_from_S'] = random.normal(mean(HeII_HII_array), mean(HeII_HII_error), size = self.MC_array_len) # # #Calculate the He+2 abundance # if self.lines_dict.viewkeys() >= {'He2_4686A'}: # self.abunData['HeIII_HII_from_S'] = self.He2_atom.getIonAbundance(int_ratio = self.lines_dict['He2_4686A'], tem=TSIII, den=ne, wave = 4685.6, Hbeta = self.Hbeta_flux) # # #Calculate elemental abundance # if ('HeII_HII_from_S' in self.abunData) and ('HeIII_HII_from_S' in self.abunData): # self.abunData['HeI_HI_from_S'] = self.abunData['HeII_HII_from_S'] + self.abunData['HeIII_HII_from_S'] # # elif 'HeII_HII_from_S' in self.abunData: # self.abunData['HeI_HI_from_S'] = self.abunData['HeII_HII_from_S'] # # #Proceed to get the Helium mass fraction Y # if ('HeI_HI_from_S' in self.abunData) and ('SI_HI' in self.abunData): # self.abunData['Ymass_S'] = (4 * self.abunData['HeI_HI_from_S'] * (1 - 20 * self.OI_SI * self.abunData['SI_HI'])) / (1 + 4 * self.abunData['HeI_HI_from_S']) # # return # def check_nan_entries(self, input_array): nan_count = np_sum(isnan(input_array)) if nan_count > 0: mag, error = nanmean(input_array), nanstd(input_array) new_distr = random.normal(mag, error, size = self.MC_array_len) if nan_count > 0.1 *self.MC_array_len: print '--Helium issue with {} nans'.format(nan_count) else: new_distr = input_array return new_distr
58.722476
268
0.50931
29,892
270,417
4.329754
0.031346
0.070636
0.090817
0.008669
0.941379
0.927085
0.916979
0.906278
0.901178
0.892679
0
0.074334
0.372625
270,417
4,604
269
58.73523
0.688547
0.871014
0
0.222535
0
0.005634
0.100663
0.00597
0
0
0
0
0
0
null
null
0
0.025352
null
null
0.039437
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
bbefb7184cc15782af0948fba290860b5c66cbc6
1,502
py
Python
raiden_contracts/tests/fixtures/test_contracts.py
konradkonrad/raiden-contracts
5726f744e8d7e80f7ca61401bd3f1084de57e30c
[ "MIT" ]
null
null
null
raiden_contracts/tests/fixtures/test_contracts.py
konradkonrad/raiden-contracts
5726f744e8d7e80f7ca61401bd3f1084de57e30c
[ "MIT" ]
null
null
null
raiden_contracts/tests/fixtures/test_contracts.py
konradkonrad/raiden-contracts
5726f744e8d7e80f7ca61401bd3f1084de57e30c
[ "MIT" ]
null
null
null
import pytest from raiden_contracts.constants import ( TEST_SETTLE_TIMEOUT_MIN, TEST_SETTLE_TIMEOUT_MAX, ) @pytest.fixture() def token_network_test_storage( deploy_tester_contract, web3, custom_token, secret_registry_contract, ): return deploy_tester_contract( 'TokenNetworkInternalStorageTest', {}, [ custom_token.address, secret_registry_contract.address, int(web3.version.network), TEST_SETTLE_TIMEOUT_MIN, TEST_SETTLE_TIMEOUT_MAX, ], ) @pytest.fixture() def token_network_test_signatures( deploy_tester_contract, web3, custom_token, secret_registry_contract, ): return deploy_tester_contract( 'TokenNetworkSignatureTest', {}, [ custom_token.address, secret_registry_contract.address, int(web3.version.network), TEST_SETTLE_TIMEOUT_MIN, TEST_SETTLE_TIMEOUT_MAX, ], ) @pytest.fixture() def token_network_test_utils( deploy_tester_contract, web3, custom_token, secret_registry_contract, ): return deploy_tester_contract( 'TokenNetworkUtilsTest', {}, [ custom_token.address, secret_registry_contract.address, int(web3.version.network), TEST_SETTLE_TIMEOUT_MIN, TEST_SETTLE_TIMEOUT_MAX, ], )
22.41791
45
0.611185
135
1,502
6.325926
0.237037
0.093677
0.159251
0.093677
0.830211
0.830211
0.830211
0.830211
0.830211
0.830211
0
0.005871
0.319574
1,502
66
46
22.757576
0.829746
0
0
0.745763
0
0
0.051265
0.051265
0
0
0
0
0
1
0.050847
false
0
0.033898
0.050847
0.135593
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
a5267c9909adfdcac70aa8beb5d4dd29314b79b5
2,940
py
Python
src/sem_seg/eval_iou_accuracy.py
bonchinchi/PinSout
e1f8882e20dcb714faaa4ba350569a6c7315a3aa
[ "MIT" ]
30
2019-08-27T21:13:26.000Z
2022-02-15T07:23:20.000Z
src/sem_seg/eval_iou_accuracy.py
bonchinchi/PinSout
e1f8882e20dcb714faaa4ba350569a6c7315a3aa
[ "MIT" ]
1
2020-08-28T05:15:39.000Z
2020-08-28T05:15:39.000Z
src/sem_seg/eval_iou_accuracy.py
bonchinchi/PinSout
e1f8882e20dcb714faaa4ba350569a6c7315a3aa
[ "MIT" ]
8
2019-05-23T15:36:48.000Z
2022-03-02T14:35:22.000Z
# import numpy as np # import os # import sys # # BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # sys.path.append(BASE_DIR) # print BASE_DIR # # # all_pred_data_label_filelist = os.path.join(BASE_DIR, '/home/dprt/pointnet/sem_seg/log5/output_filelist.txt') # all_pred_data_label_filelist = os.path.join(BASE_DIR, 'logSC_7cls_3/IOU_test/output_filelist.txt') # # output_filelist : log/area_1_visu/Area_1_conferenceRoom_1_pred.txt # pred_data_label_filenames = [line.rstrip() for line in open(all_pred_data_label_filelist)] # gt_label_filenames = [f.rstrip('_pred\.txt') + '_gt.txt' for f in pred_data_label_filenames] # # print gt_label_filenames # num_room = len(gt_label_filenames) # # print pred_data_label_filenames # # gt_classes = [0 for _ in range(5)] # positive_classes = [0 for _ in range(5)] # true_positive_classes = [0 for _ in range(5)] # for i in range(num_room): # # data_label = np.loadtxt(pred_data_label_filenames[i]) # pred_label = data_label[:, -1] # gt_label = np.loadtxt(gt_label_filenames[i]) # # for j in range(gt_label.shape[0]): # gt_l = int(gt_label[j]) # pred_l = int(pred_label[j]) # gt_classes[gt_l] += 1 # positive_classes[pred_l] += 1 # true_positive_classes[gt_l] += int(gt_l == pred_l) # # print(gt_classes) # print(positive_classes) # print(true_positive_classes) # # # print('Overall accuracy: {0}'.format(sum(true_positive_classes)/float(sum(positive_classes)))) # # print('IoU:') # iou_list = [] # for i in range(5): # iou = true_positive_classes[i]/float(gt_classes[i]+positive_classes[i]-true_positive_classes[i]) # print(iou) # iou_list.append(iou) # # # print(sum(iou_list)/13.0) # print(sum(iou_list)/5.0) import numpy as np pred_data_label_filenames = [line.rstrip() for line in open('/home/dprt/Desktop/Demo/IOU_test/output_filelist.txt')] gt_label_filenames = [f.rstrip('_pred\.txt') + '_gt.txt' for f in pred_data_label_filenames] num_room = len(gt_label_filenames) gt_classes = [0 for _ in range(5)] positive_classes = [0 for _ in range(5)] true_positive_classes = [0 for _ in range(5)] for i in range(num_room): print(i) data_label = np.loadtxt(pred_data_label_filenames[i]) pred_label = data_label[:,-1] gt_label = np.loadtxt(gt_label_filenames[i]) print(gt_label.shape) for j in xrange(gt_label.shape[0]): gt_l = int(gt_label[j]) pred_l = int(pred_label[j]) gt_classes[gt_l] += 1 positive_classes[pred_l] += 1 true_positive_classes[gt_l] += int(gt_l == pred_l) print(gt_classes) print(positive_classes) print(true_positive_classes) print('Overall accuracy: {0}'.format(sum(true_positive_classes)/float(sum(positive_classes)))) print 'IoU:' iou_list = [] for i in range(5): iou = true_positive_classes[i]/float(gt_classes[i]+positive_classes[i]-true_positive_classes[i]) print(iou) iou_list.append(iou) print(sum(iou_list)/5.0)
32.307692
116
0.709524
477
2,940
4.031447
0.148847
0.171607
0.118565
0.080083
0.838794
0.801352
0.791472
0.791472
0.764431
0.764431
0
0.01477
0.147959
2,940
90
117
32.666667
0.752894
0.55102
0
0
0
0
0.074308
0.041107
0
0
0
0
0
0
null
null
0
0.033333
null
null
0.3
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
7
a5613c1e35c2e5fe3a7932aaf8e82a341960e373
112
py
Python
platform/hwconf_data/ezr32lg/PythonSnippet/__init__.py
lenloe1/v2.7
9ac9c4a7bb37987af382c80647f42d84db5f2e1d
[ "Zlib" ]
null
null
null
platform/hwconf_data/ezr32lg/PythonSnippet/__init__.py
lenloe1/v2.7
9ac9c4a7bb37987af382c80647f42d84db5f2e1d
[ "Zlib" ]
1
2020-08-25T02:36:22.000Z
2020-08-25T02:36:22.000Z
platform/hwconf_data/ezr32lg/PythonSnippet/__init__.py
lenloe1/v2.7
9ac9c4a7bb37987af382c80647f42d84db5f2e1d
[ "Zlib" ]
1
2020-08-25T01:56:04.000Z
2020-08-25T01:56:04.000Z
from ezr32lg.halconfig import halconfig_types as types from ezr32lg.halconfig import halconfig_dependency as dep
56
57
0.883929
16
112
6.0625
0.5
0.226804
0.412371
0.536082
0.721649
0
0
0
0
0
0
0.039604
0.098214
112
2
57
56
0.920792
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
7
a563a689e4ba767e619bd36c85d5150b7a6b3d9b
69
py
Python
fth/imports.py
pipetovarh/manim
a277e2ac0c4af8430a3f44cd3276de2bcdbeb254
[ "MIT" ]
null
null
null
fth/imports.py
pipetovarh/manim
a277e2ac0c4af8430a3f44cd3276de2bcdbeb254
[ "MIT" ]
null
null
null
fth/imports.py
pipetovarh/manim
a277e2ac0c4af8430a3f44cd3276de2bcdbeb254
[ "MIT" ]
null
null
null
from fth.externals.beethoven import * from fth.externals.fth import *
34.5
37
0.811594
10
69
5.6
0.5
0.25
0.571429
0
0
0
0
0
0
0
0
0
0.101449
69
2
38
34.5
0.903226
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
a59be13d5d04d8f78c265e7c46e2c8451e45daa5
8,222
py
Python
manual/remoteserver.py
kunal26das/Autonomous-Car-Model
353c87c98001c258d21d25a74e73ff5c53f8b781
[ "Apache-2.0" ]
1
2019-04-19T02:25:27.000Z
2019-04-19T02:25:27.000Z
manual/remoteserver.py
kunal26das/Autonomous-Car-Model
353c87c98001c258d21d25a74e73ff5c53f8b781
[ "Apache-2.0" ]
null
null
null
manual/remoteserver.py
kunal26das/Autonomous-Car-Model
353c87c98001c258d21d25a74e73ff5c53f8b781
[ "Apache-2.0" ]
null
null
null
<<<<<<< HEAD import base64 import datetime import picamera import RPi.GPIO as GPIO from io import BytesIO from flask import Flask, request from flask_socketio import SocketIO, emit #Rear Wheels for Driving Motor1A = 23 Motor1B = 24 #Front Wheels for Steer Motor2A = 26 Motor2B = 19 angle = 10 frequency = 50 def accelerate(): pwm = GPIO.PWM(Motor1B,frequency) pwm.start(angle) GPIO.output(Motor1A, GPIO.HIGH) GPIO.output(Motor1B, GPIO.LOW) def reverse(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.HIGH) def left(): #pwm = GPIO.PWM(Motor2B,frequency) #pwm.start(angle) GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.HIGH) def right(): #pwm = GPIO.PWM(Motor2A,frequency) #pwm.start(angle) GPIO.output(Motor2A, GPIO.HIGH) GPIO.output(Motor2B, GPIO.LOW) def leftTurn(): GPIO.output(Motor1A, GPIO.HIGH) GPIO.output(Motor1B, GPIO.LOW) GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.HIGH) def rightTurn(): GPIO.output(Motor1A, GPIO.HIGH) GPIO.output(Motor1B, GPIO.LOW) GPIO.output(Motor2A, GPIO.HIGH) GPIO.output(Motor2B, GPIO.LOW) def leftRev(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.HIGH) GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.HIGH) def rightRev(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.HIGH) GPIO.output(Motor2A, GPIO.HIGH) GPIO.output(Motor2B, GPIO.LOW) def brakes(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.LOW) def release(): GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.LOW) def capture(): camera = picamera.PiCamera() camera.rotation = 180 myStream = BytesIO() camera.start_preview() camera.capture(myStream, 'jpeg') camera.stop_preview() myString = base64.b64encode(myStream.getvalue()) return myString app = Flask(__name__) socketio = SocketIO(app) socketio_connections = set() @socketio.on('throttle', namespace='/sdc') def on_throttle(msg): if msg['key']=='38': accelerate() print("@"+str(datetime.datetime.now().time())+" : Accelerate") elif msg['key']=='40': reverse() print("@"+str(datetime.datetime.now().time())+" : Reverse") @socketio.on('steer', namespace='/sdc') def on_steer(msg): if msg['key']=='37': left() print("@"+str(datetime.datetime.now().time())+" : Steering Left") elif msg['key']=='39': right() print("@"+str(datetime.datetime.now().time())+" : Steering Right") @socketio.on('turn', namespace='/sdc') def on_turn(msg): if msg['key']=='75': leftTurn() print("@"+str(datetime.datetime.now().time())+" : Turning Left") elif msg['key']=='77': rightTurn() print("@"+str(datetime.datetime.now().time())+" : Turning Right") @socketio.on('reverse', namespace='sdc') def on_reverse(msg): if msg['key']=='77': leftRev() print("@"+str(datetime.datetime.now().time())+" : Reversing Left") elif msg['key']=='79': rightRev() print("@"+str(datetime.datetime.now().time())+" : Reversing Right") @socketio.on('brakes', namespace='/sdc') def on_brakes(msg): brakes() print("@"+str(datetime.datetime.now().time())+" : Brakes") @socketio.on('release', namespace='/sdc') def on_release(msg): release() print("@"+str(datetime.datetime.now().time())+" : Released Steer") @socketio.on('connect', namespace='/sdc') def on_connect(): socketio_connections.add(request.sid) print("@"+str(datetime.datetime.now().time())+" : Remote Connected") @socketio.on('disconnect', namespace='/sdc') def on_disconnect(): socketio_connections.remove(request.sid) print("@"+str(datetime.datetime.now().time())+" : Remote Disconnected") if __name__ == '__main__': GPIO.setmode(GPIO.BCM) GPIO.setup(Motor1A, GPIO.OUT) GPIO.setup(Motor1B, GPIO.OUT) GPIO.setup(Motor2A, GPIO.OUT) GPIO.setup(Motor2B, GPIO.OUT) socketio.run(app, host='192.168.43.55', port=9999) GPIO.cleanup() ======= import base64 import datetime import picamera import RPi.GPIO as GPIO from io import BytesIO from flask import Flask, request from flask_socketio import SocketIO, emit #Rear Wheels for Driving Motor1A = 23 Motor1B = 24 #Front Wheels for Steer Motor2A = 26 Motor2B = 19 angle = 10 frequency = 50 def accelerate(): pwm = GPIO.PWM(Motor1B,frequency) pwm.start(angle) GPIO.output(Motor1A, GPIO.HIGH) GPIO.output(Motor1B, GPIO.LOW) def reverse(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.HIGH) def left(): #pwm = GPIO.PWM(Motor2B,frequency) #pwm.start(angle) GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.HIGH) def right(): #pwm = GPIO.PWM(Motor2A,frequency) #pwm.start(angle) GPIO.output(Motor2A, GPIO.HIGH) GPIO.output(Motor2B, GPIO.LOW) def leftTurn(): GPIO.output(Motor1A, GPIO.HIGH) GPIO.output(Motor1B, GPIO.LOW) GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.HIGH) def rightTurn(): GPIO.output(Motor1A, GPIO.HIGH) GPIO.output(Motor1B, GPIO.LOW) GPIO.output(Motor2A, GPIO.HIGH) GPIO.output(Motor2B, GPIO.LOW) def leftRev(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.HIGH) GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.HIGH) def rightRev(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.HIGH) GPIO.output(Motor2A, GPIO.HIGH) GPIO.output(Motor2B, GPIO.LOW) def brakes(): GPIO.output(Motor1A, GPIO.LOW) GPIO.output(Motor1B, GPIO.LOW) def release(): GPIO.output(Motor2A, GPIO.LOW) GPIO.output(Motor2B, GPIO.LOW) def capture(): camera = picamera.PiCamera() camera.rotation = 180 myStream = BytesIO() camera.start_preview() camera.capture(myStream, 'jpeg') camera.stop_preview() myString = base64.b64encode(myStream.getvalue()) return myString app = Flask(__name__) socketio = SocketIO(app) socketio_connections = set() @socketio.on('throttle', namespace='/sdc') def on_throttle(msg): if msg['key']=='38': accelerate() print("@"+str(datetime.datetime.now().time())+" : Accelerate") elif msg['key']=='40': reverse() print("@"+str(datetime.datetime.now().time())+" : Reverse") @socketio.on('steer', namespace='/sdc') def on_steer(msg): if msg['key']=='37': left() print("@"+str(datetime.datetime.now().time())+" : Steering Left") elif msg['key']=='39': right() print("@"+str(datetime.datetime.now().time())+" : Steering Right") @socketio.on('turn', namespace='/sdc') def on_turn(msg): if msg['key']=='75': leftTurn() print("@"+str(datetime.datetime.now().time())+" : Turning Left") elif msg['key']=='77': rightTurn() print("@"+str(datetime.datetime.now().time())+" : Turning Right") @socketio.on('reverse', namespace='sdc') def on_reverse(msg): if msg['key']=='77': leftRev() print("@"+str(datetime.datetime.now().time())+" : Reversing Left") elif msg['key']=='79': rightRev() print("@"+str(datetime.datetime.now().time())+" : Reversing Right") @socketio.on('brakes', namespace='/sdc') def on_brakes(msg): brakes() print("@"+str(datetime.datetime.now().time())+" : Brakes") @socketio.on('release', namespace='/sdc') def on_release(msg): release() print("@"+str(datetime.datetime.now().time())+" : Released Steer") @socketio.on('connect', namespace='/sdc') def on_connect(): socketio_connections.add(request.sid) print("@"+str(datetime.datetime.now().time())+" : Remote Connected") @socketio.on('disconnect', namespace='/sdc') def on_disconnect(): socketio_connections.remove(request.sid) print("@"+str(datetime.datetime.now().time())+" : Remote Disconnected") if __name__ == '__main__': GPIO.setmode(GPIO.BCM) GPIO.setup(Motor1A, GPIO.OUT) GPIO.setup(Motor1B, GPIO.OUT) GPIO.setup(Motor2A, GPIO.OUT) GPIO.setup(Motor2B, GPIO.OUT) socketio.run(app, host='192.168.43.55', port=9999) GPIO.cleanup() >>>>>>> e5e2854306b7143c1e031de516abfc66f7896142
26.694805
75
0.648018
1,042
8,222
5.06334
0.107486
0.106141
0.072782
0.109174
0.99166
0.99166
0.99166
0.99166
0.99166
0.99166
0
0.03053
0.17137
8,222
307
76
26.781759
0.743872
0.034785
0
0.987755
0
0
0.088592
0
0
0
0
0
0
0
null
null
0
0.057143
null
null
0.097959
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
b1c7cfc1974ef08d8cf8043fded42de4f2e95478
187
py
Python
eapimt/monitoring/__init__.py
JasonGodmere/eapimt
358560e5c08d26ef44cc0a62fde81c8165265b95
[ "BSD-2-Clause" ]
null
null
null
eapimt/monitoring/__init__.py
JasonGodmere/eapimt
358560e5c08d26ef44cc0a62fde81c8165265b95
[ "BSD-2-Clause" ]
null
null
null
eapimt/monitoring/__init__.py
JasonGodmere/eapimt
358560e5c08d26ef44cc0a62fde81c8165265b95
[ "BSD-2-Clause" ]
null
null
null
from .system_details_monitoring import * from .site_level_production_monitoring import * from .site_level_consumption_monitoring import * from .device_level_production_monitoring import *
46.75
49
0.877005
23
187
6.652174
0.434783
0.418301
0.392157
0.313725
0.379085
0
0
0
0
0
0
0
0.080214
187
4
49
46.75
0.889535
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
b1e0d8624d31aeb2d8229e8f46e6bcd03d9a6363
66,896
py
Python
fonts/romfonts/vga2_16x32.py
slabua/st7789py_mpy
31e6f94592563e2b5ad716c48486e605ca3911bb
[ "MIT" ]
153
2020-02-02T11:03:14.000Z
2022-03-30T05:47:07.000Z
fonts/bitmap/vga2_16x32.py
skylin008/st7789_mpy
f304991fc5558be653df5f0de928494b85cbc60d
[ "MIT" ]
58
2020-04-11T23:23:02.000Z
2022-03-26T20:45:23.000Z
fonts/bitmap/vga2_16x32.py
skylin008/st7789_mpy
f304991fc5558be653df5f0de928494b85cbc60d
[ "MIT" ]
50
2020-02-02T11:05:23.000Z
2022-03-22T15:24:42.000Z
WIDTH = 16 HEIGHT = 32 FIRST = 0 LAST = 255 _FONT = \ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x60\x06\x60\x06\xc0\x03\xc0\x03\xcc\x33\xcc\x33\xc0\x03\xc0\x03\xc0\x03\xc0\x03\xcf\xf3\xcf\xf3\xc3\xc3\xc3\xc3\xc0\x03\xc0\x03\x60\x06\x60\x06\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x7f\xfe\x7f\xfe\xff\xff\xff\xff\xf3\xcf\xf3\xcf\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x0f\xf0\x0f\xfc\x3f\xfc\x3f\xff\xff\xff\xff\x7f\xfe\x7f\xfe\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x78\x1e\x78\x3f\xfc\x3f\xfc\x7f\xfe\x7f\xfe\x7f\xfe\x7f\xfe\x7f\xfe\x7f\xfe\x3f\xfc\x3f\xfc\x1f\xf8\x1f\xf8\x07\xe0\x07\xe0\x01\x80\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x80\x01\x80\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0f\xf0\x0f\xf0\x1f\xf8\x1f\xf8\x0f\xf0\x0f\xf0\x07\xe0\x07\xe0\x03\xc0\x03\xc0\x01\x80\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x03\xe0\x03\xe0\x03\xe0\x03\xe0\x1d\xdc\x1d\xdc\x3f\xfe\x3f\xfe\x3f\xfe\x3f\xfe\x1d\xdc\x1d\xdc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x1f\xfc\x1f\xfc\x7f\xff\x7f\xff\x7f\xff\x7f\xff\x7f\xff\x7f\xff\x1d\xdc\x1d\xdc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x03\xc0\x0f\xf0\x0f\xf0\x0f\xf0\x0f\xf0\x03\xc0\x03\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x3f\xfc\x3f\xf0\x0f\xf0\x0f\xf0\x0f\xf0\x0f\xfc\x3f\xfc\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x3c\x3c\x3c\x3c\x30\x0c\x30\x0c\x30\x0c\x30\x0c\x3c\x3c\x3c\x3c\x0f\xf0\x0f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x0f\xf0\x0f\xc3\xc3\xc3\xc3\xcf\xf3\xcf\xf3\xcf\xf3\xcf\xf3\xc3\xc3\xc3\xc3\xf0\x0f\xf0\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x7f\x00\x1f\x00\x1f\x00\x3b\x00\x3b\x00\x70\x00\x70\x07\xe0\x07\xe0\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x07\xe0\x07\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x03\xe0\x0e\x38\x0e\x38\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x03\xe0\x03\xe0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x1f\xfc\x1f\xfc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xff\x0f\xff\x0e\x07\x0e\x07\x0f\xff\x0f\xff\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x3e\x00\x3e\x00\x7e\x00\x7e\x00\x3c\x00\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xfe\x1f\xfe\x1c\x0e\x1c\x0e\x1f\xfe\x1f\xfe\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x0e\x1c\x1e\x1c\x1e\x3c\x3e\x3c\x3e\x7c\x1c\x7c\x1c\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x39\xce\x39\xce\x1d\xdc\x1d\xdc\x0f\xf8\x0f\xf8\x7e\x3f\x7e\x3f\x0f\xf8\x0f\xf8\x1d\xdc\x1d\xdc\x39\xce\x39\xce\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x30\x00\x3c\x00\x3c\x00\x3f\x00\x3f\x00\x3f\xc0\x3f\xc0\x3f\xf0\x3f\xf0\x3f\xfc\x3f\xfc\x3f\xf0\x3f\xf0\x3f\xc0\x3f\xc0\x3f\x00\x3f\x00\x3c\x00\x3c\x00\x30\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x0c\x00\x3c\x00\x3c\x00\xfc\x00\xfc\x03\xfc\x03\xfc\x0f\xfc\x0f\xfc\x3f\xfc\x3f\xfc\x0f\xfc\x0f\xfc\x03\xfc\x03\xfc\x00\xfc\x00\xfc\x00\x3c\x00\x3c\x00\x0c\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x1d\xdc\x1d\xdc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x1d\xdc\x1d\xdc\x07\xf0\x07\xf0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x00\x00\x00\x00\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xff\x1f\xff\x71\xce\x71\xce\x71\xce\x71\xce\x71\xce\x71\xce\x71\xce\x71\xce\x1f\xce\x1f\xce\x01\xce\x01\xce\x01\xce\x01\xce\x01\xce\x01\xce\x01\xce\x01\xce\x01\xce\x01\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x0e\x00\x0e\x00\x03\xe0\x03\xe0\x0e\x38\x0e\x38\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0e\x38\x0e\x38\x03\xe0\x03\xe0\x00\x38\x00\x38\x38\x0e\x38\x0e\x0f\xf8\x0f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\x3f\xff\x3f\xff\x3f\xff\x3f\xff\x3f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x1d\xdc\x1d\xdc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x1d\xdc\x1d\xdc\x07\xf0\x07\xf0\x01\xc0\x01\xc0\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x1d\xdc\x1d\xdc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x1d\xdc\x1d\xdc\x07\xf0\x07\xf0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x00\x1c\x00\x1c\x3f\xff\x3f\xff\x00\x1c\x00\x1c\x00\x70\x00\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x80\x03\x80\x0e\x00\x0e\x00\x3f\xff\x3f\xff\x0e\x00\x0e\x00\x03\x80\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xff\x3f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x7f\xfe\x7f\xfe\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x80\x01\x80\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0f\xf0\x0f\xf0\x1f\xf8\x1f\xf8\x3f\xfc\x3f\xfc\x7f\xfe\x7f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\xfe\x7f\xfe\x3f\xfc\x3f\xfc\x1f\xf8\x1f\xf8\x0f\xf0\x0f\xf0\x07\xe0\x07\xe0\x03\xc0\x03\xc0\x01\x80\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x7f\xfe\x7f\xfe\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x7f\xfe\x7f\xfe\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x01\x80\x01\x80\x0f\xf0\x0f\xf0\x39\x9c\x39\x9c\x71\x8e\x71\x8e\x71\x80\x71\x80\x39\x80\x39\x80\x0f\xf0\x0f\xf0\x01\x9c\x01\x9c\x01\x8e\x01\x8e\x71\x8e\x71\x8e\x39\x9c\x39\x9c\x0f\xf0\x0f\xf0\x01\x80\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x1c\x1e\x1c\x1e\x38\x1e\x38\x00\x70\x00\x70\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x0e\x3c\x0e\x3c\x1c\x3c\x1c\x3c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xc0\x07\xc0\x1c\x70\x1c\x70\x38\x38\x38\x38\x1c\x70\x1c\x70\x07\xc0\x07\xc0\x0f\xce\x0f\xce\x38\xfc\x38\xfc\x70\x78\x70\x78\x70\x78\x70\x78\x38\xfc\x38\xfc\x0f\xce\x0f\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xe0\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x07\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x38\x0e\x38\x03\xe0\x03\xe0\x3f\xfe\x3f\xfe\x03\xe0\x03\xe0\x0e\x38\x0e\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x3f\xfe\x3f\xfe\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x03\xc0\x03\xc0\x03\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x03\xc0\x03\xc0\x03\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x1c\x00\x38\x00\x38\x00\x70\x00\x70\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xe0\x07\xe0\x1c\x38\x1c\x38\x38\x3c\x38\x3c\x38\x7c\x38\x7c\x38\xdc\x38\xdc\x39\x9c\x39\x9c\x3b\x1c\x3b\x1c\x3e\x1c\x3e\x1c\x3c\x1c\x3c\x1c\x1c\x38\x1c\x38\x07\xe0\x07\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x03\xc0\x03\xc0\x0f\xc0\x0f\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x38\x1c\x38\x1c\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x1c\x00\x1c\x00\x38\x00\x38\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x38\x1c\x38\x1c\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x01\xf0\x01\xf0\x00\x1c\x00\x1c\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x38\x1c\x38\x1c\x0f\xf0\x0f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xf0\x01\xf0\x03\xf0\x03\xf0\x07\x70\x07\x70\x0e\x70\x0e\x70\x1c\x70\x1c\x70\x38\x70\x38\x70\x3f\xfc\x3f\xfc\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xf0\x3f\xf0\x00\x1c\x00\x1c\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x38\x1c\x38\x1c\x0f\xf0\x0f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x00\x1c\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf8\x3f\xf8\x00\x38\x00\x38\x00\x38\x00\x38\x00\x70\x00\x70\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x0e\x1c\x0e\x07\xfe\x07\xfe\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x0f\xf0\x0f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x80\x03\x80\x03\x80\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x80\x03\x80\x03\x80\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x80\x03\x80\x03\x80\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x80\x03\x80\x03\x80\x03\x80\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x00\x0e\x00\x0e\x00\x07\x00\x07\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xe0\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x07\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xe0\x00\xe0\x00\x70\x00\x70\x00\x38\x00\x38\x00\x70\x00\x70\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xe0\x07\xe0\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x00\x38\x00\x38\x00\x70\x00\x70\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x38\x1c\x38\x1c\x70\x0e\x70\x0e\x71\xfe\x71\xfe\x73\x8e\x73\x8e\x73\x8e\x73\x8e\x73\x8e\x73\x8e\x71\xfc\x71\xfc\x70\x00\x70\x00\x38\x00\x38\x00\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0e\x70\x0e\x70\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x3f\xfc\x3f\xfc\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x1c\x38\x1c\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x1c\x38\x1c\x3f\xf0\x3f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x1c\x38\x1c\x3f\xf0\x3f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xe0\x3f\xe0\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xe0\x3f\xe0\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x3e\x38\x3e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x00\x1c\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x03\xe0\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x38\x1c\x38\x1c\x70\x1c\x70\x1c\xe0\x1c\xe0\x1d\xc0\x1d\xc0\x1f\x80\x1f\x80\x1f\x80\x1f\x80\x1d\xc0\x1d\xc0\x1c\xe0\x1c\xe0\x1c\x70\x1c\x70\x1c\x38\x1c\x38\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x78\x1e\x78\x1e\x7c\x3e\x7c\x3e\x7e\x7e\x7e\x7e\x77\xee\x77\xee\x73\xce\x73\xce\x71\x8e\x71\x8e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x3c\x0e\x3c\x0e\x3e\x0e\x3e\x0e\x3f\x0e\x3f\x0e\x3b\x8e\x3b\x8e\x39\xce\x39\xce\x38\xee\x38\xee\x38\x7e\x38\x7e\x38\x3e\x38\x3e\x38\x1e\x38\x1e\x38\x0e\x38\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x1c\x38\x1c\x3f\xf0\x3f\xf0\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\xee\x38\xee\x1c\x7c\x1c\x7c\x07\xf8\x07\xf8\x00\x1c\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x1c\x38\x1c\x3f\xf0\x3f\xf0\x38\xe0\x38\xe0\x38\x70\x38\x70\x38\x38\x38\x38\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x38\x1c\x38\x1c\x70\x0e\x70\x0e\x70\x00\x70\x00\x38\x00\x38\x00\x0f\xf0\x0f\xf0\x00\x1c\x00\x1c\x00\x0e\x00\x0e\x70\x0e\x70\x0e\x38\x1c\x38\x1c\x0f\xf0\x0f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x0e\x70\x0e\x70\x07\xe0\x07\xe0\x03\xc0\x03\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x70\x0e\x71\x8e\x71\x8e\x73\xce\x73\xce\x77\xee\x77\xee\x3e\x7c\x3e\x7c\x1c\x38\x1c\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x0e\x70\x0e\x70\x07\xe0\x07\xe0\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0e\x70\x0e\x70\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x07\x70\x07\x70\x03\xe0\x03\xe0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x1c\x00\x1c\x00\x38\x00\x38\x00\x70\x00\x70\x00\xe0\x00\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x1c\x00\x0e\x00\x0e\x00\x07\x00\x07\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xe0\x00\xe0\x00\x70\x00\x70\x00\x38\x00\x38\x00\x1c\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0e\x70\x0e\x70\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x07\x00\x07\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xe0\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x0f\xfe\x0f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xf8\x3f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x0e\x38\x0e\x0f\xf8\x0f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x07\xfe\x07\xfe\x1c\x0e\x1c\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x00\x38\x00\x38\x00\x38\x00\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00\xf8\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x0f\xf0\x0f\xf0\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x1f\xf8\x1f\xf8\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3b\xf8\x3b\xf8\x3c\x0e\x3c\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x00\x70\x00\x70\x00\x00\x00\x00\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\xe0\x00\xe0\x0f\x80\x0f\x80\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x38\x0e\x38\x0e\x70\x0e\x70\x0e\xe0\x0e\xe0\x0f\xc0\x0f\xc0\x0e\xe0\x0e\xe0\x0e\x70\x0e\x70\x0e\x38\x0e\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x78\x3e\x78\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x39\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xe0\x3f\xe0\x38\x38\x38\x38\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x1c\x38\x1c\x3f\xf0\x3f\xf0\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xfe\x07\xfe\x1c\x0e\x1c\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x0e\x1c\x0e\x07\xfe\x07\xfe\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x38\x1c\x38\x1c\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xfc\x0f\xfc\x38\x00\x38\x00\x38\x00\x38\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x1f\xf8\x1f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x1f\xfc\x1f\xfc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x0e\x70\x0e\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x0e\x70\x0e\x70\x07\xe0\x07\xe0\x03\xc0\x03\xc0\x01\x80\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x39\xce\x39\xce\x3b\xee\x3b\xee\x1f\x7c\x1f\x7c\x0e\x38\x0e\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x38\x1c\x38\x0e\x70\x0e\x70\x07\xe0\x07\xe0\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0e\x70\x0e\x70\x1c\x38\x1c\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x07\x70\x07\x70\x03\xe0\x03\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x0e\x00\x0e\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x1c\x00\x1c\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x1c\x00\x1c\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00\xf8\x01\xc0\x01\xc0\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x1e\x00\x1e\x00\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x01\xc0\x01\xc0\x00\xf8\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x1f\x00\x03\x80\x03\x80\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x78\x00\x78\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x03\x80\x03\x80\x1f\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\x9e\x07\x9e\x3c\xf0\x3c\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\x70\x07\x70\x1c\x1c\x1c\x1c\x70\x07\x70\x07\x70\x07\x70\x07\x7f\xff\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf8\x07\xf8\x1c\x0e\x1c\x0e\x38\x06\x38\x06\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x06\x38\x06\x1c\x0e\x1c\x0e\x07\xf8\x07\xf8\x00\x38\x00\x38\x00\x1c\x00\x1c\x0f\xf8\x0f\xf8\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\xe0\x00\xe0\x03\x80\x03\x80\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x00\x38\x00\x38\x00\x38\x00\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\x70\x07\x70\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x0f\xfe\x0f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x0f\xfe\x0f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x07\x00\x01\xc0\x01\xc0\x00\x70\x00\x70\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x0f\xfe\x0f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\xe0\x03\xe0\x0e\x38\x0e\x38\x03\xe0\x03\xe0\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x0f\xfe\x0f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x38\x1c\x38\x1c\x38\x00\x38\x00\x38\x00\x38\x00\x38\x1c\x38\x1c\x0f\xf0\x0f\xf0\x00\x70\x00\x70\x00\x38\x00\x38\x0f\xf0\x0f\xf0\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\x70\x07\x70\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x00\x38\x00\x38\x00\x38\x00\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x00\x38\x00\x38\x00\x38\x00\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x07\x00\x01\xc0\x01\xc0\x00\x70\x00\x70\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x00\x38\x00\x38\x00\x38\x00\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\x70\x07\x70\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x03\x80\x03\x80\x00\xe0\x00\xe0\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x00\x00\x00\x00\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0e\x70\x0e\x70\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x3f\xfc\x3f\xfc\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x03\xc0\x03\xc0\x0e\x70\x0e\x70\x03\xc0\x03\xc0\x00\x00\x00\x00\x03\xc0\x03\xc0\x07\xe0\x07\xe0\x0e\x70\x0e\x70\x1c\x38\x1c\x38\x38\x1c\x38\x1c\x3f\xfc\x3f\xfc\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xe0\x3f\xe0\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x7e\x3e\x7e\x03\xc7\x03\xc7\x03\xc7\x03\xc7\x7f\xfe\x7f\xfe\xe3\xc0\xe3\xc0\xe3\xc0\xe3\xc0\x7f\xff\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\x07\xff\x0e\xe0\x0e\xe0\x1c\xe0\x1c\xe0\x38\xe0\x38\xe0\x70\xe0\x70\xe0\x7f\xfe\x7f\xfe\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xff\x70\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x07\x70\x07\x70\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x07\x00\x01\xc0\x01\xc0\x00\x70\x00\x70\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x03\xc0\x0e\x70\x0e\x70\x38\x1c\x38\x1c\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x03\x80\x03\x80\x00\xe0\x00\xe0\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x07\x70\x07\x70\x03\xe0\x03\xe0\x01\xc0\x01\xc0\x03\x80\x03\x80\x07\x00\x07\x00\x0e\x00\x0e\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x00\x00\x00\x00\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x1e\x38\x1e\x0f\xf8\x0f\xf8\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xf0\x01\xf0\x07\x1c\x07\x1c\x07\x00\x07\x00\x07\x00\x07\x00\x1f\xc0\x1f\xc0\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x3f\x0e\x3f\x0e\x3f\xf8\x3f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x07\x70\x07\x70\x03\xe0\x03\xe0\x3f\xfe\x3f\xfe\x01\xc0\x01\xc0\x3f\xfe\x3f\xfe\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x80\x7f\x80\x70\xe0\x70\xe0\x70\x70\x70\x70\x70\xe0\x70\xe0\x7f\x9c\x7f\x9c\x70\x1c\x70\x1c\x70\x7f\x70\x7f\x70\x1c\x70\x1c\x70\x1c\x70\x1c\x70\x1c\x70\x1c\x70\x1c\x70\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x00\x78\x01\xce\x01\xce\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x1f\xfc\x1f\xfc\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x39\xc0\x39\xc0\x0f\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x00\x0e\x00\x0e\x0f\xfe\x0f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x0f\xfe\x0f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x00\x00\x00\x00\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x9c\x07\x9c\x3c\xf0\x3c\xf0\x00\x00\x00\x00\x3f\xe0\x3f\xe0\x38\x38\x38\x38\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x07\x9e\x07\x9e\x3c\xf0\x3c\xf0\x00\x00\x00\x00\x3c\x0e\x3c\x0e\x3e\x0e\x3e\x0e\x3f\x0e\x3f\x0e\x3b\x8e\x3b\x8e\x39\xce\x39\xce\x38\xee\x38\xee\x38\x7e\x38\x7e\x38\x3e\x38\x3e\x38\x1e\x38\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf0\x0f\xf0\x38\x70\x38\x70\x38\x70\x38\x70\x0f\xfc\x0f\xfc\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xc0\x0f\xc0\x38\x70\x38\x70\x38\x70\x38\x70\x0f\xc0\x0f\xc0\x00\x00\x00\x00\x3f\xf0\x3f\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\x80\x03\x80\x03\x80\x03\x80\x00\x00\x00\x00\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x03\x80\x07\x00\x07\x00\x1c\x00\x1c\x00\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x07\xe0\x07\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\x3f\xff\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xff\x3f\xff\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\x78\x00\x78\x00\x38\x00\x38\x00\x38\x1c\x38\x1c\x38\x70\x38\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x1c\x7c\x1c\x7c\x70\x0e\x70\x0e\x00\x1c\x00\x1c\x00\x70\x00\x70\x00\xfe\x00\xfe\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x38\x00\x38\x00\x78\x00\x78\x00\x38\x00\x38\x00\x38\x1c\x38\x1c\x38\x70\x38\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x1c\x1c\x1c\x1c\x70\x7c\x70\x7c\x01\xdc\x01\xdc\x01\xfe\x01\xfe\x00\x1c\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x8e\x03\x8e\x0e\x38\x0e\x38\x38\xe0\x38\xe0\x0e\x38\x0e\x38\x03\x8e\x03\x8e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\xe0\x38\xe0\x0e\x38\x0e\x38\x03\x8e\x03\x8e\x0e\x38\x0e\x38\x38\xe0\x38\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30\x03\x03\x03\x03\x30\x30\x30\x30'\ b'\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc\x33\x33\x33\x33\xcc\xcc\xcc\xcc'\ b'\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f\xf3\xf3\xf3\xf3\x3f\x3f\x3f\x3f'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\x38\xff\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xf8\xff\xf8\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\xff\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\x38\xff\x38\x00\x38\x00\x38\xff\x38\xff\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xf8\xff\xf8\x00\x38\x00\x38\xff\x38\xff\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\x38\xff\x38\x00\x38\x00\x38\xff\xf8\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\xf8\xff\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\xff\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xff\x01\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xff\xff\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x3f\x07\x3f\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x3f\x07\x3f\x07\x00\x07\x00\x07\xff\x07\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\x07\xff\x07\x00\x07\x00\x07\x3f\x07\x3f\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\x3f\xff\x3f\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\x3f\xff\x3f\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x3f\x07\x3f\x07\x00\x07\x00\x07\x3f\x07\x3f\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\x3f\xff\x3f\x00\x00\x00\x00\xff\x3f\xff\x3f\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\xff\x07\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xff\x01\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\x07\xff\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\xff\xff\xff\xff\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38\x07\x38'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xff\xff\xff\x01\xc0\x01\xc0\xff\xff\xff\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\xff\xc0\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x01\xff\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'\ b'\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00'\ b'\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff'\ b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x0e\x0f\x0e\x39\xdc\x39\xdc\x70\xf8\x70\xf8\x70\xf0\x70\xf0\x70\xf8\x70\xf8\x39\xdc\x39\xdc\x0f\x0e\x0f\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xf8\x0f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xf8\x3f\xf8\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xf8\x3f\xf8\x38\x00\x38\x00\x38\x00\x38\x00\x18\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x38\x0e\x38\x0e\x38\x00\x38\x00\x0e\x00\x0e\x00\x03\x80\x03\x80\x00\xe0\x00\xe0\x03\x80\x03\x80\x0e\x00\x0e\x00\x38\x00\x38\x00\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xff\x07\xff\x1c\x38\x1c\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x1c\x70\x1c\x70\x07\xc0\x07\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x1c\x0e\x1c\x0f\xf0\x0f\xf0\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x9e\x0f\x9e\x3c\xf8\x3c\xf8\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xfc\x1f\xfc\x01\xc0\x01\xc0\x07\xf0\x07\xf0\x0e\x38\x0e\x38\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x07\xf0\x07\xf0\x01\xc0\x01\xc0\x1f\xfc\x1f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x3f\xfe\x3f\xfe\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x07\xf0\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x1c\x1c\x1c\x1c\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x3e\x3e\x3e\x3e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\xf0\x03\xf0\x0e\x38\x0e\x38\x0e\x00\x0e\x00\x03\x80\x03\x80\x00\xe0\x00\xe0\x07\xf8\x07\xf8\x1c\x1c\x1c\x1c\x38\x1c\x38\x1c\x38\x1c\x38\x1c\x1c\x38\x1c\x38\x07\xe0\x07\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x7c\x3e\x7c\x73\xce\x73\xce\x73\xce\x73\xce\x73\xce\x73\xce\x3e\x7c\x3e\x7c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x1c\x00\x38\x00\x38\x0f\xf0\x0f\xf0\x38\xfc\x38\xfc\x71\xce\x71\xce\x73\x8e\x73\x8e\x3f\x1c\x3f\x1c\x0f\xf0\x0f\xf0\x1c\x00\x1c\x00\x38\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x03\xf0\x03\xf0\x0e\x00\x0e\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x3f\xf0\x3f\xf0\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x38\x00\x0e\x00\x0e\x00\x03\xf0\x03\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf0\x07\xf0\x1c\x1c\x1c\x1c\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x38\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x3f\xfe\x3f\xfe\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x0e\x00\x03\x80\x03\x80\x00\xe0\x00\xe0\x00\x38\x00\x38\x00\xe0\x00\xe0\x03\x80\x03\x80\x0e\x00\x0e\x00\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x70\x01\xc0\x01\xc0\x07\x00\x07\x00\x1c\x00\x1c\x00\x07\x00\x07\x00\x01\xc0\x01\xc0\x00\x70\x00\x70\x00\x00\x00\x00\x3f\xfc\x3f\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x00\x7c\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0'\ b'\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x71\xc0\x71\xc0\x71\xc0\x71\xc0\x1f\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x3f\xfe\x3f\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x9e\x07\x9e\x3c\xf0\x3c\xf0\x00\x00\x00\x00\x07\x9e\x07\x9e\x3c\xf0\x3c\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x0f\xc0\x0f\xc0\x38\x70\x38\x70\x38\x70\x38\x70\x0f\xc0\x0f\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xc0\x03\xc0\x03\xc0\x03\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x7f\x00\x7f\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\x00\x70\xf8\x70\xf8\x70\x1c\x70\x1c\x70\x07\x70\x07\x70\x01\xf0\x01\xf0\x00\x70\x00\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x7f\x80\x7f\x80\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x70\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x3f\x00\x3f\x00\xe1\xc0\xe1\xc0\x01\xc0\x01\xc0\x07\x00\x07\x00\x1c\x00\x1c\x00\x70\x00\x70\x00\xff\xc0\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x1f\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' FONT = memoryview(_FONT)
252.437736
260
0.739357
16,652
66,896
2.970094
0.003723
0.758704
1.04889
1.279631
0.970055
0.952525
0.946945
0.945246
0.933176
0.924016
0
0.408406
0.004126
66,896
264
261
253.393939
0.333984
0
0
0.015267
0
0.977099
0.979685
0.979685
0
1
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
1
1
0
0
0
0
1
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
16
3cc9030e8694b5005b25c4449c8318577b6122d7
50
py
Python
core/__init__.py
Shardj/py-gangue
d02e4e0b0c85069cb4ca9c507be77ecaac51dd73
[ "MIT" ]
null
null
null
core/__init__.py
Shardj/py-gangue
d02e4e0b0c85069cb4ca9c507be77ecaac51dd73
[ "MIT" ]
null
null
null
core/__init__.py
Shardj/py-gangue
d02e4e0b0c85069cb4ca9c507be77ecaac51dd73
[ "MIT" ]
null
null
null
from core import routes from core import packages
16.666667
25
0.84
8
50
5.25
0.625
0.380952
0.666667
0
0
0
0
0
0
0
0
0
0.16
50
2
26
25
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
a73351090d1207945608fdac6f7287221bc9a54b
787
py
Python
hw2/q4_run.py
hsilva664/Reinforcement_Learning_Course
6a250bc017965bec76b6fe909068e40127e62fa7
[ "MIT" ]
null
null
null
hw2/q4_run.py
hsilva664/Reinforcement_Learning_Course
6a250bc017965bec76b6fe909068e40127e62fa7
[ "MIT" ]
null
null
null
hw2/q4_run.py
hsilva664/Reinforcement_Learning_Course
6a250bc017965bec76b6fe909068e40127e62fa7
[ "MIT" ]
null
null
null
import os os.system('cd code && python3 train_pg_f18.py CartPole-v0 -n 100 -b 1000 -e 6 -l 1 -s 32 -lr 5e-3 -dna --exp_name sb_no_rtg_dna') os.system('cd code && python3 train_pg_f18.py CartPole-v0 -n 100 -b 1000 -e 6 -l 1 -s 32 -lr 5e-3 -rtg -dna --exp_name sb_rtg_dna') os.system('cd code && python3 train_pg_f18.py CartPole-v0 -n 100 -b 1000 -e 6 -l 1 -s 32 -lr 5e-3 -rtg --exp_name sb_rtg_na') os.system('cd code && python3 train_pg_f18.py CartPole-v0 -n 100 -b 5000 -e 6 -l 1 -s 32 -lr 5e-3 -dna --exp_name lb_no_rtg_dna') os.system('cd code && python3 train_pg_f18.py CartPole-v0 -n 100 -b 5000 -e 6 -l 1 -s 32 -lr 5e-3 -rtg -dna --exp_name lb_rtg_dna') os.system('cd code && python3 train_pg_f18.py CartPole-v0 -n 100 -b 5000 -e 6 -l 1 -s 32 -lr 5e-3 -rtg --exp_name lb_rtg_na')
87.444444
131
0.68615
186
787
2.731183
0.182796
0.094488
0.11811
0.165354
0.940945
0.940945
0.940945
0.940945
0.940945
0.940945
0
0.155488
0.166455
787
8
132
98.375
0.618902
0
0
0
0
0.857143
0.879288
0
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
11
5966034778794a747c2943583c2f3cca6ff169ab
106
py
Python
simulations/ecg/s.py
sensomatrix/sensocore
f2e94b7dae6ab3e95785c4c1b363e49aab23ddab
[ "MIT" ]
2
2019-04-02T00:17:57.000Z
2019-08-20T05:21:46.000Z
simulations/ecg/s.py
sensomatrix/sensocore
f2e94b7dae6ab3e95785c4c1b363e49aab23ddab
[ "MIT" ]
13
2019-04-01T00:37:01.000Z
2020-10-04T00:50:01.000Z
simulations/ecg/s.py
sensomatrix/sensocore
f2e94b7dae6ab3e95785c4c1b363e49aab23ddab
[ "MIT" ]
null
null
null
import math def s(M_S,t_S,W_S,t): return -1 * M_S * math.exp(-1 * ((t - t_S)/(math.sqrt(2) * W_S)) ** 2)
26.5
71
0.556604
27
106
1.962963
0.444444
0.075472
0
0
0
0
0
0
0
0
0
0.045977
0.179245
106
4
71
26.5
0.563218
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
7
abbae932ecc04df1195be24011ec73d23b4d6090
5,276
py
Python
KWP/lookup_tables/migrations/0012_auto_20170220_1256.py
arcticczar/DownedWildlifeMonitoring
55c2b2bd1d537163735f9c371493365215b5ea7d
[ "Unlicense", "MIT" ]
null
null
null
KWP/lookup_tables/migrations/0012_auto_20170220_1256.py
arcticczar/DownedWildlifeMonitoring
55c2b2bd1d537163735f9c371493365215b5ea7d
[ "Unlicense", "MIT" ]
null
null
null
KWP/lookup_tables/migrations/0012_auto_20170220_1256.py
arcticczar/DownedWildlifeMonitoring
55c2b2bd1d537163735f9c371493365215b5ea7d
[ "Unlicense", "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-20 22:56 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lookup_tables', '0011_auto_20170220_1019'), ] operations = [ migrations.RemoveField( model_name='bait', name='target_species', ), migrations.RemoveField( model_name='traptype', name='target_species', ), migrations.AlterField( model_name='age', name='age_text', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='bait', name='bait_text', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='bandcolor', name='color_text', field=models.CharField(max_length=50, unique=True), ), migrations.AlterField( model_name='canine', name='name', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='direction', name='direction_text', field=models.CharField(max_length=50, unique=True), ), migrations.AlterField( model_name='infrastructure', name='name', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='nightsurvey_behavior', name='behavior', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='nightsurvey_distance', name='distance_range', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='nightsurvey_elevation', name='elevation', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='personnel', name='initials', field=models.CharField(max_length=20, unique=True), ), migrations.AlterField( model_name='plantspecies', name='scientific_name', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='randompoints', name='point_id', field=models.AutoField(primary_key=True, serialize=False, unique=True), ), migrations.AlterField( model_name='searcharea', name='to_10', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_20', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_30', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_40', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_50', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_60', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_70', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='searcharea', name='to_80', field=models.DecimalField(blank=True, decimal_places=10, max_digits=20, null=True), ), migrations.AlterField( model_name='site', name='locations', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='site', name='short', field=models.CharField(max_length=20, unique=True), ), migrations.AlterField( model_name='sizeclass', name='size_txt', field=models.CharField(max_length=50, unique=True), ), migrations.AlterField( model_name='status', name='status_txt', field=models.CharField(max_length=50, unique=True), ), migrations.AlterField( model_name='traptype', name='trap_type_text', field=models.CharField(max_length=200, unique=True), ), migrations.AlterField( model_name='weather', name='rain', field=models.CharField(max_length=200, unique=True), ), ]
34.03871
95
0.565959
508
5,276
5.690945
0.190945
0.087167
0.224836
0.260809
0.758907
0.758907
0.756832
0.751297
0.71982
0.71982
0
0.03501
0.317854
5,276
154
96
34.25974
0.768269
0.012889
0
0.678082
1
0
0.102594
0.008453
0
0
0
0
0
1
0
false
0
0.013699
0
0.034247
0
0
0
0
null
0
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
0574e482beb1a704aef1419c829e85f2cb15a529
17,562
py
Python
lang/python/github/com/metaprov/modelaapi/services/featurepipeline/v1/featurepipeline_pb2_grpc.py
metaprov/modeldapi
ee05693832051dcd990ee4f061715d7ae0787340
[ "Apache-2.0" ]
5
2022-02-18T03:40:10.000Z
2022-03-01T16:11:24.000Z
lang/python/github/com/metaprov/modelaapi/services/featurepipeline/v1/featurepipeline_pb2_grpc.py
metaprov/modeldapi
ee05693832051dcd990ee4f061715d7ae0787340
[ "Apache-2.0" ]
1
2022-01-07T19:59:25.000Z
2022-02-04T01:21:14.000Z
lang/python/github/com/metaprov/modelaapi/services/featurepipeline/v1/featurepipeline_pb2_grpc.py
metaprov/modeldapi
ee05693832051dcd990ee4f061715d7ae0787340
[ "Apache-2.0" ]
1
2022-03-25T10:21:43.000Z
2022-03-25T10:21:43.000Z
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from github.com.metaprov.modelaapi.services.featurepipeline.v1 import featurepipeline_pb2 as github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2 class FeaturePipelineServiceStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.ListFeaturePipelines = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/ListFeaturePipelines', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ListFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ListFeaturePipelineResponse.FromString, ) self.CreateFeaturePipeline = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/CreateFeaturePipeline', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.CreateFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.CreateFeaturePipelineResponse.FromString, ) self.GetFeaturePipeline = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/GetFeaturePipeline', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.GetFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.GetFeaturePipelineResponse.FromString, ) self.UpdateFeaturePipeline = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/UpdateFeaturePipeline', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.UpdateFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.UpdateFeaturePipelineResponse.FromString, ) self.DeleteFeaturePipeline = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/DeleteFeaturePipeline', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.DeleteFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.DeleteFeaturePipelineResponse.FromString, ) self.PauseFeaturePipeline = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/PauseFeaturePipeline', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.PauseFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.PauseFeaturePipelineResponse.FromString, ) self.ResumeFeaturePipeline = channel.unary_unary( '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/ResumeFeaturePipeline', request_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ResumeFeaturePipelineRequest.SerializeToString, response_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ResumeFeaturePipelineResponse.FromString, ) class FeaturePipelineServiceServicer(object): """Missing associated documentation comment in .proto file.""" def ListFeaturePipelines(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CreateFeaturePipeline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetFeaturePipeline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def UpdateFeaturePipeline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DeleteFeaturePipeline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PauseFeaturePipeline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ResumeFeaturePipeline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_FeaturePipelineServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'ListFeaturePipelines': grpc.unary_unary_rpc_method_handler( servicer.ListFeaturePipelines, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ListFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ListFeaturePipelineResponse.SerializeToString, ), 'CreateFeaturePipeline': grpc.unary_unary_rpc_method_handler( servicer.CreateFeaturePipeline, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.CreateFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.CreateFeaturePipelineResponse.SerializeToString, ), 'GetFeaturePipeline': grpc.unary_unary_rpc_method_handler( servicer.GetFeaturePipeline, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.GetFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.GetFeaturePipelineResponse.SerializeToString, ), 'UpdateFeaturePipeline': grpc.unary_unary_rpc_method_handler( servicer.UpdateFeaturePipeline, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.UpdateFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.UpdateFeaturePipelineResponse.SerializeToString, ), 'DeleteFeaturePipeline': grpc.unary_unary_rpc_method_handler( servicer.DeleteFeaturePipeline, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.DeleteFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.DeleteFeaturePipelineResponse.SerializeToString, ), 'PauseFeaturePipeline': grpc.unary_unary_rpc_method_handler( servicer.PauseFeaturePipeline, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.PauseFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.PauseFeaturePipelineResponse.SerializeToString, ), 'ResumeFeaturePipeline': grpc.unary_unary_rpc_method_handler( servicer.ResumeFeaturePipeline, request_deserializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ResumeFeaturePipelineRequest.FromString, response_serializer=github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ResumeFeaturePipelineResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class FeaturePipelineService(object): """Missing associated documentation comment in .proto file.""" @staticmethod def ListFeaturePipelines(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/ListFeaturePipelines', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ListFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ListFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CreateFeaturePipeline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/CreateFeaturePipeline', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.CreateFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.CreateFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetFeaturePipeline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/GetFeaturePipeline', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.GetFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.GetFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def UpdateFeaturePipeline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/UpdateFeaturePipeline', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.UpdateFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.UpdateFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DeleteFeaturePipeline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/DeleteFeaturePipeline', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.DeleteFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.DeleteFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PauseFeaturePipeline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/PauseFeaturePipeline', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.PauseFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.PauseFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ResumeFeaturePipeline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/github.com.metaprov.modelaapi.services.featurepipeline.v1.FeaturePipelineService/ResumeFeaturePipeline', github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ResumeFeaturePipelineRequest.SerializeToString, github_dot_com_dot_metaprov_dot_modelaapi_dot_services_dot_featurepipeline_dot_v1_dot_featurepipeline__pb2.ResumeFeaturePipelineResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
66.271698
199
0.765687
1,673
17,562
7.530783
0.069337
0.122867
0.040956
0.051195
0.890547
0.890547
0.890547
0.865386
0.855306
0.823716
0
0.007145
0.179137
17,562
264
200
66.522727
0.866815
0.045553
0
0.504505
1
0
0.118501
0.095712
0
0
0
0
0
1
0.072072
false
0
0.009009
0.031532
0.126126
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
0581f2c6c726ab0e477b48cb5c34c5d3747db7dd
141
py
Python
skypy/halo/tests/test_import.py
ArthurTolley/skypy
5621877ada75c667b1af7e665b02a91026f7ef0f
[ "BSD-3-Clause" ]
1
2020-12-28T18:00:24.000Z
2020-12-28T18:00:24.000Z
skypy/halo/tests/test_import.py
ArthurTolley/skypy
5621877ada75c667b1af7e665b02a91026f7ef0f
[ "BSD-3-Clause" ]
2
2020-12-28T20:14:40.000Z
2020-12-28T21:49:27.000Z
skypy/halo/tests/test_import.py
ArthurTolley/skypy
5621877ada75c667b1af7e665b02a91026f7ef0f
[ "BSD-3-Clause" ]
null
null
null
def test_import(): import skypy.halo import skypy.halo.abundance_matching import skypy.halo.mass import skypy.halo.quenching
23.5
40
0.744681
19
141
5.421053
0.473684
0.427184
0.582524
0
0
0
0
0
0
0
0
0
0.184397
141
5
41
28.2
0.895652
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
true
0
1
0
1.2
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
55326e07f4d8b0c8a6ba8dc81c872fd349624724
50,551
py
Python
python-client/swagger_client/apis/collections_api.py
gabisurita/kinto-codegen-tutorial
b5921ec603df031f9ff25683b7a3fbed5af79094
[ "MIT" ]
2
2017-03-02T13:12:24.000Z
2017-10-22T10:31:09.000Z
python-client/swagger_client/apis/collections_api.py
gabisurita/kinto-codegen-tutorial
b5921ec603df031f9ff25683b7a3fbed5af79094
[ "MIT" ]
null
null
null
python-client/swagger_client/apis/collections_api.py
gabisurita/kinto-codegen-tutorial
b5921ec603df031f9ff25683b7a3fbed5af79094
[ "MIT" ]
null
null
null
# coding: utf-8 """ kinto Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch operations). 2. [Filtering](http://kinto.readthedocs.io/en/stable/api/1.x/filtering.html) is supported on any field by using `?{prefix}{field_name}={value}`. 3. [Backoff headers](http://kinto.readthedocs.io/en/stable/api/1.x/backoff.html) may occur with any response, but they are only present if the server is under in heavy load, so we cannot validate them on every request. They are listed only on the default error message. 4. [Collection schemas](http://kinto.readthedocs.io/en/stable/api/1.x/collections.html#collection-json-schema) can be provided when defining a collection, but they are not validated by this specification. OpenAPI spec version: 1.13 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from __future__ import absolute_import import sys import os import re # python 2 and python 3 compatibility library from six import iteritems from ..configuration import Configuration from ..api_client import ApiClient class CollectionsApi(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): config = Configuration() if api_client: self.api_client = api_client else: if not config.api_client: config.api_client = ApiClient() self.api_client = config.api_client def create_collection(self, bucket_id, **kwargs): """ Create a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.create_collection(bucket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param Collection collection: Collection information. :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :return: Collection If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.create_collection_with_http_info(bucket_id, **kwargs) else: (data) = self.create_collection_with_http_info(bucket_id, **kwargs) return data def create_collection_with_http_info(self, bucket_id, **kwargs): """ Create a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.create_collection_with_http_info(bucket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param Collection collection: Collection information. :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :return: Collection If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'collection', 'if_match', 'if_none_match'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_collection" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `create_collection`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `create_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `create_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] query_params = {} header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None if 'collection' in params: body_params = params['collection'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Collection', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_collection(self, bucket_id, collection_id, **kwargs): """ Delete a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.delete_collection(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Deleted If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs) else: (data) = self.delete_collection_with_http_info(bucket_id, collection_id, **kwargs) return data def delete_collection_with_http_info(self, bucket_id, collection_id, **kwargs): """ Delete a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.delete_collection_with_http_info(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Deleted If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_collection" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `delete_collection`") # verify the required parameter 'collection_id' is set if ('collection_id' not in params) or (params['collection_id'] is None): raise ValueError("Missing the required parameter `collection_id` when calling `delete_collection`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `delete_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] if 'collection_id' in params: path_params['collection_id'] = params['collection_id'] query_params = {} if 'fields' in params: query_params['_fields'] = params['fields'] collection_formats['_fields'] = 'csv' header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Deleted', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_collections(self, bucket_id, **kwargs): """ Delete writable collections. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.delete_collections(bucket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param int since: Get entries after a timestamp. :param int before: Get entries before a timestamp. :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending). :return: List If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.delete_collections_with_http_info(bucket_id, **kwargs) else: (data) = self.delete_collections_with_http_info(bucket_id, **kwargs) return data def delete_collections_with_http_info(self, bucket_id, **kwargs): """ Delete writable collections. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.delete_collections_with_http_info(bucket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param int since: Get entries after a timestamp. :param int before: Get entries before a timestamp. :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending). :return: List If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_collections" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `delete_collections`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `delete_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `delete_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] query_params = {} if 'since' in params: query_params['_since'] = params['since'] if 'before' in params: query_params['_before'] = params['before'] if 'sort' in params: query_params['_sort'] = params['sort'] collection_formats['_sort'] = 'csv' header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='List', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_collection(self, bucket_id, collection_id, **kwargs): """ Retreive an existing collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.get_collection(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Collection If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_collection_with_http_info(bucket_id, collection_id, **kwargs) else: (data) = self.get_collection_with_http_info(bucket_id, collection_id, **kwargs) return data def get_collection_with_http_info(self, bucket_id, collection_id, **kwargs): """ Retreive an existing collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.get_collection_with_http_info(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Collection If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'collection_id', 'if_match', 'if_none_match', 'fields'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_collection" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `get_collection`") # verify the required parameter 'collection_id' is set if ('collection_id' not in params) or (params['collection_id'] is None): raise ValueError("Missing the required parameter `collection_id` when calling `get_collection`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `get_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `get_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] if 'collection_id' in params: path_params['collection_id'] = params['collection_id'] query_params = {} if 'fields' in params: query_params['_fields'] = params['fields'] collection_formats['_fields'] = 'csv' header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Collection', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_collections(self, bucket_id, **kwargs): """ List bucket’s collections. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.get_collections(bucket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param int since: Get entries after a timestamp. :param int before: Get entries before a timestamp. :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending). :param int limit: Limit objects on a list. :param str token: Continuation token of a limited list. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: List If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.get_collections_with_http_info(bucket_id, **kwargs) else: (data) = self.get_collections_with_http_info(bucket_id, **kwargs) return data def get_collections_with_http_info(self, bucket_id, **kwargs): """ List bucket’s collections. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.get_collections_with_http_info(bucket_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param int since: Get entries after a timestamp. :param int before: Get entries before a timestamp. :param list[str] sort: Comma separeted list of fields to sort ascending on a list (use -field to sort descending). :param int limit: Limit objects on a list. :param str token: Continuation token of a limited list. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: List If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'if_match', 'if_none_match', 'since', 'before', 'sort', 'limit', 'token', 'fields'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_collections" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `get_collections`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `get_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `get_collections`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] query_params = {} if 'since' in params: query_params['_since'] = params['since'] if 'before' in params: query_params['_before'] = params['before'] if 'sort' in params: query_params['_sort'] = params['sort'] collection_formats['_sort'] = 'csv' if 'limit' in params: query_params['_limit'] = params['limit'] if 'token' in params: query_params['_token'] = params['token'] if 'fields' in params: query_params['_fields'] = params['fields'] collection_formats['_fields'] = 'csv' header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='List', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def patch_collection(self, bucket_id, collection_id, **kwargs): """ Modify an existing collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.patch_collection(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param Collection collection: Collection information. :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Collection If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.patch_collection_with_http_info(bucket_id, collection_id, **kwargs) else: (data) = self.patch_collection_with_http_info(bucket_id, collection_id, **kwargs) return data def patch_collection_with_http_info(self, bucket_id, collection_id, **kwargs): """ Modify an existing collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.patch_collection_with_http_info(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param Collection collection: Collection information. :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Collection If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'collection_id', 'collection', 'if_match', 'if_none_match', 'fields'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method patch_collection" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `patch_collection`") # verify the required parameter 'collection_id' is set if ('collection_id' not in params) or (params['collection_id'] is None): raise ValueError("Missing the required parameter `collection_id` when calling `patch_collection`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `patch_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `patch_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] if 'collection_id' in params: path_params['collection_id'] = params['collection_id'] query_params = {} if 'fields' in params: query_params['_fields'] = params['fields'] collection_formats['_fields'] = 'csv' header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None if 'collection' in params: body_params = params['collection'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json', 'application/merge-patch+json', 'application/json-patch+json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Collection', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_collection(self, bucket_id, collection_id, **kwargs): """ Create or replace a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.update_collection(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param Collection collection: Collection information. :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Collection If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.update_collection_with_http_info(bucket_id, collection_id, **kwargs) else: (data) = self.update_collection_with_http_info(bucket_id, collection_id, **kwargs) return data def update_collection_with_http_info(self, bucket_id, collection_id, **kwargs): """ Create or replace a collection. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.update_collection_with_http_info(bucket_id, collection_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str bucket_id: Bucket id. (required) :param str collection_id: Colection id. (required) :param Collection collection: Collection information. :param str if_match: Provide a timestamp to see if a resource has changed, avoid changes and returns 412 if it does. :param str if_none_match: Provide a timestamp to see if a resource has changed, avoid overwriting objects with the same id if it does. Returns 304 with empty body if nothing has changed. :param list[str] fields: Fields to compose response (id and last_modified are always returned). :return: Collection If the method is called asynchronously, returns the request thread. """ all_params = ['bucket_id', 'collection_id', 'collection', 'if_match', 'if_none_match', 'fields'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_collection" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'bucket_id' is set if ('bucket_id' not in params) or (params['bucket_id'] is None): raise ValueError("Missing the required parameter `bucket_id` when calling `update_collection`") # verify the required parameter 'collection_id' is set if ('collection_id' not in params) or (params['collection_id'] is None): raise ValueError("Missing the required parameter `collection_id` when calling `update_collection`") if 'if_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_match']): raise ValueError("Invalid value for parameter `if_match` when calling `update_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") if 'if_none_match' in params and not re.search('\\\"[0-9]+\\\"', params['if_none_match']): raise ValueError("Invalid value for parameter `if_none_match` when calling `update_collection`, must conform to the pattern `/\\\"[0-9]+\\\"/`") collection_formats = {} resource_path = '/buckets/{bucket_id}/collections/{collection_id}'.replace('{format}', 'json') path_params = {} if 'bucket_id' in params: path_params['bucket_id'] = params['bucket_id'] if 'collection_id' in params: path_params['collection_id'] = params['collection_id'] query_params = {} if 'fields' in params: query_params['_fields'] = params['fields'] collection_formats['_fields'] = 'csv' header_params = {} if 'if_match' in params: header_params['If-Match'] = params['if_match'] if 'if_none_match' in params: header_params['If-None-Match'] = params['if_none_match'] form_params = [] local_var_files = {} body_params = None if 'collection' in params: body_params = params['collection'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] return self.api_client.call_api(resource_path, 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Collection', auth_settings=auth_settings, callback=params.get('callback'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
49.559804
938
0.600443
5,763
50,551
5.069929
0.05275
0.036416
0.023718
0.021083
0.94257
0.938531
0.937915
0.932576
0.931001
0.923369
0
0.004505
0.310558
50,551
1,019
939
49.60844
0.83384
0.359597
0
0.816406
0
0
0.242275
0.028418
0
0
0
0
0
1
0.029297
false
0
0.013672
0
0.085938
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
555d8ca0af5dc276805aeeae799af7fd07c88706
47,386
py
Python
datasets/the_general_index/pipelines/the_general_index/the_general_index_dag.py
alick-at-looker/public-datasets-pipelines
9809935936866332e425f278ec97b935bdf4a65d
[ "Apache-2.0" ]
null
null
null
datasets/the_general_index/pipelines/the_general_index/the_general_index_dag.py
alick-at-looker/public-datasets-pipelines
9809935936866332e425f278ec97b935bdf4a65d
[ "Apache-2.0" ]
null
null
null
datasets/the_general_index/pipelines/the_general_index/the_general_index_dag.py
alick-at-looker/public-datasets-pipelines
9809935936866332e425f278ec97b935bdf4a65d
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from airflow import DAG from airflow.providers.google.cloud.operators import kubernetes_engine default_args = { "owner": "Google", "depends_on_past": False, "start_date": "2021-03-01", } with DAG( dag_id="the_general_index.the_general_index", default_args=default_args, max_active_runs=1, schedule_interval="@weekly", catchup=False, default_view="graph", ) as dag: create_cluster = kubernetes_engine.GKECreateClusterOperator( task_id="create_cluster", project_id="{{ var.value.gcp_project }}", location="us-central1-c", body={ "name": "the-general-index", "initial_node_count": 8, "network": "{{ var.value.vpc_network }}", "node_config": { "machine_type": "e2-standard-16", "oauth_scopes": [ "https://www.googleapis.com/auth/devstorage.read_write", "https://www.googleapis.com/auth/cloud-platform", ], }, }, ) # Run The General Index Pipeline transform_csv_dump_0 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_0", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_0.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_0.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_0.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_0.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_0.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_1 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_1", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_1.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_1.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_1.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_1.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_1.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_2 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_2", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_2.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_2.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_2.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_2.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_2.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_3 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_3", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_3.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_3.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_3.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_3.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_3.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_4 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_4", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_4.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_4.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_4.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_4.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_4.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_5 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_5", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_5.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_5.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_5.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_5.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_5.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_6 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_6", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_6.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_6.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_6.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_6.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_6.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_7 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_7", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_7.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_7.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_7.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_7.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_7.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_8 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_8", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_8.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_8.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_8.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_8.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_8.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_9 = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_9", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_9.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_9.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_9.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_9.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_9.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_a = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_a", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_a.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_a.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_a.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_a.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_a.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_b = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_b", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_b.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_b.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_b.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_b.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_b.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_c = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_c", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_c.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_c.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_c.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_c.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_c.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_d = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_d", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_d.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_d.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_d.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_d.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_d.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_e = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_e", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_e.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_e.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_e.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_e.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_e.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) # Run The General Index Pipeline transform_csv_dump_f = kubernetes_engine.GKEStartPodOperator( task_id="transform_csv_dump_f", name="the_general_index", project_id="{{ var.value.gcp_project }}", location="us-central1-c", cluster_name="the-general-index", namespace="default", image_pull_policy="Always", image="{{ var.json.the_general_index.container_registry.run_csv_transform_kub }}", env_vars={ "PROJECT_ID": "{{ var.value.gcp_project }}", "TARGET_GCS_BUCKET": "{{ var.value.composer_bucket }}", "CHUNKSIZE": "{{ var.json.the_general_index.chunksize }}", "DATASET_ID": "{{ var.json.the_general_index.dataset_id }}", "TABLE_ID": "{{ var.json.the_general_index.destination_table }}", "SCHEMA_PATH": "{{ var.json.the_general_index.schema_path }}", "SOURCE_FILE_HEADER_ROWS": "{{ var.json.the_general_index.source_file_header_rows }}", "SOURCE_FILE_FOOTER_ROWS": "{{ var.json.the_general_index.source_file_footer_rows }}", "PIPELINE_NAME": "{{ var.json.the_general_index.dump_f.pipeline_name }}", "SOURCE_URL": "{{ var.json.the_general_index.dump_f.source_url }}", "SOURCE_FILE": "{{ var.json.the_general_index.dump_f.source_file }}", "TARGET_FILE": "{{ var.json.the_general_index.dump_f.target_file }}", "TARGET_GCS_PATH": "{{ var.json.the_general_index.dump_f.target_gcs_path }}", "INPUT_CSV_HEADERS": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', "DATA_DTYPES": '{\n "dkey": "str",\n "raw_id": "str",\n "meta_key": "str",\n "doc_doi": "str",\n "meta_doi": "str",\n "doi": "str",\n "doi_flag": "str",\n "isbn": "str",\n "journal": "str",\n "doc_title": "str",\n "meta_title": "str",\n "title": "str",\n "doc_pub_date": "str",\n "meta_pub_date": "str",\n "pub_date": "str",\n "doc_author": "str",\n "meta_author": "str",\n "author": "str",\n "doc_size": "str",\n "insert_date": "str",\n "multi_row_flag": "str"\n}', "DATETIME_LIST": '[\n "insert_date"\n]', "NULL_STRING_LIST": '[\n "dkey",\n "raw_id",\n "meta_key",\n "doc_doi",\n "meta_doi",\n "doi",\n "doi_flag",\n "isbn",\n "journal",\n "doc_title",\n "meta_title",\n "title",\n "doc_pub_date",\n "meta_pub_date",\n "pub_date",\n "doc_author",\n "meta_author",\n "author",\n "doc_size",\n "insert_date",\n "multi_row_flag"\n]', }, ) delete_cluster = kubernetes_engine.GKEDeleteClusterOperator( task_id="delete_cluster", project_id="{{ var.value.gcp_project }}", location="us-central1-c", name="the_general_index", ) ( create_cluster >> [ transform_csv_dump_0, transform_csv_dump_1, transform_csv_dump_2, transform_csv_dump_3, transform_csv_dump_4, transform_csv_dump_5, transform_csv_dump_6, transform_csv_dump_7, transform_csv_dump_8, transform_csv_dump_9, transform_csv_dump_a, transform_csv_dump_b, transform_csv_dump_c, transform_csv_dump_d, transform_csv_dump_e, transform_csv_dump_f, ] >> delete_cluster )
82.267361
499
0.604841
6,772
47,386
3.876846
0.029681
0.051192
0.139407
0.124324
0.950103
0.947437
0.947437
0.946827
0.908052
0.908052
0
0.003115
0.19377
47,386
575
500
82.410435
0.684091
0.022032
0
0.620229
0
0.091603
0.752613
0.231862
0
0
0
0
0
1
0
false
0
0.003817
0
0.003817
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
559e16c911748fe3a48faa9ee6f532a6973f09e1
5,875
py
Python
tests/test_migration_functions.py
alan-eu/postgresql-audit
ae470f22d8f810dc286e246f9b529e1065758dd0
[ "BSD-2-Clause" ]
96
2015-02-17T11:44:54.000Z
2022-02-10T22:32:48.000Z
tests/test_migration_functions.py
alan-eu/postgresql-audit
ae470f22d8f810dc286e246f9b529e1065758dd0
[ "BSD-2-Clause" ]
45
2015-03-12T20:21:29.000Z
2022-02-25T03:48:11.000Z
tests/test_migration_functions.py
alan-eu/postgresql-audit
ae470f22d8f810dc286e246f9b529e1065758dd0
[ "BSD-2-Clause" ]
31
2015-03-12T15:55:50.000Z
2022-01-21T12:27:51.000Z
import pytest import sqlalchemy as sa from postgresql_audit import ( add_column, alter_column, change_column_name, remove_column, rename_table ) from .utils import last_activity @pytest.mark.usefixtures('activity_cls', 'table_creator') class TestRenameTable(object): def test_only_updates_given_table( self, session, article, user, connection, versioning_manager ): rename_table(connection, 'user', 'user2') activity = session.query(versioning_manager.activity_cls).filter_by( table_name='article' ).one() assert activity def test_updates_table_name(self, session, user, connection): rename_table(connection, 'user', 'user2') activity = last_activity(connection) assert activity['table_name'] == 'user2' @pytest.mark.usefixtures('activity_cls', 'table_creator') class TestChangeColumnName(object): def test_only_updates_given_table( self, session, article, user, connection, versioning_manager ): change_column_name(connection, 'user', 'name', 'some_name') activity = session.query(versioning_manager.activity_cls).filter_by( table_name='article' ).one() assert 'name' in activity.changed_data def test_updates_changed_data(self, session, user, connection): change_column_name(connection, 'user', 'name', 'some_name') activity = last_activity(connection) assert activity['changed_data'] == { 'id': user.id, 'some_name': 'John', 'age': 15 } def test_updates_old_data(self, session, user, connection): user.name = 'Luke' session.commit() change_column_name(connection, 'user', 'name', 'some_name') activity = last_activity(connection) assert activity['old_data'] == { 'id': user.id, 'some_name': 'John', 'age': 15 } @pytest.mark.usefixtures('activity_cls', 'table_creator') class TestRemoveColumn(object): def test_only_updates_given_table( self, session, article, user, connection, versioning_manager ): remove_column(connection, 'user', 'name') activity = session.query(versioning_manager.activity_cls).filter_by( table_name='article' ).one() assert 'name' in activity.changed_data def test_updates_changed_data(self, session, user, connection): remove_column(connection, 'user', 'name') activity = last_activity(connection) assert activity['old_data'] == {} assert activity['changed_data'] == { 'id': user.id, 'age': 15 } def test_updates_old_data(self, session, user, connection): user.name = 'Luke' session.commit() remove_column(connection, 'user', 'name') activity = last_activity(connection) assert activity['old_data'] == { 'id': user.id, 'age': 15 } @pytest.mark.usefixtures('activity_cls', 'table_creator') class TestAddColumn(object): def test_only_updates_given_table( self, session, article, user, connection, versioning_manager ): add_column(connection, 'user', 'some_column') activity = session.query(versioning_manager.activity_cls).filter_by( table_name='article' ).one() assert 'some_column' not in activity.changed_data def test_updates_changed_data(self, session, user, connection): add_column(connection, 'user', 'some_column') activity = last_activity(connection) assert activity['old_data'] == {} assert activity['changed_data'] == { 'id': user.id, 'age': 15, 'name': 'John', 'some_column': None } def test_updates_old_data(self, session, user, connection): user.name = 'Luke' session.commit() add_column(connection, 'user', 'some_column') activity = last_activity(connection) assert activity['old_data'] == { 'id': user.id, 'age': 15, 'name': 'John', 'some_column': None } assert activity['changed_data'] == {'name': 'Luke'} @pytest.mark.usefixtures('activity_cls', 'table_creator') class TestAlterColumn(object): def test_only_updates_given_table( self, session, article, user, connection, versioning_manager ): alter_column( connection, 'user', 'id', lambda value, activity_table: sa.cast(value, sa.Text) ) activity = session.query(versioning_manager.activity_cls).filter_by( table_name='article' ).one() assert isinstance(activity.changed_data['id'], int) def test_updates_changed_data(self, session, user, connection): alter_column( connection, 'user', 'id', lambda value, activity_table: sa.cast(value, sa.Text) ) activity = last_activity(connection) assert activity['changed_data'] == { 'id': str(user.id), 'age': 15, 'name': 'John' } def test_updates_old_data(self, session, user, connection): user.name = 'Luke' session.commit() alter_column( connection, 'user', 'id', lambda value, activity_table: sa.cast(value, sa.Text) ) activity = last_activity(connection) assert activity['old_data'] == { 'id': str(user.id), 'age': 15, 'name': 'John' }
29.228856
76
0.582298
594
5,875
5.513468
0.114478
0.076947
0.054962
0.068702
0.886412
0.886412
0.846718
0.836641
0.791756
0.731603
0
0.004649
0.30434
5,875
200
77
29.375
0.796672
0
0
0.821229
0
0
0.102809
0
0
0
0
0
0.094972
1
0.078212
false
0
0.022346
0
0.128492
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
75777d14aec8ea859b08a349b625c2c5053b7f96
152
py
Python
logdecorator/__init__.py
Antyos/logdecorator
d814d5669fa19c72da85e34ecd067701b7541a19
[ "MIT" ]
46
2017-06-07T16:07:22.000Z
2022-02-01T10:19:58.000Z
logdecorator/__init__.py
Antyos/logdecorator
d814d5669fa19c72da85e34ecd067701b7541a19
[ "MIT" ]
16
2017-06-12T06:31:01.000Z
2021-09-24T23:04:38.000Z
logdecorator/__init__.py
Antyos/logdecorator
d814d5669fa19c72da85e34ecd067701b7541a19
[ "MIT" ]
8
2019-04-22T13:53:01.000Z
2021-10-14T01:50:43.000Z
from .decorator import log_on_start, log_on_error, log_on_end, log_exception __all__ = ["log_on_start", "log_on_error", "log_on_end", "log_exception"]
38
76
0.789474
26
152
3.923077
0.384615
0.294118
0.196078
0.254902
0.784314
0.784314
0.784314
0.784314
0.784314
0.784314
0
0
0.092105
152
3
77
50.666667
0.73913
0
0
0
0
0
0.309211
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
1
0
1
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
11
75b12d4a7f5caca7064125b46da39688a81ee5d8
1,643
py
Python
mirtorch/dic/util.py
guanhuaw/MIRTorch
535690946d1f105c6d3532c9fbc68cd78307e945
[ "BSD-3-Clause" ]
38
2021-03-07T21:51:51.000Z
2022-03-29T09:32:52.000Z
mirtorch/dic/util.py
guanhuaw/MIRTorch
535690946d1f105c6d3532c9fbc68cd78307e945
[ "BSD-3-Clause" ]
2
2021-09-17T19:52:50.000Z
2022-03-29T09:32:42.000Z
mirtorch/dic/util.py
guanhuaw/MIRTorch
535690946d1f105c6d3532c9fbc68cd78307e945
[ "BSD-3-Clause" ]
null
null
null
import numpy as np from scipy.fft import dct, idct import math def idct_basis_2d(len_basis, num_basis): ''' Generate basic 2D DCT basis for dictionary learning Inputs: len_basis: length of the flattened atom, e.g. 36 for 6x6 basis num_basis: number of the atoms. usually it is overcomplete (larger than len_basis) Returns: DCT basis in [len_basis, num_basis] ''' assert len_basis <= num_basis, 'should be over-complete dictionary' ODCT = idct(np.identity(math.ceil(num_basis ** 0.5)), norm='ortho', axis=0) ODCT = ODCT[:math.ceil(len_basis ** 0.5), :] ODCT = np.kron(ODCT, ODCT) ODCT = np.column_stack((ODCT[:, 0], ODCT[:, 1:] - np.mean(ODCT[:, 1:], axis=0))) ODCT = ODCT / np.linalg.norm(ODCT, axis=0) ODCT = ODCT[:, :num_basis] return ODCT def idct_basis_3d(len_basis, num_basis): ''' Generate basic 3D DCT basis for dictionary learning Inputs: len_basis: length of the flattened atom, e.g. 216 for 6x6x6 basis num_basis: number of the atoms. usually it is overcomplete (larger than len_basis) Returns: DCT basis in [len_basis, num_basis] ''' assert len_basis <= num_basis, 'should be over-complete dictionary' ODCT = idct(np.identity(math.ceil(num_basis ** (1 / 3))), norm='ortho', axis=0) ODCT = ODCT[:math.ceil(len_basis ** (1 / 3)), :] ODCT = np.kron(ODCT, np.kron(ODCT, ODCT)) ODCT = np.column_stack((ODCT[:, 0], ODCT[:, 1:] - np.mean(ODCT[:, 1:], axis=0))) ODCT = ODCT / np.linalg.norm(ODCT, axis=0) ODCT = ODCT[:, :num_basis] return ODCT
39.119048
94
0.627511
249
1,643
4.02008
0.257028
0.095904
0.103896
0.095904
0.881119
0.881119
0.823177
0.823177
0.823177
0.823177
0
0.027178
0.238588
1,643
41
95
40.073171
0.772982
0.345709
0
0.47619
1
0
0.077689
0
0
0
0
0
0.095238
1
0.095238
false
0
0.142857
0
0.333333
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
f96aae2705eb923541296ec900bb25e5281c90af
1,709
py
Python
tests/call_error_test.py
schlueter/mitogen
76102927c81d5dfcc6c91565b2984f24dd3ee678
[ "BSD-3-Clause" ]
null
null
null
tests/call_error_test.py
schlueter/mitogen
76102927c81d5dfcc6c91565b2984f24dd3ee678
[ "BSD-3-Clause" ]
null
null
null
tests/call_error_test.py
schlueter/mitogen
76102927c81d5dfcc6c91565b2984f24dd3ee678
[ "BSD-3-Clause" ]
null
null
null
import os import pickle import unittest2 import mitogen.core class ConstructorTest(unittest2.TestCase): klass = mitogen.core.CallError def test_string_noargs(self): e = self.klass('%s%s') self.assertEquals(e[0], '%s%s') def test_string_args(self): e = self.klass('%s%s', 1, 1) self.assertEquals(e[0], '11') def test_from_exc(self): ve = ValueError('eek') e = self.klass(ve) self.assertEquals(e[0], 'exceptions.ValueError: eek') def test_from_exc_tb(self): try: raise ValueError('eek') except ValueError, ve: e = self.klass(ve) self.assertTrue(e[0].startswith('exceptions.ValueError: eek')) self.assertTrue('test_from_exc_tb' in e[0]) class PickleTest(unittest2.TestCase): klass = mitogen.core.CallError def test_string_noargs(self): e = self.klass('%s%s') e2 = pickle.loads(pickle.dumps(e)) self.assertEquals(e2[0], '%s%s') def test_string_args(self): e = self.klass('%s%s', 1, 1) e2 = pickle.loads(pickle.dumps(e)) self.assertEquals(e2[0], '11') def test_from_exc(self): ve = ValueError('eek') e = self.klass(ve) e2 = pickle.loads(pickle.dumps(e)) self.assertEquals(e2[0], 'exceptions.ValueError: eek') def test_from_exc_tb(self): try: raise ValueError('eek') except ValueError, ve: e = self.klass(ve) e2 = pickle.loads(pickle.dumps(e)) self.assertTrue(e2[0].startswith('exceptions.ValueError: eek')) self.assertTrue('test_from_exc_tb' in e2[0]) if __name__ == '__main__': unittest2.main()
25.507463
71
0.599766
226
1,709
4.393805
0.190265
0.060423
0.080564
0.056395
0.813696
0.805639
0.805639
0.805639
0.805639
0.805639
0
0.024409
0.256875
1,709
66
72
25.893939
0.75748
0
0
0.625
0
0
0.107665
0.051492
0
0
0
0
0.208333
0
null
null
0
0.083333
null
null
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
7
ddf48fd099d7734dad96e556a95b4fd338f26308
3,321
py
Python
scripts/script_utils/test/test_changelog.py
Staberinde/data-hub-api
3d0467dbceaf62a47158eea412a3dba827073300
[ "MIT" ]
6
2019-12-02T16:11:24.000Z
2022-03-18T10:02:02.000Z
scripts/script_utils/test/test_changelog.py
Staberinde/data-hub-api
3d0467dbceaf62a47158eea412a3dba827073300
[ "MIT" ]
1,696
2019-10-31T14:08:37.000Z
2022-03-29T12:35:57.000Z
scripts/script_utils/test/test_changelog.py
Staberinde/data-hub-api
3d0467dbceaf62a47158eea412a3dba827073300
[ "MIT" ]
9
2019-11-22T12:42:03.000Z
2021-09-03T14:25:05.000Z
import pytest from script_utils.changelog import extract_version_changelog CHANGELOG_CONTENT = """# Data Hub API 24.0.0 (2019-12-10) ## Features - **Companies** A setting `DNB_AUTOMATIC_UPDATE_LIMIT` was added which can be used to limit the number of companies updated by the `datahub.dnb_api.tasks.get_company_updates` task. ## Bug fixes - **Companies** A bug was fixed to ensure that DNB company updates can be ingested over multiple pages from dnb-service. Previously, the cursor value was not being extracted from the URL for the next page correctly. # Data Hub API 23.2.0 (2019-12-02) ## Bug fixes - **Companies** Merging two companies (via the admin site) now works when both companies are on the same company list. ## API - **Investment** `GET /v4/dataset/investment-projects-dataset`: The `competing_countries` field was updated to return country names rather than ids - **OMIS** `GET /v4/dataset/omis-dataset`: The field `quote__accepted_on` was added to the omis dataset endpoint # Data Hub API 23.1.0 (2019-11-28) ## Removals - The `init_es` management command has been removed. Please use `migrate_es` instead. ## Features - The `migrate_es` management command was updated to handle the case when indexes don‘t already exist. Hence, the `init_es` command is no longer required and has been removed. """ V24_0_0_EXPECTED = """## Features - **Companies** A setting `DNB_AUTOMATIC_UPDATE_LIMIT` was added which can be used to limit the number of companies updated by the `datahub.dnb_api.tasks.get_company_updates` task. ## Bug fixes - **Companies** A bug was fixed to ensure that DNB company updates can be ingested over multiple pages from dnb-service. Previously, the cursor value was not being extracted from the URL for the next page correctly.""" V23_2_0_EXPECTED = """## Bug fixes - **Companies** Merging two companies (via the admin site) now works when both companies are on the same company list. ## API - **Investment** `GET /v4/dataset/investment-projects-dataset`: The `competing_countries` field was updated to return country names rather than ids - **OMIS** `GET /v4/dataset/omis-dataset`: The field `quote__accepted_on` was added to the omis dataset endpoint""" V23_1_0_EXPECTED = """## Removals - The `init_es` management command has been removed. Please use `migrate_es` instead. ## Features - The `migrate_es` management command was updated to handle the case when indexes don‘t already exist. Hence, the `init_es` command is no longer required and has been removed.""" @pytest.mark.parametrize( 'version,expected_result', [ pytest.param( '9.9.9', None, id='no-match', ), pytest.param( '24.0.0', V24_0_0_EXPECTED, id='start-of-changelog', ), pytest.param( '23.2.0', V23_2_0_EXPECTED, id='middle-of-changelog', ), pytest.param( '23.1.0', V23_1_0_EXPECTED, id='end-of-changelog', ), ], ) def test_extract_version_changelog(version, expected_result): """Test extract_version_changelog() for various cases.""" assert extract_version_changelog(CHANGELOG_CONTENT, version) == expected_result
27.675
96
0.693165
477
3,321
4.698113
0.301887
0.024096
0.041053
0.028559
0.810353
0.754128
0.754128
0.754128
0.754128
0.754128
0
0.030164
0.211382
3,321
119
97
27.907563
0.825506
0.015357
0
0.545455
0
0.051948
0.7644
0.104473
0
0
0
0
0.012987
1
0.012987
false
0
0.025974
0
0.038961
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
ddf876eb8b4f45f5f1935a1b69a6a239f5bece01
22,064
py
Python
advent/day11/data.py
benjackwhite/adventofcode2017
ce29e625cbe11fd5f36cff6b36a879c6a3955581
[ "MIT" ]
null
null
null
advent/day11/data.py
benjackwhite/adventofcode2017
ce29e625cbe11fd5f36cff6b36a879c6a3955581
[ "MIT" ]
null
null
null
advent/day11/data.py
benjackwhite/adventofcode2017
ce29e625cbe11fd5f36cff6b36a879c6a3955581
[ "MIT" ]
null
null
null
data = """s,ne,ne,ne,se,se,se,s,s,s,s,s,s,s,sw,s,s,sw,sw,sw,sw,sw,sw,sw,n,s,ne,nw,nw,nw,nw,nw,se,nw,nw,nw,nw,ne,n,n,nw,nw,n,nw,n,n,nw,n,ne,nw,nw,n,n,n,n,n,s,n,n,n,n,n,n,n,ne,nw,n,nw,n,n,nw,n,n,n,n,se,n,nw,n,n,ne,s,nw,ne,ne,ne,n,ne,ne,ne,nw,sw,n,se,ne,n,ne,ne,nw,ne,ne,sw,se,ne,ne,ne,nw,ne,sw,ne,se,ne,ne,nw,se,ne,ne,ne,ne,ne,se,ne,ne,s,se,ne,s,ne,sw,ne,se,se,nw,se,ne,ne,se,ne,se,ne,se,se,se,se,se,se,se,s,ne,n,s,se,se,se,se,ne,se,se,se,nw,s,s,s,s,se,se,se,se,s,nw,s,se,s,s,s,s,s,sw,s,s,se,se,se,se,se,se,ne,ne,ne,s,ne,se,se,ne,s,ne,s,se,n,s,n,s,n,s,s,se,s,s,sw,s,s,sw,s,s,s,s,s,s,nw,s,s,s,ne,ne,s,n,ne,s,sw,s,sw,s,sw,s,s,s,sw,s,s,s,sw,s,s,sw,sw,s,s,sw,s,s,nw,sw,sw,sw,sw,ne,nw,s,s,nw,s,sw,s,sw,s,sw,sw,sw,sw,sw,s,s,sw,sw,n,s,s,sw,sw,s,s,sw,s,sw,sw,sw,s,s,sw,sw,s,sw,sw,sw,n,sw,ne,nw,s,sw,sw,s,sw,sw,nw,sw,sw,se,sw,ne,sw,sw,sw,sw,sw,sw,ne,n,s,sw,sw,sw,sw,nw,sw,sw,n,sw,sw,sw,sw,sw,sw,nw,sw,sw,sw,sw,sw,sw,sw,ne,ne,sw,s,sw,nw,nw,sw,nw,sw,ne,sw,sw,nw,sw,ne,nw,se,sw,sw,ne,sw,nw,sw,n,sw,nw,sw,nw,nw,sw,sw,sw,nw,ne,sw,nw,nw,sw,sw,sw,sw,n,sw,nw,sw,nw,sw,sw,sw,sw,n,nw,nw,nw,nw,nw,sw,sw,nw,se,se,nw,sw,nw,nw,nw,sw,nw,sw,ne,nw,nw,nw,nw,s,nw,sw,s,sw,se,sw,nw,sw,nw,sw,nw,nw,s,s,n,nw,sw,sw,nw,nw,sw,sw,nw,ne,sw,nw,se,nw,se,s,nw,nw,nw,n,nw,nw,sw,nw,ne,ne,nw,nw,nw,sw,nw,nw,se,se,nw,nw,nw,nw,sw,nw,nw,nw,nw,s,nw,nw,nw,nw,n,s,nw,nw,nw,n,nw,nw,nw,n,n,ne,nw,n,nw,nw,nw,nw,n,nw,nw,nw,nw,nw,ne,n,sw,sw,nw,nw,sw,se,nw,n,nw,sw,nw,s,nw,n,ne,nw,nw,nw,n,nw,s,n,nw,n,n,nw,n,se,n,nw,nw,n,nw,nw,ne,n,n,se,se,nw,nw,nw,sw,n,nw,sw,sw,nw,nw,s,n,nw,n,s,n,n,n,nw,nw,n,nw,sw,sw,n,sw,n,n,n,n,n,nw,nw,n,ne,n,ne,sw,n,n,n,nw,n,s,n,n,s,n,n,nw,nw,n,n,n,nw,nw,nw,n,nw,n,n,nw,se,n,nw,n,n,sw,n,n,n,n,nw,n,nw,n,n,se,n,n,n,n,n,n,nw,s,nw,n,n,nw,n,n,n,sw,n,se,nw,n,nw,n,n,n,n,n,n,n,sw,n,nw,n,n,n,n,n,n,se,n,se,n,n,n,n,n,n,nw,n,n,ne,n,n,n,n,sw,n,se,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,ne,n,n,n,n,n,n,n,n,n,ne,n,s,ne,nw,s,n,nw,n,n,n,sw,n,n,n,sw,se,ne,n,n,n,s,nw,n,se,n,n,s,sw,n,n,se,n,n,sw,n,n,n,ne,ne,ne,ne,n,n,se,sw,n,n,n,se,n,se,sw,nw,ne,n,n,n,n,nw,n,n,n,n,n,n,ne,n,nw,n,s,n,nw,nw,ne,ne,n,n,n,n,n,n,n,ne,n,n,n,n,n,ne,ne,n,ne,ne,n,n,n,ne,n,ne,n,n,n,n,ne,ne,n,s,ne,ne,n,n,s,n,ne,ne,ne,n,ne,nw,n,ne,n,ne,n,ne,ne,se,ne,s,ne,ne,n,n,ne,s,n,ne,s,n,ne,ne,ne,n,ne,s,se,se,ne,s,sw,ne,se,ne,ne,ne,n,ne,n,ne,n,nw,sw,ne,n,n,ne,ne,ne,ne,ne,se,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,s,ne,ne,ne,ne,s,ne,ne,sw,ne,ne,n,n,ne,ne,ne,ne,ne,n,ne,n,ne,ne,ne,ne,se,ne,ne,n,ne,ne,ne,n,sw,ne,ne,n,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,nw,ne,s,ne,ne,ne,ne,ne,ne,ne,sw,n,sw,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,ne,ne,ne,se,sw,ne,ne,ne,ne,se,ne,ne,s,ne,s,ne,se,nw,s,n,ne,ne,ne,ne,sw,ne,ne,se,ne,ne,ne,ne,ne,ne,se,ne,se,ne,ne,sw,nw,se,ne,ne,ne,ne,s,ne,n,ne,ne,nw,sw,ne,n,nw,ne,ne,se,ne,ne,ne,ne,se,ne,ne,sw,ne,s,s,se,n,ne,ne,ne,n,s,nw,ne,se,se,s,ne,se,sw,ne,ne,se,ne,ne,ne,ne,ne,ne,se,se,ne,ne,ne,se,ne,nw,ne,s,se,ne,sw,ne,ne,ne,ne,ne,ne,ne,nw,se,ne,n,s,ne,ne,ne,ne,ne,ne,ne,ne,se,se,ne,nw,ne,ne,sw,sw,ne,ne,sw,ne,se,ne,ne,ne,se,se,ne,ne,ne,ne,se,se,ne,ne,ne,ne,ne,se,ne,ne,s,se,ne,ne,se,ne,ne,ne,se,s,ne,se,se,ne,ne,ne,ne,sw,se,se,s,se,se,ne,ne,se,s,se,se,ne,ne,se,s,ne,se,ne,nw,se,ne,ne,se,se,se,sw,se,ne,se,se,se,ne,ne,se,se,ne,ne,ne,n,ne,ne,ne,nw,se,s,se,s,n,ne,ne,nw,ne,se,ne,ne,s,ne,ne,se,nw,ne,se,se,se,se,se,se,se,ne,se,se,ne,ne,se,se,se,se,n,ne,se,se,se,s,se,ne,ne,sw,se,ne,s,se,n,se,se,ne,ne,se,se,se,n,sw,ne,ne,se,ne,se,se,se,se,se,ne,sw,sw,se,se,ne,ne,se,se,se,se,se,nw,se,se,se,se,sw,se,s,se,sw,se,se,se,se,n,se,ne,s,se,ne,se,se,se,se,se,ne,ne,se,ne,ne,n,se,se,sw,se,se,nw,se,ne,n,se,n,se,sw,se,sw,se,se,se,nw,se,se,se,se,s,nw,sw,nw,se,se,se,ne,se,n,ne,se,se,se,se,se,se,se,se,se,se,nw,se,ne,se,se,se,nw,se,se,se,se,se,se,s,se,se,se,s,se,sw,nw,se,se,sw,se,se,se,se,se,n,se,se,se,se,ne,sw,se,se,sw,se,nw,n,ne,se,s,s,n,s,s,nw,se,ne,se,se,s,se,se,se,se,sw,se,se,se,se,s,se,se,se,se,se,se,se,se,se,se,se,se,s,se,n,n,se,se,se,se,ne,se,se,se,s,se,se,se,se,se,se,se,se,se,se,se,se,s,nw,se,se,s,se,s,se,s,se,se,se,s,se,se,se,se,se,se,n,ne,se,n,s,se,se,sw,nw,nw,se,se,se,se,se,s,se,ne,se,s,se,se,n,s,se,s,se,s,se,s,se,se,s,s,s,se,se,se,s,se,se,s,se,nw,ne,s,s,se,se,se,ne,se,se,s,se,se,se,se,se,nw,se,se,se,ne,se,s,se,se,se,se,se,se,s,s,se,s,nw,s,n,se,s,se,se,se,se,nw,s,se,s,s,se,se,se,ne,s,s,se,s,s,s,se,se,sw,s,se,se,sw,nw,s,s,se,se,se,se,se,ne,s,s,se,s,s,se,s,sw,sw,s,se,s,se,se,s,se,s,n,s,s,nw,nw,s,s,se,s,s,se,se,se,s,s,ne,se,se,n,ne,se,s,nw,s,se,s,s,n,se,se,ne,ne,se,s,s,se,se,se,se,se,se,se,s,se,s,se,s,se,se,s,sw,s,se,sw,se,s,s,n,s,s,s,s,nw,n,s,s,s,se,s,s,s,s,s,se,nw,s,se,s,s,nw,s,se,s,s,s,se,se,s,s,se,se,se,s,s,se,s,s,sw,se,se,se,s,se,se,n,s,s,s,se,s,s,nw,s,ne,nw,se,s,s,se,nw,se,ne,se,se,se,s,s,se,se,nw,se,n,se,s,sw,se,sw,s,se,s,s,se,s,se,s,s,se,s,s,n,s,se,se,s,s,s,s,s,s,sw,ne,s,s,s,s,se,s,se,s,se,s,se,s,s,se,se,s,s,s,s,s,se,nw,se,se,s,se,ne,s,s,nw,nw,s,s,s,se,ne,s,ne,s,s,s,sw,s,se,nw,s,nw,s,n,s,s,se,s,s,ne,se,s,s,s,se,s,s,se,s,nw,s,s,s,se,ne,n,se,s,s,s,n,s,nw,s,ne,s,s,nw,s,s,n,s,s,se,s,se,se,s,s,s,s,s,s,s,se,ne,s,ne,s,s,sw,s,s,s,s,n,s,s,s,s,sw,se,s,nw,ne,ne,s,s,se,s,s,s,s,s,ne,s,s,nw,sw,s,s,s,n,s,ne,se,s,se,s,s,s,s,s,sw,se,nw,s,s,s,s,s,s,s,s,ne,n,s,ne,s,s,s,s,nw,s,se,s,s,s,s,s,se,s,s,s,s,s,s,s,n,s,sw,s,s,s,s,s,se,s,s,sw,se,s,s,s,s,s,s,sw,s,s,s,s,s,s,s,s,s,ne,nw,nw,s,n,s,s,s,s,s,s,s,s,sw,s,s,n,s,s,nw,s,s,s,nw,s,sw,s,nw,s,s,s,s,sw,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,sw,s,sw,s,s,s,nw,sw,s,s,nw,s,s,se,nw,s,s,s,se,s,se,nw,ne,s,s,s,s,s,s,nw,s,s,s,sw,s,sw,s,s,s,s,s,s,sw,ne,sw,s,n,s,s,s,s,s,s,s,s,s,s,sw,s,s,s,s,s,s,s,sw,s,s,ne,s,s,s,s,s,sw,sw,s,s,s,s,s,s,n,sw,n,ne,s,s,s,nw,nw,s,se,ne,s,se,s,s,s,sw,n,s,s,s,nw,sw,s,sw,ne,s,s,s,s,sw,ne,s,s,s,s,s,sw,s,s,sw,s,s,s,s,s,s,s,sw,s,n,s,s,s,sw,s,s,n,sw,s,n,ne,nw,sw,s,s,sw,s,s,sw,s,n,s,s,sw,s,s,sw,s,se,s,sw,s,s,s,sw,s,s,s,s,sw,s,n,sw,s,s,s,sw,s,sw,s,sw,s,sw,s,s,sw,s,s,s,s,n,s,s,s,s,s,s,sw,s,s,sw,s,sw,s,s,s,s,n,s,sw,s,s,n,nw,s,s,nw,sw,s,sw,sw,s,sw,sw,s,s,sw,sw,nw,sw,nw,s,sw,se,sw,s,s,sw,sw,s,nw,s,s,se,s,s,s,sw,sw,sw,n,s,sw,s,sw,s,se,s,s,s,sw,sw,s,sw,nw,sw,s,s,sw,sw,s,sw,s,s,s,sw,sw,sw,sw,sw,s,s,ne,ne,s,s,sw,se,se,sw,se,nw,sw,sw,s,sw,ne,sw,sw,s,s,sw,nw,sw,s,sw,s,s,sw,s,sw,s,nw,se,s,s,s,sw,s,se,se,ne,sw,sw,sw,s,nw,s,s,n,sw,sw,s,sw,sw,s,sw,sw,s,s,sw,s,s,ne,s,sw,s,sw,sw,sw,n,s,sw,s,s,sw,sw,nw,n,sw,s,nw,s,s,sw,sw,sw,sw,sw,ne,sw,sw,sw,sw,s,s,sw,sw,sw,nw,s,s,s,sw,sw,se,sw,sw,s,s,sw,sw,ne,se,sw,se,sw,s,nw,n,ne,s,sw,se,s,sw,s,sw,s,sw,s,sw,ne,s,sw,n,sw,s,s,nw,sw,se,s,sw,sw,sw,sw,sw,sw,sw,ne,s,s,se,sw,sw,sw,sw,s,se,sw,sw,s,s,s,sw,nw,n,sw,sw,s,ne,s,sw,se,sw,sw,se,sw,sw,sw,s,s,s,s,sw,s,s,sw,se,s,sw,s,nw,s,sw,sw,s,sw,sw,sw,s,se,sw,sw,sw,sw,ne,sw,sw,sw,se,s,n,sw,se,s,sw,n,sw,sw,se,sw,s,s,sw,sw,s,sw,ne,nw,sw,s,sw,sw,s,s,sw,sw,s,sw,sw,sw,sw,sw,sw,s,sw,sw,se,sw,sw,s,sw,sw,se,sw,sw,s,ne,s,sw,ne,s,s,sw,sw,sw,s,sw,sw,sw,sw,sw,sw,sw,s,sw,ne,s,sw,sw,sw,sw,sw,sw,sw,s,n,ne,s,sw,sw,sw,sw,sw,sw,sw,s,nw,sw,sw,n,sw,sw,sw,s,sw,sw,sw,sw,sw,se,ne,sw,s,sw,ne,s,sw,sw,ne,sw,sw,s,n,sw,nw,sw,sw,ne,sw,sw,sw,sw,sw,s,sw,n,sw,sw,s,sw,n,s,s,s,sw,sw,s,sw,se,sw,ne,n,sw,sw,n,sw,s,sw,sw,sw,sw,sw,sw,s,sw,sw,s,s,sw,sw,sw,se,sw,nw,sw,sw,sw,sw,sw,se,sw,sw,sw,sw,sw,s,ne,sw,sw,sw,se,ne,sw,sw,s,sw,sw,ne,nw,s,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,se,sw,sw,ne,se,sw,sw,se,sw,ne,sw,se,sw,sw,sw,sw,sw,sw,sw,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,se,sw,sw,sw,ne,sw,sw,sw,nw,sw,n,sw,nw,s,n,n,se,sw,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,nw,sw,sw,se,sw,sw,sw,ne,sw,sw,sw,sw,sw,nw,nw,sw,sw,sw,sw,sw,sw,sw,n,sw,sw,sw,sw,sw,sw,nw,sw,ne,sw,ne,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,n,sw,nw,n,sw,sw,sw,sw,nw,ne,sw,sw,sw,sw,sw,n,sw,sw,sw,nw,nw,sw,sw,sw,ne,sw,sw,sw,nw,sw,sw,sw,ne,sw,ne,nw,sw,nw,s,sw,sw,sw,ne,nw,sw,s,nw,sw,sw,sw,sw,sw,sw,sw,sw,sw,ne,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,ne,n,sw,sw,sw,ne,sw,nw,se,nw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,sw,se,sw,sw,sw,nw,sw,sw,s,nw,ne,se,sw,sw,s,sw,sw,sw,se,sw,sw,nw,sw,sw,sw,sw,sw,sw,nw,sw,sw,n,sw,sw,sw,sw,nw,sw,se,sw,sw,sw,s,ne,n,sw,sw,sw,nw,sw,ne,sw,sw,sw,sw,sw,sw,sw,nw,sw,nw,sw,nw,s,sw,sw,sw,nw,nw,nw,sw,nw,sw,se,se,sw,sw,sw,sw,sw,sw,ne,nw,sw,sw,nw,nw,sw,sw,ne,sw,se,sw,sw,sw,sw,sw,nw,nw,s,nw,nw,sw,sw,sw,nw,sw,n,ne,s,sw,sw,sw,sw,sw,sw,sw,sw,sw,n,n,sw,sw,sw,sw,sw,n,nw,ne,nw,nw,ne,nw,nw,sw,sw,sw,sw,ne,nw,sw,sw,s,nw,nw,sw,nw,sw,se,sw,sw,nw,ne,sw,nw,nw,sw,sw,sw,sw,s,s,sw,sw,sw,sw,n,sw,nw,sw,sw,nw,sw,sw,ne,sw,sw,sw,ne,n,sw,sw,sw,n,nw,nw,sw,nw,nw,sw,sw,sw,sw,nw,sw,sw,sw,nw,sw,sw,sw,nw,nw,nw,nw,ne,s,sw,sw,sw,sw,nw,sw,sw,sw,sw,nw,nw,sw,sw,nw,nw,nw,sw,n,sw,nw,se,nw,s,sw,nw,sw,sw,sw,sw,nw,sw,n,nw,nw,nw,se,se,s,nw,sw,ne,sw,sw,nw,ne,s,sw,sw,nw,nw,nw,nw,nw,nw,nw,nw,sw,sw,nw,sw,nw,nw,sw,sw,sw,sw,nw,n,nw,sw,nw,sw,nw,ne,sw,se,nw,sw,n,sw,nw,sw,nw,sw,se,nw,nw,nw,sw,ne,nw,sw,s,nw,s,s,nw,nw,ne,ne,nw,sw,nw,sw,nw,sw,n,se,sw,sw,nw,sw,sw,s,nw,ne,ne,nw,sw,nw,nw,s,ne,nw,sw,sw,sw,sw,sw,sw,nw,ne,nw,nw,sw,nw,sw,se,sw,ne,sw,s,ne,sw,sw,nw,sw,nw,ne,sw,nw,nw,sw,nw,nw,se,se,s,nw,sw,sw,nw,nw,nw,nw,nw,nw,sw,sw,sw,ne,s,sw,sw,ne,nw,n,nw,se,nw,sw,se,nw,nw,sw,s,sw,s,sw,sw,sw,sw,sw,se,s,nw,sw,sw,sw,sw,nw,nw,sw,nw,sw,n,sw,nw,n,se,sw,sw,sw,nw,se,sw,s,nw,nw,nw,sw,sw,nw,s,n,nw,sw,sw,nw,sw,nw,nw,nw,se,nw,nw,s,nw,se,nw,nw,sw,sw,nw,sw,sw,nw,nw,nw,sw,nw,sw,s,sw,sw,sw,nw,nw,nw,nw,sw,nw,nw,sw,s,nw,nw,nw,sw,sw,nw,sw,nw,se,ne,nw,nw,sw,nw,sw,nw,sw,nw,nw,sw,sw,nw,sw,nw,sw,nw,sw,sw,nw,sw,nw,sw,sw,sw,nw,nw,nw,n,ne,nw,nw,sw,nw,sw,nw,s,nw,nw,sw,sw,sw,sw,sw,nw,sw,n,nw,sw,nw,sw,sw,sw,nw,sw,nw,nw,sw,sw,sw,sw,nw,nw,nw,nw,sw,sw,sw,nw,sw,sw,nw,n,sw,n,nw,sw,nw,nw,nw,s,nw,sw,nw,nw,nw,nw,nw,sw,sw,nw,nw,n,n,sw,nw,nw,sw,sw,s,nw,nw,nw,nw,nw,sw,nw,sw,nw,sw,nw,sw,nw,nw,nw,n,nw,sw,nw,nw,s,nw,nw,nw,sw,sw,nw,sw,nw,nw,ne,sw,se,nw,nw,sw,nw,nw,n,sw,sw,sw,nw,nw,nw,nw,nw,nw,n,sw,ne,nw,nw,nw,sw,sw,sw,sw,ne,nw,nw,sw,nw,nw,sw,nw,nw,nw,sw,nw,nw,sw,nw,nw,se,s,s,nw,nw,nw,nw,nw,sw,nw,nw,sw,sw,nw,nw,se,nw,nw,nw,nw,sw,nw,nw,nw,sw,s,sw,se,nw,sw,nw,nw,nw,s,nw,nw,nw,sw,sw,nw,sw,sw,n,nw,nw,sw,nw,nw,sw,nw,s,se,nw,nw,nw,nw,se,ne,nw,se,nw,ne,nw,nw,sw,nw,nw,nw,nw,nw,nw,sw,ne,nw,nw,se,nw,sw,nw,nw,se,ne,nw,nw,nw,nw,s,sw,nw,sw,sw,nw,nw,ne,nw,nw,nw,nw,nw,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,s,ne,nw,sw,nw,sw,nw,nw,n,sw,nw,nw,nw,ne,sw,nw,nw,nw,nw,sw,nw,nw,nw,se,nw,nw,s,nw,sw,se,sw,nw,nw,nw,s,sw,s,nw,n,se,sw,se,nw,nw,nw,sw,sw,sw,nw,se,nw,nw,nw,nw,nw,nw,sw,ne,nw,nw,nw,nw,nw,sw,nw,sw,s,nw,nw,nw,ne,nw,sw,se,se,nw,sw,sw,nw,n,s,s,nw,nw,nw,nw,nw,nw,nw,nw,nw,s,nw,nw,ne,n,se,ne,nw,nw,nw,sw,sw,sw,nw,nw,nw,nw,se,nw,se,nw,nw,ne,n,nw,nw,nw,nw,nw,nw,nw,nw,se,nw,ne,nw,nw,sw,nw,nw,nw,nw,nw,sw,se,nw,nw,nw,s,n,nw,nw,nw,s,s,nw,sw,s,nw,nw,se,nw,nw,nw,n,nw,n,nw,nw,nw,nw,nw,nw,ne,sw,nw,nw,nw,s,nw,nw,nw,nw,se,nw,nw,nw,nw,nw,nw,nw,ne,nw,nw,nw,nw,ne,sw,nw,nw,sw,nw,nw,nw,nw,n,nw,nw,se,nw,nw,sw,s,nw,se,nw,n,nw,nw,ne,nw,ne,nw,sw,s,nw,nw,nw,nw,nw,ne,nw,s,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,sw,n,ne,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,ne,nw,n,nw,nw,nw,n,nw,nw,s,ne,nw,nw,nw,n,nw,nw,ne,nw,nw,nw,nw,nw,nw,nw,s,nw,se,nw,nw,nw,nw,se,se,nw,nw,nw,nw,nw,nw,s,nw,nw,nw,nw,ne,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,sw,sw,nw,se,nw,nw,nw,sw,nw,nw,n,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,sw,s,nw,n,nw,sw,s,s,n,nw,n,nw,nw,nw,nw,nw,nw,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,n,ne,sw,nw,s,nw,ne,nw,nw,nw,nw,nw,sw,nw,nw,nw,ne,nw,nw,sw,sw,s,nw,nw,ne,nw,s,nw,nw,n,nw,nw,n,n,nw,nw,nw,nw,nw,nw,se,nw,n,nw,se,nw,s,nw,nw,sw,n,nw,nw,sw,nw,nw,n,nw,ne,nw,se,nw,n,se,nw,nw,nw,nw,nw,nw,n,nw,nw,nw,nw,n,sw,nw,nw,nw,nw,ne,nw,nw,nw,n,n,nw,nw,nw,nw,nw,sw,sw,n,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,se,nw,nw,nw,nw,nw,ne,nw,sw,n,s,sw,s,nw,se,nw,nw,s,sw,sw,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,s,ne,se,nw,nw,s,nw,nw,n,nw,nw,nw,nw,nw,n,n,nw,n,nw,nw,nw,se,nw,nw,nw,nw,n,nw,sw,nw,n,nw,nw,nw,se,nw,s,nw,s,nw,nw,n,nw,n,n,nw,se,n,nw,sw,nw,nw,nw,nw,nw,nw,nw,nw,nw,s,n,nw,nw,ne,nw,n,nw,n,n,nw,nw,n,nw,ne,ne,se,se,nw,n,nw,nw,nw,n,nw,se,n,s,nw,nw,se,n,nw,nw,sw,s,nw,nw,ne,sw,nw,n,nw,nw,n,nw,ne,ne,sw,n,ne,s,nw,nw,se,nw,nw,nw,nw,n,nw,sw,n,ne,nw,se,nw,nw,nw,se,sw,n,nw,nw,nw,nw,nw,s,n,nw,s,n,nw,nw,nw,ne,se,nw,nw,nw,nw,s,n,nw,nw,n,nw,nw,nw,n,nw,nw,nw,nw,nw,s,nw,nw,s,nw,nw,nw,nw,nw,sw,nw,nw,ne,nw,ne,nw,nw,sw,n,nw,nw,ne,nw,s,nw,n,se,sw,n,sw,s,nw,se,nw,nw,n,ne,nw,nw,nw,nw,nw,nw,se,nw,ne,n,nw,nw,sw,ne,nw,n,n,n,nw,nw,nw,n,nw,n,nw,nw,n,s,nw,nw,nw,nw,ne,nw,s,ne,ne,n,nw,se,nw,n,s,nw,se,n,nw,nw,nw,nw,nw,n,n,nw,nw,nw,sw,n,n,n,n,nw,nw,nw,nw,nw,nw,n,nw,nw,nw,nw,sw,nw,n,nw,n,nw,nw,nw,n,nw,s,nw,se,n,n,nw,n,nw,n,nw,n,n,n,nw,sw,nw,nw,s,n,nw,nw,ne,nw,se,n,nw,nw,n,n,nw,nw,nw,n,se,n,nw,nw,nw,sw,n,nw,nw,nw,n,nw,nw,n,nw,s,n,nw,n,nw,n,nw,n,nw,nw,n,nw,n,nw,n,nw,nw,n,s,sw,nw,nw,nw,nw,nw,n,ne,n,nw,nw,nw,n,s,nw,nw,nw,se,nw,nw,n,se,nw,ne,nw,n,n,nw,nw,se,nw,nw,se,n,n,nw,n,n,nw,sw,ne,nw,nw,nw,sw,nw,ne,n,se,n,ne,nw,sw,nw,n,nw,nw,nw,n,ne,s,nw,nw,sw,nw,se,nw,n,sw,sw,nw,n,n,n,nw,nw,sw,nw,n,nw,ne,n,nw,n,nw,n,nw,se,nw,nw,n,s,se,nw,n,nw,nw,nw,n,n,s,n,nw,nw,nw,sw,s,n,ne,se,nw,ne,n,nw,nw,sw,nw,n,nw,n,nw,nw,s,n,nw,nw,n,n,n,nw,nw,n,ne,n,nw,n,nw,n,ne,s,nw,n,n,nw,nw,n,nw,nw,sw,n,n,nw,nw,n,nw,sw,nw,n,nw,nw,nw,n,n,nw,n,sw,n,n,n,nw,s,se,n,ne,n,nw,n,n,nw,n,n,nw,nw,nw,n,nw,se,nw,sw,n,nw,nw,n,n,nw,n,n,s,nw,nw,n,sw,nw,nw,n,nw,nw,n,ne,s,sw,nw,nw,n,n,n,nw,sw,n,ne,n,nw,nw,ne,sw,n,n,sw,nw,n,n,n,nw,sw,n,nw,nw,n,se,nw,nw,nw,n,nw,nw,n,n,n,se,nw,nw,n,n,sw,n,nw,n,nw,n,n,nw,nw,n,nw,n,s,n,n,n,nw,nw,se,n,nw,n,n,s,nw,n,n,nw,nw,n,s,n,n,nw,n,nw,n,n,n,nw,s,sw,n,sw,nw,ne,nw,nw,nw,se,n,nw,nw,nw,nw,n,nw,nw,n,n,n,nw,nw,nw,n,n,nw,n,n,s,nw,ne,n,se,nw,nw,nw,n,n,nw,n,nw,n,n,nw,n,nw,nw,nw,n,n,s,n,s,n,n,n,n,nw,se,n,nw,n,n,se,sw,n,n,n,nw,nw,nw,nw,nw,s,s,s,nw,ne,nw,n,ne,n,n,n,nw,n,se,n,n,n,n,sw,nw,n,n,n,n,nw,n,s,se,n,n,n,nw,n,n,n,nw,n,se,n,nw,s,se,nw,n,nw,nw,n,nw,n,n,ne,n,n,n,n,n,se,n,n,s,nw,n,nw,sw,s,n,se,ne,n,sw,s,s,nw,ne,nw,sw,n,n,n,n,n,n,s,n,n,nw,nw,n,nw,n,n,sw,ne,nw,n,n,n,se,se,n,n,n,s,n,n,ne,n,nw,nw,n,n,n,n,se,nw,n,n,n,n,n,s,n,nw,s,n,n,n,se,n,n,n,n,nw,n,n,se,n,sw,n,n,n,n,n,n,s,nw,n,n,nw,nw,n,nw,nw,n,n,nw,n,n,nw,ne,n,n,n,nw,nw,n,n,n,n,n,n,n,ne,sw,nw,n,n,n,n,nw,n,n,nw,n,ne,n,n,n,s,se,nw,n,se,n,nw,n,n,se,n,n,nw,n,s,se,n,sw,n,ne,n,nw,n,n,ne,ne,n,n,n,n,n,n,nw,nw,n,n,se,n,nw,n,n,n,ne,nw,ne,n,nw,n,nw,nw,n,n,n,nw,n,se,n,nw,se,n,nw,n,n,n,n,n,n,n,nw,se,n,n,n,nw,n,se,nw,n,n,n,nw,n,sw,n,n,n,nw,nw,ne,n,n,nw,n,n,n,n,s,nw,n,sw,se,n,s,n,n,n,nw,ne,nw,n,s,n,n,n,n,n,n,n,n,n,n,nw,n,nw,nw,n,n,n,n,s,n,n,nw,n,nw,n,n,n,sw,n,n,nw,n,nw,n,n,se,s,n,se,sw,n,n,sw,n,n,n,nw,nw,n,nw,nw,nw,n,n,n,n,n,s,n,se,n,n,s,n,n,nw,n,n,n,n,n,ne,n,n,n,n,se,n,n,n,nw,n,n,nw,n,n,s,n,sw,n,n,n,n,n,n,ne,n,se,nw,nw,n,n,n,ne,n,n,n,n,nw,se,n,n,n,n,n,ne,n,n,n,sw,n,n,se,n,n,nw,n,n,n,ne,n,sw,nw,nw,n,n,n,n,n,n,n,n,sw,n,s,n,n,nw,nw,s,n,n,n,n,n,n,n,nw,n,n,n,n,n,n,n,n,ne,n,ne,n,n,n,n,n,n,se,s,s,n,n,n,ne,n,se,n,n,ne,ne,sw,sw,n,n,n,n,n,ne,s,n,nw,sw,n,s,n,sw,sw,n,ne,ne,n,sw,n,n,sw,ne,n,n,n,n,n,ne,sw,n,n,sw,ne,n,s,ne,nw,n,n,n,n,n,n,n,n,n,n,n,nw,n,n,s,n,n,ne,sw,n,n,nw,sw,s,s,se,s,s,ne,se,se,se,ne,ne,se,ne,ne,ne,ne,se,ne,ne,ne,ne,sw,ne,n,n,ne,nw,nw,n,sw,nw,n,n,n,n,ne,nw,n,sw,n,nw,ne,nw,nw,nw,sw,n,nw,n,n,n,nw,nw,nw,nw,nw,nw,nw,nw,nw,s,ne,sw,nw,nw,nw,nw,nw,nw,nw,nw,se,nw,ne,nw,sw,ne,nw,nw,sw,ne,nw,sw,nw,nw,ne,sw,se,nw,nw,nw,sw,se,sw,sw,sw,sw,nw,sw,nw,sw,s,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,s,s,n,s,sw,s,s,se,sw,n,s,sw,s,s,s,ne,sw,sw,sw,s,s,se,s,s,s,s,s,s,s,s,s,s,s,ne,se,s,s,nw,s,ne,sw,s,s,s,se,s,sw,s,s,s,s,ne,s,sw,s,s,ne,s,se,s,s,s,se,ne,se,se,se,se,se,s,ne,ne,sw,s,se,n,ne,s,se,s,se,s,se,n,s,se,s,nw,se,se,s,se,sw,se,ne,se,nw,se,se,se,se,nw,se,se,se,se,se,se,se,se,n,nw,se,n,se,ne,n,sw,se,sw,se,se,se,se,ne,se,se,n,se,sw,se,ne,se,ne,nw,ne,se,se,ne,se,sw,se,se,sw,se,n,se,n,ne,n,ne,ne,ne,se,se,ne,se,se,nw,se,se,ne,se,n,s,se,ne,ne,n,ne,ne,ne,ne,nw,s,ne,sw,n,ne,ne,ne,nw,se,ne,ne,ne,ne,ne,ne,ne,se,nw,ne,ne,ne,ne,se,ne,ne,se,ne,ne,se,se,se,sw,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,s,ne,n,ne,ne,ne,s,n,ne,se,n,n,s,se,n,ne,ne,nw,ne,ne,ne,ne,ne,ne,nw,ne,ne,ne,n,n,ne,sw,ne,n,se,sw,sw,n,n,ne,n,se,n,ne,ne,ne,nw,ne,s,n,se,sw,ne,se,n,ne,se,ne,ne,n,n,n,n,n,n,ne,n,n,n,n,ne,ne,n,ne,s,n,sw,ne,s,ne,s,ne,ne,n,n,n,nw,n,n,ne,ne,ne,n,n,n,n,ne,ne,ne,n,n,n,ne,s,s,n,ne,n,se,n,n,ne,n,n,ne,ne,n,ne,nw,sw,n,n,n,n,n,n,nw,n,n,ne,se,se,nw,se,n,n,n,n,n,nw,n,n,n,n,n,se,nw,ne,n,s,n,n,n,n,nw,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,sw,n,n,n,nw,n,n,n,nw,se,nw,s,se,n,n,n,nw,s,n,nw,n,n,n,nw,se,n,nw,n,n,n,n,nw,nw,sw,n,n,nw,n,nw,se,n,n,nw,n,n,se,n,n,n,nw,n,nw,n,nw,nw,nw,s,n,n,n,nw,nw,nw,n,n,n,n,n,nw,nw,nw,n,nw,n,nw,nw,nw,ne,nw,nw,n,nw,nw,n,n,n,n,n,n,n,n,nw,n,s,ne,nw,n,nw,nw,nw,s,n,nw,sw,sw,nw,nw,n,nw,nw,nw,nw,se,nw,nw,n,nw,n,sw,nw,nw,ne,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,se,nw,s,nw,n,sw,nw,n,ne,ne,nw,nw,nw,nw,nw,nw,nw,nw,ne,nw,nw,nw,nw,nw,nw,ne,nw,sw,nw,nw,nw,nw,nw,sw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,sw,nw,nw,nw,nw,s,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,sw,ne,sw,sw,sw,nw,nw,se,nw,s,s,nw,nw,se,s,se,s,sw,nw,nw,nw,nw,nw,se,sw,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,ne,nw,sw,nw,nw,nw,sw,sw,n,n,n,nw,nw,sw,sw,nw,nw,nw,se,sw,sw,sw,sw,nw,sw,nw,se,nw,sw,nw,s,sw,nw,sw,nw,nw,nw,n,sw,se,s,nw,sw,sw,nw,sw,nw,nw,nw,n,se,sw,nw,nw,sw,ne,nw,sw,sw,sw,sw,nw,nw,ne,ne,nw,s,nw,sw,nw,sw,nw,nw,sw,n,nw,sw,nw,nw,nw,nw,sw,n,n,nw,nw,nw,nw,sw,nw,nw,nw,sw,sw,sw,nw,se,sw,sw,sw,sw,nw,nw,sw,nw,sw,se,s,sw,ne,nw,ne,sw,ne,sw,nw,sw,sw,sw,sw,nw,sw,sw,nw,sw,sw,n,nw,sw,sw,sw,se,sw,sw,sw,n,n,sw,sw,sw,sw,sw,sw,nw,sw,nw,sw,s,sw,ne,sw,s,nw,sw,sw,n,sw,sw,nw,sw,n,nw,nw,sw,nw,sw,s,sw,ne,sw,n,s,sw,ne,sw,sw,sw,sw,sw,sw,se,sw,sw,sw,se,n,sw,sw,nw,s,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,nw,sw,sw,sw,nw,sw,sw,s,sw,sw,nw,sw,ne,sw,n,sw,sw,sw,sw,n,s,s,sw,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,se,sw,s,sw,ne,nw,n,s,ne,sw,se,nw,sw,sw,sw,sw,sw,s,sw,sw,sw,sw,sw,s,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,ne,sw,sw,sw,sw,sw,n,s,sw,sw,sw,ne,sw,sw,sw,se,sw,nw,sw,sw,sw,se,se,sw,s,sw,sw,sw,n,sw,sw,sw,sw,sw,sw,sw,sw,se,n,s,s,s,s,nw,sw,se,ne,sw,sw,n,nw,sw,s,s,s,nw,sw,s,sw,sw,sw,sw,sw,ne,s,s,sw,sw,s,s,sw,s,s,n,s,sw,s,nw,s,sw,sw,sw,n,s,sw,sw,sw,sw,sw,sw,s,sw,n,s,sw,sw,sw,s,sw,sw,sw,s,sw,s,sw,s,s,sw,sw,s,nw,sw,sw,sw,sw,s,s,sw,se,s,n,sw,s,sw,sw,sw,s,sw,s,sw,s,n,sw,s,s,sw,sw,sw,sw,sw,s,sw,nw,sw,sw,s,s,sw,sw,sw,sw,ne,sw,sw,s,sw,n,sw,sw,sw,s,nw,nw,sw,s,sw,s,s,s,s,sw,ne,s,sw,s,s,sw,sw,sw,nw,s,s,s,sw,nw,n,nw,sw,sw,s,s,sw,sw,se,s,se,sw,nw,s,s,sw,s,s,s,s,sw,s,ne,sw,s,nw,sw,s,s,ne,sw,s,sw,sw,sw,s,sw,s,sw,s,se,s,nw,sw,s,s,sw,s,sw,s,se,s,n,s,ne,s,sw,s,s,sw,nw,s,s,s,sw,s,s,s,s,sw,s,sw,sw,s,n,s,s,s,s,s,sw,ne,nw,se,s,s,s,s,s,s,sw,n,s,nw,n,s,s,s,n,s,s,nw,s,s,s,nw,s,s,nw,s,se,n,n,s,s,n,s,s,sw,sw,s,nw,s,s,s,nw,s,s,s,n,s,s,s,nw,s,s,s,se,s,s,s,ne,se,s,s,s,s,s,sw,n,s,ne,s,s,se,nw,s,s,s,s,s,n,s,s,sw,nw,nw,s,s,n,s,nw,n,s,s,s,ne,sw,s,s,s,s,s,sw,s,s,s,s,s,s,s,s,s,sw,nw,ne,s,s,s,s,s,s,nw,s,s,s,se,s,n,ne,nw,se,ne,s,s,s,n,s,nw,s,s,s,sw,sw,ne,s,se,se,s,s,s,sw,s,s,se,s,s,s,ne,s,s,se,s,s,s,se,n,s,s,s,s,s,ne,s,s,s,s,s,s,s,s,n,s,s,s,s,s,s,s,se,s,s,s,se,s,s,s,s,se,se,s,sw,nw,s,nw,s,s,se,s,n,s,se,n,sw,s,sw,sw,se,s,se,s,s,s,s,s,s,s,s,s,s,se,s,se,sw,s,s,se,s,s,s,s,se,s,s,nw,s,s,n,n,s,s,se,se,se,s,se,nw,s,s,se,s,se,se,s,s,s,nw,nw,se,n,se,n,se,se,s,s,n,s,sw,s,s,s,s,s,se,n,s,se,ne,s,s,s,sw,se,n,s,s,s,s,s,s,s,n,se,s,s,s,s,s,s,s,s,s,se,s,sw,s,se,ne,sw,nw,s,s,nw,s,s,s,se,s,s,sw,se,s,s,s,ne,se,s,s,s,s,s,s,sw,se,nw,se,se,s,sw,s,ne,se,s,se,se,se,s,se,se,se,n,se,sw,s,s,s,se,s,s,se,s,s,s,s,s,se,se,se,s,se,se,se,s,se,se,s,s,s,se,s,s,s,s,se,se,s,s,s,se,se,s,s,n,se,s,s,nw,se,se,se,se,nw,se,s,se,s,s,se,se,n,s,sw,nw,s,s,se,se,se,s,se,n,s,se,s,se,n,se,se,se,se,s,se,nw,s,se,s,n,s,se,se,s,se,se,ne,s,ne,se,se,se,s,nw,se,nw,s,se,s,s,se,se,nw,s,se,s,se,se,sw,se,s,s,se,se,se,ne,se,s,se,s,se,se,se,se,se,se,se,s,se,s,se,se,s,se,s,nw,ne,se,nw,se,se,s,se,se,s,ne,se,se,se,s,se,se,se,se,s,se,se,se,se,s,se,se,se,se,se,se,se,se,s,se,se,se,nw,s,se,s,n,s,se,se,se,se,s,s,se,se,nw,se,n,ne,se,nw,se,s,s,se,se,n,sw,ne,s,se,se,sw,s,s,se,n,se,se,s,ne,s,se,se,se,se,se,sw,se,se,se,se,se,ne,s,ne,se,s,sw,se,se,se,se,se,se,s,se,s,s,se,sw,se,se,se,se,nw,se,se,nw,se,ne,s,se,sw,se,se,se,s,se,sw,se,se,se,se,sw,se,se,sw,se,se,se,se,se,nw,ne,sw,ne,se,s,se,sw,se,se,se,se,se,se,ne,se,sw,se,se,se,se,se,sw,se,se,se,se,se,se,se,se,se,ne,se,se,n,se,n,s,se,se,se,se,se,se,se,nw,se,se,se,sw,se,se,se,se,ne,se,se,se,se,se,se,s,se,se,ne,s,ne,se,s,se,se,nw,se,se,sw,se,se,se,se,se,se,se,se,se,se,nw,ne,se,se,ne,se,se,se,se,se,se,n,se,se,se,se,ne,sw,se,se,ne,se,ne,se,nw,se,se,se,n,se,se,sw,se,s,se,se,se,se,se,se,se,se,ne,se,se,se,s,se,se,se,ne,se,nw,n,se,se,nw,ne,se,se,se,se,se,se,ne,ne,nw,se,se,se,ne,se,se,ne,n,se,se,se,se,ne,se,ne,ne,se,n,nw,se,se,s,ne,se,se,se,ne,se,se,se,se,se,s,ne,se,se,nw,se,se,se,sw,se,n,se,se,se,s,ne,se,se,se,se,se,n,n,se,se,se,se,ne,nw,se,se,ne,n,se,ne,se,se,ne,ne,se,ne,n,s,ne,se,se,se,se,ne,s,s,se,se,se,se,se,ne,se,ne,ne,ne,se,sw,s,se,s,ne,se,ne,ne,se,ne,se,se,se,se,ne,se,se,se,ne,sw,nw,se,se,s,se,nw,se,se,nw,s,se,se,se,se,se,se,nw,se,se,se,nw,ne,ne,se,se,n,se,se,se,nw,se,s,nw,ne,ne,ne,se,ne,se,se,se,ne,se,se,ne,ne,ne,nw,se,se,nw,ne,se,ne,n,se,ne,ne,ne,ne,ne,se,sw,ne,se,s,sw,se,nw,ne,se,se,se,se,se,sw,se,se,s,ne,se,se,ne,se,se,ne,se,nw,ne,se,se,se,se,se,ne,ne,se,se,se,ne,se,se,ne,ne,se,se,n,ne,ne,se,ne,se,se,ne,ne,n,ne,se,ne,se,ne,s,se,ne,se,sw,ne,ne,s,ne,n,ne,se,se,ne,ne,ne,se,se,se,se,sw,se,s,ne,nw,ne,ne,ne,se,se,se,ne,ne,nw,se,se,ne,se,nw,se,nw,se,se,nw,se,se,ne,ne,se,se,se,se,ne,ne,ne,ne,sw,se,ne,ne,se,ne,se,ne,se,se,ne,ne,ne,ne,ne,se,se,se,se,se,sw,ne,se,n,se,n,nw,se,se,sw,se,ne,se,ne,ne,ne,ne,nw,ne,se,se,ne,ne,se,ne,ne,se,ne,ne,ne,ne,se,ne,sw,se,se,n,ne,se,ne,ne,sw,ne,ne,ne,se,se,se,se,se,ne,ne,se,n,se,n,sw,se,se,se,se,ne,se,se,se,se,ne,se,se,se,ne,n,n,ne,se,se,ne,ne,ne,nw,ne,se,ne,se,ne,n,se,ne,nw,ne,se,ne,s,ne,ne,ne,se,ne,sw,ne,se,se,se,ne,ne,ne,se,s,se,ne,n,n,ne,se,se,ne,ne,ne,se,ne,n,ne,s,ne,ne,s,ne,se,ne,se,ne,ne,nw,se,ne,ne,se,nw,ne,ne,se,sw,ne,se,ne,ne,s,se,ne,ne,ne,ne,se,se,ne,n,s,se,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,nw,n,ne,ne,n,se,ne,ne,ne,ne,ne,n,ne,se,ne,ne,se,ne,ne,nw,ne,se,ne,se,s,se,ne,ne,ne,ne,ne,ne,ne,s,ne,ne,ne,ne,ne,ne,se,ne,ne,ne,nw,ne,se,ne,ne,ne,ne,ne,nw,ne,nw,ne,ne,s,se,n,ne,ne,ne,se,ne,ne,ne,ne,ne,ne,nw,ne,s,sw,ne,ne,ne,ne,ne,ne,ne,se,se,se,ne,n,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,ne,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,se,ne,se,ne,n,ne,se,ne,ne,ne,se,n,ne,ne,ne,ne,se,ne,ne,ne,ne,se,sw,ne,ne,se,se,ne,ne,n,nw,ne,se,ne,ne,ne,ne,ne,ne,nw,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,se,ne,ne,ne,sw,nw,ne,nw,se,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,se"""
11,032
22,063
0.626904
8,224
22,064
1.681907
0.000851
0.216599
0.178716
0.143436
0.983227
0.905654
0.76952
0.616758
0.431825
0.290558
0
0
0.000136
22,064
1
22,064
22,064
0.626989
0
0
0
0
1
0.999365
0.999365
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
1
0
0
1
1
1
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
11
fb0ad62c80758faf43f2d22ddf33602086a26d4f
59,048
py
Python
windc_data/loader.py
uw-windc/windc_datastream
8b6277acf943358a064f109a873852a82991ba3d
[ "MIT" ]
3
2019-11-07T05:15:18.000Z
2020-06-30T15:30:10.000Z
windc_data/loader.py
uw-windc/windc_datastream
8b6277acf943358a064f109a873852a82991ba3d
[ "MIT" ]
null
null
null
windc_data/loader.py
uw-windc/windc_datastream
8b6277acf943358a064f109a873852a82991ba3d
[ "MIT" ]
4
2019-11-07T05:15:29.000Z
2021-09-01T17:01:03.000Z
import os import pandas as pd import numpy as np import pprint import copy from windc_data import * from terminaltables import SingleTable from textwrap import wrap class WindcEnvironment: _versions = {"windc_2_0_1": windc_2_0_1, "windc_2_1": windc_2_1} _load_options = { "windc_2_0_1": { "bea_use", "bea_supply", "cfs", "bea_use_det", "bea_supply_det", "eia_emissions", "eia_crude_price", "eia_seds", "eia_heatrate", "usda_nass", "bea_pce", "bea_gsp", "state_exim", "census_sgf", "emission_rate", }, "windc_2_1": { "bea_use", "bea_supply", "cfs", "bea_use_det", "bea_supply_det", "eia_emissions", "eia_crude_price", "eia_seds", "eia_heatrate", "usda_nass", "bea_pce", "bea_gsp", "state_exim", "census_sgf", "emission_rate", }, } def __init__(self, gams_sysdir, data_dir, version=None, load=None): if version is None: version = "windc_2_1" if version not in self._versions: raise ValueError(f"Unknown Windc version: {version}") if load is None: load = self._load_options[version] if not isinstance(load, (str, list, set)): raise ValueError("load argument must be of type str, list or set") if isinstance(load, str): load = [load] if set(load).issubset(self._load_options[version]): self._load_from = load else: raise ValueError( f"load arguments must be one or more of the following: {self._load_options[version]}" ) self.gams_sysdir = os.path.abspath(gams_sysdir) self.version = version self.data_dir = os.path.abspath(os.path.expanduser(data_dir)) print(f"GAMS sysdir given as: {self.gams_sysdir}") print(f"WiNDC data directory given as: {self.data_dir}") # create data container self.data = {} # load data self._load_data() # container for notation self.windc_notation = {} for k, v in mappings.maps.items(): for col in v.columns: self.windc_notation[col] = set(mappings.maps[k][col]) # container for column links # structure is {tablename:[(original_column_name, linked_notation_name)]} self.notation_link = {} def _load_data(self): # get data from version of windc for i in dir(self._versions[self.version].join): if ( callable(getattr(self._versions[self.version].join, i)) and i in self._load_from ): print(f"Loading data from... {i}") self.data[i] = getattr(self._versions[self.version].join, i)( self.data_dir ) def diff(self): pass def bulk_strip(self): for k, v in self.data.items(): for col in v.columns: if v[col].dtype == "O": v[col] = v[col].str.strip() def column_dtypes(self, dtypes): for k, v in self.data.items(): for i in v.columns.to_list(): print( f"converting '{i}' in '{k}' from '{v[i].dtype}' --> '{dtypes[k][i]}'" ) self.data[k][i] = self.data[k][i].map(dtypes[k][i]) def bulk_replace(self, convert): for k, v in self.data.items(): self.data[k].replace(convert, inplace=True) def remove_zeros(self): for k, v in self.data.items(): for col in v.columns: if v[col].dtype == "float": idx = self.data[k][self.data[k][col] == 0].index if len(idx) != 0: print(f"removing {len(idx)} zeros from '{col}' in '{k}'") self.data[k].drop(idx, inplace=True) self.data[k].reset_index(drop=True, inplace=True) def drop_rows(self): for k, v in self.__to_drop__.items(): for col, v2 in v.items(): if v2 != []: idx = self.data[k][self.data[k][col].isin(v2) == True].index print(f"dropping {len(idx)} rows from '{col}' in '{k}'") self.data[k].drop(idx, inplace=True) for k, v in self.data.items(): self.data[k].reset_index(drop=True, inplace=True) def test_notation(self): self.__to_drop__ = {} for k in self.notation_link.keys(): v = self.data[k] self.__to_drop__[k] = {} # look through all linked columns of the dataframe for d, nl in self.notation_link[k]: print(f"column name {d} linked to {nl}") self.__to_drop__[k][d] = [] # set up new table for output display table_data = [] table_title = f"{d} :: {k}" data = set(v[d]) notation = self.windc_notation[nl] diff_data = data - notation diff_notation = notation - data # if sets are equal if data == notation: table_data.append(["Valid dense data detected..."]) table_data.append(["{data} == {notation}"]) table = SingleTable(table_data) table.title = table_title print(table.table) # if data is a subset of notation elif data.issubset(notation) and data != notation: print( "Valid sparse data detected... ({data} is a proper subset of {notation})" ) table_data.append( [ f"{len(diff_notation)} Notation elements not in Data", f"{len(diff_data)} Data elements not in Notation", ] ) table = SingleTable(table_data) max_widths = table.column_widths col1 = list(diff_notation) col1.sort() col1 = "\n".join(wrap(f"{col1}", 2 * max_widths[0])) col2 = list(diff_data) col2.sort() col2 = "\n".join(wrap(f"{col2}", 2 * max_widths[1])) table_data.append([col1, col2]) table.title = table_title print(table.table) # if data is a superset of notation elif data.issuperset(notation) and data != notation: self.__to_drop__[k][d].extend(diff_data) print( "**** Drop detected... ({data} is a proper superset of {notation})" ) table_data.append( [ f"{len(diff_notation)} Notation elements not in Data", f"** {len(diff_data)} Drop Candidates **", ] ) table = SingleTable(table_data) max_widths = table.column_widths col1 = list(diff_notation) col1.sort() col1 = "\n".join(wrap(f"{col1}", 2 * max_widths[0])) col2 = list(diff_data) col2.sort() col2 = "\n".join(wrap(f"{col2}", 2 * max_widths[1])) table_data.append([col1, col2]) table.title = table_title print(table.table) # if symmetric difference is not empty and the length of differences are == elif data.symmetric_difference(notation) != set() and len( diff_notation ) == len(diff_data): self.__to_drop__[k][d].extend(diff_data) print("**** Potential 1:1 map detected...") table_data.append( [ f"{len(diff_notation)} Notation elements not in Data", f"{len(diff_data)} Data elements not in Notation", ] ) table = SingleTable(table_data) max_widths = table.column_widths col1 = list(diff_notation) col1.sort() col1 = "\n".join(wrap(f"{col1}", 2 * max_widths[0])) col2 = list(diff_data) col2.sort() col2 = "\n".join(wrap(f"{col2}", 2 * max_widths[1])) table_data.append([col1, col2]) table.title = table_title print(table.table) # if the left and right differences are != and diff_notation not empty elif len(diff_notation) != len(diff_data) and diff_notation != set(): self.__to_drop__[k][d].extend(diff_data) print("**** Drop detected (from a sparse data structure)... ") table_data.append( [ f"{len(diff_notation)} Notation elements not in Data", f"** {len(diff_data)} Drop Candidates **", ] ) table = SingleTable(table_data) max_widths = table.column_widths col1 = list(diff_notation) col1.sort() col1 = "\n".join(wrap(f"{col1}", 2 * max_widths[0])) col2 = list(diff_data) col2.sort() col2 = "\n".join(wrap(f"{col2}", 2 * max_widths[1])) table_data.append([col1, col2]) table.title = table_title print(table.table) else: print(f"**** UNKNOWN ISSUE in notation link {k}") print("") def bulk_map_column(self, from_col, to_col, mapping): for k, v in self.data.items(): if from_col in v.columns: print(f"mapping column '{to_col}' in table '{k}'...") self.data[k][to_col] = self.data[k][from_col].map(mapping) def unique_columns(self): col = set() for k, v in self.data.items(): col.update(v.columns) return col def find_column(self, columns): pp = pprint.PrettyPrinter(indent=2) result = {} for i in columns: table = [] for k, v in self.data.items(): if i in set(v.columns): table.append(k) result[i] = table return pp.pprint(result) def column_view(self): pp = pprint.PrettyPrinter(indent=2) cv = {} for k, v in self.data.items(): cv[k] = v.columns.tolist() return pp.pprint(cv) def rebuild(self, gdxout=None): if gdxout == None: gdxout = False if not isinstance(gdxout, bool): raise Exception("gdxout must be type bool") if gdxout == False: print("rebuilding WiNDC Data without writing GDX file") self.clean() self.transform() self.remove_zeros() self.apply_gams_labels() if gdxout == True: print("rebuilding WiNDC Data.. GDX file will be created") print( f"GDX file will be written to: {os.path.join(os.getcwd(), 'windc_base.gdx')}" ) self.clean() self.transform() self.remove_zeros() self.apply_gams_labels() self.export_gdx() def clean(self): if self.version == "windc_2_0_1": self.windc_notation["year"] = set([str(i) for i in range(1997, 2017)]) self.bulk_strip() self.remove_zeros() dtypes = { "bea_supply": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "bea_use": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "bea_supply_det": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "bea_use_det": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "census_sgf": { "Category": str, "State": str, "value": float, "year": str, "units": str, }, "cfs": { "SHIPMT_ID": str, "ORIG_STATE": str, "ORIG_MA": str, "ORIG_CFS_AREA": str, "DEST_STATE": str, "DEST_MA": str, "DEST_CFS_AREA": str, "NAICS": str, "QUARTER": str, "SCTG": str, "MODE": str, "SHIPMT_VALUE": float, "SHIPMT_WGHT": float, "SHIPMT_DIST_GC": float, "SHIPMT_DIST_ROUTED": float, "TEMP_CNTL_YN": str, "EXPORT_YN": str, "EXPORT_CNTRY": str, "HAZMAT": str, "WGT_FACTOR": float, "SHIPMT_VALUE_units": str, "SHIPMT_WGHT_units": str, "SHIPMT_DIST_GC_units": str, "SHIPMT_DIST_ROUTED_units": str, "year": str, }, "bea_gsp": { "GeoFIPS": str, "GeoName": str, "Region": str, "TableName": str, "ComponentName": str, "Unit": str, "IndustryId": str, "IndustryClassification": str, "Description": str, "year": str, "value": float, }, "bea_pce": { "GeoFIPS": str, "GeoName": str, "Region": str, "TableName": str, "ComponentName": str, "Unit": str, "Line": str, "IndustryClassification": str, "Description": str, "year": str, "value": float, }, "eia_crude_price": { "year": str, "price": float, "units": str, "notes": str, }, "eia_emissions": { "State": str, "year": str, "emissions": float, "units": str, "sector": str, }, "eia_heatrate": { "year": str, "units": str, "variable": str, "value": float, }, "eia_seds": { "Data_Status": str, "MSN": str, "StateCode": str, "Year": str, "Data": float, "full_description": str, "units": str, "source": str, "sector": str, }, "state_exim": { "State": str, "Commodity": str, "Country": str, "Time": str, "value": float, "NAICS": str, "Commodity Description": str, "units": str, "flow": str, }, "usda_nass": { "Program": str, "Year": str, "Period": str, "Geo Level": str, "State": str, "State ANSI": str, "watershed_code": str, "Commodity": str, "Data Item": str, "Domain": str, "Domain Category": str, "Value": float, "CV (%)": float, "units": str, }, "emission_rate": {"fuel": str, "units": str, "value": float,}, } self.column_dtypes(dtypes) # create a new notation self.windc_notation["usda_naics"] = { "11111", "11112", "11113", "11114", "11115", "11116", "11119", "1112", "1113", "1114", "1119", "11211", "11212", "1122", "1123", "1124", "1125", "1129", } # create a new notation self.windc_notation["gsp_industry_id"] = { "4", "5", "7", "8", "9", "10", "11", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "37", "38", "39", "40", "41", "42", "43", "44", "46", "47", "48", "49", "52", "53", "54", "55", "57", "58", "61", "62", "63", "64", "66", "67", "69", "71", "72", "73", "76", "77", "79", "80", "81", "83", "84", "85", } # create a new notation self.windc_notation["units"] = { "kilograms CO2 per million btu", "billion btu", "btu per kilowatthour", "million btu", "million btu per barrel", "million btu per short ton", "million cubic feet", "million kilowatthours", "million metric tons of carbon dioxide", "millions of chained (2009) us dollars (USD)", "millions of chained (2012) us dollars (USD)", "millions of current us dollars (USD)", "millions of us dollars (USD)", "percent", "percent change", "percentage points", "quantity index", "thousand", "thousand barrels", "thousand btu per chained (2009) us dollars (USD)", "thousand btu per cubic foot", "thousand btu per kilowatthour", "thousand cords", "thousand short tons", "thousands of us dollars (USD)", "us dollars (USD)", "us dollars (USD) per million btu", "us dollars (USD) per barrel", } # create a new notation from data cfs_ma = set(self.data["cfs"]["ORIG_MA"]) cfs_ma.update(set(self.data["cfs"]["DEST_MA"])) cfs_ma = cfs_ma - {"0"} self.windc_notation["cfs_ma"] = cfs_ma # create a new notation from data # drop undisclosed SCTG data cfs_sctg = set(self.data["cfs"]["SCTG"]) cfs_sctg = cfs_sctg - { "00", "25-30", "01-05", "15-19", "10-14", "06-09", "39-99", "20-24", "31-34", "35-38", "99", } self.windc_notation["cfs_sctg"] = cfs_sctg # create a new notation from data # drop undisclosed SCTG data self.windc_notation["cfs_export"] = {"N"} # create notation links self.notation_link["cfs"] = [ ("ORIG_STATE", "fips.state"), ("DEST_STATE", "fips.state"), ("ORIG_MA", "cfs_ma"), ("DEST_MA", "cfs_ma"), ("SCTG", "cfs_sctg"), ("EXPORT_YN", "cfs_export"), ] # create a new notation from data gsp = set(self.data["bea_gsp"]["ComponentName"]) gsp = gsp - {"Contributions to percent change in real GDP"} self.windc_notation["gsp_componentname"] = gsp # create a new notation from data self.windc_notation["pce_componentname"] = { "Total personal consumption expenditures (PCE) by state" } # create a new notation from data self.windc_notation["sgf_category"] = set( self.data["census_sgf"]["Category"] ) self.windc_notation["exim_cnty"] = {"World Total"} self.notation_link["bea_supply"] = [("year", "year")] self.notation_link["bea_use"] = [("year", "year")] self.notation_link["bea_supply_det"] = [("year", "year")] self.notation_link["bea_use_det"] = [("year", "year")] self.notation_link["bea_gsp"] = [ ("year", "year"), ("GeoName", "region.fullname"), ("Unit", "units"), ("IndustryId", "gsp_industry_id"), ("ComponentName", "gsp_componentname"), ] self.notation_link["bea_pce"] = [ ("year", "year"), ("GeoName", "region.fullname"), ("Unit", "units"), ("ComponentName", "pce_componentname"), ] self.notation_link["eia_crude_price"] = [ ("year", "year"), ("units", "units"), ] self.notation_link["eia_emissions"] = [ ("year", "year"), ("State", "region.fullname"), ("units", "units"), ] self.notation_link["eia_heatrate"] = [("year", "year"), ("units", "units")] self.notation_link["eia_seds"] = [ ("Year", "year"), ("StateCode", "region.abbv"), ("units", "units"), ] self.notation_link["state_exim"] = [ ("State", "region.fullname"), ("Time", "year"), ("units", "units"), ("Country", "exim_cnty"), ] self.notation_link["usda_nass"] = [ ("Year", "year"), ("State", "region.fullname"), ("Domain Category", "usda_naics"), ("units", "units"), ] self.notation_link["census_sgf"] = [ ("year", "year"), ("State", "region.fullname"), ("units", "units"), ("Category", "sgf_category"), ] self.bulk_replace( { "ALABAMA": "Alabama", "ALASKA": "Alaska", "ARIZONA": "Arizona", "ARKANSAS": "Arkansas", "CALIFORNIA": "California", "COLORADO": "Colorado", "CONNECTICUT": "Connecticut", "DELAWARE": "Delaware", "DISTRICT OF COLUMBIA": "District of Columbia", "FLORIDA": "Florida", "GEORGIA": "Georgia", "HAWAII": "Hawaii", "IDAHO": "Idaho", "ILLINOIS": "Illinois", "INDIANA": "Indiana", "IOWA": "Iowa", "KANSAS": "Kansas", "KENTUCKY": "Kentucky", "LOUISIANA": "Louisiana", "MAINE": "Maine", "MARYLAND": "Maryland", "MASSACHUSETTS": "Massachusetts", "MICHIGAN": "Michigan", "MINNESOTA": "Minnesota", "MISSISSIPPI": "Mississippi", "MISSOURI": "Missouri", "MONTANA": "Montana", "NEBRASKA": "Nebraska", "NEVADA": "Nevada", "NEW HAMPSHIRE": "New Hampshire", "NEW JERSEY": "New Jersey", "NEW MEXICO": "New Mexico", "NEW YORK": "New York", "NORTH CAROLINA": "North Carolina", "NORTH DAKOTA": "North Dakota", "OHIO": "Ohio", "OKLAHOMA": "Oklahoma", "OREGON": "Oregon", "PENNSYLVANIA": "Pennsylvania", "RHODE ISLAND": "Rhode Island", "SOUTH CAROLINA": "South Carolina", "SOUTH DAKOTA": "South Dakota", "TENNESSEE": "Tennessee", "TEXAS": "Texas", "UTAH": "Utah", "UNITED STATES": "United States", "VERMONT": "Vermont", "VIRGINIA": "Virginia", "WASHINGTON": "Washington", "WEST VIRGINIA": "West Virginia", "WISCONSIN": "Wisconsin", "WYOMING": "Wyoming", "Dist of Columbia": "District of Columbia", "State total (unadjusted)": "United States", "Dollars": "us dollars (USD)", "Percent change": "percent change", "Thousand Btu per cubic feet": "thousand btu per cubic foot", "Thousand": "thousand", "Quantity index": "quantity index", "Percent": "percent", "Dollars per million Btu": "us dollars (USD) per million btu", "Billion Btu": "billion btu", "Thousand Btu per kilowatthour": "thousand btu per kilowatthour", "Million Btu per short ton": "million btu per short ton", "Thousand short tons": "thousand short tons", "Million cubic feet": "million cubic feet", "Million chained (2009) dollars": "millions of chained (2009) us dollars (USD)", "Thousand cords": "thousand cords", "Thousand Btu per chained (2009) dollar": "thousand btu per chained (2009) us dollars (USD)", "Percentage points": "percentage points", "Million kilowatthours": "million kilowatthours", "Million dollars": "millions of us dollars (USD)", "Thousand Btu per cubic foot": "thousand btu per cubic foot", "btu per kWh generated": "btu per kilowatthour", "Thousands of dollars": "thousands of us dollars (USD)", "Million Btu per barrel": "million btu per barrel", "Million Btu": "million btu", "Millions of chained 2012 dollars": "millions of chained (2012) us dollars (USD)", "Millions of current dollars": "millions of us dollars (USD)", "Thousand barrels": "thousand barrels", } ) self.test_notation() self.drop_rows() # remap regions to defaults self.remap() if self.version == "windc_2_1": self.windc_notation["year"] = set([str(i) for i in range(1997, 2018)]) self.bulk_strip() self.remove_zeros() self.data["bea_gsp"].rename( columns={"LineCode": "IndustryId"}, inplace=True ) dtypes = { "bea_supply": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "bea_use": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "bea_supply_det": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "bea_use_det": { "IOCode": str, "Row_Name": str, "Commodities/Industries": str, "Column_Name": str, "value": float, "year": str, "units": str, }, "census_sgf": { "Category": str, "State": str, "value": float, "year": str, "units": str, }, "cfs": { "SHIPMT_ID": str, "ORIG_STATE": str, "ORIG_MA": str, "ORIG_CFS_AREA": str, "DEST_STATE": str, "DEST_MA": str, "DEST_CFS_AREA": str, "NAICS": str, "QUARTER": str, "SCTG": str, "MODE": str, "SHIPMT_VALUE": float, "SHIPMT_WGHT": float, "SHIPMT_DIST_GC": float, "SHIPMT_DIST_ROUTED": float, "TEMP_CNTL_YN": str, "EXPORT_YN": str, "EXPORT_CNTRY": str, "HAZMAT": str, "WGT_FACTOR": float, "SHIPMT_VALUE_units": str, "SHIPMT_WGHT_units": str, "SHIPMT_DIST_GC_units": str, "SHIPMT_DIST_ROUTED_units": str, "year": str, }, "bea_gsp": { "GeoFIPS": str, "GeoName": str, "Region": str, "TableName": str, "ComponentName": str, "Unit": str, "IndustryId": str, "IndustryClassification": str, "Description": str, "year": str, "value": float, }, "bea_pce": { "GeoFIPS": str, "GeoName": str, "Region": str, "TableName": str, "ComponentName": str, "Unit": str, "Line": str, "IndustryClassification": str, "Description": str, "year": str, "value": float, }, "eia_crude_price": { "year": str, "price": float, "units": str, "notes": str, }, "eia_emissions": { "State": str, "year": str, "emissions": float, "units": str, "sector": str, }, "eia_heatrate": { "year": str, "units": str, "variable": str, "value": float, }, "eia_seds": { "Data_Status": str, "MSN": str, "StateCode": str, "Year": str, "Data": float, "full_description": str, "units": str, "source": str, "sector": str, }, "state_exim": { "State": str, "Commodity": str, "Country": str, "Time": str, "value": float, "NAICS": str, "Commodity Description": str, "units": str, "flow": str, }, "usda_nass": { "Program": str, "Year": str, "Period": str, "Geo Level": str, "State": str, "State ANSI": str, "watershed_code": str, "Commodity": str, "Data Item": str, "Domain": str, "Domain Category": str, "Value": float, "CV (%)": float, "units": str, }, "emission_rate": {"fuel": str, "units": str, "value": float,}, } self.column_dtypes(dtypes) self.windc_notation["usda_naics"] = { "11111", "11112", "11113", "11114", "11115", "11116", "11119", "1112", "1113", "1114", "1119", "11211", "11212", "1122", "1123", "1124", "1125", "1129", } # create a new notation self.windc_notation["gsp_industry_id"] = { "4", "5", "7", "8", "9", "10", "11", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "37", "38", "39", "40", "41", "42", "43", "44", "46", "47", "48", "49", "52", "53", "54", "55", "57", "58", "61", "62", "63", "64", "66", "67", "69", "71", "72", "73", "76", "77", "79", "80", "81", "83", "84", "85", } # create a new notation self.windc_notation["units"] = { "kilowatthours", "barrels", "kilograms CO2 per million btu", "billion btu", "btu per kilowatthour", "million btu", "million btu per barrel", "million btu per short ton", "million cubic feet", "million kilowatthours", "million metric tons of carbon dioxide", "millions of chained (2009) us dollars (USD)", "millions of chained (2012) us dollars (USD)", "millions of current us dollars (USD)", "millions of us dollars (USD)", "percent", "percent change", "percentage points", "quantity index", "thousand", "thousand barrels", "thousand btu per chained (2009) us dollars (USD)", "thousand btu per chained (2012) us dollars (USD)", "thousand btu per cubic foot", "thousand btu per kilowatthour", "thousand cords", "thousand cubic feet", "thousand short tons", "thousands of us dollars (USD)", "us dollars (USD)", "us dollars (USD) per million btu", "us dollars (USD) per barrel", } # create a new notation from data cfs_ma = set(self.data["cfs"]["ORIG_MA"]) cfs_ma.update(set(self.data["cfs"]["DEST_MA"])) cfs_ma = cfs_ma - {"0"} self.windc_notation["cfs_ma"] = cfs_ma # create a new notation from data # drop undisclosed SCTG data cfs_sctg = set(self.data["cfs"]["SCTG"]) cfs_sctg = cfs_sctg - { "00", "25-30", "01-05", "15-19", "10-14", "06-09", "39-99", "20-24", "31-34", "35-38", "99", } self.windc_notation["cfs_sctg"] = cfs_sctg # create a new notation from data # drop undisclosed SCTG data self.windc_notation["cfs_export"] = {"N"} # create notation links self.notation_link["cfs"] = [ ("ORIG_STATE", "fips.state"), ("DEST_STATE", "fips.state"), ("ORIG_MA", "cfs_ma"), ("DEST_MA", "cfs_ma"), ("SCTG", "cfs_sctg"), ("EXPORT_YN", "cfs_export"), ] # create a new notation from data gsp = set(self.data["bea_gsp"]["ComponentName"]) gsp = gsp - {"Contributions to percent change in real GDP"} self.windc_notation["gsp_componentname"] = gsp # create a new notation from data self.windc_notation["pce_componentname"] = { "Total personal consumption expenditures (PCE) by state" } # create a new notation from data self.windc_notation["sgf_category"] = set( self.data["census_sgf"]["Category"] ) self.windc_notation["exim_cnty"] = {"World Total"} self.notation_link["bea_supply"] = [("year", "year")] self.notation_link["bea_use"] = [("year", "year")] self.notation_link["bea_supply_det"] = [("year", "year")] self.notation_link["bea_use_det"] = [("year", "year")] self.notation_link["bea_gsp"] = [ ("year", "year"), ("GeoName", "region.fullname"), ("Unit", "units"), ("IndustryId", "gsp_industry_id"), ("ComponentName", "gsp_componentname"), ] self.notation_link["bea_pce"] = [ ("year", "year"), ("GeoName", "region.fullname"), ("Unit", "units"), ("ComponentName", "pce_componentname"), ] self.notation_link["eia_crude_price"] = [ ("year", "year"), ("units", "units"), ] self.notation_link["eia_emissions"] = [ ("year", "year"), ("State", "region.fullname"), ("units", "units"), ] self.notation_link["eia_heatrate"] = [("year", "year"), ("units", "units")] self.notation_link["eia_seds"] = [ ("Year", "year"), ("StateCode", "region.abbv"), ("units", "units"), ] self.notation_link["state_exim"] = [ ("State", "region.fullname"), ("Time", "year"), ("units", "units"), ("Country", "exim_cnty"), ] self.notation_link["usda_nass"] = [ ("Year", "year"), ("State", "region.fullname"), ("Domain Category", "usda_naics"), ("units", "units"), ] self.notation_link["census_sgf"] = [ ("year", "year"), ("State", "region.fullname"), ("units", "units"), ("Category", "sgf_category"), ] self.bulk_replace( { "ALABAMA": "Alabama", "ALASKA": "Alaska", "ARIZONA": "Arizona", "ARKANSAS": "Arkansas", "CALIFORNIA": "California", "COLORADO": "Colorado", "CONNECTICUT": "Connecticut", "DELAWARE": "Delaware", "DISTRICT OF COLUMBIA": "District of Columbia", "FLORIDA": "Florida", "GEORGIA": "Georgia", "HAWAII": "Hawaii", "IDAHO": "Idaho", "ILLINOIS": "Illinois", "INDIANA": "Indiana", "IOWA": "Iowa", "KANSAS": "Kansas", "KENTUCKY": "Kentucky", "LOUISIANA": "Louisiana", "MAINE": "Maine", "MARYLAND": "Maryland", "MASSACHUSETTS": "Massachusetts", "MICHIGAN": "Michigan", "MINNESOTA": "Minnesota", "MISSISSIPPI": "Mississippi", "MISSOURI": "Missouri", "MONTANA": "Montana", "NEBRASKA": "Nebraska", "NEVADA": "Nevada", "NEW HAMPSHIRE": "New Hampshire", "NEW JERSEY": "New Jersey", "NEW MEXICO": "New Mexico", "NEW YORK": "New York", "NORTH CAROLINA": "North Carolina", "NORTH DAKOTA": "North Dakota", "OHIO": "Ohio", "OKLAHOMA": "Oklahoma", "OREGON": "Oregon", "PENNSYLVANIA": "Pennsylvania", "RHODE ISLAND": "Rhode Island", "SOUTH CAROLINA": "South Carolina", "SOUTH DAKOTA": "South Dakota", "TENNESSEE": "Tennessee", "TEXAS": "Texas", "UTAH": "Utah", "UNITED STATES": "United States", "VERMONT": "Vermont", "VIRGINIA": "Virginia", "WASHINGTON": "Washington", "WEST VIRGINIA": "West Virginia", "WISCONSIN": "Wisconsin", "WYOMING": "Wyoming", "Dist of Columbia": "District of Columbia", "State total (unadjusted)": "United States", "Dollars": "us dollars (USD)", "Percent change": "percent change", "Thousand Btu per cubic feet": "thousand btu per cubic foot", "Thousand": "thousand", "Quantity index": "quantity index", "Percent": "percent", "Dollars per million Btu": "us dollars (USD) per million btu", "Billion Btu": "billion btu", "Thousand Btu per kilowatthour": "thousand btu per kilowatthour", "Million Btu per short ton": "million btu per short ton", "Thousand short tons": "thousand short tons", "Million cubic feet": "million cubic feet", "Million chained (2009) dollars": "millions of chained (2009) us dollars (USD)", "Thousand cords": "thousand cords", "Thousand Btu per chained (2009) dollar": "thousand btu per chained (2009) us dollars (USD)", "Percentage points": "percentage points", "Million kilowatthours": "million kilowatthours", "Million dollars": "millions of us dollars (USD)", "Thousand Btu per cubic foot": "thousand btu per cubic foot", "btu per kWh generated": "btu per kilowatthour", "Thousands of dollars": "thousands of us dollars (USD)", "Million Btu per barrel": "million btu per barrel", "Million Btu": "million btu", "Millions of chained 2012 dollars": "millions of chained (2012) us dollars (USD)", "Millions of current dollars": "millions of us dollars (USD)", "Thousand barrels": "thousand barrels", "Barrels": "barrels", "Kilowatthours": "kilowatthours", "Million chained (2012) dollars": "millions of chained (2012) us dollars (USD)", "Thousand Btu per chained (2012) dollar": "thousand btu per chained (2012) us dollars (USD)", "Thousand cubic feet": "thousand cubic feet", } ) self.test_notation() self.drop_rows() # remap regions to defaults self.remap() def remap(self): if self.version in {"windc_2_0_1", "windc_2_1"}: for k in self.notation_link: for d, nl in self.notation_link[k]: for kk, vv in mappings.maps.items(): if nl in vv.keys() and nl != mappings.default[kk]: print( f"'{d}' :: '{k}' is linked to '{nl}' and is being remapped to '{mappings.default[kk]}'" ) # remap to default format self.data[k][d] = self.data[k][d].map( dict( zip( mappings.maps[kk][nl], mappings.maps[kk][mappings.default[kk]], ) ) ) # add new notation links and keep track of ones to remove in the next step to_remove = {} for k in self.notation_link.keys(): to_remove[k] = [] for d, nl in self.notation_link[k]: for kk, vv in mappings.maps.items(): if nl in vv.keys() and nl != mappings.default[kk]: to_remove[k].append((d, nl)) self.notation_link[k].append((d, mappings.default[kk])) # remove old notation links for k in to_remove.keys(): for d, nl in to_remove[k]: self.notation_link[k].pop(self.notation_link[k].index((d, nl))) def transform(self): if self.version == "windc_2_0_1": from .windc_2_0_1 import xfrm # transform CFS data self.data["cfs_st"], self.data["cfs_ma"] = xfrm.cfs(self.data["cfs"]) # transform bea_gsp data self.data["bea_gsp"] = xfrm.gsp(self.data["bea_gsp"]) # transform usda_nass data self.data["usda_nass"] = xfrm.usda_nass(self.data["usda_nass"]) # transform census_sgf data self.data["census_sgf"] = xfrm.census_sgf(self.data["census_sgf"]) # transform state_exim data self.data["state_exim"] = xfrm.state_exim(self.data["state_exim"]) # transform eia_heatrate data within class to allow access to some data # fill years in notation but not in data with 2005 values df = [self.data["eia_heatrate"]] for i in self.windc_notation["year"]: if i not in set(self.data["eia_heatrate"]["year"]): t = self.data["eia_heatrate"][ self.data["eia_heatrate"]["year"] == "2005" ].copy() t["year"] = i df.append(t) df = pd.concat(df, ignore_index=True) self.data["eia_heatrate"] = copy.deepcopy(df) if self.version == "windc_2_1": from .windc_2_1 import xfrm # transform CFS data self.data["cfs_st"], self.data["cfs_ma"] = xfrm.cfs(self.data["cfs"]) # transform bea_gsp data self.data["bea_gsp"] = xfrm.gsp(self.data["bea_gsp"]) # transform usda_nass data self.data["usda_nass"] = xfrm.usda_nass(self.data["usda_nass"]) # transform census_sgf data self.data["census_sgf"] = xfrm.census_sgf(self.data["census_sgf"]) # transform state_exim data self.data["state_exim"] = xfrm.state_exim(self.data["state_exim"]) # transform eia_heatrate data within class to allow access to some data # fill years in notation but not in data with 2005 values df = [self.data["eia_heatrate"]] for i in self.windc_notation["year"]: if i not in set(self.data["eia_heatrate"]["year"]): t = self.data["eia_heatrate"][ self.data["eia_heatrate"]["year"] == "2005" ].copy() t["year"] = i df.append(t) df = pd.concat(df, ignore_index=True) self.data["eia_heatrate"] = copy.deepcopy(df) def apply_gams_labels(self): if self.version in {"windc_2_0_1", "windc_2_1"}: # eia_emissions self.data["eia_emissions"]["gams.sector"] = self.data["eia_emissions"][ "sector" ].map( dict( zip( gams_windc.gams_maps["eia_emissions"]["eia_sector"], gams_windc.gams_maps["eia_emissions"]["windc_label"], ) ) ) # bea_gsp self.data["bea_gsp"]["gams.ComponentName"] = self.data["bea_gsp"][ "ComponentName" ].map( dict( zip( gams_windc.gams_maps["bea_gsp"]["bea_code"], gams_windc.gams_maps["bea_gsp"]["windc_label"], ) ) ) # eia_heatrate self.data["eia_heatrate"]["gams.variable"] = self.data["eia_heatrate"][ "variable" ].map( dict( zip( gams_windc.gams_maps["eia_gen"]["eia_technologies"], gams_windc.gams_maps["eia_gen"]["windc_label"], ) ) ) # bea_pce self.data["bea_pce"]["gams.Description"] = self.data["bea_pce"][ "Description" ].map( dict( zip( gams_windc.gams_maps["bea_pce"]["pce_description"], gams_windc.gams_maps["bea_pce"]["windc_label"], ) ) ) # census_sgf self.data["census_sgf"]["gams.Category"] = self.data["census_sgf"][ "Category" ].map( dict( zip( gams_windc.gams_maps["census_sgf"]["sgf_category"], gams_windc.gams_maps["census_sgf"]["windc_label"], ) ) ) # bea_supply_det self.data["bea_supply_det"]["gams.IOCode"] = self.data["bea_supply_det"][ "IOCode" ].map( dict( zip( gams_windc.gams_maps["bea_all_det"]["bea_code"], gams_windc.gams_maps["bea_all_det"]["windc_label"], ) ) ) self.data["bea_supply_det"]["gams.Commodities/Industries"] = self.data[ "bea_supply_det" ]["Commodities/Industries"].map( dict( zip( gams_windc.gams_maps["bea_all_det"]["bea_code"], gams_windc.gams_maps["bea_all_det"]["windc_label"], ) ) ) # bea_use_det self.data["bea_use_det"]["gams.IOCode"] = self.data["bea_use_det"][ "IOCode" ].map( dict( zip( gams_windc.gams_maps["bea_all_det"]["bea_code"], gams_windc.gams_maps["bea_all_det"]["windc_label"], ) ) ) self.data["bea_use_det"]["gams.Commodities/Industries"] = self.data[ "bea_use_det" ]["Commodities/Industries"].map( dict( zip( gams_windc.gams_maps["bea_all_det"]["bea_code"], gams_windc.gams_maps["bea_all_det"]["windc_label"], ) ) ) # bea_supply self.data["bea_supply"]["gams.IOCode"] = self.data["bea_supply"][ "IOCode" ].map( dict( zip( gams_windc.gams_maps["bea_all"]["bea_code"], gams_windc.gams_maps["bea_all"]["windc_label"], ) ) ) self.data["bea_supply"]["gams.Commodities/Industries"] = self.data[ "bea_supply" ]["Commodities/Industries"].map( dict( zip( gams_windc.gams_maps["bea_all"]["bea_code"], gams_windc.gams_maps["bea_all"]["windc_label"], ) ) ) # bea_use self.data["bea_use"]["gams.IOCode"] = self.data["bea_use"]["IOCode"].map( dict( zip( gams_windc.gams_maps["bea_all"]["bea_code"], gams_windc.gams_maps["bea_all"]["windc_label"], ) ) ) self.data["bea_use"]["gams.Commodities/Industries"] = self.data["bea_use"][ "Commodities/Industries" ].map( dict( zip( gams_windc.gams_maps["bea_all"]["bea_code"], gams_windc.gams_maps["bea_all"]["windc_label"], ) ) ) def set_gather(self, columns): t = set() for col in columns: for k, v in self.data.items(): if col in v.columns: t.update(set(v[col])) # remove any nan values from returned set return t - {np.nan} def gdx_data(self): if self.version == "windc_2_0_1": from .windc_2_0_1 import gdx_data return gdx_data.build_data(self.version, self.windc_notation, self.data) if self.version == "windc_2_1": from .windc_2_1 import gdx_data return gdx_data.build_data(self.version, self.windc_notation, self.data) def export_gdx(self): from windc_data.gmsxfr import GdxContainer # write gdx gdx = GdxContainer(self.gams_sysdir) gdx.add_to_gdx( self.gdx_data(), standardize_data=True, inplace=True, quality_checks=False ) gdx.write_gdx( os.path.join(os.getcwd(), "windc_base.gdx"), compress=True, ) def to_csv(self, output_dir=None): if output_dir == None: self.output_dir = os.path.join(os.getcwd(), "standarized_data") else: self.output_dir = os.path.abspath(output_dir) if os.path.isdir(self.output_dir) == False: os.mkdir(self.output_dir) for k, v in self.data.items(): v.to_csv(os.path.join(self.output_dir, f"{k}.csv"))
35.721718
119
0.402435
5,104
59,048
4.498824
0.104624
0.035885
0.026479
0.019249
0.818613
0.8025
0.778155
0.759124
0.742096
0.738307
0
0.02377
0.477764
59,048
1,652
120
35.743341
0.720855
0.033143
0
0.755116
0
0.002117
0.25021
0.010294
0
0
0
0
0
1
0.015526
false
0.000706
0.009174
0
0.031052
0.01976
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
34b7250f90d30137595b57354bcacb36af28ebc0
22,300
py
Python
example/auto_runner/run_dgl.py
SJTU-IPADS/fgnn-artifacts
c96e7ec8204d767152958dc63a764466e90424fd
[ "Apache-2.0" ]
23
2022-01-25T13:28:51.000Z
2022-03-23T07:05:47.000Z
example/auto_runner/run_dgl.py
SJTU-IPADS/gnnlab
5c73564e4a9bd5deeff7eed0b923c115ccba34d7
[ "Apache-2.0" ]
null
null
null
example/auto_runner/run_dgl.py
SJTU-IPADS/gnnlab
5c73564e4a9bd5deeff7eed0b923c115ccba34d7
[ "Apache-2.0" ]
1
2022-02-28T18:48:56.000Z
2022-02-28T18:48:56.000Z
from common import * import datetime import argparse import time here = os.path.abspath(os.path.dirname(__file__)) app_dir = os.path.join(here, '../dgl/multi_gpu') """ if log_dir is not None, it will only parse logs """ def motivation_test(log_folder=None): tic = time.time() if log_folder: mock = True log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: mock = False log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=2, num_col=4 ).update_col_definition( col_id=0, definition='sample_time' ).update_col_definition( col_id=1, definition='copy_time' ).update_col_definition( col_id=2, definition='train_time' ).update_col_definition( col_id=3, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 3], BOOL_use_gpu_sampling='use_gpu_sampling' ).update_row_definition( row_id=1, col_range=[0, 3], BOOL_use_gpu_sampling='no_use_gpu_sampling' ).create() ConfigList( test_group_name='DGL motivation test' ).select( 'app', [App.gcn] ).select( 'dataset', [Dataset.papers100M] ).override( 'num_epoch', [10] ).override( 'num_sampling_worker', [24] # Because it may race with extracting. ).override( 'BOOL_use_gpu_sampling', ['use_gpu_sampling', 'no_use_gpu_sampling'] ).override( 'BOOL_pipelining', ['no_pipelining'] ).override( 'devices', ['0'], # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('motivation test uses {:.4f} secs'.format(toc - tic)) def breakdown_test(log_folder=None): tic = time.time() if log_folder: mock = True log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: mock = False log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=12, num_col=3 ).update_col_definition( col_id=0, definition='sample_time' ).update_col_definition( col_id=1, definition='copy_time' ).update_col_definition( col_id=2, definition='train_time' ).update_row_definition( row_id=0, col_range=[0, 2], app=App.gcn, dataset=Dataset.products ).update_row_definition( row_id=1, col_range=[0, 2], app=App.gcn, dataset=Dataset.papers100M ).update_row_definition( row_id=2, col_range=[0, 2], app=App.gcn, dataset=Dataset.twitter ).update_row_definition( row_id=3, col_range=[0, 2], app=App.gcn, dataset=Dataset.uk_2006_05 ).update_row_definition( row_id=4, col_range=[0, 2], app=App.graphsage, dataset=Dataset.products ).update_row_definition( row_id=5, col_range=[0, 2], app=App.graphsage, dataset=Dataset.papers100M ).update_row_definition( row_id=6, col_range=[0, 2], app=App.graphsage, dataset=Dataset.twitter ).update_row_definition( row_id=7, col_range=[0, 2], app=App.graphsage, dataset=Dataset.uk_2006_05 ).update_row_definition( row_id=8, col_range=[0, 2], app=App.pinsage, dataset=Dataset.products ).update_row_definition( row_id=9, col_range=[0, 2], app=App.pinsage, dataset=Dataset.papers100M ).update_row_definition( row_id=10, col_range=[0, 2], app=App.pinsage, dataset=Dataset.twitter ).update_row_definition( row_id=11, col_range=[0, 2], app=App.pinsage, dataset=Dataset.uk_2006_05 ).create() ConfigList( test_group_name='DGL breakdown test' ).select( 'app', [App.gcn, App.graphsage, App.pinsage] ).override( 'num_epoch', [10] ).combo( 'app', [App.pinsage], 'num_sampling_worker', [40] # ).combo( # 'app', # [App.gcn, App.graphsage], # 'num_sampling_worker', # [8] ).combo( 'app', [App.gcn], 'fanout', ['5 10 15'] ).combo( 'app', [App.graphsage], 'fanout', ['25 10'] # ).combo( # 'app', # [App.pinsage], # 'num_epoch', # [1] ).combo( 'app', [App.gcn, App.graphsage], 'BOOL_use_gpu_sampling', ['use_gpu_sampling'] ).override( 'BOOL_pipelining', ['no_pipelining'] ).override( 'devices', ['0'], ).combo( 'dataset', [Dataset.uk_2006_05], 'BOOL_validate_configs', ['validate_configs'] ).combo( 'app', [App.pinsage], 'BOOL_validate_configs', ['validate_configs'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('breakdown test uses {:.4f} secs'.format(toc - tic)) def pinsage_breakdown_test(log_folder=None, mock=False): tic = time.time() if log_folder: log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=4, num_col=3 ).update_col_definition( col_id=0, definition='sample_time' ).update_col_definition( col_id=1, definition='copy_time' ).update_col_definition( col_id=2, definition='train_time' ).update_row_definition( row_id=0, col_range=[0, 2], app=App.pinsage, dataset=Dataset.products ).update_row_definition( row_id=1, col_range=[0, 2], app=App.pinsage, dataset=Dataset.twitter ).update_row_definition( row_id=2, col_range=[0, 2], app=App.pinsage, dataset=Dataset.papers100M ).update_row_definition( row_id=3, col_range=[0, 2], app=App.pinsage, dataset=Dataset.uk_2006_05 ).create() ConfigList( test_group_name='DGL PinSAGE breakdown test' ).select( 'app', [App.pinsage] ).override( 'num_epoch', [10] ).override( 'BOOL_use_gpu_sampling', ['use_gpu_sampling'] ).override( 'BOOL_pipelining', ['no_pipelining'] ).override( 'devices', ['0'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('pinsage breakdown test uses {:.4f} secs'.format(toc - tic)) def scalability_test(log_folder=None, mock=False): tic = time.time() if log_folder: log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=8, num_col=4 ).update_col_definition( col_id=0, definition='sample_time' ).update_col_definition( col_id=1, definition='copy_time' ).update_col_definition( col_id=2, definition='train_time' ).update_col_definition( col_id=3, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 2], devices='0', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=1, col_range=[0, 2], devices='0 1', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=2, col_range=[0, 2], devices='0 1 2', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=3, col_range=[0, 2], devices='0 1 2 3', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=4, col_range=[0, 2], devices='0 1 2 3 4', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=5, col_range=[0, 2], devices='0 1 2 3 4 5', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=6, col_range=[0, 2], devices='0 1 2 3 4 5 6', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=7, col_range=[0, 2], devices='0 1 2 3 4 5 6 7', BOOL_pipelining='no_pipelining' ).update_row_definition( row_id=0, col_range=[3, 3], devices='0', BOOL_pipelining='pipelining' ).update_row_definition( row_id=1, col_range=[3, 3], devices='0 1', BOOL_pipelining='pipelining' ).update_row_definition( row_id=2, col_range=[3, 3], devices='0 1 2', BOOL_pipelining='pipelining' ).update_row_definition( row_id=3, col_range=[3, 3], devices='0 1 2 3', BOOL_pipelining='pipelining' ).update_row_definition( row_id=4, col_range=[3, 3], devices='0 1 2 3 4', BOOL_pipelining='pipelining' ).update_row_definition( row_id=5, col_range=[3, 3], devices='0 1 2 3 4 5', BOOL_pipelining='pipelining' ).update_row_definition( row_id=6, col_range=[3, 3], devices='0 1 2 3 4 5 6', BOOL_pipelining='pipelining' ).update_row_definition( row_id=7, col_range=[3, 3], devices='0 1 2 3 4 5 6 7', BOOL_pipelining='pipelining' ).create() ConfigList( test_group_name='DGL scalability test' ).select( 'app', [App.gcn] ).select( 'dataset', [Dataset.papers100M] ).override( 'fanout', ['5 10 15'] ).override( 'num_epoch', [10] ).override( 'devices', ['0', '0 1', '0 1 2', '0 1 2 3', '0 1 2 3 4', '0 1 2 3 4 5', '0 1 2 3 4 5 6', '0 1 2 3 4 5 6 7'], ).override( 'BOOL_pipelining', ['pipelining', 'no_pipelining'] ).override( 'BOOL_use_gpu_sampling', ['use_gpu_sampling'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir, left_wrap='', right_wrap='', sep='\t' ) toc = time.time() print('scalability test uses {:.4f} secs'.format(toc - tic)) def scalability_twitter_test(log_folder=None, mock=False): tic = time.time() if log_folder: log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=8, num_col=1 ).update_col_definition( col_id=0, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 0], devices='0', ).update_row_definition( row_id=1, col_range=[0, 0], devices='0 1', ).update_row_definition( row_id=2, col_range=[0, 0], devices='0 1 2', ).update_row_definition( row_id=3, col_range=[0, 0], devices='0 1 2 3', ).update_row_definition( row_id=4, col_range=[0, 0], devices='0 1 2 3 4', ).update_row_definition( row_id=5, col_range=[0, 0], devices='0 1 2 3 4 5', ).update_row_definition( row_id=6, col_range=[0, 0], devices='0 1 2 3 4 5 6', ).update_row_definition( row_id=7, col_range=[0, 0], devices='0 1 2 3 4 5 6 7', ).create() ConfigList( test_group_name='DGL Twitter scalability test' ).select( 'app', [App.gcn] ).select( 'dataset', [Dataset.twitter] ).override( 'fanout', ['5 10 15'] ).override( 'num_epoch', [10] ).override( 'devices', ['0', '0 1', '0 1 2', '0 1 2 3', '0 1 2 3 4', '0 1 2 3 4 5', '0 1 2 3 4 5 6', '0 1 2 3 4 5 6 7'], ).override( 'BOOL_pipelining', ['pipelining'] ).override( 'BOOL_use_gpu_sampling', ['use_gpu_sampling'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir, left_wrap='', right_wrap='', sep='\t' ) toc = time.time() print('scalability twitter test uses {:.4f} secs'.format(toc - tic)) def overall_perf_test(log_folder=None): tic = time.time() if log_folder: mock = True log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: mock = False log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=6, num_col=1 ).update_col_definition( col_id=0, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 0], app=App.gcn, dataset=Dataset.products ).update_row_definition( row_id=1, col_range=[0, 0], app=App.gcn, dataset=Dataset.papers100M ).update_row_definition( row_id=2, col_range=[0, 0], app=App.gcn, dataset=Dataset.twitter ).update_row_definition( row_id=3, col_range=[0, 0], app=App.graphsage, dataset=Dataset.products ).update_row_definition( row_id=4, col_range=[0, 0], app=App.graphsage, dataset=Dataset.papers100M ).update_row_definition( row_id=5, col_range=[0, 0], app=App.graphsage, dataset=Dataset.twitter ).create() ConfigList( test_group_name='DGL overall performance test' ).select( 'app', [App.gcn, App.graphsage] ).select( 'dataset', [Dataset.products, Dataset.papers100M, Dataset.twitter] ).override( 'num_epoch', [10] ).override( 'devices', ['0 1 2 3 4 5 6 7'], ).override( 'BOOL_use_gpu_sampling', ['use_gpu_sampling'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).override( 'BOOL_pipelining', ['pipelining'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('DGL overall performance test uses {:.4f} secs'.format(toc - tic)) def pinsage_overall_test(log_folder=None, mock=False): tic = time.time() if log_folder: log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=4, num_col=1 ).update_col_definition( col_id=0, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 0], app=App.pinsage, dataset=Dataset.products ).update_row_definition( row_id=1, col_range=[0, 0], app=App.pinsage, dataset=Dataset.twitter ).update_row_definition( row_id=2, col_range=[0, 0], app=App.pinsage, dataset=Dataset.papers100M ).update_row_definition( row_id=3, col_range=[0, 0], app=App.pinsage, dataset=Dataset.uk_2006_05 ).create() ConfigList( test_group_name='DGL PinSAGE overall performance test' ).select( 'app', [App.pinsage] ).override( 'num_epoch', [10] ).override( 'devices', ['0 1 2 3 4 5 6 7'], ).override( 'BOOL_use_gpu_sampling', ['use_gpu_sampling'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).override( 'BOOL_pipelining', ['pipelining'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('DGL Pinsage overall performance test uses {:.4f} secs'.format(toc - tic)) def cpu_overall_perf_test(log_folder=None): tic = time.time() if log_folder: mock = True log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: mock = False log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=6, num_col=1 ).update_col_definition( col_id=0, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 0], app=App.gcn, dataset=Dataset.products ).update_row_definition( row_id=1, col_range=[0, 0], app=App.gcn, dataset=Dataset.papers100M ).update_row_definition( row_id=2, col_range=[0, 0], app=App.gcn, dataset=Dataset.twitter ).update_row_definition( row_id=3, col_range=[0, 0], app=App.graphsage, dataset=Dataset.products ).update_row_definition( row_id=4, col_range=[0, 0], app=App.graphsage, dataset=Dataset.papers100M ).update_row_definition( row_id=5, col_range=[0, 0], app=App.graphsage, dataset=Dataset.twitter ).create() ConfigList( test_group_name='DGL CPU overall performance test' ).override( 'num_epoch', [10] ).combo( 'app', [App.pinsage], 'num_epoch', [1] ).override( 'devices', ['0 1 2 3 4 5 6 7'], ).override( 'num_sampling_worker', [24] ).override( 'BOOL_pipelining', ['pipelining'] ).combo( 'app', [App.gcn, App.graphsage], 'BOOL_use_gpu_sampling', ['no_use_gpu_sampling'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('DGL CPU overall performance test uses {:.4f} secs'.format(toc - tic)) def motivation2_test(log_folder, mock): tic = time.time() if log_folder: log_dir = os.path.join(os.path.join(here, f'run-logs/{log_folder}')) else: log_dir = os.path.join( here, f'run-logs/logs_dgl_{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}') log_table = LogTable( num_row=1, num_col=4 ).update_col_definition( col_id=0, definition='sample_time' ).update_col_definition( col_id=1, definition='copy_time' ).update_col_definition( col_id=2, definition='train_time' ).update_col_definition( col_id=3, definition='epoch_time' ).update_row_definition( row_id=0, col_range=[0, 3], app=App.gcn ).create() ConfigList( test_group_name='DGL Motivation 2 test' ).select( 'app', [App.gcn] ).select( 'dataset', [Dataset.papers100M] ).override( 'num_epoch', [3] ).override( 'devices', ['0 1 2 3 4 5 6 7'], ).override( 'num_sampling_worker', [40] ).override( 'BOOL_pipelining', ['no_pipelining'] ).override( 'BOOL_use_gpu_sampling', ['no_use_gpu_sampling'] # ).override( # 'BOOL_validate_configs', # ['validate_configs'] ).run( appdir=app_dir, logdir=log_dir, mock=mock ).parse_logs( logtable=log_table, logdir=log_dir ) toc = time.time() print('DGL motivation 2 test uses {:.4f} secs'.format(toc - tic)) if __name__ == '__main__': argparser = argparse.ArgumentParser("DGL runner") argparser.add_argument('-l', '--log-folder', default=None) argparser.add_argument('-m', '--mock', action='store_true', default=False) args = argparser.parse_args() # motivation_test(args.log_folder) # breakdown_test(args.log_folder) # scalability_test(args.log_folder, args.mock) # scalability_pipeline_test(args.log_folder, args.mock) # overall_perf_test(args.log_folder) # cpu_overall_perf_test(args.log_folder) # motivation2_test(args.log_folder, args.mock) # scalability_twitter_test(args.log_folder, args.mock) pinsage_breakdown_test(args.log_folder, args.mock) # pinsage_overall_test(args.log_folder, args.mock)
25
95
0.546951
2,745
22,300
4.182514
0.051002
0.04625
0.09764
0.113056
0.934849
0.916558
0.89217
0.858636
0.83059
0.747844
0
0.037505
0.318475
22,300
891
96
25.028058
0.717923
0.052197
0
0.909091
0
0.011524
0.160493
0.051215
0
0
0
0
0
1
0.011524
false
0
0.005122
0
0.016645
0.011524
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
34bde00beef2203722bfd049aaf7be94485c3d29
226
py
Python
src/socialprofile/middleware.py
DLRSP/django-sp
9079358a4fc054f1a5afb056ccfd6a8b8afb36fa
[ "MIT" ]
1
2022-01-11T07:25:17.000Z
2022-01-11T07:25:17.000Z
src/socialprofile/middleware.py
DLRSP/django-sp
9079358a4fc054f1a5afb056ccfd6a8b8afb36fa
[ "MIT" ]
16
2021-12-20T01:30:34.000Z
2022-03-31T01:38:59.000Z
src/socialprofile/middleware.py
DLRSP/django-sp
9079358a4fc054f1a5afb056ccfd6a8b8afb36fa
[ "MIT" ]
null
null
null
import django.contrib.sessions.middleware import user_sessions.middleware class UserSessionsMiddleware( user_sessions.middleware.SessionMiddleware, # django.contrib.sessions.middleware.SessionMiddleware, ): pass
22.6
59
0.818584
21
226
8.714286
0.47619
0.393443
0.229508
0.338798
0
0
0
0
0
0
0
0
0.110619
226
9
60
25.111111
0.910448
0.234513
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.166667
0.333333
0
0.5
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
8
550c3a6c2006845b1b7d1b59a86b019b7d5bee53
5,674
py
Python
estrutura_condicional/questao_2.py
burgues0/Trabalhos_Python
996e3862c521f63b51a8479d200efa7db0a42c48
[ "MIT" ]
null
null
null
estrutura_condicional/questao_2.py
burgues0/Trabalhos_Python
996e3862c521f63b51a8479d200efa7db0a42c48
[ "MIT" ]
null
null
null
estrutura_condicional/questao_2.py
burgues0/Trabalhos_Python
996e3862c521f63b51a8479d200efa7db0a42c48
[ "MIT" ]
null
null
null
#Algoritmos Computacionais e Estruturas de Dados #1a Lista de Exercícios #Prof.: Laercio Brito #Dia: 23/08/2021 #Turma 2BINFO #Alunos: #Victor Kauã Martins Nunes #Dora Tezulino Santos #Guilherme de Almeida Torrão #Mauro Campos Pahoor #Victor Pinheiro Palmeira balas=5 rodando=True #bool para checar se outra checagem de tentativa do caçador deva ocorrer valor1 = int(input('O Marciano está em qual das 1 a 100 arvores? Digite um valor nesse espaço: \n')) if(valor1<1 or valor1>100): #condicional de funcionamento do programa print('O valor da arvore não está entre 1 e 100.') else: if(rodando==True): valor2 = int(input('Digite um número para o caçador verificar a localidade do Marciano entre 1 e 100: \n')) #primeiro tiro if(valor2<1 or valor2>100): #condicional de funcionamento do programa(se repete ao longo das tentativas) print("\nValor inválido.") else: if(valor1==valor2): #caso o caçador acerte print('\nBOA!,VOCÊ ACERTOU O MARCIANO!') #caso acerte troca a condição pra False e para as checagens rodando=False else: if(valor1>valor2): #caso ele erre balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a direita.') elif(valor1<valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a esquerda.') if(rodando==True): valor2 = int(input('Digite um número para o caçador verificar a localidade do Marciano entre 1 e 100: \n')) #segundo tiro if(valor2<1 or valor2>100): print("\nValor inválido.") else: if(valor1==valor2): print('\nBOA!,VOCÊ ACERTOU O MARCIANO!') #caso acerte troca a condição pra False e para as checagens rodando=False else: if(valor1>valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a direita') elif(valor1<valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a esquerda') if(rodando==True): valor2 = int(input('Digite um número para o caçador verificar a localidade do Marciano entre 1 e 100: \n')) #terceiro tiro if(valor2<1 or valor2>100): print("\nValor inválido.") else: if(valor1==valor2): print('\nBOA!,VOCÊ ACERTOU O MARCIANO! Game Over.') #caso acerte troca a condição pra False e para as checagens rodando=False else: if(valor1>valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a direita') elif(valor1<valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a esquerda') if(rodando==True): valor2 = int(input('Digite um número para o caçador verificar a localidade do Marciano entre 1 e 100: \n')) #quarto tiro if(valor2<1 or valor2>100): print("\nValor inválido.") else: if(valor1==valor2): print('\nBOA!,VOCÊ ACERTOU O MARCIANO! Game Over.') #caso acerte troca a condição pra False e para as checagens rodando=False else: if(valor1>valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a direita') elif(valor1<valor2): balas-=1 print(f'\nVocê errou.Você ainda tem {balas} balas.') print('Tente Novamente até acabar suas balas.') print('O marciano está mais a esquerda') if(rodando==True): valor2 = int(input('Digite um número para o caçador verificar a localidade do Marciano entre 1 e 100: \n')) #quinto tiro if(valor2<1 or valor2>100): print("\nValor inválido.") else: if(valor1==valor2): print('\nBOA!,VOCÊ ACERTOU O MARCIANO!') #caso acerte troca a condição pra False e para as checagens rodando=False else: if(valor1>valor2): balas-=1 print('\nVocê errou.Você não tem mais balas.') print('O marciano estava mais a direita. Você foi levado para Marte! \n Game Over.') elif(valor1<valor2): balas-=1 print('\nVocê errou.Você não tem mais balas.') print('O marciano estava mais a esquerda. Você foi levado para Marte! \n Game Over.') else: print("\n Game Over.")
46.508197
130
0.547233
687
5,674
4.519651
0.186317
0.057971
0.038647
0.057971
0.828663
0.826087
0.800644
0.780998
0.761031
0.761031
0
0.033499
0.363412
5,674
122
131
46.508197
0.826135
0.14258
0
0.90099
0
0
0.397521
0
0
0
0
0
0
1
0
false
0
0
0
0
0.39604
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
32c9a0bcc83d49ef874ddae2351ea98be641bd49
774
py
Python
utils/gui_update_deco.py
normoes/money
f260c104504b97b74b198e0485c7f71b160a641b
[ "MIT" ]
null
null
null
utils/gui_update_deco.py
normoes/money
f260c104504b97b74b198e0485c7f71b160a641b
[ "MIT" ]
null
null
null
utils/gui_update_deco.py
normoes/money
f260c104504b97b74b198e0485c7f71b160a641b
[ "MIT" ]
null
null
null
def gui_show_entries(f): def new_f(*args, **kwarg): # arrgs[0] represents self, which is the first parameter result = None print 'args:', args print 'kwargs:', kwarg if args: f(*args, **kwarg) args[0].show_entries() else: print 'no self (class) given' return result return new_f def gui_populate_categories(f): def new_f(*args, **kwarg): # arrgs[0] represents self, which is the first parameter result = None print 'args:', args print 'kwargs:', kwarg if args: f(*args, **kwarg) args[0].populate_categories() else: print 'no self (class) given' return result return new_f
26.689655
64
0.537468
94
774
4.319149
0.308511
0.039409
0.098522
0.039409
0.827586
0.827586
0.827586
0.827586
0.827586
0.827586
0
0.008065
0.359173
774
28
65
27.642857
0.810484
0.140827
0
0.833333
0
0
0.099698
0
0
0
0
0
0
0
null
null
0
0
null
null
0.25
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
32d91830d585e7ff2c82b4ac6b7d8828902d0df7
48
py
Python
apps/events/errors.py
CosmosTUe/Cosmos
cec2541d3f8ea1944edfaab2090916ba66f9d2f3
[ "MIT" ]
1
2021-02-01T19:27:07.000Z
2021-02-01T19:27:07.000Z
apps/events/errors.py
CosmosTUe/Cosmos
cec2541d3f8ea1944edfaab2090916ba66f9d2f3
[ "MIT" ]
79
2020-08-05T09:01:00.000Z
2022-03-24T11:27:21.000Z
apps/events/errors.py
CosmosTUe/Cosmos
cec2541d3f8ea1944edfaab2090916ba66f9d2f3
[ "MIT" ]
3
2021-02-22T18:36:52.000Z
2021-10-13T17:05:44.000Z
END_DATE_BEFORE_START = "end_date_before_start"
24
47
0.875
8
48
4.5
0.5
0.388889
0.722222
1
0
0
0
0
0
0
0
0
0.0625
48
1
48
48
0.8
0
0
0
0
0
0.4375
0.4375
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
fd1c4f6e4dfabfc9e841c97b73d88833a91895e7
45,214
py
Python
block_identification/sample/auto_id_compare.py
Smithsonian/DPO_OCR
094cfe61d67b2e251e51f56072a5a6ce98588978
[ "Apache-2.0" ]
1
2021-11-08T09:46:01.000Z
2021-11-08T09:46:01.000Z
block_identification/sample/auto_id_compare.py
Smithsonian/DPO_OCR
094cfe61d67b2e251e51f56072a5a6ce98588978
[ "Apache-2.0" ]
1
2021-03-01T18:26:18.000Z
2021-03-01T18:26:18.000Z
block_identification/sample/auto_id_compare.py
Smithsonian/DPO_OCR
094cfe61d67b2e251e51f56072a5a6ce98588978
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # # Compare automatic block id using "training" set from human transcription # import io, json, sys, os, psycopg2, logging, subprocess, swifter, re, dateparser from glob import glob from pathlib import Path from psycopg2.extras import RealDictCursor from time import localtime, strftime from fuzzywuzzy import fuzz import pandas as pd from datetime import date from tqdm import tqdm import numpy as np from multiprocessing import Pool ver = "0.2.1" ##Import settings from settings.py file import settings ############################################ # Logging ############################################ if not os.path.exists('logs'): os.makedirs('logs') current_time = strftime("%Y%m%d%H%M%S", localtime()) logfile_name = 'comparison_{}.log'.format(current_time) logfile = 'logs/{logfile_name}'.format(logfile_name = logfile_name) # from http://stackoverflow.com/a/9321890 logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M:%S', filename=logfile, filemode='a') console = logging.StreamHandler() console.setLevel(logging.INFO) formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') console.setFormatter(formatter) logger1 = logging.getLogger("compare") logging.getLogger('compare').addHandler(console) logger1.info("compare version {}".format(ver)) ############################################ #OCR Database conn = psycopg2.connect(host = settings.ocr_host, database = settings.ocr_db, user = settings.ocr_user, password = settings.ocr_password, connect_timeout = 60) conn.autocommit = True db_cursor = conn.cursor(cursor_factory=RealDictCursor) query_transcription = """ SELECT DISTINCT collector as data, 'collector' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT verbatim_date as data, 'verbatim_date' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT verbatim_locality as data, 'verbatim_locality' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT country as data, 'country' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT state_territory as data, 'state_territory' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT district_county as data, 'district_county' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT precise_locality as data, 'precise_locality' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) UNION SELECT DISTINCT elevation as data, 'elevation' as field FROM ocr_transcription_ento WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE reference_size = %(refsize)s AND ref_or_test = 'ref' ) """ query_test = """ SELECT b.document_id, replace(d.filename, '.jpg', '') as filename, b.block::text, string_agg(a.word_text, ' ') as block_text FROM ocr_blocks b, ocr_documents d, ( SELECT document_id, block, word_line, word, word_text FROM ocr_entries WHERE document_id IN ( SELECT document_id FROM ocr_documents WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE ref_or_test = 'test' AND reference_size = %(refsize)s ) ) ORDER BY page, block, word_line, word ) a WHERE d.document_id = b.document_id AND a.document_id = b.document_id AND a.block = b.block AND b.confidence >= 0.85 GROUP BY b.document_id, b.block, d.filename """ # db_cursor.execute("DELETE FROM ocr_transcription_ento_auto") # db_cursor.execute("VACUUM ocr_transcription_ento_auto") # #for refsize in ['0.05', '0.1', '0.2', '0.3', '0.4', '0.5']: # for refsize in ['0.05', '0.1', '0.2']: # print(refsize) # db_cursor.execute(query_transcription, {'refsize': refsize}) # logger1.debug(db_cursor.query.decode("utf-8")) # transcription_data = pd.DataFrame(db_cursor.fetchall()) # db_cursor.execute(query_test, {'refsize': refsize}) # logger1.debug(db_cursor.query.decode("utf-8")) # test_data = pd.DataFrame(db_cursor.fetchall()) # for data_type in transcription_data['field'].unique(): # print("Processing {}...\n".format(data_type)) # for index, record in test_data.iterrows(): # #split string into all possible sequences # logger1.debug(record['block_text']) # block_text = record['block_text'].split(' ') # len_block_text = len(block_text) # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # for i in range(len_block_text-1): # for j in range(i+1, len_block_text): # #print(i, j) # this_text = ' '.join(block_text[i:j]) # #Get alpha chars only # alpha_block = re.sub(r'\W+ ,-/', '', this_text) # #Add space after periods # alpha_block = ' '.join(alpha_block.split()).replace(' .', '.').replace('.', '. ').strip() # if len(alpha_block) > 3: # #print(this_text) # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # logger1.debug(this_text) # results_df = pd.DataFrame(columns=('data', 'field', 'text', 'score1', 'score2', 'score3', 'score', 'string_len')) # for ind, rcrd in text_to_test.iterrows(): # #tr_data = transcription_data.copy() # tr_data = transcription_data[transcription_data.field == data_type].copy() # tr_data['score1'] = tr_data.apply(lambda row : fuzz.partial_ratio(rcrd['text'].lower(), row['data'].lower()), axis = 1) # tr_data['score2'] = tr_data.apply(lambda row : fuzz.ratio(rcrd['text'].lower(), row['data'].lower()), axis = 1) # tr_data['score'] = tr_data.apply(lambda row : row['score1'] + row['score2'], axis = 1).astype(int) # tr_data['score3'] = tr_data.apply(lambda row : fuzz.token_set_ratio(rcrd['text'].lower(), row['data'].lower()), axis = 1) # tr_data['text'] = rcrd['text'] # tr_data['string_len'] = rcrd['string_len'] # results_df = results_df.append(tr_data) # results_df['score'] = pd.to_numeric(results_df['score']) # results_df['score3'] = pd.to_numeric(results_df['score3']) # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # res = results_df.nlargest(1, ['score', 'string_len']) # if res.shape[0] > 0: # if res.iloc[0]['score'] > settings.insert_min: # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto (filename, {field}, reference_size) VALUES (%(document_id)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s".format(field = res.iloc[0]['field']), {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize}) # logger1.info(db_cursor.query.decode("utf-8")) # else: # #Check for token_set_ratio # max_score = results_df['score3'].max() # res_top = results_df[results_df.score3 == max_score] # #Choose string with the least number of words that has the max score # res = results_df.nsmallest(1, 'string_len') # if res.shape[0] > 0: # if res.iloc[0]['score3'] > settings.token_set_ratio_min: # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto (filename, {field}, reference_size) VALUES (%(document_id)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s".format(field = res.iloc[0]['field']), {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize}) # logger1.info(db_cursor.query.decode("utf-8")) # #Cleanup # for refsize in ['0.05', '0.1', '0.2']: # db_cursor.execute(query_transcription, {'refsize': refsize}) # transcription_data = pd.DataFrame(db_cursor.fetchall()) # for data_type in transcription_data['field'].unique(): # db_cursor.execute("UPDATE ocr_transcription_ento_auto SET {field} = REPLACE({field}, '. , ', '., ')".format(field = data_type)) # logger1.info(db_cursor.query.decode("utf-8")) ################## #GIS database conn2 = psycopg2.connect(host = settings.gis_host, database = settings.gis_db, user = settings.gis_user, password = settings.gis_password, connect_timeout = 60) db_cursor2 = conn2.cursor(cursor_factory=RealDictCursor) # #Get state/provinces from GIS database # db_cursor2.execute("SELECT name_1 as name, name_0 as country, 'locality:state' as name_type, uid FROM gadm1") # states = pd.DataFrame(db_cursor2.fetchall()) # logger1.debug(db_cursor2.query.decode("utf-8")) # #Get countries from GIS database db_cursor2.execute("SELECT name_0 as name, 'locality:country' as name_type, uid FROM gadm0") countries = pd.DataFrame(db_cursor2.fetchall()) logger1.debug(db_cursor2.query.decode("utf-8")) # #Get counties, state # db_cursor2.execute("SELECT name_2 || ' Co., ' || name_1 as name, 'locality:county' as name_type, uid FROM gadm2 WHERE name_0 = 'United States' AND type_2 = 'County'") # counties = pd.DataFrame(db_cursor2.fetchall()) # logger1.debug(db_cursor2.query.decode("utf-8")) # counties_list = pd.DataFrame(counties) # db_cursor2.execute("SELECT name_2 || ' ' || type_2 || ', ' || name_1 as name, 'locality:county' as name_type, uid FROM gadm2 WHERE name_0 = 'United States'") # counties = pd.DataFrame(db_cursor2.fetchall()) # logger1.debug(db_cursor2.query.decode("utf-8")) # counties_list = counties_list.append(counties, ignore_index=True) # db_cursor2.execute("SELECT DISTINCT g.name_2 || ', ' || s.abbreviation as name, 'locality:county' as name_type, g.uid FROM gadm2 g, us_state_abbreviations s WHERE g.name_1 = s.state AND g.name_0 = 'United States'") # counties = pd.DataFrame(db_cursor2.fetchall()) # logger1.debug(db_cursor2.query.decode("utf-8")) # counties_list = counties_list.append(counties, ignore_index=True) # db_cursor2.execute("SELECT DISTINCT g.name_2 || ' Co., ' || s.abbreviation as name, 'locality:county' as name_type, g.name_1 AS state, g.name_0 as country, g.uid FROM gadm2 g, us_state_abbreviations s WHERE g.name_1 = s.state AND g.name_0 = 'United States'") # counties = pd.DataFrame(db_cursor2.fetchall()) # logger1.debug(db_cursor2.query.decode("utf-8")) # counties_list = counties_list.append(counties, ignore_index=True) # #Close GIS database connection db_cursor2.close() conn2.close() # ################## # db_cursor.execute("DROP TABLE ocr_transcription_ento_auto_geo") # db_cursor.execute("CREATE TABLE ocr_transcription_ento_auto_geo AS SELECT * FROM ocr_transcription_ento_auto") # db_cursor.execute("ALTER TABLE ocr_transcription_ento_auto_geo ADD CONSTRAINT ocr_tra_ento_auto_geo_c UNIQUE (filename, reference_size)") # #country query_country = """ SELECT b.document_id, replace(d.filename, '.jpg', '') as filename, b.block::text, string_agg(a.word_text, ' ') as block_text FROM ocr_blocks b, ocr_documents d, ( SELECT document_id, block, word_line, word, word_text FROM ocr_entries WHERE document_id IN ( SELECT document_id FROM ocr_documents WHERE replace(filename, '.jpg', '') IN ( SELECT filename FROM ocr_auto_sample WHERE ref_or_test = 'test' AND reference_size = %(refsize)s ) ) ORDER BY page, block, word_line, word ) a WHERE d.document_id = b.document_id AND a.document_id = b.document_id AND a.block = b.block AND b.confidence >= 0.85 GROUP BY b.document_id, b.block, d.filename """ # query_state = """ # SELECT # b.document_id, # replace(d.filename, '.jpg', '') as filename, # b.block::text, # string_agg(a.word_text, ' ') as block_text # FROM # ocr_blocks b, # ocr_documents d, # ( # SELECT # document_id, # block, # word_line, # word, # word_text # FROM # ocr_entries # WHERE # document_id IN # ( # SELECT document_id FROM ocr_documents WHERE replace(filename, '.jpg', '') IN # ( # SELECT # filename # FROM # ocr_auto_sample # WHERE # ref_or_test = 'test' AND # reference_size = %(refsize)s # ) # ) # ORDER BY # page, block, word_line, word # ) a # WHERE # d.document_id = b.document_id AND # a.document_id = b.document_id AND # a.block = b.block AND # b.confidence >= 0.85 # GROUP BY # b.document_id, # b.block, # d.filename # """ # query_county = """ # SELECT # b.document_id, # replace(d.filename, '.jpg', '') as filename, # b.block::text, # string_agg(a.word_text, ' ') as block_text # FROM # ocr_blocks b, # ocr_documents d, # ( # SELECT # document_id, # block, # word_line, # word, # word_text # FROM # ocr_entries # WHERE # document_id IN # ( # SELECT document_id FROM ocr_documents WHERE replace(filename, '.jpg', '') IN # ( # SELECT # filename # FROM # ocr_auto_sample # WHERE # ref_or_test = 'test' AND # reference_size = %(refsize)s # ) # ) # ORDER BY # page, block, word_line, word # ) a # WHERE # d.document_id = b.document_id AND # a.document_id = b.document_id AND # a.block = b.block AND # b.confidence >= 0.85 # GROUP BY # b.document_id, # b.block, # d.filename # """ def match_country(this_record): try: record = this_record.iloc[0] except: return logger1.debug(record['block_text']) block_text = record['block_text'].split(' ') len_block_text = len(block_text) text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) for i in range(len_block_text-1): for j in range(i+1, len_block_text): #print(i, j) #this_text = ' '.join(block_text[i:j]) this_text = ' '.join(map(str, block_text[i:j])) alpha_block = re.sub(r'\W+ ,-/', '', this_text) #Add space after periods alpha_block = ' '.join(alpha_block.split()).replace(' .', '.').replace('.', '. ').strip() if len(alpha_block) > 3: #print(this_text) text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) logger1.debug(this_text) results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) results_df['score2'] = pd.to_numeric(results_df['score2']) results_df['string_len'] = pd.to_numeric(results_df['string_len']) for idx, rcrd in text_to_test.iterrows(): tr_data = countries[['name', 'uid']].copy() tr_data['score2'] = tr_data.apply(lambda row : fuzz.ratio(rcrd['text'].lower(), row['name'].lower()), axis = 1) tr_data['text'] = rcrd['text'] tr_data['string_len'] = rcrd['string_len'] results_df = results_df.append(tr_data) res = results_df.nlargest(1, ['score2', 'string_len']) if res.shape[0] > 0: logger1.info(res) if res.iloc[0]['score2'] > settings.geo_min: db_cursor.execute("INSERT INTO ocr_transcription_ento_auto (filename, {field}, reference_size) VALUES (%(filename)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s".format(field = 'country'), {'filename': record['filename'], 'text': res.iloc[0]['name'], 'reference_size': refsize}) logger1.info(db_cursor.query.decode("utf-8")) return res #match_country(record) #Check for country #for refsize in ['0.05', '0.1', '0.2', '0.3', '0.4', '0.5']: for refsize in ['0.05', '0.1', '0.2']: print(refsize) db_cursor.execute(query_country, {'refsize': refsize}) logger1.debug(db_cursor.query.decode("utf-8")) test_data = pd.DataFrame(db_cursor.fetchall()) df_split = np.array_split(test_data, test_data.size) pool = Pool(settings.pool_workers) df = pd.concat(pool.map(match_country, df_split)) pool.close() pool.join() # # for index, record in test_data.iterrows(): # # #split string into all possible sequences # # logger1.info(record['block_text']) # # block_text = record['block_text'].split(' ') # # len_block_text = len(block_text) # # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # # for i in range(len_block_text-1): # # for j in range(i+1, len_block_text): # # #print(i, j) # # this_text = ' '.join(block_text[i:j]) # # alpha_block = re.sub(r'\W+ ,-/', '', this_text).strip() # # if len(alpha_block) > 3: # # #print(this_text) # # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # # logger1.debug(this_text) # # results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) # # results_df['score2'] = pd.to_numeric(results_df['score2']) # # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # # for idx, rcrd in text_to_test.iterrows(): # # tr_data = countries[['name', 'uid']].copy() # # tqdm.pandas() # # tr_data['score2'] = tr_data.progress_apply(lambda row : fuzz.ratio(rcrd['text'], row['name']), axis = 1) # # tr_data['text'] = rcrd['text'] # # tr_data['string_len'] = rcrd['string_len'] # # results_df = results_df.append(tr_data) # # res = results_df.nlargest(1, ['score2', 'string_len']) # # if res.shape[0] > 0: # # print(res) # # if res.iloc[0]['score'] > settings.geo_min: # # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto_geo (filename, {field}, reference_size) VALUES (%(document_id)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s".format(field = 'country'), {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize}) # # logger1.info(db_cursor.query.decode("utf-8")) # def match_state(record): # logger1.debug(record['block_text']) # block_text = record['block_text'].str.split(' ').tolist()[0] # len_block_text = len(block_text) # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # for i in range(len_block_text-1): # for j in range(i+1, len_block_text): # #print(i, j) # #this_text = ' '.join(block_text[i:j]) # this_text = ' '.join(map(str, block_text[i:j])) # alpha_block = re.sub(r'\W+ ,-/', '', this_text) # #Add space after periods # alpha_block = ' '.join(alpha_block.split()).replace(' .', '.').replace('.', '. ').strip() # if len(alpha_block) > 3: # #print(this_text) # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # logger1.debug(this_text) # results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) # results_df['score2'] = pd.to_numeric(results_df['score2']) # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # for idx, rcrd in text_to_test.iterrows(): # tr_data = states[['name', 'uid', 'country']].copy() # tr_data['score2'] = tr_data.apply(lambda row : fuzz.ratio(rcrd['text'], row['name']), axis = 1) # tr_data['text'] = rcrd['text'] # tr_data['string_len'] = rcrd['string_len'] # results_df = results_df.append(tr_data) # res = results_df.nlargest(1, ['score2', 'string_len']) # if res.shape[0] > 0: # logger1.info(res) # if res.iloc[0]['score'] > settings.geo_min: # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto_geo (filename, state_territory, country, reference_size) VALUES (%(document_id)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s", {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize, 'country': res.iloc[0]['country']}) # logger1.info(db_cursor.query.decode("utf-8")) # return res # #Check for state/province # #for refsize in ['0.05', '0.1', '0.2', '0.3', '0.4', '0.5']: # for refsize in ['0.05', '0.1', '0.2']: # print(refsize) # db_cursor.execute(query_state, {'refsize': refsize}) # logger1.debug(db_cursor.query.decode("utf-8")) # test_data = pd.DataFrame(db_cursor.fetchall()) # df_split = np.array_split(test_data, settings.pool_workers * 4) # pool = Pool(settings.pool_workers) # df = pd.concat(pool.map(match_state, df_split)) # pool.close() # pool.join() # # for index, record in test_data.iterrows(): # # #split string into all possible sequences # # logger1.info(record['block_text']) # # block_text = record['block_text'].split(' ') # # len_block_text = len(block_text) # # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # # for i in range(len_block_text-1): # # for j in range(i+1, len_block_text): # # #print(i, j) # # this_text = ' '.join(block_text[i:j]) # # alpha_block = re.sub(r'\W+ ,-/', '', this_text).strip() # # if len(alpha_block) > 3: # # #print(this_text) # # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # # logger1.debug(this_text) # # results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) # # results_df['score2'] = pd.to_numeric(results_df['score2']) # # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # # for idx, rcrd in text_to_test.iterrows(): # # tr_data = states[['name', 'uid']].copy() # # tqdm.pandas() # # tr_data['score2'] = tr_data.progress_apply(lambda row : fuzz.ratio(rcrd['text'], row['name']), axis = 1) # # tr_data['text'] = rcrd['text'] # # tr_data['string_len'] = rcrd['string_len'] # # results_df = results_df.append(tr_data) # # res = results_df.nlargest(1, ['score2', 'string_len']) # # if res.shape[0] > 0: # # print(res) # # if res.iloc[0]['score'] > settings.geo_min: # # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto_geo (filename, {field}, reference_size) VALUES (%(document_id)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s".format(field = 'state_territory'), {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize}) # # logger1.info(db_cursor.query.decode("utf-8")) # def match_county(record): # logger1.debug(record['block_text']) # block_text = record['block_text'].str.split(' ').tolist()[0] # len_block_text = len(block_text) # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # for i in range(len_block_text-1): # for j in range(i+1, len_block_text): # #print(i, j) # #this_text = ' '.join(block_text[i:j]) # this_text = ' '.join(map(str, block_text[i:j])) # alpha_block = re.sub(r'\W+ ,-/', '', this_text) # #Add space after periods # alpha_block = ' '.join(alpha_block.split()).replace(' .', '.').replace('.', '. ').strip() # if len(alpha_block) > 3: # #print(this_text) # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # logger1.debug(this_text) # results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) # results_df['score2'] = pd.to_numeric(results_df['score2']) # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # for idx, rcrd in text_to_test.iterrows(): # tr_data = counties_list[['name', 'uid', 'state', 'country']].copy() # tr_data['score2'] = tr_data.apply(lambda row : fuzz.ratio(rcrd['text'], row['name']), axis = 1) # tr_data['text'] = rcrd['text'] # tr_data['string_len'] = rcrd['string_len'] # results_df = results_df.append(tr_data) # res = results_df.nlargest(1, ['score2', 'string_len']) # if res.shape[0] > 0: # logger1.info(res) # if res.iloc[0]['score'] > settings.geo_min: # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto_geo (filename, district_county, state_territory, country, reference_size) VALUES (%(document_id)s, %(text)s, %(state)s, %(country)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s", {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize, 'state': res.iloc[0]['state'], 'country': res.iloc[0]['country']}) # logger1.info(db_cursor.query.decode("utf-8")) # return res # #Check for Counties_list # #for refsize in ['0.05', '0.1', '0.2', '0.3', '0.4', '0.5']: # for refsize in ['0.05', '0.1', '0.2']: # print(refsize) # db_cursor.execute(query_county, {'refsize': refsize}) # logger1.debug(db_cursor.query.decode("utf-8")) # test_data = pd.DataFrame(db_cursor.fetchall()) # df_split = np.array_split(test_data, settings.pool_workers * 4) # pool = Pool(settings.pool_workers) # df = pd.concat(pool.map(match_state, df_split)) # pool.close() # pool.join() # # for index, record in test_data.iterrows(): # # #split string into all possible sequences # # logger1.info(record['block_text']) # # block_text = record['block_text'].split(' ') # # len_block_text = len(block_text) # # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # # for i in range(len_block_text-1): # # for j in range(i+1, len_block_text): # # #print(i, j) # # this_text = ' '.join(block_text[i:j]) # # alpha_block = re.sub(r'\W+ ,-/', '', this_text).strip() # # if len(alpha_block) > 3: # # #print(this_text) # # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # # logger1.debug(this_text) # # results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) # # results_df['score2'] = pd.to_numeric(results_df['score2']) # # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # # for idx, rcrd in text_to_test.iterrows(): # # tr_data = counties_list[['name', 'uid']].copy() # # tqdm.pandas() # # tr_data['score2'] = tr_data.progress_apply(lambda row : fuzz.ratio(rcrd['text'], row['name']), axis = 1) # # tr_data['text'] = rcrd['text'] # # tr_data['string_len'] = rcrd['string_len'] # # results_df = results_df.append(tr_data) # # res = results_df.nlargest(1, ['score2', 'string_len']) # # if res.shape[0] > 0: # # print(res) # # if res.iloc[0]['score'] > settings.geo_min: # # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto_geo (filename, {field}, reference_size) VALUES (%(document_id)s, %(text)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s".format(field = 'district_county'), {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize}) # # logger1.info(db_cursor.query.decode("utf-8")) # #Date # from_year = 1800 # #Iterate blocks # for ocr_block in ocr_blocks: # logger1.info("Block text: {}".format(ocr_block['block_text'])) # #Identify year # #This year # today = date.today() # cur_year = today.strftime("%Y") # interpreted_value = "" # alpha_block = re.sub(r'\W+ ,-/', '', ocr_block['block_text']).strip() # if len(alpha_block) < 5 or len(re.sub(r'\W+', '', ocr_block['block_text']).strip()) < 5: # #Too short to parse # alpha_block_yr = re.sub(r'\W+', '', alpha_block).strip() # if len(alpha_block_yr) == 4: # #Year # try: # for y in range(from_year, int(cur_year)): # if int(alpha_block_yr) == y: # interpreted_value = "{}".format(alpha_block_yr) # db_cursor.execute(insert_q, {'document_id': ocr_block['document_id'], 'block_id': ocr_block['block'], 'data_type': 'verbatim_date', 'data_format': 'Date (year)', 'interpreted_value': interpreted_value, 'verbatim_value': alpha_block, 'data_source': '', 'match_score': 0}) # logger1.info('Date (year): {}'.format(interpreted_value)) # for i in range(from_year, int(cur_year)): # if interpreted_value == "": # if str(i) in ocr_block['block_text']: # #Check if can directly parse the date # for d_format in ['DMY', 'YMD', 'MDY']: # if dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) != None: # this_date = dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) # interpreted_value = this_date.strftime("%Y-%m-%d") # verbatim_value = alpha_block # continue # #Check if there is a month in roman numerals # roman_month = {"I": "Jan", "II": "Feb", "III": "Mar", "IV": "Apr", "V": "May", "VI": "Jun", "VII": "Jul", "VIII": "Aug", "IX": "Sep", "X": "Oct", "XI": "Nov", "X11": "Dec"} # for m in roman_month: # if m in ocr_block['block_text']: # #Possible year and month found # this_text = ocr_block['block_text'].replace(m, roman_month[m]) # alpha_block = re.sub(r'\W+ ,-/', '', this_text).strip() # #Try to parse date # for d_format in ['DMY', 'YMD', 'MDY']: # if dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) != None: # this_date = dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) # interpreted_value = this_date.strftime("%Y-%m-%d") # verbatim_value = alpha_block # continue # if interpreted_value == "": # for i in range(99): # if interpreted_value == "": # if i < 10: # i = "0{}".format(i) # else: # i = str(i) # if "-{}".format(i) in ocr_block['block_text'] or "\'{}".format(i) in ocr_block['block_text'] or " {}".format(i) in ocr_block['block_text'] or "/{}".format(i) in ocr_block['block_text']: # #Check if can directly parse the date # alpha_block = re.sub(r'\W+ ,-/', '', ocr_block['block_text']).strip() # for d_format in ['DMY', 'YMD', 'MDY']: # if dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) != None: # this_date = dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) # if int(this_date.strftime("%Y")) > int(cur_year): # #If it interprets year 64 as 2064 # this_date_year = int(this_date.strftime("%Y")) - 1000 # else: # this_date_year = this_date.strftime("%Y") # interpreted_value = "{}-{}".format(this_date_year, this_date.strftime("%m-%d")) # verbatim_value = alpha_block # break # #Check if there is a month in roman numerals # roman_month = {"I": "Jan", "II": "Feb", "III": "Mar", "IV": "Apr", "V": "May", "VI": "Jun", "VII": "Jul", "VIII": "Aug", "IX": "Sep", "X": "Oct", "XI": "Nov", "X11": "Dec"} # for m in roman_month: # if m in ocr_block['block_text']: # #Possible year and month found # this_text = ocr_block['block_text'].replace(m, roman_month[m]) # alpha_block = re.sub(r'\W+ ,-/', '', this_text).strip() # #Try to parse date # for d_format in ['DMY', 'YMD', 'MDY']: # if dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) != None: # this_date = dateparser.parse(alpha_block, settings={'DATE_ORDER': d_format, 'PREFER_DATES_FROM': 'past', 'PREFER_DAY_OF_MONTH': 'first', 'REQUIRE_PARTS': ['month', 'year']}) # if int(this_date.strftime("%Y")) > int(cur_year): # #If it interprets year 64 as 2064 # this_date_year = int(this_date.strftime("%Y")) - 1000 # else: # this_date_year = this_date.strftime("%Y") # interpreted_value = "{}-{}".format(this_date_year, this_date.strftime("%m-%d")) # verbatim_value = alpha_block # def parse_dates(record): # logger1.debug(record['block_text']) # block_text = record['block_text'].str.split(' ').tolist()[0] # len_block_text = len(block_text) # text_to_test = pd.DataFrame(columns=('document_id', 'block', 'text', 'string_len')) # for i in range(len_block_text-1): # for j in range(i+1, len_block_text): # #print(i, j) # #this_text = ' '.join(block_text[i:j]) # this_text = ' '.join(map(str, block_text[i:j])) # alpha_block = re.sub(r'\W+ ,-/', '', this_text) # #Add space after periods # alpha_block = ' '.join(alpha_block.split()).replace(' .', '.').replace('.', '. ').strip() # if len(alpha_block) > 3: # #print(this_text) # text_to_test = text_to_test.append([{'document_id': record['document_id'], 'block': record['block'], 'text': this_text, 'string_len': len(alpha_block)}], ignore_index=True) # logger1.debug(this_text) # results_df = pd.DataFrame(columns=('text', 'score1', 'score2', 'score3', 'score', 'string_len')) # results_df['score2'] = pd.to_numeric(results_df['score2']) # results_df['string_len'] = pd.to_numeric(results_df['string_len']) # for idx, rcrd in text_to_test.iterrows(): # tr_data = counties_list[['name', 'uid', 'state', 'country']].copy() # tr_data['score2'] = tr_data.apply(lambda row : fuzz.ratio(rcrd['text'], row['name']), axis = 1) # tr_data['text'] = rcrd['text'] # tr_data['string_len'] = rcrd['string_len'] # results_df = results_df.append(tr_data) # res = results_df.nlargest(1, ['score2', 'string_len']) # if res.shape[0] > 0: # logger1.info(res) # if res.iloc[0]['score'] > settings.geo_min: # db_cursor.execute("INSERT INTO ocr_transcription_ento_auto_geo (filename, district_county, state_territory, country, reference_size) VALUES (%(document_id)s, %(text)s, %(state)s, %(country)s, %(reference_size)s) ON CONFLICT (filename, reference_size) DO UPDATE SET {field} = %(text)s", {'document_id': record['filename'], 'text': res.iloc[0]['text'], 'reference_size': refsize, 'state': res.iloc[0]['state'], 'country': res.iloc[0]['country']}) # logger1.info(db_cursor.query.decode("utf-8")) # return res # #Check for Counties_list # for refsize in ['0.05', '0.1', '0.2']: # print(refsize) # db_cursor.execute(query_county, {'refsize': refsize}) # logger1.debug(db_cursor.query.decode("utf-8")) # test_data = pd.DataFrame(db_cursor.fetchall()) # df_split = np.array_split(test_data, settings.pool_workers * 4) # pool = Pool(settings.pool_workers) # df = pd.concat(pool.map(parse_dates, df_split)) # pool.close() # pool.join() #Close database connection db_cursor.close() conn.close() #Compress log files script_dir = os.getcwd() os.chdir('logs') for file in glob('*.log'): subprocess.run(["zip", "{}.zip".format(file), file]) os.remove(file) os.chdir(script_dir) sys.exit(0)
48.512876
458
0.524063
5,153
45,214
4.37027
0.071027
0.042362
0.017052
0.014654
0.844494
0.838055
0.821403
0.814609
0.801909
0.799778
0
0.014578
0.329433
45,214
932
459
48.512876
0.72819
0.702106
0
0.585209
0
0.003215
0.648702
0.019706
0
0
0
0
0
1
0.003215
false
0.006431
0.038585
0
0.048232
0.003215
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
fd31f61b48af91ef42a43323cd457d51165c77f3
174
py
Python
simpleseo/utils.py
gelo-zhukov/django-simple-seo
872894917b39f2e938ac9a25471326d7a8c01873
[ "BSD-3-Clause" ]
1
2020-02-18T13:54:02.000Z
2020-02-18T13:54:02.000Z
simpleseo/utils.py
gelo-zhukov/django-simple-seo
872894917b39f2e938ac9a25471326d7a8c01873
[ "BSD-3-Clause" ]
null
null
null
simpleseo/utils.py
gelo-zhukov/django-simple-seo
872894917b39f2e938ac9a25471326d7a8c01873
[ "BSD-3-Clause" ]
2
2015-06-23T09:10:28.000Z
2020-07-25T10:04:31.000Z
# -*- coding: utf-8 -*- from django.utils.translation import get_language def get_generic_lang_code(lang_code=None): return (lang_code or get_language()).split('-')[0]
24.857143
54
0.724138
26
174
4.576923
0.730769
0.201681
0
0
0
0
0
0
0
0
0
0.013072
0.12069
174
6
55
29
0.764706
0.12069
0
0
0
0
0.006623
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
7
fd47ee6bd66dcd25ef0dfef033a3216263cec46a
36,845
py
Python
aiida/scheduler/plugins/test_torque.py
astamminger/aiida_core
b01ad8236f21804f273c9d2a0365ecee62255cbb
[ "BSD-2-Clause" ]
null
null
null
aiida/scheduler/plugins/test_torque.py
astamminger/aiida_core
b01ad8236f21804f273c9d2a0365ecee62255cbb
[ "BSD-2-Clause" ]
null
null
null
aiida/scheduler/plugins/test_torque.py
astamminger/aiida_core
b01ad8236f21804f273c9d2a0365ecee62255cbb
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # # # The code is hosted on GitHub at https://github.com/aiidateam/aiida_core # # For further information on the license, see the LICENSE.txt file # # For further information please visit http://www.aiida.net # ########################################################################### from aiida.scheduler.plugins.torque import * from aiida.scheduler.datastructures import job_states import unittest # import logging import uuid text_qstat_f_to_test = """Job Id: 68350.mycluster Job_Name = cell-Qnormal Job_Owner = usernum1@mycluster.cluster job_state = Q queue = Q_express server = mycluster Checkpoint = u ctime = Tue Apr 9 15:01:47 2013 Error_Path = mycluster.cluster:/home/usernum1/scratch/cptest/scaletest/PTOs caletest/testjob.err Hold_Types = n Join_Path = n Keep_Files = n Mail_Points = a mtime = Mon Apr 22 13:13:53 2013 Output_Path = mycluster.cluster:/home/usernum1/scratch/cptest/scaletest/PTO scaletest/testjob.out Priority = 0 qtime = Tue Apr 9 18:26:32 2013 Rerunable = False Resource_List.mpiprocs = 15 Resource_List.ncpus = 240 Resource_List.nodect = 15 Resource_List.place = free Resource_List.select = 15:ncpus=16 Resource_List.walltime = 01:00:00 substate = 10 Variable_List = PBS_O_SYSTEM=Linux,PBS_O_SHELL=/bin/bash, PBS_O_HOME=/home/usernum1,PBS_O_LOGNAME=usernum1, PBS_O_WORKDIR=/home/usernum1/scratch/cptest/scaletest/PTOscaletest, PBS_O_LANG=en_US.UTF-8, PBS_O_PATH=/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/loc al/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/b in:/opt/software/python/3.3.0/bin:/opt/software/bin, PBS_O_MAIL=/var/spool/mail/usernum1,PBS_O_QUEUE=P_share_queue, PBS_O_HOST=mycluster.cluster comment = Not Running: Node is in an ineligible state: offline etime = Tue Apr 9 18:26:32 2013 Submit_arguments = job-PTO64cell-Qnormal.6.15.1.64.4 project = _pbs_project_default Job Id: 68351.mycluster Job_Name = cell-Qnormal Job_Owner = usernum1@mycluster.cluster job_state = Q queue = Q_express server = mycluster Checkpoint = u ctime = Tue Apr 9 15:01:47 2013 Error_Path = mycluster.cluster:/home/usernum1/scratch/cptest/scaletest/PTOs caletest/testjob.err Hold_Types = n Join_Path = n Keep_Files = n Mail_Points = a mtime = Mon Apr 22 13:13:53 2013 Output_Path = mycluster.cluster:/home/usernum1/scratch/cptest/scaletest/PTO scaletest/testjob.out Priority = 0 qtime = Tue Apr 9 18:26:32 2013 Rerunable = False Resource_List.mpiprocs = 15 Resource_List.ncpus = 240 Resource_List.nodect = 15 Resource_List.place = free Resource_List.select = 15:ncpus=16 Resource_List.walltime = 01:00:00 substate = 10 Variable_List = PBS_O_SYSTEM=Linux,PBS_O_SHELL=/bin/bash, PBS_O_HOME=/home/usernum1,PBS_O_LOGNAME=usernum1, PBS_O_WORKDIR=/home/usernum1/scratch/cptest/scaletest/PTOscaletest, PBS_O_LANG=en_US.UTF-8, PBS_O_PATH=/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/loc al/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/b in:/opt/software/python/3.3.0/bin:/opt/software/bin, PBS_O_MAIL=/var/spool/mail/usernum1,PBS_O_QUEUE=P_share_queue, PBS_O_HOST=mycluster.cluster comment = Not Running: Node is in an ineligible state: offline etime = Tue Apr 9 18:26:32 2013 Submit_arguments = job-PTO64cell-Qnormal.6.15.1.64.8 project = _pbs_project_default Job Id: 69301.mycluster Job_Name = Cu-dbp Job_Owner = user02@mycluster.cluster resources_used.cpupercent = 6384 resources_used.cput = 4090:56:03 resources_used.mem = 13378420kb resources_used.ncpus = 64 resources_used.vmem = 9866188kb resources_used.walltime = 64:26:16 job_state = R queue = P_lsu server = mycluster Account_Name = lsu Checkpoint = u ctime = Wed Apr 10 17:10:29 2013 depend = afterok:69299.mycluster@mycluster.cluster, beforeok:69302.mycluster@mycluster.cluster Error_Path = mycluster.cluster:/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN7/C u-dbp.e69301 exec_host = b141/0*16+b142/0*16+b143/0*16+b144/0*16 exec_vnode = (b141:ncpus=16)+(b142:ncpus=16)+(b143:ncpus=16)+(b144:ncpus=16 ) Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = a mtime = Sat Apr 20 01:37:01 2013 Output_Path = mycluster.cluster:/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN7/ Cu-dbp.o69301 Priority = 0 qtime = Wed Apr 10 17:10:29 2013 Rerunable = False Resource_List.mpiprocs = 4 Resource_List.ncpus = 64 Resource_List.nodect = 4 Resource_List.place = excl Resource_List.select = 4:ncpus=16 Resource_List.walltime = 72:00:00 stime = Sat Apr 20 01:36:59 2013 session_id = 118473 Shell_Path_List = /bin/tcsh jobdir = /home/user02 substate = 42 Variable_List = SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass, PERL_BADLANG=0,KDE_IS_PRELINKED=1,PBS_O_HOME=/home/user02, module=() { eval `/usr/bin/modulecmd bash $*`,}, LESSOPEN=|/usr/bin/lesspipe.sh %s,PBS_O_LOGNAME=user02, SSH_CLIENT=128.178.54.94 46714 22,CVS_RSH=ssh,PBS_O_LANG=C,USER=user02, HOME=/home/user02,LIBGL_ALWAYS_INDIRECT=yes, PATH=/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin :/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/bin:/op t/software/python/3.3.0/bin:/opt/software/bin, LD_LIBRARY_PATH=/opt/software/python/3.3.0/lib, SSH_CONNECTION=128.178.54.94 46714 128.178.209.70 22,LANG=C, QTLIB=/usr/lib64/qt-3.3/lib,TERM=xterm,SHELL=/bin/bash, QTINC=/usr/lib64/qt-3.3/include,G_BROKEN_FILENAMES=1,HISTSIZE=1000, PBS_O_WORKDIR=/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN7, PBS_O_PATH=/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/loc al/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/b in:/opt/software/python/3.3.0/bin:/opt/software/bin, MANPATH=/opt/xcat/share/man:,XCATROOT=/opt/xcat, MODULESHOME=/usr/share/Modules,PBS_O_SYSTEM=Linux,MSM_PRODUCT=MSM, HOST=mycluster,MAIL=/var/spool/mail/user02, PBS_O_MAIL=/var/spool/mail/user02,_=/opt/pbs/default/bin/qsub, MODULEPATH=/etc/modulefiles:/opt/software/modulefiles:/opt/software/cs e-software/modulefiles,KDEDIRS=/usr,PBS_O_SHELL=/bin/bash, SSH_TTY=/dev/pts/55,OLDPWD=/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN6, LOADEDMODULES=,HISTCONTROL=ignoredups,SHLVL=1, PWD=/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN7,HOSTNAME=mycluster, MSM_HOME=/usr/local/MegaRAID Storage Manager,LOGNAME=user02, PBS_O_HOST=mycluster.cluster comment = Job run at Sat Apr 20 at 01:36 on (b141:ncpus=16)+(b142:ncpus=16) +(b143:ncpus=16)+(b144:ncpus=16) etime = Sat Apr 20 01:36:59 2013 Submit_arguments = job.sh project = _pbs_project_default Job Id: 69302.mycluster Job_Name = Cu-dbp Job_Owner = user02@mycluster.cluster job_state = H queue = P_lsu server = mycluster Account_Name = lsu Checkpoint = u ctime = Wed Apr 10 17:11:21 2013 depend = afterok:69301.mycluster@mycluster.cluster Error_Path = mycluster.cluster:/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN8/C u-dbp.e69302 Hold_Types = s Join_Path = oe Keep_Files = n Mail_Points = a mtime = Wed Apr 10 17:11:21 2013 Output_Path = mycluster.cluster:/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN8/ Cu-dbp.o69302 Priority = 0 qtime = Wed Apr 10 17:11:21 2013 Rerunable = False Resource_List.mpiprocs = 4 Resource_List.ncpus = 64 Resource_List.nodect = 4 Resource_List.place = excl Resource_List.select = 4:ncpus=16 Resource_List.walltime = 72:00:00 Shell_Path_List = /bin/tcsh substate = 22 Variable_List = SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass, PERL_BADLANG=0,KDE_IS_PRELINKED=1,PBS_O_HOME=/home/user02, module=() { eval `/usr/bin/modulecmd bash $*`,}, LESSOPEN=|/usr/bin/lesspipe.sh %s,PBS_O_LOGNAME=user02, SSH_CLIENT=128.178.54.94 46714 22,CVS_RSH=ssh,PBS_O_LANG=C,USER=user02, HOME=/home/user02,LIBGL_ALWAYS_INDIRECT=yes, PATH=/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin :/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/bin:/op t/software/python/3.3.0/bin:/opt/software/bin, LD_LIBRARY_PATH=/opt/software/python/3.3.0/lib, SSH_CONNECTION=128.178.54.94 46714 128.178.209.70 22,LANG=C, QTLIB=/usr/lib64/qt-3.3/lib,TERM=xterm,SHELL=/bin/bash, QTINC=/usr/lib64/qt-3.3/include,G_BROKEN_FILENAMES=1,HISTSIZE=1000, PBS_O_WORKDIR=/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN8, PBS_O_PATH=/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/loc al/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/b in:/opt/software/python/3.3.0/bin:/opt/software/bin, MANPATH=/opt/xcat/share/man:,XCATROOT=/opt/xcat, MODULESHOME=/usr/share/Modules,PBS_O_SYSTEM=Linux,MSM_PRODUCT=MSM, HOST=mycluster,MAIL=/var/spool/mail/user02, PBS_O_MAIL=/var/spool/mail/user02,_=/opt/pbs/default/bin/qsub, MODULEPATH=/etc/modulefiles:/opt/software/modulefiles:/opt/software/cs e-software/modulefiles,KDEDIRS=/usr,PBS_O_SHELL=/bin/bash, SSH_TTY=/dev/pts/55,OLDPWD=/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN7, LOADEDMODULES=,HISTCONTROL=ignoredups,SHLVL=1, PWD=/scratch/user02/QMMM-CuPhens/dbp/NOSE/RUN8,HOSTNAME=mycluster, MSM_HOME=/usr/local/MegaRAID Storage Manager,LOGNAME=user02, PBS_O_HOST=mycluster.cluster Submit_arguments = job.sh project = _pbs_project_default Job Id: 74164.mycluster Job_Name = u-100-l-96.job Job_Owner = user3@mycluster.cluster resources_used.cpupercent = 3889 resources_used.cput = 343:11:42 resources_used.mem = 1824176kb resources_used.ncpus = 32 resources_used.vmem = 3796376kb resources_used.walltime = 10:45:13 job_state = R queue = Q_normal server = mycluster Checkpoint = u ctime = Fri Apr 12 15:21:55 2013 depend = afterany:74163.mycluster@mycluster.cluster, beforeany:74165.mycluster@mycluster.cluster Error_Path = mycluster.cluster:/scratch/user3/ubiquitin/100gL/starting-from -left/production/u-100-l-96.job.e74164 exec_host = b270/0*16+b275/0*16 exec_vnode = (b270:ncpus=16)+(b275:ncpus=16) Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = abe Mail_Users = enrico.user3@epfl.ch mtime = Mon Apr 22 07:17:36 2013 Output_Path = mycluster.cluster:/scratch/user3/ubiquitin/100gL/starting-fro m-left/production/u-100-l-96.job.o74164 Priority = 0 qtime = Fri Apr 12 15:21:55 2013 Rerunable = False Resource_List.mpiprocs = 32 Resource_List.ncpus = 32 Resource_List.nodect = 2 Resource_List.place = excl Resource_List.select = 2:ncpus=16:mpiprocs=16 Resource_List.walltime = 24:00:00 stime = Mon Apr 22 07:17:36 2013 session_id = 14147 jobdir = /home/user3 substate = 42 Variable_List = PBS_O_SYSTEM=Linux,PBS_O_SHELL=/bin/bash, PBS_O_HOME=/home/user3,PBS_O_LOGNAME=user3, PBS_O_WORKDIR=/scratch/user3/ubiquitin/100gL/starting-from-left/produc tion,PBS_O_LANG=en_US.utf8, PBS_O_PATH=/opt/pbs/default/sbin/:/home/bovigny/bin:/opt/xcat/bin:/opt /xcat/sbin:/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/loca l/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/bi n:/opt/software/python/3.3.0/bin:/opt/software/bin:/opt/pbs/default/bin :/opt/software/python/3.3.0/bin:/opt/software/bin, PBS_O_MAIL=/var/spool/mail/user3,PBS_O_QUEUE=P_share_queue, PBS_O_HOST=mycluster.cluster comment = Job run at Mon Apr 22 at 07:17 on (b270:ncpus=16)+(b275:ncpus=16) etime = Mon Apr 22 07:17:34 2013 Submit_arguments = -W depend=afterany:74163 u-100-l-96.job project = _pbs_project_default Job Id: 74165.mycluster Job_Name = u-100-l-97.job Job_Owner = user3@mycluster.cluster job_state = H queue = Q_normal server = mycluster Checkpoint = u ctime = Fri Apr 12 15:22:01 2013 depend = afterany:74164.mycluster@mycluster.cluster, beforeany:74166.mycluster@mycluster.cluster Error_Path = mycluster.cluster:/scratch/user3/ubiquitin/100gL/starting-from -left/production/u-100-l-97.job.e74165 Hold_Types = s Join_Path = oe Keep_Files = n Mail_Points = abe Mail_Users = enrico.user3@epfl.ch mtime = Fri Apr 12 15:22:07 2013 Output_Path = mycluster.cluster:/scratch/user3/ubiquitin/100gL/starting-fro m-left/production/u-100-l-97.job.o74165 Priority = 0 qtime = Fri Apr 12 15:22:01 2013 Rerunable = False Resource_List.mpiprocs = 32 Resource_List.ncpus = 32 Resource_List.nodect = 2 Resource_List.place = excl Resource_List.select = 2:ncpus=16:mpiprocs=16 Resource_List.walltime = 24:00:00 substate = 22 Variable_List = PBS_O_SYSTEM=Linux,PBS_O_SHELL=/bin/bash, PBS_O_HOME=/home/user3,PBS_O_LOGNAME=user3, PBS_O_WORKDIR=/scratch/user3/ubiquitin/100gL/starting-from-left/produc tion,PBS_O_LANG=en_US.utf8, PBS_O_PATH=/opt/pbs/default/sbin/:/home/bovigny/bin:/opt/xcat/bin:/opt /xcat/sbin:/opt/xcat/bin:/opt/xcat/sbin:/usr/lib64/qt-3.3/bin:/usr/loca l/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/pbs/default/bi n:/opt/software/python/3.3.0/bin:/opt/software/bin:/opt/pbs/default/bin :/opt/software/python/3.3.0/bin:/opt/software/bin, PBS_O_MAIL=/var/spool/mail/user3,PBS_O_QUEUE=P_share_queue, PBS_O_HOST=mycluster.cluster Submit_arguments = -W depend=afterany:74164 u-100-l-97.job project = _pbs_project_default """ ## This contains in the 10-th job unexpected newlines ## in the sched_hint field. Still, it should parse correctly. text_qstat_f_to_test_with_unexpected_newlines = """Job Id: 549159 Job_Name = somejob Job_Owner = user_549159 job_state = H queue = ShortQ server = service1 Account_Name = account_549159 Checkpoint = u ctime = Sun Jun 21 07:09:41 2015 depend = afterok:549158.service1.head.cb3.ichec.ie@service1.cb3.ichec.ie Error_Path = host.domain:/some/path/to/sth/ASSP -1R-p/more/down/the/path/ASSP -1R.e549159 Hold_Types = s Join_Path = oe Keep_Files = n Mail_Points = bea Mail_Users = usermail@domain1 mtime = Sun Jun 21 07:09:41 2015 Output_Path = host.domain:/some/path/to/sth/GL more/down/the/path/ASS P-1R.o549159 Priority = 0 qtime = Sun Jun 21 07:09:41 2015 Rerunable = False Resource_List.nodect = 4 Resource_List.nodes = 4:ppn=24 Resource_List.walltime = 09:00:00 euser = user_549159 egroup = users queue_type = E submit_args = -W depend=afterok:549158 somejob.pbs fault_tolerant = False job_radix = 0 submit_host = host.domain1 Job Id: 555716 Job_Name = ini_J2 Job_Owner = somebody@host.domain resources_used.cput = 500:13:39 resources_used.energy_used = 0 resources_used.mem = 20716400kb resources_used.vmem = 23534576kb resources_used.walltime = 41:45:13 job_state = R queue = ProdQ server = service1 Account_Name = dias01 Checkpoint = u ctime = Fri Jun 26 14:04:56 2015 Error_Path = host:/down/the/path/test _valg.out exec_host = r2i4n13/0-23+r1i2n12/0-23+r1i2n11/0-23+r1i1n15/0-23 Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = bea Mail_Users = usermail@mail.domain mtime = Sun Jun 28 23:20:51 2015 Output_Path = host:/down/the/path/tes t_valg.out Priority = 0 qtime = Fri Jun 26 14:04:56 2015 Rerunable = False Resource_List.nodect = 4 Resource_List.nodes = 4:ppn=24 Resource_List.walltime = 70:00:00 session_id = 21190 euser = somebody egroup = users queue_type = E etime = Fri Jun 26 14:04:56 2015 submit_args = runmem_CB_E start_time = Sun Jun 28 23:20:51 2015 Walltime.Remaining = 101627 start_count = 1 fault_tolerant = False job_radix = 0 submit_host = host.domain Job Id: 556491 Job_Name = somejob010 Job_Owner = user_556491 resources_used.cput = 1850:10:45 resources_used.energy_used = 0 resources_used.mem = 50392860kb resources_used.vmem = 77507412kb resources_used.walltime = 78:21:43 job_state = R queue = LongQ server = service1 Account_Name = some432472 Checkpoint = u ctime = Sat Jun 27 10:44:32 2015 Error_Path = host:/down/teh/path/ATc T/somejob010.e556491 exec_host = r3i1n2/0-23 Hold_Types = n Join_Path = n Keep_Files = n Mail_Points = ea Mail_Users = user@mail mtime = Sat Jun 27 10:45:06 2015 Output_Path = host;/down/the/path/AT cT/somejob-010.o556491 Priority = 0 qtime = Sat Jun 27 10:44:32 2015 Rerunable = False Resource_List.nodect = 1 Resource_List.nodes = 1:ppn=24 Resource_List.walltime = 144:00:00 session_id = 28668 euser = user_556491 egroup = users queue_type = E etime = Sat Jun 27 10:44:32 2015 submit_args = scriptname.pbs start_time = Sat Jun 27 10:45:06 2015 Walltime.Remaining = 236282 start_count = 1 fault_tolerant = False job_radix = 0 submit_host = host.domain Job Id: 546437 Job_Name = job_546437 Job_Owner = user_546437 resources_used.cput = 146:03:05 resources_used.energy_used = 0 resources_used.mem = 4199416kb resources_used.vmem = 10804052kb resources_used.walltime = 06:12:22 job_state = C queue = ShortQ server = server.service.546437 Account_Name = account_546437 Checkpoint = u ctime = Thu Jun 18 16:10:46 2015 depend = beforeok:546438@service1 Error_Path = server.domain:/path/to/error/file -1R-p/more/down/the/path/GLP -1R.e546437 exec_host = r2i7n16/0-23+r2i6n14/0-23+r2i6n1/0-23+r1i7n8/0-23 Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = bea Mail_Users = usermail_546437@domain.546437 mtime = Thu Jun 18 22:36:03 2015 Output_Path = server.domain:/path/to/output/file something2/more/down/the/path/GL P-1R.o546437 Priority = 0 qtime = Thu Jun 18 16:10:46 2015 Rerunable = False Resource_List.nodect = 4 Resource_List.nodes = 4:ppn=24 Resource_List.walltime = 08:00:00 session_id = 7054 euser = user_546437 egroup = group_546437 queue_type = E etime = Thu Jun 18 16:10:46 2015 exit_status = 271 submit_args = args_546437.ext start_time = Thu Jun 18 16:23:35 2015 start_count = 1 fault_tolerant = False job_radix = 0 submit_host = host_546437.domain Job Id: 547637 Job_Name = job_546437 Job_Owner = user_546437 job_state = Q queue = ShortQ server = server.service.546437 Account_Name = account_546437 Checkpoint = u ctime = Fri Jun 19 14:00:43 2015 Error_Path = server.domain:/path/to/error/file Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = bea Mail_Users = usermail_546437@domain.546437 mtime = Fri Jun 19 14:00:43 2015 Output_Path = server.domain:/path/to/output/file 7 Priority = 0 qtime = Fri Jun 19 14:00:43 2015 Rerunable = False Resource_List.nodect = 1 Resource_List.nodes = 1:ppn=24 Resource_List.walltime = 24:00:00 euser = user_546437 egroup = group_546437 queue_type = E etime = Fri Jun 19 14:00:43 2015 submit_args = args_546437.ext fault_tolerant = False job_radix = 0 submit_host = host_546437.domain Job Id: 547683 Job_Name = job_547683 Job_Owner = user_547683 job_state = Q queue = ShortQ server = server.service.547683 Account_Name = account_547683 Checkpoint = u ctime = Fri Jun 19 14:58:08 2015 Error_Path = server.domain:/path/to/error/file 83 Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = ea Mail_Users = usermail_547683@domain.547683 mtime = Fri Jun 19 14:58:08 2015 Output_Path = server.domain:/path/to/output/file 683 Priority = 0 qtime = Fri Jun 19 14:58:08 2015 Rerunable = False Resource_List.nodect = 1 Resource_List.nodes = 1:ppn=24 Resource_List.walltime = 23:30:00 euser = user_547683 egroup = group_547683 queue_type = E etime = Fri Jun 19 14:58:08 2015 submit_args = args_547683.ext fault_tolerant = False job_radix = 0 submit_host = host_547683.domain Job Id: 549004 Job_Name = job_549004 Job_Owner = user_549004 job_state = Q queue = ProdQ server = server.service.549004 Account_Name = account_549004 Checkpoint = u ctime = Sat Jun 20 21:25:20 2015 Error_Path = server.domain:/path/to/error/file _something1_202.e549004 Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = bea mtime = Sat Jun 20 21:25:20 2015 Output_Path = server.domain:/path/to/output/file w_something1_202.o549004 Priority = 0 qtime = Sat Jun 20 21:25:20 2015 Rerunable = False Resource_List.nodect = 1 Resource_List.nodes = 1:ppn=24 Resource_List.walltime = 48:00:00 euser = user_549004 egroup = group_549004 queue_type = E etime = Sat Jun 20 21:25:20 2015 submit_args = args_549004ext fault_tolerant = False job_radix = 0 submit_host = host_549004.domain Job Id: 549005 Job_Name = job_549004 Job_Owner = user_549004 job_state = Q queue = ProdQ server = server.service.549004 Account_Name = account_549004 Checkpoint = u ctime = Sat Jun 20 21:25:24 2015 Error_Path = server.domain:/path/to/error/file _something1_102.e549005 Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = bea mtime = Sat Jun 20 21:25:24 2015 Output_Path = server.domain:/path/to/output/file w_something1_102.o549005 Priority = 0 qtime = Sat Jun 20 21:25:24 2015 Rerunable = False Resource_List.nodect = 1 Resource_List.nodes = 1:ppn=24 Resource_List.walltime = 48:00:00 euser = user_549004 egroup = group_549004 queue_type = E etime = Sat Jun 20 21:25:24 2015 submit_args = args_549004.ext fault_tolerant = False job_radix = 0 submit_host = host_549004.domain Job Id: 549008 Job_Name = job_549008 Job_Owner = user_549008 job_state = Q queue = ProdQ server = server.service.549008 Account_Name = account_549008 Checkpoint = u ctime = Sat Jun 20 21:25:39 2015 Error_Path = server.domain:/path/to/error/file something1_102.e549008 Hold_Types = n Join_Path = oe Keep_Files = n Mail_Points = bea mtime = Sat Jun 20 21:25:39 2015 Output_Path = server.domain:/path/to/output/file _something1_102.o549008 Priority = 0 qtime = Sat Jun 20 21:25:39 2015 Rerunable = False Resource_List.nodect = 1 Resource_List.nodes = 1:ppn=24 Resource_List.walltime = 48:00:00 euser = user_549008 egroup = group_549008 queue_type = E etime = Sat Jun 20 21:25:39 2015 submit_args = args_549008.ext fault_tolerant = False job_radix = 0 submit_host = host_549008.domain Job Id: 543984 Job_Name = job_543984 Job_Owner = user_543984 resources_used.cput = 641:36:16 resources_used.energy_used = 0 resources_used.mem = 3815752kb resources_used.vmem = 12122136kb resources_used.walltime = 35:47:31 job_state = C queue = ProdQ server = server.service.543984 Account_Name = account_543984 Checkpoint = u ctime = Wed Jun 17 09:16:05 2015 depend = beforeany:545943@service1 Error_Path = server.domain:/path/to/error/file P_Mp=318.,NVF=1e5,tau=0.10,ddZ,AD,1T,iFlr,xyz.e543984 exec_host = r2i7n17/0-23+r2i0n11/0-23+r2i6n17/0-23+r2i0n5/0-23+r2i7n1/0-23 +r2i5n8/0-23+r2i4n11/0-23+r2i4n8/0-23+r2i2n8/0-23+r2i0n2/0-23+r2i3n16/ 0-23+r2i3n2/0-23+r2i1n2/0-23+r2i4n3/0-23+r2i1n15/0-23+r2i1n9/0-23+r2i2 n2/0-23+r2i3n8/0-23+r2i3n5/0-23+r2i1n11/0-23+r2i0n16/0-23+r2i2n5/0-23+ r2i1n3/0-23+r2i0n17/0-23+r2i0n8/0-23+r1i3n0/0-23+r1i7n7/0-23+r1i6n1/0- 23+r1i7n3/0-23+r1i7n5/0-23+r1i6n17/0-23+r1i7n4/0-23 Hold_Types = n Join_Path = n Keep_Files = n Mail_Points = n Mail_Users = usermail_543984@domain.543984 mtime = Thu Jun 18 22:36:12 2015 Output_Path = server.domain:/path/to/output/file EP_Mp=318.,NVF=1e5,tau=0.10,ddZ,AD,1T,iFlr,xyz.o543984 Priority = 0 qtime = Wed Jun 17 09:16:05 2015 Rerunable = False Resource_List.nodect = 32 Resource_List.nodes = 32:ppn=24 Resource_List.walltime = 71:59:59 session_id = 47630 euser = user_543984 egroup = group_543984 queue_type = E sched_hint = Post job file processing error; job 543984 on host r2i7n17 U nable to copy file 543984.OU to /some/path/on/the/cluster/MHD something_Mp=318.,NVF=1e5,tau=0.10,ddZ,AD,1T,iFlr,xyz.o543984, error 1 *** error from copy /bin/cp: cannot stat `543984.OU': No suc h file or directory *** end error output Unable to copy file 543984.E R to /some/path/on/the/cluster/something_Mp=318., NVF=1e5,tau=0.10,ddZ,AD,1T,iFlr,xyz.e543984, error 1 *** error from copy /bin/cp: cannot stat `543984.ER': No suc h file or directory *** end error output etime = Wed Jun 17 09:16:05 2015 exit_status = 271 submit_args = args_XX.ext xyz -l nodes=32:ppn=24,walltime=71:59:59 -v RESUME=true,SMP=24, NND=32, NOPFS=false -d /some/path/ /some/other/pa th/NIx/que/runN.sth start_time = Wed Jun 17 10:48:24 2015 start_count = 1 fault_tolerant = False job_radix = 0 submit_host = host_XX.domain """ class TestParserQstat(unittest.TestCase): """ Tests to verify if teh function _parse_joblist_output behave correctly The tests is done parsing a string defined above, to be used offline """ def test_parse_common_joblist_output(self): """ Test whether _parse_joblist can parse the qstat -f output """ s = TorqueScheduler() retval = 0 stdout = text_qstat_f_to_test stderr = '' job_list = s._parse_joblist_output(retval, stdout, stderr) # The parameters are hard coded in the text to parse job_on_cluster = 6 job_parsed = len(job_list) self.assertEquals(job_parsed, job_on_cluster) job_running = 2 job_running_parsed = len([j for j in job_list if j.job_state \ and j.job_state == job_states.RUNNING]) self.assertEquals(job_running, job_running_parsed) job_held = 2 job_held_parsed = len([j for j in job_list if j.job_state \ and j.job_state == job_states.QUEUED_HELD]) self.assertEquals(job_held, job_held_parsed) job_queued = 2 job_queued_parsed = len([j for j in job_list if j.job_state \ and j.job_state == job_states.QUEUED]) self.assertEquals(job_queued, job_queued_parsed) running_users = ['user02', 'user3'] parsed_running_users = [j.job_owner for j in job_list if j.job_state \ and j.job_state == job_states.RUNNING] self.assertEquals(set(running_users), set(parsed_running_users)) running_jobs = ['69301.mycluster', '74164.mycluster'] parsed_running_jobs = [j.job_id for j in job_list if j.job_state \ and j.job_state == job_states.RUNNING] self.assertEquals(set(running_jobs), set(parsed_running_jobs)) for j in job_list: if j.allocated_machines: num_machines = 0 num_cpus = 0 for n in j.allocated_machines: num_machines += 1 num_cpus += n.num_cpus self.assertTrue(j.num_machines == num_machines) self.assertTrue(j.num_cpus == num_cpus) # TODO : parse the env_vars def test_parse_with_unexpected_newlines(self): """ Test whether _parse_joblist can parse the qstat -f output also when there are unexpected newlines """ s = TorqueScheduler() retval = 0 stdout = text_qstat_f_to_test_with_unexpected_newlines stderr = '' job_list = s._parse_joblist_output(retval, stdout, stderr) # The parameters are hard coded in the text to parse job_on_cluster = 10 job_parsed = len(job_list) self.assertEquals(job_parsed, job_on_cluster) job_running = 2 job_running_parsed = len([j for j in job_list if j.job_state \ and j.job_state == job_states.RUNNING]) self.assertEquals(job_running, job_running_parsed) job_held = 1 job_held_parsed = len([j for j in job_list if j.job_state \ and j.job_state == job_states.QUEUED_HELD]) self.assertEquals(job_held, job_held_parsed) job_queued = 5 job_queued_parsed = len([j for j in job_list if j.job_state \ and j.job_state == job_states.QUEUED]) self.assertEquals(job_queued, job_queued_parsed) running_users = ['somebody', 'user_556491'] parsed_running_users = [j.job_owner for j in job_list if j.job_state \ and j.job_state == job_states.RUNNING] self.assertEquals(set(running_users), set(parsed_running_users)) running_jobs = ['555716', '556491'] parsed_running_jobs = [j.job_id for j in job_list if j.job_state \ and j.job_state == job_states.RUNNING] self.assertEquals(set(running_jobs), set(parsed_running_jobs)) for j in job_list: if j.allocated_machines: num_machines = 0 num_cpus = 0 for n in j.allocated_machines: num_machines += 1 num_cpus += n.num_cpus self.assertTrue(j.num_machines == num_machines) self.assertTrue(j.num_cpus == num_cpus) # TODO : parse the env_vars class TestSubmitScript(unittest.TestCase): def test_submit_script(self): """ Test to verify if scripts works fine with default options """ from aiida.scheduler.datastructures import JobTemplate from aiida.common.datastructures import CodeInfo, code_run_modes s = TorqueScheduler() job_tmpl = JobTemplate() job_tmpl.shebang = '#!/bin/bash' job_tmpl.job_resource = s.create_job_resource(num_machines=1, num_mpiprocs_per_machine=1) job_tmpl.uuid = str(uuid.uuid4()) job_tmpl.max_wallclock_seconds = 24 * 3600 code_info = CodeInfo() code_info.cmdline_params = ["mpirun", "-np", "23", "pw.x", "-npool", "1"] code_info.stdin_name = 'aiida.in' job_tmpl.codes_info = [code_info] job_tmpl.codes_run_mode = code_run_modes.SERIAL submit_script_text = s.get_submit_script(job_tmpl) self.assertTrue('#PBS -r n' in submit_script_text) self.assertTrue(submit_script_text.startswith('#!/bin/bash')) self.assertTrue('#PBS -l nodes=1:ppn=1,walltime=24:00:00' in submit_script_text) self.assertTrue("'mpirun' '-np' '23' 'pw.x' '-npool' '1'" + \ " < 'aiida.in'" in submit_script_text) def test_submit_script_with_num_cores_per_machine(self): """ Test to verify if script works fine if we specify only num_cores_per_machine value. """ from aiida.scheduler.datastructures import JobTemplate from aiida.common.datastructures import CodeInfo, code_run_modes s = TorqueScheduler() job_tmpl = JobTemplate() job_tmpl.shebang = '#!/bin/bash' job_tmpl.job_resource = s.create_job_resource( num_machines=1, num_mpiprocs_per_machine=1, num_cores_per_machine=24 ) job_tmpl.uuid = str(uuid.uuid4()) job_tmpl.max_wallclock_seconds = 24 * 3600 code_info = CodeInfo() code_info.cmdline_params = [ "mpirun", "-np", "23", "pw.x", "-npool", "1" ] code_info.stdin_name = 'aiida.in' job_tmpl.codes_info = [code_info] job_tmpl.codes_run_mode = code_run_modes.SERIAL submit_script_text = s.get_submit_script(job_tmpl) self.assertTrue('#PBS -r n' in submit_script_text) self.assertTrue(submit_script_text.startswith('#!/bin/bash')) self.assertTrue('#PBS -l nodes=1:ppn=24,walltime=24:00:00' in submit_script_text) self.assertTrue("'mpirun' '-np' '23' 'pw.x' '-npool' '1'" + " < 'aiida.in'" in submit_script_text) def test_submit_script_with_num_cores_per_mpiproc(self): """ Test to verify if scripts works fine if we pass only num_cores_per_mpiproc value """ from aiida.scheduler.datastructures import JobTemplate from aiida.common.datastructures import CodeInfo, code_run_modes s = TorqueScheduler() job_tmpl = JobTemplate() job_tmpl.shebang = '#!/bin/bash' job_tmpl.job_resource = s.create_job_resource( num_machines=1, num_mpiprocs_per_machine=1, num_cores_per_mpiproc=24 ) job_tmpl.uuid = str(uuid.uuid4()) job_tmpl.max_wallclock_seconds = 24 * 3600 code_info = CodeInfo() code_info.cmdline_params = [ "mpirun", "-np", "23", "pw.x", "-npool", "1" ] code_info.stdin_name = 'aiida.in' job_tmpl.codes_info = [code_info] job_tmpl.codes_run_mode = code_run_modes.SERIAL submit_script_text = s.get_submit_script(job_tmpl) self.assertTrue('#PBS -r n' in submit_script_text) self.assertTrue(submit_script_text.startswith('#!/bin/bash')) self.assertTrue('#PBS -l nodes=1:ppn=24,walltime=24:00:00' in submit_script_text) self.assertTrue("'mpirun' '-np' '23' 'pw.x' '-npool' '1'" + " < 'aiida.in'" in submit_script_text) def test_submit_script_with_num_cores_per_machine_and_mpiproc1(self): """ Test to verify if scripts works fine if we pass both num_cores_per_machine and num_cores_per_mpiproc correct values It should pass in check: res.num_cores_per_mpiproc * res.num_mpiprocs_per_machine = res.num_cores_per_machine """ from aiida.scheduler.datastructures import JobTemplate from aiida.common.datastructures import CodeInfo, code_run_modes s = TorqueScheduler() job_tmpl = JobTemplate() job_tmpl.shebang = '#!/bin/bash' job_tmpl.job_resource = s.create_job_resource( num_machines=1, num_mpiprocs_per_machine=1, num_cores_per_machine=24, num_cores_per_mpiproc=24 ) job_tmpl.uuid = str(uuid.uuid4()) job_tmpl.max_wallclock_seconds = 24 * 3600 code_info = CodeInfo() code_info.cmdline_params = [ "mpirun", "-np", "23", "pw.x", "-npool", "1" ] code_info.stdin_name = 'aiida.in' job_tmpl.codes_info = [code_info] job_tmpl.codes_run_mode = code_run_modes.SERIAL submit_script_text = s.get_submit_script(job_tmpl) self.assertTrue('#PBS -r n' in submit_script_text) self.assertTrue(submit_script_text.startswith('#!/bin/bash')) self.assertTrue('#PBS -l nodes=1:ppn=24,walltime=24:00:00' in submit_script_text) self.assertTrue("'mpirun' '-np' '23' 'pw.x' '-npool' '1'" + " < 'aiida.in'" in submit_script_text) def test_submit_script_with_num_cores_per_machine_and_mpiproc2(self): """ Test to verify if scripts works fine if we pass num_cores_per_machine and num_cores_per_mpiproc wrong values It should fail in check: res.num_cores_per_mpiproc * res.num_mpiprocs_per_machine = res.num_cores_per_machine """ from aiida.scheduler.datastructures import JobTemplate from aiida.common.datastructures import CodeInfo, code_run_modes s = TorqueScheduler() job_tmpl = JobTemplate() with self.assertRaises(ValueError): job_tmpl.job_resource = s.create_job_resource( num_machines=1, num_mpiprocs_per_machine=1, num_cores_per_machine=24, num_cores_per_mpiproc=23 )
35.496146
97
0.67195
5,571
36,845
4.249506
0.125292
0.033454
0.007603
0.009462
0.813677
0.793191
0.773
0.733083
0.708963
0.682901
0
0.105252
0.221251
36,845
1,037
98
35.530376
0.719827
0.046275
0
0.669945
0
0.063388
0.732976
0.285718
0
0
0
0.001929
0.036066
1
0.00765
false
0.002186
0.015301
0
0.025137
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
fd4ca19cb0804493165b95212530a95d1780f746
366
py
Python
notebook/pypdf2_split.py
vhn0912/python-snippets
80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038
[ "MIT" ]
174
2018-05-30T21:14:50.000Z
2022-03-25T07:59:37.000Z
notebook/pypdf2_split.py
vhn0912/python-snippets
80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038
[ "MIT" ]
5
2019-08-10T03:22:02.000Z
2021-07-12T20:31:17.000Z
notebook/pypdf2_split.py
vhn0912/python-snippets
80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038
[ "MIT" ]
53
2018-04-27T05:26:35.000Z
2022-03-25T07:59:37.000Z
import PyPDF2 merger = PyPDF2.PdfFileMerger() merger.append('data/src/pdf/sample1.pdf', pages=PyPDF2.pagerange.PageRange(':2')) merger.write('data/temp/sample_split1.pdf') merger.close() merger = PyPDF2.PdfFileMerger() merger.append('data/src/pdf/sample1.pdf', pages=PyPDF2.pagerange.PageRange('2:')) merger.write('data/temp/sample_split2.pdf') merger.close()
22.875
81
0.759563
50
366
5.52
0.36
0.086957
0.181159
0.224638
0.811594
0.811594
0.811594
0.811594
0.811594
0.811594
0
0.031977
0.060109
366
15
82
24.4
0.770349
0
0
0.444444
0
0
0.289617
0.278689
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
fd64c4adfa0f6a5254f68836527a46351e80772c
1,730
py
Python
scripts/main.py
IvanVnucec/UKF_STM32F4
9c65e89ebc16464c812d043e82c2c8b0f3090d66
[ "MIT" ]
2
2021-03-23T12:40:14.000Z
2021-06-23T06:03:17.000Z
scripts/main.py
IvanVnucec/UKF_STM32F4
9c65e89ebc16464c812d043e82c2c8b0f3090d66
[ "MIT" ]
null
null
null
scripts/main.py
IvanVnucec/UKF_STM32F4
9c65e89ebc16464c812d043e82c2c8b0f3090d66
[ "MIT" ]
null
null
null
f = open("Acc_2021-02-21_231529.txt", "r") acc = [] for line in f.readlines()[1:]: aa = line.split()[1:] bb = line.split()[1:] for i, a in enumerate(bb): bb[i] = f"{a}f" acc.append(bb) acc = acc[0::8] dataTowrite = [] dataTowrite.append(f"const float accData[{len(acc)}][3] = {{\n") for a in acc[:-1]: dataTowrite.append(f"\t{{{a[0]}, {a[1]}, {a[2]}}},\n") dataTowrite.append(f"\t{{{acc[-1][0]}, {acc[-1][1]}, {acc[-1][2]}}}\n") dataTowrite.append("};\n") f.close() f = open("IMUdata.c", 'w') f.writelines(dataTowrite) f.close() f = open("Gyr_2021-02-21_231529.txt", "r") acc = [] for line in f.readlines()[1:]: aa = line.split()[1:] bb = line.split()[1:] for i, a in enumerate(bb): bb[i] = f"{a}f" acc.append(bb) acc = acc[0::8] dataTowrite = [] dataTowrite.append(f"const float gyroData[{len(acc)}][3] = {{\n") for a in acc[:-1]: dataTowrite.append(f"\t{{{a[0]}, {a[1]}, {a[2]}}},\n") dataTowrite.append(f"\t{{{acc[-1][0]}, {acc[-1][1]}, {acc[-1][2]}}}\n") dataTowrite.append("};\n") f.close() f = open("IMUdata.c", 'a') f.writelines(dataTowrite) f.close() f = open("Mag_2021-02-21_231529.txt", "r") acc = [] for line in f.readlines()[1:]: aa = line.split()[1:] bb = line.split()[1:] for i, a in enumerate(bb): bb[i] = f"{a}f" acc.append(bb) acc = acc[:len(dataTowrite)-2] dataTowrite = [] dataTowrite.append(f"\nconst float magData[{len(acc)}][3] = {{\n") for a in acc[:-1]: dataTowrite.append(f"\t{{{a[0]}, {a[1]}, {a[2]}}},\n") dataTowrite.append(f"\t{{{acc[-1][0]}, {acc[-1][1]}, {acc[-1][2]}}}\n") dataTowrite.append("};\n") f.close() f = open("IMUdata.c", 'a') f.writelines(dataTowrite) f.close()
22.179487
71
0.544509
295
1,730
3.172881
0.142373
0.217949
0.173077
0.121795
0.901709
0.901709
0.901709
0.861111
0.861111
0.861111
0
0.061806
0.16763
1,730
78
72
22.179487
0.588194
0
0
0.859649
0
0.052632
0.285962
0.082034
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
b5e6932a684a966b509826f11b840897ee2d73bd
173
py
Python
chainerrl/misc/__init__.py
takeratta/chainerrl
51a2762246db2964fe97e596fd98a1a1cbfea19a
[ "MIT" ]
null
null
null
chainerrl/misc/__init__.py
takeratta/chainerrl
51a2762246db2964fe97e596fd98a1a1cbfea19a
[ "MIT" ]
null
null
null
chainerrl/misc/__init__.py
takeratta/chainerrl
51a2762246db2964fe97e596fd98a1a1cbfea19a
[ "MIT" ]
null
null
null
from chainerrl.misc.batch_states import batch_states # NOQA from chainerrl.misc import env_modifiers # NOQA from chainerrl.misc.random_seed import set_random_seed # NOQA
43.25
62
0.83237
26
173
5.307692
0.461538
0.282609
0.369565
0.304348
0
0
0
0
0
0
0
0
0.121387
173
3
63
57.666667
0.907895
0.080925
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
7
1fb7f18fce0a92f088c522c17d74fba2e71e71ac
812,991
py
Python
angr/procedures/definitions/win32_crypt32.py
r4b3rt/angr
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
[ "BSD-2-Clause" ]
null
null
null
angr/procedures/definitions/win32_crypt32.py
r4b3rt/angr
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
[ "BSD-2-Clause" ]
null
null
null
angr/procedures/definitions/win32_crypt32.py
r4b3rt/angr
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
[ "BSD-2-Clause" ]
null
null
null
# pylint:disable=line-too-long import logging from ...sim_type import SimTypeFunction, SimTypeShort, SimTypeInt, SimTypeLong, SimTypeLongLong, SimTypeDouble, SimTypeFloat, SimTypePointer, SimTypeChar, SimStruct, SimTypeFixedSizeArray, SimTypeBottom, SimUnion, SimTypeBool from ...calling_conventions import SimCCStdcall, SimCCMicrosoftAMD64 from .. import SIM_PROCEDURES as P from . import SimLibrary _l = logging.getLogger(name=__name__) lib = SimLibrary() lib.set_default_cc('X86', SimCCStdcall) lib.set_default_cc('AMD64', SimCCMicrosoftAMD64) lib.set_library_names("crypt32.dll") prototypes = \ { # 'CryptFormatObject': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "dwFormatType", "dwFormatStrType", "pFormatStruct", "lpszStructType", "pbEncoded", "cbEncoded", "pbFormat", "pcbFormat"]), # 'CryptEncodeObjectEx': SimTypeFunction([SimTypeInt(signed=False, label="CERT_QUERY_ENCODING_TYPE"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CRYPT_ENCODE_OBJECT_FLAGS"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pfnAlloc": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["cbSize"]), offset=0), "pfnFree": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["pv"]), offset=0)}, name="CRYPT_ENCODE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "lpszStructType", "pvStructInfo", "dwFlags", "pEncodePara", "pvEncoded", "pcbEncoded"]), # 'CryptEncodeObject': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "lpszStructType", "pvStructInfo", "pbEncoded", "pcbEncoded"]), # 'CryptDecodeObjectEx': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pfnAlloc": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["cbSize"]), offset=0), "pfnFree": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["pv"]), offset=0)}, name="CRYPT_DECODE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "lpszStructType", "pbEncoded", "cbEncoded", "dwFlags", "pDecodePara", "pvStructInfo", "pcbStructInfo"]), # 'CryptDecodeObject': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "lpszStructType", "pbEncoded", "cbEncoded", "dwFlags", "pvStructInfo", "pcbStructInfo"]), # 'CryptInstallOIDFunctionAddress': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"pszOID": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvFuncAddr": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_OID_FUNC_ENTRY", pack=False, align=None), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hModule", "dwEncodingType", "pszFuncName", "cFuncEntry", "rgFuncEntry", "dwFlags"]), # 'CryptInitOIDFunctionSet': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["pszFuncName", "dwFlags"]), # 'CryptGetOIDFunctionAddress': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hFuncSet", "dwEncodingType", "pszOID", "dwFlags", "ppvFuncAddr", "phFuncAddr"]), # 'CryptGetDefaultOIDDllList': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hFuncSet", "dwEncodingType", "pwszDllList", "pcchDllList"]), # 'CryptGetDefaultOIDFunctionAddress': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hFuncSet", "dwEncodingType", "pwszDll", "dwFlags", "ppvFuncAddr", "phFuncAddr"]), # 'CryptFreeOIDFunctionAddress': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hFuncAddr", "dwFlags"]), # 'CryptRegisterOIDFunction': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pszOID", "pwszDll", "pszOverrideFuncName"]), # 'CryptUnregisterOIDFunction': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pszOID"]), # 'CryptRegisterDefaultOIDFunction': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "dwIndex", "pwszDll"]), # 'CryptUnregisterDefaultOIDFunction': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pwszDll"]), # 'CryptSetOIDFunctionValue': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="REG_VALUE_TYPE"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pszOID", "pwszValueName", "dwValueType", "pbValueData", "cbValueData"]), # 'CryptGetOIDFunctionValue': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pszOID", "pwszValueName", "pdwValueType", "pbValueData", "pcbValueData"]), # 'CryptEnumOIDFunction': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pszOID", "cValue", "rgdwValueType", "rgpwszValueName", "rgpbValueData", "rgcbValueData", "pvArg"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pszFuncName", "pszOID", "dwFlags", "pvArg", "pfnEnumOIDFunc"]), # 'CryptFindOIDInfo': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pszOID": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pwszName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwGroupId": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"dwValue": SimTypeInt(signed=False, label="UInt32"), "Algid": SimTypeInt(signed=False, label="UInt32"), "dwLength": SimTypeInt(signed=False, label="UInt32")}, name="<anon>", label="None"), "ExtraInfo": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_OID_INFO", pack=False, align=None), offset=0), arg_names=["dwKeyType", "pvKey", "dwGroupId"]), # 'CryptRegisterOIDInfo': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pszOID": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pwszName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwGroupId": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"dwValue": SimTypeInt(signed=False, label="UInt32"), "Algid": SimTypeInt(signed=False, label="UInt32"), "dwLength": SimTypeInt(signed=False, label="UInt32")}, name="<anon>", label="None"), "ExtraInfo": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_OID_INFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pInfo", "dwFlags"]), # 'CryptUnregisterOIDInfo': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pszOID": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pwszName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwGroupId": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"dwValue": SimTypeInt(signed=False, label="UInt32"), "Algid": SimTypeInt(signed=False, label="UInt32"), "dwLength": SimTypeInt(signed=False, label="UInt32")}, name="<anon>", label="None"), "ExtraInfo": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_OID_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pInfo"]), # 'CryptEnumOIDInfo': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pszOID": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pwszName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwGroupId": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"dwValue": SimTypeInt(signed=False, label="UInt32"), "Algid": SimTypeInt(signed=False, label="UInt32"), "dwLength": SimTypeInt(signed=False, label="UInt32")}, name="<anon>", label="None"), "ExtraInfo": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_OID_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pInfo", "pvArg"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwGroupId", "dwFlags", "pvArg", "pfnEnumOIDInfo"]), # 'CryptFindLocalizedName': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypePointer(SimTypeChar(label="Char"), offset=0), arg_names=["pwszCryptName"]), # 'CryptMsgOpenToEncode': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CRYPT_MSG_TYPE"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimStruct({"cbContent": SimTypeInt(signed=False, label="UInt32"), "pfnStreamOutput": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=True, label="Int32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pvArg", "pbData", "cbData", "fFinal"]), offset=0), "pvArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CMSG_STREAM_INFO", pack=False, align=None), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["dwMsgEncodingType", "dwFlags", "dwMsgType", "pvMsgEncodeInfo", "pszInnerContentObjID", "pStreamInfo"]), # 'CryptMsgCalculateEncodedLength': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["dwMsgEncodingType", "dwFlags", "dwMsgType", "pvMsgEncodeInfo", "pszInnerContentObjID", "cbData"]), # 'CryptMsgOpenToDecode': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbContent": SimTypeInt(signed=False, label="UInt32"), "pfnStreamOutput": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=True, label="Int32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pvArg", "pbData", "cbData", "fFinal"]), offset=0), "pvArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CMSG_STREAM_INFO", pack=False, align=None), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["dwMsgEncodingType", "dwFlags", "dwMsgType", "hCryptProv", "pRecipientInfo", "pStreamInfo"]), # 'CryptMsgDuplicate': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["hCryptMsg"]), # 'CryptMsgClose': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptMsg"]), # 'CryptMsgUpdate': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=True, label="Int32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptMsg", "pbData", "cbData", "fFinal"]), # 'CryptMsgGetParam': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptMsg", "dwParamType", "dwIndex", "pvData", "pcbData"]), # 'CryptMsgControl': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptMsg", "dwFlags", "dwCtrlType", "pvCtrlPara"]), # 'CryptMsgVerifyCountersignatureEncoded': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwEncodingType", "pbSignerInfo", "cbSignerInfo", "pbSignerInfoCountersignature", "cbSignerInfoCountersignature", "pciCountersigner"]), # 'CryptMsgVerifyCountersignatureEncodedEx': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwEncodingType", "pbSignerInfo", "cbSignerInfo", "pbSignerInfoCountersignature", "cbSignerInfoCountersignature", "dwSignerType", "pvSigner", "dwFlags", "pvExtra"]), # 'CryptMsgCountersign': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "Anonymous": SimUnion({"hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "hNCryptKey": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)}, name="<anon>", label="None"), "dwKeySpec": SimTypeInt(signed=False, label="UInt32"), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cAuthAttr": SimTypeInt(signed=False, label="UInt32"), "rgAuthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "cUnauthAttr": SimTypeInt(signed=False, label="UInt32"), "rgUnauthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CMSG_SIGNER_ENCODE_INFO", pack=False, align=None), label="LPArray", offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptMsg", "dwIndex", "cCountersigners", "rgCountersigners"]), # 'CryptMsgCountersignEncoded': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "Anonymous": SimUnion({"hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "hNCryptKey": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)}, name="<anon>", label="None"), "dwKeySpec": SimTypeInt(signed=False, label="UInt32"), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cAuthAttr": SimTypeInt(signed=False, label="UInt32"), "rgAuthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "cUnauthAttr": SimTypeInt(signed=False, label="UInt32"), "rgUnauthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CMSG_SIGNER_ENCODE_INFO", pack=False, align=None), label="LPArray", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "pbSignerInfo", "cbSignerInfo", "cCountersigners", "rgCountersigners", "pbCountersignature", "pcbCountersignature"]), # 'CertOpenStore': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="CERT_QUERY_ENCODING_TYPE"), SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="CERT_OPEN_STORE_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["lpszStoreProvider", "dwEncodingType", "hCryptProv", "dwFlags", "pvPara"]), # 'CertDuplicateStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["hCertStore"]), # 'CertSaveStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CERT_QUERY_ENCODING_TYPE"), SimTypeInt(signed=False, label="CERT_STORE_SAVE_AS"), SimTypeInt(signed=False, label="CERT_STORE_SAVE_TO"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwEncodingType", "dwSaveAs", "dwSaveTo", "pvSaveToPara", "dwFlags"]), # 'CertCloseStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwFlags"]), # 'CertGetSubjectCertificateFromStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "dwCertEncodingType", "pCertId"]), # 'CertEnumCertificatesInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "pPrevCertContext"]), # 'CertFindCertificateInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CERT_FIND_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "dwCertEncodingType", "dwFindFlags", "dwFindType", "pvFindPara", "pPrevCertContext"]), # 'CertGetIssuerCertificateFromStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "pSubjectContext", "pPrevIssuerContext", "pdwFlags"]), # 'CertVerifySubjectCertificateContext': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubject", "pIssuer", "pdwFlags"]), # 'CertDuplicateCertificateContext': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["pCertContext"]), # 'CertCreateCertificateContext': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["dwCertEncodingType", "pbCertEncoded", "cbCertEncoded"]), # 'CertFreeCertificateContext': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext"]), # 'CertSetCertificateContextProperty': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "dwPropId", "dwFlags", "pvData"]), # 'CertGetCertificateContextProperty': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "dwPropId", "pvData", "pcbData"]), # 'CertEnumCertificateContextProperties': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["pCertContext", "dwPropId"]), # 'CertCreateCTLEntryFromCertificateContextProperties': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "cOptAttr", "rgOptAttr", "dwFlags", "pvReserved", "pCtlEntry", "pcbCtlEntry"]), # 'CertSetCertificateContextPropertiesFromCTLEntry': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "pCtlEntry", "dwFlags"]), # 'CertGetCRLFromStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "pIssuerContext", "pPrevCrlContext", "pdwFlags"]), # 'CertEnumCRLsInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "pPrevCrlContext"]), # 'CertFindCRLInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "dwCertEncodingType", "dwFindFlags", "dwFindType", "pvFindPara", "pPrevCrlContext"]), # 'CertDuplicateCRLContext': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), arg_names=["pCrlContext"]), # 'CertCreateCRLContext': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), arg_names=["dwCertEncodingType", "pbCrlEncoded", "cbCrlEncoded"]), # 'CertFreeCRLContext': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCrlContext"]), # 'CertSetCRLContextProperty': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCrlContext", "dwPropId", "dwFlags", "pvData"]), # 'CertGetCRLContextProperty': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCrlContext", "dwPropId", "pvData", "pcbData"]), # 'CertEnumCRLContextProperties': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["pCrlContext", "dwPropId"]), # 'CertFindCertificateInCRL': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCert", "pCrlContext", "dwFlags", "pvReserved", "ppCrlEntry"]), # 'CertIsValidCRLForCertificate': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCert", "pCrl", "dwFlags", "pvReserved"]), # 'CertAddEncodedCertificateToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwCertEncodingType", "pbCertEncoded", "cbCertEncoded", "dwAddDisposition", "ppCertContext"]), # 'CertAddCertificateContextToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pCertContext", "dwAddDisposition", "ppStoreContext"]), # 'CertAddSerializedElementToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pbElement", "cbElement", "dwAddDisposition", "dwFlags", "dwContextTypeFlags", "pdwContextType", "ppvContext"]), # 'CertDeleteCertificateFromStore': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext"]), # 'CertAddEncodedCRLToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwCertEncodingType", "pbCrlEncoded", "cbCrlEncoded", "dwAddDisposition", "ppCrlContext"]), # 'CertAddCRLContextToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pCrlContext", "dwAddDisposition", "ppStoreContext"]), # 'CertDeleteCRLFromStore': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCrlContext"]), # 'CertSerializeCertificateStoreElement': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "dwFlags", "pbElement", "pcbElement"]), # 'CertSerializeCRLStoreElement': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCrlContext", "dwFlags", "pbElement", "pcbElement"]), # 'CertDuplicateCTLContext': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), arg_names=["pCtlContext"]), # 'CertCreateCTLContext': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), arg_names=["dwMsgAndCertEncodingType", "pbCtlEncoded", "cbCtlEncoded"]), # 'CertFreeCTLContext': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCtlContext"]), # 'CertSetCTLContextProperty': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCtlContext", "dwPropId", "dwFlags", "pvData"]), # 'CertGetCTLContextProperty': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCtlContext", "dwPropId", "pvData", "pcbData"]), # 'CertEnumCTLContextProperties': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["pCtlContext", "dwPropId"]), # 'CertEnumCTLsInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "pPrevCtlContext"]), # 'CertFindSubjectInCTL': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), arg_names=["dwEncodingType", "dwSubjectType", "pvSubject", "pCtlContext", "dwFlags"]), # 'CertFindCTLInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CERT_FIND_TYPE"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "dwMsgAndCertEncodingType", "dwFindFlags", "dwFindType", "pvFindPara", "pPrevCtlContext"]), # 'CertAddEncodedCTLToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwMsgAndCertEncodingType", "pbCtlEncoded", "cbCtlEncoded", "dwAddDisposition", "ppCtlContext"]), # 'CertAddCTLContextToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pCtlContext", "dwAddDisposition", "ppStoreContext"]), # 'CertSerializeCTLStoreElement': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCtlContext", "dwFlags", "pbElement", "pcbElement"]), # 'CertDeleteCTLFromStore': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCtlContext"]), # 'CertAddCertificateLinkToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pCertContext", "dwAddDisposition", "ppStoreContext"]), # 'CertAddCRLLinkToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pCrlContext", "dwAddDisposition", "ppStoreContext"]), # 'CertAddCTLLinkToStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "pCtlContext", "dwAddDisposition", "ppStoreContext"]), # 'CertAddStoreToCollection': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hCollectionStore", "hSiblingStore", "dwUpdateFlags", "dwPriority"]), # 'CertRemoveStoreFromCollection': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["hCollectionStore", "hSiblingStore"]), # 'CertControlStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CERT_CONTROL_STORE_FLAGS"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwFlags", "dwCtrlType", "pvCtrlPara"]), # 'CertSetStoreProperty': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwPropId", "dwFlags", "pvData"]), # 'CertGetStoreProperty': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCertStore", "dwPropId", "pvData", "pcbData"]), # 'CertCreateContext': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pfnFree": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["pv"]), offset=0), "pvFree": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pfnSort": SimTypePointer(SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["cbTotalEncoded", "cbRemainEncoded", "cEntry", "pvSort"]), offset=0), "pvSort": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CREATE_CONTEXT_PARA", pack=False, align=None), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["dwContextType", "dwEncodingType", "pbEncoded", "cbEncoded", "dwFlags", "pCreatePara"]), # 'CertRegisterSystemStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SYSTEM_STORE_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags", "pStoreInfo", "pvReserved"]), # 'CertRegisterPhysicalStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pszOpenStoreProvider": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "dwOpenEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwOpenFlags": SimTypeInt(signed=False, label="UInt32"), "OpenParameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwPriority": SimTypeInt(signed=False, label="UInt32")}, name="CERT_PHYSICAL_STORE_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags", "pwszStoreName", "pStoreInfo", "pvReserved"]), # 'CertUnregisterSystemStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags"]), # 'CertUnregisterPhysicalStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags", "pwszStoreName"]), # 'CertEnumSystemStoreLocation': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pwszStoreLocation", "dwFlags", "pvReserved", "pvArg"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwFlags", "pvArg", "pfnEnum"]), # 'CertEnumSystemStore': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CERT_SYSTEM_STORE_FLAGS"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SYSTEM_STORE_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags", "pStoreInfo", "pvReserved", "pvArg"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwFlags", "pvSystemStoreLocationPara", "pvArg", "pfnEnum"]), # 'CertEnumPhysicalStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pszOpenStoreProvider": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "dwOpenEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwOpenFlags": SimTypeInt(signed=False, label="UInt32"), "OpenParameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwPriority": SimTypeInt(signed=False, label="UInt32")}, name="CERT_PHYSICAL_STORE_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags", "pwszStoreName", "pStoreInfo", "pvReserved", "pvArg"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pvSystemStore", "dwFlags", "pvArg", "pfnEnum"]), # 'CertGetEnhancedKeyUsage': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "dwFlags", "pUsage", "pcbUsage"]), # 'CertSetEnhancedKeyUsage': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "pUsage"]), # 'CertAddEnhancedKeyUsageIdentifier': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "pszUsageIdentifier"]), # 'CertRemoveEnhancedKeyUsageIdentifier': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "pszUsageIdentifier"]), # 'CertGetValidUsages': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["cCerts", "rghCerts", "cNumOIDs", "rghOIDs", "pcbOIDs"]), # 'CryptMsgGetAndVerifySigner': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptMsg", "cSignerStore", "rghSignerStore", "dwFlags", "ppSigner", "pdwSignerIndex"]), # 'CryptMsgSignCTL': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "cSigners": SimTypeInt(signed=False, label="UInt32"), "rgSigners": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "Anonymous": SimUnion({"hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "hNCryptKey": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)}, name="<anon>", label="None"), "dwKeySpec": SimTypeInt(signed=False, label="UInt32"), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cAuthAttr": SimTypeInt(signed=False, label="UInt32"), "rgAuthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "cUnauthAttr": SimTypeInt(signed=False, label="UInt32"), "rgUnauthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CMSG_SIGNER_ENCODE_INFO", pack=False, align=None), offset=0), "cCertEncoded": SimTypeInt(signed=False, label="UInt32"), "rgCertEncoded": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), "cCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "rgCrlEncoded": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CMSG_SIGNED_ENCODE_INFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwMsgEncodingType", "pbCtlContent", "cbCtlContent", "pSignInfo", "dwFlags", "pbEncoded", "pcbEncoded"]), # 'CryptMsgEncodeAndSignCTL': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "cSigners": SimTypeInt(signed=False, label="UInt32"), "rgSigners": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "Anonymous": SimUnion({"hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "hNCryptKey": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)}, name="<anon>", label="None"), "dwKeySpec": SimTypeInt(signed=False, label="UInt32"), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cAuthAttr": SimTypeInt(signed=False, label="UInt32"), "rgAuthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "cUnauthAttr": SimTypeInt(signed=False, label="UInt32"), "rgUnauthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CMSG_SIGNER_ENCODE_INFO", pack=False, align=None), offset=0), "cCertEncoded": SimTypeInt(signed=False, label="UInt32"), "rgCertEncoded": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), "cCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "rgCrlEncoded": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CMSG_SIGNED_ENCODE_INFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwMsgEncodingType", "pCtlInfo", "pSignInfo", "dwFlags", "pbEncoded", "pcbEncoded"]), # 'CertFindSubjectInSortedCTL': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectIdentifier", "pCtlContext", "dwFlags", "pvReserved", "pEncodedAttributes"]), # 'CertEnumSubjectInSortedCTL': SimTypeFunction([SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCtlContext", "ppvNextSubject", "pSubjectIdentifier", "pEncodedAttributes"]), # 'CertVerifyCTLUsage': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cCtlStore": SimTypeInt(signed=False, label="UInt32"), "rghCtlStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), "cSignerStore": SimTypeInt(signed=False, label="UInt32"), "rghSignerStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)}, name="CTL_VERIFY_USAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwError": SimTypeInt(signed=False, label="UInt32"), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "ppCtl": SimTypePointer(SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0), offset=0), "dwCtlEntryIndex": SimTypeInt(signed=False, label="UInt32"), "ppSigner": SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), "dwSignerIndex": SimTypeInt(signed=False, label="UInt32")}, name="CTL_VERIFY_USAGE_STATUS", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "dwSubjectType", "pvSubject", "pSubjectUsage", "dwFlags", "pVerifyUsagePara", "pVerifyUsageStatus"]), # 'CertVerifyRevocation': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pIssuerCert": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "cCertStore": SimTypeInt(signed=False, label="UInt32"), "rgCertStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), "hCrlStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pftTimeToUse": SimTypePointer(SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwIndex": SimTypeInt(signed=False, label="UInt32"), "dwError": SimTypeInt(signed=False, label="UInt32"), "dwReason": SimTypeInt(signed=False, label="CERT_REVOCATION_STATUS_REASON"), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_REVOCATION_STATUS", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwEncodingType", "dwRevType", "cContext", "rgpvContext", "dwFlags", "pRevPara", "pRevStatus"]), # 'CertCompareIntegerBlob': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pInt1", "pInt2"]), # 'CertCompareCertificate': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pCertId1", "pCertId2"]), # 'CertCompareCertificateName': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pCertName1", "pCertName2"]), # 'CertIsRDNAttrsInCertificateName': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cRDNAttr": SimTypeInt(signed=False, label="UInt32"), "rgRDNAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "dwValueType": SimTypeInt(signed=False, label="CERT_RDN_ATTR_VALUE_TYPE"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_RDN_ATTR", pack=False, align=None), offset=0)}, name="CERT_RDN", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "dwFlags", "pCertName", "pRDN"]), # 'CertComparePublicKeyInfo': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pPublicKey1", "pPublicKey2"]), # 'CertGetPublicKeyLength': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=False, label="UInt32"), arg_names=["dwCertEncodingType", "pPublicKey"]), # 'CryptVerifyCertificateSignature': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwCertEncodingType", "pbEncoded", "cbEncoded", "pPublicKey"]), # 'CryptVerifyCertificateSignatureEx': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CRYPT_VERIFY_CERT_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwCertEncodingType", "dwSubjectType", "pvSubject", "dwIssuerType", "pvIssuer", "dwFlags", "pvExtra"]), # 'CertIsStrongHashToSign': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwInfoChoice": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"pvInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pSerializedInfo": SimTypePointer(SimStruct({"dwFlags": SimTypeInt(signed=False, label="CERT_STRONG_SIGN_FLAGS"), "pwszCNGSignHashAlgids": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszCNGPubKeyMinBitLengths": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_STRONG_SIGN_SERIALIZED_INFO", pack=False, align=None), offset=0), "pszOID": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="<anon>", label="None")}, name="CERT_STRONG_SIGN_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pStrongSignPara", "pwszCNGHashAlgid", "pSigningCert"]), # 'CryptHashToBeSigned': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwCertEncodingType", "pbEncoded", "cbEncoded", "pbComputedHash", "pcbComputedHash"]), # 'CryptHashCertificate': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "Algid", "dwFlags", "pbEncoded", "cbEncoded", "pbComputedHash", "pcbComputedHash"]), # 'CryptHashCertificate2': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pwszCNGHashAlgid", "dwFlags", "pvReserved", "pbEncoded", "cbEncoded", "pbComputedHash", "pcbComputedHash"]), # 'CryptSignCertificate': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProvOrNCryptKey", "dwKeySpec", "dwCertEncodingType", "pbEncodedToBeSigned", "cbEncodedToBeSigned", "pSignatureAlgorithm", "pvHashAuxInfo", "pbSignature", "pcbSignature"]), # 'CryptSignAndEncodeCertificate': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="CERT_KEY_SPEC"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProvOrNCryptKey", "dwKeySpec", "dwCertEncodingType", "lpszStructType", "pvStructInfo", "pSignatureAlgorithm", "pvHashAuxInfo", "pbEncoded", "pcbEncoded"]), # 'CertVerifyTimeValidity': SimTypeFunction([SimTypePointer(SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pTimeToVerify", "pCertInfo"]), # 'CertVerifyCRLTimeValidity': SimTypeFunction([SimTypePointer(SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pTimeToVerify", "pCrlInfo"]), # 'CertVerifyValidityNesting': SimTypeFunction([SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectInfo", "pIssuerInfo"]), # 'CertVerifyCRLRevocation': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), label="LPArray", offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pCertId", "cCrlInfo", "rgpCrlInfo"]), # 'CertAlgIdToOID': SimTypeFunction([SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeChar(label="Byte"), offset=0), arg_names=["dwAlgId"]), # 'CertOIDToAlgId': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=False, label="UInt32"), arg_names=["pszObjId"]), # 'CertFindExtension': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), label="LPArray", offset=0)], SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0), arg_names=["pszObjId", "cExtensions", "rgExtensions"]), # 'CertFindAttribute': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), label="LPArray", offset=0)], SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), arg_names=["pszObjId", "cAttr", "rgAttr"]), # 'CertFindRDNAttr': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimStruct({"cRDN": SimTypeInt(signed=False, label="UInt32"), "rgRDN": SimTypePointer(SimStruct({"cRDNAttr": SimTypeInt(signed=False, label="UInt32"), "rgRDNAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "dwValueType": SimTypeInt(signed=False, label="CERT_RDN_ATTR_VALUE_TYPE"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_RDN_ATTR", pack=False, align=None), offset=0)}, name="CERT_RDN", pack=False, align=None), offset=0)}, name="CERT_NAME_INFO", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "dwValueType": SimTypeInt(signed=False, label="CERT_RDN_ATTR_VALUE_TYPE"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_RDN_ATTR", pack=False, align=None), offset=0), arg_names=["pszObjId", "pName"]), # 'CertGetIntendedKeyUsage': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pCertInfo", "pbKeyUsage", "cbKeyUsage"]), # 'CryptInstallDefaultContext': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="CRYPT_DEFAULT_CONTEXT_TYPE"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CRYPT_DEFAULT_CONTEXT_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwDefaultType", "pvDefaultPara", "dwFlags", "pvReserved", "phDefaultContext"]), # 'CryptUninstallDefaultContext': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hDefaultContext", "dwFlags", "pvReserved"]), # 'CryptExportPublicKeyInfo': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProvOrNCryptKey", "dwKeySpec", "dwCertEncodingType", "pInfo", "pcbInfo"]), # 'CryptExportPublicKeyInfoEx': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProvOrNCryptKey", "dwKeySpec", "dwCertEncodingType", "pszPublicKeyObjId", "dwFlags", "pvAuxInfo", "pInfo", "pcbInfo"]), # 'CryptExportPublicKeyInfoFromBCryptKeyHandle': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hBCryptKey", "dwCertEncodingType", "pszPublicKeyObjId", "dwFlags", "pvAuxInfo", "pInfo", "pcbInfo"]), # 'CryptImportPublicKeyInfo': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwCertEncodingType", "pInfo", "phKey"]), # 'CryptImportPublicKeyInfoEx': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwCertEncodingType", "pInfo", "aiKeyAlg", "dwFlags", "pvAuxInfo", "phKey"]), # 'CryptImportPublicKeyInfoEx2': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="CRYPT_IMPORT_PUBLIC_KEY_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pInfo", "dwFlags", "pvAuxInfo", "phKey"]), # 'CryptAcquireCertificatePrivateKey': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="CRYPT_ACQUIRE_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="CERT_KEY_SPEC"), offset=0), SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCert", "dwFlags", "pvParameters", "phCryptProvOrNCryptKey", "pdwKeySpec", "pfCallerFreeProvOrNCryptKey"]), # 'CryptFindCertificateKeyProvInfo': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="CRYPT_FIND_FLAGS"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCert", "dwFlags", "pvReserved"]), # 'CryptImportPKCS8': SimTypeFunction([SimStruct({"PrivateKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "pResolvehCryptProvFunc": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"Version": SimTypeInt(signed=False, label="UInt32"), "Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PrivateKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "pAttributes": SimTypePointer(SimStruct({"cAttr": SimTypeInt(signed=False, label="UInt32"), "rgAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTES", pack=False, align=None), offset=0)}, name="CRYPT_PRIVATE_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pPrivateKeyInfo", "phCryptProv", "pVoidResolveFunc"]), offset=0), "pVoidResolveFunc": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pDecryptPrivateKeyFunc": SimTypePointer(SimTypeFunction([SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["Algorithm", "EncryptedPrivateKey", "pbClearTextKey", "pcbClearTextKey", "pVoidDecryptFunc"]), offset=0), "pVoidDecryptFunc": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_PKCS8_IMPORT_PARAMS", pack=False, align=None), SimTypeInt(signed=False, label="CRYPT_KEY_FLAGS"), SimTypePointer(SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["sPrivateKeyAndParams", "dwFlags", "phCryptProv", "pvAuxInfo"]), # 'CryptExportPKCS8': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "dwKeySpec", "pszPrivateKeyObjId", "dwFlags", "pvAuxInfo", "pbPrivateKeyBlob", "pcbPrivateKeyBlob"]), # 'CryptHashPublicKeyInfo': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hCryptProv", "Algid", "dwFlags", "dwCertEncodingType", "pInfo", "pbComputedHash", "pcbComputedHash"]), # 'CertRDNValueToStrA': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["dwValueType", "pValue", "psz", "csz"]), # 'CertRDNValueToStrW': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["dwValueType", "pValue", "psz", "csz"]), # 'CertNameToStrA': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="CERT_STRING_TYPE"), SimTypePointer(SimTypeChar(label="Byte"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["dwCertEncodingType", "pName", "dwStrType", "psz", "csz"]), # 'CertNameToStrW': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="CERT_STRING_TYPE"), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["dwCertEncodingType", "pName", "dwStrType", "psz", "csz"]), # 'CertStrToNameA': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="CERT_STRING_TYPE"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pszX500", "dwStrType", "pvReserved", "pbEncoded", "pcbEncoded", "ppszError"]), # 'CertStrToNameW': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="CERT_STRING_TYPE"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pszX500", "dwStrType", "pvReserved", "pbEncoded", "pcbEncoded", "ppszError"]), # 'CertGetNameStringA': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["pCertContext", "dwType", "dwFlags", "pvTypePara", "pszNameString", "cchNameString"]), # 'CertGetNameStringW': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=False, label="UInt32"), arg_names=["pCertContext", "dwType", "dwFlags", "pvTypePara", "pszNameString", "cchNameString"]), # 'CryptSignMessage': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "pSigningCert": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cMsgCert": SimTypeInt(signed=False, label="UInt32"), "rgpMsgCert": SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), "cMsgCrl": SimTypeInt(signed=False, label="UInt32"), "rgpMsgCrl": SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), offset=0), "cAuthAttr": SimTypeInt(signed=False, label="UInt32"), "rgAuthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "cUnauthAttr": SimTypeInt(signed=False, label="UInt32"), "rgUnauthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwInnerContentType": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_SIGN_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=True, label="Int32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSignPara", "fDetachedSignature", "cToBeSigned", "rgpbToBeSigned", "rgcbToBeSigned", "pbSignedBlob", "pcbSignedBlob"]), # 'CryptVerifyMessageSignature': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "pfnGetSignerCertificate": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["pvGetArg", "dwCertEncodingType", "pSignerId", "hMsgCertStore"]), offset=0), "pvGetArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_VERIFY_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pVerifyPara", "dwSignerIndex", "pbSignedBlob", "cbSignedBlob", "pbDecoded", "pcbDecoded", "ppSignerCert"]), # 'CryptGetMessageSignerCount': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["dwMsgEncodingType", "pbSignedBlob", "cbSignedBlob"]), # 'CryptGetMessageCertificates': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["dwMsgAndCertEncodingType", "hCryptProv", "dwFlags", "pbSignedBlob", "cbSignedBlob"]), # 'CryptVerifyDetachedMessageSignature': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "pfnGetSignerCertificate": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["pvGetArg", "dwCertEncodingType", "pSignerId", "hMsgCertStore"]), offset=0), "pvGetArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_VERIFY_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pVerifyPara", "dwSignerIndex", "pbDetachedSignBlob", "cbDetachedSignBlob", "cToBeSigned", "rgpbToBeSigned", "rgcbToBeSigned", "ppSignerCert"]), # 'CryptEncryptMessage': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "ContentEncryptionAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvEncryptionAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwInnerContentType": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_ENCRYPT_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pEncryptPara", "cRecipientCert", "rgpRecipientCert", "pbToBeEncrypted", "cbToBeEncrypted", "pbEncryptedBlob", "pcbEncryptedBlob"]), # 'CryptDecryptMessage': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "cCertStore": SimTypeInt(signed=False, label="UInt32"), "rghCertStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)}, name="CRYPT_DECRYPT_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pDecryptPara", "pbEncryptedBlob", "cbEncryptedBlob", "pbDecrypted", "pcbDecrypted", "ppXchgCert"]), # 'CryptSignAndEncryptMessage': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "pSigningCert": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cMsgCert": SimTypeInt(signed=False, label="UInt32"), "rgpMsgCert": SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), "cMsgCrl": SimTypeInt(signed=False, label="UInt32"), "rgpMsgCrl": SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), offset=0), "cAuthAttr": SimTypeInt(signed=False, label="UInt32"), "rgAuthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "cUnauthAttr": SimTypeInt(signed=False, label="UInt32"), "rgUnauthAttr": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwInnerContentType": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_SIGN_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "ContentEncryptionAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvEncryptionAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwInnerContentType": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_ENCRYPT_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSignPara", "pEncryptPara", "cRecipientCert", "rgpRecipientCert", "pbToBeSignedAndEncrypted", "cbToBeSignedAndEncrypted", "pbSignedAndEncryptedBlob", "pcbSignedAndEncryptedBlob"]), # 'CryptDecryptAndVerifyMessageSignature': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "cCertStore": SimTypeInt(signed=False, label="UInt32"), "rghCertStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)}, name="CRYPT_DECRYPT_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "pfnGetSignerCertificate": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["pvGetArg", "dwCertEncodingType", "pSignerId", "hMsgCertStore"]), offset=0), "pvGetArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_VERIFY_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pDecryptPara", "pVerifyPara", "dwSignerIndex", "pbEncryptedBlob", "cbEncryptedBlob", "pbDecrypted", "pcbDecrypted", "ppXchgCert", "ppSignerCert"]), # 'CryptDecodeMessage': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "cCertStore": SimTypeInt(signed=False, label="UInt32"), "rghCertStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)}, name="CRYPT_DECRYPT_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "pfnGetSignerCertificate": SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["pvGetArg", "dwCertEncodingType", "pSignerId", "hMsgCertStore"]), offset=0), "pvGetArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_VERIFY_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwMsgTypeFlags", "pDecryptPara", "pVerifyPara", "dwSignerIndex", "pbEncodedBlob", "cbEncodedBlob", "dwPrevInnerContentType", "pdwMsgType", "pdwInnerContentType", "pbDecoded", "pcbDecoded", "ppXchgCert", "ppSignerCert"]), # 'CryptHashMessage': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_HASH_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=True, label="Int32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pHashPara", "fDetachedHash", "cToBeHashed", "rgpbToBeHashed", "rgcbToBeHashed", "pbHashedBlob", "pcbHashedBlob", "pbComputedHash", "pcbComputedHash"]), # 'CryptVerifyMessageHash': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_HASH_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pHashPara", "pbHashedBlob", "cbHashedBlob", "pbToBeHashed", "pcbToBeHashed", "pbComputedHash", "pcbComputedHash"]), # 'CryptVerifyDetachedMessageHash': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRYPT_HASH_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pHashPara", "pbDetachedHashBlob", "cbDetachedHashBlob", "cToBeHashed", "rgpbToBeHashed", "rgcbToBeHashed", "pbComputedHash", "pcbComputedHash"]), # 'CryptSignMessageWithKey': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="CERT_QUERY_ENCODING_TYPE"), "Anonymous": SimUnion({"hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "hNCryptKey": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)}, name="<anon>", label="None"), "dwKeySpec": SimTypeInt(signed=False, label="CERT_KEY_SPEC"), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "pvHashAuxInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "PubKeyAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None)}, name="CRYPT_KEY_SIGN_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSignPara", "pbToBeSigned", "cbToBeSigned", "pbSignedBlob", "pcbSignedBlob"]), # 'CryptVerifyMessageSignatureWithKey': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwMsgEncodingType": SimTypeInt(signed=False, label="UInt32"), "hCryptProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0)}, name="CRYPT_KEY_VERIFY_MESSAGE_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pVerifyPara", "pPublicKeyInfo", "pbSignedBlob", "cbSignedBlob", "pbDecoded", "pcbDecoded"]), # 'CertOpenSystemStoreA': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["hProv", "szSubsystemProtocol"]), # 'CertOpenSystemStoreW': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["hProv", "szSubsystemProtocol"]), # 'CertAddEncodedCertificateToSystemStoreA': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["szCertStoreName", "pbCertEncoded", "cbCertEncoded"]), # 'CertAddEncodedCertificateToSystemStoreW': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["szCertStoreName", "pbCertEncoded", "cbCertEncoded"]), # 'CryptQueryObject': SimTypeFunction([SimTypeInt(signed=False, label="CERT_QUERY_OBJECT_TYPE"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="CERT_QUERY_CONTENT_TYPE_FLAGS"), SimTypeInt(signed=False, label="CERT_QUERY_FORMAT_TYPE_FLAGS"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="CERT_QUERY_ENCODING_TYPE"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="CERT_QUERY_CONTENT_TYPE"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="CERT_QUERY_FORMAT_TYPE"), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwObjectType", "pvObject", "dwExpectedContentTypeFlags", "dwExpectedFormatTypeFlags", "dwFlags", "pdwMsgAndCertEncodingType", "pdwContentType", "pdwFormatType", "phCertStore", "phMsg", "ppvContext"]), # 'CryptMemAlloc': SimTypeFunction([SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["cbSize"]), # 'CryptMemRealloc': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["pv", "cbSize"]), # 'CryptMemFree': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["pv"]), # 'CryptCreateAsyncHandle': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwFlags", "phAsync"]), # 'CryptSetAsyncParam': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["pszParamOid", "pvParam"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hAsync", "pszParamOid", "pvParam", "pfnFree"]), # 'CryptGetAsyncParam': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["pszParamOid", "pvParam"]), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hAsync", "pszParamOid", "ppvParam", "ppfnFree"]), # 'CryptCloseAsyncHandle': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hAsync"]), # 'CertCreateSelfSignCertificate': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="CERT_CREATE_SELFSIGN_FLAGS"), SimTypePointer(SimStruct({"pwszContainerName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszProvName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwProvType": SimTypeInt(signed=False, label="UInt32"), "dwFlags": SimTypeInt(signed=False, label="CRYPT_KEY_FLAGS"), "cProvParam": SimTypeInt(signed=False, label="UInt32"), "rgProvParam": SimTypePointer(SimStruct({"dwParam": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbData": SimTypeInt(signed=False, label="UInt32"), "dwFlags": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_KEY_PROV_PARAM", pack=False, align=None), offset=0), "dwKeySpec": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_KEY_PROV_INFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"wYear": SimTypeShort(signed=False, label="UInt16"), "wMonth": SimTypeShort(signed=False, label="UInt16"), "wDayOfWeek": SimTypeShort(signed=False, label="UInt16"), "wDay": SimTypeShort(signed=False, label="UInt16"), "wHour": SimTypeShort(signed=False, label="UInt16"), "wMinute": SimTypeShort(signed=False, label="UInt16"), "wSecond": SimTypeShort(signed=False, label="UInt16"), "wMilliseconds": SimTypeShort(signed=False, label="UInt16")}, name="SYSTEMTIME", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"wYear": SimTypeShort(signed=False, label="UInt16"), "wMonth": SimTypeShort(signed=False, label="UInt16"), "wDayOfWeek": SimTypeShort(signed=False, label="UInt16"), "wDay": SimTypeShort(signed=False, label="UInt16"), "wHour": SimTypeShort(signed=False, label="UInt16"), "wMinute": SimTypeShort(signed=False, label="UInt16"), "wSecond": SimTypeShort(signed=False, label="UInt16"), "wMilliseconds": SimTypeShort(signed=False, label="UInt16")}, name="SYSTEMTIME", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_EXTENSIONS", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCryptProvOrNCryptKey", "pSubjectIssuerBlob", "dwFlags", "pKeyProvInfo", "pSignatureAlgorithm", "pStartTime", "pEndTime", "pExtensions"]), # 'CryptGetKeyIdentifierProperty': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pKeyIdentifier", "dwPropId", "dwFlags", "pwszComputerName", "pvReserved", "pvData", "pcbData"]), # 'CryptSetKeyIdentifierProperty': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pKeyIdentifier", "dwPropId", "dwFlags", "pwszComputerName", "pvReserved", "pvData"]), # 'CryptEnumKeyIdentifierProperties': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), label="LPArray", offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pKeyIdentifier", "dwFlags", "pvReserved", "pvArg", "cProp", "rgdwPropId", "rgpvData", "rgcbData"]), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pKeyIdentifier", "dwPropId", "dwFlags", "pwszComputerName", "pvReserved", "pvArg", "pfnEnum"]), # 'CryptCreateKeyIdentifierFromCSP': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimStruct({"bType": SimTypeChar(label="Byte"), "bVersion": SimTypeChar(label="Byte"), "reserved": SimTypeShort(signed=False, label="UInt16"), "aiKeyAlg": SimTypeInt(signed=False, label="UInt32")}, name="PUBLICKEYSTRUC", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwCertEncodingType", "pszPubKeyOID", "pPubKeyStruc", "cbPubKeyStruc", "dwFlags", "pvReserved", "pbHash", "pcbHash"]), # 'CertCreateCertificateChainEngine': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "hRestrictedRoot": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hRestrictedTrust": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hRestrictedOther": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cAdditionalStore": SimTypeInt(signed=False, label="UInt32"), "rghAdditionalStore": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwUrlRetrievalTimeout": SimTypeInt(signed=False, label="UInt32"), "MaximumCachedCertificates": SimTypeInt(signed=False, label="UInt32"), "CycleDetectionModulus": SimTypeInt(signed=False, label="UInt32"), "hExclusiveRoot": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hExclusiveTrustedPeople": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "dwExclusiveFlags": SimTypeInt(signed=False, label="UInt32")}, name="CERT_CHAIN_ENGINE_CONFIG", pack=False, align=None), offset=0), SimTypePointer(SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pConfig", "phChainEngine"]), # 'CertFreeCertificateChainEngine': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0)], SimTypeBottom(label="Void"), arg_names=["hChainEngine"]), # 'CertResyncCertificateChainEngine': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hChainEngine"]), # 'CertGetCertificateChain': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "RequestedUsage": SimStruct({"dwType": SimTypeInt(signed=False, label="UInt32"), "Usage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None)}, name="CERT_USAGE_MATCH", pack=False, align=None)}, name="CERT_CHAIN_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["hChainEngine", "pCertContext", "pTime", "hAdditionalStore", "pChainPara", "dwFlags", "pvReserved", "ppChainContext"]), # 'CertFreeCertificateChain': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0)], SimTypeBottom(label="Void"), arg_names=["pChainContext"]), # 'CertDuplicateCertificateChain': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), arg_names=["pChainContext"]), # 'CertFindChainInStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CERT_FIND_CHAIN_IN_STORE_FLAGS"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0)], SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), arg_names=["hCertStore", "dwCertEncodingType", "dwFindFlags", "dwFindType", "pvFindPara", "pPrevChainContext"]), # 'CertVerifyCertificateChainPolicy': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwFlags": SimTypeInt(signed=False, label="CERT_CHAIN_POLICY_FLAGS"), "pvExtraPolicyPara": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CHAIN_POLICY_PARA", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwError": SimTypeInt(signed=False, label="UInt32"), "lChainIndex": SimTypeInt(signed=True, label="Int32"), "lElementIndex": SimTypeInt(signed=True, label="Int32"), "pvExtraPolicyStatus": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CHAIN_POLICY_STATUS", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pszPolicyOID", "pChainContext", "pPolicyPara", "pPolicyStatus"]), # 'CryptStringToBinaryA': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CRYPT_STRING"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pszString", "cchString", "dwFlags", "pbBinary", "pcbBinary", "pdwSkip", "pdwFlags"]), # 'CryptStringToBinaryW': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CRYPT_STRING"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pszString", "cchString", "dwFlags", "pbBinary", "pcbBinary", "pdwSkip", "pdwFlags"]), # 'CryptBinaryToStringA': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CRYPT_STRING"), SimTypePointer(SimTypeChar(label="Byte"), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pbBinary", "cbBinary", "dwFlags", "pszString", "pcchString"]), # 'CryptBinaryToStringW': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="CRYPT_STRING"), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pbBinary", "cbBinary", "dwFlags", "pszString", "pcchString"]), # 'PFXImportCertStore': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="CRYPT_KEY_FLAGS")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["pPFX", "szPassword", "dwFlags"]), # 'PFXIsPFXBlob': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pPFX"]), # 'PFXVerifyPassword': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pPFX", "szPassword", "dwFlags"]), # 'PFXExportCertStoreEx': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hStore", "pPFX", "szPassword", "pvPara", "dwFlags"]), # 'PFXExportCertStore': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["hStore", "pPFX", "szPassword", "dwFlags"]), # 'CertOpenServerOcspResponse': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "pcbUsedSize": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pwszOcspDirectory": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pfnUpdateCallback": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pbEncodedOcspResponse": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbEncodedOcspResponse": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SERVER_OCSP_RESPONSE_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeBottom(label="Void"), arg_names=["pChainContext", "pServerOcspResponseContext", "pNewCrlContext", "pPrevCrlContext", "pvArg", "dwWriteOcspFileError"]), offset=0), "pvUpdateCallbackArg": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_SERVER_OCSP_RESPONSE_OPEN_PARA", pack=False, align=None), offset=0)], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["pChainContext", "dwFlags", "pOpenPara"]), # 'CertAddRefServerOcspResponse': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeBottom(label="Void"), arg_names=["hServerOcspResponse"]), # 'CertCloseServerOcspResponse': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeBottom(label="Void"), arg_names=["hServerOcspResponse", "dwFlags"]), # 'CertGetServerOcspResponseContext': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pbEncodedOcspResponse": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbEncodedOcspResponse": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SERVER_OCSP_RESPONSE_CONTEXT", pack=False, align=None), offset=0), arg_names=["hServerOcspResponse", "dwFlags", "pvReserved"]), # 'CertAddRefServerOcspResponseContext': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pbEncodedOcspResponse": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbEncodedOcspResponse": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SERVER_OCSP_RESPONSE_CONTEXT", pack=False, align=None), offset=0)], SimTypeBottom(label="Void"), arg_names=["pServerOcspResponseContext"]), # 'CertFreeServerOcspResponseContext': SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pbEncodedOcspResponse": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbEncodedOcspResponse": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SERVER_OCSP_RESPONSE_CONTEXT", pack=False, align=None), offset=0)], SimTypeBottom(label="Void"), arg_names=["pServerOcspResponseContext"]), # 'CertRetrieveLogoOrBiometricInfo': SimTypeFunction([SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pCertContext", "lpszLogoOrBiometricType", "dwRetrievalFlags", "dwTimeout", "dwFlags", "pvReserved", "ppbData", "pcbData", "ppwszMimeType"]), # 'CertSelectCertificateChains': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Guid"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"hChainEngine": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pTime": SimTypePointer(SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), offset=0), "hAdditionalStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pChainPara": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "RequestedUsage": SimStruct({"dwType": SimTypeInt(signed=False, label="UInt32"), "Usage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None)}, name="CERT_USAGE_MATCH", pack=False, align=None)}, name="CERT_CHAIN_PARA", pack=False, align=None), offset=0), "dwFlags": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SELECT_CHAIN_PARA", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"dwType": SimTypeInt(signed=False, label="CERT_SELECT_CRITERIA_TYPE"), "cPara": SimTypeInt(signed=False, label="UInt32"), "ppPara": SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)}, name="CERT_SELECT_CRITERIA", pack=False, align=None), label="LPArray", offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSelectionContext", "dwFlags", "pChainParameters", "cCriteria", "rgpCriteria", "hStore", "pcSelection", "pprgpSelection"]), # 'CertFreeCertificateChainList': SimTypeFunction([SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), offset=0)], SimTypeBottom(label="Void"), arg_names=["prgpSelection"]), # 'CryptRetrieveTimeStamp': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypePointer(SimStruct({"pszTSAPolicyId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fRequestCerts": SimTypeInt(signed=True, label="Int32"), "Nonce": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRYPT_TIMESTAMP_PARA", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"cbEncoded": SimTypeInt(signed=False, label="UInt32"), "pbEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pTimeStamp": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "pszTSAPolicyId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "HashedMessage": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ftTime": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "pvAccuracy": SimTypePointer(SimStruct({"dwSeconds": SimTypeInt(signed=False, label="UInt32"), "dwMillis": SimTypeInt(signed=False, label="UInt32"), "dwMicros": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_TIMESTAMP_ACCURACY", pack=False, align=None), offset=0), "fOrdering": SimTypeInt(signed=True, label="Int32"), "Nonce": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "Tsa": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRYPT_TIMESTAMP_INFO", pack=False, align=None), offset=0)}, name="CRYPT_TIMESTAMP_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["wszUrl", "dwRetrievalFlags", "dwTimeout", "pszHashId", "pPara", "pbData", "cbData", "ppTsContext", "ppTsSigner", "phStore"]), # 'CryptVerifyTimeStampSignature': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimTypePointer(SimStruct({"cbEncoded": SimTypeInt(signed=False, label="UInt32"), "pbEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pTimeStamp": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "pszTSAPolicyId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "HashAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "HashedMessage": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ftTime": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "pvAccuracy": SimTypePointer(SimStruct({"dwSeconds": SimTypeInt(signed=False, label="UInt32"), "dwMillis": SimTypeInt(signed=False, label="UInt32"), "dwMicros": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_TIMESTAMP_ACCURACY", pack=False, align=None), offset=0), "fOrdering": SimTypeInt(signed=True, label="Int32"), "Nonce": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "Tsa": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRYPT_TIMESTAMP_INFO", pack=False, align=None), offset=0)}, name="CRYPT_TIMESTAMP_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pbTSContentInfo", "cbTSContentInfo", "pbData", "cbData", "hAdditionalStore", "ppTsContext", "ppTsSigner", "phStore"]), # 'CertIsWeakHash': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cChain": SimTypeInt(signed=False, label="UInt32"), "rgpChain": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "cElement": SimTypeInt(signed=False, label="UInt32"), "rgpElement": SimTypePointer(SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCertContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCertEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCertEncoded": SimTypeInt(signed=False, label="UInt32"), "pCertInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "NotBefore": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NotAfter": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "Subject": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SubjectPublicKeyInfo": SimStruct({"Algorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "PublicKey": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None)}, name="CERT_PUBLIC_KEY_INFO", pack=False, align=None), "IssuerUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "SubjectUniqueId": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cUnusedBits": SimTypeInt(signed=False, label="UInt32")}, name="CRYPT_BIT_BLOB", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CERT_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CERT_CONTEXT", pack=False, align=None), offset=0), "TrustStatus": SimStruct({"dwErrorStatus": SimTypeInt(signed=False, label="UInt32"), "dwInfoStatus": SimTypeInt(signed=False, label="UInt32")}, name="CERT_TRUST_STATUS", pack=False, align=None), "pRevocationInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwRevocationResult": SimTypeInt(signed=False, label="UInt32"), "pszRevocationOid": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pvOidSpecificInfo": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "fHasFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pBaseCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pDeltaCrlContext": SimTypePointer(SimStruct({"dwCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCrlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCrlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCrlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SignatureAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Issuer": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cCRLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCRLEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="CRL_CONTEXT", pack=False, align=None), offset=0), "pCrlEntry": SimTypePointer(SimStruct({"SerialNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "RevocationDate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CRL_ENTRY", pack=False, align=None), offset=0), "fDeltaCrlEntry": SimTypeInt(signed=True, label="Int32")}, name="CERT_REVOCATION_CRL_INFO", pack=False, align=None), offset=0)}, name="CERT_REVOCATION_INFO", pack=False, align=None), offset=0), "pIssuanceUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pApplicationUsage": SimTypePointer(SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), offset=0), "pwszExtendedErrorInfo": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CERT_CHAIN_ELEMENT", pack=False, align=None), offset=0), offset=0), "pTrustListInfo": SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pCtlEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "pCtlContext": SimTypePointer(SimStruct({"dwMsgAndCertEncodingType": SimTypeInt(signed=False, label="UInt32"), "pbCtlEncoded": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlEncoded": SimTypeInt(signed=False, label="UInt32"), "pCtlInfo": SimTypePointer(SimStruct({"dwVersion": SimTypeInt(signed=False, label="UInt32"), "SubjectUsage": SimStruct({"cUsageIdentifier": SimTypeInt(signed=False, label="UInt32"), "rgpszUsageIdentifier": SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0)}, name="CTL_USAGE", pack=False, align=None), "ListIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "SequenceNumber": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "ThisUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "NextUpdate": SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), "SubjectAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "cCTLEntry": SimTypeInt(signed=False, label="UInt32"), "rgCTLEntry": SimTypePointer(SimStruct({"SubjectIdentifier": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), "cAttribute": SimTypeInt(signed=False, label="UInt32"), "rgAttribute": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cValue": SimTypeInt(signed=False, label="UInt32"), "rgValue": SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)}, name="CRYPT_ATTRIBUTE", pack=False, align=None), offset=0)}, name="CTL_ENTRY", pack=False, align=None), offset=0), "cExtension": SimTypeInt(signed=False, label="UInt32"), "rgExtension": SimTypePointer(SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "fCritical": SimTypeInt(signed=True, label="Int32"), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CERT_EXTENSION", pack=False, align=None), offset=0)}, name="CTL_INFO", pack=False, align=None), offset=0), "hCertStore": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "hCryptMsg": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pbCtlContent": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "cbCtlContent": SimTypeInt(signed=False, label="UInt32")}, name="CTL_CONTEXT", pack=False, align=None), offset=0)}, name="CERT_TRUST_LIST_INFO", pack=False, align=None), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32")}, name="CERT_SIMPLE_CHAIN", pack=False, align=None), offset=0), offset=0), "cLowerQualityChainContext": SimTypeInt(signed=False, label="UInt32"), "rgpLowerQualityChainContext": SimTypePointer(SimTypePointer(SimTypeBottom(label="CERT_CHAIN_CONTEXT"), offset=0), offset=0), "fHasRevocationFreshnessTime": SimTypeInt(signed=True, label="Int32"), "dwRevocationFreshnessTime": SimTypeInt(signed=False, label="UInt32"), "dwCreateFlags": SimTypeInt(signed=False, label="UInt32"), "ChainId": SimTypeBottom(label="Guid")}, name="CERT_CHAIN_CONTEXT", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"dwLowDateTime": SimTypeInt(signed=False, label="UInt32"), "dwHighDateTime": SimTypeInt(signed=False, label="UInt32")}, name="FILETIME", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["dwHashUseType", "pwszCNGHashAlgid", "dwChainFlags", "pSignerChainContext", "pTimeStamp", "pwszFileName"]), # 'CryptProtectData': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwPromptFlags": SimTypeInt(signed=False, label="UInt32"), "hwndApp": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "szPrompt": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CRYPTPROTECT_PROMPTSTRUCT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pDataIn", "szDataDescr", "pOptionalEntropy", "pvReserved", "pPromptStruct", "dwFlags", "pDataOut"]), # 'CryptUnprotectData': SimTypeFunction([SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0), SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "dwPromptFlags": SimTypeInt(signed=False, label="UInt32"), "hwndApp": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "szPrompt": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="CRYPTPROTECT_PROMPTSTRUCT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pDataIn", "ppszDataDescr", "pOptionalEntropy", "pvReserved", "pPromptStruct", "dwFlags", "pDataOut"]), # 'CryptUpdateProtectedState': SimTypeFunction([SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pOldSid", "pwszOldPassword", "dwFlags", "pdwSuccessCount", "pdwFailureCount"]), # 'CryptProtectMemory': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pDataIn", "cbDataIn", "dwFlags"]), # 'CryptUnprotectMemory': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pDataIn", "cbDataIn", "dwFlags"]), # 'CryptSIPLoad': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Guid"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "hSIP": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pfGet": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pgSubjectType": SimTypePointer(SimTypeBottom(label="Guid"), offset=0), "hFile": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pwsFileName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwsDisplayName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwReserved1": SimTypeInt(signed=False, label="UInt32"), "dwIntVersion": SimTypeInt(signed=False, label="UInt32"), "hProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwReserved2": SimTypeInt(signed=False, label="UInt32"), "fdwCAPISettings": SimTypeInt(signed=False, label="UInt32"), "fdwSecuritySettings": SimTypeInt(signed=False, label="UInt32"), "dwIndex": SimTypeInt(signed=False, label="UInt32"), "dwUnionChoice": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"psFlat": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_FLAT"), offset=0), "psCatMember": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_CATALOGMEMBER"), offset=0), "psBlob": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_BLOB"), offset=0)}, name="<anon>", label="None"), "pClientData": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="SIP_SUBJECTINFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectInfo", "pdwEncodingType", "dwIndex", "pcbSignedDataMsg", "pbSignedDataMsg"]), offset=0), "pfPut": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pgSubjectType": SimTypePointer(SimTypeBottom(label="Guid"), offset=0), "hFile": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pwsFileName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwsDisplayName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwReserved1": SimTypeInt(signed=False, label="UInt32"), "dwIntVersion": SimTypeInt(signed=False, label="UInt32"), "hProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwReserved2": SimTypeInt(signed=False, label="UInt32"), "fdwCAPISettings": SimTypeInt(signed=False, label="UInt32"), "fdwSecuritySettings": SimTypeInt(signed=False, label="UInt32"), "dwIndex": SimTypeInt(signed=False, label="UInt32"), "dwUnionChoice": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"psFlat": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_FLAT"), offset=0), "psCatMember": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_CATALOGMEMBER"), offset=0), "psBlob": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_BLOB"), offset=0)}, name="<anon>", label="None"), "pClientData": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="SIP_SUBJECTINFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Byte"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectInfo", "dwEncodingType", "pdwIndex", "cbSignedDataMsg", "pbSignedDataMsg"]), offset=0), "pfCreate": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pgSubjectType": SimTypePointer(SimTypeBottom(label="Guid"), offset=0), "hFile": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pwsFileName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwsDisplayName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwReserved1": SimTypeInt(signed=False, label="UInt32"), "dwIntVersion": SimTypeInt(signed=False, label="UInt32"), "hProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwReserved2": SimTypeInt(signed=False, label="UInt32"), "fdwCAPISettings": SimTypeInt(signed=False, label="UInt32"), "fdwSecuritySettings": SimTypeInt(signed=False, label="UInt32"), "dwIndex": SimTypeInt(signed=False, label="UInt32"), "dwUnionChoice": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"psFlat": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_FLAT"), offset=0), "psCatMember": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_CATALOGMEMBER"), offset=0), "psBlob": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_BLOB"), offset=0)}, name="<anon>", label="None"), "pClientData": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="SIP_SUBJECTINFO", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimStruct({"Data": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ATTRIBUTE_TYPE_VALUE", pack=False, align=None), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Digest": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="SIP_INDIRECT_DATA", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectInfo", "pcbIndirectData", "pIndirectData"]), offset=0), "pfVerify": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pgSubjectType": SimTypePointer(SimTypeBottom(label="Guid"), offset=0), "hFile": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pwsFileName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwsDisplayName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwReserved1": SimTypeInt(signed=False, label="UInt32"), "dwIntVersion": SimTypeInt(signed=False, label="UInt32"), "hProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwReserved2": SimTypeInt(signed=False, label="UInt32"), "fdwCAPISettings": SimTypeInt(signed=False, label="UInt32"), "fdwSecuritySettings": SimTypeInt(signed=False, label="UInt32"), "dwIndex": SimTypeInt(signed=False, label="UInt32"), "dwUnionChoice": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"psFlat": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_FLAT"), offset=0), "psCatMember": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_CATALOGMEMBER"), offset=0), "psBlob": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_BLOB"), offset=0)}, name="<anon>", label="None"), "pClientData": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="SIP_SUBJECTINFO", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"Data": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Value": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ATTRIBUTE_TYPE_VALUE", pack=False, align=None), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "Digest": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="SIP_INDIRECT_DATA", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectInfo", "pIndirectData"]), offset=0), "pfRemove": SimTypePointer(SimTypeFunction([SimTypePointer(SimStruct({"cbSize": SimTypeInt(signed=False, label="UInt32"), "pgSubjectType": SimTypePointer(SimTypeBottom(label="Guid"), offset=0), "hFile": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "pwsFileName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwsDisplayName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "dwReserved1": SimTypeInt(signed=False, label="UInt32"), "dwIntVersion": SimTypeInt(signed=False, label="UInt32"), "hProv": SimTypePointer(SimTypeInt(signed=False, label="UInt"), label="UIntPtr", offset=0), "DigestAlgorithm": SimStruct({"pszObjId": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "Parameters": SimStruct({"cbData": SimTypeInt(signed=False, label="UInt32"), "pbData": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="CRYPTOAPI_BLOB", pack=False, align=None)}, name="CRYPT_ALGORITHM_IDENTIFIER", pack=False, align=None), "dwFlags": SimTypeInt(signed=False, label="UInt32"), "dwEncodingType": SimTypeInt(signed=False, label="UInt32"), "dwReserved2": SimTypeInt(signed=False, label="UInt32"), "fdwCAPISettings": SimTypeInt(signed=False, label="UInt32"), "fdwSecuritySettings": SimTypeInt(signed=False, label="UInt32"), "dwIndex": SimTypeInt(signed=False, label="UInt32"), "dwUnionChoice": SimTypeInt(signed=False, label="UInt32"), "Anonymous": SimUnion({"psFlat": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_FLAT"), offset=0), "psCatMember": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_CATALOGMEMBER"), offset=0), "psBlob": SimTypePointer(SimTypeBottom(label="MS_ADDINFO_BLOB"), offset=0)}, name="<anon>", label="None"), "pClientData": SimTypePointer(SimTypeBottom(label="Void"), offset=0)}, name="SIP_SUBJECTINFO", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pSubjectInfo", "dwIndex"]), offset=0)}, name="SIP_DISPATCH_INFO", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pgSubject", "dwFlags", "pSipDispatch"]), # 'CryptSIPRetrieveSubjectGuid': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypePointer(SimTypeBottom(label="Guid"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["FileName", "hFileIn", "pgSubject"]), # 'CryptSIPRetrieveSubjectGuidForCatalogFile': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), SimTypePointer(SimTypeBottom(label="Guid"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["FileName", "hFileIn", "pgSubject"]), # 'CryptSIPAddProvider': SimTypeFunction([SimTypePointer(SimStruct({"cbStruct": SimTypeInt(signed=False, label="UInt32"), "pgSubject": SimTypePointer(SimTypeBottom(label="Guid"), offset=0), "pwszDLLFileName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszMagicNumber": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszIsFunctionName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszGetFuncName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszPutFuncName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszCreateFuncName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszVerifyFuncName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszRemoveFuncName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszIsFunctionNameFmt2": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pwszGetCapFuncName": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="SIP_ADD_NEWPROVIDER", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["psNewProv"]), # 'CryptSIPRemoveProvider': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Guid"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pgProv"]), } lib.set_prototypes(prototypes)
1,693.73125
41,914
0.750237
90,523
812,991
6.688201
0.011356
0.138003
0.12471
0.201924
0.97594
0.97427
0.971959
0.970715
0.96929
0.967785
0
0.019356
0.054916
812,991
479
41,915
1,697.267223
0.768618
0.000034
0
0
0
0
0.261979
0.023129
0
0
0
0
0
1
0
false
0.020576
0.041152
0
0.041152
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
950bc70e9680e09136d9b21fd40ae4c155c592fd
198
py
Python
pymedphys/mosaiq.py
pymedphys/pymedphys-archive-2019
6bb7c8d0da2e93ff56469bb47e65b15ece2ea25e
[ "Apache-2.0" ]
1
2020-12-20T14:13:56.000Z
2020-12-20T14:13:56.000Z
pymedphys/mosaiq.py
pymedphys/pymedphys-archive-2019
6bb7c8d0da2e93ff56469bb47e65b15ece2ea25e
[ "Apache-2.0" ]
6
2020-10-06T15:36:46.000Z
2022-02-27T05:15:17.000Z
pymedphys/mosaiq.py
cpbhatt/pymedphys
177b3db8e2a6e83c44835d0007d1d5c7a420fd99
[ "Apache-2.0" ]
1
2020-12-20T14:14:00.000Z
2020-12-20T14:14:00.000Z
# pylint: disable = unused-import, missing-docstring from ._mosaiq.connect import connect from ._mosaiq.connect import execute_sql as execute from ._mosaiq.helpers import get_qcls_by_date as qcls
28.285714
53
0.818182
29
198
5.344828
0.586207
0.193548
0.219355
0.296774
0
0
0
0
0
0
0
0
0.121212
198
6
54
33
0.890805
0.252525
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
1f266d409aadf44ae30f563d14e91f67f20cb74e
127
py
Python
sparsereg/model/__init__.py
Thomasillo/sparsereg
9cbfbd2e3479580f121e6f14ee4b131e7d6fd74d
[ "MIT" ]
null
null
null
sparsereg/model/__init__.py
Thomasillo/sparsereg
9cbfbd2e3479580f121e6f14ee4b131e7d6fd74d
[ "MIT" ]
null
null
null
sparsereg/model/__init__.py
Thomasillo/sparsereg
9cbfbd2e3479580f121e6f14ee4b131e7d6fd74d
[ "MIT" ]
null
null
null
from sparsereg.model.base import RationalFunctionMixin, STRidge, BoATS, fit_with_noise from sparsereg.model.sindy import SINDy
42.333333
86
0.858268
17
127
6.294118
0.705882
0.242991
0.336449
0
0
0
0
0
0
0
0
0
0.086614
127
2
87
63.5
0.922414
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
1f485ec456b37939bd1cd76847e90ccf34a1b3d8
3,416
py
Python
progs/python-t77-date-master/python-t77-date-master/tests/set_prev_week_day_test.py
am-3/TimeZoned
e8ae2e90c2d6addf13b145aa2a4c7a9a66c1346e
[ "MIT" ]
null
null
null
progs/python-t77-date-master/python-t77-date-master/tests/set_prev_week_day_test.py
am-3/TimeZoned
e8ae2e90c2d6addf13b145aa2a4c7a9a66c1346e
[ "MIT" ]
1
2016-02-08T18:43:49.000Z
2016-02-08T19:21:13.000Z
progs/python-t77-date-master/python-t77-date-master/tests/set_prev_week_day_test.py
am-3/TimeZoned
e8ae2e90c2d6addf13b145aa2a4c7a9a66c1346e
[ "MIT" ]
null
null
null
import unittest from datetime import datetime, date from t77_date import FRIDAY, ISO_FRIDAY, set_prev_week_day class SetPrevWeekDayTestCase(unittest.TestCase): def test_date_saturday_to_prev_friday(self): saturday = date(2016, 7, 2) # SATURDAY prev_friday = set_prev_week_day(saturday, FRIDAY) self.assertEqual(prev_friday.weekday(), FRIDAY) self.assertLess(prev_friday, saturday) def test_date_friday_to_friday(self): friday = date(2016, 7, 1) # FRIDAY prev_friday = set_prev_week_day(friday, FRIDAY) self.assertEqual(prev_friday.weekday(), FRIDAY) self.assertEqual(prev_friday, friday) def test_date_thursday_to_prev_friday(self): thursday = date(2016, 6, 30) # THURSDAY prev_friday = set_prev_week_day(thursday, FRIDAY) self.assertEqual(prev_friday.weekday(), FRIDAY) self.assertLess(prev_friday, thursday) def test_datetime_saturday_to_prev_friday(self): saturday = datetime(2016, 7, 2, 12) # SATURDAY prev_friday = set_prev_week_day(saturday, FRIDAY) self.assertEqual(prev_friday.weekday(), FRIDAY) self.assertLess(prev_friday, saturday) def test_datetime_friday_to_friday(self): friday = datetime(2016, 7, 1, 12) # FRIDAY prev_friday = set_prev_week_day(friday, FRIDAY) self.assertEqual(prev_friday.weekday(), FRIDAY) self.assertEqual(prev_friday, friday) def test_datetime_thursday_to_prev_friday(self): thursday = datetime(2016, 6, 30, 12) # THURSDAY prev_friday = set_prev_week_day(thursday, FRIDAY) self.assertEqual(prev_friday.weekday(), FRIDAY) self.assertLess(prev_friday, thursday) def test_date_saturday_to_prev_friday_iso(self): saturday = date(2016, 7, 2) # SATURDAY prev_friday = set_prev_week_day(saturday, ISO_FRIDAY, True) self.assertEqual(prev_friday.isoweekday(), ISO_FRIDAY) self.assertLess(prev_friday, saturday) def test_date_friday_to_friday_iso(self): friday = date(2016, 7, 1) # FRIDAY prev_friday = set_prev_week_day(friday, ISO_FRIDAY, True) self.assertEqual(prev_friday.isoweekday(), ISO_FRIDAY) self.assertEqual(prev_friday, friday) def test_date_thursday_to_prev_friday_iso(self): thursday = date(2016, 6, 30) # THURSDAY prev_friday = set_prev_week_day(thursday, ISO_FRIDAY, True) self.assertEqual(prev_friday.isoweekday(), ISO_FRIDAY) self.assertLess(prev_friday, thursday) def test_datetime_saturday_to_prev_friday_iso(self): saturday = datetime(2016, 7, 2, 12) # SATURDAY prev_friday = set_prev_week_day(saturday, ISO_FRIDAY, True) self.assertEqual(prev_friday.isoweekday(), ISO_FRIDAY) self.assertLess(prev_friday, saturday) def test_datetime_friday_to_friday_iso(self): friday = datetime(2016, 7, 1, 12) # FRIDAY prev_friday = set_prev_week_day(friday, ISO_FRIDAY, True) self.assertEqual(prev_friday.isoweekday(), ISO_FRIDAY) self.assertEqual(prev_friday, friday) def test_datetime_thursday_to_prev_friday_iso(self): thursday = datetime(2016, 6, 30, 12) # THURSDAY prev_friday = set_prev_week_day(thursday, ISO_FRIDAY, True) self.assertEqual(prev_friday.isoweekday(), ISO_FRIDAY) self.assertLess(prev_friday, thursday)
43.240506
67
0.708431
444
3,416
5.11036
0.074324
0.193918
0.13398
0.176289
0.950198
0.941384
0.93874
0.909211
0.909211
0.909211
0
0.033003
0.201698
3,416
78
68
43.794872
0.799047
0.028981
0
0.75
0
0
0
0
0
0
0
0
0.375
1
0.1875
false
0
0.046875
0
0.25
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
1f74298ab405883543bbd9eeb556a9cb73932262
9,779
py
Python
python/dlxapi/api/mappings_api.py
dlens/dlxapi
189a6519240ce625d7a9cdb89e305a335d2aa045
[ "MIT" ]
null
null
null
python/dlxapi/api/mappings_api.py
dlens/dlxapi
189a6519240ce625d7a9cdb89e305a335d2aa045
[ "MIT" ]
1
2020-08-20T17:31:43.000Z
2020-08-20T17:31:43.000Z
python/dlxapi/api/mappings_api.py
dlens/dlxapi
189a6519240ce625d7a9cdb89e305a335d2aa045
[ "MIT" ]
null
null
null
# coding: utf-8 """ Decision Lens API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from dlxapi.api_client import ApiClient class MappingsApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def spreadsheet_to_mappings(self, file, **kwargs): # noqa: E501 """Accepts upload of spreadsheet and converts data into mappings. # noqa: E501 Maps the fields in the spreadsheet to appropriate buckets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.spreadsheet_to_mappings(file, async_req=True) >>> result = thread.get() :param async_req bool :param file file: maybe put supported file types here? (required) :return: Mappings If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.spreadsheet_to_mappings_with_http_info(file, **kwargs) # noqa: E501 else: (data) = self.spreadsheet_to_mappings_with_http_info(file, **kwargs) # noqa: E501 return data def spreadsheet_to_mappings_with_http_info(self, file, **kwargs): # noqa: E501 """Accepts upload of spreadsheet and converts data into mappings. # noqa: E501 Maps the fields in the spreadsheet to appropriate buckets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.spreadsheet_to_mappings_with_http_info(file, async_req=True) >>> result = thread.get() :param async_req bool :param file file: maybe put supported file types here? (required) :return: Mappings If the method is called asynchronously, returns the request thread. """ all_params = ['file'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method spreadsheet_to_mappings" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'file' is set if self.api_client.client_side_validation and ('file' not in params or params['file'] is None): # noqa: E501 raise ValueError("Missing the required parameter `file` when calling `spreadsheet_to_mappings`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} if 'file' in params: local_var_files['file'] = params['file'] # noqa: E501 body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['multipart/form-data']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2'] # noqa: E501 return self.api_client.call_api( '/mappings/spreadsheet', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Mappings', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_mapping(self, id, body, **kwargs): # noqa: E501 """Update mapping # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_mapping(id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Mapping id (required) :param Operations body: JSON Patch Operations to update mapping. (required) :param str expand: JSON string containing an array expand specifications for fields. An expand specification must have a path and includes optional properties match, unique, allPossible, limit, offset, orderBy. :return: list[Mapping] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_mapping_with_http_info(id, body, **kwargs) # noqa: E501 else: (data) = self.update_mapping_with_http_info(id, body, **kwargs) # noqa: E501 return data def update_mapping_with_http_info(self, id, body, **kwargs): # noqa: E501 """Update mapping # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_mapping_with_http_info(id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Mapping id (required) :param Operations body: JSON Patch Operations to update mapping. (required) :param str expand: JSON string containing an array expand specifications for fields. An expand specification must have a path and includes optional properties match, unique, allPossible, limit, offset, orderBy. :return: list[Mapping] If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'body', 'expand'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_mapping" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if self.api_client.client_side_validation and ('id' not in params or params['id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `id` when calling `update_mapping`") # noqa: E501 # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in params or params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `update_mapping`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] if 'expand' in params: query_params.append(('expand', params['expand'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2'] # noqa: E501 return self.api_client.call_api( '/mappings/{id}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[Mapping]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
40.242798
219
0.614582
1,137
9,779
5.081794
0.165347
0.049844
0.024749
0.024922
0.840602
0.826411
0.78972
0.753721
0.753721
0.753721
0
0.017149
0.296349
9,779
242
220
40.409091
0.822555
0.36517
0
0.629032
1
0
0.166492
0.039791
0
0
0
0
0
1
0.040323
false
0
0.032258
0
0.129032
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
2f076c111fc96aa52b611a5f36a72096e1df0e54
6,087
py
Python
tests/test_hypergeometric_distribution.py
jsleb333/hypergeometric_tail_inversion
7141d2bfec97f8d2e162a389531f01ce6e931b7c
[ "MIT" ]
null
null
null
tests/test_hypergeometric_distribution.py
jsleb333/hypergeometric_tail_inversion
7141d2bfec97f8d2e162a389531f01ce6e931b7c
[ "MIT" ]
null
null
null
tests/test_hypergeometric_distribution.py
jsleb333/hypergeometric_tail_inversion
7141d2bfec97f8d2e162a389531f01ce6e931b7c
[ "MIT" ]
null
null
null
from scipy.special import binom, comb from hypergeo.hypergeometric_distribution import * def test_hypergeometric_pmf(): k, m, K, M = 5, 13, 16, 30 assert np.isclose(hypergeometric_pmf(k, m, K, M), binom(K, k) * binom(M-K, m-k) / binom(M, m)) def test_hypergeometric_tail(): k, m, K, M = 5, 13, 16, 30 assert np.isclose(hypergeometric_tail(k, m, K, M), sum(binom(K, j)*binom(M-K, m-j)/binom(M, m) for j in range(k+1))) def test_hypergeometric_lower_tail(): k, m, K, M = 5, 13, 16, 30 assert np.isclose(hypergeometric_tail(k, m, K, M), 1-hypergeometric_lower_tail(k, m, K, M)) def test_berkopec_single_term(): k, m, K, M = 5, 13, 16, 30 assert berkopec_single_term(k,m,K,M) == binom(K, k)*binom(M-K-1, M-K-m+k)/binom(M, m) def test_berkopec_formula_equals_tail(): k, m, K, M = 50, 200, 500, 1000 berkopec = hypergeometric_berkopec_tail(k, m, K, M) # assert np.isclose(berkopec, hypergeometric_tail(k, m, K, M), atol=10-35, rtol=10e-20) k, m, K, M = 10, 200, 10, 1000 berkopec = hypergeometric_berkopec_tail(k, m, K, M) print(f'{berkopec:e}') assert berkopec == 1 def test_hypergeometric_tail_inverse_is_inverse(): k, m, K, M = 5, 13, 16, 30 k, m, K, M = 20, 200, 42, 222 assert hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M), M) == K assert hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)-10e-22, M) == K+1 assert hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)+10e-18, M) == K for delta in [0.05, 0.1, 0.25, 10e-20]: assert hypergeometric_tail(k, m, hypergeometric_tail_inverse(k,m,delta,M), M) <= delta def test_hypergeometric_tail_inverse_log_delta_is_same_as_delta(): delta = 0.05 k, m, _, M = 20, 200, 42, 222 assert hypergeometric_tail_inverse(k, m, delta, M) == hypergeometric_tail_inverse(k, m, np.log(delta), M, log_delta=True) def test_hypergeometric_tail_lower_inverse_is_inverse(): k, m, K, M = 5, 13, 16, 30 k, m, K, M = 20, 150, 52, 222 assert hypergeometric_tail_lower_inverse(k, m, 1-hypergeometric_tail(k,m,K,M), M) == K assert hypergeometric_tail_lower_inverse(k, m, 1-hypergeometric_tail(k,m,K+1,M), M) == K+1 assert hypergeometric_tail_lower_inverse(k, m, 1-hypergeometric_tail(k,m,K-1,M), M) == K-1 mean = (hypergeometric_tail(k,m,K,M) + hypergeometric_tail(k,m,K-1,M))/2 assert hypergeometric_tail_lower_inverse(k, m, 1-mean, M) == K-1 assert hypergeometric_tail_lower_inverse(k, m, 1-hypergeometric_tail(k,m,K,M)+10e-18, M) == K for delta in [0.05, 0.1, 0.25, 1-10e-20]: assert hypergeometric_tail(k, m, hypergeometric_tail_lower_inverse(k,m,1-delta,M), M) >= delta def test_berkopec_hypergeometric_tail_inverse_below_is_inverse(): k, m, K, M = 5, 13, 16, 30 assert berkopec_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M), M) == K assert berkopec_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)-0.001, M) == K+1 assert berkopec_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)+0.001, M) == K for delta in [0.05, 0.1, 0.25, 10e-20]: assert hypergeometric_tail(k, m, berkopec_hypergeometric_tail_inverse(k,m,delta,M), M) <= delta def test_berkopec_hypergeometric_tail_inverse_above_is_inverse(): k, m, K, M = 5, 13, 16, 30 assert berkopec_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M), M, start='above') == K assert berkopec_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)-0.001, M, start='above') == K+1 assert berkopec_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)+0.001, M, start='above') == K for delta in [0.05, 0.1, 0.25, 10e-20]: assert hypergeometric_tail(k, m, berkopec_hypergeometric_tail_inverse(k,m,delta,M, start='above'), M) <= delta def test_logberkopec_hypergeometric_tail_inverse_below_is_inverse(): k, m, K, M = 5, 13, 16, 30 assert logberkopec_hypergeometric_tail_inverse(k, m, np.log(hypergeometric_tail(k,m,K,M)), M) == K assert logberkopec_hypergeometric_tail_inverse(k, m, np.log(hypergeometric_tail(k,m,K,M)-0.001), M) == K+1 assert logberkopec_hypergeometric_tail_inverse(k, m, np.log(hypergeometric_tail(k,m,K,M)+0.001), M) == K for delta in [0.05, 0.1, 0.25]: assert np.log(hypergeometric_tail(k, m, logberkopec_hypergeometric_tail_inverse(k,m,np.log(delta),M), M)) <= np.log(delta) def test_logberkopec_hypergeometric_tail_inverse_below_is_same_as_log_above(): k, m, K, M = 5, 13, 16, 30 for delta in [0.05, 0.1, 0.25]: assert logberkopec_hypergeometric_tail_inverse(k, m, np.log(delta), M, start='below') == logberkopec_hypergeometric_tail_inverse(k, m, np.log(delta), M, start='above') k, m, K, M = 7, 50, 40, 200 for delta in [0.05, 0.1, 0.25]: assert logberkopec_hypergeometric_tail_inverse(k, m, np.log(delta), M, start='below') == logberkopec_hypergeometric_tail_inverse(k, m, np.log(delta), M, start='above') def test_naive_hypergeometric_tail_inverse_below_is_inverse(): k, m, K, M = 5, 13, 16, 30 assert naive_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M), M) == K assert naive_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)-0.001, M) == K+1 assert naive_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)+0.001, M) == K for delta in [0.05, 0.1, 0.25]: assert hypergeometric_tail(k, m, naive_hypergeometric_tail_inverse(k,m,delta,M), M) <= delta def test_naive_hypergeometric_tail_inverse_above_is_inverse(): k, m, K, M = 5, 13, 16, 30 assert naive_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M), M, start='above') == K assert naive_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)-0.001, M, start='above') == K+1 assert naive_hypergeometric_tail_inverse(k, m, hypergeometric_tail(k,m,K,M)+0.001, M, start='above') == K for delta in [0.05, 0.1, 0.25]: assert hypergeometric_tail(k, m, naive_hypergeometric_tail_inverse(k,m,delta,M, start='above'), M) <= delta
49.08871
175
0.695416
1,076
6,087
3.723048
0.067844
0.070894
0.038193
0.045931
0.909386
0.892661
0.862456
0.832501
0.82002
0.750125
0
0.062196
0.154756
6,087
123
176
49.487805
0.716424
0.013964
0
0.27907
0
0
0.012
0
0
0
0
0
0.44186
1
0.162791
false
0
0.023256
0
0.186047
0.011628
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
7
2f276e9109dbe4d3ee24a8286626c8b55b990b30
15,744
py
Python
build/lib/sspredict/make_prediction/input_format.py
DS-Wen/SSPredict
663f693405b066d4b93751c8374d9f5412c501ee
[ "MIT" ]
2
2019-03-02T06:32:05.000Z
2021-04-30T04:18:24.000Z
build/lib/sspredict/make_prediction/input_format.py
DS-Wen/SSPredict
663f693405b066d4b93751c8374d9f5412c501ee
[ "MIT" ]
null
null
null
build/lib/sspredict/make_prediction/input_format.py
DS-Wen/SSPredict
663f693405b066d4b93751c8374d9f5412c501ee
[ "MIT" ]
1
2019-05-12T11:46:24.000Z
2019-05-12T11:46:24.000Z
class input_format(): def __init__(self,format_tag): self.tag = format_tag def print_sample_input(self): if self.tag =='FCC_BCC_Edge_Ternary': print(''' Sample JSON for using pseudo-ternary predictions of solid solution strength by Curtin edge dislocation model. ------------------------------------------------------------ { "material":"MnFeCoNiAl", "structure":"FCC", "pseudo-ternary":{ "increment": 1, "psA": {"grouped_elements":["Mn","Co"], "ratio": [1,1], "range":[0,100]}, "psB": {"grouped_elements":["Fe","Ni"], "ratio": [1,1], "range":[0,100]}, "psC": {"grouped_elements":["Al"], "ratio": [1], "range":[0,100]} }, "elements":{ "Co": {"Vn":11.12,"E":262.9,"G":101.7,"nu":0.292}, "Ni": {"Vn":10.94,"E":199.1,"G":76.0,"nu":0.309}, "Al": {"Vn":16.472,"E":65.5,"G":23.9,"nu":0.369}, "Mn": {"Vn":12.60,"E":197.7,"G":73.4,"nu":0.347}, "Fe": {"Vn":12.09,"E":194.3,"G":73.4} }, "uncertainty_level":{ "on/off":"on", "a":0.01, "elastic_constants":0.05 }, "conditions":{"temperature":300,"strain_r":0.001}, "model":{ "name":"FCC_Varvenne-Curtin-2016" }, "savefile":"MnFeCoNiAl_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "structure": "FCC" or "BCC" -- "pseudo-ternary": containing "psA" "psB" 'psC' for pseudo-ternary components "psA": pseudo-ternary component, can be a single element or grouped element. "grouped_elements": # group specific elements in psA # eg. "grouped_elements":["Ni","Co"], Mn and Co are grouped "ratio": # specify the ratio between elements in A # eg. "ratio": [1,1], represent Co:Ni=1:1 "range": # specify the concentration range for "psA" # eg. "range":[0,100], range from 0 to 100 at.% -- "elements": input data for elements: "Co": element symbol for Co "Vn": atomic volume "a": lattice constant "b": Burgers vector # NOTE, just need to specify one of "Vn", "a" or "b" "E": Young's modulus "G": shear modulus "nu": Poisson's ratio # NOTE, in Voigt notation, as indicated in the paper. # Need to specify 2 of the "E", "G", and "nu" for isotropic. -- "conditions": experimental conditions "temperature": Kelvin "strain_r": experiment strain rate, typical tensile tests: 0.001 /s "model": IMPORTANT!!! "name": name of the model, use "FCC_Varvenne-Curtin-2016" for FCC and use "BCC_edge_Maresca-Curtin-2019" for BCC The following are adjustable parameters for the model "f1": # dimensionless pressure field parameter for athermal yield stress "f2": # dimensionless pressure field parameter for energy barrier "alpha": # dislocation line tension parameter IMPORTANT: If you don't know f1, f2, and alpha for your material, DO NOT change f1, f2 and alpha. The default values were optimized for FCC HEAs and BCC HEAs. Read Curtin's papers. ------- Optional tags: "uncertainty_level": allow uncertainty evaluation on input data. "on/off":"on" # turn on/off the uncertainty calculation # if off, no need to set the following tags # if on, specify the standard deviations for lattice constants and elastic constants "a": 0.01 # applied 1% standard deviation to lattice constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # a new lattice constant will be generated using normal distribution, # centered at the value "a" (lattice constants) in "elements" # with a standard deviation 0.01a. "elastic_constants": 0.05 # applied 5% standard deviation to elastic constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # new elastic constants will be generated using normal distribution, # centered at the values "E", "G", "nu" (elastic constants) in "elements" # with a standard deviation 0.01a. "savefile": output filename, CSV file. END ''') elif self.tag =='FCC_BCC_Edge_Composition_Temperature': print(''' Sample JSON for composition-temperature predictions of solid solution strength by Curtin edge dislocation model. ------------------------------------------------------------ { "material":"MnFeCoNi", "structure":"FCC", "elements":{ "Co": {"Vn":11.12,"E":262.9,"G":101.7,"nu":0.292}, "Ni": {"Vn":10.94,"E":199.1,"G":76.0,"nu":0.309}, "Mn": {"Vn":12.60,"E":197.7,"G":73.4,"nu":0.347}, "Fe": {"Vn":12.09,"E":194.3,"G":73.4} }, "compositions":{ "element_order": ["Co","Ni","Fe","Mn"], "concentrations": [ [25,25,25,25], [20,20,30,30], [30,30,20,20] ] }, "uncertainty_level":{ "on/off":"on", "a":0.01, "elastic_constants":0.05 }, "conditions":{ "temperature":{ "min": 300, "max": 600, "inc": 10 }, "strain_r":0.001 }, "model":{ "name":"FCC_Varvenne-Curtin-2016" }, "savefile":"MnFeCoNi_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "structure": "FCC" or "BCC" -- "compositions": containing element symbols and concentrations for calculation. "element_order": a list of element symbols in order, be consistent with the "concentrations" "concentrations": a list of concentrations in at.% for elements in the "element_order", add up to 100. -- "elements": input data for elements: "Co": element symbol for Co "Vn": atomic volume "a": lattice constant "b": Burgers vector # NOTE, just need to specify one of "Vn", "a" or "b" "E": Young's modulus "G": shear modulus "nu": Poisson's ratio # NOTE, in Voigt notation, as indicated in the paper. # Need to specify 2 of the "E", "G", and "nu" for isotropic. -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) range and increment for the calculations. "max": max T "min": min T "inc": increment. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s "model": IMPORTANT!!! "name": name of the model, use "FCC_Varvenne-Curtin-2016" for FCC and use "BCC_edge_Maresca-Curtin-2019" for BCC The following are adjustable parameters for the model "f1": # dimensionless pressure field parameter for athermal yield stress "f2": # dimensionless pressure field parameter for energy barrier "alpha": # dislocation line tension parameter IMPORTANT: If you don't know f1, f2, and alpha for your material, DO NOT change f1, f2 and alpha. The default values were optimized for FCC HEAs and BCC HEAs. Read Curtin's papers. ------- Optional tags: "uncertainty_level": allow uncertainty evaluation on input data. "on/off":"on" # turn on/off the uncertainty calculation # if off, no need to set the following tags # if on, specify the standard deviations for lattice constants and elastic constants "a": 0.01 # applied 1% standard deviation to lattice constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # a new lattice constant will be generated using normal distribution, # centered at the value "a" (lattice constants) in "elements" # with a standard deviation 0.01a. "elastic_constants": 0.05 # applied 5% standard deviation to elastic constants # 1000 data points were generated to evaluate the average and standar deviation # this means for each element, # new elastic constants will be generated using normal distribution, # centered at the values "E", "G", "nu" (elastic constants) in "elements" # with a standard deviation 0.05*value. "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Curtin_Ternary': print(''' Sample JSON for predictions of solid solution strength for pseudo-ternary BCC by Curtin screw dislocation model. Screw dislocation in BCC. ------------------------------------------------------------ { "material":"NbMoW", "pseudo-ternary":{ "increment": 1, "psA": {"grouped_elements":["Nb"], "ratio": [1], "range":[0,100]}, "psB": {"grouped_elements":["Mo"], "ratio": [1], "range":[0,100]}, "psC": {"grouped_elements":["W"], "ratio": [1], "range":[0,100]} }, "elements":{ "Nb": {"a":3.30,"Delta_E_p":0.0345,"E_k":0.6400,"E_v":2.9899,"E_si":5.2563,"Delta_V_p":0.020}, "Mo": {"a":3.14,"Delta_E_p":0.1579,"E_k":0.5251,"E_v":2.9607,"E_si":7.3792,"Delta_V_p":0.020}, "W": {"a":3.16,"Delta_E_p":0.1493,"E_k":0.9057,"E_v":3.5655,"E_si":9.5417,"Delta_V_p":0.020} }, "adjustables":{ "kink_width":10, "Delta_V_p_scaler":1, "Delta_E_p_scaler":1 }, "conditions":{"temperature":300,"strain_r":0.001}, "model":{ "name":"BCC_screw_Maresca-Curtin-2019" }, "savefile":"NbMoW_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "pseudo-ternary": containing "psA" "psB" 'psC' for pseudo-ternary components "psA": pseudo-ternary component, can be a single element or grouped elements. "grouped_elements": # group specific elements in psA # eg. "grouped_elements":["W","Ta"], Mn and Co are grouped "ratio": # specify the ratio between elements in A # eg. "ratio": [1,1], represent W:Ta=1:1 "range": # specify the concentration range for "psA" # eg. "range":[0,100], range from 0 to 100 at.% -- "elements": input data for elements: "W": element symbol for W below are necessary inputs. "a": lattice constant "E_k": screw dislocation kink formation energy (usually by DFT or MD calculations) "E_v": vacancy formation energy (usually by DFT or MD) "E_si": self-interstitial formation energy (usually by DFT or MD) "Delta_E_p": solute-dislocation interaction energy (usually by DFT or MD) "Delta_V_p": Peierls barrier (usually by DFT or MD) -- "adjustables": adjustable parameters for the model. Be VERY careful to change the values. "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. "Delta_V_p_scaler":1, Peierls barrier scaler, DFT values are usually very high compared to experiments. So rescaling was taken to fit the experimental yield strengths. "Delta_E_p_scaler":1 Solute-dislocation interaction energy scaler. This is also rescaled for DFT/MD values. -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) the calculations. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "model": "BCC_screw_Maresca-Curtin-2019", ------- Optional tags: "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Curtin_Composition_Temperature': print(''' Sample JSON for composition-temperature predictions of BCC solid solution strength by Curtin screw dislocation model. Screw dislocation in BCC. ------------------------------------------------------------ { "material":"Nb95Mo5", "model":"BCC_screw_Maresca-Curtin-2019", "properties":{ "a": 3.289, "E_k": 0.6342, "E_v": 2.989, "E_si": 5.361, "Delta_E_p": 0.0488, "Delta_V_p": 0.020 }, "conditions":{ "temperature":{ "max":500, "min":0, "inc":10 }, "strain_r":0.001 }, "adjustables":{ "kink_width":10, "Delta_V_p_scaler":1, "Delta_E_p_scaler":1 }, "savefile":"Nb95Mo5_out" } ------------------------------------------------------------ Nesessary tags: "material": material name -- "properties": input data for the material: "a": lattice constant "E_k": screw dislocation kink formation energy (usually by DFT or MD calculations) "E_v": vacancy formation energy (usually by DFT or MD) "E_si": self-interstitial formation energy (usually by DFT or MD) "Delta_E_p": solute-dislocation interaction energy (usually by DFT or MD) "Delta_V_p": Peierls barrier (usually by DFT or MD) -- "conditions": experimental conditions "temperature": specify temperature (Kelvin) range and increment for the calculations. "max": max T "min": min T "inc": increment. "strain_r": experiment strain rate, typical tensile tests: 0.001 /s -- "adjustables": adjustable parameters for the model. Be VERY careful to change the values. "kink_width":10 kink width, default is 10, (unit: burgers vector), usually between 10b to 20b. "Delta_V_p_scaler":1, Peierls barrier scaler, DFT values are usually very high compared to experiments. So rescaling was taken to fit the experimental yield strengths. "Delta_E_p_scaler":1 Solute-dislocation interaction energy scaler. This is also rescaled for DFT/MD values. -- "model": "BCC_screw_Maresca-Curtin-2019", ------- Optional tags: "savefile": output filename, CSV file. END ''') elif self.tag =='BCC_Screw_Suzuki_Temperature': print('under development') else: print('NOT a valid name. Available input formats: \n' 'FCC_BCC_Edge_Ternary\n' 'FCC_BCC_Edge_Composition_Temperature\n' 'BCC_Screw_Curtin_Ternary\n' 'BCC_Screw_Curtin_Composition_Temperature\n' 'BCC_Screw_Suzuki_Temperature\n')
40.787565
118
0.541857
1,845
15,744
4.536043
0.17019
0.022942
0.008364
0.016728
0.878839
0.84335
0.822679
0.791492
0.791492
0.78038
0
0.047884
0.314215
15,744
386
119
40.787565
0.727239
0
0
0.723757
0
0.044199
0.961893
0.155795
0
0
0
0
0
1
0.005525
false
0
0.01105
0
0.019337
0.019337
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
2f87ceecdff5ed53b726428165aca9f91ba781bb
120
py
Python
recommender/core/__init__.py
abhishekpathak/recommendation-system
b91961f2baa2ab70626aaadad2f90f609c92a449
[ "MIT" ]
null
null
null
recommender/core/__init__.py
abhishekpathak/recommendation-system
b91961f2baa2ab70626aaadad2f90f609c92a449
[ "MIT" ]
null
null
null
recommender/core/__init__.py
abhishekpathak/recommendation-system
b91961f2baa2ab70626aaadad2f90f609c92a449
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from core.settings import dev as config from core.settings import log log.configure_logging()
17.142857
39
0.733333
18
120
4.833333
0.722222
0.183908
0.367816
0.505747
0
0
0
0
0
0
0
0.009804
0.15
120
6
40
20
0.843137
0.175
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
85f4d1f30f2cb4732e03b40699c5d31899fda059
157
py
Python
pySDC/tests/test_projects/test_AC/test_temp_forcing.py
brownbaerchen/pySDC
31293859d731646aa09cef4345669eac65501550
[ "BSD-2-Clause" ]
20
2015-03-21T09:02:55.000Z
2022-02-26T20:22:21.000Z
pySDC/tests/test_projects/test_AC/test_temp_forcing.py
brownbaerchen/pySDC
31293859d731646aa09cef4345669eac65501550
[ "BSD-2-Clause" ]
61
2015-03-02T09:35:55.000Z
2022-03-17T12:42:48.000Z
pySDC/tests/test_projects/test_AC/test_temp_forcing.py
brownbaerchen/pySDC
31293859d731646aa09cef4345669eac65501550
[ "BSD-2-Clause" ]
19
2015-02-20T11:52:33.000Z
2022-02-02T10:46:27.000Z
from pySDC.projects.AllenCahn_Bayreuth.run_temp_forcing_verification import main def test_main_serial(): main(cwd='pySDC/projects/AllenCahn_Bayreuth/')
31.4
80
0.834395
21
157
5.904762
0.714286
0.209677
0.354839
0.483871
0
0
0
0
0
0
0
0
0.076433
157
4
81
39.25
0.855172
0
0
0
0
0
0.216561
0.216561
0
0
0
0
0
1
0.333333
true
0
0.333333
0
0.666667
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
9
c82ca4c9cb49ef51bf70a63224ed590edd552bec
1,873
py
Python
Web/smartDeployer/results/migrations/0001_initial.py
Zhipeng-Chang/CMPUT-401-Winter-2018
48c0a43cae32b32ed40be4be1fd126b53784ab13
[ "MIT" ]
null
null
null
Web/smartDeployer/results/migrations/0001_initial.py
Zhipeng-Chang/CMPUT-401-Winter-2018
48c0a43cae32b32ed40be4be1fd126b53784ab13
[ "MIT" ]
null
null
null
Web/smartDeployer/results/migrations/0001_initial.py
Zhipeng-Chang/CMPUT-401-Winter-2018
48c0a43cae32b32ed40be4be1fd126b53784ab13
[ "MIT" ]
null
null
null
# Generated by Django 2.0.2 on 2018-02-24 02:24 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Insert', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('workload', models.IntegerField()), ('latency', models.IntegerField()), ], ), migrations.CreateModel( name='Scan', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('workload', models.IntegerField()), ('latency', models.IntegerField()), ], ), migrations.CreateModel( name='Update', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('workload', models.IntegerField()), ('latency', models.IntegerField()), ], ), migrations.CreateModel( name='Write', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('workload', models.IntegerField()), ('latency', models.IntegerField()), ], ), migrations.CreateModel( name='YCSBstats', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('cpu', models.IntegerField()), ('mem', models.IntegerField()), ('io', models.IntegerField()), ], ), ]
33.446429
114
0.515216
154
1,873
6.168831
0.279221
0.208421
0.131579
0.121053
0.735789
0.735789
0.735789
0.735789
0.735789
0.735789
0
0.012165
0.341698
1,873
55
115
34.054545
0.758313
0.024026
0
0.6875
1
0
0.064622
0
0
0
0
0
0
1
0
false
0
0.020833
0
0.104167
0
0
0
0
null
1
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c86bf2426bb7914052ce8fb956e35933f871107c
4,908
py
Python
data/data_generator.py
CSUBioGroup/DeepGOA
09802b14ca4f8be6e8d4c2a72e08dbf7876c3b30
[ "MIT" ]
3
2020-09-09T15:57:28.000Z
2021-12-22T04:39:06.000Z
data/data_generator.py
CSUBioGroup/DeepGOA
09802b14ca4f8be6e8d4c2a72e08dbf7876c3b30
[ "MIT" ]
2
2020-09-07T16:13:41.000Z
2021-07-09T06:13:35.000Z
data/data_generator.py
CSUBioGroup/DeepGOA
09802b14ca4f8be6e8d4c2a72e08dbf7876c3b30
[ "MIT" ]
null
null
null
#-*- encoding:utf8 -*- import os import time import pickle import torch as t import numpy as np from torch.utils import data import nibabel as nib class dataSet_V1(data.Dataset): def __init__(self,sequences_file=None,label_file=None,gos_gile=None,embeddings_file=None, PPI_embedding_file=None): super(dataSet_V1,self).__init__() with open(sequences_file,"rb") as fp_seq: self.all_sequences = pickle.load(fp_seq) with open(label_file,"rb") as fp_label: self.all_labels = pickle.load(fp_label) with open(gos_gile, "rb") as fp_gos: self.all_gos = pickle.load(fp_gos) self.embeddings = np.load(embeddings_file) self.lookup_matrix = self.embeddings if PPI_embedding_file: with open(PPI_embedding_file,"rb") as fp_emb: self.all_net_embeddings = pickle.load(fp_emb,encoding="bytes") else: self.all_net_embeddings = None def __getitem__(self,index): feavalue_value = [] for idx in self.all_sequences[index][:1000]: feavalue_value.append(self.lookup_matrix[idx]) feavalue_value = np.stack(feavalue_value) label = self.all_labels[index] label = np.array(label,dtype=np.float32) gos = self.all_gos[index] if self.all_net_embeddings: embedding = np.array(self.all_net_embeddings[index],dtype=np.float32) return feavalue_value,embedding,label,gos else: return feavalue_value, label,gos def __len__(self): return len(self.all_sequences) class dataSet_V2(data.Dataset): def __init__(self,sequences_file=None,label_file=None,gos_gile=None,embeddings_file=None, PPI_embedding_file=None,interpro_file=None): super(dataSet_V2,self).__init__() with open(sequences_file,"rb") as fp_seq: self.all_sequences = pickle.load(fp_seq) with open(label_file,"rb") as fp_label: self.all_labels = pickle.load(fp_label) with open(gos_gile, "rb") as fp_gos: self.all_gos = pickle.load(fp_gos) with open(interpro_file,"rb") as fp_pro: self.inter_pro = pickle.load(fp_pro) self.embeddings = np.load(embeddings_file) self.lookup_matrix = self.embeddings if PPI_embedding_file: with open(PPI_embedding_file,"rb") as fp_emb: self.all_net_embeddings = pickle.load(fp_emb,encoding="bytes") else: self.all_net_embeddings = None def __getitem__(self,index): feavalue_value = [] for idx in self.all_sequences[index][:1000]: feavalue_value.append(self.lookup_matrix[idx]) feavalue_value = np.stack(feavalue_value) label = self.all_labels[index] label = np.array(label,dtype=np.float32) gos = self.all_gos[index] no_zero_index = self.inter_pro[index] interpro_info = np.zeros(35020,dtype=np.float32) interpro_info[no_zero_index] = 1 if self.all_net_embeddings: embedding = np.array(self.all_net_embeddings[index],dtype=np.float32) return feavalue_value,embedding,interpro_info,label,gos else: return feavalue_value, label,gos def __len__(self): return len(self.all_sequences) class dataSet_V3(data.Dataset): def __init__(self,label_file=None,gos_gile=None, PPI_embedding_file=None,interpro_file=None): super(dataSet_V3,self).__init__() with open(label_file,"rb") as fp_label: self.all_labels = pickle.load(fp_label) with open(gos_gile, "rb") as fp_gos: self.all_gos = pickle.load(fp_gos) with open(interpro_file,"rb") as fp_pro: self.inter_pro = pickle.load(fp_pro) if PPI_embedding_file: with open(PPI_embedding_file,"rb") as fp_emb: self.all_net_embeddings = pickle.load(fp_emb,encoding="bytes") else: self.all_net_embeddings = None def __getitem__(self,index): feavalue_value = [[0],[0]] feavalue_value = np.stack(feavalue_value) label = self.all_labels[index] label = np.array(label,dtype=np.float32) gos = self.all_gos[index] no_zero_index = self.inter_pro[index] interpro_info = np.zeros(35020,dtype=np.float32) interpro_info[no_zero_index] = 1 if self.all_net_embeddings: embedding = np.array(self.all_net_embeddings[index],dtype=np.float32) return feavalue_value,embedding,interpro_info,label,gos else: return feavalue_value, label,gos def __len__(self): return len(self.all_labels)
29.214286
138
0.627954
644
4,908
4.468944
0.114907
0.0754
0.027102
0.083391
0.942669
0.935024
0.928075
0.928075
0.928075
0.928075
0
0.012662
0.275876
4,908
167
139
29.389222
0.79713
0.004279
0
0.817308
0
0
0.008391
0
0
0
0
0
0
1
0.086538
false
0
0.067308
0.028846
0.269231
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c073e3453a7dd613bb278c50edca73e3623ddbb2
1,451
py
Python
utils/kernel.py
RomuloDrumond/LSSVM
092c486218c8a6bd0690fa6ebf712dddb488c397
[ "MIT" ]
23
2019-07-25T08:51:20.000Z
2022-03-19T06:03:35.000Z
utils/kernel.py
rcminitor/LSSVM
092c486218c8a6bd0690fa6ebf712dddb488c397
[ "MIT" ]
11
2019-07-25T09:48:25.000Z
2022-03-11T23:55:38.000Z
utils/kernel.py
rcminitor/LSSVM
092c486218c8a6bd0690fa6ebf712dddb488c397
[ "MIT" ]
13
2019-10-25T04:55:43.000Z
2022-03-20T23:49:00.000Z
from numpy import dot, exp from scipy.spatial.distance import cdist import torch def get_kernel(name, **params): """The method that returns the kernel function, given the 'kernel' parameter. """ def linear(x_i, x_j): return dot(x_i, x_j.T) def poly(x_i, x_j, d=params.get('d', 3)): return (dot(x_i, x_j.T) + 1) ** d def rbf(x_i, x_j, sigma=params.get('sigma', 1)): return exp(-cdist(x_i, x_j) ** 2 / sigma ** 2) kernels = {'linear': linear, 'poly': poly, 'rbf': rbf} if kernels.get(name) is None: raise KeyError( f"Kernel '{name}' is not defined, try one in the list: " f"{list(kernels.keys())}." ) else: return kernels[name] def torch_get_kernel(name, **params): """The method that returns the kernel function, given the 'kernel' parameter. """ def linear(x_i, x_j): return torch.mm(x_i, torch.t(x_j)) def poly(x_i, x_j, d=params.get('d', 3)): return (torch.mm(x_i, torch.t(x_j)) + 1) ** d def rbf(x_i, x_j, sigma=params.get('sigma', 1)): return torch.exp(-torch.cdist(x_i, x_j) ** 2 / sigma ** 2) kernels = {'linear': linear, 'poly': poly, 'rbf': rbf} if kernels.get(name) is None: raise KeyError( f"Kernel '{name}' is not defined, try one in the list: " f"{list(kernels.keys())}." ) else: return kernels[name]
26.87037
70
0.564438
228
1,451
3.473684
0.223684
0.030303
0.037879
0.050505
0.881313
0.881313
0.881313
0.861111
0.861111
0.818182
0
0.009542
0.277739
1,451
53
71
27.377358
0.746183
0.102688
0
0.606061
0
0
0.150198
0.036364
0
0
0
0
0
1
0.242424
false
0
0.090909
0.181818
0.575758
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
9
c09cc77e40d879df3c3439332a18e53c40f9b24f
232
py
Python
hypervector/resources/core/__init__.py
hypervectorio/hypervector-wrapper
c90ec91363249ec9401898960ea41cf6aa116ced
[ "MIT" ]
8
2021-05-12T15:19:17.000Z
2022-03-06T00:59:25.000Z
hypervector/resources/core/__init__.py
hypervectorio/hypervector-wrapper
c90ec91363249ec9401898960ea41cf6aa116ced
[ "MIT" ]
null
null
null
hypervector/resources/core/__init__.py
hypervectorio/hypervector-wrapper
c90ec91363249ec9401898960ea41cf6aa116ced
[ "MIT" ]
6
2021-04-07T14:03:24.000Z
2021-04-16T15:38:54.000Z
from hypervector.resources.core.project import Project from hypervector.resources.core.ensemble import Ensemble from hypervector.resources.core.definition import Definition from hypervector.resources.core.benchmark import Benchmark
46.4
60
0.87931
28
232
7.285714
0.321429
0.294118
0.470588
0.54902
0
0
0
0
0
0
0
0
0.068966
232
4
61
58
0.944444
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
c0a160196cc4275e8a6d111f7201ccf8bea17854
1,640
py
Python
game/levels.py
eivaremir/TheLearningDoors
92e9b7cd05f9955103d4d7d145098ea726674d34
[ "Apache-2.0" ]
2
2021-11-21T21:09:43.000Z
2021-11-21T22:10:07.000Z
game/levels.py
eivaremir/TheLearningDoors
92e9b7cd05f9955103d4d7d145098ea726674d34
[ "Apache-2.0" ]
null
null
null
game/levels.py
eivaremir/TheLearningDoors
92e9b7cd05f9955103d4d7d145098ea726674d34
[ "Apache-2.0" ]
null
null
null
import json def get_questions(): questions = json.load(open('./game/assets/questions/questions.json')) return questions levels = [ { "question": { "type":"Text", "value":"ahhhhhhhhhh?" }, "answers": [ { "type": "Text", "value": "Answer", "answer":True }, { "type": "Text", "value": "Answer 2" }, { "type": "Text", "value": "Answer 3" }, { "type": "Text", "value": "Answer 4" }, { "type": "Text", "value": "Answer 5" }, { "type": "Text", "value": "Answer 6" } ] }, { "question": { "type":"Text", "value":"ahhhhhhhhhh?" }, "answers": [ { "type": "Text", "value": "Answer", "answer":True }, { "type": "Text", "value": "Answer 2" }, { "type": "Text", "value": "Answer 3" }, { "type": "Text", "value": "Answer 4" }, { "type": "Text", "value": "Answer 5" }, { "type": "Text", "value": "Answer 6" } ] } ]
21.866667
73
0.265854
91
1,640
4.78022
0.263736
0.257471
0.418391
0.524138
0.772414
0.772414
0.772414
0.772414
0.772414
0.772414
0
0.014684
0.584756
1,640
75
74
21.866667
0.624082
0
0
0.472222
0
0
0.230347
0.023157
0
0
0
0
0
1
0.013889
false
0
0.013889
0
0.041667
0
0
0
0
null
1
1
1
0
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
f1b7737e1e3c453249950003e937cbb097abdb8b
28,508
py
Python
libica/openapi/libtes/api/task_runs_api.py
umccr-illumina/libica
916d27eea499f29bee590268b84208effb0cc576
[ "MIT" ]
null
null
null
libica/openapi/libtes/api/task_runs_api.py
umccr-illumina/libica
916d27eea499f29bee590268b84208effb0cc576
[ "MIT" ]
4
2021-11-15T10:47:51.000Z
2022-02-22T04:43:20.000Z
libica/openapi/libtes/api/task_runs_api.py
umccr-illumina/libica
916d27eea499f29bee590268b84208effb0cc576
[ "MIT" ]
null
null
null
# coding: utf-8 """ Task Execution Service No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from libica.openapi.libtes.api_client import ApiClient from libica.openapi.libtes.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) class TaskRunsApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def abort_task_run(self, run_id, **kwargs): # noqa: E501 """Abort a task run # noqa: E501 Aborts a task run for a given task run ID. The task run is required to have a status of \"Pending\" or \"Running\". # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.abort_task_run(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: TaskRunSummary If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.abort_task_run_with_http_info(run_id, **kwargs) # noqa: E501 def abort_task_run_with_http_info(self, run_id, **kwargs): # noqa: E501 """Abort a task run # noqa: E501 Aborts a task run for a given task run ID. The task run is required to have a status of \"Pending\" or \"Running\". # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.abort_task_run_with_http_info(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(TaskRunSummary, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'run_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method abort_task_run" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'run_id' is set if self.api_client.client_side_validation and ('run_id' not in local_var_params or # noqa: E501 local_var_params['run_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `run_id` when calling `abort_task_run`") # noqa: E501 collection_formats = {} path_params = {} if 'run_id' in local_var_params: path_params['runId'] = local_var_params['run_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/runs/{runId}:abort', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskRunSummary', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def create_task_run(self, **kwargs): # noqa: E501 """Create and launch a task run # noqa: E501 Creates and launches a task run. Returns the ID and status associated with the new task run. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_task_run(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreateTaskRunRequest body: :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: TaskRun If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.create_task_run_with_http_info(**kwargs) # noqa: E501 def create_task_run_with_http_info(self, **kwargs): # noqa: E501 """Create and launch a task run # noqa: E501 Creates and launches a task run. Returns the ID and status associated with the new task run. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_task_run_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param CreateTaskRunRequest body: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(TaskRun, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_task_run" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/runs', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskRun', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def get_task_run(self, run_id, **kwargs): # noqa: E501 """Get the status of a task run # noqa: E501 Gets the status of a task run for a given task run ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_task_run(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: TaskRun If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.get_task_run_with_http_info(run_id, **kwargs) # noqa: E501 def get_task_run_with_http_info(self, run_id, **kwargs): # noqa: E501 """Get the status of a task run # noqa: E501 Gets the status of a task run for a given task run ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_task_run_with_http_info(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(TaskRun, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'run_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_task_run" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'run_id' is set if self.api_client.client_side_validation and ('run_id' not in local_var_params or # noqa: E501 local_var_params['run_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `run_id` when calling `get_task_run`") # noqa: E501 collection_formats = {} path_params = {} if 'run_id' in local_var_params: path_params['runId'] = local_var_params['run_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/runs/{runId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskRun', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def heartbeat_task_run(self, run_id, **kwargs): # noqa: E501 """Heartbeat for a task run # noqa: E501 Heartbeat a task run for a given task run ID. This notifies TES that a task run is executing. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.heartbeat_task_run(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param HeartbeatTaskRunRequest body: :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: TaskRunHeartbeat If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.heartbeat_task_run_with_http_info(run_id, **kwargs) # noqa: E501 def heartbeat_task_run_with_http_info(self, run_id, **kwargs): # noqa: E501 """Heartbeat for a task run # noqa: E501 Heartbeat a task run for a given task run ID. This notifies TES that a task run is executing. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.heartbeat_task_run_with_http_info(run_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str run_id: (required) :param HeartbeatTaskRunRequest body: :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(TaskRunHeartbeat, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'run_id', 'body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method heartbeat_task_run" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'run_id' is set if self.api_client.client_side_validation and ('run_id' not in local_var_params or # noqa: E501 local_var_params['run_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `run_id` when calling `heartbeat_task_run`") # noqa: E501 collection_formats = {} path_params = {} if 'run_id' in local_var_params: path_params['runId'] = local_var_params['run_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/runs/{runId}:heartbeat', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskRunHeartbeat', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) def list_task_runs(self, **kwargs): # noqa: E501 """Get a list of task runs # noqa: E501 Get a list of task runs accessible by the current tenant ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_task_runs(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str sort: Sort: Optional parameter to set the sort of the returned list. Valid fields include: name, status, timeCreated, timeModified. The sort can be specified as asc or desc. (Default: asc.) :param str names: :param str status: :param str versions: :param str acls: :param int page_size: Optional parameter to define the page size returned. Valid inputs range from 1-1000. :param str page_token: pageToken: Optional parameter for navigation after initial listing. Valid values include firstPageToken, nextPageToken, and previousPageToken (provided in the list response) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: TaskRunSummaryPagedItems If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True return self.list_task_runs_with_http_info(**kwargs) # noqa: E501 def list_task_runs_with_http_info(self, **kwargs): # noqa: E501 """Get a list of task runs # noqa: E501 Get a list of task runs accessible by the current tenant ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_task_runs_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str sort: Sort: Optional parameter to set the sort of the returned list. Valid fields include: name, status, timeCreated, timeModified. The sort can be specified as asc or desc. (Default: asc.) :param str names: :param str status: :param str versions: :param str acls: :param int page_size: Optional parameter to define the page size returned. Valid inputs range from 1-1000. :param str page_token: pageToken: Optional parameter for navigation after initial listing. Valid values include firstPageToken, nextPageToken, and previousPageToken (provided in the list response) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(TaskRunSummaryPagedItems, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'sort', 'names', 'status', 'versions', 'acls', 'page_size', 'page_token' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_task_runs" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 query_params.append(('sort', local_var_params['sort'])) # noqa: E501 if 'names' in local_var_params and local_var_params['names'] is not None: # noqa: E501 query_params.append(('names', local_var_params['names'])) # noqa: E501 if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 if 'versions' in local_var_params and local_var_params['versions'] is not None: # noqa: E501 query_params.append(('versions', local_var_params['versions'])) # noqa: E501 if 'acls' in local_var_params and local_var_params['acls'] is not None: # noqa: E501 query_params.append(('acls', local_var_params['acls'])) # noqa: E501 if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 query_params.append(('pageSize', local_var_params['page_size'])) # noqa: E501 if 'page_token' in local_var_params and local_var_params['page_token'] is not None: # noqa: E501 query_params.append(('pageToken', local_var_params['page_token'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( '/v1/tasks/runs', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='TaskRunSummaryPagedItems', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
44.335925
209
0.592606
3,278
28,508
4.918853
0.074131
0.043165
0.066857
0.027909
0.924895
0.921546
0.91739
0.912305
0.884954
0.880365
0
0.015397
0.332468
28,508
642
210
44.404984
0.831897
0.47064
0
0.698676
1
0
0.164933
0.036937
0
0
0
0
0
1
0.036424
false
0
0.016556
0
0.089404
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
f1d1cf907a9aace7e27b5ff24b2498cf2810d380
104,919
py
Python
tools/draw_figure.py
xinyufei/Quantum-Control-qutip
bd8a119b9ff8ac0929ffb1f706328759d89fcb5e
[ "BSD-3-Clause" ]
1
2021-08-31T02:28:54.000Z
2021-08-31T02:28:54.000Z
tools/draw_figure.py
xinyufei/Quantum-Control-qutip
bd8a119b9ff8ac0929ffb1f706328759d89fcb5e
[ "BSD-3-Clause" ]
null
null
null
tools/draw_figure.py
xinyufei/Quantum-Control-qutip
bd8a119b9ff8ac0929ffb1f706328759d89fcb5e
[ "BSD-3-Clause" ]
null
null
null
import numpy as np import matplotlib import matplotlib.pyplot as plt def draw_stats(): x = [0, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1, 10] sum_norm = [167.48180578702548, 167.47867920029202, 95.40499099227462, 34.144492624667244, 30.14356912948749, 18.70981873414983, 0.3962903548156124, 5.55381795807922e-07, 8.428231286969557e-10] # sum_norm = [4980.880077104522, 603.8538414769712, 332.6922609756568, 311.7450060080427, # 176.5722320180486, 5.863445830245192e-06, 6.282453886269812e-07, # 6.174458598795899e-10, 1.8027156950348233e-11] # 8.822329350354554e-08, 1.4531085324239638e-08] # exit() # plt.plot(np.array(x), np.array(sum_norm), '-o', label='squared_L2_norm') # plt.plot(np.array(x), 1e-9 / np.power(np.array(x), 2)) # plt.show() # exit() # plt.figure(dpi=300) # plt.plot(np.array(x), np.array(sum_norm), '-o', label='squared_L2_norm') # plt.xlabel("Penalty parameter") # plt.ylabel("Squared Penalized Term") # plt.legend() # # plt.savefig("../example/figure/Continuous/MoleculeNew_H2_evotime4.0_n_ts80.png") # plt.savefig("../example/figure/Continuous/MoleculeVQE_LiH_evotime20.0_n_ts200.png") constant_idx = 5 bound = [sum_norm[constant_idx] * x[constant_idx] / rho for rho in x[1:]] plt.figure(dpi=300) plt.plot(np.log10(np.array(x[1:])), np.log10(np.array(sum_norm[1:])), '-o', label=r'Common logarithm of squared $L_2$ norm') matplotlib.rcParams['text.usetex'] = True plt.plot(np.log10(np.array(x[1:])), np.log10(np.array(bound)), '--', # label=r'$\log_{10}$' + str(round(sum_norm[constant_idx], 2)) + r'$-\log_{10} \rho$') label=r'$-$' + str(round(-np.log10(sum_norm[constant_idx] * x[constant_idx]), 2)) + r'$-\log_{10} \rho$') plt.xlabel("Common logarithm of penalty parameter") plt.ylabel("Common logarithm of squared penalized Term") plt.legend(loc="lower left") plt.savefig("../figure_paper/MoleculeNew_H2_evotime4.0_n_ts80_log10_wb.png") # plt.savefig("../figure_paper/MoleculeVQE_LiH_evotime20.0_n_ts200_log10_wb.png") def draw_control(evo_time, n_ts, control, output_fig): plt.figure(dpi=300) plt.xlabel("Time") plt.ylabel("Control amplitude") plt.ylim([0, 1]) marker_list = ['-o', '--^', '-*', '--s', '-P'] marker_size_list = [5, 5, 8, 5, 8] for j in range(control.shape[1]): plt.step(np.linspace(0, evo_time, n_ts + 1), np.hstack((control[:, j], control[-1, j])), marker_list[j], where='post', linewidth=2, label='controller ' + str(j + 1), markevery=5, markersize=marker_size_list[j]) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() plt.savefig(output_fig) def draw_sos1(n_ts, control, output_fig): plt.figure(dpi=300) plt.xlabel("Time") plt.ylabel("Absolute violation") plt.plot(np.linspace(0, evo_time, n_ts), [abs(sum(control[k, :]) - 1) for k in range(n_ts)], label='absolute violation') plt.legend() plt.savefig(output_fig) def draw_integral_error(example="H2", ub=False): if example == "H2": evo_time = 4.0 ts_list = [40, 80, 160, 240, 320, 400] delta_t_list = [evo_time / n_ts for n_ts in ts_list] integral_err = [] if ub: ub_list = [] lb_list = [] ub_list_1 = [] ub_list_2 = [] epsilon_list = [] l2_err = [] for n_ts in ts_list: c_control_name = "../example/control/Continuous/MoleculeNew_H2_evotime4.0_n_ts" + str(n_ts) + \ "_ptypeWARM_offset0.5_objUNIT_sum_penalty1.0.csv" c_control = np.loadtxt(c_control_name, delimiter=',') b_control_name = "../example/control/Rounding/" + c_control_name.split('/')[-1].split('.csv')[0] + \ "_1_SUR.csv" b_control = np.loadtxt(b_control_name, delimiter=',') n_ctrls = c_control.shape[1] delta_t = evo_time / n_ts integral = np.zeros((n_ts + 1, n_ctrls)) for j in range(n_ctrls): for t in range(n_ts): integral[t + 1, j] = integral[t, j] + (c_control[t, j] - b_control[t, j]) * delta_t integral_err.append(np.max(abs(integral))) if ub: print(np.sum(integral, 1)) epsilon = np.max(abs(np.sum(integral, 1))) lb_list.append(1 / n_ctrls * epsilon) ub_list.append((n_ctrls - 1) * delta_t + (2 * n_ctrls - 1) / n_ctrls * epsilon) epsilon_list.append(epsilon) l2_err.append(sum(np.square(sum(c_control[t, j] for j in range(n_ctrls)) - 1) for t in range(n_ts))) ub_list_1.append((n_ctrls - 1) * delta_t) ub_list_2.append((2 * n_ctrls - 1) / n_ctrls * epsilon) # draw the figure plt.figure(dpi=300) plt.xlabel("Time steps") # plt.xlabel("Unit interval length") # plt.ylabel("Maximum integral error") # plt.plot(ts_list, integral_err, label='Maximum integral error') plt.ylabel("Common logarithm of maximum integral error") # plt.ylim(bottom=-5, top=2) plt.plot(ts_list, np.log10(integral_err), '-o', label='Common logarithm of maximum integral error') if ub: # plt.plot(ts_list, np.log10(lb_list), linestyle='dotted', label="Lower bound of common logarithm of integral error") plt.plot(ts_list, np.log10(ub_list), linestyle="-", marker='o', label="Upper bound of common logarithm of integral error") plt.plot(ts_list, np.log10(ub_list_1), linestyle="--", marker='^', label="Fist term of the upper bound") plt.plot(ts_list, np.log10(ub_list_2), linestyle="--", marker='+', markersize='8', label="Second term of the upper bound") # plt.plot(delta_t_list, integral_err, label='Maximum integral error') plt.legend(prop={'size': 6}) if ub: plt.savefig("../figure_paper/MoleculeNew_H2_evotime4.0_sur_error_delta_t_log10_wb.png") else: plt.savefig("../figure_paper/MoleculeNew_H2_evotime4.0_sur_error_delta_t_log10.png") plt.figure(dpi=300) plt.xlabel("Time steps") plt.plot(ts_list, np.log10(epsilon_list), linestyle='-', marker='o', label="Epsilon") plt.plot(ts_list, np.log10([evo_time * np.sqrt(l2_err[i] * delta_t_list[i]) for i in range(len(l2_err))]), linestyle='--', marker='^', label="Upper bound of epsilon") # plt.plot(ts_list, np.log10(ub_list_1), linestyle="--", marker='^', label="Fist term of the upper bound") # plt.plot(ts_list, np.log10(ub_list_2), linestyle="--", marker='+', markersize='8', # label="Second term of the upper bound") # plt.plot(delta_t_list, integral_err, label='Maximum integral error') plt.legend(prop={'size': 5}) plt.savefig("../figure_paper/MoleculeNew_H2_evotime4.0_epsilon_ub.png") # exit() if example == "LiH": evo_time = 20.0 ts_list = [100, 200, 400, 600, 800, 1000] delta_t_list = [evo_time / n_ts for n_ts in ts_list] integral_err = [] if ub: ub_list = [] lb_list = [] ub_list_1 = [] ub_list_2 = [] epsilon_list = [] l2_err = [] for n_ts in ts_list: c_control_name = "../example/control/Continuous/MoleculeVQE_LiH_evotime20.0_n_ts" + str(n_ts) + \ "_ptypeWARM_offset0.5_objUNIT_sum_penalty0.1.csv" c_control = np.loadtxt(c_control_name, delimiter=',') b_control_name = "../example/control/Rounding/" + c_control_name.split('/')[-1].split('.csv')[0] + \ "_1_SUR.csv" b_control = np.loadtxt(b_control_name, delimiter=',') n_ctrls = c_control.shape[1] delta_t = evo_time / n_ts integral = np.zeros((n_ts + 1, n_ctrls)) for j in range(n_ctrls): for t in range(n_ts): integral[t + 1, j] = integral[t, j] + (c_control[t, j] - b_control[t, j]) * delta_t integral_err.append(np.max(abs(integral))) if ub: print(np.sum(integral, 1)) epsilon = np.max(abs(np.sum(integral, 1))) lb_list.append(1 / n_ctrls * epsilon) ub_list.append((n_ctrls - 1) * delta_t + (2 * n_ctrls - 1) / n_ctrls * epsilon) ub_list_1.append((n_ctrls - 1) * delta_t) ub_list_2.append((2 * n_ctrls - 1) / n_ctrls * epsilon) epsilon_list.append(epsilon) l2_err.append(sum(np.square(sum(c_control[t, j] for j in range(n_ctrls)) - 1) for t in range(n_ts))) # draw the figure plt.figure(dpi=300) plt.xlabel("Time steps") # plt.xlabel("Unit interval length") # plt.ylabel("Maximum integral error") # plt.plot(ts_list, integral_err, label='Maximum integral error') # # plt.plot(delta_t_list, integral_err, label='Maximum integral error') # if ub: # plt.plot(ts_list, ub_list, "--", label="Upper bound of integral error") plt.ylabel("Common logarithm of maximum integral error") plt.plot(ts_list, np.log10(integral_err), '-o', label='Common logarithm of maximum integral error') if ub: # plt.plot(ts_list, np.log10(ub_list), "--", label="Upper bound of common logarithm of integral error") plt.plot(ts_list, np.log10(ub_list), linestyle="-", marker='o', label="Upper bound of common logarithm of integral error") plt.plot(ts_list, np.log10(ub_list_1), linestyle="--", marker='^', label="Fist term of the upper bound") plt.plot(ts_list, np.log10(ub_list_2), linestyle="--", marker='+', markersize='8', label="Second term of the upper bound") # plt.plot(delta_t_list, integral_err, label='Maximum integral error') plt.legend(prop={'size': 6}) if ub: plt.savefig("../figure_paper/MoleculeVQE_LiH_evotime20.0_sur_error_delta_t_log10_wb.png") else: plt.savefig("../figure_paper/MoleculeVQE_LiH_evotime20.0_sur_error_delta_t_log10.png") plt.figure(dpi=300) plt.xlabel("Time steps") plt.plot(ts_list, np.log10(epsilon_list), linestyle='-', marker='o', label="Epsilon") plt.plot(ts_list, np.log10([evo_time * np.sqrt(l2_err[i] * delta_t_list[i]) for i in range(len(l2_err))]), linestyle='--', marker='^', label="Upper bound of epsilon") # plt.plot(ts_list, np.log10(ub_list_1), linestyle="--", marker='^', label="Fist term of the upper bound") # plt.plot(ts_list, np.log10(ub_list_2), linestyle="--", marker='+', markersize='8', # label="Second term of the upper bound") # plt.plot(delta_t_list, integral_err, label='Maximum integral error') plt.legend(prop={'size': 5}) plt.savefig("../figure_paper/MoleculeVQE_LiH_evotime20.0_epsilon_ub.png") def draw_obj_energy_c(): # plt.figure(figsize=(15, 3), dpi=300) plt.figure(dpi=300) step = 1 instance = np.array([1, 2, 3]) * step instance_name = ["Energy2", "Energy4", "Energy6"] # grape_ar = [0.999, 3.999/4, 3.868/4.886] # tr_ar = [0.999, 3.9939/4, 3.838/4.886] # admm_ar = [0.999, 3.993/4, 3.838/4.886] grape_tv = [0.989, 3.953, 3.808] tr_tv = [0.993, 3.962, 3.820] admm_tv = [0.999, 3.993, 3.806] width = 0.1 * step plt.bar(instance-width, grape_tv, alpha=0.9, width=width, hatch='/', color='lightgray', edgecolor='black', label='GRAPE') plt.bar(instance, tr_tv, alpha=0.9, width=width, hatch='\\', color='lightgray', edgecolor='black', label='TR') plt.bar(instance+width, admm_tv, alpha=0.9, width=width, hatch='+', color='lightgray', edgecolor='black', label='ADMM') x_loc = plt.MultipleLocator(step) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Energy_continuous_TV.png") def draw_obj_energy_r(): # plt.figure(figsize=(15, 3), dpi=300) plt.figure(dpi=300) step = 1 instance = np.array([1, 2, 3]) * step instance_name = ["Energy2", "Energy4", "Energy6"] grape_sur_tv = [0.459, 3.578, 3.466] tr_sur_tv = [0.455, 3.619, 3.418] admm_sur_tv = [0.519, 3.534, 3.305] grape_sur_tv_alb = [0.897, 3.578, 3.522] tr_sur_tv_alb = [0.915, 3.619, 3.450] admm_sur_tv_alb = [0.957, 3.534, 3.340] tr_st = [0, 3.937, 3.330] admm_st = [0, 3.270, 3.036] grape_mt = [0.841, 3.884, 1.548] tr_mt = [0.841, 3.884, 1.868] admm_mt = [0.841, 3.884, 1.910] grape_mt_alb = [0.997, 3.884, 2.709] tr_mt_alb = [0.997, 3.884, 2.709] admm_mt_alb = [0.959, 3.84, 2.614] tr_st_mt = [0, 3.934, 3.036] admm_st_mt = [0, 3.934, 3.036] grape_ms = [0.971, 3.920, 3.706] tr_ms = [0.960, 3.926, 3.651] admm_ms = [0.972, 3.928, 3.730] grape_ms_alb = [0.999, 3.962, 3.789] tr_ms_alb = [0.997, 3.975, 3.781] admm_ms_alb = [0.998, 3.971, 3.752] method_list = [grape_sur_tv, tr_sur_tv, admm_sur_tv, grape_sur_tv_alb, tr_sur_tv_alb, admm_sur_tv_alb, tr_st, admm_st, grape_mt, tr_mt, admm_mt, grape_mt_alb, tr_mt_alb, admm_mt_alb, tr_st_mt, admm_st_mt, grape_ms, tr_ms, admm_ms, grape_ms_alb, tr_ms_alb, admm_ms_alb] width = 0.04 * step for i in range(11): plt.bar(instance - (11 - i) * width, method_list[i], width=width, edgecolor='black') for i in range(11, 22): plt.bar(instance + (i - 11) * width, method_list[i], width=width) # plt.bar(instance - width, grape_tv, alpha=0.9, width=width, hatch='/', color='lightgray', edgecolor='black', # label='GRAPE+SUR') # plt.bar(instance, tr_tv, alpha=0.9, width=width, hatch='\\', color='lightgray', edgecolor='black', label='TR+SUR') # plt.bar(instance + width, admm_tv, alpha=0.9, width=width, hatch='+', color='lightgray', edgecolor='black', # label='ADMM+SUR') x_loc = plt.MultipleLocator(step) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Energy_binary.png") def draw_sur_improve(): plt.figure(figsize=(15, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_st = np.array([1, 2, 3, 8, 9]) instance_l2 = np.array([8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] grape_sur_tv = [0.897, 0.785204688, 0.720764602, 0.734, 0.969, 0.973, 0.952, 0.977, 0.545] pgrape_sur_tv = [0.973, 0.553] tr_sur_tv = [0.915, 0.797010362, 0.705988294, 0.724, 0.964, 0.970, 0.952, 0.955, 0.539] admm_sur_tv = [0.957, 0.790725327, 0.683639638, 0.734, 0.979, 0.973, 0.955, 0.918, 0.715] tr_st_tv = [0, 0.830134194, 0.669190782, 0.987, 0.951] admm_st_tv = [0, 0.622728045, 0.669190782, 0.865, 0.001] width = 0.15 # plt.bar(np.array([1 - width * 2, 2 - width * 2, 3 - width * 2, 4 - width, 5 - width, 6 - width, 7 - width, # 8 - width / 2 * 5, 9 - width / 2 * 5]), grape_sur_tv, alpha=0.9, width=width, # hatch='/', edgecolor='black', label='GRAPE+SUR+ALB') # plt.bar(np.array([1 - width, 2 - width, 3 - width, 4, 5, 6, 7, # 8 - width / 2 * 3, 9 - width / 2 * 3]), tr_sur_tv, alpha=0.9, width=width, # hatch='\\', edgecolor='black', label='TR+SUR+ALB') # plt.bar(np.array([1, 2, 3, 4 + width, 5 + width, 6 + width, 7 + width, # 8 - width / 2, 9 - width / 2]), admm_sur_tv, alpha=0.9, width=width, # hatch='+', edgecolor='black', label='ADMM+SUR+ALB') # plt.bar(np.array([8 + width / 2, 9 + width / 2]), pgrape_sur_tv, alpha=0.9, width=width, # hatch='o', edgecolor='black', label='p-GRAPE+SUR+ALB') # plt.bar(np.array([1 + width, 2 + width, 3 + width, 8 + width / 2 * 3, 9 + width / 2 * 3]), tr_st_tv, alpha=0.9, # width=width, hatch='.', edgecolor='black', label='TR+ST') # plt.bar(np.array([1 + width * 2, 2 + width * 2, 3 + width * 2, 8 + width / 2 * 5, 9 + width / 2 * 5]), admm_st_tv, # alpha=0.9, width=width, hatch='*', edgecolor='black', label='ADMM+ST') plt.bar(np.array([1 - width, 2 - width, 3 - width, 4 - width, 5 - width, 6 - width, 7 - width, 8 - width / 2 * 3, 9 - width / 2 * 3]), grape_sur_tv, alpha=0.9, width=width, hatch='/', edgecolor='black', label='GRAPE+SUR+ALB') plt.bar(np.array([1, 2, 3, 4, 5, 6, 7, 8 - width / 2, 9 - width / 2]), tr_sur_tv, alpha=0.9, width=width, hatch='\\', edgecolor='black', label='TR+SUR+ALB') plt.bar(np.array([1 + width, 2 + width, 3 + width, 4 + width, 5 + width, 6 + width, 7 + width, 8 + width / 2, 9 + width / 2]), admm_sur_tv, alpha=0.9, width=width, hatch='+', edgecolor='black', label='ADMM+SUR+ALB') plt.bar(np.array([8 + width / 2 * 3, 9 + width / 2 * 3]), pgrape_sur_tv, alpha=0.9, width=width, hatch='o', edgecolor='black', label='p-GRAPE+SUR+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Rounding_improve_all_instances_new.png") def draw_mt_improve(): plt.figure(figsize=(15, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] grape_mt = [0.997, 0.834465772, 0.554418567, 0.805, 0.996, 0.994, 0.999, 0.992, 0.96] pgrape_mt = [0.755, 0.998] tr_mt = [0.997, 0.834465772, 0.554418567, 0.804, 0.991, 0.994, 0.999, 0.993, 0.504] admm_mt = [0.959, 0.81654493, 0.535016987, 0.805, 0.994, 0.999, 0.999, 0.946, 0.645] tr_st_mt = [0, 0.837013759, 0.621341738, 0.995, 0.593] admm_st_mt = [0, 0.635722779, 0.621341738, 0.869, 0.001] width = 0.15 # plt.bar(np.array([1 - width * 2, 2 - width * 2, 3 - width * 2, 4 - width, 5 - width, 6 - width, 7 - width, # 8 - width / 2 * 5, 9 - width / 2 * 5]), grape_mt, alpha=0.9, width=width, # hatch='/', edgecolor='black', label='GRAPE+MT+ALB') # plt.bar(np.array([1 - width, 2 - width, 3 - width, 4, 5, 6, 7, # 8 - width / 2 * 3, 9 - width / 2 * 3]), tr_mt, alpha=0.9, width=width, # hatch='\\', edgecolor='black', label='TR+MT+ALB') # plt.bar(np.array([1, 2, 3, 4 + width, 5 + width, 6 + width, 7 + width, # 8 - width / 2, 9 - width / 2]), admm_mt, alpha=0.9, width=width, # hatch='+', edgecolor='black', label='ADMM+MT+ALB') # plt.bar(np.array([8 + width / 2, 9 + width / 2]), pgrape_mt, alpha=0.9, width=width, # hatch='o', edgecolor='black', label='p-GRAPE+MT+ALB') # plt.bar(np.array([1 + width, 2 + width, 3 + width, 8 + width / 2 * 3, 9 + width / 2 * 3]), tr_st_mt, alpha=0.9, # width=width, hatch='.', edgecolor='black', label='TR+STMT') # plt.bar(np.array([1 + width * 2, 2 + width * 2, 3 + width * 2, 8 + width / 2 * 5, 9 + width / 2 * 5]), admm_st_mt, # alpha=0.9, width=width, hatch='*', edgecolor='black', label='ADMM+STMT') plt.bar(np.array([1 - width, 2 - width, 3 - width, 4 - width, 5 - width, 6 - width, 7 - width, 8 - width / 2 * 3, 9 - width / 2 * 3]), grape_mt, alpha=0.9, width=width, hatch='/', edgecolor='black', label='GRAPE+MT+ALB') plt.bar(np.array([1, 2, 3, 4, 5, 6, 7, 8 - width / 2, 9 - width / 2]), tr_mt, alpha=0.9, width=width, hatch='\\', edgecolor='black', label='TR+MT+ALB') plt.bar(np.array([1 + width, 2 + width, 3 + width, 4 + width, 5 + width, 6 + width, 7 + width, 8 + width / 2, 9 + width / 2]), admm_mt, alpha=0.9, width=width, hatch='+', edgecolor='black', label='ADMM+MT+ALB') plt.bar(np.array([8 + width / 2 * 3, 9 + width / 2 * 3]), pgrape_mt, alpha=0.9, width=width, hatch='o', edgecolor='black', label='p-GRAPE+MT+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Minup_time_improve_all_instances_new.png") def draw_ms_improve(): plt.figure(figsize=(15, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] grape_ms = [0.999, 0.857057924, 0.775408293, 0.83, 0.999, 0.999, 0.9990531, 0.997, 0.994] pgrape_ms = [0.986, 0.835] tr_ms = [0.998, 0.857482589, 0.773893823, 0.827, 0.999, 0.997, 0.997, 0.997, 0.88] admm_ms = [0.997, 0.840496008, 0.767835946, 0.828, 0.999, 0.998, 0.9992551, 0.992, 0.979] width = 0.15 plt.bar(np.array([1 - width, 2 - width, 3 - width, 4 - width, 5 - width, 6 - width, 7 - width, 8 - width / 2 * 3, 9 - width / 2 * 3]), grape_ms, alpha=0.9, width=width, hatch='/', edgecolor='black', label='GRAPE+MS+ALB') plt.bar(np.array([1, 2, 3, 4, 5, 6, 7, 8 - width / 2, 9 - width / 2]), tr_ms, alpha=0.9, width=width, hatch='\\', edgecolor='black', label='TR+MS+ALB') plt.bar(np.array([1 + width, 2 + width, 3 + width, 4 + width, 5 + width, 6 + width, 7 + width, 8 + width / 2, 9 + width / 2]), admm_ms, alpha=0.9, width=width, hatch='+', edgecolor='black', label='ADMM+MS+ALB') plt.bar(np.array([8 + width / 2 * 3, 9 + width / 2 * 3]), pgrape_ms, alpha=0.9, width=width, hatch='o', edgecolor='black', label='p-GRAPE+MS+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Max_switching_improve_all_instances.png") def draw_sur(): plt.figure(figsize=(15, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] grape_sur_tv = [0.459, 0.745625955, 0.709303753, 0.670, 0.883, 0.972, 0.950, -0.062, -0.171] pgrape_sur_tv = [0.941, 0.452] tr_sur_tv = [0.455, 0.722694072, 0.6995211, 0.428, 0.883, 0.970, 0.951, 0.937, 0.438] admm_sur_tv = [0.519, 0.662051979, 0.676312881, 0.400, 0.913, 0.969, 0.952, 0.918, 0.715] tr_st_tv = [0, 0.830134194, 0.669190782, 0.987, 0.951] admm_st_tv = [0, 0.622728045, 0.669190782, 0.865, 0.001] width = 0.15 # plt.bar(np.array([1 - width, 2 - width, 3 - width, 4 - width, 5 - width, 6 - width, 7 - width, # 8 - width / 2 * 3, 9 - width / 2 * 3]), grape_sur_tv, alpha=0.9, width=width, # hatch='/', edgecolor='black', label='GRAPE+SUR') # plt.bar(np.array([1, 2, 3, 4, 5, 6, 7, 8 - width / 2, 9 - width / 2]), tr_sur_tv, alpha=0.9, width=width, # hatch='\\', edgecolor='black', label='TR+SUR') # plt.bar(np.array([1 + width, 2 + width, 3 + width, 4 + width, 5 + width, 6 + width, 7 + width, # 8 + width / 2, 9 + width / 2]), admm_sur_tv, alpha=0.9, width=width, # hatch='+', edgecolor='black', label='ADMM+SUR') # plt.bar(np.array([8 + width / 2 * 3, 9 + width / 2 * 3]), pgrape_sur_tv, alpha=0.9, width=width, # hatch='o', edgecolor='black', label='p-GRAPE+SUR') plt.bar(np.array([1 - width * 2, 2 - width * 2, 3 - width * 2, 4 - width, 5 - width, 6 - width, 7 - width, 8 - width / 2 * 5, 9 - width / 2 * 5]), grape_sur_tv, alpha=0.9, width=width, hatch='/', edgecolor='black', label='GRAPE+SUR') plt.bar(np.array([1 - width, 2 - width, 3 - width, 4, 5, 6, 7, 8 - width / 2 * 3, 9 - width / 2 * 3]), tr_sur_tv, alpha=0.9, width=width, hatch='\\', edgecolor='black', label='TR+SUR') plt.bar(np.array([1, 2, 3, 4 + width, 5 + width, 6 + width, 7 + width, 8 - width / 2, 9 - width / 2]), admm_sur_tv, alpha=0.9, width=width, hatch='+', edgecolor='black', label='ADMM+SUR') plt.bar(np.array([8 + width / 2, 9 + width / 2]), pgrape_sur_tv, alpha=0.9, width=width, hatch='o', edgecolor='black', label='p-GRAPE+SUR') plt.bar(np.array([1 + width, 2 + width, 3 + width, 8 + width / 2 * 3, 9 + width / 2 * 3]), tr_st_tv, alpha=0.9, width=width, hatch='.', edgecolor='black', label='TR+ST') plt.bar(np.array([1 + width * 2, 2 + width * 2, 3 + width * 2, 8 + width / 2 * 5, 9 + width / 2 * 5]), admm_st_tv, alpha=0.9, width=width, hatch='*', edgecolor='black', label='ADMM+ST') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) ax.xaxis.set_ticks_position('bottom') ax.spines['bottom'].set_position(('data', 0)) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Rounding_all_instances_new.png") def draw_mt(): plt.figure(figsize=(15, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] grape_mt = [0.841, 0.653728554, 0.316892473, 0.757, 0.842, 0.461, 0.218, 0.291, 0.003] pgrape_mt = [0.400, 0.037] tr_mt = [0.841, 0.699677255, 0.382219312, 0.715, 0.677, 0.710, 0.686, 0.409, 0.034] admm_mt = [0.846, 0.649312043, 0.390978675, 0.475, 0.916, 0.824, 0.483, 0.937, 0.342] tr_st_mt = [0, 0.837013759, 0.621341738, 0.995, 0.593] admm_st_mt = [0, 0.635722779, 0.621341738, 0.869, 0.001] width = 0.15 # plt.bar(np.array([1 - width, 2 - width, 3 - width, 4 - width, 5 - width, 6 - width, 7 - width, # 8 - width / 2 * 3, 9 - width / 2 * 3]), grape_mt, alpha=0.9, width=width, # hatch='/', edgecolor='black', label='GRAPE+MT') # plt.bar(np.array([1, 2, 3, 4, 5, 6, 7, 8 - width / 2, 9 - width / 2]), tr_mt, alpha=0.9, width=width, # hatch='\\', edgecolor='black', label='TR+MT') # plt.bar(np.array([1 + width, 2 + width, 3 + width, 4 + width, 5 + width, 6 + width, 7 + width, # 8 + width / 2, 9 + width / 2]), admm_mt, alpha=0.9, width=width, # hatch='+', edgecolor='black', label='ADMM+MT') # plt.bar(np.array([8 + width / 2 * 3, 9 + width / 2 * 3]), pgrape_mt, alpha=0.9, width=width, # hatch='o', edgecolor='black', label='p-GRAPE+MT') plt.bar(np.array([1 - width * 2, 2 - width * 2, 3 - width * 2, 4 - width, 5 - width, 6 - width, 7 - width, 8 - width / 2 * 5, 9 - width / 2 * 5]), grape_mt, alpha=0.9, width=width, hatch='/', edgecolor='black', label='GRAPE+MT') plt.bar(np.array([1 - width, 2 - width, 3 - width, 4, 5, 6, 7, 8 - width / 2 * 3, 9 - width / 2 * 3]), tr_mt, alpha=0.9, width=width, hatch='\\', edgecolor='black', label='TR+MT') plt.bar(np.array([1, 2, 3, 4 + width, 5 + width, 6 + width, 7 + width, 8 - width / 2, 9 - width / 2]), admm_mt, alpha=0.9, width=width, hatch='+', edgecolor='black', label='ADMM+MT') plt.bar(np.array([8 + width / 2, 9 + width / 2]), pgrape_mt, alpha=0.9, width=width, hatch='o', edgecolor='black', label='p-GRAPE+MT') plt.bar(np.array([1 + width, 2 + width, 3 + width, 8 + width / 2 * 3, 9 + width / 2 * 3]), tr_st_mt, alpha=0.9, width=width, hatch='.', edgecolor='black', label='TR+STMT') plt.bar(np.array([1 + width * 2, 2 + width * 2, 3 + width * 2, 8 + width / 2 * 5, 9 + width / 2 * 5]), admm_st_mt, alpha=0.9, width=width, hatch='*', edgecolor='black', label='ADMM+STMT') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Minup_time_instances_new.png") def draw_ms(): plt.figure(figsize=(15, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] grape_ms = [0.971, 0.854509937, 0.758544472, 0.830, 0.989, 0.675, 0.346, 0.230, 0.004] pgrape_ms = [0.974, 0.713] tr_ms = [0.96, 0.855868864, 0.747288281, 0.407, 0.981, 0.716, 0.303, 0.962, 0.776] admm_ms = [0.972, 0.829879395, 0.763374401, 0.809, 0.994, 0.786, 0.381, 0.992, 0.443] width = 0.15 plt.bar(np.array([1 - width, 2 - width, 3 - width, 4 - width, 5 - width, 6 - width, 7 - width, 8 - width / 2 * 3, 9 - width / 2 * 3]), grape_ms, alpha=0.9, width=width, hatch='/', edgecolor='black', label='GRAPE+MS') plt.bar(np.array([1, 2, 3, 4, 5, 6, 7, 8 - width / 2, 9 - width / 2]), tr_ms, alpha=0.9, width=width, hatch='\\', edgecolor='black', label='TR+MS') plt.bar(np.array([1 + width, 2 + width, 3 + width, 4 + width, 5 + width, 6 + width, 7 + width, 8 + width / 2, 9 + width / 2]), admm_ms, alpha=0.9, width=width, hatch='+', edgecolor='black', label='ADMM+MS') plt.bar(np.array([8 + width / 2 * 3, 9 + width / 2 * 3]), pgrape_ms, alpha=0.9, width=width, hatch='o', edgecolor='black', label='p-GRAPE+MS') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/Max_switching_all_instances.png") def draw_grape_obj(): grape_sur = [0.999, 0.859436046, 0.788711064, 0.830, 0.999, 0.999, 0.999, 0.050, 0.209] grape_mt = [0.841, 0.653728554, 0.316892473, 0.757, 0.842, 0.461, 0.218, 0.291, 0.003] grape_ms = [0.971, 0.854509937, 0.758544472, 0.830, 0.989, 0.675, 0.346, 0.230, 0.004] grape_sur_improve = [0.997, 0.858246985, 0.7870738, 0.824, 0.999, 0.999, 0.999544, 0.993, 0.551] grape_mt_improve = [0.997, 0.834465772, 0.554418567, 0.805, 0.996, 0.994, 0.999, 0.992, 0.96] grape_ms_improve = [0.999, 0.857057924, 0.775408293, 0.83, 0.999, 0.999, 0.9990531, 0.997, 0.994] plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] plt.plot(instance, grape_sur, marker='o', linestyle='-', label='GRAPE+SUR') plt.plot(instance, grape_mt, marker='^', linestyle='-', label='GRAPE+MT') plt.plot(instance, grape_ms, marker='+', markersize='8', linestyle='-', label='GRAPE+MS') plt.plot(instance, grape_sur_improve, marker='o', linestyle='--', label='GRAPE+SUR+ALB') plt.plot(instance, grape_mt_improve, marker='^', linestyle='--', label='GRAPE+MT+ALB') plt.plot(instance, grape_ms_improve, marker='+', markersize='8', linestyle='--', label='GRAPE+MS+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/grape_obj_all_instances.png") def draw_grape_obj_instance(): grape = [0.999, 0.863597758, 0.791535344, 0.831, 1.000, 1.000, 1.000, 1.000, 1.000] grape_sur = [0.999, 0.841476808, 0.7836432, 0.830, 0.999, 0.999, 0.999, 0.050, 0.209] grape_mt = [0.841, 0.632912135, 0.3161038, 0.757, 0.842, 0.461, 0.218, 0.291, 0.003] grape_ms = [0.971, 0.836338827, 0.7525139, 0.830, 0.989, 0.675, 0.346, 0.230, 0.004] grape_sur_improve = [0.997, 0.840329552, 0.7816671, 0.824, 0.999, 0.999, 0.999544, 0.993, 0.551] grape_mt_improve = [0.997, 0.801350332, 0.5713352, 0.805, 0.996, 0.994, 0.999, 0.992, 0.96] grape_ms_improve = [0.999, 0.839518644, 0.7711258, 0.83, 0.999, 0.999, 0.9990531, 0.997, 0.994] all_methods = [grape, grape_sur, grape_mt, grape_ms, grape_sur_improve, grape_mt_improve, grape_ms_improve] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7]) method_name = ["GRAPE", "GRAPE+SUR", "GRAPE+MT", "GRAPE+MS", "GRAPE+SUR+ALB", "GRAPE+MT+ALB", "GRAPE+MS+ALB"] plt.plot(methods, [1 - method[0] for method in all_methods], marker='o', linestyle='-', label="Energy2") plt.plot(methods, [1 - method[1] for method in all_methods], marker='^', linestyle='-', label="Energy4") plt.plot(methods, [1 - method[2] for method in all_methods], marker='+', markersize='8', linestyle='-', label="Energy6") plt.plot(methods, [1 - method[3] for method in all_methods], marker='o', linestyle='--', label="CNOT5") plt.plot(methods, [1 - method[4] for method in all_methods], marker='^', linestyle='--', label="CNOT10") plt.plot(methods, [1 - method[5] for method in all_methods], marker='+', markersize='8', linestyle='--', label="CNOT15") plt.plot(methods, [1 - method[6] for method in all_methods], marker='s', linestyle='--', label='CNOT20') plt.plot(methods, [1 - method[7] for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [1 - method[8] for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/grape_obj_per_instance_min.png") def draw_grape_tv(): grape_sur_tv = [54, 26.8, 38.8, 16, 116, 266, 491, 112, 380] grape_mt_tv = [4, 6, 6, 10, 22, 37, 53, 10, 48] grape_ms_tv = [10, 10, 10, 16, 39, 38, 39, 26, 208] grape_sur_improve_tv = [10, 17.2, 32.4, 9, 30, 262, 479, 16, 6] grape_mt_improve_tv = [4, 6, 6, 9, 23, 33, 28, 4, 18] grape_ms_improve_tv = [10, 9.2, 10, 16, 39, 39, 40, 18, 50] plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] plt.plot(instance, grape_sur_tv, marker='o', linestyle='-', label='GRAPE+SUR') plt.plot(instance, grape_mt_tv, marker='^', linestyle='-', label='GRAPE+MT') plt.plot(instance, grape_ms_tv, marker='+', markersize='8', linestyle='-', label='GRAPE+MS') plt.plot(instance, grape_sur_improve_tv, marker='o', linestyle='--', label='GRAPE+SUR+ALB') plt.plot(instance, grape_mt_improve_tv, marker='^', linestyle='--', label='GRAPE+MT+ALB') plt.plot(instance, grape_ms_improve_tv, marker='+', markersize='8', linestyle='--', label='GRAPE+MS+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/grape_tv_all_instances.png") def draw_grape_tv_instance(): grape_tv = [0.999, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 2.744, 0.677] grape_sur_tv = [54, 26.8, 38.8, 16, 116, 266, 491, 112, 380] grape_mt_tv = [4, 6, 6, 10, 22, 37, 53, 10, 48] grape_ms_tv = [10, 10, 10, 16, 39, 38, 39, 26, 208] grape_sur_improve_tv = [10, 17.2, 32.4, 9, 30, 262, 479, 16, 6] grape_mt_improve_tv = [4, 6, 6, 9, 23, 33, 28, 4, 18] grape_ms_improve_tv = [10, 9.2, 10, 16, 39, 39, 40, 18, 50] all_methods = [grape_tv, grape_sur_tv, grape_mt_tv, grape_ms_tv, grape_sur_improve_tv, grape_mt_improve_tv, grape_ms_improve_tv] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7]) method_name = ["GRAPE", "GRAPE+SUR", "GRAPE+MT", "GRAPE+MS", "GRAPE+SUR+ALB", "GRAPE+MT+ALB", "GRAPE+MS+ALB"] plt.plot(methods, [np.log10(method[0]) for method in all_methods], marker='o', linestyle='-', label="Energy2") plt.plot(methods, [np.log10(method[1]) for method in all_methods], marker='^', linestyle='-', label="Energy4") plt.plot(methods, [np.log10(method[2]) for method in all_methods], marker='+', markersize='8', linestyle='-', label="Energy6") plt.plot(methods, [np.log10(method[3]) for method in all_methods], marker='o', linestyle='--', label="CNOT5") plt.plot(methods, [np.log10(method[4]) for method in all_methods], marker='^', linestyle='--', label="CNOT10") plt.plot(methods, [np.log10(method[5]) for method in all_methods], marker='+', markersize='8', linestyle='--', label="CNOT15") plt.plot(methods, [np.log10(method[6]) for method in all_methods], marker='s', linestyle='--', label='CNOT20') plt.plot(methods, [np.log10(method[7]) for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [np.log10(method[8]) for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend(fontsize=8) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/grape_tv_per_instance_log10.png") def draw_pgrape_obj(): pgrape_sur = [0.973, 0.832] pgrape_mt = [0.400, 0.037] pgrape_ms = [0.974, 0.713] pgrape_sur_improve = [0.997, 0.931] pgrape_mt_improve = [0.755, 0.998] pgrape_ms_improve = [0.986, 0.835] plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2]) instance_name = ["CircuitH2", "CircuitLiH"] plt.plot(instance, pgrape_sur, marker='o', linestyle='-', label='p-GRAPE+SUR') plt.plot(instance, pgrape_mt, marker='^', linestyle='-', label='p-GRAPE+MT') plt.plot(instance, pgrape_ms, marker='+', markersize='8', linestyle='-', label='p-GRAPE+MS') plt.plot(instance, pgrape_sur_improve, marker='o', linestyle='--', label='p-GRAPE+SUR+ALB') plt.plot(instance, pgrape_mt_improve, marker='^', linestyle='--', label='p-GRAPE+MT+ALB') plt.plot(instance, pgrape_ms_improve, marker='+', markersize='8', linestyle='--', label='p-GRAPE+MS+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/pgrape_obj_all_instances.png") def draw_pgrape_obj_instance(): pgrape = [1.000, 0.999] pgrape_sur = [0.973, 0.832] pgrape_mt = [0.400, 0.037] pgrape_ms = [0.974, 0.713] pgrape_sur_improve = [0.997, 0.931] pgrape_mt_improve = [0.755, 0.998] pgrape_ms_improve = [0.986, 0.835] all_methods = [pgrape, pgrape_sur, pgrape_mt, pgrape_ms, pgrape_sur_improve, pgrape_mt_improve, pgrape_ms_improve] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7]) method_name = ["p-GRAPE", "p-GRAPE+SUR", "p-GRAPE+MT", "p-GRAPE+MS", "p-GRAPE+SUR+ALB", "p-GRAPE+MT+ALB", "p-GRAPE+MS+ALB"] plt.plot(methods, [1 - method[0] for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [1 - method[1] for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/pgrape_obj_per_instance_min.png") def draw_pgrape_tv(): pgrape_sur_tv = [32, 380] pgrape_mt_tv = [8, 68] pgrape_ms_tv = [22, 290] pgrape_sur_improve_tv = [24, 378] pgrape_mt_improve_tv = [12, 6] pgrape_ms_improve_tv = [18, 286] plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2]) instance_name = ["CircuitH2", "CircuitLiH"] plt.plot(instance, pgrape_sur_tv, marker='o', linestyle='-', label='p-GRAPE+SUR') plt.plot(instance, pgrape_mt_tv, marker='^', linestyle='-', label='p-GRAPE+MT') plt.plot(instance, pgrape_ms_tv, marker='+', markersize='8', linestyle='-', label='p-GRAPE+MS') plt.plot(instance, pgrape_sur_improve_tv, marker='o', linestyle='--', label='p-GRAPE+SUR+ALB') plt.plot(instance, pgrape_mt_improve_tv, marker='^', linestyle='--', label='p-GRAPE+MT+ALB') plt.plot(instance, pgrape_ms_improve_tv, marker='+', markersize='8', linestyle='--', label='p-GRAPE+MS+ALB') x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/pgrape_tv_all_instances.png") def draw_pgrape_tv_instance(): pgrape_tv = [18.720, 53.976] pgrape_sur_tv = [32, 380] pgrape_mt_tv = [8, 68] pgrape_ms_tv = [22, 290] pgrape_sur_improve_tv = [24, 378] pgrape_mt_improve_tv = [12, 6] pgrape_ms_improve_tv = [18, 286] all_methods = [pgrape_tv, pgrape_sur_tv, pgrape_mt_tv, pgrape_ms_tv, pgrape_sur_improve_tv, pgrape_mt_improve_tv, pgrape_ms_improve_tv] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7]) method_name = ["p-GRAPE", "p-GRAPE+SUR", "p-GRAPE+MT", "p-GRAPE+MS", "p-GRAPE+SUR+ALB", "p-GRAPE+MT+ALB", "p-GRAPE+MS+ALB"] plt.plot(methods, [np.log10(method[0]) for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [np.log10(method[1]) for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend(fontsize=8) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/pgrape_tv_per_instance_log10.png") def draw_pgrape_obj_tv_instance_split(): pgrape = [0.999, 0.863597758, 0.791535344, 0.831, 1.000, 1.000, 1.000, 1.000, 0.999] pgrape_sur = [0.999, 0.841476808, 0.7836432, 0.830, 0.999, 0.999, 0.999, 0.973, 0.832] pgrape_mt = [0.841, 0.632912135, 0.3161038, 0.757, 0.842, 0.461, 0.218, 0.400, 0.037] pgrape_ms = [0.971, 0.836338827, 0.7525139, 0.830, 0.989, 0.675, 0.346, 0.974, 0.713] pgrape_sur_improve = [0.997, 0.840329552, 0.7816671, 0.824, 0.999, 0.999, 0.999544, 0.997, 0.931] pgrape_mt_improve = [0.997, 0.801350332, 0.5713352, 0.805, 0.996, 0.994, 0.999, 0.755, 0.998] pgrape_ms_improve = [0.999, 0.839518644, 0.7711258, 0.83, 0.999, 0.999, 0.9990531, 0.986, 0.835] pgrape_tv = [0.999, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 18.720, 53.976] pgrape_sur_tv = [54, 26.8, 38.8, 16, 116, 266, 491, 32, 380] pgrape_mt_tv = [4, 6, 6, 10, 22, 37, 53, 8, 68] pgrape_ms_tv = [] pgrape_sur_improve_tv = [] pgrape_mt_improve_tv = [] pgrape_ms_improve_tv = [] pgrape_ms_tv = [10, 10, 10, 16, 39, 38, 39, 22, 290] pgrape_sur_improve_tv = [10, 17.2, 32.4, 9, 30, 262, 479, 24, 378] pgrape_mt_improve_tv = [4, 6, 6, 9, 23, 33, 28, 12, 6] pgrape_ms_improve_tv = [10, 9.2, 10, 16, 39, 39, 40, 18, 286] fig = plt.figure(figsize=(9, 8), dpi=300) fig.subplots_adjust(hspace=0.3, wspace=0.3, left=0.05, right=0.95, top=0.95, bottom=0.08) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [pgrape, pgrape_sur, pgrape_sur_improve] methods_mt = [pgrape, pgrape_mt, pgrape_mt_improve] methods_ms = [pgrape, pgrape_ms, pgrape_ms_improve] methods_sur_tv = [pgrape_tv, pgrape_sur_tv, pgrape_sur_improve_tv] methods_mt_tv = [pgrape_tv, pgrape_mt_tv, pgrape_mt_improve_tv] methods_ms_tv = [pgrape_tv, pgrape_ms_tv, pgrape_ms_improve_tv] # all_methods = [pgrape, pgrape_sur, pgrape_mt, pgrape_ms, pgrape_sur_improve, pgrape_mt_improve, pgrape_ms_improve, # pgrape_st, pgrape_stmt] for i in range(9): ax = fig.add_subplot(3, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) if i == 0: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10, label='MS') else: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3) plt.savefig("../figure_paper/pgrape_obj_split.png") fig = plt.figure(figsize=(9, 8), dpi=300) fig.subplots_adjust(hspace=0.3, wspace=0.3, left=0.05, right=0.95, top=0.95, bottom=0.08) for i in range(9): ax = fig.add_subplot(3, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) if i == 0: plt.plot(models, [method[i] for method in methods_sur_tv], marker='o', label='SUR') plt.plot(models, [method[i] for method in methods_mt_tv], marker='^', label='MT') plt.plot(models, [method[i] for method in methods_ms_tv], marker='+', markersize=10, label='MS') else: plt.plot(models, [method[i] for method in methods_sur_tv], marker='o') plt.plot(models, [method[i] for method in methods_mt_tv], marker='^') plt.plot(models, [method[i] for method in methods_ms_tv], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3) plt.savefig("../figure_paper/pgrape_tv_split.png") def draw_pgrape_selected(): pgrape = [0.999, 0.863597758, 0.791535344, 0.831, 1.000, 1.000, 1.000, 1.000, 0.999] pgrape_sur = [0.999, 0.841476808, 0.7836432, 0.830, 0.999, 0.999, 0.999, 0.973, 0.832] pgrape_mt = [0.841, 0.632912135, 0.3161038, 0.757, 0.842, 0.461, 0.218, 0.400, 0.037] pgrape_ms = [0.971, 0.836338827, 0.7525139, 0.830, 0.989, 0.675, 0.346, 0.974, 0.713] pgrape_sur_improve = [0.997, 0.840329552, 0.7816671, 0.824, 0.999, 0.999, 0.999544, 0.997, 0.931] pgrape_mt_improve = [0.997, 0.801350332, 0.5713352, 0.805, 0.996, 0.994, 0.999, 0.755, 0.998] pgrape_ms_improve = [0.999, 0.839518644, 0.7711258, 0.83, 0.999, 0.999, 0.9990531, 0.986, 0.835] pgrape_tv = [0.999, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 18.720, 53.976] pgrape_sur_tv = [54, 26.8, 38.8, 16, 116, 266, 491, 32, 380] pgrape_mt_tv = [4, 6, 6, 10, 22, 37, 53, 8, 68] pgrape_ms_tv = [] pgrape_sur_improve_tv = [] pgrape_mt_improve_tv = [] pgrape_ms_improve_tv = [] pgrape_ms_tv = [10, 10, 10, 16, 39, 38, 39, 22, 290] pgrape_sur_improve_tv = [10, 17.2, 32.4, 9, 30, 262, 479, 24, 378] pgrape_mt_improve_tv = [4, 6, 6, 9, 23, 33, 28, 12, 6] pgrape_ms_improve_tv = [10, 9.2, 10, 16, 39, 39, 40, 18, 286] fig = plt.figure(figsize=(9, 3), dpi=300) fig.subplots_adjust(hspace=0.4, wspace=0.4, left=0.05, right=0.95, top=0.9, bottom=0.2) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [pgrape, pgrape_sur, pgrape_sur_improve] methods_mt = [pgrape, pgrape_mt, pgrape_mt_improve] methods_ms = [pgrape, pgrape_ms, pgrape_ms_improve] methods_sur_tv = [pgrape_tv, pgrape_sur_tv, pgrape_sur_improve_tv] methods_mt_tv = [pgrape_tv, pgrape_mt_tv, pgrape_mt_improve_tv] methods_ms_tv = [pgrape_tv, pgrape_ms_tv, pgrape_ms_improve_tv] select = [2, 6, 8] # all_methods = [pgrape, pgrape_sur, pgrape_mt, pgrape_ms, pgrape_sur_improve, pgrape_mt_improve, pgrape_ms_improve, # pgrape_st, pgrape_stmt] for i in range(3): ax = fig.add_subplot(1, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[select[i]]) if i == 0: plt.plot(models, [1 - method[select[i]] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[select[i]] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[select[i]] for method in methods_ms], marker='+', markersize=10, label='MS') else: plt.plot(models, [1 - method[select[i]] for method in methods_sur], marker='o') plt.plot(models, [1 - method[select[i]] for method in methods_mt], marker='^') plt.plot(models, [1 - method[select[i]] for method in methods_ms], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3, prop={'size': 10}) plt.savefig("../figure_paper/pgrape_obj_select.png") fig = plt.figure(figsize=(9, 3), dpi=300) fig.subplots_adjust(hspace=0.4, wspace=0.4, left=0.05, right=0.95, top=0.9, bottom=0.2) for i in range(3): ax = fig.add_subplot(1, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[select[i]]) if i == 0: plt.plot(models, [method[select[i]] for method in methods_sur_tv], marker='o', label='SUR') plt.plot(models, [method[select[i]] for method in methods_mt_tv], marker='^', label='MT') plt.plot(models, [method[select[i]] for method in methods_ms_tv], marker='+', markersize=10, label='MS') else: plt.plot(models, [method[select[i]] for method in methods_sur_tv], marker='o') plt.plot(models, [method[select[i]] for method in methods_mt_tv], marker='^') plt.plot(models, [method[select[i]] for method in methods_ms_tv], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3, prop={'size': 10}) plt.savefig("../figure_paper/pgrape_tv_select.png") def draw_admm_obj(): plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] admm_sur = [0.999, 0.829315975, 0.7788632, 0.810, 0.999, 0.997, 0.999, 0.994, 0.967] admm_mt = [0.846, 0.636487265, 0.3936237, 0.475, 0.916, 0.824, 0.483, 0.937, 0.342] admm_ms = [0.972, 0.805007335, 0.7596211, 0.809, 0.994, 0.786, 0.381, 0.992, 0.443] admm_sur_improve = [0.997, 0.833747845, 0.7808066, 0.824, 0.999, 0.999, 0.999, 0.994, 0.967] admm_mt_improve = [0.959, 0.781849407, 0.5482583, 0.805, 0.994, 0.999, 0.999, 0.946, 0.645] admm_ms_improve = [0.997, 0.815520921, 0.7639767, 0.828, 0.999, 0.998, 0.9992551, 0.992, 0.979] admm_st = [0, 0.525196884, 0.6789286, 0.869, 0.001] admm_stmt = [0, 0.521655792, 0.6242092, 0.869, 0.001] plt.plot(instance, admm_sur, marker='o', linestyle='-', label='ADMM+SUR') plt.plot(instance, admm_mt, marker='^', linestyle='-', label='ADMM+MT') plt.plot(instance, admm_ms, marker='+', markersize='8', linestyle='-', label='ADMM+MS') plt.plot(instance, admm_sur_improve, marker='o', linestyle='--', label='ADMM+SUR+ALB') plt.plot(instance, admm_mt_improve, marker='^', linestyle='--', label='ADMM+MT+ALB') plt.plot(instance, admm_ms_improve, marker='+', markersize='8', linestyle='--', label='ADMM+MS+ALB') line1 = plt.plot(instance[0:3], admm_st[0:3], marker='o', linestyle='dotted', label='ADMM+ST') plt.plot(instance[7:], admm_st[3:], marker='o', linestyle='dotted', color=line1[0].get_color()) line2 = plt.plot(instance[0:3], admm_stmt[0:3], marker='^', linestyle='dotted', label='ADMM+STMT') plt.plot(instance[7:], admm_stmt[3:], marker='^', linestyle='dotted', color=line2[0].get_color()) x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/admm_obj_all_instances.png") def draw_admm_obj_instance(): admm = [0.999, 0.853660608, 0.785477467, 0.809, 1.000, 1.000, 1.000, 1.000, 0.999] admm_sur = [0.999, 0.829315975, 0.7788632, 0.810, 0.999, 0.997, 0.999, 0.994, 0.967] admm_mt = [0.846, 0.636487265, 0.3936237, 0.475, 0.916, 0.824, 0.483, 0.937, 0.342] admm_ms = [0.972, 0.805007335, 0.7596211, 0.809, 0.994, 0.786, 0.381, 0.992, 0.443] admm_sur_improve = [0.997, 0.833747845, 0.7808066, 0.824, 0.999, 0.999, 0.999, 0.994, 0.967] admm_mt_improve = [0.959, 0.781849407, 0.5482583, 0.805, 0.994, 0.999, 0.999, 0.946, 0.645] admm_ms_improve = [0.997, 0.815520921, 0.7639767, 0.828, 0.999, 0.998, 0.9992551, 0.992, 0.979] admm_st = [0, 0.525196884, 0.6789286, None, None, None, None, 0.869, 0.001] admm_stmt = [0, 0.521655792, 0.6242092, None, None, None, None, 0.869, 0.001] all_methods = [admm, admm_sur, admm_mt, admm_ms, admm_sur_improve, admm_mt_improve, admm_ms_improve, admm_st, admm_stmt] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) method_name = ["ADMM", "ADMM+SUR", "ADMM+MT", "ADMM+MS", "ADMM+SUR+ALB", "ADMM+MT+ALB", "ADMM+MS+ALB", "ADMM+ST", "ADMM+STMT"] plt.plot(methods, [1 - method[0] for method in all_methods], marker='o', linestyle='-', label="Energy2") plt.plot(methods, [1 - method[1] for method in all_methods], marker='^', linestyle='-', label="Energy4") plt.plot(methods, [1 - method[2] for method in all_methods], marker='+', markersize='8', linestyle='-', label="Energy6") plt.plot(methods[:-2], [1 - method[3] for method in all_methods[:-2]], marker='o', linestyle='--', label="CNOT5") plt.plot(methods[:-2], [1 - method[4] for method in all_methods[:-2]], marker='^', linestyle='--', label="CNOT10") plt.plot(methods[:-2], [1 - method[5] for method in all_methods[:-2]], marker='+', markersize='8', linestyle='--', label="CNOT15") plt.plot(methods[:-2], [1 - method[6] for method in all_methods[:-2]], marker='s', linestyle='--', label='CNOT20') plt.plot(methods, [1 - method[7] for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [1 - method[8] for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/admm_obj_per_instance_min.png") def draw_admm_instance_split(): admm = [0.999, 0.853660608, 0.785477467, 0.809, 1.000, 1.000, 1.000, 1.000, 0.999] admm_sur = [0.999, 0.829315975, 0.7788632, 0.810, 0.999, 0.997, 0.999, 0.994, 0.967] admm_mt = [0.846, 0.636487265, 0.3936237, 0.475, 0.916, 0.824, 0.483, 0.937, 0.342] admm_ms = [0.972, 0.805007335, 0.7596211, 0.809, 0.994, 0.786, 0.381, 0.992, 0.443] admm_sur_improve = [0.997, 0.833747845, 0.7808066, 0.824, 0.999, 0.999, 0.999, 0.994, 0.967] admm_mt_improve = [0.959, 0.781849407, 0.5482583, 0.805, 0.994, 0.999, 0.999, 0.946, 0.645] admm_ms_improve = [0.997, 0.815520921, 0.7639767, 0.828, 0.999, 0.998, 0.9992551, 0.992, 0.979] admm_st = [0, 0.525196884, 0.6789286, None, None, None, None, 0.869, 0.001] admm_stmt = [0, 0.521655792, 0.6242092, None, None, None, None, 0.869, 0.001] admm_tv = [0.567, 4.114, 4.508, 9.419, 15.194, 24.348, 23.481, 8.421, 48.720] admm_sur_tv = [48, 44.8, 52.8, 41, 86, 279, 467, 76, 252] admm_mt_tv = [6, 6, 6, 7, 15, 27, 47, 8, 48] admm_ms_tv = [10, 10, 10, 32, 32, 39, 39, 22, 148] admm_sur_improve_tv = [4, 14.4, 50.0, 9, 20, 263, 441, 76, 252] admm_mt_improve_tv = [6, 5.6, 6, 9, 15, 30, 48, 10, 48] admm_ms_improve_tv = [8, 8.4, 10, 16, 36, 40, 40, 22, 158] admm_st_tv = [0, 4, 6, None, None, None, None, 4, 0] admm_stmt_tv = [0, 4, 6, None, None, None, None, 4, 0] fig = plt.figure(figsize=(11, 16), dpi=300) fig.subplots_adjust(hspace=0.35, wspace=0.35, left=0.05, right=0.95, top=0.98, bottom=0.04) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [admm, admm_sur, admm_sur_improve] methods_mt = [admm, admm_mt, admm_mt_improve] methods_ms = [admm, admm_ms, admm_ms_improve] methods_st = [admm, admm_st] methods_stmt = [admm, admm_stmt] methods_sur_tv = [admm_tv, admm_sur_tv, admm_sur_improve_tv] methods_mt_tv = [admm_tv, admm_mt_tv, admm_mt_improve_tv] methods_ms_tv = [admm_tv, admm_ms_tv, admm_ms_improve_tv] methods_st_tv = [admm_tv, admm_st_tv] methods_stmt_tv = [admm_tv, admm_stmt_tv] # all_methods = [admm, admm_sur, admm_mt, admm_ms, admm_sur_improve, admm_mt_improve, admm_ms_improve, admm_st, # admm_stmt] for i in range(18): ax = fig.add_subplot(6, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) else: ax.set_title(instance_name[i - 9]) if i == 0: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10, label='MS') plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--', label='ST') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--', label='STMT') if 1 <= i <= 8: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10) if i in [0, 1, 2, 7, 8]: plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--') if i > 8: plt.plot(models, [method[i - 9] for method in methods_sur_tv], marker='o') plt.plot(models, [method[i - 9] for method in methods_mt_tv], marker='^') plt.plot(models, [method[i - 9] for method in methods_ms_tv], marker='+', markersize=10) if i in [9, 10, 11, 16, 17]: plt.plot(models[0:2], [method[i - 9] for method in methods_st_tv], marker='o', linestyle='--') plt.plot(models[0:2], [method[i - 9] for method in methods_stmt_tv], marker='^', linestyle='--') x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=0) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.25, 0, 0.5, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=5) # , bbox_to_anchor=(0, 1.02, 1, 0.2), mode='expand', borderaxespad=0, ncol=5) # fig.legend(loc='upper right', bbox_to_anchor=(1, 0.5)) # fig.tight_layout() # plt.show() plt.savefig("../figure_paper/admm_split.png") def draw_admm_selected(): admm = [0.999, 0.853660608, 0.785477467, 0.809, 1.000, 1.000, 1.000, 1.000, 0.999] admm_sur = [0.999, 0.829315975, 0.7788632, 0.810, 0.999, 0.997, 0.999, 0.994, 0.967] admm_mt = [0.846, 0.636487265, 0.3936237, 0.475, 0.916, 0.824, 0.483, 0.937, 0.342] admm_ms = [0.972, 0.805007335, 0.7596211, 0.809, 0.994, 0.786, 0.381, 0.992, 0.443] admm_sur_improve = [0.997, 0.833747845, 0.7808066, 0.824, 0.999, 0.999, 0.999, 0.994, 0.967] admm_mt_improve = [0.959, 0.781849407, 0.5482583, 0.805, 0.994, 0.999, 0.999, 0.946, 0.645] admm_ms_improve = [0.997, 0.815520921, 0.7639767, 0.828, 0.999, 0.998, 0.9992551, 0.992, 0.979] admm_st = [0, 0.525196884, 0.6789286, None, None, None, None, 0.869, 0.001] admm_stmt = [0, 0.521655792, 0.6242092, None, None, None, None, 0.869, 0.001] admm_tv = [0.567, 4.114, 4.508, 9.419, 15.194, 24.348, 23.481, 8.421, 48.720] admm_sur_tv = [48, 44.8, 52.8, 41, 86, 279, 467, 76, 252] admm_mt_tv = [6, 6, 6, 7, 15, 27, 47, 8, 48] admm_ms_tv = [10, 10, 10, 32, 32, 39, 39, 22, 148] admm_sur_improve_tv = [4, 14.4, 50.0, 9, 20, 263, 441, 76, 252] admm_mt_improve_tv = [6, 5.6, 6, 9, 15, 30, 48, 10, 48] admm_ms_improve_tv = [8, 8.4, 10, 16, 36, 40, 40, 22, 158] admm_st_tv = [0, 4, 6, None, None, None, None, 4, 0] admm_stmt_tv = [0, 4, 6, None, None, None, None, 4, 0] fig = plt.figure(figsize=(9, 3), dpi=300) fig.subplots_adjust(hspace=0.4, wspace=0.4, left=0.05, right=0.95, top=0.9, bottom=0.2) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [admm, admm_sur, admm_sur_improve] methods_mt = [admm, admm_mt, admm_mt_improve] methods_ms = [admm, admm_ms, admm_ms_improve] methods_st = [admm, admm_st] methods_stmt = [admm, admm_stmt] methods_sur_tv = [admm_tv, admm_sur_tv, admm_sur_improve_tv] methods_mt_tv = [admm_tv, admm_mt_tv, admm_mt_improve_tv] methods_ms_tv = [admm_tv, admm_ms_tv, admm_ms_improve_tv] methods_st_tv = [admm_tv, admm_st_tv] methods_stmt_tv = [admm_tv, admm_stmt_tv] select = [2, 6, 8] # all_methods = [pgrape, pgrape_sur, pgrape_mt, pgrape_ms, pgrape_sur_improve, pgrape_mt_improve, pgrape_ms_improve, # pgrape_st, pgrape_stmt] for i in range(3): ax = fig.add_subplot(1, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[select[i]]) if i == 0: plt.plot(models, [1 - method[select[i]] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[select[i]] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[select[i]] for method in methods_ms], marker='+', markersize=10, label='MS') else: plt.plot(models, [1 - method[select[i]] for method in methods_sur], marker='o') plt.plot(models, [1 - method[select[i]] for method in methods_mt], marker='^') plt.plot(models, [1 - method[select[i]] for method in methods_ms], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3, prop={'size': 10}) plt.savefig("../figure_paper/admm_obj_select.png") fig = plt.figure(figsize=(9, 3), dpi=300) fig.subplots_adjust(hspace=0.4, wspace=0.4, left=0.05, right=0.95, top=0.9, bottom=0.2) for i in range(3): ax = fig.add_subplot(1, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[select[i]]) if i == 0: plt.plot(models, [method[select[i]] for method in methods_sur_tv], marker='o', label='SUR') plt.plot(models, [method[select[i]] for method in methods_mt_tv], marker='^', label='MT') plt.plot(models, [method[select[i]] for method in methods_ms_tv], marker='+', markersize=10, label='MS') else: plt.plot(models, [method[select[i]] for method in methods_sur_tv], marker='o') plt.plot(models, [method[select[i]] for method in methods_mt_tv], marker='^') plt.plot(models, [method[select[i]] for method in methods_ms_tv], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3, prop={'size': 10}) plt.savefig("../figure_paper/admm_tv_select.png") def draw_admm_obj_tv_instance_split(): admm = [0.999, 0.853660608, 0.785477467, 0.809, 1.000, 1.000, 1.000, 1.000, 0.999] admm_sur = [0.999, 0.829315975, 0.7788632, 0.810, 0.999, 0.997, 0.999, 0.994, 0.967] admm_mt = [0.846, 0.636487265, 0.3936237, 0.475, 0.916, 0.824, 0.483, 0.937, 0.342] admm_ms = [0.972, 0.805007335, 0.7596211, 0.809, 0.994, 0.786, 0.381, 0.992, 0.443] admm_sur_improve = [0.997, 0.833747845, 0.7808066, 0.824, 0.999, 0.999, 0.999, 0.994, 0.967] admm_mt_improve = [0.959, 0.781849407, 0.5482583, 0.805, 0.994, 0.999, 0.999, 0.946, 0.645] admm_ms_improve = [0.997, 0.815520921, 0.7639767, 0.828, 0.999, 0.998, 0.9992551, 0.992, 0.979] admm_st = [0, 0.525196884, 0.6789286, None, None, None, None, 0.869, 0.001] admm_stmt = [0, 0.521655792, 0.6242092, None, None, None, None, 0.869, 0.001] admm_tv = [0.567, 4.114, 4.508, 9.419, 15.194, 24.348, 23.481, 8.421, 48.720] admm_sur_tv = [48, 44.8, 52.8, 41, 86, 279, 467, 76, 252] admm_mt_tv = [6, 6, 6, 7, 15, 27, 47, 8, 48] admm_ms_tv = [10, 10, 10, 32, 32, 39, 39, 22, 148] admm_sur_improve_tv = [4, 14.4, 50.0, 9, 20, 263, 441, 76, 252] admm_mt_improve_tv = [6, 5.6, 6, 9, 15, 30, 48, 10, 48] admm_ms_improve_tv = [8, 8.4, 10, 16, 36, 40, 40, 22, 158] admm_st_tv = [0, 4, 6, None, None, None, None, 4, 0] admm_stmt_tv = [0, 4, 6, None, None, None, None, 4, 0] fig = plt.figure(figsize=(9, 8), dpi=300) fig.subplots_adjust(hspace=0.3, wspace=0.3, left=0.05, right=0.95, top=0.95, bottom=0.08) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [admm, admm_sur, admm_sur_improve] methods_mt = [admm, admm_mt, admm_mt_improve] methods_ms = [admm, admm_ms, admm_ms_improve] methods_st = [admm, admm_st] methods_stmt = [admm, admm_stmt] methods_sur_tv = [admm_tv, admm_sur_tv, admm_sur_improve_tv] methods_mt_tv = [admm_tv, admm_mt_tv, admm_mt_improve_tv] methods_ms_tv = [admm_tv, admm_ms_tv, admm_ms_improve_tv] methods_st_tv = [admm_tv, admm_st_tv] methods_stmt_tv = [admm_tv, admm_stmt_tv] # all_methods = [admm, admm_sur, admm_mt, admm_ms, admm_sur_improve, admm_mt_improve, admm_ms_improve, admm_st, # admm_stmt] for i in range(9): ax = fig.add_subplot(3, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) if i == 0: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10, label='MS') plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--', label='ST') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--', label='STMT') else: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10) if i in [0, 1, 2, 7, 8]: plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--') x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.25, 0, 0.5, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=5) plt.savefig("../figure_paper/admm_obj_split.png") fig = plt.figure(figsize=(9, 8), dpi=300) fig.subplots_adjust(hspace=0.3, wspace=0.3, left=0.05, right=0.95, top=0.95, bottom=0.08) for i in range(9): ax = fig.add_subplot(3, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) if i == 0: plt.plot(models, [method[i] for method in methods_sur_tv], marker='o', label='SUR') plt.plot(models, [method[i] for method in methods_mt_tv], marker='^', label='MT') plt.plot(models, [method[i] for method in methods_ms_tv], marker='+', markersize=10, label='MS') plt.plot(models[0:2], [method[i] for method in methods_st_tv], marker='o', linestyle='--', label='ST') plt.plot(models[0:2], [method[i] for method in methods_stmt_tv], marker='^', linestyle='--', label='STMT') else: plt.plot(models, [method[i] for method in methods_sur_tv], marker='o') plt.plot(models, [method[i] for method in methods_mt_tv], marker='^') plt.plot(models, [method[i] for method in methods_ms_tv], marker='+', markersize=10) if i in [0, 1, 2, 7, 8]: plt.plot(models[0:2], [method[i] for method in methods_st_tv], marker='o', linestyle='--') plt.plot(models[0:2], [method[i] for method in methods_stmt_tv], marker='^', linestyle='--') x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.25, 0, 0.5, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=5) plt.savefig("../figure_paper/admm_tv_split.png") def draw_admm_tv(): plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] admm_sur_tv = [48, 44.8, 52.8, 41, 86, 279, 467, 56, 252] admm_mt_tv = [6, 6, 6, 7, 15, 27, 47, 8, 48] admm_ms_tv = [10, 10, 10, 32, 32, 39, 39, 22, 148] admm_sur_improve_tv = [4, 14.4, 50.0, 9, 20, 263, 441, 76, 252] admm_mt_improve_tv = [6, 5.6, 6, 9, 15, 30, 48, 10, 48] admm_ms_improve_tv = [8, 8.4, 10, 16, 36, 40, 40, 22, 158] admm_st_tv = [0, 4, 6, 4, 0] admm_stmt_tv = [0, 4, 6, 4, 0] plt.plot(instance, admm_sur_tv, marker='o', linestyle='-', label='ADMM+SUR') plt.plot(instance, admm_mt_tv, marker='^', linestyle='-', label='ADMM+MT') plt.plot(instance, admm_ms_tv, marker='+', markersize='8', linestyle='-', label='ADMM+MS') plt.plot(instance, admm_sur_improve_tv, marker='o', linestyle='--', label='ADMM+SUR+ALB') plt.plot(instance, admm_mt_improve_tv, marker='^', linestyle='--', label='ADMM+MT+ALB') plt.plot(instance, admm_ms_improve_tv, marker='+', markersize='8', linestyle='--', label='ADMM+MS+ALB') line1 = plt.plot(instance[0:3], admm_st_tv[0:3], marker='o', linestyle='dotted', label='ADMM+ST') plt.plot(instance[7:], admm_st_tv[3:], marker='o', linestyle='dotted', color=line1[0].get_color()) line2 = plt.plot(instance[0:3], admm_stmt_tv[0:3], marker='^', linestyle='dotted', label='ADMM+STMT') plt.plot(instance[7:], admm_stmt_tv[3:], marker='^', linestyle='dotted', color=line2[0].get_color()) x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/admm_tv_all_instances.png") def draw_admm_tv_instance(): admm_tv = [0.567, 4.114, 4.508, 9.419, 15.194, 24.348, 23.481, 8.421, 48.720] admm_sur_tv = [48, 44.8, 52.8, 41, 86, 279, 467, 56, 252] admm_mt_tv = [6, 6, 6, 7, 15, 27, 47, 8, 48] admm_ms_tv = [10, 10, 10, 32, 32, 39, 39, 22, 148] admm_sur_improve_tv = [4, 14.4, 50.0, 9, 20, 263, 441, 76, 252] admm_mt_improve_tv = [6, 5.6, 6, 9, 15, 30, 48, 10, 48] admm_ms_improve_tv = [8, 8.4, 10, 16, 36, 40, 40, 22, 158] admm_st_tv = [0, 4, 6, None, None, None, None, 4, 0] admm_stmt_tv = [0, 4, 6, None, None, None, None, 4, 0] all_methods = [admm_tv, admm_sur_tv, admm_mt_tv, admm_ms_tv, admm_sur_improve_tv, admm_mt_improve_tv, admm_ms_improve_tv, admm_st_tv, admm_stmt_tv] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) method_name = ["ADMM", "ADMM+SUR", "ADMM+MT", "ADMM+MS", "ADMM+SUR+ALB", "ADMM+MT+ALB", "ADMM+MS+ALB", "ADMM+ST", "ADMM+STMT"] plt.plot(methods, [np.log10(method[0]) for method in all_methods], marker='o', linestyle='-', label="Energy2") plt.plot(methods, [np.log10(method[1]) for method in all_methods], marker='^', linestyle='-', label="Energy4") plt.plot(methods, [np.log10(method[2]) for method in all_methods], marker='+', markersize='8', linestyle='-', label="Energy6") plt.plot(methods[:-2], [np.log10(method[3]) for method in all_methods[:-2]], marker='o', linestyle='--', label="CNOT5") plt.plot(methods[:-2], [np.log10(method[4]) for method in all_methods[:-2]], marker='^', linestyle='--', label="CNOT10") plt.plot(methods[:-2], [np.log10(method[5]) for method in all_methods[:-2]], marker='+', markersize='8', linestyle='--', label="CNOT15") plt.plot(methods[:-2], [np.log10(method[6]) for method in all_methods[:-2]], marker='s', linestyle='--', label='CNOT20') plt.plot(methods, [np.log10(method[7]) for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [np.log10(method[8]) for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend(fontsize=8) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/admm_tv_per_instance_log10.png") def draw_tr_obj(): plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] tr_sur = [0.995, 0.860285375, 0.788751995, 0.668, 0.998, 0.998, 0.999, 0.973, 0.818] tr_mt = [0.841, 0.699677255, 0.382219312, 0.715, 0.677, 0.710, 0.686, 0.409, 0.034] tr_ms = [0.96, 0.855868864, 0.747288281, 0.407, 0.981, 0.716, 0.303, 0.962, 0.776] tr_sur_improve = [0.995, 0.856463394, 0.788670132, 0.794, 0.998, 1.000, 0.999, 0.987, 0.917] tr_mt_improve = [0.997, 0.834465772, 0.554418567, 0.804, 0.991, 0.994, 0.999, 0.993, 0.504] tr_ms_improve = [0.998, 0.857482589, 0.773893823, 0.827, 0.999, 0.997, 0.997, 0.997, 0.88] tr_st = [0, 0.855614065, 0.681470263, 0.995, 0.999] tr_stmt = [0, 0.837013759, 0.621341738, 0.995, 0.593] plt.plot(instance, tr_sur, marker='o', linestyle='-', label='TR+SUR') plt.plot(instance, tr_mt, marker='^', linestyle='-', label='TR+MT') plt.plot(instance, tr_ms, marker='+', markersize='8', linestyle='-', label='TR+MS') plt.plot(instance, tr_sur_improve, marker='o', linestyle='--', label='TR+SUR+ALB') plt.plot(instance, tr_mt_improve, marker='^', linestyle='--', label='TR+MT+ALB') plt.plot(instance, tr_ms_improve, marker='+', markersize='8', linestyle='--', label='TR+MS+ALB') line1 = plt.plot(instance[0:3], tr_st[0:3], marker='o', linestyle='dotted', label='TR+ST') plt.plot(instance[7:], tr_st[3:], marker='o', linestyle='dotted', color=line1[0].get_color()) line2 = plt.plot(instance[0:3], tr_stmt[0:3], marker='^', linestyle='dotted', label='TR+STMT') plt.plot(instance[7:], tr_stmt[3:], marker='^', linestyle='dotted', color=line2[0].get_color()) x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/tr_obj_all_instances.png") def draw_tr_obj_instance(): tr = [0.999, 0.862748429, 0.791003234, 0.876, 1.000, 1.000, 1.000, 1.000, 0.999] tr_sur = [0.995, 0.841779059, 0.7838377, 0.668, 0.998, 0.998, 0.999, 0.973, 0.818] tr_mt = [0.841, 0.682912135, 0.3832050, 0.715, 0.677, 0.710, 0.686, 0.409, 0.034] tr_ms = [0.96, 0.83739821, 0.7419845, 0.407, 0.981, 0.716, 0.303, 0.962, 0.776] tr_sur_improve = [0.995, 0.838262615, 0.7837403, 0.794, 0.998, 1.000, 0.999, 0.987, 0.917] tr_mt_improve = [0.997, 0.801350332, 0.5713352, 0.804, 0.991, 0.994, 0.999, 0.993, 0.504] tr_ms_improve = [0.998, 0.840041622, 0.7699510, 0.827, 0.999, 0.997, 0.997, 0.997, 0.88] tr_st = [0, 0.838716809, 0.6789286, None, None, None, None, 0.995, 0.999] tr_stmt = [0, 0.803798946, 0.6242092, None, None, None, None, 0.995, 0.593] all_methods = [tr, tr_sur, tr_mt, tr_ms, tr_sur_improve, tr_mt_improve, tr_ms_improve, tr_st, tr_stmt] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) method_name = ["TR", "TR+SUR", "TR+MT", "TR+MS", "TR+SUR+ALB", "TR+MT+ALB", "TR+MS+ALB", "TR+ST", "TR+STMT"] plt.plot(methods, [1 - method[0] for method in all_methods], marker='o', linestyle='-', label="Energy2") plt.plot(methods, [1 - method[1] for method in all_methods], marker='^', linestyle='-', label="Energy4") plt.plot(methods, [1 - method[2] for method in all_methods], marker='+', markersize='8', linestyle='-', label="Energy6") plt.plot(methods[:-2], [1 - method[3] for method in all_methods[:-2]], marker='o', linestyle='--', label="CNOT5") plt.plot(methods[:-2], [1 - method[4] for method in all_methods[:-2]], marker='^', linestyle='--', label="CNOT10") plt.plot(methods[:-2], [1 - method[5] for method in all_methods[:-2]], marker='+', markersize='8', linestyle='--', label="CNOT15") plt.plot(methods[:-2], [1 - method[6] for method in all_methods[:-2]], marker='s', linestyle='--', label='CNOT20') plt.plot(methods, [1 - method[7] for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [1 - method[8] for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/tr_obj_per_instance_min.png") def draw_tr_instance_split(): tr = [0.999, 0.862748429, 0.791003234, 0.876, 1.000, 1.000, 1.000, 1.000, 0.999] tr_sur = [0.995, 0.841779059, 0.7838377, 0.668, 0.998, 0.998, 0.999, 0.973, 0.818] tr_mt = [0.841, 0.682912135, 0.3832050, 0.715, 0.677, 0.710, 0.686, 0.409, 0.034] tr_ms = [0.96, 0.83739821, 0.7419845, 0.407, 0.981, 0.716, 0.303, 0.962, 0.776] tr_sur_improve = [0.995, 0.838262615, 0.7837403, 0.794, 0.998, 1.000, 0.999, 0.987, 0.917] tr_mt_improve = [0.997, 0.801350332, 0.5713352, 0.804, 0.991, 0.994, 0.999, 0.993, 0.504] tr_ms_improve = [0.998, 0.840041622, 0.7699510, 0.827, 0.999, 0.997, 0.997, 0.997, 0.88] tr_st = [0, 0.838716809, 0.6789286, None, None, None, None, 0.995, 0.999] tr_stmt = [0, 0.803798946, 0.6242092, None, None, None, None, 0.995, 0.593] tr_tv = [0.523, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 2.744, 0.677] tr_sur_tv = [54, 32.4, 43.6, 24, 116, 276, 480, 36, 280] tr_mt_tv = [6, 6, 6, 6, 21, 36, 51, 8, 72] tr_ms_tv = [10, 10, 10, 15, 38, 40, 39, 24, 288] tr_sur_improve_tv = [8, 14, 40.4, 7, 24, 256, 471, 32, 378] tr_mt_improve_tv = [4, 6, 6, 10, 16, 34, 49, 2, 70] tr_ms_improve_tv = [10, 10, 10, 20, 38, 39, 40, 22, 290] tr_st_tv = [2, 6, 6, None, None, None, None, 8, 48] tr_stmt_tv = [2, 6, 6, None, None, None, None, 8, 64] fig = plt.figure(figsize=(11, 16), dpi=300) fig.subplots_adjust(hspace=0.35, wspace=0.35, left=0.05, right=0.95, top=0.98, bottom=0.04) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [tr, tr_sur, tr_sur_improve] methods_mt = [tr, tr_mt, tr_mt_improve] methods_ms = [tr, tr_ms, tr_ms_improve] methods_st = [tr, tr_st] methods_stmt = [tr, tr_stmt] methods_sur_tv = [tr_tv, tr_sur_tv, tr_sur_improve_tv] methods_mt_tv = [tr_tv, tr_mt_tv, tr_mt_improve_tv] methods_ms_tv = [tr_tv, tr_ms_tv, tr_ms_improve_tv] methods_st_tv = [tr_tv, tr_st_tv] methods_stmt_tv = [tr_tv, tr_stmt_tv] # all_methods = [tr, tr_sur, tr_mt, tr_ms, tr_sur_improve, tr_mt_improve, tr_ms_improve, tr_st, # tr_stmt] for i in range(18): ax = fig.add_subplot(6, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) else: ax.set_title(instance_name[i - 9]) if i == 0: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10, label='MS') plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--', label='ST') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--', label='STMT') if 1 <= i <= 8: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10) if i in [0, 1, 2, 7, 8]: plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--') if i > 8: plt.plot(models, [method[i - 9] for method in methods_sur_tv], marker='o') plt.plot(models, [method[i - 9] for method in methods_mt_tv], marker='^') plt.plot(models, [method[i - 9] for method in methods_ms_tv], marker='+', markersize=10) if i in [9, 10, 11, 16, 17]: plt.plot(models[0:2], [method[i - 9] for method in methods_st_tv], marker='o', linestyle='--') plt.plot(models[0:2], [method[i - 9] for method in methods_stmt_tv], marker='^', linestyle='--') x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=0) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.25, 0, 0.5, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=5) # , bbox_to_anchor=(0, 1.02, 1, 0.2), mode='expand', borderaxespad=0, ncol=5) # fig.legend(loc='upper right', bbox_to_anchor=(1, 0.5)) # fig.tight_layout() # plt.show() plt.savefig("../figure_paper/tr_split.png") def draw_tr_obj_tv_instance_split(): tr = [0.999, 0.862748429, 0.791003234, 0.876, 1.000, 1.000, 1.000, 1.000, 0.999] tr_sur = [0.995, 0.841779059, 0.7838377, 0.668, 0.998, 0.998, 0.999, 0.973, 0.818] tr_mt = [0.841, 0.682912135, 0.3832050, 0.715, 0.677, 0.710, 0.686, 0.409, 0.034] tr_ms = [0.96, 0.83739821, 0.7419845, 0.407, 0.981, 0.716, 0.303, 0.962, 0.776] tr_sur_improve = [0.995, 0.838262615, 0.7837403, 0.794, 0.998, 1.000, 0.999, 0.987, 0.917] tr_mt_improve = [0.997, 0.801350332, 0.5713352, 0.804, 0.991, 0.994, 0.999, 0.993, 0.504] tr_ms_improve = [0.998, 0.840041622, 0.7699510, 0.827, 0.999, 0.997, 0.997, 0.997, 0.88] tr_st = [0, 0.838716809, 0.6789286, None, None, None, None, 0.995, 0.999] tr_stmt = [0, 0.803798946, 0.6242092, None, None, None, None, 0.995, 0.593] tr_tv = [0.523, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 2.744, 0.677] tr_sur_tv = [54, 32.4, 43.6, 24, 116, 276, 480, 36, 380] tr_mt_tv = [6, 6, 6, 6, 21, 36, 51, 8, 72] tr_ms_tv = [10, 10, 10, 15, 38, 40, 39, 24, 288] tr_sur_improve_tv = [8, 14, 40.4, 7, 24, 256, 471, 32, 378] tr_mt_improve_tv = [4, 6, 6, 10, 16, 34, 49, 2, 70] tr_ms_improve_tv = [10, 10, 10, 20, 38, 39, 40, 22, 290] tr_st_tv = [2, 6, 6, None, None, None, None, 8, 48] tr_stmt_tv = [2, 6, 6, None, None, None, None, 8, 64] fig = plt.figure(figsize=(9, 8), dpi=300) fig.subplots_adjust(hspace=0.3, wspace=0.3, left=0.05, right=0.95, top=0.95, bottom=0.08) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [tr, tr_sur, tr_sur_improve] methods_mt = [tr, tr_mt, tr_mt_improve] methods_ms = [tr, tr_ms, tr_ms_improve] methods_st = [tr, tr_st] methods_stmt = [tr, tr_stmt] methods_sur_tv = [tr_tv, tr_sur_tv, tr_sur_improve_tv] methods_mt_tv = [tr_tv, tr_mt_tv, tr_mt_improve_tv] methods_ms_tv = [tr_tv, tr_ms_tv, tr_ms_improve_tv] methods_st_tv = [tr_tv, tr_st_tv] methods_stmt_tv = [tr_tv, tr_stmt_tv] # all_methods = [tr, tr_sur, tr_mt, tr_ms, tr_sur_improve, tr_mt_improve, tr_ms_improve, tr_st, # tr_stmt] for i in range(9): ax = fig.add_subplot(3, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) if i == 0: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10, label='MS') plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--', label='ST') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--', label='STMT') else: plt.plot(models, [1 - method[i] for method in methods_sur], marker='o') plt.plot(models, [1 - method[i] for method in methods_mt], marker='^') plt.plot(models, [1 - method[i] for method in methods_ms], marker='+', markersize=10) if i in [0, 1, 2, 7, 8]: plt.plot(models[0:2], [1 - method[i] for method in methods_st], marker='o', linestyle='--') plt.plot(models[0:2], [1 - method[i] for method in methods_stmt], marker='^', linestyle='--') x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.25, 0, 0.5, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=5) plt.savefig("../figure_paper/tr_obj_split.png") fig = plt.figure(figsize=(9, 8), dpi=300) fig.subplots_adjust(hspace=0.3, wspace=0.3, left=0.05, right=0.95, top=0.95, bottom=0.08) for i in range(9): ax = fig.add_subplot(3, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[i]) if i == 0: plt.plot(models, [method[i] for method in methods_sur_tv], marker='o', label='SUR') plt.plot(models, [method[i] for method in methods_mt_tv], marker='^', label='MT') plt.plot(models, [method[i] for method in methods_ms_tv], marker='+', markersize=10, label='MS') plt.plot(models[0:2], [method[i] for method in methods_st_tv], marker='o', linestyle='--', label='ST') plt.plot(models[0:2], [method[i] for method in methods_stmt_tv], marker='^', linestyle='--', label='STMT') else: plt.plot(models, [method[i] for method in methods_sur_tv], marker='o') plt.plot(models, [method[i] for method in methods_mt_tv], marker='^') plt.plot(models, [method[i] for method in methods_ms_tv], marker='+', markersize=10) if i in [0, 1, 2, 7, 8]: plt.plot(models[0:2], [method[i] for method in methods_st_tv], marker='o', linestyle='--') plt.plot(models[0:2], [method[i] for method in methods_stmt_tv], marker='^', linestyle='--') x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.25, 0, 0.5, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=5) plt.savefig("../figure_paper/tr_tv_split.png") def draw_tr_tv(): plt.figure(figsize=(8, 6), dpi=300) instance = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] tr_sur_tv = [54, 32.4, 43.6, 24, 116, 276, 480, 36, 280] tr_mt_tv = [6, 6, 6, 6, 21, 36, 51, 8, 72] tr_ms_tv = [10, 10, 10, 15, 38, 40, 39, 24, 288] tr_sur_improve_tv = [8, 14, 40.4, 7, 24, 256, 471, 32, 378] tr_mt_improve_tv = [4, 6, 6, 10, 16, 34, 49, 2, 70] tr_ms_improve_tv = [10, 10, 10, 20, 38, 39, 40, 22, 290] tr_st_tv = [2, 6, 6, 8, 48] tr_stmt_tv = [2, 6, 6, 8, 64] plt.plot(instance, tr_sur_tv, marker='o', linestyle='-', label='TR+SUR') plt.plot(instance, tr_mt_tv, marker='^', linestyle='-', label='TR+MT') plt.plot(instance, tr_ms_tv, marker='+', markersize='8', linestyle='-', label='TR+MS') plt.plot(instance, tr_sur_improve_tv, marker='o', linestyle='--', label='TR+SUR+ALB') plt.plot(instance, tr_mt_improve_tv, marker='^', linestyle='--', label='TR+MT+ALB') plt.plot(instance, tr_ms_improve_tv, marker='+', markersize='8', linestyle='--', label='TR+MS+ALB') line1 = plt.plot(instance[0:3], tr_st_tv[0:3], marker='o', linestyle='dotted', label='TR+ST') plt.plot(instance[7:], tr_st_tv[3:], marker='o', linestyle='dotted', color=line1[0].get_color()) line2 = plt.plot(instance[0:3], tr_stmt_tv[0:3], marker='^', linestyle='dotted', label='TR+STMT') plt.plot(instance[7:], tr_stmt_tv[3:], marker='^', linestyle='dotted', color=line2[0].get_color()) x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(instance, instance_name) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend() plt.tight_layout() # plt.show() plt.savefig("../figure_paper/tr_tv_all_instances.png") def draw_tr_tv_instance(): tr_tv = [0.523, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 2.744, 0.677] tr_sur_tv = [54, 32.4, 43.6, 24, 116, 276, 480, 36, 280] tr_mt_tv = [6, 6, 6, 6, 21, 36, 51, 8, 72] tr_ms_tv = [10, 10, 10, 15, 38, 40, 39, 24, 288] tr_sur_improve_tv = [8, 14, 40.4, 7, 24, 256, 471, 32, 378] tr_mt_improve_tv = [4, 6, 6, 10, 16, 34, 49, 2, 70] tr_ms_improve_tv = [10, 10, 10, 20, 38, 39, 40, 22, 290] tr_st_tv = [2, 6, 6, None, None, None, None, 8, 48] tr_stmt_tv = [2, 6, 6, None, None, None, None, 8, 64] all_methods = [tr_tv, tr_sur_tv, tr_mt_tv, tr_ms_tv, tr_sur_improve_tv, tr_mt_improve_tv, tr_ms_improve_tv, tr_st_tv, tr_stmt_tv] plt.figure(figsize=(8, 6), dpi=300) methods = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) method_name = ["TR", "TR+SUR", "TR+MT", "TR+MS", "TR+SUR+ALB", "TR+MT+ALB", "TR+MS+ALB", "TR+ST", "TR+STMT"] plt.plot(methods, [np.log10(method[0]) for method in all_methods], marker='o', linestyle='-', label="Energy2") plt.plot(methods, [np.log10(method[1]) for method in all_methods], marker='^', linestyle='-', label="Energy4") plt.plot(methods, [np.log10(method[2]) for method in all_methods], marker='+', markersize='8', linestyle='-', label="Energy6") plt.plot(methods[:-2], [np.log10(method[3]) for method in all_methods[:-2]], marker='o', linestyle='--', label="CNOT5") plt.plot(methods[:-2], [np.log10(method[4]) for method in all_methods[:-2]], marker='^', linestyle='--', label="CNOT10") plt.plot(methods[:-2], [np.log10(method[5]) for method in all_methods[:-2]], marker='+', markersize='8', linestyle='--', label="CNOT15") plt.plot(methods[:-2], [np.log10(method[6]) for method in all_methods[:-2]], marker='s', linestyle='--', label='CNOT20') plt.plot(methods, [np.log10(method[7]) for method in all_methods], marker='o', linestyle='dotted', label="CircuitH2") plt.plot(methods, [np.log10(method[8]) for method in all_methods], marker='^', linestyle='dotted', label="CircuitLiH") x_loc = plt.MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_loc) plt.xticks(methods, method_name, rotation=-15) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.legend(fontsize=8) plt.tight_layout() # plt.show() plt.savefig("../figure_paper/tr_tv_per_instance_log10.png") def draw_tr_selected(): tr = [0.999, 0.862748429, 0.791003234, 0.876, 1.000, 1.000, 1.000, 1.000, 0.999] tr_sur = [0.995, 0.841779059, 0.7838377, 0.668, 0.998, 0.998, 0.999, 0.973, 0.818] tr_mt = [0.841, 0.682912135, 0.3832050, 0.715, 0.677, 0.710, 0.686, 0.409, 0.034] tr_ms = [0.96, 0.83739821, 0.7419845, 0.407, 0.981, 0.716, 0.303, 0.962, 0.776] tr_sur_improve = [0.995, 0.838262615, 0.7837403, 0.794, 0.998, 1.000, 0.999, 0.987, 0.917] tr_mt_improve = [0.997, 0.801350332, 0.5713352, 0.804, 0.991, 0.994, 0.999, 0.993, 0.504] tr_ms_improve = [0.998, 0.840041622, 0.7699510, 0.827, 0.999, 0.997, 0.997, 0.997, 0.88] tr_st = [0, 0.838716809, 0.6789286, None, None, None, None, 0.995, 0.999] tr_stmt = [0, 0.803798946, 0.6242092, None, None, None, None, 0.995, 0.593] tr_tv = [0.523, 2.752, 3.237, 6.094, 11.056, 16.795, 15.099, 2.744, 0.677] tr_sur_tv = [54, 32.4, 43.6, 24, 116, 276, 480, 36, 380] tr_mt_tv = [6, 6, 6, 6, 21, 36, 51, 8, 72] tr_ms_tv = [10, 10, 10, 15, 38, 40, 39, 24, 288] tr_sur_improve_tv = [8, 14, 40.4, 7, 24, 256, 471, 32, 378] tr_mt_improve_tv = [4, 6, 6, 10, 16, 34, 49, 2, 70] tr_ms_improve_tv = [10, 10, 10, 20, 38, 39, 40, 22, 290] tr_st_tv = [2, 6, 6, None, None, None, None, 8, 48] tr_stmt_tv = [2, 6, 6, None, None, None, None, 8, 64] fig = plt.figure(figsize=(9, 3), dpi=300) fig.subplots_adjust(hspace=0.4, wspace=0.4, left=0.05, right=0.95, top=0.9, bottom=0.2) instance_name = ["Energy2", "Energy4", "Energy6", "CNOT5", "CNOT10", "CNOT15", "CNOT20", "CircuitH2", "CircuitLiH"] models = np.array([1, 2, 3]) model_name = ["Continuous", "Rounding", "Improvement"] methods_sur = [tr, tr_sur, tr_sur_improve] methods_mt = [tr, tr_mt, tr_mt_improve] methods_ms = [tr, tr_ms, tr_ms_improve] methods_st = [tr, tr_st] methods_stmt = [tr, tr_stmt] methods_sur_tv = [tr_tv, tr_sur_tv, tr_sur_improve_tv] methods_mt_tv = [tr_tv, tr_mt_tv, tr_mt_improve_tv] methods_ms_tv = [tr_tv, tr_ms_tv, tr_ms_improve_tv] methods_st_tv = [tr_tv, tr_st_tv] methods_stmt_tv = [tr_tv, tr_stmt_tv] select = [2, 6, 8] # all_methods = [pgrape, pgrape_sur, pgrape_mt, pgrape_ms, pgrape_sur_improve, pgrape_mt_improve, pgrape_ms_improve, # pgrape_st, pgrape_stmt] for i in range(3): ax = fig.add_subplot(1, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[select[i]]) if i == 0: plt.plot(models, [1 - method[select[i]] for method in methods_sur], marker='o', label='SUR') plt.plot(models, [1 - method[select[i]] for method in methods_mt], marker='^', label='MT') plt.plot(models, [1 - method[select[i]] for method in methods_ms], marker='+', markersize=10, label='MS') else: plt.plot(models, [1 - method[select[i]] for method in methods_sur], marker='o') plt.plot(models, [1 - method[select[i]] for method in methods_mt], marker='^') plt.plot(models, [1 - method[select[i]] for method in methods_ms], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3, prop={'size': 10}) plt.savefig("../figure_paper/tr_obj_select.png") fig = plt.figure(figsize=(9, 3), dpi=300) fig.subplots_adjust(hspace=0.4, wspace=0.4, left=0.05, right=0.95, top=0.9, bottom=0.2) for i in range(3): ax = fig.add_subplot(1, 3, i + 1) # ax.text(0.5, 0.5, str((2, 3, i)), fontsize=18, ha='center') if i < 9: ax.set_title(instance_name[select[i]]) if i == 0: plt.plot(models, [method[select[i]] for method in methods_sur_tv], marker='o', label='SUR') plt.plot(models, [method[select[i]] for method in methods_mt_tv], marker='^', label='MT') plt.plot(models, [method[select[i]] for method in methods_ms_tv], marker='+', markersize=10, label='MS') else: plt.plot(models, [method[select[i]] for method in methods_sur_tv], marker='o') plt.plot(models, [method[select[i]] for method in methods_mt_tv], marker='^') plt.plot(models, [method[select[i]] for method in methods_ms_tv], marker='+', markersize=10) x_loc = plt.MultipleLocator(1) ax.xaxis.set_major_locator(x_loc) plt.xticks(models, model_name, rotation=-5) # plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) lines, labels = fig.axes[0].get_legend_handles_labels() fig.legend(lines, labels, bbox_to_anchor=(0.35, 0, 0.3, 0.2), loc='lower center', mode='expand', borderaxespad=0, ncol=3, prop={'size': 10}) plt.savefig("../figure_paper/tr_tv_select.png") if __name__ == '__main__': # evo_time = 4 # n_ts = 80 # control = np.loadtxt("../example/control/Continuous/MoleculeNew_H2_evotime4.0_n_ts80_ptypeCONSTANT_offset0.5_objUNIT_sum_penalty0.0.csv", # delimiter=',') # output_fig = "../example/figure/Continuous/MoleculeNew_H2_evotime4.0_n_ts80_ptypeCONSTANT_offset0.5_objUNIT_sum_penalty0.0_sos1.png" # draw_control(evo_time, n_ts, control, output_fig) # draw_stats() # draw_sos1(n_ts, control, output_fig) # print(max([abs(sum(control[k, :]) - 1) for k in range(n_ts)])) draw_integral_error("H2", ub=True) draw_integral_error("LiH", ub=True) # draw_stats() # draw_obj_energy_r() # draw_sur() # draw_mt() # draw_ms() # draw_sur_improve() # draw_mt_improve() # draw_ms_improve() # draw_grape_obj() # draw_pgrape_obj() # draw_admm_obj() # draw_tr_obj() # draw_grape_tv() # draw_pgrape_tv() # draw_admm_tv() # draw_tr_tv() # draw_grape_obj_instance() # draw_grape_tv_instance() # draw_pgrape_obj_instance() # draw_pgrape_tv_instance() # draw_pgrape_obj_tv_instance_split() # draw_pgrape_selected() # draw_admm_obj_instance() # draw_admm_tv_instance() # draw_admm_instance_split() # draw_admm_obj_tv_instance_split() # draw_admm_selected() # draw_tr_obj_instance() # draw_tr_tv_instance() # draw_tr_obj_tv_instance_split() # draw_tr_selected()
53.915211
143
0.606887
17,399
104,919
3.498822
0.036209
0.031277
0.031802
0.034891
0.945972
0.933997
0.923172
0.913973
0.90842
0.903312
0
0.145106
0.206798
104,919
1,945
144
53.942931
0.586383
0.1173
0
0.757829
0
0
0.085143
0.024617
0.001392
0
0
0
0
1
0.025052
false
0
0.002088
0
0.02714
0.001392
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
f1d389a7fef12754fab0292787214aa8ba4fa4e2
22,689
py
Python
api/views.py
omidiora/DNA_backend
9a797e4d591f67519488c4a987e1250b85dc8910
[ "MIT" ]
null
null
null
api/views.py
omidiora/DNA_backend
9a797e4d591f67519488c4a987e1250b85dc8910
[ "MIT" ]
null
null
null
api/views.py
omidiora/DNA_backend
9a797e4d591f67519488c4a987e1250b85dc8910
[ "MIT" ]
null
null
null
from allauth.socialaccount.adapter import get_adapter from rest_framework.response import Response from rest_framework import viewsets, status from django.contrib.auth.models import User from rest_framework.decorators import action from rest_framework.authentication import TokenAuthentication from .models import Profile,Loan_Record from .serializers import UserRegistrationSerializers, ProfileSerializer, EditProfileSerilizer,LoanSerializer , DeleteAccountSerializer from rest_framework.permissions import AllowAny, IsAuthenticated import jwt import os from datetime import datetime, timedelta # favour django-mailer but fall back to django.core.mail from django.conf import settings from django.core.mail import send_mail from django.template.loader import render_to_string from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter from allauth.socialaccount.providers.oauth2.client import OAuth2Client from rest_auth.registration.views import SocialLoginView from django.http import Http404 # from rest_framework.parsers import FileUploadParser #login was class UserViewSet(viewsets.ModelViewSet): queryset = User.objects.all() serializer_class = UserRegistrationSerializers authentication_classes = (TokenAuthentication,) permission_classes = (AllowAny,) versions =['v1'] # update - default method should be restricted # pylint: disable=R0201 def update(self, request, *args, **kwargs ): response = {'message': 'You cant Update your Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # destroy - IsAuthenticated an isSelf # pylint: disable=R0201 def destroy(self, request, *args, **kwargs): response = {'message': 'You cant delete Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # retrieve - default method for all should be restricted, # pylint: disable=R0201 def list(self, request, *args, **kwargs): response = {'message': 'You cant list or retrieve users Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def retrieve(self, request, pk=None, *args, **kwargs): response = {'message': 'You cant list or retrieve users Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) class ProfileViewSet(viewsets.ModelViewSet): queryset = Profile.objects.all() serializer_class = ProfileSerializer authentication_classes = (TokenAuthentication,) #this option is used to authenticate a user, thus django can identify the token and its owner permission_classes = (IsAuthenticated,) versions = ['v1'] # only set permissions for actions as update # remember to customise Create, delete, retrieve # pylint: disable=R0201 def update(self, request, *args, **kwargs): response = {'message': 'You cant edit your Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def create(self, request, *args, **kwargs): response = {'message': 'You cant create Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def destroy(self, request, *args, **kwargs): response = {'message': 'You cant delete Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def list(self, request, version="v1", *args, **kwargs): # check if the version argument exists in the versions list if version in self.versions: if request.user: try: user = request.user profile = Profile.objects.get(user=user.id) serializer = ProfileSerializer(profile, many=False) response = {'message': 'User profile ', 'result': serializer.data} return Response(response, status=status.HTTP_200_OK) except IndexError: response = {'message': 'User not Authenticated! '} return Response(response, status=status.HTTP_400_BAD_REQUEST) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def retrieve(self, request, pk=None, *args, **kwargs): response = {'message': 'You cant retrieve users Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # write a custom method that uses the authToken for access privileges # pylint: disable=R0201 @action(detail=False, methods=['PUT']) def update_profile(self, request, version="v1"): # check if the version argument exists in the versions list if version in self.versions: if request.data : fetched_data = request.data user = request.user try : profile = Profile.objects.filter(user=user.id) profile.update( facebook_user=fetched_data['facebook_user'], phone=fetched_data['phone'], profile=fetched_data['profile']) get_profile = Profile.objects.get(user=user.id) serializer = EditProfileSerilizer(get_profile, many=False) response = {'message': 'User profile Updated', 'result': serializer.data} return Response(response, status=status.HTTP_200_OK) except Profile.DoesNotExist: response = {'message': 'user profile does not exit'} return Response(response, status=status.HTTP_200_OK) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) class RecoveryViewSet(viewsets.ModelViewSet): queryset = User.objects.all() #used by serializers output authentication_classes = (TokenAuthentication,) permission_classes = (AllowAny,) versions =['v1'] # pylint: disable=R0201 def update(self, request, *args, **kwargs): response = {'message': 'You cant edit your Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def list(self, request, *args, **kwargs): response = {'message': 'You cant create Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def destroy(self, request, *args, **kwargs): response = {'message': 'You cant delete Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def retrieve(self, request, pk=None, *args, **kwargs): response = {'message': 'You cant retrieve users Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) def create(self, request, version="v1", *args, **kwargs): # check if the version argument exists in the versions list if version in self.versions: if request.data : fetched_data = request.data email= fetched_data['email'] try : # check in fetch email exits user = User.objects.get(email=email) # create jwt token secret = os.getenv("SECRETKEY") # minutes=1 dt = datetime.now() + timedelta(minutes=5) encoded = jwt.encode({'email': email, 'exp': dt}, secret , algorithm='HS256') reset_link = f'{os.getenv("RESETPASS_URL")}/{encoded.decode("utf-8")}' # send an e-mail to the user context = { 'user': user, 'reset_link': reset_link } print(reset_link) msg_plain = render_to_string('../templates/password_reset_email.txt', context) msg_html = render_to_string('../templates/password_reset_email.html', context) subject = 'Debt notification account recovery request.' from_email = settings.EMAIL_HOST_USER message = msg_plain recipient_list = [email] send_mail(subject, message, from_email, recipient_list, fail_silently=False, html_message=msg_html) response= {'token': 'email sent!'} return Response(response, status=status.HTTP_200_OK) except User.DoesNotExist: response = {'message': 'No user associated with this email exits!'} return Response(response, status=status.HTTP_404_NOT_FOUND) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) @action(detail=False, methods=['POST']) def validate_token(self,request, version="v1"): if version in self.versions: if request.data : fetched_data =request.data encoded_token= fetched_data['token'] try: secret = os.getenv("SECRETKEY") jwt.decode(encoded_token, secret, leeway=10, algorithms=['HS256']) response= {'message': 'Token is still valid and active :)'} return Response(response, status=status.HTTP_200_OK) except jwt.ExpiredSignatureError: response= {'message': 'Token expired. Get new one'} return Response(response, status=status.HTTP_200_OK) except jwt.InvalidTokenError: response= {'message': 'Invalid Token'} return Response(response, status=status.HTTP_200_OK) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) @action(detail=False, methods=['POST']) def confirm(self,request, version="v1"): if version in self.versions: if request.data : try: # user token and password fetched_data =request.data encoded_token= fetched_data['token'] new_password = fetched_data['password'] secret = os.getenv("SECRETKEY") decode_token = jwt.decode(encoded_token, secret, leeway=10, algorithms=['HS256']) email = decode_token['email'] # modify existing user user = User.objects.get(email=email) user.set_password(new_password) user.save() response = {'success': 'Password reset was successful!'} return Response(response, status=status.HTTP_200_OK) except jwt.InvalidTokenError: response= {'message': 'Invalid Token'} return Response(response, status=status.HTTP_200_OK) except User.DoesNotExist: response = {'message': 'No user associated with this email exits!'} return Response(response, status=status.HTTP_200_OK) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) class RecoveryViewSet(viewsets.ModelViewSet): queryset = User.objects.all() #used by serializers output authentication_classes = (TokenAuthentication,) permission_classes = (AllowAny,) versions =['v1'] # pylint: disable=R0201 def update(self, request, *args, **kwargs): response = {'message': 'You cant edit your Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def list(self, request, *args, **kwargs): response = {'message': 'You cant create Profile like that'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def destroy(self, request, *args, **kwargs): response = {'message': 'You cant delete Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # pylint: disable=R0201 def retrieve(self, request, pk=None, *args, **kwargs): response = {'message': 'You cant retrieve users Profile like this'} return Response(response, status=status.HTTP_400_BAD_REQUEST) def create(self, request, version="v1", *args, **kwargs): # check if the version argument exists in the versions list if version in self.versions: if request.data : fetched_data = request.data email= fetched_data['email'] try : # check in fetch email exits user = User.objects.get(email=email) # create jwt token secret = os.getenv("SECRETKEY") # minutes=1 dt = datetime.now() + timedelta(minutes=1) encoded = jwt.encode({'email': email, 'exp': dt}, secret , algorithm='HS256') reset_link = f'{os.getenv("RESETPASS_URL")}/{encoded.decode("utf-8")}' # send an e-mail to the user context = { 'user': user, 'reset_link': reset_link } print(reset_link) msg_plain = render_to_string('../templates/password_reset_email.txt', context) msg_html = render_to_string('../templates/password_reset_email.html', context) subject = 'Debt notification account recovery request.' from_email = settings.EMAIL_HOST_USER message = msg_plain recipient_list = [email] send_mail(subject, message, from_email, recipient_list, fail_silently=False, html_message=msg_html) response= {'token': 'email sent!'} return Response(response, status=status.HTTP_200_OK) except User.DoesNotExist: response = {'message': 'No user associated with this email exits!'} return Response(response, status=status.HTTP_404_NOT_FOUND) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) @action(detail=False, methods=['POST']) def validate_token(self,request, version="v1"): if version in self.versions: if request.data : fetched_data =request.data encoded_token= fetched_data['token'] try: secret = os.getenv("SECRETKEY") jwt.decode(encoded_token, secret, leeway=10, algorithms=['HS256']) response= {'message': 'Token is still valid and active :)'} return Response(response, status=status.HTTP_200_OK) except jwt.ExpiredSignatureError: response= {'message': 'Token expired. Get new one'} return Response(response, status=status.HTTP_200_OK) except jwt.InvalidTokenError: response= {'message': 'Invalid Token'} return Response(response, status=status.HTTP_200_OK) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) @action(detail=False, methods=['POST']) def confirm(self,request, version="v1"): if version in self.versions: if request.data : try: # user token and password fetched_data =request.data encoded_token= fetched_data['token'] new_password = fetched_data['password'] secret = os.getenv("SECRETKEY") decode_token = jwt.decode(encoded_token, secret, leeway=10, algorithms=['HS256']) email = decode_token['email'] # modify existing user user = User.objects.get(email=email) user.set_password(new_password) user.save() response = {'success': 'Password reset was successful!'} return Response(response, status=status.HTTP_200_OK) except jwt.InvalidTokenError: response= {'message': 'Invalid Token'} return Response(response, status=status.HTTP_200_OK) except User.DoesNotExist: response = {'message': 'No user associated with this email exits!'} return Response(response, status=status.HTTP_200_OK) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) class FacebookLogin(SocialLoginView): adapter_class = FacebookOAuth2Adapter class GoogleLogin(SocialLoginView): adapter_class = GoogleOAuth2Adapter client_class = OAuth2Client class LoanViewSet(viewsets.ModelViewSet): queryset = Loan_Record.objects.all() serializer_class= LoanSerializer authentication_classes = (TokenAuthentication,) #this option is used to authenticate a user, thus django can identify the token and its owner permission_classes = (IsAuthenticated,) versions = ['v1'] def create(self, request, version="v1", *args, **kwargs): if version in self.versions : #for now the interest is flat, for personal loan tracker if request.data : request.data._mutable = True if 'interest_rate' and 'amount' in request.data : percentage = int(request.data['interest_rate'])/100 amount = int(request.data['amount']) request.data['balance_to_pay'] = (percentage * amount) + amount else: response = {'message': 'Please check if the amount and interest rate are not empty.'} return Response(response, status=status.HTTP_400_BAD_REQUEST) #update the request data with user id in runtime request.data.update({'user': request.user.id}) return super(LoanViewSet, self).create(request, *args, **kwargs) else: response = {'message': 'Please check and make sure all fields are not empty.'} return Response(response, status=status.HTTP_400_BAD_REQUEST) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) def update(self, request, version="v1", *args, **kwargs): if version in self.versions : #for now the interest is flat, for personal loan tracker if request.data : request.data._mutable = True if 'interest_rate' and 'amount' in request.data : percentage = int(request.data['interest_rate'])/100 amount = int(request.data['amount']) request.data['balance_to_pay'] = (percentage * amount) + amount else: response = {'message': 'Please check if the amount and interest rate are not empty.'} return Response(response, status=status.HTTP_400_BAD_REQUEST) #update the request data with user id in runtime request.data.update({'user': request.user.id}) return super(LoanViewSet, self).create(request, *args, **kwargs) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) # this function is used to update loan records of a user def list(self, request, version="v1", *args, **kwargs): if version in self.versions: if request.user: try: user = request.user loan_Record = Loan_Record.objects.filter(user=user.id) # profile = Profile.objects.get(user=user.id) serializer = LoanSerializer(loan_Record, many=True) response = {'message': 'User loan Records ', 'result': serializer.data} return Response(response, status=status.HTTP_200_OK) except IndexError: response = {'message': f' Hi 👋 {user.username}, you have no loan records yet 😔.'} return Response(response, status=status.HTTP_400_BAD_REQUEST) else: response = {'message': 'API version not identified!'} return Response(response, status=status.HTTP_400_BAD_REQUEST) def destroy(self, request, *args, **kwargs): try: instance = self.get_object() self.perform_destroy(instance) response = {'message': 'Loan is Deleted '} return Response(response, status=status.HTTP_200_OK) except Http404: response = {'message': 'Loan not Found!'} return Response(response , status=status.HTTP_204_NO_CONTENT) class DeleteAccount(viewsets.ModelViewSet): queryset=User.objects.all() serializer_class=DeleteAccountSerializer authentication_classes = (TokenAuthentication,) #this option is used to authenticate a user, thus django can identify the token and its owner permission_classes = (IsAuthenticated,) lookup_field = 'email' # pylint: disable=R0201 def delete(self, request, pk=None, **kwargs): request.user.delete() response = {'message': 'User has been Deleted successfully'} return Response(response, status=status.HTTP_204_NO_CONTENT)
45.468938
146
0.603641
2,370
22,689
5.657806
0.121941
0.057424
0.090238
0.114848
0.821165
0.820345
0.814304
0.805355
0.780222
0.76911
0
0.019527
0.304817
22,689
499
147
45.468938
0.83047
0.085945
0
0.799443
0
0
0.136676
0.012473
0
0
0
0
0
1
0.08078
false
0.033426
0.05571
0
0.4039
0.005571
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
7b210960ae7c71733048ba7ed8146714b0ee1029
6,248
py
Python
models.py
bubblemans/Gun-Violence-Information-Retrieval-Using-BERT-as-Sequence-Tagging-Task
a8a199760c531286ae79fd9de541387a6c9fd5a7
[ "MIT" ]
null
null
null
models.py
bubblemans/Gun-Violence-Information-Retrieval-Using-BERT-as-Sequence-Tagging-Task
a8a199760c531286ae79fd9de541387a6c9fd5a7
[ "MIT" ]
null
null
null
models.py
bubblemans/Gun-Violence-Information-Retrieval-Using-BERT-as-Sequence-Tagging-Task
a8a199760c531286ae79fd9de541387a6c9fd5a7
[ "MIT" ]
null
null
null
import torch import torch.nn as nn from torchcrf import CRF from utils import TRANSFORMER_PATH class BERT_Linear(nn.Module): def __init__(self, num_labels): super(BERT_Linear, self).__init__() config = torch.hub.load(TRANSFORMER_PATH, 'config', 'bert-base-cased') config.max_position_embeddings = 1024 self.bert = torch.hub.load(TRANSFORMER_PATH, 'model', 'bert-base-cased') self.classifier = nn.Linear(768, num_labels) def forward(self, tokens_tensor, segments_tensors, labels=None): bert_output = self.bert(tokens_tensor, token_type_ids=segments_tensors) last_hidden_state = bert_output.last_hidden_state pooler_output = bert_output.pooler_output logits = self.classifier(last_hidden_state) return logits class BERT_LSTM(nn.Module): def __init__(self, num_labels): super(BERT_LSTM, self).__init__() config = torch.hub.load(TRANSFORMER_PATH, 'config', 'bert-base-cased') config.max_position_embeddings = 1024 self.bert = torch.hub.load(TRANSFORMER_PATH, 'model', 'bert-base-cased') self.lstm = nn.LSTM(768, 768) self.classifier = nn.Linear(768, num_labels) def forward(self, tokens_tensor, segments_tensors, labels=None): bert_output = self.bert(tokens_tensor, token_type_ids=segments_tensors) last_hidden_state = bert_output.last_hidden_state pooler_output = bert_output.pooler_output lstm_out, _ = self.lstm(last_hidden_state) logits = self.classifier(lstm_out) return logits class BERT_BiLSTM(nn.Module): def __init__(self, num_labels): super(BERT_BiLSTM, self).__init__() config = torch.hub.load(TRANSFORMER_PATH, 'config', 'bert-base-cased') config.max_position_embeddings = 1024 self.bert = torch.hub.load(TRANSFORMER_PATH, 'model', 'bert-base-cased') self.lstm = nn.LSTM(768, 768, bidirectional=True) self.classifier = nn.Linear(768, num_labels) # self.classifier = nn.Linear(768 * 2, num_labels) def forward(self, tokens_tensor, segments_tensors, labels=None): bert_output = self.bert(tokens_tensor, token_type_ids=segments_tensors) last_hidden_state = bert_output.last_hidden_state pooler_output = bert_output.pooler_output lstm_out, _ = self.lstm(last_hidden_state) lstm_out = lstm_out[:, :, :768] + lstm_out[:, :, 768:] logits = self.classifier(lstm_out) return logits class BERT_CRF_Linear(nn.Module): def __init__(self, num_labels): super(BERT_CRF_Linear, self).__init__() config = torch.hub.load(TRANSFORMER_PATH, 'config', 'bert-base-cased') config.max_position_embeddings = 1024 self.bert = torch.hub.load(TRANSFORMER_PATH, 'model', 'bert-base-cased') self.classifier = nn.Linear(768, num_labels) self.CRF_model = CRF(num_labels, batch_first=True) def forward(self, tokens_tensor, segments_tensors, labels=None): bert_output = self.bert(tokens_tensor, token_type_ids=segments_tensors) last_hidden_state = bert_output.last_hidden_state pooler_output = bert_output.pooler_output logits = self.classifier(last_hidden_state) # the CRF layer of NER labels crf_loss_list = self.CRF_model(logits, labels) crf_loss = torch.mean(-crf_loss_list) crf_predict = self.CRF_model.decode(logits) # the classifier of category & polarity loss_fct = nn.CrossEntropyLoss() loss = loss_fct(logits.permute(0, 2, 1), labels) return torch.tensor(crf_predict).to('cuda'), logits, loss class BERT_CRF_LSTM(nn.Module): def __init__(self, num_labels): super(BERT_CRF_LSTM, self).__init__() config = torch.hub.load(TRANSFORMER_PATH, 'config', 'bert-base-cased') config.max_position_embeddings = 1024 self.bert = torch.hub.load(TRANSFORMER_PATH, 'model', 'bert-base-cased') self.lstm = nn.LSTM(768, 768) self.classifier = nn.Linear(768, num_labels) self.CRF_model = CRF(num_labels, batch_first=True) def forward(self, tokens_tensor, segments_tensors, labels=None): bert_output = self.bert(tokens_tensor, token_type_ids=segments_tensors) last_hidden_state = bert_output.last_hidden_state pooler_output = bert_output.pooler_output lstm_out, _ = self.lstm(last_hidden_state) logits = self.classifier(lstm_out) # the CRF layer of NER labels crf_loss_list = self.CRF_model(logits, labels) crf_loss = torch.mean(-crf_loss_list) crf_predict = self.CRF_model.decode(logits) # the classifier of category & polarity loss_fct = nn.CrossEntropyLoss() loss = loss_fct(logits.permute(0, 2, 1), labels) return torch.tensor(crf_predict).to('cuda'), logits, loss class BERT_CRF_BiLSTM(nn.Module): def __init__(self, num_labels): super(BERT_CRF_BiLSTM, self).__init__() config = torch.hub.load(TRANSFORMER_PATH, 'config', 'bert-base-cased') config.max_position_embeddings = 1024 self.bert = torch.hub.load(TRANSFORMER_PATH, 'model', 'bert-base-cased') self.lstm = nn.LSTM(768, 768, bidirectional=True) self.classifier = nn.Linear(768, num_labels) # self.classifier = nn.Linear(768 * 2, num_labels) self.CRF_model = CRF(num_labels, batch_first=True) def forward(self, tokens_tensor, segments_tensors, labels=None): bert_output = self.bert(tokens_tensor, token_type_ids=segments_tensors) last_hidden_state = bert_output.last_hidden_state pooler_output = bert_output.pooler_output lstm_out, _ = self.lstm(last_hidden_state) lstm_out = lstm_out[:, :, :768] + lstm_out[:, :, 768:] logits = self.classifier(lstm_out) # the CRF layer of NER labels crf_loss_list = self.CRF_model(logits, labels) crf_loss = torch.mean(-crf_loss_list) crf_predict = self.CRF_model.decode(logits) # the classifier of category & polarity loss_fct = nn.CrossEntropyLoss() loss = loss_fct(logits.permute(0, 2, 1), labels) return torch.tensor(crf_predict).to('cuda'), logits, loss
41.653333
80
0.68822
832
6,248
4.847356
0.088942
0.044632
0.066948
0.068435
0.972229
0.972229
0.972229
0.972229
0.972229
0.961815
0
0.019161
0.206466
6,248
150
81
41.653333
0.794272
0.047215
0
0.854545
0
0
0.043398
0
0
0
0
0
0
1
0.109091
false
0
0.036364
0
0.254545
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
9e39720d4a07ccdd150e3c018436069e6f06c301
93
py
Python
brd_mod/__init__.py
benrdavison/brd_mod
d496c5faece564f3758c25ed99a8240cde0ccf81
[ "MIT" ]
null
null
null
brd_mod/__init__.py
benrdavison/brd_mod
d496c5faece564f3758c25ed99a8240cde0ccf81
[ "MIT" ]
null
null
null
brd_mod/__init__.py
benrdavison/brd_mod
d496c5faece564f3758c25ed99a8240cde0ccf81
[ "MIT" ]
null
null
null
from brd_mod.brdstats import * from brd_mod.brdgeo import * from brd_mod.brdecon import *
23.25
31
0.774194
15
93
4.6
0.466667
0.304348
0.434783
0.463768
0
0
0
0
0
0
0
0
0.16129
93
3
32
31
0.884615
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
9e524998ae36ca3e7c5697d9ea57a99764c965b0
17,658
py
Python
tests/test_windows.py
Colin-b/pyndows
a52573c8ecf2aec0929bdb212808ae1059d2fa78
[ "MIT" ]
4
2019-12-03T20:31:42.000Z
2021-12-23T21:32:15.000Z
tests/test_windows.py
Colin-b/pyndows
a52573c8ecf2aec0929bdb212808ae1059d2fa78
[ "MIT" ]
6
2019-12-03T20:33:29.000Z
2020-04-23T23:44:21.000Z
tests/test_windows.py
Colin-b/pyndows
a52573c8ecf2aec0929bdb212808ae1059d2fa78
[ "MIT" ]
2
2020-01-31T11:29:47.000Z
2020-02-04T16:21:09.000Z
import os import os.path import pytest from smb.base import SMBTimeout from smb.smb_structs import OperationFailure import pyndows from pyndows.testing import samba_mock, SMBConnectionMock, SharedFileMock def test_successful_connection(samba_mock: SMBConnectionMock): assert ( pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) is not None ) def test_connection_failure(samba_mock: SMBConnectionMock): samba_mock.add_callback("connect", lambda *args: False) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) assert ( str(exception_info.value) == r"Impossible to connect to TestComputer (127.0.0.1:80), check connectivity or TestDomain\TestUser rights." ) def test_connection_timeout(samba_mock: SMBConnectionMock): def raise_failure(*args): raise TimeoutError() samba_mock.add_callback("connect", raise_failure) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) assert ( str(exception_info.value) == r"Impossible to connect to TestComputer (127.0.0.1:80), check connectivity or TestDomain\TestUser rights." ) def test_file_retrieval(samba_mock: SMBConnectionMock, tmpdir): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/TestFilePath").write_text("Test Content") pyndows.get( connection, "TestShare", "/TestFilePath", os.path.join(tmpdir, "local_file") ) with open(os.path.join(tmpdir, "local_file")) as local_file: assert local_file.read() == "Test Content" def test_operation_failure_during_file_retrieval(samba_mock: SMBConnectionMock, tmpdir): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.get( connection, "TestShare", "/TestFilePath", os.path.join(tmpdir, "local_file") ) assert ( str(exception_info.value) == r"Unable to retrieve \\TestComputer\TestShare/TestFilePath file" ) def test_file_move(samba_mock: SMBConnectionMock, tmpdir): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") pyndows.move( connection, "TestShare", "/TestFilePath", os.path.join(tmpdir, "local_file") ) assert ( samba_mock.path("TestShare", "/TestFilePath").read_text() == "Test Content Move" ) def test_file_move_with_folder_creation(samba_mock: SMBConnectionMock, tmpdir): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") pyndows.move( connection, "TestShare", "/Folder1/Folder2/Folder3/TestFilePath", os.path.join(tmpdir, "local_file"), ) assert ( samba_mock.path( "TestShare", "/Folder1/Folder2/Folder3/TestFilePath" ).read_text() == "Test Content Move" ) def test_file_move_with_last_folder_creation(samba_mock: SMBConnectionMock, tmpdir): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") samba_mock.path("TestShare", "/Folder1/Folder2").mkdir(parents=True) pyndows.move( connection, "TestShare", "/Folder1/Folder2/Folder3/TestFilePath", os.path.join(tmpdir, "local_file"), ) assert ( samba_mock.path( "TestShare", "/Folder1/Folder2/Folder3/TestFilePath" ).read_text() == "Test Content Move" ) def test_file_move_with_last_folder_creation_failure( samba_mock: SMBConnectionMock, tmpdir ): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") samba_mock.path("TestShare", "/Folder1/Folder2").mkdir(parents=True) def raise_failure(*args): raise OperationFailure("Unable to create directory", []) samba_mock.add_callback("createDirectory", raise_failure) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.move( connection, "TestShare", "/Folder1/Folder2/Folder3/TestFilePath", os.path.join(tmpdir, "local_file"), ) assert ( str(exception_info.value) == r"Unable to write \\TestComputer\TestShare/Folder1/Folder2/Folder3/TestFilePath.tmp" ) def test_store_file_operation_failure_during_file_move( samba_mock: SMBConnectionMock, tmpdir ): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") def raise_failure(*args): raise OperationFailure("Mock for storeFile failure.", []) samba_mock.add_callback("storeFile", raise_failure) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.move( connection, "TestShare", "/TestFilePath", os.path.join(tmpdir, "local_file") ) assert ( str(exception_info.value) == r"Unable to write \\TestComputer\TestShare/TestFilePath.tmp" ) def test_smbtimeout_failure_during_storefile(samba_mock: SMBConnectionMock, tmpdir): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") def raise_failure(*args): raise SMBTimeout() samba_mock.add_callback("storeFile", raise_failure) with pytest.raises(SMBTimeout): pyndows.move( connection, "TestShare", "/TestFilePath", os.path.join(tmpdir, "local_file") ) def test_rename_operation_failure_during_file_move( samba_mock: SMBConnectionMock, tmpdir ): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with open(os.path.join(tmpdir, "local_file"), mode="w") as distant_file: distant_file.write("Test Content Move") def raise_failure(*args): raise OperationFailure("Mock for rename failure.", []) samba_mock.add_callback("rename", raise_failure) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.move( connection, "TestShare", "/TestFilePath", os.path.join(tmpdir, "local_file") ) assert ( str(exception_info.value) == r"Unable to rename temp file into \\TestComputer\TestShare/TestFilePath" ) def test_file_rename(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/file_to_rename").write_text("Test Rename") pyndows.rename(connection, "TestShare", "/file_to_rename", "/file_new_name") assert not samba_mock.path("TestShare", "/file_to_rename").exists() assert samba_mock.path("TestShare", "/file_new_name").read_text() == "Test Rename" def test_rename_operation_failure_during_file_rename(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/file_to_rename").write_text("Test Rename") def raise_failure(*args): raise OperationFailure("Mock for rename failure.", []) samba_mock.add_callback("rename", raise_failure) with pytest.raises(pyndows.PyndowsException) as exception_info: pyndows.rename(connection, "TestShare", "/file_to_rename", "/file_new_name") assert ( str(exception_info.value) == r"Unable to rename \\TestComputer\TestShare/file_to_rename into \\TestComputer\TestShare/file_new_name" ) def test_file_rename_file_does_not_exist(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) with pytest.raises(FileNotFoundError) as exception_info: pyndows.rename(connection, "TestShare", "/file_to_rename_2", "/file_new_name") assert ( str(exception_info.value) == r"\\TestComputer\TestShare/file_to_rename_2 doesn't exist" ) def test_get_all_folder_contents(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") samba_mock.path("TestShare", "/A").mkdir() samba_mock.path("TestShare", "/A/1").write_text("Test Find") samba_mock.path("TestShare", "/A/2").write_text("Test Find") samba_mock.path("TestShare", "/A/3").write_text("Test Find") samba_mock.path("TestShare", "/A/i").mkdir() samba_mock.path("TestShare", "/A/i/1").write_text("Test Find") samba_mock.path("TestShare", "/A/i/2").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="/A" ) assert shared_folder_contents == [ SharedFileMock(filename="1", isDirectory=False), SharedFileMock(filename="2", isDirectory=False), SharedFileMock(filename="3", isDirectory=False), SharedFileMock(filename="i", isDirectory=True), ] def test_get_all_sub_folder_contents(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") samba_mock.path("TestShare", "/A").mkdir() samba_mock.path("TestShare", "/A/1").write_text("Test Find") samba_mock.path("TestShare", "/A/2").write_text("Test Find") samba_mock.path("TestShare", "/A/3").write_text("Test Find") samba_mock.path("TestShare", "/A/i").mkdir() samba_mock.path("TestShare", "/A/i/1").write_text("Test Find") samba_mock.path("TestShare", "/A/i/2").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="/A/i" ) assert shared_folder_contents == [ SharedFileMock(filename="1", isDirectory=False), SharedFileMock(filename="2", isDirectory=False), ] def test_get_all_folder_contents_empty_folder(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="/A" ) assert shared_folder_contents == [] def test_get_all_folder_contents_empty_shared_folder(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="" ) assert shared_folder_contents == [] def test_get_all_folder_contents_non_existing_folder(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="/B" ) assert shared_folder_contents == [] def test_get_all_folder_contents_non_existing_shared_folder( samba_mock: SMBConnectionMock, ): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "AnotherTestShare", folder_path="" ) assert shared_folder_contents == [] def test_get_all_folder_contents_excluding_directories(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") samba_mock.path("TestShare", "/A").mkdir() samba_mock.path("TestShare", "/A/1").write_text("Test Find") samba_mock.path("TestShare", "/A/2").write_text("Test Find") samba_mock.path("TestShare", "/A/3").write_text("Test Find") samba_mock.path("TestShare", "/A/i").mkdir() samba_mock.path("TestShare", "/A/i/1").write_text("Test Find") samba_mock.path("TestShare", "/A/i/2").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="/A", include_folders=False ) assert shared_folder_contents == [ SharedFileMock(filename="1", isDirectory=False), SharedFileMock(filename="2", isDirectory=False), SharedFileMock(filename="3", isDirectory=False), ] def test_get_all_folder_contents_matching_a_pattern(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") samba_mock.path("TestShare", "/A").mkdir() samba_mock.path("TestShare", "/A/1").write_text("Test Find") samba_mock.path("TestShare", "/A/12").write_text("Test Find") samba_mock.path("TestShare", "/A/3").write_text("Test Find") samba_mock.path("TestShare", "/A/i").mkdir() samba_mock.path("TestShare", "/A/i/1").write_text("Test Find") samba_mock.path("TestShare", "/A/1i").mkdir() samba_mock.path("TestShare", "/A/1i/2").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="/A", pattern="1*" ) assert shared_folder_contents == [ SharedFileMock(filename="1", isDirectory=False), SharedFileMock(filename="12", isDirectory=False), SharedFileMock(filename="1i", isDirectory=True), ] def test_get_all_folder_contents_matching_a_pattern_with_question_mark_wildcard( samba_mock: SMBConnectionMock, ): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/test_12345_test").write_text("Test Find") samba_mock.path("TestShare", "/test_123456_test").write_text("Test Find") samba_mock.path("TestShare", "/test_123_test").write_text("Test Find") samba_mock.path("TestShare", "/test_1234M_test").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", pattern="test_?????_test" ) assert shared_folder_contents == [ SharedFileMock(filename="test_12345_test", isDirectory=False), SharedFileMock(filename="test_1234M_test", isDirectory=False), ] def test_get_all_shared_folder_contents(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/1").write_text("Test Find") samba_mock.path("TestShare", "/A").mkdir() samba_mock.path("TestShare", "/A/1").write_text("Test Find") samba_mock.path("TestShare", "/A/2").write_text("Test Find") samba_mock.path("TestShare", "/A/3").write_text("Test Find") samba_mock.path("TestShare", "/A/i").mkdir() samba_mock.path("TestShare", "/A/i/1").write_text("Test Find") samba_mock.path("TestShare", "/A/i/2").write_text("Test Find") shared_folder_contents = pyndows.get_folder_content( connection, "TestShare", folder_path="" ) assert shared_folder_contents == [ SharedFileMock(filename="1", isDirectory=False), SharedFileMock(filename="A", isDirectory=True), ] def test_get_file_desc_file_exists(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/file_to_find").write_text("Test Find") file = pyndows.get_file_desc(connection, "TestShare", "/file_to_find") assert file.filename == "file_to_find" def test_get_file_desc_file_does_not_exist(samba_mock: SMBConnectionMock): connection = pyndows.connect( "TestComputer", "127.0.0.1", 80, "TestDomain", "TestUser", "TestPassword" ) samba_mock.path("TestShare", "/file_to_find").write_text("Test Find") assert pyndows.get_file_desc(connection, "TestShare", "/non_existing") is None
35.457831
117
0.679352
2,078
17,658
5.544273
0.065929
0.073431
0.066574
0.112664
0.898099
0.876139
0.848451
0.840465
0.835257
0.817464
0
0.02284
0.176804
17,658
497
118
35.529175
0.769744
0
0
0.622691
0
0.005277
0.255408
0.027353
0
0
0
0
0.07124
1
0.087071
false
0.07124
0.01847
0
0.105541
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
9ead613014167971ddc01e83e17191092beb1a2a
259
py
Python
exoctk/setup_package.py
nespinoza/exoctk
bb50f592c1143195ee20b4a838ce39c0522d3216
[ "BSD-3-Clause" ]
21
2018-10-28T09:44:30.000Z
2021-06-10T18:33:16.000Z
exoctk/setup_package.py
nespinoza/exoctk
bb50f592c1143195ee20b4a838ce39c0522d3216
[ "BSD-3-Clause" ]
358
2018-10-19T19:02:21.000Z
2022-02-22T19:15:34.000Z
exoctk/setup_package.py
nespinoza/exoctk
bb50f592c1143195ee20b4a838ce39c0522d3216
[ "BSD-3-Clause" ]
8
2018-11-13T16:47:07.000Z
2020-08-18T18:37:19.000Z
def get_package_data(): return {'exoctk': ['data/*', 'data/images/*', 'data/core/*', 'data/core/modelgrid/*', 'data/contam_visibility/*', 'exoctk_app/static/images/*', 'exoctk_app/static/css/*', 'exoctk_app/static/js/*', 'exoctk_app/static/js/vendor/*']}
86.333333
234
0.671815
34
259
4.911765
0.470588
0.215569
0.359281
0.203593
0
0
0
0
0
0
0
0
0.065637
259
2
235
129.5
0.690083
0
0
0
0
0
0.698842
0.559846
0
0
0
0
0
1
0.5
true
0
0
0.5
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
1
null
0
0
0
0
0
1
1
0
0
1
1
0
0
11
7b5676201d618dda901f38fee7c10f2b7d9bb8b4
4,230
py
Python
tests/mutate/test_rests_to_multimeasure_rest.py
gilbertohasnofb/auxjad
553b7fe97221b6f378a93ade6262f024e3cbc678
[ "MIT" ]
6
2020-05-18T09:28:29.000Z
2021-12-22T00:40:54.000Z
tests/mutate/test_rests_to_multimeasure_rest.py
gilbertohasnofb/auxjad
553b7fe97221b6f378a93ade6262f024e3cbc678
[ "MIT" ]
1
2021-04-21T20:29:38.000Z
2021-04-22T19:44:54.000Z
tests/mutate/test_rests_to_multimeasure_rest.py
gilbertohasnofb/auxjad
553b7fe97221b6f378a93ade6262f024e3cbc678
[ "MIT" ]
1
2021-04-21T18:54:46.000Z
2021-04-21T18:54:46.000Z
import abjad import auxjad def test_rests_to_multimeasure_rest_01(): staff = abjad.Staff(r"r1") auxjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 } """ ) def test_rests_to_multimeasure_rest_02(): staff = abjad.Staff(r"r2 r8.. r32 r16 r8 r16") auxjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 } """ ) def test_rests_to_multimeasure_rest_03(): staff = abjad.Staff( r"\time 3/4 r2. | \time 6/8 r2. | \time 5/4 c'1 ~ c'4 | r1 r4" ) auxjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { \time 3/4 R1 * 3/4 \time 6/8 R1 * 3/4 \time 5/4 c'1 ~ c'4 R1 * 5/4 } """ ) def test_rests_to_multimeasure_rest_04(): staff = abjad.Staff(r"\times 2/3 {r2 r2 r2}") auxjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 } """ ) staff = abjad.Staff( r"r2 \times 2/3 {r2 r4} \times 4/5 {r2. \times 2/3 {r2 r4}}" ) auxjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 R1 } """ ) def test_rests_to_multimeasure_rest_05(): staff = abjad.Staff( r"r2 \times 2/3 {r2 r4} \times 4/5 {r2. \times 2/3 {r2 r4}}" ) auxjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 R1 } """ ) def test_rests_to_multimeasure_rest_06(): staff = abjad.Staff(r"r2 r8.. r32 r16 r8 r16") abjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 } """ ) def test_rests_to_multimeasure_rest_07(): staff = abjad.Staff( r"\clef bass r4 r4 \times 2/3 {r4 r8} r4 " r"\time 3/4 \clef treble r2. " r"\time 5/4 r2 \clef bass r2." ) abjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { \clef "bass" R1 \time 3/4 \clef "treble" R1 * 3/4 \time 5/4 \clef "bass" R1 * 5/4 } """ ) staff = abjad.Staff( r"\clef bass r4 r4 \times 2/3 {r4 r8} r4 " r"\time 3/4 \clef treble r2. " r"\time 5/4 r2 \clef bass r2." ) abjad.mutate.rests_to_multimeasure_rest(staff[:], ignore_clefs=True) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { R1 \time 3/4 R1 * 3/4 \time 5/4 R1 * 5/4 } """ ) def test_rests_to_multimeasure_rest_08(): staff = abjad.Staff(r"c'1\p\< r2\! r2 d'1\f\> r2 r2\ppp") abjad.mutate.rests_to_multimeasure_rest(staff[:]) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { c'1 \p \< R1 \! d'1 \f \> R1 \ppp } """ ) staff = abjad.Staff(r"c'1\p\< r2\! r2 d'1\f\> r2 r2\ppp") abjad.mutate.rests_to_multimeasure_rest(staff[:], ignore_dynamics=True) assert abjad.lilypond(staff) == abjad.String.normalize( r""" \new Staff { c'1 \p \< R1 d'1 \f \> R1 } """ )
22.380952
75
0.478723
514
4,230
3.793774
0.101167
0.112821
0.185128
0.224103
0.918974
0.910769
0.887692
0.873333
0.85641
0.85641
0
0.066875
0.395508
4,230
188
76
22.5
0.695737
0
0
0.468354
0
0.037975
0.176597
0
0
0
0
0
0.139241
1
0.101266
false
0
0.025316
0
0.126582
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
c8bcf3d1c322aa7a31c844aff454238ba440565e
168
py
Python
ex3.py
vitorsergiota/python
2cc95392a2a52a871e0582e4e900c0aa24a021a1
[ "MIT" ]
null
null
null
ex3.py
vitorsergiota/python
2cc95392a2a52a871e0582e4e900c0aa24a021a1
[ "MIT" ]
null
null
null
ex3.py
vitorsergiota/python
2cc95392a2a52a871e0582e4e900c0aa24a021a1
[ "MIT" ]
null
null
null
#so sai quando escrever sair nome = str(input("Escreva nome :(sair para terminar)")) while nome != "sair": nome = str(input("Escreva nome: (sair para terminar)"))
28
59
0.678571
24
168
4.75
0.5
0.210526
0.192982
0.280702
0.754386
0.754386
0.754386
0.754386
0.754386
0
0
0
0.166667
168
5
60
33.6
0.814286
0.160714
0
0.666667
0
0
0.517986
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
c8c1580762aa5748ebfd55ca00a08bbd0018a082
15,519
py
Python
test/common/test_convert.py
xhajnal/DiPS
2e5d6e0a26d2b1cd44522dc521992e6d7cfe6883
[ "BSD-3-Clause" ]
4
2020-04-25T22:29:43.000Z
2022-01-14T07:52:55.000Z
test/common/test_convert.py
xhajnal/DiPS
2e5d6e0a26d2b1cd44522dc521992e6d7cfe6883
[ "BSD-3-Clause" ]
64
2020-01-06T18:38:56.000Z
2022-02-27T18:38:45.000Z
test/common/test_convert.py
xhajnal/DiPS
2e5d6e0a26d2b1cd44522dc521992e6d7cfe6883
[ "BSD-3-Clause" ]
3
2020-02-13T16:46:54.000Z
2021-11-26T11:47:56.000Z
import unittest import sympy from src.common.convert import * class MyTestCase(unittest.TestCase): def test_parse_numbers(self): print(colored("Checking parsers of numbers from string", 'blue')) self.assertEqual(parse_numbers("h3110 23 cat 444.4 rabbit 11 2 dog"), [3110, 23, 444.4, 11, 2]) self.assertEqual(parse_numbers('hello 42 I\'m a 32 string 30'), [42, 32, 30]) self.assertEqual(parse_numbers('hello 8e-7 holario'), [8e-7]) self.assertEqual(parse_numbers('hello8e-7holario'), [8e-7]) self.assertEqual(parse_numbers("Time for model construction: 0.262 seconds."), [0.262]) self.assertEqual(parse_numbers('Time for model input parsing: 0.006s.'), [0.006]) self.assertEqual(parse_numbers('Time for model input parsing: 0.006s .9'), [0.006, 0.9]) self.assertEqual(parse_numbers('Time for model input parsing: 0.006s.9'), [0.006, 9]) def test_to_sympy_intervals(self): print(colored("Checking conversion from a list of pairs/lists to list of Intervals", 'blue')) self.assertEqual(to_sympy_intervals([[2, 3]]), [Interval(2, 3)]) self.assertEqual(to_sympy_intervals([[2, 3]]), [Interval(2, 3)]) self.assertEqual(to_sympy_intervals([(2, 3)]), [Interval(2, 3)]) self.assertEqual(to_sympy_intervals([[2, 3], (4, 5)]), [Interval(2, 3), Interval(4, 5)]) self.assertEqual(to_sympy_intervals([(2, 3), [4, 5]]), [Interval(2, 3), Interval(4, 5)]) self.assertEqual(to_sympy_intervals([(2, 3), (4, 5)]), [Interval(2, 3), Interval(4, 5)]) def test_ineq_to_constraints(self): print(colored("Checking conversion from a list of inequalities to list of properties", 'blue')) self.assertEqual(ineq_to_constraints(["x+3"], [[0, 1]], decoupled=True), ["x+3 >= 0", "x+3 <= 1"]) self.assertEqual(ineq_to_constraints(["x", "2*x"], [Interval(0, 1), Interval(0, 2)], decoupled=True), ['x >= 0', 'x <= 1', '2*x >= 0', '2*x <= 2']) ## No intervals with self.assertRaises(Exception) as context: ineq_to_constraints(["x+3"], [], decoupled=True) self.assertTrue("Constraints cannot be computed" in str(context.exception)) self.assertEqual(ineq_to_constraints(["x+3"], [[0, 1]], decoupled=False), ["0 <= x+3 <= 1"], ) self.assertEqual(ineq_to_constraints(["x", "2*x"], [Interval(0, 1), Interval(0, 2)], decoupled=False), ['0 <= x <= 1', '0 <= 2*x <= 2']) ## No intervals with self.assertRaises(Exception) as context: ineq_to_constraints(["x+3"], [], decoupled=False) self.assertTrue("Constraints cannot be computed" in str(context.exception)) ## Bad intervals with self.assertRaises(Exception) as context: ineq_to_constraints(["x"], [Interval(3, 2)]) print(context.exception) self.assertTrue('Some intervals are incorrect' in str(context.exception)) with self.assertRaises(Exception) as context: ineq_to_constraints(["x"], [Interval(2, 2)]) self.assertTrue('Some intervals are incorrect' in str(context.exception)) def test_ineq_to_constraints_with_sympy(self): print(colored("Checking conversion from a list of inequalities to list of properties with sympy", 'blue')) self.assertEqual(ineq_to_constraints([sympy.factor("x+3")], [[0, 1]], decoupled=True), [sympy.factor("x+3 >= 0"), sympy.factor("x+3 <= 1")]) self.assertEqual(ineq_to_constraints([sympy.factor("x"), sympy.factor("2*x")], [Interval(0, 1), Interval(0, 2)], decoupled=True), [sympy.factor('x >= 0'), sympy.factor('x <= 1'), sympy.factor('2*x >= 0'), sympy.factor('2*x <= 2')]) ## No intervals with self.assertRaises(Exception) as context: ineq_to_constraints([sympy.factor("x+3")], [], decoupled=True) self.assertTrue("Constraints cannot be computed" in str(context.exception)) self.assertTrue("does not correspond" in str(context.exception)) self.assertEqual(ineq_to_constraints([sympy.factor("x+3")], [[0, 1]], decoupled=False), [sympy.factor("x+3 >= 0"), sympy.factor("x+3 <= 1")]) self.assertEqual(ineq_to_constraints([sympy.factor("x"), sympy.factor("2*x")], [Interval(0, 1), Interval(0, 2)], decoupled=False), [sympy.factor('x >= 0'), sympy.factor('x <= 1'), sympy.factor('2*x >= 0'), sympy.factor('2*x <= 2')]) ## No intervals with self.assertRaises(Exception) as context: ineq_to_constraints([sympy.factor("x+3")], [], decoupled=False) self.assertTrue("Constraints cannot be computed" in str(context.exception)) self.assertTrue("does not correspond" in str(context.exception)) ## Bad intervals with self.assertRaises(Exception) as context: ineq_to_constraints([sympy.factor("x")], [Interval(3, 2)]) print(context.exception) self.assertTrue('Some intervals are incorrect' in str(context.exception)) with self.assertRaises(Exception) as context: ineq_to_constraints([sympy.factor("x")], [Interval(2, 2)]) self.assertTrue('Some intervals are incorrect' in str(context.exception)) def test_constraints_to_ineq(self): print(colored("Checking conversion from a list properties to a list of inequalities", 'blue')) self.assertEqual(constraints_to_ineq(["x+3>=0", "x+3<=1"]), (["x+3"], [Interval(0, 1)])) self.assertEqual(constraints_to_ineq(['x>=0', 'x<=1', '2*x>=0', '2*x<=2']), (["x", "2*x"], [Interval(0, 1), Interval(0, 2)])) ## Properties not in a form of inequalities # self.assertEqual(constraints_to_ineq(["x+3>=0", "x+4<=1"]), False) with self.assertRaises(Exception) as context: constraints_to_ineq(["x+3"]) self.assertTrue("Number of properties is not even, some interval will be invalid" in context.exception) with self.assertRaises(Exception) as context: constraints_to_ineq(["x+3>=0", "x+4<=1"]) self.assertTrue("does not have proper number of boundaries" in context.exception) def test_decouple_constraint(self): print(colored("Checking decoupling of constraints", 'blue')) with self.assertRaises(Exception) as context: decouple_constraint("0.706726790611575 - (r_0 - r_1)**3 + 0.893273209388426") self.assertTrue('No' in str(context.exception)) self.assertEqual(decouple_constraint("0.706726790611575 <= -(r_0 - r_1)**3"), ["0.706726790611575 <= -(r_0 - r_1)**3"]) self.assertEqual(decouple_constraint("0.706726790611575 <= -(r_0 - r_1)**3 <= 0.893273209388426"), ['0.706726790611575 <= -(r_0 - r_1)**3', '-(r_0 - r_1)**3 <= 0.893273209388426']) with self.assertRaises(Exception) as context: decouple_constraint("0.706726790611575 <= -(r_0 - r_1)**3 <= 0.893273 = 209388426") self.assertTrue('More than two' in str(context.exception)) def test_decouple_constraints(self): print(colored("Checking decoupling of constraints", 'blue')) with self.assertRaises(Exception) as context: decouple_constraints(["0.706726790611575 - (r_0 - r_1)**3 + 0.893273209388426"]) self.assertTrue('No' in str(context.exception)) self.assertEqual(decouple_constraints(["0.706726790611575 <= -(r_0 - r_1)**3"]), ["0.706726790611575 <= -(r_0 - r_1)**3"]) self.assertEqual(decouple_constraints(["0.706726790611575 <= -(r_0 - r_1)**3 <= 0.893273209388426"]), ['0.706726790611575 <= -(r_0 - r_1)**3', '-(r_0 - r_1)**3 <= 0.893273209388426']) with self.assertRaises(Exception) as context: decouple_constraints(["0.706726790611575 <= -(r_0 - r_1)**3 <= 0.893273 = 209388426"]) self.assertTrue('More than two' in str(context.exception)) def test_add_white_spaces(self): print(colored("Checking adding space in between <, = and <=", 'blue')) self.assertEqual(add_white_spaces("0.270794145078059 >= p*q >= 0.129205854921941"), "0.270794145078059 >= p*q >= 0.129205854921941") self.assertEqual(add_white_spaces("0.270794145078059>=p*q>=0.129205854921941"), "0.270794145078059 >= p*q >= 0.129205854921941") self.assertEqual(add_white_spaces("p*q>=0.129205854921941"), "p*q >= 0.129205854921941") self.assertEqual(add_white_spaces("0.270794145078059>=p*q"), "0.270794145078059 >= p*q") ## TODO add more tests def test_normalise_constraint(self): print(colored("Checking normalising constraints", 'blue')) self.assertEqual(normalise_constraint("0.2 >= p+q/8 >= 0.1"), "0.1 <= p+q/8 <= 0.2") self.assertEqual(normalise_constraint("0.2 >= p+q/8"), "p+q/8 <= 0.2") self.assertEqual(normalise_constraint("0.2 >= p+q/8 > 0.1"), "0.1 < p+q/8 <= 0.2") self.assertEqual(normalise_constraint("0.2 > p+q/8 >= 0.1"), "0.1 <= p+q/8 < 0.2") self.assertEqual(normalise_constraint("0.2 > p+q/8 > 0.1"), "0.1 < p+q/8 < 0.2") self.assertEqual(normalise_constraint("0.2 >= p+q/8"), "p+q/8 <= 0.2") self.assertEqual(normalise_constraint("0.2 = p+q/8"), "p+q/8 = 0.2") ## TODO add more tests def test_put_exp_left(self): print(colored("Checking alligning the expression to the left side", 'blue')) self.assertEqual(put_exp_left("0.2 > p"), "p < 0.2") self.assertEqual(put_exp_left("0.2 < p"), "p > 0.2") self.assertEqual(put_exp_left("0.2 >= p"), "p <= 0.2") self.assertEqual(put_exp_left("0.2 <= p"), "p >= 0.2") self.assertEqual(put_exp_left("0.2 = p"), "p = 0.2") self.assertEqual(put_exp_left("p < 0.2"), "p < 0.2") self.assertEqual(put_exp_left("p > 0.2"), "p > 0.2") self.assertEqual(put_exp_left("p = 0.2"), "p = 0.2") self.assertEqual(put_exp_left("p <= 0.2"), "p <= 0.2") self.assertEqual(put_exp_left("p >= 0.2"), "p >= 0.2") def test_split_constraints(self): print(colored("Checking splitting constraints", 'blue')) self.assertEqual(split_constraints(["0.7 <= p+q < 0.8"]), [["0.7", "p+q", "0.8"]]) self.assertEqual(split_constraints(["0.7 < p+q < 0.8"]), [["0.7", "p+q", "0.8"]]) self.assertEqual(split_constraints(["0.7 < p+q"]), [["0.7", "p+q", None]]) self.assertEqual(split_constraints(["0.7 > p+q < 0.8"]), [["0.7", "p+q", "0.8"]]) self.assertEqual(split_constraints(["0.7 > p+q"]), [["0.7", "p+q", None]]) self.assertEqual(split_constraints(["0.7 <= p+q < 0.8"]), [["0.7", "p+q", "0.8"]]) self.assertEqual(split_constraints(["0.7 <= p+q"]), [["0.7", "p+q", None]]) self.assertEqual(split_constraints(["0.7 >= p+q < 0.8"]), [["0.7", "p+q", "0.8"]]) self.assertEqual(split_constraints(["0.7 >= p+q"]), [["0.7", "p+q", None]]) self.assertEqual(split_constraints(["0.7 = p+q < 0.8"]), [["0.7", "p+q", "0.8"]]) self.assertEqual(split_constraints(["0.7 = p+q"]), [["0.7", "p+q", None]]) def test_split_constraint(self): print(colored("Checking splitting single constraint", 'blue')) self.assertEqual(split_constraint("0.7 < p+q < 0.8"), ["0.7", "p+q", "0.8"]) self.assertEqual(split_constraint("0.7 < p+q"), ["0.7", "p+q", None]) self.assertEqual(split_constraint("p+q < 0.7"), [None, "p+q", "0.7"]) self.assertEqual(split_constraint("0.7 > p+q < 0.8"), ["0.7", "p+q", "0.8"]) self.assertEqual(split_constraint("0.7 > p+q"), ["0.7", "p+q", None]) self.assertEqual(split_constraint("p+q > 0.7"), [None, "p+q", "0.7"]) self.assertEqual(split_constraint("0.7 <= p+q < 0.8"), ["0.7", "p+q", "0.8"]) self.assertEqual(split_constraint("0.7 <= p+q"), ["0.7", "p+q", None]) self.assertEqual(split_constraint("p+q <= 0.7"), [None, "p+q", "0.7"]) self.assertEqual(split_constraint("0.7 >= p+q < 0.8"), ["0.7", "p+q", "0.8"]) self.assertEqual(split_constraint("0.7 >= p+q"), ["0.7", "p+q", None]) self.assertEqual(split_constraint("p+q >= 0.7"), [None, "p+q", "0.7"]) self.assertEqual(split_constraint("0.7 = p+q < 0.8"), ["0.7", "p+q", "0.8"]) self.assertEqual(split_constraint("0.7 = p+q"), ["0.7", "p+q", None]) self.assertEqual(split_constraint("p+q = 0.7"), [None, "p+q", "0.7"]) self.assertEqual(split_constraint("p < q"), [None, "p", "q"]) self.assertEqual(split_constraint("l > m"), [None, "l", "m"]) def test_parse_interval_bounds(self): print(colored("Checking parsing of interval bounds", 'blue')) self.assertEqual(parse_interval_bounds("0.7<p"), [[0.7, None]]) self.assertEqual(parse_interval_bounds("p<0.8"), [[None, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8"), [[0.7, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<p<=0.8"), [[0.7, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<=p<0.8"), [[0.7, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<=p<=0.8"), [[0.7, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8,"), [[0.7, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8;"), [[0.7, 0.8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8, 7<q<8"), [[0.7, 0.8], [7, 8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8,7<q<8"), [[0.7, 0.8], [7, 8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8; 7<q<8"), [[0.7, 0.8], [7, 8]]) self.assertEqual(parse_interval_bounds("0.7<p<0.8;7<q<8"), [[0.7, 0.8], [7, 8]]) self.assertEqual(parse_interval_bounds('0.0<=p1<=1.0'), [[0.0, 1.0]]) def test_parse_param_from_interval_bounds(self): self.assertEqual(parse_interval_bounds("0.7<p", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("p<0.8", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<p<=0.8", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<=p<0.8", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<=p<=0.8", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8,", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8;", parse_param=True), ["p"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8, 7<q<8", parse_param=True), ["p", "q"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8,7<q<8", parse_param=True), ["p", "q"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8; 7<q<8", parse_param=True), ["p", "q"]) self.assertEqual(parse_interval_bounds("0.7<p<0.8;7<q<8", parse_param=True), ["p", "q"]) self.assertEqual(parse_interval_bounds('0.0<=p1<=1.0', parse_param=True), ["p1"]) def test_to_interval(self): print(colored("Checking transformation of a set of points into a set of intervals here", 'blue')) self.assertEqual(to_interval([[0, 5]]), [[0, 0], [5, 5]]) self.assertEqual(to_interval([(0, 2), (1, 3)]), [[0, 1], [2, 3]]) self.assertEqual(to_interval([(0, 0, 0), (1, 0, 0), (1, 2, 0), (0, 2, 0), (0, 2, 3), (0, 0, 3), (1, 0, 3), (1, 2, 3)]), [[0, 1], [0, 2], [0, 3]]) self.assertEqual(to_interval([(0, 2), (1, 3), (4, 5)]), [[0, 4], [2, 5]]) self.assertEqual(to_interval([(0, 2, 9), (1, 5, 0), (4, 3, 6)]), [[0, 4], [2, 5], [0, 9]]) if __name__ == '__main__': unittest.main()
62.076
239
0.607836
2,330
15,519
3.927897
0.066524
0.178649
0.020979
0.018357
0.867133
0.832059
0.813374
0.805944
0.785074
0.759615
0
0.100142
0.184097
15,519
249
240
62.325301
0.62265
0.014627
0
0.263158
0
0.421053
0.245089
0.005566
0
0
0
0.004016
0.726316
1
0.078947
false
0
0.015789
0
0.1
0.084211
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
c8cb290947ce69cf315006085e29d4d4e8c46f53
24,140
py
Python
griAK_LayoutBuilder.py
vincseize/MG
bceae7d11f6e93426f14b6f6596078a3f6104472
[ "MIT" ]
null
null
null
griAK_LayoutBuilder.py
vincseize/MG
bceae7d11f6e93426f14b6f6596078a3f6104472
[ "MIT" ]
null
null
null
griAK_LayoutBuilder.py
vincseize/MG
bceae7d11f6e93426f14b6f6596078a3f6104472
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ''' Some Tools for Pip-In - Verbose Documentation ''' # ################################################################################## # MG ILLUMINATION # # First Crazy Debroussailleur : jDepoortere # # Author : cPOTTIER # # Last Update : 27-06-2016 # # ################################################################################## #================================================================================================================================== PRIMARY CLASS import sys, ink.proto path_modules = '/u/'+ink.io.ConnectUserInfo()[2]+'/Users/COM/InK/Scripts/Python/proj/pipe/ink/exemples' sys.path.append(path_modules) if '__InK__connect' in sys.modules: del(sys.modules["__InK__connect"]) import __InK__connect from __InK__connect import * else: import __InK__connect from __InK__connect import * #==================================================================================================================== Ink external useful CLASSES __PIPEIN_GRAPH = __InK__connect.__PIPEIN_GRAPH__(graphs.DEFAULT, None) # protograph, verbose mode #================================================================================================================================================ # =========================================================================================================================== AK02_LAYOUT_BuildCameraModel def AK02_LAYOUT_BuildCameraModel(autoload='True',autosave='True',save_private='False',cat='MAIN',all_cats='True',_cat=None): ''' | / | \ Tool - Last update 27-06-2016 ---------------------------------------------------------------------- - Organize MODEL Context Layout - autosave graphs in : MODELING/CHARS/MODTECH/ -> M_MAIN.inkGraph -> M_SECONDARY.inkGraph -> M_TERTIARY.inkGraph - Auto Execution or Select CAMERA-Actor_ModChars-Ok.a7 ---------------------------------------------------------------------- todo : - release gestion filters = None - r&d : check len name for ecart auto optimal ''' # PARAMS MODIFIABLES ############################################################################################ A7refPos_X = None # X origin a7 ref - None for not Used A7refPos_Y = None # Y origin a7 ref - None for not Used offset_X = 6 # 4 # relative to X origin a7 ref - can be negative offset_Y = 3 # 0 # relative to Y origin a7 ref - can be negative ecart_a7_X = 'Auto' # 3 # X space between streams a7 , if = 'Auto', space depends of A7 name longer ecart_a7_Y = None # 2 # Y space between streams a7 n_A7_perColumn = None # 6 # max n streams vertically n_A7_perRow = None # 6 # max n streams horizontally - None for not Used X_space_betweenColumns = 2 quinconce = None # True False # boolean, decale les a7 une fois sur 2 quinconce_X = None # 0.5 # x offset, 0.5/-0.5 left-right, min max quinconce_start = None # 0 # switch first quinconce_X value to modulo 0.5 to -0.5 n_col_byGroup = None # 2 # n column by a7 grouped X_space_betweenGroup = 2 # ecart_a7_X*2 # subjectif, to do better in relation with n assets, n group etc n_groups_grouded = None # todo paquet de groups - None for not Used # DONT TOUCH ################################################################################################### params = {} if A7refPos_X != None : params['A7refPos_X'] = A7refPos_X if A7refPos_Y != None : params['A7refPos_Y'] = A7refPos_Y if offset_X != None : params['offset_X'] = offset_X if offset_Y != None : params['offset_Y'] = offset_Y if ecart_a7_X != None : params['ecart_a7_X'] = ecart_a7_X if ecart_a7_Y != None : params['ecart_a7_Y'] = ecart_a7_Y if n_A7_perColumn != None : params['n_A7_perColumn'] = n_A7_perColumn if n_A7_perRow != None : params['n_A7_perRow'] = n_A7_perRow if X_space_betweenColumns != None : params['X_space_betweenColumns'] = X_space_betweenColumns if quinconce != None : params['quinconce'] = quinconce if quinconce_X != None : params['quinconce_X'] = quinconce_X if quinconce_start != None : params['quinconce_start'] = quinconce_start if n_col_byGroup != None : params['n_col_byGroup'] = n_col_byGroup if X_space_betweenGroup != None : params['X_space_betweenGroup'] = X_space_betweenGroup if n_groups_grouded != None : params['n_groups_grouded'] = n_groups_grouded #========= autoLoadA7ref = False if autoload == 'True': autoLoadA7ref = True # in 2 variables because this script can be call external # Functions ################################################################################################### def showStream(protoGraph,assetProto,typeStreams,catFamily,A7posRef=None): ''' show a7 streams ''' A7pos = None Filters = {'type': ['Model']} family = ['CHARS'] family.append(catFamily[0]) Filters['family'] = family # Filters = {'family': ['CHARS', 'MAIN'] , 'type': ['Model']} # Ordre Important pour family filters 1-CHARS 2-MAIN etc StreamProtoList = __PIPEIN_GRAPH.GetStreams(typeStreams,protoGraph,layout,assetProto,Filters) return StreamProtoList # End Functions ################################################################################################ #========= cat_array = [] catFamily = [] # for external request if _cat != None : cat = _cat[0] for a in _catFamily: catFamily.append(a) if _cat == None : catFamily.append(cat) cat = cat cat_array.append(cat) if all_cats == 'True': cat_array = ['MAIN', 'SECONDARY', 'TERTIARY'] for cat_in_Array in cat_array: A7R = 'CAMERA-Actor_ModChars-Ok.a7' A7RefPath = 'LIB/CAMERAS/CAMERA/Ok/'+A7R myG = 'M_'+cat_in_Array+'.inkGraph' myGraph = 'MODELING/CHARS/MODTECH/'+myG myGraphLocal = LOCALPATH+'M_'+cat_in_Array+'.inkGraph' # for debug catFamily = [] catFamily.append(cat_in_Array) #====================================================================== #========= Declare protograph #====================================================================== protoGraph = ink.proto.Graph( graphs.DEFAULT ) layout = protoGraph.GetLayout() #====================================================================== #========= Add Get Ref A7 #====================================================================== if autoLoadA7ref == True: __PIPEIN_GRAPH.add_A7('dirPath',A7RefPath,True) # _type, A7(str,list,dic), A7Select[optional], A7position[optional] protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() if autoLoadA7ref == False: layout = protoGraph.GetLayout() selection = protoGraph.GetSelection() if not selection: raise Exception('Please select '+A7R+' !') #====================================================================== #========= Get Selection and move to center graph #====================================================================== layout = protoGraph.GetLayout() selection = protoGraph.GetSelection() layout.SetPos(A7RefPath, (0,0) ) protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() #====================================================================== #========= Retrieve ref.a7 Pos #====================================================================== for pa in selection: A7_infos = __PIPEIN_GRAPH.getA7_infos(pa) nm_asset = A7_infos['nm_asset'] a_types = A7_infos['a_types'] if str(pa) == str(A7RefPath): ProtoA7 = pa #====================================================================== #========= get Refa7 position #====================================================================== A7refPos = __PIPEIN_GRAPH.getPosition(pa,layout) #====================================================================== #========= show a7 Downstreams #====================================================================== StreamProtoList = showStream(protoGraph,ProtoA7,'GetDownstreams',catFamily) #========= apply and refresh graph protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() #====================================================================== #========= set position .a7 Downstreams #====================================================================== #========= R&D for auto-ecart, check longest name for ecart optimal if str(ecart_a7_X).upper() == 'AUTO': params = __PIPEIN_GRAPH.get_autoEcart_X(StreamProtoList,params) #========= set position .a7 Downstreams n_streams = len(StreamProtoList) __PIPEIN_GRAPH.move_StreamProtoList(n_streams,StreamProtoList,layout,A7refPos,params) #========= apply and refresh graph protoGraph.Show() #========= save Graph if str(save_private) == 'True': myGraph = myGraphLocal if str(autosave) == 'True' and str(save_private) == 'True': # __PIPEIN_GRAPH.SaveGraph(myGraph) # to do , to debug protoGraph.Write(myG, private=True) print '[ OK ] ' + myG + ' have been saved -> ' + myGraph if str(autosave) == 'True' and str(save_private) == 'False': # __PIPEIN_GRAPH.SaveGraph(myGraph) # to do , to debug protoGraph.Write(str(myGraph), private=False) print '[ OK ] ' + myG + ' have been saved -> ' + myGraph if str(autosave) == 'False': print '[ OK ] You can save : ' + myG # #=========================== UI AK02_LAYOUT_BuildCameraModel.__category__ = 'A - PIPE-IN TOOLZ' AK02_LAYOUT_BuildCameraModel.__author__ = 'cpottier' AK02_LAYOUT_BuildCameraModel.__textColor__ = '#6699ff' AK02_LAYOUT_BuildCameraModel.__paramsType__ = { 'autoload' : ( 'bool', 'True' , ['True', 'False'] ), 'autosave' : ( 'bool', 'True' , ['True', 'False'] ), 'save_private' : ( 'bool', 'False' , ['True', 'False'] ), 'cat' : ( 'enum', 'MAIN',['MAIN', 'SECONDARY', 'TERTIARY'] ), 'all_cats' : ( 'bool', 'True' , ['True', 'False'] ) } def AK03_LAYOUT_BuildHumanShape(autoload='True',autosave='True',save_private='False',cat='MAIN',all_cats='True',_cat=None): ''' | / | \ Tool - Last update 27-06-2016 ---------------------------------------------------------------------- - Organize FACIAL Context Layout - autosave graphs in : MODELING/CHARS/MODTECH/ -> F_MAIN.inkGraph -> F_SECONDARY.inkGraph -> F_TERTIARY.inkGraph - Auto Execution or Select Human-Shape_BcsTpl.a7 ---------------------------------------------------------------------- todo : - release gestion Filters = None - r&d : check len name for ecart auto optimal ''' # PARAMS MODIFIABLES ############################################################################################ A7refPos_X = None # X origin a7 ref - None for not Used A7refPos_Y = None # Y origin a7 ref - None for not Used offset_X = 8 # 4 # relative to X origin a7 ref - can be negative offset_Y = 3 # 0 # relative to Y origin a7 ref - can be negative ecart_a7_X = 'Auto' # 3 # X space between streams a7 , if = 'Auto', space depends of A7 name longer ecart_a7_Y = None # 2 # Y space between streams a7 n_A7_perColumn = None # 6 # max n streams vertically n_A7_perRow = None # 6 # max n streams horizontally - None for not Used X_space_betweenColumns = 3 quinconce = None # True False # boolean, decale les a7 une fois sur 2 quinconce_X = None # 0.5 # x offset, 0.5/-0.5 left-right, min max quinconce_start = None # 0 # switch first quinconce_X value to modulo 0.5 to -0.5 n_col_byGroup = None # 2 # n column by a7 grouped X_space_betweenGroup = 3 # ecart_a7_X*2 # subjectif, to do better in relation with n assets, n group etc n_groups_grouded = None # todo paquet de groups - None for not Used # DONT TOUCH ################################################################################################### params = {} if A7refPos_X != None : params['A7refPos_X'] = A7refPos_X if A7refPos_Y != None : params['A7refPos_Y'] = A7refPos_Y if offset_X != None : params['offset_X'] = offset_X if offset_Y != None : params['offset_Y'] = offset_Y if ecart_a7_X != None : params['ecart_a7_X'] = ecart_a7_X if ecart_a7_Y != None : params['ecart_a7_Y'] = ecart_a7_Y if n_A7_perColumn != None : params['n_A7_perColumn'] = n_A7_perColumn if n_A7_perRow != None : params['n_A7_perRow'] = n_A7_perRow if X_space_betweenColumns != None : params['X_space_betweenColumns'] = X_space_betweenColumns if quinconce != None : params['quinconce'] = quinconce if quinconce_X != None : params['quinconce_X'] = quinconce_X if quinconce_start != None : params['quinconce_start'] = quinconce_start if n_col_byGroup != None : params['n_col_byGroup'] = n_col_byGroup if X_space_betweenGroup != None : params['X_space_betweenGroup'] = X_space_betweenGroup if n_groups_grouded != None : params['n_groups_grouded'] = n_groups_grouded # catFamily = [] # if _cat != None : # cat = _cat[0] # for a in _catFamily: # catFamily.append(a) # if _cat == None : # catFamily.append(cat) # cat = cat # A7R = 'Human-Shape_BcsTpl.a7' # A7RefPath = 'LIB/TEMPLATES/Human/Shape/'+A7R # myG = 'F_'+cat+'.inkGraph' # myGraph = 'MODELING/CHARS/MODTECH/'+myG # myGraphLocal = LOCALPATH+'F_'+cat+'.inkGraph' # for test autoLoadA7ref = False if autoload == 'True': autoLoadA7ref = True # in 2 variables because this script can be call external # Functions ################################################################################################### def showStream(protoGraph,assetProto,typeStreams,catFamily,A7posRef=None): ''' show a7 streams ''' A7pos = None layout = protoGraph.GetLayout() if typeStreams == 'GetDownstreams': Filters = {'type': ['.*']} family = ['CHARS'] family.append(catFamily[0]) Filters['family'] = family # Ordre Important pour family filters 1-CHARS 2-MAIN etc StreamProtoList = __PIPEIN_GRAPH.GetStreams(typeStreams,protoGraph,layout,assetProto,Filters) if typeStreams == 'GetUpstreams': Filters = {'type': ['Actor','Skin']} if A7posRef != None: X_posRef = A7posRef[0] - 0.1 Y_posRef = A7posRef[1] + 0.6 A7pos = [] A7pos.append(X_posRef) A7pos.append(Y_posRef) StreamProtoList = __PIPEIN_GRAPH.GetStreams(typeStreams,protoGraph,layout,assetProto,Filters,A7pos) # move upstream, to do better for pa in StreamProtoList: if A7pos != None: # todo better # X_pos = A7pos[0]-2 X_pos = A7pos[0]-(2+1.2) Y_pos = A7pos[1]+0.2 layout.SetPos(pa, (X_pos,Y_pos) ) return StreamProtoList # End Functions ################################################################################################ #========= cat_array = [] # for external request catFamily = [] if _cat != None : cat = _cat[0] for a in _catFamily: catFamily.append(a) if _cat == None : catFamily.append(cat) cat = cat cat_array.append(cat) if all_cats == 'True': cat_array = ['MAIN', 'SECONDARY', 'TERTIARY'] for cat_in_Array in cat_array: A7R = 'Human-Shape_BcsTpl.a7' A7RefPath = 'LIB/TEMPLATES/Human/Shape/'+A7R myG = 'F_'+cat_in_Array+'.inkGraph' myGraph = 'MODELING/CHARS/MODTECH/'+myG myGraphLocal = LOCALPATH+'F_'+cat_in_Array+'.inkGraph' # for test catFamily = [] catFamily.append(cat_in_Array) #====================================================================== #========= Declare protograph #====================================================================== protoGraph = ink.proto.Graph( graphs.DEFAULT ) layout = protoGraph.GetLayout() #====================================================================== #========= Add Get Ref A7 #====================================================================== if autoLoadA7ref == True: __PIPEIN_GRAPH.add_A7('dirPath',A7RefPath,True) # _type, A7(str,list,dic), A7Select[optional], A7position[optional] protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() if autoLoadA7ref == False: layout = protoGraph.GetLayout() selection = protoGraph.GetSelection() if not selection: raise Exception('Please select '+A7R+' !') #====================================================================== #========= Get Selection and move to center graph #====================================================================== layout = protoGraph.GetLayout() selection = protoGraph.GetSelection() layout.SetPos(A7RefPath, (0,0) ) protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() #====================================================================== #========= Retrieve a7 Pos #====================================================================== for pa in selection: A7_infos = __PIPEIN_GRAPH.getA7_infos(pa) nm_asset = A7_infos['nm_asset'] a_types = A7_infos['a_types'] if str(pa) == str(A7RefPath): ProtoA7 = pa #====================================================================== #========= get Refa7 position #====================================================================== A7refPos = __PIPEIN_GRAPH.getPosition(pa,layout) #====================================================================== #========= show .a7 Downstreams #====================================================================== StreamProtoList = showStream(protoGraph,ProtoA7,'GetDownstreams',catFamily) #========= apply and refresh graph protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() #====================================================================== #========= set position .a7 Downstreams #====================================================================== #========= R&D for auto-ecart, check longest name for ecart optimal if str(ecart_a7_X).upper() == 'AUTO': params = __PIPEIN_GRAPH.get_autoEcart_X(StreamProtoList,params) #========= set position .a7 Downstreams n_streams = len(StreamProtoList) __PIPEIN_GRAPH.move_StreamProtoList(n_streams,StreamProtoList,layout,A7refPos,params) #========= apply and refresh graph protoGraph.Show() protoGraph.Apply() protoGraph.SelectAll() #====================================================================== #========= show childrens Skin Upstreams #====================================================================== longestName = [] selection = protoGraph.GetSelection() #========= R&D for auto-ecart, check longest name for ecart optimal # to do for upstreams ? for pa in selection: A7_infos = __PIPEIN_GRAPH.getA7_infos(pa) nm_asset = A7_infos['nm_asset'] nm_path = A7_infos['nm_path'] A7posRef = [] position = __PIPEIN_GRAPH.getPosition(pa,layout) A7posRef.append(position[0]) A7posRef.append(position[1]) if str(nm_asset) != str(A7RefPath): result = showStream(protoGraph,pa,'GetUpstreams',catFamily,A7posRef) # protoGraph,assetProto,typeStreams,catFamily,A7posRef=None #========= apply and refresh graph protoGraph.Show() protoGraph.Apply() #========= save Graph # myGraph = myGraphLocal if str(save_private) == 'True': myGraph = myGraphLocal if str(autosave) == 'True' and str(save_private) == 'True': # __PIPEIN_GRAPH.SaveGraph(myGraph) # to do , to debug protoGraph.Write(myG, private=True) print '[ OK ] ' + myG + ' have been saved -> ' + myGraph if str(autosave) == 'True' and str(save_private) == 'False': # __PIPEIN_GRAPH.SaveGraph(myGraph) # to do , to debug protoGraph.Write(str(myGraph), private=False) print '[ OK ] ' + myG + ' have been saved -> ' + myGraph if str(autosave) == 'False': print '[ OK ] You can save : ' + myG # #=========================== UI AK03_LAYOUT_BuildHumanShape.__category__ = 'A - PIPE-IN TOOLZ' AK03_LAYOUT_BuildHumanShape.__author__ = 'cpottier' AK03_LAYOUT_BuildHumanShape.__textColor__ = '#6699ff' AK03_LAYOUT_BuildHumanShape.__paramsType__ = { 'autoload' : ( 'bool', 'True' , ['True', 'False'] ), 'autosave' : ( 'bool', 'True' , ['True', 'False'] ), 'save_private' : ( 'bool', 'False' , ['True', 'False'] ), 'cat' : ( 'enum', 'MAIN',['MAIN', 'SECONDARY', 'TERTIARY'] ), 'all_cats' : ( 'bool', 'True' , ['True', 'False'] ) }
45.121495
155
0.448964
2,108
24,140
4.925996
0.132353
0.028891
0.009245
0.010786
0.849095
0.830316
0.810285
0.803351
0.789195
0.771475
0
0.017625
0.297225
24,140
534
156
45.205993
0.594459
0.284383
0
0.811075
0
0
0.102002
0.016098
0
0
0
0.007491
0
0
null
null
0
0.016287
null
null
0.019544
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
74024840923ee760e4a8c58c1fd2fa7ee63b789b
4,267
py
Python
tests/test_merge_sort.py
Akards/Medusa
00f75e4baa6953e207e7766747a6dc6750c2796c
[ "MIT" ]
1
2020-05-06T00:03:29.000Z
2020-05-06T00:03:29.000Z
tests/test_merge_sort.py
Akards/Parallel-Python
00f75e4baa6953e207e7766747a6dc6750c2796c
[ "MIT" ]
1
2020-05-06T02:19:42.000Z
2020-05-06T02:19:42.000Z
tests/test_merge_sort.py
Akards/Medusa
00f75e4baa6953e207e7766747a6dc6750c2796c
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import unittest import os import math import Medusa.sort from Medusa.sort.merge_sort import * class TestMergeSort(unittest.TestCase): @classmethod def setUpClass(self): print("hello") def test_empty_list(self): A = [] merge = Merge(A, True, 1) B = merge.sort() self.assertEqual(B, []) def test_even_length_list_sequential_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 1) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_2_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 2) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_3_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 3) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_4_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 4) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_5_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 5) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_6_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 6) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_7_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 7) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_even_length_list_parallel_8_merge_sort(self): A = [8, 6, 7, 3, 5, 2, 1, 4] merge = Merge(A, True, 8) B = merge.sort() self.assertEqual(B, [1, 2, 3, 4, 5, 6, 7, 8]) def test_odd_length_list_sequential_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 1) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_2_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 2) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_3_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 3) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_4_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 4) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_5_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 5) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_7_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 7) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_8_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 8) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_odd_length_list_parallel_9_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, True, 9) B = merge.sort() self.assertEqual(B, [0, 1, 2, 3, 4, 6, 7, 8, 9]) def test_even_length_list_parallel_4_decreasing_order_merge_sort(self): A = [4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, False, 4) B = merge.sort() self.assertEqual(B, [8, 7, 6, 4, 3, 2, 1, 0]) def test_odd_length_list_parallel_4_decreasing_order_merge_sort(self): A = [9, 4, 3, 7, 2, 1, 8, 0, 6] merge = Merge(A, False, 4) B = merge.sort() self.assertEqual(B, [9, 8, 7, 6, 4, 3, 2, 1, 0])
29.839161
75
0.52449
750
4,267
2.809333
0.061333
0.162316
0.228287
0.126246
0.90935
0.902705
0.902705
0.877076
0.863787
0.863787
0
0.116803
0.313804
4,267
142
76
30.049296
0.602801
0.004921
0
0.663462
0
0
0.001183
0
0
0
0
0
0.182692
1
0.192308
false
0
0.048077
0
0.25
0.009615
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
cda032b0b0766230329877e78a5f02bfe8d29967
15,333
py
Python
src/metrics.py
mbiandix/radix-node-exporter
b1dba99ebe8cdea80b99e37fa173056abca2bfe1
[ "MIT" ]
null
null
null
src/metrics.py
mbiandix/radix-node-exporter
b1dba99ebe8cdea80b99e37fa173056abca2bfe1
[ "MIT" ]
null
null
null
src/metrics.py
mbiandix/radix-node-exporter
b1dba99ebe8cdea80b99e37fa173056abca2bfe1
[ "MIT" ]
null
null
null
# All metrics are treated as gauge as the counter instrument don't provide a set # method and for performance, it's always good to avoid calculation when ever it's possible. # Using the inc() method require the diff to be calculated! metrics = [ ## Custom metrics ("up", "the status of the node (1=running, 0=down, -1=connection issue, -2=node error)"), ("peers_count", "how many peers the node is seeing"), ("sigs_count", "how many nodes are currently validating"), ("header_nextValidators_count", "how many nodes are in the validators set for the next epoch"), ("header_nextValidators_is_included", "if the node is included in the next validators set"), ("header_nextValidators_stake_min", "the smallest amount of total stake in the validators set for the next epoch"), ("header_nextValidators_stake_max", "the biggest amount of total stake in the validators set for the next epoch"), ## /node/validator # ("validator_address", "validator_address"), ("validator_stakes_count", "the number of delegators currently staking on the node"), # ("validator_name", "validator_name"), ("validator_registered", "if the node is registered as validaator node"), ("validator_totalStake", "the total amount staked on the node"), # ("validator_url", "validator_url"), ## /system/peers #peers ## /system/epochproof # ("opaque", "opaque"), # ("sigs", "sigs"), # ("header_view", "header_view"), # ("header_nextValidators", "header_nextValidators"), # ("header_epoch", "header_epoch"), # ("header_accumulator", "header_accumulator"), # ("header_version", "header_version"), # ("header_timestamp", "header_timestamp"), ## /system/info # ("transports_0_metadata_port", "transports_0_metadata_port"), # ("transports_0_metadata_host", "transports_0_metadata_host"), # ("transports_0_sz", "transports_0_sz"), # ("transports_0_name", "transports_0_name"), # ("agent_protocol", "agent_protocol"), # ("agent_name", "agent_name"), # ("agent_version", "agent_version"), # ("hid", "hid"), # ("sz", "sz"), # ("nid", "nid"), # ("key", "key"), # ("info_counters_ledger_state_version", "info_counters_ledger_state_version"), ("info_counters_ledger_bft_commands_processed", "info_counters_ledger_bft_commands_processed"), ("info_counters_ledger_sync_commands_processed", "info_counters_ledger_sync_commands_processed"), ("info_counters_pacemaker_view", "info_counters_pacemaker_view"), ("info_counters_mempool_maxcount", "info_counters_mempool_maxcount"), ("info_counters_mempool_relayer_sent_count", "info_counters_mempool_relayer_sent_count"), ("info_counters_mempool_count", "info_counters_mempool_count"), ("info_counters_mempool_add_success", "info_counters_mempool_add_success"), ("info_counters_mempool_errors_other", "info_counters_mempool_errors_other"), ("info_counters_mempool_errors_hook", "info_counters_mempool_errors_hook"), ("info_counters_mempool_errors_conflict", "info_counters_mempool_errors_conflict"), ("info_counters_mempool_proposed_transaction", "info_counters_mempool_proposed_transaction"), ("info_counters_radix_engine_invalid_proposed_commands", "info_counters_radix_engine_invalid_proposed_commands"), ("info_counters_radix_engine_system_transactions", "info_counters_radix_engine_system_transactions"), ("info_counters_radix_engine_user_transactions", "info_counters_radix_engine_user_transactions"), ("info_counters_count_bdb_ledger_contains_tx", "info_counters_count_bdb_ledger_contains_tx"), ("info_counters_count_bdb_ledger_deletes", "info_counters_count_bdb_ledger_deletes"), ("info_counters_count_bdb_ledger_commit", "info_counters_count_bdb_ledger_commit"), ("info_counters_count_bdb_ledger_save", "info_counters_count_bdb_ledger_save"), ("info_counters_count_bdb_ledger_last_vertex", "info_counters_count_bdb_ledger_last_vertex"), ("info_counters_count_bdb_ledger_store", "info_counters_count_bdb_ledger_store"), ("info_counters_count_bdb_ledger_create_tx", "info_counters_count_bdb_ledger_create_tx"), ("info_counters_count_bdb_ledger_contains", "info_counters_count_bdb_ledger_contains"), ("info_counters_count_bdb_ledger_entries", "info_counters_count_bdb_ledger_entries"), ("info_counters_count_bdb_ledger_get_last", "info_counters_count_bdb_ledger_get_last"), ("info_counters_count_bdb_ledger_get_next", "info_counters_count_bdb_ledger_get_next"), ("info_counters_count_bdb_ledger_search", "info_counters_count_bdb_ledger_search"), ("info_counters_count_bdb_ledger_total", "info_counters_count_bdb_ledger_total"), ("info_counters_count_bdb_ledger_get_prev", "info_counters_count_bdb_ledger_get_prev"), ("info_counters_count_bdb_ledger_bytes_read", "info_counters_count_bdb_ledger_bytes_read"), ("info_counters_count_bdb_ledger_bytes_write", "info_counters_count_bdb_ledger_bytes_write"), ("info_counters_count_bdb_ledger_proofs_removed", "info_counters_count_bdb_ledger_proofs_removed"), ("info_counters_count_bdb_ledger_proofs_added", "info_counters_count_bdb_ledger_proofs_added"), ("info_counters_count_bdb_ledger_get", "info_counters_count_bdb_ledger_get"), ("info_counters_count_bdb_ledger_last_committed", "info_counters_count_bdb_ledger_last_committed"), ("info_counters_count_bdb_ledger_get_first", "info_counters_count_bdb_ledger_get_first"), ("info_counters_count_bdb_header_bytes_write", "info_counters_count_bdb_header_bytes_write"), ("info_counters_count_bdb_address_book_deletes", "info_counters_count_bdb_address_book_deletes"), ("info_counters_count_bdb_address_book_total", "info_counters_count_bdb_address_book_total"), ("info_counters_count_bdb_address_book_bytes_read", "info_counters_count_bdb_address_book_bytes_read"), ("info_counters_count_bdb_address_book_bytes_write", "info_counters_count_bdb_address_book_bytes_write"), ("info_counters_count_bdb_safety_state_total", "info_counters_count_bdb_safety_state_total"), ("info_counters_count_bdb_safety_state_bytes_read", "info_counters_count_bdb_safety_state_bytes_read"), ("info_counters_count_bdb_safety_state_bytes_write", "info_counters_count_bdb_safety_state_bytes_write"), ("info_counters_count_apidb_balance_total", "info_counters_count_apidb_balance_total"), ("info_counters_count_apidb_balance_read", "info_counters_count_apidb_balance_read"), ("info_counters_count_apidb_balance_bytes_read", "info_counters_count_apidb_balance_bytes_read"), ("info_counters_count_apidb_balance_bytes_write", "info_counters_count_apidb_balance_bytes_write"), ("info_counters_count_apidb_balance_write", "info_counters_count_apidb_balance_write"), ("info_counters_count_apidb_flush_count", "info_counters_count_apidb_flush_count"), ("info_counters_count_apidb_queue_size", "info_counters_count_apidb_queue_size"), ("info_counters_count_apidb_transaction_total", "info_counters_count_apidb_transaction_total"), ("info_counters_count_apidb_transaction_read", "info_counters_count_apidb_transaction_read"), ("info_counters_count_apidb_transaction_bytes_read", "info_counters_count_apidb_transaction_bytes_read"), ("info_counters_count_apidb_transaction_bytes_write", "info_counters_count_apidb_transaction_bytes_write"), ("info_counters_count_apidb_transaction_write", "info_counters_count_apidb_transaction_write"), ("info_counters_count_apidb_token_total", "info_counters_count_apidb_token_total"), ("info_counters_count_apidb_token_read", "info_counters_count_apidb_token_read"), ("info_counters_count_apidb_token_bytes_read", "info_counters_count_apidb_token_bytes_read"), ("info_counters_count_apidb_token_bytes_write", "info_counters_count_apidb_token_bytes_write"), ("info_counters_count_apidb_token_write", "info_counters_count_apidb_token_write"), ("info_counters_epoch_manager_queued_consensus_events", "info_counters_epoch_manager_queued_consensus_events"), ("info_counters_hashed_bytes", "info_counters_hashed_bytes"), ("info_counters_networking_received_bytes", "info_counters_networking_received_bytes"), ("info_counters_networking_tcp_out_opened", "info_counters_networking_tcp_out_opened"), ("info_counters_networking_tcp_dropped_messages", "info_counters_networking_tcp_dropped_messages"), ("info_counters_networking_tcp_in_opened", "info_counters_networking_tcp_in_opened"), ("info_counters_networking_tcp_closed", "info_counters_networking_tcp_closed"), ("info_counters_networking_udp_dropped_messages", "info_counters_networking_udp_dropped_messages"), ("info_counters_networking_sent_bytes", "info_counters_networking_sent_bytes"), ("info_counters_sync_processed", "info_counters_sync_processed"), ("info_counters_sync_target_state_version", "info_counters_sync_target_state_version"), ("info_counters_sync_remote_requests_processed", "info_counters_sync_remote_requests_processed"), ("info_counters_sync_invalid_commands_received", "info_counters_sync_invalid_commands_received"), ("info_counters_sync_last_read_millis", "info_counters_sync_last_read_millis"), ("info_counters_sync_target_current_diff", "info_counters_sync_target_current_diff"), ("info_counters_signatures_verified", "info_counters_signatures_verified"), ("info_counters_signatures_signed", "info_counters_signatures_signed"), ("info_counters_elapsed_bdb_ledger_contains_tx", "info_counters_elapsed_bdb_ledger_contains_tx"), ("info_counters_elapsed_bdb_ledger_commit", "info_counters_elapsed_bdb_ledger_commit"), ("info_counters_elapsed_bdb_ledger_save", "info_counters_elapsed_bdb_ledger_save"), ("info_counters_elapsed_bdb_ledger_last_vertex", "info_counters_elapsed_bdb_ledger_last_vertex"), ("info_counters_elapsed_bdb_ledger_store", "info_counters_elapsed_bdb_ledger_store"), ("info_counters_elapsed_bdb_ledger_create_tx", "info_counters_elapsed_bdb_ledger_create_tx"), ("info_counters_elapsed_bdb_ledger_contains", "info_counters_elapsed_bdb_ledger_contains"), ("info_counters_elapsed_bdb_ledger_entries", "info_counters_elapsed_bdb_ledger_entries"), ("info_counters_elapsed_bdb_ledger_get_last", "info_counters_elapsed_bdb_ledger_get_last"), ("info_counters_elapsed_bdb_ledger_search", "info_counters_elapsed_bdb_ledger_search"), ("info_counters_elapsed_bdb_ledger_total", "info_counters_elapsed_bdb_ledger_total"), ("info_counters_elapsed_bdb_ledger_get", "info_counters_elapsed_bdb_ledger_get"), ("info_counters_elapsed_bdb_ledger_last_committed", "info_counters_elapsed_bdb_ledger_last_committed"), ("info_counters_elapsed_bdb_ledger_get_first", "info_counters_elapsed_bdb_ledger_get_first"), ("info_counters_elapsed_bdb_address_book", "info_counters_elapsed_bdb_address_book"), ("info_counters_elapsed_bdb_safety_state", "info_counters_elapsed_bdb_safety_state"), ("info_counters_elapsed_apidb_balance_read", "info_counters_elapsed_apidb_balance_read"), ("info_counters_elapsed_apidb_balance_write", "info_counters_elapsed_apidb_balance_write"), ("info_counters_elapsed_apidb_flush_time", "info_counters_elapsed_apidb_flush_time"), ("info_counters_elapsed_apidb_transaction_read", "info_counters_elapsed_apidb_transaction_read"), ("info_counters_elapsed_apidb_transaction_write", "info_counters_elapsed_apidb_transaction_write"), ("info_counters_elapsed_apidb_token_read", "info_counters_elapsed_apidb_token_read"), ("info_counters_elapsed_apidb_token_write", "info_counters_elapsed_apidb_token_write"), ("info_counters_bft_state_version", "info_counters_bft_state_version"), ("info_counters_bft_vote_quorums", "info_counters_bft_vote_quorums"), ("info_counters_bft_rejected", "info_counters_bft_rejected"), ("info_counters_bft_vertex_store_rebuilds", "info_counters_bft_vertex_store_rebuilds"), ("info_counters_bft_vertex_store_forks", "info_counters_bft_vertex_store_forks"), ("info_counters_bft_sync_request_timeouts", "info_counters_bft_sync_request_timeouts"), ("info_counters_bft_sync_requests_sent", "info_counters_bft_sync_requests_sent"), ("info_counters_bft_timeout", "info_counters_bft_timeout"), ("info_counters_bft_vertex_store_size", "info_counters_bft_vertex_store_size"), ("info_counters_bft_processed", "info_counters_bft_processed"), ("info_counters_bft_consensus_events", "info_counters_bft_consensus_events"), ("info_counters_bft_indirect_parent", "info_counters_bft_indirect_parent"), ("info_counters_bft_proposals_made", "info_counters_bft_proposals_made"), ("info_counters_bft_timed_out_views", "info_counters_bft_timed_out_views"), ("info_counters_bft_timeout_quorums", "info_counters_bft_timeout_quorums"), ("info_counters_startup_time_ms", "info_counters_startup_time_ms"), ("info_counters_messages_inbound_processed", "info_counters_messages_inbound_processed"), ("info_counters_messages_inbound_discarded", "info_counters_messages_inbound_discarded"), ("info_counters_messages_inbound_badsignature", "info_counters_messages_inbound_badsignature"), ("info_counters_messages_inbound_received", "info_counters_messages_inbound_received"), ("info_counters_messages_outbound_processed", "info_counters_messages_outbound_processed"), ("info_counters_messages_outbound_aborted", "info_counters_messages_outbound_aborted"), ("info_counters_messages_outbound_pending", "info_counters_messages_outbound_pending"), ("info_counters_messages_outbound_sent", "info_counters_messages_outbound_sent"), ("info_counters_persistence_safety_store_saves", "info_counters_persistence_safety_store_saves"), ("info_counters_persistence_vertex_store_saves", "info_counters_persistence_vertex_store_saves"), ("info_counters_persistence_atom_log_write_bytes", "info_counters_persistence_atom_log_write_bytes"), ("info_counters_persistence_atom_log_write_compressed", "info_counters_persistence_atom_log_write_compressed"), ("info_counters_time_duration", "info_counters_time_duration"), # ("info_counters_time_since", "info_counters_time_since"), ("info_configuration_pacemakerRate", "info_configuration_pacemakerRate"), ("info_configuration_pacemakerTimeout", "info_configuration_pacemakerTimeout"), ("info_configuration_pacemakerMaxExponent", "info_configuration_pacemakerMaxExponent"), ("info_system_version_system_version_agent_version", "info_system_version_system_version_agent_version"), ("info_system_version_system_version_protocol_version", "info_system_version_system_version_protocol_version"), # ("info_system_version_system_version_display", "info_system_version_system_version_display"), # ("info_system_version_system_version_commit", "info_system_version_system_version_commit"), # ("info_system_version_system_version_branch", "info_system_version_system_version_branch"), ("info_epochManager_currentView_view", "info_epochManager_currentView_view"), ("info_epochManager_currentView_epoch", "info_epochManager_currentView_epoch"), ]
81.126984
120
0.812105
1,924
15,333
5.727131
0.113825
0.285325
0.141937
0.105273
0.895544
0.874217
0.861603
0.794355
0.732371
0.562483
0
0.000863
0.093002
15,333
188
121
81.558511
0.791472
0.097763
0
0
0
0.006757
0.836078
0.791679
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
cdb1781ab70f38d47967a6221790c47d2b775fe3
383
py
Python
rest-api/tests/test_api_general.py
Toxe/gps-tracks
1118ff38995598920db3ea3b76be61dfc3f6a8e1
[ "MIT" ]
null
null
null
rest-api/tests/test_api_general.py
Toxe/gps-tracks
1118ff38995598920db3ea3b76be61dfc3f6a8e1
[ "MIT" ]
null
null
null
rest-api/tests/test_api_general.py
Toxe/gps-tracks
1118ff38995598920db3ea3b76be61dfc3f6a8e1
[ "MIT" ]
null
null
null
def test_slash_request_forbidden(client): assert client.get("/").status_code == 404 def test_api_root_request_forbidden(client): assert client.get("/api").status_code == 404 assert client.get("/api/").status_code == 404 def test_auth_root_request_forbidden(client): assert client.get("/auth").status_code == 404 assert client.get("/auth/").status_code == 404
29.461538
50
0.723238
54
383
4.833333
0.259259
0.229885
0.287356
0.321839
0.927203
0.823755
0.681992
0
0
0
0
0.045045
0.130548
383
12
51
31.916667
0.738739
0
0
0
0
0
0.05483
0
0
0
0
0
0.625
1
0.375
false
0
0
0
0.375
0
0
0
0
null
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
0
0
0
7
a81f59b6cc0f62fd8ecfa721c36b9044dddc856a
1,689
py
Python
saraswati/mooncal/migrations/0012_auto_20200304_1815.py
tony-mikhailov/mooncal
9f0a1a215a2d5fd2ec1f98803f666ea10106f25e
[ "MIT" ]
null
null
null
saraswati/mooncal/migrations/0012_auto_20200304_1815.py
tony-mikhailov/mooncal
9f0a1a215a2d5fd2ec1f98803f666ea10106f25e
[ "MIT" ]
9
2020-03-04T09:31:37.000Z
2021-06-10T18:28:36.000Z
saraswati/mooncal/migrations/0012_auto_20200304_1815.py
tony-mikhailov/mooncal
9f0a1a215a2d5fd2ec1f98803f666ea10106f25e
[ "MIT" ]
null
null
null
# Generated by Django 3.0 on 2020-03-04 15:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mooncal', '0011_auto_20200227_1020'), ] operations = [ migrations.AddField( model_name='event', name='bg_color', field=models.CharField(blank=True, help_text='HEX color, as #RRGGBB', max_length=7, null=True, verbose_name='Background Color'), ), migrations.AddField( model_name='event', name='fg_color', field=models.CharField(blank=True, help_text='HEX color, as #RRGGBB', max_length=7, null=True, verbose_name='Foreground Color'), ), migrations.AddField( model_name='moonday', name='bg_color', field=models.CharField(blank=True, help_text='HEX color, as #RRGGBB', max_length=7, null=True, verbose_name='Background Color'), ), migrations.AddField( model_name='moonday', name='fg_color', field=models.CharField(blank=True, help_text='HEX color, as #RRGGBB', max_length=7, null=True, verbose_name='Foreground Color'), ), migrations.AddField( model_name='ritual', name='bg_color', field=models.CharField(blank=True, help_text='HEX color, as #RRGGBB', max_length=7, null=True, verbose_name='Background Color'), ), migrations.AddField( model_name='ritual', name='fg_color', field=models.CharField(blank=True, help_text='HEX color, as #RRGGBB', max_length=7, null=True, verbose_name='Foreground Color'), ), ]
38.386364
140
0.608644
196
1,689
5.076531
0.25
0.108543
0.138693
0.162814
0.850251
0.850251
0.813065
0.786935
0.786935
0.786935
0
0.028916
0.262877
1,689
43
141
39.27907
0.770281
0.025459
0
0.810811
1
0
0.20438
0.01399
0
0
0
0
0
1
0
false
0
0.027027
0
0.108108
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
a82ab653aba7a3d53f7882a7292cce95be151a55
6,855
py
Python
examples/relationship/many_to_many/pre_defined_models_auto.py
MihailMiller/OpenAlchemy
55b751c58ca50706ebc46262f50addb7dec34278
[ "Apache-2.0" ]
40
2019-11-05T06:50:35.000Z
2022-03-09T01:34:57.000Z
examples/relationship/many_to_many/pre_defined_models_auto.py
MihailMiller/OpenAlchemy
55b751c58ca50706ebc46262f50addb7dec34278
[ "Apache-2.0" ]
178
2019-11-03T04:10:38.000Z
2022-03-31T00:07:17.000Z
examples/relationship/many_to_many/pre_defined_models_auto.py
MihailMiller/OpenAlchemy
55b751c58ca50706ebc46262f50addb7dec34278
[ "Apache-2.0" ]
17
2019-11-04T07:22:46.000Z
2022-03-23T05:29:49.000Z
"""Autogenerated SQLAlchemy models based on OpenAlchemy models.""" # pylint: disable=no-member,super-init-not-called,unused-argument import typing import sqlalchemy from sqlalchemy import orm from open_alchemy import models Base = models.Base # type: ignore class ProjectDict(typing.TypedDict, total=False): """TypedDict for properties that are not required.""" id: typing.Optional[int] name: typing.Optional[str] class TProject(typing.Protocol): """ SQLAlchemy model protocol. A large sized business objective. Attrs: id: Unique identifier for the project. name: The name of the project. """ # SQLAlchemy properties __table__: sqlalchemy.Table __tablename__: str query: orm.Query # Model properties id: "sqlalchemy.Column[typing.Optional[int]]" name: "sqlalchemy.Column[typing.Optional[str]]" def __init__( self, id: typing.Optional[int] = None, name: typing.Optional[str] = None ) -> None: """ Construct. Args: id: Unique identifier for the project. name: The name of the project. """ ... @classmethod def from_dict( cls, id: typing.Optional[int] = None, name: typing.Optional[str] = None ) -> "TProject": """ Construct from a dictionary (eg. a POST payload). Args: id: Unique identifier for the project. name: The name of the project. Returns: Model instance based on the dictionary. """ ... @classmethod def from_str(cls, value: str) -> "TProject": """ Construct from a JSON string (eg. a POST payload). Returns: Model instance based on the JSON string. """ ... def to_dict(self) -> ProjectDict: """ Convert to a dictionary (eg. to send back for a GET request). Returns: Dictionary based on the model instance. """ ... def to_str(self) -> str: """ Convert to a JSON string (eg. to send back for a GET request). Returns: JSON string based on the model instance. """ ... Project: typing.Type[TProject] = models.Project # type: ignore class EmployeeDict(typing.TypedDict, total=False): """TypedDict for properties that are not required.""" id: typing.Optional[int] name: typing.Optional[str] projects: typing.Sequence["ProjectDict"] class TEmployee(typing.Protocol): """ SQLAlchemy model protocol. Person that works for a company. Attrs: id: Unique identifier for the employee. name: The name of the employee. projects: The projects the employee is working on. """ # SQLAlchemy properties __table__: sqlalchemy.Table __tablename__: str query: orm.Query # Model properties id: "sqlalchemy.Column[typing.Optional[int]]" name: "sqlalchemy.Column[typing.Optional[str]]" projects: 'sqlalchemy.Column[typing.Sequence["TProject"]]' def __init__( self, id: typing.Optional[int] = None, name: typing.Optional[str] = None, projects: typing.Optional[typing.Sequence["TProject"]] = None, ) -> None: """ Construct. Args: id: Unique identifier for the employee. name: The name of the employee. projects: The projects the employee is working on. """ ... @classmethod def from_dict( cls, id: typing.Optional[int] = None, name: typing.Optional[str] = None, projects: typing.Optional[typing.Sequence["ProjectDict"]] = None, ) -> "TEmployee": """ Construct from a dictionary (eg. a POST payload). Args: id: Unique identifier for the employee. name: The name of the employee. projects: The projects the employee is working on. Returns: Model instance based on the dictionary. """ ... @classmethod def from_str(cls, value: str) -> "TEmployee": """ Construct from a JSON string (eg. a POST payload). Returns: Model instance based on the JSON string. """ ... def to_dict(self) -> EmployeeDict: """ Convert to a dictionary (eg. to send back for a GET request). Returns: Dictionary based on the model instance. """ ... def to_str(self) -> str: """ Convert to a JSON string (eg. to send back for a GET request). Returns: JSON string based on the model instance. """ ... Employee: typing.Type[TEmployee] = models.Employee # type: ignore class EmployeeProjectDict(typing.TypedDict, total=True): """TypedDict for properties that are required.""" employee_id: int project_id: int class TEmployeeProject(typing.Protocol): """ SQLAlchemy model protocol. Attrs: employee_id: The employee_id of the EmployeeProject. project_id: The project_id of the EmployeeProject. """ # SQLAlchemy properties __table__: sqlalchemy.Table __tablename__: str query: orm.Query # Model properties employee_id: "sqlalchemy.Column[int]" project_id: "sqlalchemy.Column[int]" def __init__(self, employee_id: int, project_id: int) -> None: """ Construct. Args: employee_id: The employee_id of the EmployeeProject. project_id: The project_id of the EmployeeProject. """ ... @classmethod def from_dict(cls, employee_id: int, project_id: int) -> "TEmployeeProject": """ Construct from a dictionary (eg. a POST payload). Args: employee_id: The employee_id of the EmployeeProject. project_id: The project_id of the EmployeeProject. Returns: Model instance based on the dictionary. """ ... @classmethod def from_str(cls, value: str) -> "TEmployeeProject": """ Construct from a JSON string (eg. a POST payload). Returns: Model instance based on the JSON string. """ ... def to_dict(self) -> EmployeeProjectDict: """ Convert to a dictionary (eg. to send back for a GET request). Returns: Dictionary based on the model instance. """ ... def to_str(self) -> str: """ Convert to a JSON string (eg. to send back for a GET request). Returns: JSON string based on the model instance. """ ... EmployeeProject: typing.Type[TEmployeeProject] = models.EmployeeProject # type: ignore
23.158784
87
0.589059
753
6,855
5.270916
0.126162
0.063492
0.030234
0.028723
0.781809
0.740237
0.718821
0.718821
0.718821
0.701688
0
0
0.314223
6,855
295
88
23.237288
0.844288
0.436178
0
0.586207
1
0
0.11302
0.081295
0
0
0
0
0
1
0.172414
false
0
0.045977
0
0.551724
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
7
b5256220589759c7ece1f602d3ac254e97f82594
107,766
py
Python
pycm/test.py
mahi97/pycm
6192519c04111f29521a914d566ba47f516a61cf
[ "MIT" ]
null
null
null
pycm/test.py
mahi97/pycm
6192519c04111f29521a914d566ba47f516a61cf
[ "MIT" ]
null
null
null
pycm/test.py
mahi97/pycm
6192519c04111f29521a914d566ba47f516a61cf
[ "MIT" ]
1
2019-02-13T16:10:30.000Z
2019-02-13T16:10:30.000Z
# -*- coding: utf-8 -*- ''' >>> from pycm import * >>> import os >>> import json >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2] >>> cm = ConfusionMatrix(y_actu, y_pred) >>> cm pycm.ConfusionMatrix(classes: [0, 1, 2]) >>> len(cm) 3 >>> print(cm) Predict 0 1 2 Actual 0 3 0 0 <BLANKLINE> 1 0 1 2 <BLANKLINE> 2 2 1 3 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.30439,0.86228) AUNP 0.66667 AUNU 0.69444 Bennett S 0.375 CBA 0.47778 Chi-Squared 6.6 Chi-Squared DF 4 Conditional Entropy 0.95915 Cramer V 0.5244 Cross Entropy 1.59352 Gwet AC1 0.38931 Hamming Loss 0.41667 Joint Entropy 2.45915 KL Divergence 0.09352 Kappa 0.35484 Kappa 95% CI (-0.07708,0.78675) Kappa No Prevalence 0.16667 Kappa Standard Error 0.22036 Kappa Unbiased 0.34426 Lambda A 0.16667 Lambda B 0.42857 Mutual Information 0.52421 NIR 0.5 Overall ACC 0.58333 Overall CEN 0.46381 Overall J (1.225,0.40833) Overall MCC 0.36667 Overall MCEN 0.51894 Overall RACC 0.35417 Overall RACCU 0.36458 P-Value 0.38721 PPV Macro 0.56667 PPV Micro 0.58333 Phi-Squared 0.55 RCI 0.34947 RR 4.0 Reference Entropy 1.5 Response Entropy 1.48336 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.34426 Standard Error 0.14232 TPR Macro 0.61111 TPR Micro 0.58333 Zero-one Loss 5 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.83333 0.75 0.58333 AUC(Area under the roc curve) 0.88889 0.61111 0.58333 AUCI(Auc value interpretation) Very Good Fair Poor BM(Informedness or bookmaker informedness) 0.77778 0.22222 0.16667 CEN(Confusion entropy) 0.25 0.49658 0.60442 DOR(Diagnostic odds ratio) None 4.0 2.0 DP(Discriminant power) None 0.33193 0.16597 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.16667 0.25 0.41667 F0.5(F0.5 score) 0.65217 0.45455 0.57692 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.4 0.54545 F2(F2 score) 0.88235 0.35714 0.51724 FDR(False discovery rate) 0.4 0.5 0.4 FN(False negative/miss/type 2 error) 0 2 3 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.2 0.42857 FP(False positive/type 1 error/false alarm) 2 1 2 FPR(Fall-out or false positive rate) 0.22222 0.11111 0.33333 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.40825 0.54772 GI(Gini index) 0.77778 0.22222 0.16667 IS(Information score) 1.26303 1.0 0.26303 J(Jaccard index) 0.6 0.25 0.375 LS(Lift score) 2.4 2.0 1.2 MCC(Matthews correlation coefficient) 0.68313 0.2582 0.16903 MCEN(Modified confusion entropy) 0.26439 0.5 0.6875 MK(Markedness) 0.6 0.3 0.17143 N(Condition negative) 9 9 6 NLR(Negative likelihood ratio) 0.0 0.75 0.75 NPV(Negative predictive value) 1.0 0.8 0.57143 P(Condition positive or support) 3 3 6 PLR(Positive likelihood ratio) 4.5 3.0 1.5 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 12 12 12 PPV(Precision or positive predictive value) 0.6 0.5 0.6 PRE(Prevalence) 0.25 0.25 0.5 RACC(Random accuracy) 0.10417 0.04167 0.20833 RACCU(Random accuracy unbiased) 0.11111 0.0434 0.21007 TN(True negative/correct rejection) 7 8 4 TNR(Specificity or true negative rate) 0.77778 0.88889 0.66667 TON(Test outcome negative) 7 10 7 TOP(Test outcome positive) 5 2 5 TP(True positive/hit) 3 1 3 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.77778 0.22222 0.16667 dInd(Distance index) 0.22222 0.67586 0.60093 sInd(Similarity index) 0.84287 0.52209 0.57508 <BLANKLINE> >>> cm.relabel({0:"L1",1:"L2",2:"L3"}) >>> print(cm) Predict L1 L2 L3 Actual L1 3 0 0 <BLANKLINE> L2 0 1 2 <BLANKLINE> L3 2 1 3 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.30439,0.86228) AUNP 0.66667 AUNU 0.69444 Bennett S 0.375 CBA 0.47778 Chi-Squared 6.6 Chi-Squared DF 4 Conditional Entropy 0.95915 Cramer V 0.5244 Cross Entropy 1.59352 Gwet AC1 0.38931 Hamming Loss 0.41667 Joint Entropy 2.45915 KL Divergence 0.09352 Kappa 0.35484 Kappa 95% CI (-0.07708,0.78675) Kappa No Prevalence 0.16667 Kappa Standard Error 0.22036 Kappa Unbiased 0.34426 Lambda A 0.16667 Lambda B 0.42857 Mutual Information 0.52421 NIR 0.5 Overall ACC 0.58333 Overall CEN 0.46381 Overall J (1.225,0.40833) Overall MCC 0.36667 Overall MCEN 0.51894 Overall RACC 0.35417 Overall RACCU 0.36458 P-Value 0.38721 PPV Macro 0.56667 PPV Micro 0.58333 Phi-Squared 0.55 RCI 0.34947 RR 4.0 Reference Entropy 1.5 Response Entropy 1.48336 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.34426 Standard Error 0.14232 TPR Macro 0.61111 TPR Micro 0.58333 Zero-one Loss 5 <BLANKLINE> Class Statistics : <BLANKLINE> Classes L1 L2 L3 ACC(Accuracy) 0.83333 0.75 0.58333 AUC(Area under the roc curve) 0.88889 0.61111 0.58333 AUCI(Auc value interpretation) Very Good Fair Poor BM(Informedness or bookmaker informedness) 0.77778 0.22222 0.16667 CEN(Confusion entropy) 0.25 0.49658 0.60442 DOR(Diagnostic odds ratio) None 4.0 2.0 DP(Discriminant power) None 0.33193 0.16597 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.16667 0.25 0.41667 F0.5(F0.5 score) 0.65217 0.45455 0.57692 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.4 0.54545 F2(F2 score) 0.88235 0.35714 0.51724 FDR(False discovery rate) 0.4 0.5 0.4 FN(False negative/miss/type 2 error) 0 2 3 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.2 0.42857 FP(False positive/type 1 error/false alarm) 2 1 2 FPR(Fall-out or false positive rate) 0.22222 0.11111 0.33333 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.40825 0.54772 GI(Gini index) 0.77778 0.22222 0.16667 IS(Information score) 1.26303 1.0 0.26303 J(Jaccard index) 0.6 0.25 0.375 LS(Lift score) 2.4 2.0 1.2 MCC(Matthews correlation coefficient) 0.68313 0.2582 0.16903 MCEN(Modified confusion entropy) 0.26439 0.5 0.6875 MK(Markedness) 0.6 0.3 0.17143 N(Condition negative) 9 9 6 NLR(Negative likelihood ratio) 0.0 0.75 0.75 NPV(Negative predictive value) 1.0 0.8 0.57143 P(Condition positive or support) 3 3 6 PLR(Positive likelihood ratio) 4.5 3.0 1.5 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 12 12 12 PPV(Precision or positive predictive value) 0.6 0.5 0.6 PRE(Prevalence) 0.25 0.25 0.5 RACC(Random accuracy) 0.10417 0.04167 0.20833 RACCU(Random accuracy unbiased) 0.11111 0.0434 0.21007 TN(True negative/correct rejection) 7 8 4 TNR(Specificity or true negative rate) 0.77778 0.88889 0.66667 TON(Test outcome negative) 7 10 7 TOP(Test outcome positive) 5 2 5 TP(True positive/hit) 3 1 3 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.77778 0.22222 0.16667 dInd(Distance index) 0.22222 0.67586 0.60093 sInd(Similarity index) 0.84287 0.52209 0.57508 <BLANKLINE> >>> cm.Y["L2"] 0.2222222222222221 >>> cm_2 = ConfusionMatrix(y_actu, 2) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: The type of input vectors is assumed to be a list or a NumPy array >>> cm_3 = ConfusionMatrix(y_actu, [1,2]) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors must have same length >>> cm_4 = ConfusionMatrix([], []) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors are empty >>> cm_5 = ConfusionMatrix([1,1,1,], [1,1,1,1]) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Input vectors must have same length >>> pycm_help() <BLANKLINE> PyCM is a multi-class confusion matrix library written in Python that supports both input data vectors and direct matrix, and a proper tool for post-classification model evaluation that supports most classes and overall statistics parameters. PyCM is the swiss-army knife of confusion matrices, targeted mainly at data scientists that need a broad array of metrics for predictive models and an accurate evaluation of large variety of classifiers. <BLANKLINE> Repo : https://github.com/sepandhaghighi/pycm Webpage : http://www.pycm.ir <BLANKLINE> <BLANKLINE> >>> RCI_calc(24,0) 'None' >>> CBA_calc([1,2], {1:{1:0,2:0},2:{1:0,2:0}}, {1:0,2:0}, {1:0,2:0}) 'None' >>> RR_calc([], {1:0,2:0}) 'None' >>> overall_MCC_calc([1,2], {1:{1:0,2:0},2:{1:0,2:0}}, {1:0,2:0}, {1:0,2:0}) 'None' >>> CEN_misclassification_calc({1:{1:0,2:0},2:{1:0,2:0}},{1:0,2:0},{1:0,2:0},1,1,2) 'None' >>> vector_check([1,2,3,0.4]) False >>> vector_check([1,2,3,-2]) False >>> matrix_check({1:{1:0.5,2:0},2:{1:0,2:0}}) False >>> matrix_check([]) False >>> TTPN_calc(0,0) 'None' >>> TTPN_calc(1,4) 0.2 >>> FXR_calc(None) 'None' >>> FXR_calc(0.2) 0.8 >>> ACC_calc(0,0,0,0) 'None' >>> ACC_calc(1,1,3,4) 0.2222222222222222 >>> MCC_calc(0,2,0,2) 'None' >>> MCC_calc(1,2,3,4) -0.408248290463863 >>> LR_calc(1,2) 0.5 >>> LR_calc(1,0) 'None' >>> MK_BM_calc(2,"None") 'None' >>> MK_BM_calc(1,2) 2 >>> PRE_calc(None,2) 'None' >>> PRE_calc(1,5) 0.2 >>> PRE_calc(1,0) 'None' >>> G_calc(None,2) 'None' >>> G_calc(1,2) 1.4142135623730951 >>> RACC_calc(2,3,4) 0.375 >>> reliability_calc(1,None) 'None' >>> reliability_calc(2,0.3) 1.7 >>> micro_calc({1:2,2:3},{1:1,2:4}) 0.5 >>> micro_calc({1:2,2:3},None) 'None' >>> macro_calc(None) 'None' >>> macro_calc({1:2,2:3}) 2.5 >>> F_calc(TP=0,FP=0,FN=0,Beta=1) 'None' >>> F_calc(TP=3,FP=2,FN=1,Beta=5) 0.7428571428571429 >>> save_stat=cm.save_stat("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered2",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=["L1","L2"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("test_filtered3",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_stat("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.pycm'"} True >>> ERR_calc(None) 'None' >>> ERR_calc(0.1) 0.9 >>> cm.F_beta(4)["L1"] 0.9622641509433962 >>> cm.F_beta(4)["L2"] 0.34 >>> cm.F_beta(4)["L3"] 0.504950495049505 >>> import numpy as np >>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200]) >>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200]) >>> cm=ConfusionMatrix(y_test, y_pred) >>> print(cm) Predict 100 200 500 600 Actual 100 0 0 0 0 <BLANKLINE> 200 9 6 1 0 <BLANKLINE> 500 1 1 1 0 <BLANKLINE> 600 1 0 0 0 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> cm.stat() Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 ACC(Accuracy) 0.45 AUC(Area under the roc curve) None TNR(Specificity or true negative rate) 0.45 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=[],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> >>> cm.stat(overall_param=["Kappa","Scott PI"],class_param=["TPR"],class_name=[100]) Overall Statistics : <BLANKLINE> Kappa 0.07801 Scott PI -0.12554 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.stat(overall_param=[],class_param=["TPR"],class_name=[100]) <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 TPR(Sensitivity, recall, hit rate, or true positive rate) None <BLANKLINE> >>> cm.print_normalized_matrix() Predict 100 200 500 600 Actual 100 0.0 0.0 0.0 0.0 200 0.5625 0.375 0.0625 0.0 500 0.33333 0.33333 0.33333 0.0 600 1.0 0.0 0.0 0.0 <BLANKLINE> >>> cm.print_matrix() Predict 100 200 500 600 Actual 100 0 0 0 0 200 9 6 1 0 500 1 1 1 0 600 1 0 0 0 <BLANKLINE> >>> cm.print_matrix(one_vs_all=True,class_name=200) Predict 200 ~ Actual 200 6 10 ~ 1 3 <BLANKLINE> >>> cm.print_normalized_matrix(one_vs_all=True,class_name=200) Predict 200 ~ Actual 200 0.375 0.625 ~ 0.25 0.75 <BLANKLINE> >>> kappa_analysis_koch(-0.1) 'Poor' >>> kappa_analysis_koch(0) 'Slight' >>> kappa_analysis_koch(0.2) 'Fair' >>> kappa_analysis_koch(0.4) 'Moderate' >>> kappa_analysis_koch(0.6) 'Substantial' >>> kappa_analysis_koch(0.8) 'Almost Perfect' >>> kappa_analysis_koch(1.2) 'None' >>> kappa_analysis_fleiss(0.4) 'Intermediate to Good' >>> kappa_analysis_fleiss(0.75) 'Excellent' >>> kappa_analysis_fleiss(1.2) 'Excellent' >>> kappa_analysis_altman(-0.2) 'Poor' >>> kappa_analysis_altman(0.2) 'Fair' >>> kappa_analysis_altman(0.4) 'Moderate' >>> kappa_analysis_altman(0.6) 'Good' >>> kappa_analysis_altman(0.8) 'Very Good' >>> kappa_analysis_altman(1.2) 'None' >>> kappa_analysis_fleiss(0.2) 'Poor' >>> kappa_analysis_cicchetti(0.3) 'Poor' >>> kappa_analysis_cicchetti(0.5) 'Fair' >>> kappa_analysis_cicchetti(0.65) 'Good' >>> kappa_analysis_cicchetti(0.8) 'Excellent' >>> PLR_analysis(1) 'Negligible' >>> PLR_analysis(3) 'Poor' >>> PLR_analysis(7) 'Fair' >>> PLR_analysis(11) 'Good' >>> DP_analysis(0.2) 'Poor' >>> DP_analysis(1.5) 'Limited' >>> DP_analysis(2.5) 'Fair' >>> DP_analysis(10) 'Good' >>> AUC_analysis(0.5) 'Poor' >>> AUC_analysis(0.65) 'Fair' >>> AUC_analysis(0.75) 'Good' >>> AUC_analysis(0.86) 'Very Good' >>> AUC_analysis(0.97) 'Excellent' >>> AUC_analysis(1.0) 'Excellent' >>> PC_PI_calc(1,1,1) 'None' >>> PC_PI_calc({1:12},{1:6},{1:45}) 0.04000000000000001 >>> PC_AC1_calc(1,1,1) 'None' >>> PC_AC1_calc({1:123,2:2},{1:120,2:5},{1:125,2:125}) 0.05443200000000002 >>> y_act=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2] >>> y_pre=[0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,2,0,1,2,2,2,2] >>> cm2=ConfusionMatrix(y_act,y_pre) >>> chi_squared=chi_square_calc(cm2.classes,cm2.table,cm2.TOP,cm2.P,cm2.POP) >>> chi_squared 15.525641025641026 >>> population = list(cm2.POP.values())[0] >>> phi_squared=phi_square_calc(chi_squared,population) >>> phi_squared 0.5750237416904084 >>> V=cramers_V_calc(phi_squared,cm2.classes) >>> V 0.5362013342441477 >>> DF=DF_calc(cm2.classes) >>> DF 4 >>> SE=se_calc(cm2.Overall_ACC,population) >>> SE 0.09072184232530289 >>> CI=CI_calc(cm2.Overall_ACC,SE) >>> CI (0.48885185570907297, 0.8444814776242603) >>> response_entropy=entropy_calc(cm2.TOP,cm2.POP) >>> response_entropy 1.486565953154142 >>> reference_entropy=entropy_calc(cm2.P,cm2.POP) >>> reference_entropy 1.5304930567574824 >>> cross_entropy = cross_entropy_calc(cm2.TOP,cm2.P,cm2.POP) >>> cross_entropy 1.5376219392005763 >>> join_entropy = joint_entropy_calc(cm2.classes,cm2.table,cm2.POP) >>> join_entropy 2.619748965432189 >>> conditional_entropy = conditional_entropy_calc(cm2.classes,cm2.table,cm2.P,cm2.POP) >>> conditional_entropy 1.089255908674706 >>> kl_divergence=kl_divergence_calc(cm2.P,cm2.TOP,cm2.POP) >>> kl_divergence 0.007128882443093773 >>> lambda_B=lambda_B_calc(cm2.classes,cm2.table,cm2.TOP,population) >>> lambda_B 0.35714285714285715 >>> lambda_A=lambda_A_calc(cm2.classes,cm2.table,cm2.P,population) >>> lambda_A 0.4 >>> IS_calc(13,0,0,38) 1.5474877953024933 >>> kappa_no_prevalence_calc(cm2.Overall_ACC) 0.33333333333333326 >>> reliability_calc(cm2.Overall_RACC,cm2.Overall_ACC) 0.4740259740259741 >>> mutual_information_calc(cm2.ResponseEntropy,cm2.ConditionalEntropy) 0.39731004447943596 >>> cm3=ConfusionMatrix(matrix=cm2.table) >>> cm3 pycm.ConfusionMatrix(classes: [0, 1, 2]) >>> cm3.CI (0.48885185570907297, 0.8444814776242603) >>> cm3.Chi_Squared 15.525641025641026 >>> cm3.Phi_Squared 0.5750237416904084 >>> cm3.V 0.5362013342441477 >>> cm3.DF 4 >>> cm3.ResponseEntropy 1.486565953154142 >>> cm3.ReferenceEntropy 1.5304930567574824 >>> cm3.CrossEntropy 1.5376219392005763 >>> cm3.JointEntropy 2.619748965432189 >>> cm3.ConditionalEntropy 1.089255908674706 >>> cm3.KL 0.007128882443093773 >>> cm3.LambdaA 0.4 >>> cm3.LambdaB 0.35714285714285715 >>> cm3=ConfusionMatrix(matrix={}) Traceback (most recent call last): ... pycm.pycm_obj.pycmMatrixError: Input confusion matrix format error >>> cm_4=ConfusionMatrix(matrix={1:{1:2,"1":2},"1":{1:2,"1":3}}) Traceback (most recent call last): ... pycm.pycm_obj.pycmMatrixError: Type of the input matrix classes is assumed be the same >>> cm_5=ConfusionMatrix(matrix={1:{1:2}}) Traceback (most recent call last): ... pycm.pycm_obj.pycmVectorError: Number of the classes is lower than 2 >>> save_stat=cm.save_html("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered2",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered3",address=False,overall_param=["Kappa","Scott PI"],class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered4",address=False,overall_param=["Kappa","Scott PI"],class_param=[],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_filtered5",address=False,overall_param=[],class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("test_colored",address=False,color=(130,100,200)) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test",address=False) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered",address=False,class_param=["TPR","TNR","ACC","AUC"]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered2",address=False,class_param=["TPR","TNR","ACC","AUC"],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered3",address=False,class_param=["TPR","TNR","ACC","AUC"],class_name=[]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_csv("test_filtered4",address=False,class_param=[],class_name=[100]) >>> save_stat=={'Status': True, 'Message': None} True >>> save_stat=cm.save_html("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.html'"} True >>> save_stat=cm.save_csv("/asdasd,qweqwe.eo/",address=True) >>> save_stat=={'Status': False, 'Message': "[Errno 2] No such file or directory: '/asdasd,qweqwe.eo/.csv'"} True >>> def activation(i): ... if i<0.7: ... return 1 ... else: ... return 0 >>> cm_6 = ConfusionMatrix([0,0,1,0],[0.87,0.34,0.9,0.12],threshold=activation) >>> cm_6.print_matrix() Predict 0 1 Actual 0 1 2 1 1 0 >>> save_obj=cm.save_obj("test",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file=ConfusionMatrix(file=open("test.obj","r")) >>> print(cm_file) Predict 100 200 500 600 Actual 100 0 0 0 0 <BLANKLINE> 200 9 6 1 0 <BLANKLINE> 500 1 1 1 0 <BLANKLINE> 600 1 0 0 0 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.14096,0.55904) AUNP None AUNU None Bennett S 0.13333 CBA 0.17708 Chi-Squared None Chi-Squared DF 9 Conditional Entropy 1.23579 Cramer V None Cross Entropy 1.70995 Gwet AC1 0.19505 Hamming Loss 0.65 Joint Entropy 2.11997 KL Divergence None Kappa 0.07801 Kappa 95% CI (-0.2185,0.37453) Kappa No Prevalence -0.3 Kappa Standard Error 0.15128 Kappa Unbiased -0.12554 Lambda A 0.0 Lambda B 0.0 Mutual Information 0.10088 NIR 0.8 Overall ACC 0.35 Overall CEN 0.3648 Overall J (0.60294,0.15074) Overall MCC 0.12642 Overall MCEN 0.37463 Overall RACC 0.295 Overall RACCU 0.4225 P-Value 1.0 PPV Macro None PPV Micro 0.35 Phi-Squared None RCI 0.11409 RR 5.0 Reference Entropy 0.88418 Response Entropy 1.33667 SOA1(Landis & Koch) Slight SOA2(Fleiss) Poor SOA3(Altman) Poor SOA4(Cicchetti) Poor Scott PI -0.12554 Standard Error 0.10665 TPR Macro None TPR Micro 0.35 Zero-one Loss 13 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 100 200 500 600 ACC(Accuracy) 0.45 0.45 0.85 0.95 AUC(Area under the roc curve) None 0.5625 0.63725 0.5 AUCI(Auc value interpretation) None Poor Fair Poor BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 DOR(Diagnostic odds ratio) None 1.8 8.0 None DP(Discriminant power) None 0.14074 0.4979 None DPI(Discriminant power interpretation) None Poor Poor None ERR(Error rate) 0.55 0.55 0.15 0.05 F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 F2(F2 score) 0.0 0.42254 0.35714 0.0 FDR(False discovery rate) 1.0 0.14286 0.5 None FN(False negative/miss/type 2 error) 0 10 2 1 FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 FOR(False omission rate) 0.0 0.76923 0.11111 0.05 FP(False positive/type 1 error/false alarm) 11 1 1 0 FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None GI(Gini index) None 0.125 0.27451 0.0 IS(Information score) None 0.09954 1.73697 None J(Jaccard index) 0.0 0.35294 0.25 0.0 LS(Lift score) None 1.07143 3.33333 None MCC(Matthews correlation coefficient) None 0.10483 0.32673 None MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 MK(Markedness) 0.0 0.08791 0.38889 None N(Condition negative) 20 4 17 19 NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 P(Condition positive or support) 0 16 3 1 PLR(Positive likelihood ratio) None 1.5 5.66667 None PLRI(Positive likelihood ratio interpretation) None Poor Fair None POP(Population) 20 20 20 20 PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None PRE(Prevalence) 0.0 0.8 0.15 0.05 RACC(Random accuracy) 0.0 0.28 0.015 0.0 RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 TN(True negative/correct rejection) 9 3 16 19 TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 TON(Test outcome negative) 9 13 18 20 TOP(Test outcome positive) 11 7 2 0 TP(True positive/hit) 0 6 1 0 TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 Y(Youden index) None 0.125 0.27451 0.0 dInd(Distance index) None 0.67315 0.66926 1.0 sInd(Similarity index) None 0.52401 0.52676 0.29289 <BLANKLINE> >>> save_obj=cm_6.save_obj("test2",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file_2=ConfusionMatrix(file=open("test2.obj","r")) >>> cm_file_2.print_matrix() Predict 0 1 Actual 0 1 2 1 1 0 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":9,"Class2":3,"Class3":0},"Class2":{"Class1":3,"Class2":5,"Class3":1},"Class3":{"Class1":1,"Class2":1,"Class3":4}}) >>> print(cm) Predict Class1 Class2 Class3 Actual Class1 9 3 0 <BLANKLINE> Class2 3 5 1 <BLANKLINE> Class3 1 1 4 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.48885,0.84448) AUNP 0.73175 AUNU 0.73929 Bennett S 0.5 CBA 0.63818 Chi-Squared 15.52564 Chi-Squared DF 4 Conditional Entropy 1.08926 Cramer V 0.5362 Cross Entropy 1.53762 Gwet AC1 0.51229 Hamming Loss 0.33333 Joint Entropy 2.61975 KL Divergence 0.00713 Kappa 0.47403 Kappa 95% CI (0.19345,0.7546) Kappa No Prevalence 0.33333 Kappa Standard Error 0.14315 Kappa Unbiased 0.47346 Lambda A 0.4 Lambda B 0.35714 Mutual Information 0.39731 NIR 0.44444 Overall ACC 0.66667 Overall CEN 0.52986 Overall J (1.51854,0.50618) Overall MCC 0.47511 Overall MCEN 0.65286 Overall RACC 0.36626 Overall RACCU 0.36694 P-Value 0.01667 PPV Macro 0.68262 PPV Micro 0.66667 Phi-Squared 0.57502 RCI 0.2596 RR 9.0 Reference Entropy 1.53049 Response Entropy 1.48657 SOA1(Landis & Koch) Moderate SOA2(Fleiss) Intermediate to Good SOA3(Altman) Moderate SOA4(Cicchetti) Fair Scott PI 0.47346 Standard Error 0.09072 TPR Macro 0.65741 TPR Micro 0.66667 Zero-one Loss 9 <BLANKLINE> Class Statistics : <BLANKLINE> Classes Class1 Class2 Class3 ACC(Accuracy) 0.74074 0.7037 0.88889 AUC(Area under the roc curve) 0.74167 0.66667 0.80952 AUCI(Auc value interpretation) Good Fair Very Good BM(Informedness or bookmaker informedness) 0.48333 0.33333 0.61905 CEN(Confusion entropy) 0.45994 0.66249 0.47174 DOR(Diagnostic odds ratio) 8.25 4.375 40.0 DP(Discriminant power) 0.50527 0.35339 0.88326 DPI(Discriminant power interpretation) Poor Poor Poor ERR(Error rate) 0.25926 0.2963 0.11111 F0.5(F0.5 score) 0.70312 0.55556 0.76923 F1(F1 score - harmonic mean of precision and sensitivity) 0.72 0.55556 0.72727 F2(F2 score) 0.7377 0.55556 0.68966 FDR(False discovery rate) 0.30769 0.44444 0.2 FN(False negative/miss/type 2 error) 3 4 2 FNR(Miss rate or false negative rate) 0.25 0.44444 0.33333 FOR(False omission rate) 0.21429 0.22222 0.09091 FP(False positive/type 1 error/false alarm) 4 4 1 FPR(Fall-out or false positive rate) 0.26667 0.22222 0.04762 G(G-measure geometric mean of precision and sensitivity) 0.72058 0.55556 0.7303 GI(Gini index) 0.48333 0.33333 0.61905 IS(Information score) 0.63941 0.73697 1.848 J(Jaccard index) 0.5625 0.38462 0.57143 LS(Lift score) 1.55769 1.66667 3.6 MCC(Matthews correlation coefficient) 0.48067 0.33333 0.66254 MCEN(Modified confusion entropy) 0.57782 0.77284 0.60158 MK(Markedness) 0.47802 0.33333 0.70909 N(Condition negative) 15 18 21 NLR(Negative likelihood ratio) 0.34091 0.57143 0.35 NPV(Negative predictive value) 0.78571 0.77778 0.90909 P(Condition positive or support) 12 9 6 PLR(Positive likelihood ratio) 2.8125 2.5 14.0 PLRI(Positive likelihood ratio interpretation) Poor Poor Good POP(Population) 27 27 27 PPV(Precision or positive predictive value) 0.69231 0.55556 0.8 PRE(Prevalence) 0.44444 0.33333 0.22222 RACC(Random accuracy) 0.21399 0.11111 0.04115 RACCU(Random accuracy unbiased) 0.21433 0.11111 0.0415 TN(True negative/correct rejection) 11 14 20 TNR(Specificity or true negative rate) 0.73333 0.77778 0.95238 TON(Test outcome negative) 14 18 22 TOP(Test outcome positive) 13 9 5 TP(True positive/hit) 9 5 4 TPR(Sensitivity, recall, hit rate, or true positive rate) 0.75 0.55556 0.66667 Y(Youden index) 0.48333 0.33333 0.61905 dInd(Distance index) 0.36553 0.4969 0.33672 sInd(Similarity index) 0.74153 0.64864 0.7619 <BLANKLINE> >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":9,"Class2":3,"Class3":1},"Class2":{"Class1":3,"Class2":5,"Class3":1},"Class3":{"Class1":0,"Class2":1,"Class3":4}},transpose=True) >>> print(cm) Predict Class1 Class2 Class3 Actual Class1 9 3 0 <BLANKLINE> Class2 3 5 1 <BLANKLINE> Class3 1 1 4 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.48885,0.84448) AUNP 0.73175 AUNU 0.73929 Bennett S 0.5 CBA 0.63818 Chi-Squared 15.52564 Chi-Squared DF 4 Conditional Entropy 1.08926 Cramer V 0.5362 Cross Entropy 1.53762 Gwet AC1 0.51229 Hamming Loss 0.33333 Joint Entropy 2.61975 KL Divergence 0.00713 Kappa 0.47403 Kappa 95% CI (0.19345,0.7546) Kappa No Prevalence 0.33333 Kappa Standard Error 0.14315 Kappa Unbiased 0.47346 Lambda A 0.4 Lambda B 0.35714 Mutual Information 0.39731 NIR 0.44444 Overall ACC 0.66667 Overall CEN 0.52986 Overall J (1.51854,0.50618) Overall MCC 0.47511 Overall MCEN 0.65286 Overall RACC 0.36626 Overall RACCU 0.36694 P-Value 0.01667 PPV Macro 0.68262 PPV Micro 0.66667 Phi-Squared 0.57502 RCI 0.2596 RR 9.0 Reference Entropy 1.53049 Response Entropy 1.48657 SOA1(Landis & Koch) Moderate SOA2(Fleiss) Intermediate to Good SOA3(Altman) Moderate SOA4(Cicchetti) Fair Scott PI 0.47346 Standard Error 0.09072 TPR Macro 0.65741 TPR Micro 0.66667 Zero-one Loss 9 <BLANKLINE> Class Statistics : <BLANKLINE> Classes Class1 Class2 Class3 ACC(Accuracy) 0.74074 0.7037 0.88889 AUC(Area under the roc curve) 0.74167 0.66667 0.80952 AUCI(Auc value interpretation) Good Fair Very Good BM(Informedness or bookmaker informedness) 0.48333 0.33333 0.61905 CEN(Confusion entropy) 0.45994 0.66249 0.47174 DOR(Diagnostic odds ratio) 8.25 4.375 40.0 DP(Discriminant power) 0.50527 0.35339 0.88326 DPI(Discriminant power interpretation) Poor Poor Poor ERR(Error rate) 0.25926 0.2963 0.11111 F0.5(F0.5 score) 0.70312 0.55556 0.76923 F1(F1 score - harmonic mean of precision and sensitivity) 0.72 0.55556 0.72727 F2(F2 score) 0.7377 0.55556 0.68966 FDR(False discovery rate) 0.30769 0.44444 0.2 FN(False negative/miss/type 2 error) 3 4 2 FNR(Miss rate or false negative rate) 0.25 0.44444 0.33333 FOR(False omission rate) 0.21429 0.22222 0.09091 FP(False positive/type 1 error/false alarm) 4 4 1 FPR(Fall-out or false positive rate) 0.26667 0.22222 0.04762 G(G-measure geometric mean of precision and sensitivity) 0.72058 0.55556 0.7303 GI(Gini index) 0.48333 0.33333 0.61905 IS(Information score) 0.63941 0.73697 1.848 J(Jaccard index) 0.5625 0.38462 0.57143 LS(Lift score) 1.55769 1.66667 3.6 MCC(Matthews correlation coefficient) 0.48067 0.33333 0.66254 MCEN(Modified confusion entropy) 0.57782 0.77284 0.60158 MK(Markedness) 0.47802 0.33333 0.70909 N(Condition negative) 15 18 21 NLR(Negative likelihood ratio) 0.34091 0.57143 0.35 NPV(Negative predictive value) 0.78571 0.77778 0.90909 P(Condition positive or support) 12 9 6 PLR(Positive likelihood ratio) 2.8125 2.5 14.0 PLRI(Positive likelihood ratio interpretation) Poor Poor Good POP(Population) 27 27 27 PPV(Precision or positive predictive value) 0.69231 0.55556 0.8 PRE(Prevalence) 0.44444 0.33333 0.22222 RACC(Random accuracy) 0.21399 0.11111 0.04115 RACCU(Random accuracy unbiased) 0.21433 0.11111 0.0415 TN(True negative/correct rejection) 11 14 20 TNR(Specificity or true negative rate) 0.73333 0.77778 0.95238 TON(Test outcome negative) 14 18 22 TOP(Test outcome positive) 13 9 5 TP(True positive/hit) 9 5 4 TPR(Sensitivity, recall, hit rate, or true positive rate) 0.75 0.55556 0.66667 Y(Youden index) 0.48333 0.33333 0.61905 dInd(Distance index) 0.36553 0.4969 0.33672 sInd(Similarity index) 0.74153 0.64864 0.7619 <BLANKLINE> >>> online_help(param=None) Please choose one parameter : <BLANKLINE> Example : online_help("J") or online_help(2) <BLANKLINE> 1-95% CI 2-ACC 3-AUC 4-AUCI 5-AUNP 6-AUNU 7-BM 8-Bennett S 9-CBA 10-CEN 11-Chi-Squared 12-Chi-Squared DF 13-Conditional Entropy 14-Cramer V 15-Cross Entropy 16-DOR 17-DP 18-DPI 19-ERR 20-F0.5 21-F1 22-F2 23-FDR 24-FN 25-FNR 26-FOR 27-FP 28-FPR 29-G 30-GI 31-Gwet AC1 32-Hamming Loss 33-IS 34-J 35-Joint Entropy 36-KL Divergence 37-Kappa 38-Kappa 95% CI 39-Kappa No Prevalence 40-Kappa Standard Error 41-Kappa Unbiased 42-LS 43-Lambda A 44-Lambda B 45-MCC 46-MCEN 47-MK 48-Mutual Information 49-N 50-NIR 51-NLR 52-NPV 53-Overall ACC 54-Overall CEN 55-Overall J 56-Overall MCC 57-Overall MCEN 58-Overall RACC 59-Overall RACCU 60-P 61-P-Value 62-PLR 63-PLRI 64-POP 65-PPV 66-PPV Macro 67-PPV Micro 68-PRE 69-Phi-Squared 70-RACC 71-RACCU 72-RCI 73-RR 74-Reference Entropy 75-Response Entropy 76-SOA1(Landis & Koch) 77-SOA2(Fleiss) 78-SOA3(Altman) 79-SOA4(Cicchetti) 80-Scott PI 81-Standard Error 82-TN 83-TNR 84-TON 85-TOP 86-TP 87-TPR 88-TPR Macro 89-TPR Micro 90-Y 91-Zero-one Loss 92-dInd 93-sInd >>> online_help("J") ... >>> online_help(4) ... >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2] >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2] >>> cm = ConfusionMatrix(y_actu, y_pred, sample_weight=[2, 2, 2, 2, 3, 1, 1, 2, 2, 1, 1, 2]) >>> print(cm) Predict 0 1 2 Actual 0 6 0 0 <BLANKLINE> 1 0 1 2 <BLANKLINE> 2 4 2 6 <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> <BLANKLINE> Overall Statistics : <BLANKLINE> 95% CI (0.41134,0.82675) AUNP 0.7 AUNU 0.70556 Bennett S 0.42857 CBA 0.47778 Chi-Squared 10.44167 Chi-Squared DF 4 Conditional Entropy 0.96498 Cramer V 0.49861 Cross Entropy 1.50249 Gwet AC1 0.45277 Hamming Loss 0.38095 Joint Entropy 2.34377 KL Divergence 0.1237 Kappa 0.3913 Kappa 95% CI (0.05943,0.72318) Kappa No Prevalence 0.2381 Kappa Standard Error 0.16932 Kappa Unbiased 0.37313 Lambda A 0.22222 Lambda B 0.36364 Mutual Information 0.47618 NIR 0.57143 Overall ACC 0.61905 Overall CEN 0.43947 Overall J (1.22857,0.40952) Overall MCC 0.41558 Overall MCEN 0.50059 Overall RACC 0.37415 Overall RACCU 0.39229 P-Value 0.41709 PPV Macro 0.56111 PPV Micro 0.61905 Phi-Squared 0.49722 RCI 0.34536 RR 7.0 Reference Entropy 1.37878 Response Entropy 1.44117 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.37313 Standard Error 0.10597 TPR Macro 0.61111 TPR Micro 0.61905 Zero-one Loss 8 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.80952 0.80952 0.61905 AUC(Area under the roc curve) 0.86667 0.61111 0.63889 AUCI(Auc value interpretation) Very Good Fair Fair BM(Informedness or bookmaker informedness) 0.73333 0.22222 0.27778 CEN(Confusion entropy) 0.25 0.52832 0.56439 DOR(Diagnostic odds ratio) None 4.0 3.5 DP(Discriminant power) None 0.33193 0.29996 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.19048 0.19048 0.38095 F0.5(F0.5 score) 0.65217 0.33333 0.68182 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.33333 0.6 F2(F2 score) 0.88235 0.33333 0.53571 FDR(False discovery rate) 0.4 0.66667 0.25 FN(False negative/miss/type 2 error) 0 2 6 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.11111 0.46154 FP(False positive/type 1 error/false alarm) 4 2 2 FPR(Fall-out or false positive rate) 0.26667 0.11111 0.22222 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.33333 0.61237 GI(Gini index) 0.73333 0.22222 0.27778 IS(Information score) 1.07039 1.22239 0.39232 J(Jaccard index) 0.6 0.2 0.42857 LS(Lift score) 2.1 2.33333 1.3125 MCC(Matthews correlation coefficient) 0.66332 0.22222 0.28307 MCEN(Modified confusion entropy) 0.26439 0.52877 0.65924 MK(Markedness) 0.6 0.22222 0.28846 N(Condition negative) 15 18 9 NLR(Negative likelihood ratio) 0.0 0.75 0.64286 NPV(Negative predictive value) 1.0 0.88889 0.53846 P(Condition positive or support) 6 3 12 PLR(Positive likelihood ratio) 3.75 3.0 2.25 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 21 21 21 PPV(Precision or positive predictive value) 0.6 0.33333 0.75 PRE(Prevalence) 0.28571 0.14286 0.57143 RACC(Random accuracy) 0.13605 0.02041 0.21769 RACCU(Random accuracy unbiased) 0.14512 0.02041 0.22676 TN(True negative/correct rejection) 11 16 7 TNR(Specificity or true negative rate) 0.73333 0.88889 0.77778 TON(Test outcome negative) 11 18 13 TOP(Test outcome positive) 10 3 8 TP(True positive/hit) 6 1 6 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.73333 0.22222 0.27778 dInd(Distance index) 0.26667 0.67586 0.54716 sInd(Similarity index) 0.81144 0.52209 0.6131 <BLANKLINE> >>> save_obj=cm.save_obj("test3",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file_3=ConfusionMatrix(file=open("test3.obj","r")) >>> cm_file_3.print_matrix() Predict 0 1 2 Actual 0 6 0 0 1 0 1 2 2 4 2 6 <BLANKLINE> >>> cm_file_3.stat() Overall Statistics : <BLANKLINE> 95% CI (0.41134,0.82675) AUNP 0.7 AUNU 0.70556 Bennett S 0.42857 CBA 0.47778 Chi-Squared 10.44167 Chi-Squared DF 4 Conditional Entropy 0.96498 Cramer V 0.49861 Cross Entropy 1.50249 Gwet AC1 0.45277 Hamming Loss 0.38095 Joint Entropy 2.34377 KL Divergence 0.1237 Kappa 0.3913 Kappa 95% CI (0.05943,0.72318) Kappa No Prevalence 0.2381 Kappa Standard Error 0.16932 Kappa Unbiased 0.37313 Lambda A 0.22222 Lambda B 0.36364 Mutual Information 0.47618 NIR 0.57143 Overall ACC 0.61905 Overall CEN 0.43947 Overall J (1.22857,0.40952) Overall MCC 0.41558 Overall MCEN 0.50059 Overall RACC 0.37415 Overall RACCU 0.39229 P-Value 0.41709 PPV Macro 0.56111 PPV Micro 0.61905 Phi-Squared 0.49722 RCI 0.34536 RR 7.0 Reference Entropy 1.37878 Response Entropy 1.44117 SOA1(Landis & Koch) Fair SOA2(Fleiss) Poor SOA3(Altman) Fair SOA4(Cicchetti) Poor Scott PI 0.37313 Standard Error 0.10597 TPR Macro 0.61111 TPR Micro 0.61905 Zero-one Loss 8 <BLANKLINE> Class Statistics : <BLANKLINE> Classes 0 1 2 ACC(Accuracy) 0.80952 0.80952 0.61905 AUC(Area under the roc curve) 0.86667 0.61111 0.63889 AUCI(Auc value interpretation) Very Good Fair Fair BM(Informedness or bookmaker informedness) 0.73333 0.22222 0.27778 CEN(Confusion entropy) 0.25 0.52832 0.56439 DOR(Diagnostic odds ratio) None 4.0 3.5 DP(Discriminant power) None 0.33193 0.29996 DPI(Discriminant power interpretation) None Poor Poor ERR(Error rate) 0.19048 0.19048 0.38095 F0.5(F0.5 score) 0.65217 0.33333 0.68182 F1(F1 score - harmonic mean of precision and sensitivity) 0.75 0.33333 0.6 F2(F2 score) 0.88235 0.33333 0.53571 FDR(False discovery rate) 0.4 0.66667 0.25 FN(False negative/miss/type 2 error) 0 2 6 FNR(Miss rate or false negative rate) 0.0 0.66667 0.5 FOR(False omission rate) 0.0 0.11111 0.46154 FP(False positive/type 1 error/false alarm) 4 2 2 FPR(Fall-out or false positive rate) 0.26667 0.11111 0.22222 G(G-measure geometric mean of precision and sensitivity) 0.7746 0.33333 0.61237 GI(Gini index) 0.73333 0.22222 0.27778 IS(Information score) 1.07039 1.22239 0.39232 J(Jaccard index) 0.6 0.2 0.42857 LS(Lift score) 2.1 2.33333 1.3125 MCC(Matthews correlation coefficient) 0.66332 0.22222 0.28307 MCEN(Modified confusion entropy) 0.26439 0.52877 0.65924 MK(Markedness) 0.6 0.22222 0.28846 N(Condition negative) 15 18 9 NLR(Negative likelihood ratio) 0.0 0.75 0.64286 NPV(Negative predictive value) 1.0 0.88889 0.53846 P(Condition positive or support) 6 3 12 PLR(Positive likelihood ratio) 3.75 3.0 2.25 PLRI(Positive likelihood ratio interpretation) Poor Poor Poor POP(Population) 21 21 21 PPV(Precision or positive predictive value) 0.6 0.33333 0.75 PRE(Prevalence) 0.28571 0.14286 0.57143 RACC(Random accuracy) 0.13605 0.02041 0.21769 RACCU(Random accuracy unbiased) 0.14512 0.02041 0.22676 TN(True negative/correct rejection) 11 16 7 TNR(Specificity or true negative rate) 0.73333 0.88889 0.77778 TON(Test outcome negative) 11 18 13 TOP(Test outcome positive) 10 3 8 TP(True positive/hit) 6 1 6 TPR(Sensitivity, recall, hit rate, or true positive rate) 1.0 0.33333 0.5 Y(Youden index) 0.73333 0.22222 0.27778 dInd(Distance index) 0.26667 0.67586 0.54716 sInd(Similarity index) 0.81144 0.52209 0.6131 >>> NIR_calc({'Class2': 804, 'Class1': 196},1000) # Verified Case 0.804 >>> cm = ConfusionMatrix(matrix={0:{0:3,1:1},1:{0:4,1:2}}) # Verified Case >>> cm.LS[1] 1.1111111111111112 >>> cm.LS[0] 1.0714285714285714 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":183,"Class2":13},"Class2":{"Class1":141,"Class2":663}}) # Verified Case >>> cm.PValue 0.000342386296143693 >>> cm = ConfusionMatrix(matrix={"Class1":{"Class1":4,"Class2":2},"Class2":{"Class1":2,"Class2":4}}) # Verified Case >>> cm.Overall_CEN 0.861654166907052 >>> cm.Overall_MCEN 0.6666666666666666 >>> cm.IS["Class1"] 0.4150374992788437 >>> cm.IS["Class2"] 0.4150374992788437 >>> cm = ConfusionMatrix(matrix={1:{1:5,2:0,3:0},2:{1:0,2:10,3:0},3:{1:0,2:300,3:0}}) # Verified Case >>> cm.Overall_CEN 0.022168905807495587 >>> cm.Overall_MCC 0.3012440235352457 >>> cm.CBA 0.3440860215053763 >>> cm = ConfusionMatrix(matrix={1:{1:1,2:3,3:0,4:0},2:{1:9,2:1,3:0,4:0},3:{1:0,2:0,3:100,4:0},4:{1:0,2:0,3:0,4:200}}) # Verified Case >>> cm.RCI 0.9785616782831341 >>> cm = ConfusionMatrix(matrix={1:{1:1,2:0,3:3},2:{1:0,2:100,3:0},3:{1:0,2:0,3:200}}) # Verified Case >>> cm.RCI 0.9264007150415143 >>> cm = ConfusionMatrix(matrix={1:{1:5,2:0,3:0},2:{1:0,2:10,3:0},3:{1:0,2:300,3:0}}) >>> cm.RCI 0.3675708571923818 >>> cm = ConfusionMatrix(matrix={1:{1:12806,2:26332},2:{1:5484,2:299777}},transpose=True) # Verified Case >>> cm.AUC[1] 0.8097090079101759 >>> cm.GI[1] 0.6194180158203517 >>> cm.Overall_ACC 0.9076187793808925 >>> cm.DP[1] 0.7854399677022138 >>> cm.Y[1] 0.6194180158203517 >>> cm.BM[1] 0.6194180158203517 >>> cm = ConfusionMatrix(matrix={1:{1:13182,2:30516},2:{1:5108,2:295593}},transpose=True) # Verified Case >>> cm.AUC[1] 0.8135728157964055 >>> cm.GI[1] 0.627145631592811 >>> cm.Overall_ACC 0.896561836706843 >>> cm.DP[1] 0.770700985610517 >>> cm.Y[1] 0.627145631592811 >>> cm.BM[1] 0.627145631592811 >>> save_obj = cm.save_obj("test4",address=False) >>> save_obj=={'Status': True, 'Message': None} True >>> cm_file=ConfusionMatrix(file=open("test4.obj","r")) >>> cm_file.DP[1] 0.770700985610517 >>> cm_file.Y[1] 0.627145631592811 >>> cm_file.BM[1] 0.627145631592811 >>> cm_file.transpose True >>> json.dump({"Actual-Vector": None, "Digit": 5, "Predict-Vector": None, "Matrix": {"0": {"0": 3, "1": 0, "2": 2}, "1": {"0": 0, "1": 1, "2": 1}, "2": {"0": 0, "1": 2, "2": 3}}, "Transpose": True,"Sample-Weight": None},open("test5.obj","w")) >>> cm_file=ConfusionMatrix(file=open("test5.obj","r")) >>> cm_file.transpose True >>> cm_file.matrix == {"0": {"0": 3, "1": 0, "2": 2}, "1": {"0": 0, "1": 1, "2": 1}, "2": {"0": 0, "1": 2, "2": 3}} True >>> cm = ConfusionMatrix([1,2,3,4],[1,2,3,"4"]) >>> cm pycm.ConfusionMatrix(classes: ['1', '2', '3', '4']) >>> os.remove("test.csv") >>> os.remove("test.obj") >>> os.remove("test.html") >>> os.remove("test_filtered.html") >>> os.remove("test_filtered.csv") >>> os.remove("test_filtered.pycm") >>> os.remove("test_filtered2.html") >>> os.remove("test_filtered3.html") >>> os.remove("test_filtered4.html") >>> os.remove("test_filtered5.html") >>> os.remove("test_colored.html") >>> os.remove("test_filtered2.csv") >>> os.remove("test_filtered3.csv") >>> os.remove("test_filtered4.csv") >>> os.remove("test_filtered2.pycm") >>> os.remove("test_filtered3.pycm") >>> os.remove("test2.obj") >>> os.remove("test3.obj") >>> os.remove("test4.obj") >>> os.remove("test5.obj") >>> os.remove("test.pycm") '''
63.804618
242
0.336498
9,342
107,766
3.839863
0.087133
0.011597
0.006607
0.003122
0.821393
0.796917
0.787076
0.776622
0.771409
0.760733
0
0.229252
0.599605
107,766
1,688
243
63.842417
0.6021
1.000176
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
10
b5ad6e42e2742bc57f8d376feb9a3627c6dc04f9
131
py
Python
ceml/backend/torch/layer.py
andreArtelt/ceml
364d4630d6a01592c2ab86f2d53dbb7feb682381
[ "MIT" ]
24
2019-07-12T08:11:25.000Z
2021-12-09T19:24:53.000Z
ceml/backend/torch/layer.py
andreArtelt/ceml
364d4630d6a01592c2ab86f2d53dbb7feb682381
[ "MIT" ]
6
2020-09-28T04:42:44.000Z
2021-09-27T06:59:36.000Z
ceml/backend/torch/layer.py
andreArtelt/ceml
364d4630d6a01592c2ab86f2d53dbb7feb682381
[ "MIT" ]
7
2019-09-11T13:54:57.000Z
2021-01-14T13:13:26.000Z
# -*- coding: utf-8 -*- import torch def create_tensor(x, device=torch.device('cpu')): return torch.Tensor(x, device=device)
18.714286
49
0.671756
19
131
4.578947
0.631579
0.16092
0.298851
0
0
0
0
0
0
0
0
0.008929
0.145038
131
6
50
21.833333
0.767857
0.160305
0
0
0
0
0.027778
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
7
a90d80bd18f914be6a279e0bb5c198bba220bae4
8,186
py
Python
simulations_collection.py
skdys/quantumwave
40374b8fce1adec210b0afdef0c656ede1b15703
[ "MIT" ]
2
2019-09-15T11:49:09.000Z
2020-12-29T12:33:58.000Z
simulations_collection.py
skdys/quantumwave
40374b8fce1adec210b0afdef0c656ede1b15703
[ "MIT" ]
null
null
null
simulations_collection.py
skdys/quantumwave
40374b8fce1adec210b0afdef0c656ede1b15703
[ "MIT" ]
1
2019-11-27T12:06:44.000Z
2019-11-27T12:06:44.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Collection of predefined simulations. Authors: - Andrea Maiani <andrea.maiani@mail.polimi.it> - Ciro Pentangelo <ciro.pentangelo@mail.polimi.it>""" import numpy as np import quickfunctions as qf from schrodingersim import SchrodingerSimulation def square_barrier(): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "squar_barrier" p0 = 1 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = qf.square_barrier(x, 2, 2) ss.set_static_potential(V_x) return ss, x0, p0 def invisible_susy(a=1j, c=1): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "invisible_susy_a" + str(a) + "c" + str(c) p0 = 1 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = qf.invisible_susy(x, a=a, c=c) ss.set_static_potential(V_x) return ss, x0, p0 def reflectionless(l=1): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "reflectionless-" + str(l) p0 = 0.8 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = qf.reflectionless(x, l=l) ss.set_static_potential(V_x) return ss, x0, p0 def kk(n, a, c, A): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "kk_n" + str(n) + "a" + str(a) + "c" + str(c) + "A" + str(A) p0 = 1 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = qf.kk(x=x, n=n, a=a, A=A, c=c) ss.set_static_potential(V_x) return ss, x0, p0 def kk_wrong(n, a, c, A): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "kk-wrong_n" + str(n) + "a" + str(a) + "c" + str(c) + "A" + str(A) p0 = -1 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = 50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = qf.kk(x=x, n=n, a=a, A=A, c=c) ss.set_static_potential(V_x) return ss, x0, p0 def tentativo(): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "tentativo" p0 = 0.8 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -40 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = 1j * np.imag(qf.kk(x, n=1, a=1j, c=3, A=20)) ss.set_static_potential(V_x) return ss, x0, p0 def dancing(): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "dancing" x = dx * (np.arange(Nx) - 0.5 * Nx) p0 = 0 d = 3 x0 = 0 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) V_x = qf.theta(x + 1) - qf.theta(x - 1) V_x[x < -20] = 1E6 V_x[x > 20] = 1E6 V_x = np.array([V_x]) ss.set_static_potential(V_x) return ss, x0, p0 # Time dependent potentials def osc_barrier(): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "oscillating_barrier" p0 = 1 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) freq = 0.1 amp = 10 V_x = np.zeros((Nt, Nx)) for i in range(Nt - 1): V = np.zeros((Nx)) V[x < -99] = 1E6 V[x > 99] = 1E6 V += qf.square_barrier(x + amp * np.cos(2 * np.pi * freq * t[i]), 4, 2) V_x[i] = V ss.set_potential(V_x) return ss, x0, p0 def osc_invisible(): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "oscillating_invisible" p0 = 0.75 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) freq = 0.3 amp = 10 V_x = np.zeros((Nt, Nx), dtype=np.complex128) for i in range(Nt - 1): V = np.zeros((Nx), dtype=np.complex128) V[x < -99] = 1E6 V[x > 99] = 1E6 V += qf.invisible_susy(x + amp * np.cos(2 * np.pi * freq * t[i])) V_x[i] = V ss.set_potential(V_x) return ss, x0, p0 def osc_reflectionless(l=1): Nx = 2 ** 13 dx = 0.03 t0 = 0.0 dt = 0.02 Nt = int(105 / dt) x = dx * (np.arange(Nx) - 0.5 * Nx) t = t0 + dt * np.arange(Nt) simname = "oscillating_reflectionless" p0 = 0.75 dp2 = p0 * p0 * 1. / 80 d = 1 / np.sqrt(2 * dp2) x0 = -50 psi_x0 = qf.gauss_x(x, d, x0, p0) norm = np.sqrt((np.abs(psi_x0) ** 2).sum() * 2 * np.pi / dx) psi_x0 = psi_x0 / norm ss = SchrodingerSimulation(Nx=Nx, dx=dx, t0=t0, Nt=Nt, dt=dt, psi_x0=psi_x0, normalize=False, simname=simname) freq = 0.05 amp = 10 V_x = np.zeros((Nt, Nx), dtype=np.complex128) for i in range(Nt - 1): V = np.zeros((Nx), dtype=np.complex128) V += qf.reflectionless(x + amp * np.cos(2 * np.pi * freq * t[i]), l) V_x[i] = V ss.set_potential(V_x) return ss, x0, p0
25.187692
80
0.487295
1,403
8,186
2.749109
0.079116
0.077781
0.041483
0.051854
0.858698
0.858698
0.856106
0.851439
0.842365
0.842365
0
0.099944
0.349743
8,186
324
81
25.265432
0.624648
0.026997
0
0.818548
0
0
0.018477
0.005907
0
0
0
0
0
1
0.040323
false
0
0.012097
0
0.092742
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
8d4441acb8c0d40b7045a32efde0b43365b1a7bc
109
py
Python
taskifier/tests/__init__.py
Vraid-Systems/taskifier
9d4976988d762ea673f28576433abd7c0f4cae33
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
taskifier/tests/__init__.py
Vraid-Systems/taskifier
9d4976988d762ea673f28576433abd7c0f4cae33
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
taskifier/tests/__init__.py
Vraid-Systems/taskifier
9d4976988d762ea673f28576433abd7c0f4cae33
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
from taskifier.tests.queue import * from taskifier.tests.helpers import * from taskifier.tests.full import *
27.25
37
0.807339
15
109
5.866667
0.466667
0.443182
0.613636
0.545455
0
0
0
0
0
0
0
0
0.110092
109
3
38
36.333333
0.907216
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
8d6bd5372390951b7d4511a238139dea4c1a6383
17,009
py
Python
hemeraplatformsdk/FileUploader.py
hemeraos/hemeraplatformsdk
21ae424a45a5a5453d62dba2efaed1439e144da1
[ "Apache-2.0" ]
null
null
null
hemeraplatformsdk/FileUploader.py
hemeraos/hemeraplatformsdk
21ae424a45a5a5453d62dba2efaed1439e144da1
[ "Apache-2.0" ]
null
null
null
hemeraplatformsdk/FileUploader.py
hemeraos/hemeraplatformsdk
21ae424a45a5a5453d62dba2efaed1439e144da1
[ "Apache-2.0" ]
1
2021-02-10T12:44:56.000Z
2021-02-10T12:44:56.000Z
#!/usr/bin/python3 import io import json import os from json import JSONDecodeError import paramiko import scp import requests import time lastTimeCalled = [0.0] class StoreNotAvailableException(Exception): def __init__(self, *args, **kwargs): Exception.__init__(self, *args, **kwargs) class FileUploader: def __init__(self, metadata): self.data = metadata # Manage host depending on environment variables try: self.host = os.environ[self.data["host"]] except KeyError: self.host = self.data["host"] def check_store_has_image(self, name, group, version=None, variant=None): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support listing files.") def get_old_versions_from_store(self, name, group, variant=None): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support listing old versions.") def can_store_images(self): return False def can_store_updates(self): return False def upload_image(self, name, group, metadata, image, version=None, variant=None): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support storing images.") def upload_recovery_package(self, name, group, metadata, package, version, variant=None): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support storing recovery packages.") def upload_file(self, src, dest): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support storing files.") def upload_update_package(self, name, group, metadata, package, version, variant=None): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support storing updates.") def upload_recovery_package(self, name, group, metadata, package, version, variant=None): raise StoreNotAvailableException("Storage " + self.data["type"] + " does not support storing recovery packages.") def scp_upload_progress_callback(filename, size, sent): # TODO: As soon as we find a decent way to use it. pass # print("--- Upload in progress, {}%".format(int((sent / size) * 100))) class SCPFileUploader(FileUploader): def __init__(self, metadata): super().__init__(metadata) self.client = paramiko.SSHClient() self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.client.load_system_host_keys() # Environment variables? if "SSH_PRIVATE_KEY" in os.environ: # Get key from os.environ keyfile = io.StringIO(os.environ["SSH_PRIVATE_KEY"]) pkey = paramiko.RSAKey.from_private_key(keyfile) self.client.connect(self.host, username=self.data["user"], pkey=pkey) elif "privatekey" in self.data: if "privatekey_password" in self.data: pkey = paramiko.RSAKey.from_private_key_file(filename=self.data["privatekey"], password=self.data["privatekey_password"]) else: pkey = paramiko.RSAKey.from_private_key_file(filename=self.data["privatekey"]) self.client.connect(self.host, username=self.data["user"], pkey=pkey) elif "password" in self.data: self.client.connect(self.host, username=self.data["user"], password=self.data["password"]) else: self.client.connect(self.host, username=self.data["user"]) def can_store_images(self): return True def can_store_updates(self): return False def check_store_has_image(self, name, group, version=None, variant=None): check_path = os.path.join(self.data["base_upload_path"], group, name) if version: check_path = os.path.join(check_path, "releases", version) if variant: image_wildcard = name + "_" + variant + "*" else: image_wildcard = name + "*" check_path = os.path.join(check_path, image_wildcard) _, stdout, _ = self.client.exec_command("[ -f " + check_path + " ] && echo OK") if stdout.read(): return True else: return False def get_old_versions_from_store(self, name, group, variant=None): old_versions = [] match_string = name if variant: match_string += "_" + variant with paramiko.SFTPClient.from_transport(self.client.get_transport()) as sftp: dirs = sftp.listdir(os.path.join(self.data["base_upload_path"], group, name, "releases")) for d in dirs: files = sftp.listdir(os.path.join(self.data["base_upload_path"], group, name, "releases", d)) for f in files: if match_string + "-" + d in f and ".metadata" in f: mf = sftp.file(os.path.join(self.data["base_upload_path"], group, name, "releases", d, f)) metadata = mf.read() try: old_versions.append((d, json.loads(metadata))) except JSONDecodeError: print("---- WARNING: Failed to retrieve metadata for {}! " "Metadata is malformed. Skipping...".format(f)) break return old_versions def upload_image(self, name, group, metadata, image, version=None, variant=None): upload_path = os.path.join(self.data["base_upload_path"], group, name) if version: upload_path = os.path.join(upload_path, "releases", version) # Create directory first self.client.exec_command("mkdir -p " + upload_path) # Go self.upload_file(metadata, os.path.join(upload_path, metadata.split('/')[-1])) self.upload_file(image, os.path.join(upload_path, image.split('/')[-1])) def upload_recovery_package(self, name, group, metadata, package, version, variant=None): upload_path = os.path.join(self.data["base_upload_path"], group, name, "releases", version) # Create directory first self.client.exec_command("mkdir -p " + upload_path) # Go self.upload_file(metadata, os.path.join(upload_path, metadata.split('/')[-1])) self.upload_file(package, os.path.join(upload_path, package.split('/')[-1])) def upload_update_package(self, name, group, metadata, package, version, variant=None): upload_path = os.path.join(self.data["base_upload_path"], group, name, "releases", version) # Create directory first self.client.exec_command("mkdir -p " + upload_path) # Go self.upload_file(metadata, os.path.join(upload_path, metadata.split('/')[-1])) self.upload_file(package, os.path.join(upload_path, package.split('/')[-1])) def upload_file(self, src, dest): print("---- Uploading", src, "to", self.host, "...") try: with scp.SCPClient(self.client.get_transport(), progress=scp_upload_progress_callback) as scp_client: scp_client.put(src, os.path.join(self.data["base_upload_path"], dest)) except scp.SCPException: if "metadata" in src: print("WARNING: Could not upload metadata. This could be normal behavior if no uploaders requiring " "metadata have been configured.") else: raise class ImageStoreFileUploader(FileUploader): def __init__(self, metadata): super().__init__(metadata) try: self.verify_ssl = self.data["verify_ssl"] if not self.verify_ssl: print("WARNING: The Server's SSL certificate will be trusted regardless. " "This should only be used when testing!!") except KeyError: # Always verify SSL by default! self.verify_ssl = True def can_store_images(self): return True def can_store_updates(self): return True def get_old_versions_from_store(self, name, group, variant=None): print("---- Getting old versions from ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name r = requests.get('{}/images/{}'.format(self.host, appliance_name), verify=self.verify_ssl, headers={'X-API-Key': self.data["api_key"]}) if r.status_code != 200: print("---- Getting versions failed! Return code: ", r.status_code, r.text) raise Exception("Getting versions failed", r.text) try: return json.loads(r.text) except JSONDecodeError: raise Exception("Getting versions failed - message malformed", r.text) def check_store_has_image(self, name, group, version=None, variant=None): try: appliance_name = name + "_" + variant except: appliance_name = name r = requests.options('{}/images/{}/{}'.format(self.host, appliance_name, version if version else 'rolling'), verify=self.verify_ssl, headers={'X-API-Key': self.data["api_key"]}) if r.status_code != 200: raise FileNotFoundError("Image not available in store!") try: return json.loads(r.text) except JSONDecodeError: raise FileNotFoundError("Image not available in store!") def upload_image(self, name, group, metadata, image, version=None, variant=None): print("---- Uploading image payload to ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name payload = {'metadata': open(metadata, 'r'), 'image': open(image, 'rb')} r = requests.post('{}/images/{}/{}'.format(self.host, appliance_name, version if version else 'rolling'), files=payload, verify=self.verify_ssl, headers={'X-API-Key': self.data["api_key"]}) if r.status_code != 200: print("---- Upload failed! Return code: ", r.status_code, r.text) raise Exception("Upload failed", r.text) def upload_recovery_package(self, name, group, metadata, package, version, variant=None): print("---- Uploading recovery package to ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name payload = {'metadata': open(metadata, 'r'), 'package': open(package, 'rb')} r = requests.post('{}/updates/{}/{}'.format(self.host, appliance_name, version), files=payload, verify=self.verify_ssl, headers={'X-API-Key': self.data["api_key"]}) if r.status_code != 200: print("---- Upload failed! Return code: ", r.status_code, r.text) raise Exception("Upload failed", r.text) print("---- Upload successful!") def upload_update_package(self, name, group, metadata, package, version, variant=None): print("---- Uploading update package to ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name payload = {'metadata': open(metadata, 'r'), 'package': open(package, 'rb')} r = requests.post('{}/updates/{}/{}'.format(self.host, appliance_name, version), files=payload, verify=self.verify_ssl, headers={'X-API-Key': self.data["api_key"]}) if r.status_code != 200: print("---- Upload failed! Return code: ", r.status_code, r.text) raise Exception("Upload failed", r.text) print("---- Upload successful!") class ImageStoreV2FileUploader(FileUploader): def __init__(self, metadata): super().__init__(metadata) self.organization = self.data["organization"] try: self.verify_ssl = self.data["verify_ssl"] if not self.verify_ssl: print("WARNING: The Server's SSL certificate will be trusted regardless. " "This should only be used when testing!!") except KeyError: # Always verify SSL by default! self.verify_ssl = True def can_store_images(self): return True def can_store_updates(self): return True def get_old_versions_from_store(self, name, group, variant=None): print("---- Getting old versions from ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name r = requests.get('{}/api/v1/{}/images/{}'.format(self.host, self.organization, appliance_name), verify=self.verify_ssl, headers={'Authorization': self.data["api_key"]}) if r.status_code != 200: print("---- Getting versions failed! Return code: ", r.status_code, r.text) raise Exception("Getting versions failed", r.text) try: return json.loads(r.text) except JSONDecodeError: raise Exception("Getting versions failed - message malformed", r.text) def check_store_has_image(self, name, group, version=None, variant=None): try: appliance_name = name + "_" + variant except: appliance_name = name r = requests.options('{}/api/v1/{}/images/{}/{}'.format(self.host, self.organization, appliance_name, version if version else 'rolling'), verify=self.verify_ssl, headers={'Authorization': self.data["api_key"]}) if r.status_code != 200: raise FileNotFoundError("Image not available in store!") try: return json.loads(r.text) except JSONDecodeError: raise FileNotFoundError("Image not available in store!") def upload_image(self, name, group, metadata, image, version=None, variant=None): print("---- Uploading image payload to ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name payload = {'metadata': open(metadata, 'r'), 'package': open(image, 'rb')} r = requests.post('{}/api/v1/{}/images/{}/{}'.format(self.host, self.organization, appliance_name, version if version else 'rolling'), files=payload, verify=self.verify_ssl, headers={'Authorization': self.data["api_key"]}) if r.status_code != 200: print("---- Upload failed! Return code: ", r.status_code, r.text) raise Exception("Upload failed", r.text) def upload_recovery_package(self, name, group, metadata, package, version, variant=None): print("---- Uploading recovery package to ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name payload = {'metadata': open(metadata, 'r'), 'package': open(package, 'rb')} r = requests.post('{}/api/v1/{}/updates/{}/{}'.format(self.host, self.organization, appliance_name, version), files=payload, verify=self.verify_ssl, headers={'Authorization': self.data["api_key"]}) if r.status_code != 200: print("---- Upload failed! Return code: ", r.status_code, r.text) raise Exception("Upload failed", r.text) print("---- Upload successful!") def upload_update_package(self, name, group, metadata, package, version, variant=None): print("---- Uploading update package to ImageStore endpoint", self.host, "...") try: appliance_name = name + "_" + variant except: appliance_name = name payload = {'metadata': open(metadata, 'r'), 'package': open(package, 'rb')} r = requests.post('{}/api/v1/{}/updates/{}/{}'.format(self.host, self.organization, appliance_name, version), files=payload, verify=self.verify_ssl, headers={'Authorization': self.data["api_key"]}) if r.status_code != 200: print("---- Upload failed! Return code: ", r.status_code, r.text) raise Exception("Upload failed", r.text) print("---- Upload successful!")
40.985542
121
0.588453
1,889
17,009
5.149815
0.115934
0.034539
0.028063
0.028063
0.816303
0.807463
0.791118
0.784025
0.771896
0.751953
0
0.003954
0.286319
17,009
414
122
41.084541
0.79743
0.021636
0
0.724252
0
0
0.17237
0.007458
0
0
0
0.002415
0
1
0.122924
false
0.016611
0.026578
0.026578
0.215947
0.083056
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
a5d05d9b947ae84221f1511f2af52ce64d69546a
57,544
py
Python
modules/tests/photons_control_tests/planner/test_gatherer.py
Djelibeybi/photons
bc0aa91771d8e88fd3c691fb58f18cb876f292ec
[ "MIT" ]
51
2020-07-03T08:34:48.000Z
2022-03-16T10:56:08.000Z
modules/tests/photons_control_tests/planner/test_gatherer.py
delfick/photons
bc0aa91771d8e88fd3c691fb58f18cb876f292ec
[ "MIT" ]
81
2020-07-03T08:13:59.000Z
2022-03-31T23:02:54.000Z
modules/tests/photons_control_tests/planner/test_gatherer.py
Djelibeybi/photons
bc0aa91771d8e88fd3c691fb58f18cb876f292ec
[ "MIT" ]
8
2020-07-24T23:48:20.000Z
2021-05-24T17:20:16.000Z
# coding: spec from photons_control.planner import Gatherer, make_plans, Plan, NoMessages, Skip from photons_app.errors import TimedOut, BadRunWithResults from photons_app import helpers as hp from photons_messages import DeviceMessages, LightMessages, DiscoveryMessages from photons_products import Products from delfick_project.errors_pytest import assertRaises, assertSameError from contextlib import contextmanager from unittest import mock import itertools import pytest devices = pytest.helpers.mimic() light1 = devices.add("light1")( "d073d5000001", Products.LCM2_A19_PLUS, hp.Firmware(2, 77), value_store=dict( power=0, label="bob", infrared=100, color=hp.Color(100, 0.5, 0.5, 4500), ), ) light2 = devices.add("light2")( "d073d5000002", Products.LMB_MESH_A21, hp.Firmware(2, 2), value_store=dict( power=65535, label="sam", color=hp.Color(200, 0.3, 1, 9000), ), ) light3 = devices.add("light3")( "d073d5000003", Products.LCM1_Z, hp.Firmware(1, 22), value_store=dict( power=0, label="strip", zones=[hp.Color(0, 1, 1, 3500)], ), ) two_lights = [light1.serial, light2.serial] @pytest.fixture(scope="module") def final_future(): fut = hp.create_future() try: yield fut finally: fut.cancel() @pytest.fixture(scope="module") async def sender(final_future): async with devices.for_test(final_future) as sender: yield sender @pytest.fixture(autouse=True) async def reset_devices(sender): for device in devices: await device.reset() devices.store(device).clear() sender.gatherer.clear_cache() def compare_called(got, want): for i, (g, w) in enumerate(itertools.zip_longest(got, want)): if g != w: print(f"Different {i}") print(f" Got : {g}") print(f" Want: {w}") else: print(f"Same {i}") print(f" Got : {g}") print(f" Want: {w}") assert want == got describe "Gatherer": def compare_received(self, by_light): for light, msgs in by_light.items(): assert light in devices devices.store(light).assertIncoming(*msgs, ignore=[DiscoveryMessages.GetService]) devices.store(light).clear() @contextmanager def modified_time(self): class T: def __init__(s): s.time = 0 def __call__(s): return s.time def forward(s, amount): s.time += amount t = T() with mock.patch("time.time", t): yield t describe "A plan saying NoMessages": async it "processes without needing messages", sender: called = [] i1 = mock.Mock(name="i1") i2 = mock.Mock(name="i2") i = {light1.serial: i1, light2.serial: i2} class NoMessagesPlan(Plan): messages = NoMessages class Instance(Plan.Instance): def process(s, pkt): called.append("process") async def info(s): called.append(("info", s.serial)) return i[s.serial] gatherer = Gatherer(sender) plans = make_plans(p=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == {light1.serial: (True, {"p": i1}), light2.serial: (True, {"p": i2})} compare_called(called, [("info", light1.serial), ("info", light2.serial)]) async it "does not process other messages", sender: called = [] i1 = mock.Mock(name="i1") i2 = mock.Mock(name="i2") i = {light1.serial: i1, light2.serial: i2} class NoMessagesPlan(Plan): messages = NoMessages class Instance(Plan.Instance): def process(s, pkt): called.append("process") async def info(s): called.append(("info", s.serial)) return i[s.serial] gatherer = Gatherer(sender) plans = make_plans("power", p=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"p": i1, "power": {"level": 0, "on": False}}), light2.serial: (True, {"p": i2, "power": {"level": 65535, "on": True}}), } compare_called(called, [("info", light1.serial), ("info", light2.serial)]) async it "can be determined by logic", sender: called = [] i1 = mock.Mock(name="i1") class NoMessagesPlan(Plan): class Instance(Plan.Instance): @property def messages(s): if s.serial == light2.serial: return [DeviceMessages.GetLabel()] else: return NoMessages def process(s, pkt): called.append(("process", s.serial)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info", s.serial)) if s.serial == light1.serial: return i1 else: return s.label gatherer = Gatherer(sender) plans = make_plans(p=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == {light1.serial: (True, {"p": i1}), light2.serial: (True, {"p": "sam"})} compare_called( called, [("info", light1.serial), ("process", light2.serial), ("info", light2.serial)], ) self.compare_received({light1: [], light2: [DeviceMessages.GetLabel()], light3: []}) describe "A plan saying Skip": async it "has no processing or info", sender: called = [] class NoMessagesPlan(Plan): messages = Skip class Instance(Plan.Instance): def process(s, pkt): called.append("process") async def info(s): called.append(("info", s.serial)) return True gatherer = Gatherer(sender) plans = make_plans(p=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == {light1.serial: (True, {"p": Skip}), light2.serial: (True, {"p": Skip})} compare_called(called, []) async it "does not process other messages", sender: called = [] class NoMessagesPlan(Plan): messages = Skip class Instance(Plan.Instance): def process(s, pkt): called.append("process") async def info(s): called.append(("info", s.serial)) return True gatherer = Gatherer(sender) plans = make_plans("power", p=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"p": Skip, "power": {"level": 0, "on": False}}), light2.serial: (True, {"p": Skip, "power": {"level": 65535, "on": True}}), } compare_called(called, []) async it "can be determined by logic", sender: called = [] class NoMessagesPlan(Plan): class Instance(Plan.Instance): @property def messages(s): if s.serial == light2.serial: return [DeviceMessages.GetLabel()] else: return Skip def process(s, pkt): called.append(("process", s.serial)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info", s.serial)) return s.label gatherer = Gatherer(sender) plans = make_plans(p=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == {light1.serial: (True, {"p": Skip}), light2.serial: (True, {"p": "sam"})} compare_called(called, [("process", light2.serial), ("info", light2.serial)]) self.compare_received({light1: [], light2: [DeviceMessages.GetLabel()], light3: []}) describe "A plan with no messages": async it "it gets all other messages", sender: called = [] class NoMessagesPlan(Plan): class Instance(Plan.Instance): finished_after_no_more_messages = True def process(s, pkt): assert pkt.serial == s.serial called.append((pkt.serial, pkt.payload.as_dict())) async def info(s): called.append(("info", s.serial)) return True gatherer = Gatherer(sender) plans = make_plans("label", "power", other=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: ( True, {"label": "bob", "power": {"level": 0, "on": False}, "other": True}, ), light2.serial: ( True, {"label": "sam", "power": {"level": 65535, "on": True}, "other": True}, ), } compare_called( called, [ (light1.serial, {"label": "bob"}), (light2.serial, {"label": "sam"}), (light1.serial, {"level": 0}), (light2.serial, {"level": 65535}), ("info", light1.serial), ("info", light2.serial), ], ) async it "still finishes if no messages processed but finished_after_no_more_messages", sender: called = [] class NoMessagesPlan(Plan): class Instance(Plan.Instance): finished_after_no_more_messages = True def process(s, pkt): assert pkt.serial == s.serial called.append((pkt.serial, pkt.payload.as_dict())) async def info(s): called.append(("info", s.serial)) return True gatherer = Gatherer(sender) plans = make_plans(other=NoMessagesPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"other": True}), light2.serial: (True, {"other": True}), } compare_called(called, [("info", light1.serial), ("info", light2.serial)]) describe "a plan that never finishes": async it "it doesn't get recorded", sender: called = [] class NeverFinishedPlan(Plan): class Instance(Plan.Instance): def process(s, pkt): called.append(("process", pkt.serial)) async def info(s): called.append(("info", s.serial)) gatherer = Gatherer(sender) plans = make_plans("label", "power", other=NeverFinishedPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (False, {"label": "bob", "power": {"level": 0, "on": False}}), light2.serial: (False, {"label": "sam", "power": {"level": 65535, "on": True}}), } compare_called( called, [ ("process", light1.serial), ("process", light2.serial), ("process", light1.serial), ("process", light2.serial), ], ) describe "A plan with messages": async it "messages are processed until we say plan is done", sender: called = [] class SimplePlan(Plan): messages = [DeviceMessages.GetLabel(), DeviceMessages.GetPower()] class Instance(Plan.Instance): def process(s, pkt): called.append((pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info", s.serial)) return s.label gatherer = Gatherer(sender) plans = make_plans(simple=SimplePlan()) found = [] async for serial, label, info in gatherer.gather(plans, two_lights): found.append((serial, label, info)) assert found == [(light1.serial, "simple", "bob"), (light2.serial, "simple", "sam")] self.compare_received( { light1: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light2: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light3: [], } ) label_type = DeviceMessages.StateLabel.Payload.message_type compare_called( called, [ (light1.serial, label_type), ("info", light1.serial), (light2.serial, label_type), ("info", light2.serial), ], ) async it "adds errors from info", sender: error = ValueError("ERROR") class ErrorPlan(Plan): messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): if pkt | DeviceMessages.StateLabel: self.label = pkt.label return True async def info(s): if s.serial == light1.serial: raise error return self.label gatherer = Gatherer(sender) plans = make_plans(label=ErrorPlan()) found = [] with assertRaises(ValueError, "ERROR"): async for serial, label, info in gatherer.gather(plans, devices.serials): found.append((serial, label, info)) assert found == [(light2.serial, "label", "sam"), (light3.serial, "label", "strip")] errors = [] found.clear() async for serial, label, info in gatherer.gather( plans, devices.serials, error_catcher=errors ): found.append((serial, label, info)) assert errors == [error] assert found == [(light2.serial, "label", "sam"), (light3.serial, "label", "strip")] async it "raises errors after yielding everything", sender: called = [] class LabelPlan(Plan): messages = [DeviceMessages.GetLabel(), DeviceMessages.GetPower()] class Instance(Plan.Instance): def process(s, pkt): called.append(("label", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.label", s.serial)) return s.label class PowerPlan(Plan): messages = [DeviceMessages.GetPower()] class Instance(Plan.Instance): def process(s, pkt): called.append(("power", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.power", s.serial)) return s.level class Looker(Plan): class Instance(Plan.Instance): finished_after_no_more_messages = True def process(s, pkt): called.append(("looker", pkt.serial, pkt.pkt_type)) async def info(s): called.append(("info.looker", s.serial)) return True gatherer = Gatherer(sender) plans = make_plans(power=PowerPlan(), label=LabelPlan(), looker=Looker()) found = [] with assertRaises(TimedOut, "Waiting for reply to a packet", serial=light1.serial): lost = light1.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: async for serial, label, info in gatherer.gather( plans, two_lights, message_timeout=0.1 ): found.append((serial, label, info)) assert found == [ (light2.serial, "label", "sam"), (light1.serial, "power", 0), (light2.serial, "power", 65535), (light2.serial, "looker", True), (light1.serial, "looker", True), ] self.compare_received( { light1: [ DeviceMessages.GetLabel(), DeviceMessages.GetPower(), ], light2: [ DeviceMessages.GetLabel(), DeviceMessages.GetPower(), ], light3: [], } ) label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type compare_called( called, [ ("label", light2.serial, label_type), ("info.label", light2.serial), ("looker", light2.serial, label_type), ("power", light2.serial, label_type), ("label", light1.serial, power_type), ("looker", light1.serial, power_type), ("power", light1.serial, power_type), ("info.power", light1.serial), ("looker", light2.serial, power_type), ("power", light2.serial, power_type), ("info.power", light2.serial), ("info.looker", light2.serial), ("info.looker", light1.serial), ], ) found.clear() called.clear() with assertRaises(TimedOut, "Waiting for reply to a packet", serial=light1.serial): lost = light1.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: async for serial, completed, info in gatherer.gather_per_serial( plans, two_lights, message_timeout=0.1 ): found.append((serial, completed, info)) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) compare_called(called, [("label", light1.serial, power_type)]) assert found == [ (light2.serial, True, {"looker": True, "label": "sam", "power": 65535}), (light1.serial, False, {"looker": True, "power": 0}), ] called.clear() try: lost = light1.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: await gatherer.gather_all(plans, two_lights, message_timeout=0.1) except BadRunWithResults as e: assert len(e.errors) == 1 label_type = DeviceMessages.GetLabel.Payload.message_type assertSameError( e.errors[0], TimedOut, "Waiting for reply to a packet", dict(serial=light1.serial, sent_pkt_type=label_type), [], ) found = e.kwargs["results"] self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) compare_called(called, [("label", light1.serial, power_type)]) assert found == { light2.serial: (True, {"looker": True, "label": "sam", "power": 65535}), light1.serial: (False, {"looker": True, "power": 0}), } async it "doesn't raise errors if we have an error catcher", sender: called = [] class LabelPlan(Plan): messages = [DeviceMessages.GetLabel(), DeviceMessages.GetPower()] class Instance(Plan.Instance): def process(s, pkt): called.append(("label", pkt.serial, pkt.pkt_type)) print("-" * 20, called[-1]) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.label", s.serial)) print("-" * 20, called[-1]) return s.label class PowerPlan(Plan): messages = [DeviceMessages.GetPower()] class Instance(Plan.Instance): def process(s, pkt): called.append(("power", pkt.serial, pkt.pkt_type)) print("-" * 20, called[-1]) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.power", s.serial)) print("-" * 20, called[-1]) return s.level class Looker(Plan): class Instance(Plan.Instance): finished_after_no_more_messages = True def process(s, pkt): called.append(("looker", pkt.serial, pkt.pkt_type)) print("-" * 20, called[-1]) async def info(s): called.append(("info.looker", s.serial)) print("-" * 20, called[-1]) return True gatherer = Gatherer(sender) plans = make_plans(power=PowerPlan(), label=LabelPlan(), looker=Looker()) error_catcher = [] kwargs = {"message_timeout": 0.1, "error_catcher": error_catcher} def assertError(errors): assert len(errors) == 1 label_type = DeviceMessages.GetLabel.Payload.message_type assertSameError( errors[0], TimedOut, "Waiting for reply to a packet", dict(serial=light1.serial, sent_pkt_type=label_type), [], ) errors.clear() found = [] lost = light1.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: async for serial, label, info in gatherer.gather(plans, two_lights, **kwargs): found.append((serial, label, info)) assertError(error_catcher) assert found == [ (light2.serial, "label", "sam"), (light1.serial, "power", 0), (light2.serial, "power", 65535), (light2.serial, "looker", True), (light1.serial, "looker", True), ] self.compare_received( { light1: [ DeviceMessages.GetLabel(), DeviceMessages.GetPower(), ], light2: [ DeviceMessages.GetLabel(), DeviceMessages.GetPower(), ], light3: [], } ) label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type compare_called( called, [ ("label", light2.serial, label_type), ("info.label", light2.serial), ("looker", light2.serial, label_type), ("power", light2.serial, label_type), ("label", light1.serial, power_type), ("looker", light1.serial, power_type), ("power", light1.serial, power_type), ("info.power", light1.serial), ("looker", light2.serial, power_type), ("power", light2.serial, power_type), ("info.power", light2.serial), ("info.looker", light2.serial), ("info.looker", light1.serial), ], ) found.clear() called.clear() lost = light1.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: async for serial, completed, info in gatherer.gather_per_serial( plans, two_lights, **kwargs ): found.append((serial, completed, info)) assertError(error_catcher) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) compare_called(called, [("label", light1.serial, power_type)]) assert found == [ (light2.serial, True, {"looker": True, "label": "sam", "power": 65535}), (light1.serial, False, {"looker": True, "power": 0}), ] called.clear() lost = light1.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: found = dict(await gatherer.gather_all(plans, two_lights, **kwargs)) assertError(error_catcher) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) compare_called(called, [("label", light1.serial, power_type)]) assert found == { light2.serial: (True, {"looker": True, "label": "sam", "power": 65535}), light1.serial: (False, {"looker": True, "power": 0}), } describe "refreshing": async it "it can refresh always", sender: called = [] class LabelPlan(Plan): default_refresh = True messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): called.append(("label", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.label", s.serial)) return s.label gatherer = Gatherer(sender) plans = make_plans(label=LabelPlan()) got = dict(await gatherer.gather_all(plans, light1.serial)) assert got == {light1.serial: (True, {"label": "bob"})} label_type = DeviceMessages.StateLabel.Payload.message_type compare_called( called, [("label", light1.serial, label_type), ("info.label", light1.serial)] ) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) called.clear() # Get it again, default refresh means it will be cached got = dict(await gatherer.gather_all(plans, light1.serial)) assert got == {light1.serial: (True, {"label": "bob"})} compare_called( called, [("label", light1.serial, label_type), ("info.label", light1.serial)] ) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) called.clear() # We can override refresh plans = make_plans(label=LabelPlan(refresh=False)) got = dict(await gatherer.gather_all(plans, light1.serial)) assert got == {light1.serial: (True, {"label": "bob"})} compare_called(called, []) self.compare_received({light1: [], light2: [], light3: []}) async it "it can refresh on time", sender: with self.modified_time() as t: called = [] class LabelPlan(Plan): default_refresh = 1 messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): called.append(("label", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.label", s.serial)) return s.label gatherer = Gatherer(sender) plans = make_plans(label=LabelPlan()) got = dict(await gatherer.gather_all(plans, light1.serial)) assert got == {light1.serial: (True, {"label": "bob"})} label_type = DeviceMessages.StateLabel.Payload.message_type compare_called( called, [("label", light1.serial, label_type), ("info.label", light1.serial)] ) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) called.clear() # Get it again, our refresh means it will be cached t.forward(0.6) plans = make_plans(label=LabelPlan()) got = dict(await gatherer.gather_all(plans, light1.serial)) assert got == {light1.serial: (True, {"label": "bob"})} compare_called(called, []) self.compare_received({light1: [], light2: [], light3: []}) # After a second, we get refreshed t.forward(0.5) got = dict(await gatherer.gather_all(plans, light1.serial)) assert got == {light1.serial: (True, {"label": "bob"})} compare_called( called, [("label", light1.serial, label_type), ("info.label", light1.serial)] ) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) called.clear() # Get it again, our refresh means it will be cached t.forward(0.6) plans = make_plans(label=LabelPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob"}), light2.serial: (True, {"label": "sam"}), } compare_called( called, [("label", light2.serial, label_type), ("info.label", light2.serial)] ) self.compare_received({light1: [], light2: [DeviceMessages.GetLabel()], light3: []}) called.clear() # After a second, we get light1 refreshed t.forward(0.5) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob"}), light2.serial: (True, {"label": "sam"}), } compare_called( called, [("label", light1.serial, label_type), ("info.label", light1.serial)] ) self.compare_received({light1: [DeviceMessages.GetLabel()], light2: [], light3: []}) called.clear() # After two seconds, we get both refreshed t.forward(2) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob"}), light2.serial: (True, {"label": "sam"}), } compare_called( called, [ ("label", light1.serial, label_type), ("info.label", light1.serial), ("label", light2.serial, label_type), ("info.label", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel()], light3: [], } ) called.clear() async it "cannot steal messages from completed plans if we refresh messages those other plans use", sender: called = [] class ReverseLabelPlan(Plan): messages = [DeviceMessages.GetLabel()] default_refresh = False class Instance(Plan.Instance): def process(s, pkt): called.append(("reverse", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.reverse", s.serial)) return "".join(reversed(s.label)) class LabelPlan(Plan): messages = [DeviceMessages.GetLabel()] default_refresh = True class Instance(Plan.Instance): def process(s, pkt): called.append(("label", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.label", s.serial)) return s.label gatherer = Gatherer(sender) plans = make_plans(rev=ReverseLabelPlan(), label=LabelPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob", "rev": "bob"}), light2.serial: (True, {"label": "sam", "rev": "mas"}), } label_type = DeviceMessages.StateLabel.Payload.message_type compare_called( called, [ ("label", light1.serial, label_type), ("info.label", light1.serial), ("reverse", light1.serial, label_type), ("info.reverse", light1.serial), ("label", light2.serial, label_type), ("info.label", light2.serial), ("reverse", light2.serial, label_type), ("info.reverse", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel()], light3: [], } ) called.clear() # Get it again, our refresh means we process LabelPlan again, # but using results from ReverseLabelPlan got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob", "rev": "bob"}), light2.serial: (True, {"label": "sam", "rev": "mas"}), } compare_called( called, [ ("label", light1.serial, label_type), ("info.label", light1.serial), ("label", light2.serial, label_type), ("info.label", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel()], light3: [], } ) async it "has no cached completed data if instance has no key", sender: called = [] class ReverseLabelPlan(Plan): messages = [DeviceMessages.GetLabel()] default_refresh = False class Instance(Plan.Instance): def process(s, pkt): called.append(("reverse", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.reverse", s.serial)) return "".join(reversed(s.label)) class LabelPlan(Plan): messages = [DeviceMessages.GetLabel()] default_refresh = False class Instance(Plan.Instance): def key(s): return None def process(s, pkt): called.append(("label", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.label", s.serial)) return s.label gatherer = Gatherer(sender) plans = make_plans(rev=ReverseLabelPlan(), label=LabelPlan()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob", "rev": "bob"}), light2.serial: (True, {"label": "sam", "rev": "mas"}), } label_type = DeviceMessages.StateLabel.Payload.message_type compare_called( called, [ ("label", light1.serial, label_type), ("info.label", light1.serial), ("reverse", light1.serial, label_type), ("info.reverse", light1.serial), ("label", light2.serial, label_type), ("info.label", light2.serial), ("reverse", light2.serial, label_type), ("info.reverse", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel()], light3: [], } ) called.clear() # Get it again, our refresh means we process LabelPlan again, # but using results from ReverseLabelPlan got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"label": "bob", "rev": "bob"}), light2.serial: (True, {"label": "sam", "rev": "mas"}), } compare_called( called, [ ("label", light1.serial, label_type), ("info.label", light1.serial), ("label", light2.serial, label_type), ("info.label", light2.serial), ], ) self.compare_received({light1: [], light2: [], light3: []}) describe "dependencies": async it "it can get dependencies", sender: called = [] class PowerPlan(Plan): class Instance(Plan.Instance): @property def messages(s): if s.serial == light3.serial: return Skip else: return [DeviceMessages.GetPower()] def process(s, pkt): called.append(("power.process.power", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.power", s.serial)) return s.level class InfoPlan(Plan): messages = [DeviceMessages.GetLabel()] dependant_info = {"p": PowerPlan()} class Instance(Plan.Instance): @property def messages(s): if s.deps["p"] == 0: return [LightMessages.GetInfrared()] else: return [DeviceMessages.GetLabel()] def process(s, pkt): if pkt | DeviceMessages.StateLabel: called.append(("info.process.label", pkt.serial, pkt.pkt_type)) s.i = pkt.label return True elif pkt | LightMessages.StateInfrared: called.append(("info.process.infrared", pkt.serial, pkt.pkt_type)) s.i = pkt.brightness return True elif pkt | DeviceMessages.StatePower: called.append(("info.process.power", pkt.serial, pkt.pkt_type)) async def info(s): called.append(("info.info", s.serial)) return {"power": s.deps["p"], "info": s.i} gatherer = Gatherer(sender) plans = make_plans(info=InfoPlan()) got = dict(await gatherer.gather_all(plans, devices.serials)) assert got == { light1.serial: (True, {"info": {"power": 0, "info": 100}}), light2.serial: (True, {"info": {"power": 65535, "info": "sam"}}), light3.serial: (True, {"info": {"power": Skip, "info": "strip"}}), } label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type infrared_type = LightMessages.StateInfrared.Payload.message_type compare_called( called, [ ("power.process.power", light1.serial, power_type), ("info.power", light1.serial), ("power.process.power", light2.serial, power_type), ("info.power", light2.serial), ("info.process.label", light3.serial, label_type), ("info.info", light3.serial), ("info.process.power", light1.serial, power_type), ("info.process.power", light2.serial, power_type), ("info.process.infrared", light1.serial, infrared_type), ("info.info", light1.serial), ("info.process.label", light2.serial, label_type), ("info.info", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetPower(), LightMessages.GetInfrared()], light2: [DeviceMessages.GetPower(), DeviceMessages.GetLabel()], light3: [DeviceMessages.GetLabel()], } ) async it "it can get dependencies of dependencies and messages can be shared", sender: called = [] class Plan1(Plan): messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): called.append(("plan1", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.plan1", s.serial)) return s.label class Plan2(Plan): messages = [DeviceMessages.GetLabel()] dependant_info = {"l": Plan1()} class Instance(Plan.Instance): def process(s, pkt): called.append(("plan2", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.plan2", s.serial)) return {"label": s.deps["l"], "rev": "".join(reversed(s.label))} class Plan3(Plan): messages = [DeviceMessages.GetPower()] dependant_info = {"p": Plan2()} class Instance(Plan.Instance): def process(s, pkt): called.append(("plan3", pkt.serial, pkt.pkt_type)) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.plan3", s.serial)) return (s.level, s.deps["p"]) gatherer = Gatherer(sender) plans = make_plans(plan3=Plan3()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"plan3": (0, {"label": "bob", "rev": "bob"})}), light2.serial: (True, {"plan3": (65535, {"label": "sam", "rev": "mas"})}), } label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type compare_called( called, [ ("plan1", light1.serial, label_type), ("info.plan1", light1.serial), ("plan1", light2.serial, label_type), ("info.plan1", light2.serial), ("plan2", light1.serial, label_type), ("info.plan2", light1.serial), ("plan2", light2.serial, label_type), ("info.plan2", light2.serial), ("plan3", light1.serial, label_type), ("plan3", light2.serial, label_type), ("plan3", light1.serial, power_type), ("info.plan3", light1.serial), ("plan3", light2.serial, power_type), ("info.plan3", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light2: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light3: [], } ) async it "it can skip based on dependency", sender: called = [] class Plan1(Plan): messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): called.append(("plan1", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.plan1", s.serial)) return s.label class Plan2(Plan): dependant_info = {"l": Plan1()} class Instance(Plan.Instance): @property def messages(s): if s.deps["l"] == "bob": return Skip else: return [DeviceMessages.GetPower()] def process(s, pkt): called.append(("plan2", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.plan2", s.serial)) return {"label": s.deps["l"], "power": s.level} gatherer = Gatherer(sender) plans = make_plans(plan2=Plan2()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"plan2": Skip}), light2.serial: (True, {"plan2": {"label": "sam", "power": 65535}}), } label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type compare_called( called, [ ("plan1", light1.serial, label_type), ("info.plan1", light1.serial), ("plan1", light2.serial, label_type), ("info.plan1", light2.serial), ("plan2", light2.serial, label_type), ("plan2", light2.serial, power_type), ("info.plan2", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light3: [], } ) async it "can get results from deps as well", sender: called = [] class Plan1(Plan): messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): called.append(("plan1", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.plan1", s.serial)) return s.label class Plan2(Plan): dependant_info = {"l": Plan1()} class Instance(Plan.Instance): @property def messages(s): if s.deps["l"] == "bob": return Skip else: return [DeviceMessages.GetPower()] def process(s, pkt): called.append(("plan2", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.plan2", s.serial)) return {"label": s.deps["l"], "power": s.level} gatherer = Gatherer(sender) plans = make_plans(plan1=Plan1(), plan2=Plan2()) got = dict(await gatherer.gather_all(plans, two_lights)) assert got == { light1.serial: (True, {"plan1": "bob", "plan2": Skip}), light2.serial: (True, {"plan1": "sam", "plan2": {"label": "sam", "power": 65535}}), } label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type compare_called( called, [ ("plan1", light1.serial, label_type), ("info.plan1", light1.serial), ("plan1", light2.serial, label_type), ("info.plan1", light2.serial), ("plan2", light2.serial, label_type), ("plan2", light2.serial, power_type), ("info.plan2", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light3: [], } ) async it "chain is broken when dep can't get results", sender: called = [] class Plan1(Plan): messages = [DeviceMessages.GetLabel()] class Instance(Plan.Instance): def process(s, pkt): called.append(("plan1", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StateLabel: s.label = pkt.label return True async def info(s): called.append(("info.plan1", s.serial)) return s.label class Plan2(Plan): dependant_info = {"l": Plan1()} class Instance(Plan.Instance): @property def messages(s): if s.deps["l"] == "bob": return Skip else: return [DeviceMessages.GetPower()] def process(s, pkt): called.append(("plan2", s.serial, pkt.pkt_type)) if pkt | DeviceMessages.StatePower: s.level = pkt.level return True async def info(s): called.append(("info.plan2", s.serial)) return {"label": s.deps["l"], "power": s.level} gatherer = Gatherer(sender) plans = make_plans("presence", plan2=Plan2()) errors = [] lost = light3.io["MEMORY"].packet_filter.lost_replies(DeviceMessages.GetLabel) with lost: got = dict( await gatherer.gather_all( plans, devices.serials, error_catcher=errors, message_timeout=0.1 ) ) assert len(errors) == 1 assert got == { light1.serial: (True, {"presence": True, "plan2": Skip}), light2.serial: ( True, {"presence": True, "plan2": {"label": "sam", "power": 65535}}, ), light3.serial: (False, {"presence": True}), } label_type = DeviceMessages.StateLabel.Payload.message_type power_type = DeviceMessages.StatePower.Payload.message_type compare_called( called, [ ("plan1", light1.serial, label_type), ("info.plan1", light1.serial), ("plan1", light2.serial, label_type), ("info.plan1", light2.serial), ("plan2", light2.serial, label_type), ("plan2", light2.serial, power_type), ("info.plan2", light2.serial), ], ) self.compare_received( { light1: [DeviceMessages.GetLabel()], light2: [DeviceMessages.GetLabel(), DeviceMessages.GetPower()], light3: [DeviceMessages.GetLabel()], } )
37.366234
115
0.461073
4,940
57,544
5.291903
0.059312
0.054166
0.025821
0.026165
0.850471
0.826142
0.79443
0.777561
0.760271
0.73992
0
0.019976
0.424093
57,544
1,539
116
37.390513
0.768859
0.008759
0
0.73042
0
0
0.067284
0.00128
0
0
0
0
0.045342
0
null
null
0
0.008244
null
null
0.009893
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
571a9323c2ae41c6a0c9ce3772bb1a48f24b9940
9,527
py
Python
projects/storycloze/assignment3_models.py
mitchelljeff/SUMMAD4.3
33bb3a74cff16a7aa699660a08d98ddcd662cad5
[ "MIT" ]
1
2017-09-15T14:06:07.000Z
2017-09-15T14:06:07.000Z
projects/storycloze/assignment3_models.py
mitchelljeff/SUMMAD4.3
33bb3a74cff16a7aa699660a08d98ddcd662cad5
[ "MIT" ]
null
null
null
projects/storycloze/assignment3_models.py
mitchelljeff/SUMMAD4.3
33bb3a74cff16a7aa699660a08d98ddcd662cad5
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import tensorflow as tf def get_permute_model(vocab_size, input_size, output_size, target_size, layers=1, dropout=0.0): # Placeholders # [batch_size x max_length] story = tf.placeholder(tf.int32, [None, None], "story") # [batch_size] story_length = tf.placeholder(tf.int32, [None], "story_length") # [batch_size] order = tf.placeholder(tf.int32, [None], "order") placeholders = {"story": story, "story_length": story_length, "order": order} # Word embeddings initializer = tf.random_uniform_initializer(-0.05, 0.05) embeddings = tf.get_variable("W", [vocab_size, input_size], initializer=initializer) # [batch_size x max_seq_length x input_size] story_embedded = tf.nn.embedding_lookup(embeddings, story) with tf.variable_scope("reader") as varscope: cell = tf.nn.rnn_cell.LSTMCell( output_size, state_is_tuple=True, initializer=tf.contrib.layers.xavier_initializer() ) if layers > 1: cell = tf.nn.rnn_cell.MultiRNNCell([cell] * layers) if dropout != 0.0: cell_dropout = \ tf.nn.rnn_cell.DropoutWrapper(cell, input_keep_prob=1.0-dropout) else: cell_dropout = cell outputs, states = tf.nn.bidirectional_dynamic_rnn( cell_dropout, cell_dropout, story_embedded, sequence_length=story_length, dtype=tf.float32 ) fw = states[0][1] # todo: also use backward pass # bw = states[1][1] h = fw logits = tf.contrib.layers.linear(h, target_size) predict = tf.arg_max(tf.nn.softmax(logits), 1) loss = tf.reduce_sum( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=order)) return loss, placeholders, predict def get_basic_model(vocab_size, input_size, output_size, target_size, layers=1, dropout=0.0, nvocab=None): # Placeholders # [batch_size x max_length] story = tf.placeholder(tf.int32, [None, None], "story") # [batch_size] story_length = tf.placeholder(tf.int32, [None], "story_length") # [batch_size x 5] order = tf.placeholder(tf.int32, [None, None], "order") placeholders = {"story": story, "story_length": story_length, "order": order} # Word embeddings if nvocab is None: initializer = tf.random_uniform_initializer(-0.05, 0.05) embeddings = tf.get_variable("W", [vocab_size, input_size], initializer=initializer) else: print('..using pretrained embeddings') embeddings = nvocab.embedding_matrix # [batch_size x max_seq_length x input_size] story_embedded = tf.nn.embedding_lookup(embeddings, story) with tf.variable_scope("reader") as varscope: cell = tf.contrib.rnn.LSTMCell( #tf.nn.rnn_cell.LSTMCell output_size, state_is_tuple=True, initializer=tf.contrib.layers.xavier_initializer() ) if layers > 1: cell = tf.contrib.rnn.MultiRNNCell([cell] * layers) #tf.nn.rnn_cell.MultiRNNCell([cell] * layers) if dropout != 0.0: cell_dropout = \ tf.contrib.rnn.DropoutWrapper(cell, input_keep_prob=1.0-dropout) # tf.nn.rnn_cell.DropoutWrapper(cell, input_keep_prob=1.0-dropout) else: cell_dropout = cell outputs, states = tf.nn.bidirectional_dynamic_rnn( cell_dropout, cell_dropout, story_embedded, sequence_length=story_length, dtype=tf.float32 ) fw = states[0][1] bw = states[1][1] h = tf.concat([fw, bw], 1) # [batch_size x 5*target_size] logits_flat = tf.contrib.layers.linear(h, 5*target_size) # [batch_size x 5 x target_size] logits = tf.reshape(logits_flat, [-1, 5, target_size]) loss = tf.reduce_sum( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=order)) predict = tf.arg_max(tf.nn.softmax(logits), 2) return loss, placeholders, predict def get_selective_model(vocab_size, input_size, output_size, target_size, layers=1, dropout=0.0, nvocab=None): # Placeholders # [batch_size x 5 x max_length] story = tf.placeholder(tf.int32, [None, None, None], "story") # [batch_size x 5] story_length = tf.placeholder(tf.int32, [None, None], "story_length") # [batch_size x 5] order = tf.placeholder(tf.int32, [None, None], "order") placeholders = {"story": story, "story_length": story_length, "order": order} batch_size = tf.shape(story)[0] # 5 times [batch_size x max_length] sentences = [tf.reshape(x, [batch_size, -1]) for x in tf.split(story, 5, 1)] # 5 times [batch_size] lengths = [tf.reshape(x, [batch_size]) for x in tf.split(story_length, 5, 1)] # Word embeddings if nvocab is None: initializer = tf.random_uniform_initializer(-0.05, 0.05) embeddings = tf.get_variable("W", [vocab_size, input_size], initializer=initializer) else: print('..using pretrained embeddings') embeddings = nvocab.embedding_matrix # [batch_size x max_seq_length x input_size] sentences_embedded = [tf.nn.embedding_lookup(embeddings, sentence) for sentence in sentences] with tf.variable_scope("reader") as varscope: cell = tf.contrib.rnn.LSTMCell( #tf.nn.rnn_cell.LSTMCell( output_size, state_is_tuple=True, initializer=tf.contrib.layers.xavier_initializer() ) if layers > 1: cell = tf.contrib.rnn.MultiRNNCell([cell] * layers) if dropout != 0.0: cell_dropout = \ tf.contrib.rnn.DropoutWrapper(cell, input_keep_prob=1.0-dropout) else: cell_dropout = cell with tf.variable_scope("rnn") as rnn_varscope: # 5 times outputs, states rnn_result = [] for i, (sentence, length) in \ enumerate(zip(sentences_embedded, lengths)): if i > 0: rnn_varscope.reuse_variables() rnn_result.append( tf.nn.bidirectional_dynamic_rnn( cell_dropout, cell_dropout, sentence, sequence_length=length, dtype=tf.float32 ) ) fws = [states[1][0][1] for states in rnn_result] bws = [states[1][1][1] for states in rnn_result] # 5 times [batch_size x 2*output_size] hs = [tf.concat([fw, bw], 1) for fw, bw in zip(fws, bws)] # [batch_size x 5*2*output_size] h = tf.concat(hs, 1) # [batch_size x 5*target_size] logits_flat = tf.contrib.layers.linear(h, 5*target_size) # [batch_size x 5 x target_size] logits = tf.reshape(logits_flat, [-1, 5, target_size]) loss = tf.reduce_sum( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=order)) predict = tf.arg_max(tf.nn.softmax(logits), 2) return loss, placeholders, predict def get_bowv_model(vocab_size, input_size, output_size, target_size, layers=1, dropout=0.0, nvocab=None): # Placeholders # [batch_size x 5 x max_length] story = tf.placeholder(tf.int32, [None, None, None], "story") # [batch_size x 5] story_length = tf.placeholder(tf.int32, [None, None], "story_length") # [batch_size x 5] order = tf.placeholder(tf.int32, [None, None], "order") placeholders = {"story": story, "story_length": story_length, "order": order} batch_size = tf.shape(story)[0] # 5 times [batch_size x max_length] sentences = [tf.reshape(x, [batch_size, -1]) for x in tf.split(story, 5, 1)] # 5 times [batch_size] lengths = [tf.reshape(x, [batch_size]) for x in tf.split(story_length, 5, 1)] # Word embeddings if nvocab is None: initializer = tf.random_uniform_initializer(-0.05, 0.05) embeddings = tf.get_variable("W", [vocab_size, input_size], initializer=initializer) else: print('..using pretrained embeddings') embeddings = nvocab.embedding_matrix # [batch_size x max_seq_length x input_size] sentences_embedded = [tf.nn.dropout( tf.nn.embedding_lookup(embeddings, sentence), 1-dropout) for sentence in sentences] # 5 times [batch_size x input_size] hs = [tf.reduce_sum(sentence, 1) for sentence in sentences_embedded] # [batch_size x 5*input_size] h = tf.concat(hs, 1) h = tf.reshape(h, [batch_size, 5*input_size]) # [batch_size x 5*target_size] logits_flat = tf.contrib.layers.linear(h, 5 * target_size) # [batch_size x 5 x target_size] logits = tf.reshape(logits_flat, [-1, 5, target_size]) loss = tf.reduce_sum( tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=order)) predict = tf.arg_max(tf.nn.softmax(logits), 2) return loss, placeholders, predict
34.146953
95
0.598509
1,203
9,527
4.535328
0.100582
0.061034
0.045821
0.030242
0.900843
0.881598
0.844392
0.844392
0.838526
0.829545
0
0.022922
0.290228
9,527
278
96
34.269784
0.78394
0.125118
0
0.764706
0
0
0.034749
0
0
0
0
0.003597
0
1
0.023529
false
0
0.005882
0
0.052941
0.017647
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
5720d2da088de69046ef8ee716cc3dd36572d436
16,221
py
Python
tests/test_yuzu_naive_equality.py
kundajelab/yuzu
34faa36b1716c41a1d1f996bc5e30040015d566a
[ "MIT" ]
2
2021-11-23T18:28:41.000Z
2022-03-01T22:02:54.000Z
tests/test_yuzu_naive_equality.py
kundajelab/yuzu
34faa36b1716c41a1d1f996bc5e30040015d566a
[ "MIT" ]
null
null
null
tests/test_yuzu_naive_equality.py
kundajelab/yuzu
34faa36b1716c41a1d1f996bc5e30040015d566a
[ "MIT" ]
null
null
null
# test_yuzu_naive_equality.py # Author: Jacob Schreiber <jmschreiber91@gmail.com> """ Testing the yuzu ISM implementation is equivalent to the naive ISM implementation using the built-in models. These are regression tests. """ import numpy import torch from nose.tools import assert_raises from numpy.testing import assert_array_almost_equal from yuzu import yuzu_ism from yuzu import precompute from yuzu.naive_ism import naive_ism from yuzu.models import * n_seqs = 2 seq_len = 150 idxs = numpy.random.RandomState(0).randn(n_seqs, 4, seq_len).argmax(axis=1) X = numpy.zeros((n_seqs, 4, seq_len), dtype='float32') for i in range(n_seqs): X[i, idxs[i], numpy.arange(seq_len)] = 1 def evaluate_model(model, X, alpha=None): alpha = alpha or 1.5 precomputation = precompute(model, seq_len=X.shape[2], n_choices=X.shape[1], alpha=alpha) yuzu_isms = yuzu_ism(model, X, precomputation) naive_isms = naive_ism(model, X) assert_array_almost_equal(naive_isms, yuzu_isms, 3) def test_one_layer(): model = OneLayer(4, seq_len) evaluate_model(model, X) evaluate_model(model, X, alpha=10) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_toynet(): model = ToyNet(4, seq_len) evaluate_model(model, X) evaluate_model(model, X, alpha=10) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_deepsea(): model = DeepSEA(4, seq_len) evaluate_model(model, X) evaluate_model(model, X, alpha=10) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_basset(): model = Basset(4, seq_len) evaluate_model(model, X) evaluate_model(model, X, alpha=10) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_factorized_basset(): model = FactorizedBasset(4, seq_len) evaluate_model(model, X) evaluate_model(model, X, alpha=10) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_bpnet(): model = ToyNet(4, seq_len) evaluate_model(model, X) evaluate_model(model, X, alpha=10) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) ### def test_conv_relu(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.ReLU() ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_mp(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.ReLU(), torch.nn.MaxPool1d(3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_batchnorm_mp_conv(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.BatchNorm1d(8), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_mp_conv(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.ReLU(), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_batchnorm_mp_conv(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.ReLU(), torch.nn.BatchNorm1d(8), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_mp(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(3), torch.nn.MaxPool1d(2) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), Flatten(), torch.nn.Linear(150*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.ReLU(), Flatten(), torch.nn.Linear(150*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_batchnorm_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.BatchNorm1d(8), Flatten(), torch.nn.Linear(150*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_batchnorm_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.ReLU(), torch.nn.BatchNorm1d(8), Flatten(), torch.nn.Linear(150*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), Flatten(), torch.nn.Linear(75*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_relu_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.ReLU(), Flatten(), torch.nn.Linear(75*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_batchnorm_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.BatchNorm1d(8), Flatten(), torch.nn.Linear(75*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_batchnorm_relu_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.BatchNorm1d(8), torch.nn.ReLU(), Flatten(), torch.nn.Linear(75*8, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3), Flatten(), torch.nn.Linear(75*6, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3), Flatten(), torch.nn.Linear(75*6, 5), torch.nn.Linear(5, 3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_relu_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3), Flatten(), torch.nn.Linear(75*6, 5), torch.nn.ReLU(), torch.nn.Linear(5, 3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_batchnorm_dense(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3), Flatten(), torch.nn.Linear(75*6, 5), torch.nn.BatchNorm1d(5), torch.nn.Linear(5, 3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_batchnorm_dense_relu(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7, padding=3), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7, padding=3), Flatten(), torch.nn.Linear(75*6, 5), torch.nn.BatchNorm1d(5), torch.nn.Linear(5, 3), torch.nn.ReLU() ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) ## def test_conv_relu_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.ReLU() ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_mp_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.ReLU(), torch.nn.MaxPool1d(3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_batchnorm_mp_conv_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.BatchNorm1d(8), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_mp_conv_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.ReLU(), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_batchnorm_mp_conv_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.ReLU(), torch.nn.BatchNorm1d(8), torch.nn.MaxPool1d(3), torch.nn.Conv1d(8, 6, kernel_size=7) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_mp_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(3), torch.nn.MaxPool1d(2) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), Flatten(), torch.nn.Linear(1152, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.ReLU(), Flatten(), torch.nn.Linear(1152, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_batchnorm_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.BatchNorm1d(8), Flatten(), torch.nn.Linear(1152, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_relu_batchnorm_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.ReLU(), torch.nn.BatchNorm1d(8), Flatten(), torch.nn.Linear(1152, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), Flatten(), torch.nn.Linear(576, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_relu_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.ReLU(), Flatten(), torch.nn.Linear(576, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_batchnorm_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.BatchNorm1d(8), Flatten(), torch.nn.Linear(576, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_batchnorm_relu_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.BatchNorm1d(8), torch.nn.ReLU(), Flatten(), torch.nn.Linear(576, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7), Flatten(), torch.nn.Linear(396, 5) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7), Flatten(), torch.nn.Linear(396, 5), torch.nn.Linear(5, 3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_relu_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7), Flatten(), torch.nn.Linear(396, 5), torch.nn.ReLU(), torch.nn.Linear(5, 3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_batchnorm_dense_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7), Flatten(), torch.nn.Linear(396, 5), torch.nn.BatchNorm1d(5), torch.nn.Linear(5, 3) ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95) def test_conv_mp_conv_dense_batchnorm_dense_relu_nopad(): model = torch.nn.Sequential( torch.nn.Conv1d(4, 8, kernel_size=7), torch.nn.MaxPool1d(2), torch.nn.Conv1d(8, 6, kernel_size=7), Flatten(), torch.nn.Linear(396, 5), torch.nn.BatchNorm1d(5), torch.nn.Linear(5, 3), torch.nn.ReLU() ) evaluate_model(model, X) evaluate_model(model, X, alpha=100) assert_raises(AssertionError, evaluate_model, model, X, alpha=0.95)
26.635468
75
0.730103
2,620
16,221
4.336641
0.041603
0.126914
0.229713
0.242475
0.93047
0.926245
0.926245
0.926245
0.926245
0.926245
0
0.056477
0.122372
16,221
609
76
26.635468
0.741641
0.013316
0
0.762677
0
0
0.000438
0
0
0
0
0
0.103448
1
0.099391
false
0
0.016227
0
0.115619
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
5724d94af35578a30df1fe10a4bda1e4c6f780c4
1,006
py
Python
clu/scripts/legacy/repl-pyzo.py
fish2000/CLU
80bc2df5f001b5639d79ba979e19ec77a9931425
[ "BSD-3-Clause" ]
1
2019-07-02T08:17:59.000Z
2019-07-02T08:17:59.000Z
clu/scripts/legacy/repl-pyzo.py
fish2000/CLU
80bc2df5f001b5639d79ba979e19ec77a9931425
[ "BSD-3-Clause" ]
13
2019-12-17T02:28:30.000Z
2021-11-17T03:46:10.000Z
clu/scripts/legacy/repl-pyzo.py
fish2000/CLU
80bc2df5f001b5639d79ba979e19ec77a9931425
[ "BSD-3-Clause" ]
null
null
null
# -*- encoding: utf-8 -*- """ 888 888 .d8888b. .d8888b. 888 888 d88P Y88b d88P Y88b 888 888 .d88P Y88b. d88P .d8888b 888 888 888888 88888b. .d88b. 88888b. 8888" "Y88888" d88P" 888 888 888 888 "88b d88""88b 888 "88b "Y8b. .d8P""Y8b. 888 888 888 888 888 888 888 888 888 888 888 888 888 888 Y88b. Y88b 888 Y88b. 888 888 Y88..88P 888 888 Y88b d88P d8b Y88b d88P "Y8888P "Y88888 "Y888 888 888 "Y88P" 888 888 "Y8888P" Y8P "Y8888P" 888 Y8b d88P "Y88P" """ from __future__ import print_function from replenv import * from replutilities import * import keyvalue
55.888889
78
0.394632
97
1,006
4.041237
0.319588
0.367347
0.321429
0.367347
0.19898
0.107143
0.107143
0.107143
0.107143
0.107143
0
0.495595
0.548708
1,006
18
79
55.888889
0.367841
0.869781
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.25
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
10
5743cf33a4921f0fdb298ab27961e0fe940bb084
3,394
py
Python
pyrqa/metric.py
szhan/pyrqa
2431bac1966f8230989f55224e7bdc58fc617bd9
[ "Apache-2.0" ]
9
2020-03-04T14:38:17.000Z
2022-03-20T06:44:36.000Z
pyrqa/metric.py
szhan/pyrqa
2431bac1966f8230989f55224e7bdc58fc617bd9
[ "Apache-2.0" ]
2
2018-07-08T19:40:07.000Z
2020-01-11T16:59:49.000Z
pyrqa/metric.py
szhan/pyrqa
2431bac1966f8230989f55224e7bdc58fc617bd9
[ "Apache-2.0" ]
4
2019-05-31T08:30:18.000Z
2022-03-20T06:44:38.000Z
#!/usr/bin/python # # This file is part of PyRQA. # Copyright 2015 Tobias Rawald, Mike Sips. """ Distance metrics. """ import math import numpy as np from pyrqa.abstract_classes import AbstractMetric class TaxicabMetric(AbstractMetric): """ Taxicab metric (L1) """ name = 'taxicab_metric' @classmethod def get_distance_time_series(cls, time_series_x, time_series_y, embedding_dimension, time_delay, index_x, index_y): """ See AbstractMetric """ distance = 0 for idx in np.arange(embedding_dimension): temp_x = index_x + (idx * time_delay) temp_y = index_y + (idx * time_delay) distance += math.fabs(time_series_x[temp_x] - time_series_y[temp_y]) return distance @classmethod def get_distance_vectors(cls, vectors_x, vectors_y, embedding_dimension, index_x, index_y): """ See AbstractMetric """ distance = 0 for idx in np.arange(embedding_dimension): temp_x = index_x * embedding_dimension + idx temp_y = index_y * embedding_dimension + idx distance += math.fabs(vectors_x[temp_x] - vectors_y[temp_y]) return distance class EuclideanMetric(AbstractMetric): """ Euclidean metric (L2) """ name = 'euclidean_metric' @classmethod def get_distance_time_series(cls, time_series_x, time_series_y, embedding_dimension, time_delay, index_x, index_y): """ See AbstractMetric """ distance = 0 for idx in np.arange(embedding_dimension): temp_x = index_x + (idx * time_delay) temp_y = index_y + (idx * time_delay) distance += math.pow(time_series_x[temp_x] - time_series_y[temp_y], 2) return math.sqrt(distance) @classmethod def get_distance_vectors(cls, vectors_x, vectors_y, embedding_dimension, index_x, index_y): """ See AbstractMetric """ distance = 0 for idx in np.arange(embedding_dimension): temp_x = index_x * embedding_dimension + idx temp_y = index_y * embedding_dimension + idx distance += math.pow(vectors_x[temp_x] - vectors_y[temp_y], 2) return math.sqrt(distance) class MaximumMetric(AbstractMetric): """ Maximum metric (L_inf) """ name = 'maximum_metric' @classmethod def get_distance_time_series(cls, time_series_x, time_series_y, embedding_dimension, time_delay, index_x, index_y): """ See AbstractMetric """ distance = np.finfo(np.float32).min for index in np.arange(embedding_dimension): temp_x = index_x + (index * time_delay) temp_y = index_y + (index * time_delay) value = math.fabs(time_series_x[temp_x] - time_series_y[temp_y]) if value > distance: distance = value return distance @classmethod def get_distance_vectors(cls, vectors_x, vectors_y, embedding_dimension, index_x, index_y): """ See AbstractMetric """ distance = np.finfo(np.float32).min for idx in np.arange(embedding_dimension): temp_x = index_x * embedding_dimension + idx temp_y = index_y * embedding_dimension + idx value = math.fabs(vectors_x[temp_x] - vectors_y[temp_y]) if value > distance: distance = value return distance
30.303571
119
0.640247
426
3,394
4.793427
0.161972
0.158668
0.083741
0.073457
0.817826
0.81097
0.801175
0.801175
0.769834
0.750735
0
0.006433
0.267236
3,394
111
120
30.576577
0.814636
0.084856
0
0.704918
0
0
0.014599
0
0
0
0
0
0
1
0.098361
false
0
0.04918
0
0.344262
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
93a9e4156b253bf86c12abf41c067da73907a9c1
5,627
py
Python
tests/rulelistmodel/categoricalmodel/test_categoricalstatistic.py
HMProenca/RuleList
4e500c3a9813aadb149286458f11460904fd15d4
[ "MIT" ]
8
2021-02-23T10:57:29.000Z
2022-03-15T10:29:08.000Z
tests/rulelistmodel/categoricalmodel/test_categoricalstatistic.py
HMProenca/RuleList
4e500c3a9813aadb149286458f11460904fd15d4
[ "MIT" ]
3
2021-02-26T21:54:24.000Z
2021-06-09T13:28:10.000Z
tests/rulelistmodel/categoricalmodel/test_categoricalstatistic.py
HMProenca/RuleList
4e500c3a9813aadb149286458f11460904fd15d4
[ "MIT" ]
2
2021-02-26T21:32:22.000Z
2021-11-01T09:32:38.000Z
import numpy as np import pandas as pd import pytest from gmpy2 import bit_mask from rulelist.datastructure.data import Data from rulelist.rulelistmodel.categoricalmodel.categoricalstatistic import CategoricalFixedStatistic, \ CategoricalFreeStatistic @pytest.fixture def constant_parameters(): input_n_cutpoints = 5 input_discretization = "static" input_target_data = "categorical" input_minsupp = 0 dictinput = {"attribute1": np.arange(100), "attribute2": np.array(["below50" if i < 50 else "above49" for i in range(100)])} input_input_data = pd.DataFrame(data=dictinput) yield input_input_data, input_n_cutpoints, input_discretization, input_target_data,input_minsupp @pytest.fixture def generate_inputvalues_one_target(constant_parameters): input_input_data, input_n_cutpoints, input_discretization, input_target_data,input_minsupp = constant_parameters # targets dictoutput = {"target1": np.array(["below50" if i < 50 else "above49" for i in range(100)])} input_output_data = pd.DataFrame(data=dictoutput) data_class = Data(input_input_data, input_n_cutpoints, input_discretization, input_output_data, input_target_data,input_minsupp) input_bitarray_for_statistic = bit_mask(data_class.number_instances) yield data_class, input_bitarray_for_statistic @pytest.fixture def generate_inputvalues_two_targets(constant_parameters): input_input_data, input_n_cutpoints, input_discretization, input_target_data,input_minsupp = constant_parameters # targets dictoutput = {"target1": np.array(["below50" if i < 50 else "above49" for i in range(100)]), "target2": np.array(["below25" if i < 25 else "above25" for i in range(100)])} input_output_data = pd.DataFrame(data=dictoutput) data_class = Data(input_input_data, input_n_cutpoints, input_discretization, input_output_data, input_target_data,input_minsupp) input_bitarray_for_statistic = bit_mask(data_class.number_instances) yield data_class, input_bitarray_for_statistic class TestCategoricalFixedStatistic: def test_2targets(self,generate_inputvalues_two_targets): data_class, input_bitarray_for_statistic = generate_inputvalues_two_targets statistic = CategoricalFixedStatistic(data_class) statistic.replace_stats(data_class,input_bitarray_for_statistic) expected_usage = 100 expected_number_targets = 2 expected_usage_per_class ={"target1": {"below50":50, "above49":50 }, "target2": {'below25': 25, 'above25': 75}} expected_number_classes = {'target1': 2, 'target2': 2} expected_prob_per_classes = {'target1': {'below50': 0.5, 'above49': 0.5}, 'target2': {'below25': 0.25, 'above25': 0.75}} assert expected_usage == statistic.usage assert expected_number_targets == statistic.number_targets assert expected_usage_per_class == statistic.usage_per_class assert expected_number_classes == statistic.number_classes assert expected_prob_per_classes == statistic.prob_per_classes def test_1targets(self,generate_inputvalues_one_target): data_class, input_bitarray_for_statistic = generate_inputvalues_one_target statistic = CategoricalFixedStatistic(data_class) statistic.replace_stats(data_class,input_bitarray_for_statistic) expected_usage = 100 expected_number_targets = 1 expected_usage_per_class ={"target1": {"below50":50, "above49":50 }} expected_number_classes = {'target1': 2} expected_prob_per_classes = {'target1': {'below50': 0.5, 'above49': 0.5}} assert expected_usage == statistic.usage assert expected_number_targets == statistic.number_targets assert expected_usage_per_class == statistic.usage_per_class assert expected_number_classes == statistic.number_classes assert expected_prob_per_classes == statistic.prob_per_classes class TestCategoricalFreeStatistic: def test_2targets(self,generate_inputvalues_two_targets): data_class, input_bitarray_for_statistic = generate_inputvalues_two_targets statistic = CategoricalFreeStatistic(data_class) statistic.replace_stats(data_class,input_bitarray_for_statistic) expected_usage = 100 expected_number_targets = 2 expected_usage_per_class ={"target1": {"below50":50, "above49":50 }, "target2": {'below25': 25, 'above25': 75}} expected_number_classes = {'target1': 2, 'target2': 2} assert expected_usage == statistic.usage assert expected_number_targets == statistic.number_targets assert expected_usage_per_class == statistic.usage_per_class assert expected_number_classes == statistic.number_classes def test_1targets(self,generate_inputvalues_one_target): data_class, input_bitarray_for_statistic = generate_inputvalues_one_target statistic = CategoricalFreeStatistic(data_class) statistic.replace_stats(data_class,input_bitarray_for_statistic) expected_usage = 100 expected_number_targets = 1 expected_usage_per_class ={"target1": {"below50":50, "above49":50 }} expected_number_classes = {'target1': 2} assert expected_usage == statistic.usage assert expected_number_targets == statistic.number_targets assert expected_usage_per_class == statistic.usage_per_class assert expected_number_classes == statistic.number_classes
47.285714
116
0.73254
653
5,627
5.92343
0.128637
0.041882
0.049638
0.077559
0.854705
0.836608
0.836608
0.836608
0.836608
0.836608
0
0.035456
0.188022
5,627
118
117
47.686441
0.811118
0.002666
0
0.72043
0
0
0.061508
0
0
0
0
0
0.193548
1
0.075269
false
0
0.064516
0
0.16129
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
9e0c072744329249a1003688b2d6dc84490784c9
3,062
py
Python
src/tfont/objects/feature.py
moyogo/tfont
6da511163af28471b1744e783ff46421d4cf4aed
[ "Apache-2.0" ]
2
2018-11-23T15:34:42.000Z
2019-02-12T03:05:38.000Z
src/tfont/objects/feature.py
BlackFoundry/tfont
182178aff22bf6c7569456f36d6f6fdbd6009528
[ "Apache-2.0" ]
null
null
null
src/tfont/objects/feature.py
BlackFoundry/tfont
182178aff22bf6c7569456f36d6f6fdbd6009528
[ "Apache-2.0" ]
null
null
null
import attr from tfont.util.tracker import obj_setattr from typing import Optional @attr.s(cmp=False, repr=False, slots=True) class Feature: tag: str = attr.ib(default="") content: str = attr.ib(default="") _parent: Optional[object] = attr.ib(default=None, init=False) def __repr__(self): return "%s(%r, %r)" % (self.__class__.__name__, self.tag, self.content) def __setattr__(self, key, value): try: font = self._parent except AttributeError: pass else: if font is not None and key[0] != "_": oldValue = getattr(self, key) if value != oldValue: if key == "tag": font.features[value] = self return obj_setattr(self, key, value) font._layoutEngine = None return obj_setattr(self, key, value) def __str__(self): tag = self.tag return "feature %s {\n%s\n} %s;" % (tag, self.content, tag) @property def font(self): return self._parent @attr.s(cmp=False, repr=False, slots=True) class FeatureClass: name: str = attr.ib(default="") content: str = attr.ib(default="") _parent: Optional[object] = attr.ib(default=None, init=False) def __repr__(self): return "%s(%r, %r)" % ( self.__class__.__name__, self.name, self.content) def __setattr__(self, key, value): try: font = self._parent except AttributeError: pass else: if font is not None and key[0] != "_": oldValue = getattr(self, key) if value != oldValue: if key == "name": font.featureClasses[value] = self return obj_setattr(self, key, value) font._layoutEngine = None return obj_setattr(self, key, value) def __str__(self): return "@%s = [%s];" % (self.name, self.content) @property def font(self): return self._parent @attr.s(cmp=False, repr=False, slots=True) class FeatureHeader: description: str = attr.ib(default="") content: str = attr.ib(default="") _parent: Optional[object] = attr.ib(default=None, init=False) def __repr__(self): return "%s(%r, %r)" % ( self.__class__.__name__, self.description, self.content) def __setattr__(self, key, value): try: font = self._parent except AttributeError: pass else: if font is not None and key[0] != "_": oldValue = getattr(self, key) if value != oldValue: obj_setattr(self, key, value) font._layoutEngine = None return obj_setattr(self, key, value) def __str__(self): return str(self.content) @property def font(self): return self._parent
28.091743
79
0.528739
339
3,062
4.533923
0.162242
0.054652
0.076122
0.111256
0.848406
0.848406
0.848406
0.848406
0.848406
0.787899
0
0.001524
0.356956
3,062
108
80
28.351852
0.779076
0
0
0.770115
0
0
0.024167
0
0
0
0
0
0
1
0.137931
false
0.034483
0.034483
0.091954
0.471264
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
1958e25ae0ac0b45e18bb7df1cc59da28df12931
58,240
py
Python
angr/procedures/definitions/win32_activeds.py
r4b3rt/angr
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
[ "BSD-2-Clause" ]
null
null
null
angr/procedures/definitions/win32_activeds.py
r4b3rt/angr
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
[ "BSD-2-Clause" ]
null
null
null
angr/procedures/definitions/win32_activeds.py
r4b3rt/angr
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
[ "BSD-2-Clause" ]
null
null
null
# pylint:disable=line-too-long import logging from ...sim_type import SimTypeFunction, SimTypeShort, SimTypeInt, SimTypeLong, SimTypeLongLong, SimTypeDouble, SimTypeFloat, SimTypePointer, SimTypeChar, SimStruct, SimTypeFixedSizeArray, SimTypeBottom, SimUnion, SimTypeBool from ...calling_conventions import SimCCStdcall, SimCCMicrosoftAMD64 from .. import SIM_PROCEDURES as P from . import SimLibrary _l = logging.getLogger(name=__name__) lib = SimLibrary() lib.set_default_cc('X86', SimCCStdcall) lib.set_default_cc('AMD64', SimCCMicrosoftAMD64) lib.set_library_names("activeds.dll") prototypes = \ { # 'ADsGetObject': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeBottom(label="Guid"), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["lpszPathName", "riid", "ppObject"]), # 'ADsBuildEnumerator': SimTypeFunction([SimTypeBottom(label="IADsContainer"), SimTypePointer(SimTypeBottom(label="IEnumVARIANT"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pADsContainer", "ppEnumVariant"]), # 'ADsFreeEnumerator': SimTypeFunction([SimTypeBottom(label="IEnumVARIANT")], SimTypeInt(signed=True, label="Int32"), arg_names=["pEnumVariant"]), # 'ADsEnumerateNext': SimTypeFunction([SimTypeBottom(label="IEnumVARIANT"), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pEnumVariant", "cElements", "pvar", "pcElementsFetched"]), # 'ADsBuildVarArrayStr': SimTypeFunction([SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["lppPathNames", "dwPathNames", "pVar"]), # 'ADsBuildVarArrayInt': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["lpdwObjectTypes", "dwObjectTypes", "pVar"]), # 'ADsOpenObject': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="ADS_AUTHENTICATION_ENUM"), SimTypePointer(SimTypeBottom(label="Guid"), offset=0), SimTypePointer(SimTypePointer(SimTypeBottom(label="Void"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["lpszPathName", "lpszUserName", "lpszPassword", "dwReserved", "riid", "ppObject"]), # 'ADsGetLastError': SimTypeFunction([SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), label="LPArray", offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["lpError", "lpErrorBuf", "dwErrorBufLen", "lpNameBuf", "dwNameBufLen"]), # 'ADsSetLastError': SimTypeFunction([SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeBottom(label="Void"), arg_names=["dwErr", "pszError", "pszProvider"]), # 'AllocADsMem': SimTypeFunction([SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["cb"]), # 'FreeADsMem': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pMem"]), # 'ReallocADsMem': SimTypeFunction([SimTypePointer(SimTypeBottom(label="Void"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypeInt(signed=False, label="UInt32")], SimTypePointer(SimTypeBottom(label="Void"), offset=0), arg_names=["pOldMem", "cbOld", "cbNew"]), # 'AllocADsStr': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypePointer(SimTypeChar(label="Char"), offset=0), arg_names=["pStr"]), # 'FreeADsStr': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pStr"]), # 'ReallocADsStr': SimTypeFunction([SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["ppStr", "pStr"]), # 'ADsEncodeBinaryData': SimTypeFunction([SimTypePointer(SimTypeChar(label="Byte"), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pbSrcData", "dwSrcLen", "ppszDestData"]), # 'ADsDecodeBinaryData': SimTypeFunction([SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypePointer(SimTypeChar(label="Byte"), offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["szSrcData", "ppbDestData", "pdwDestLen"]), # 'PropVariantToAdsType': SimTypeFunction([SimTypePointer(SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimTypePointer(SimStruct({"dwType": SimTypeInt(signed=False, label="ADSTYPEENUM"), "Anonymous": SimUnion({"DNString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "CaseExactString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "CaseIgnoreString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "PrintableString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "NumericString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "Boolean": SimTypeInt(signed=False, label="UInt32"), "Integer": SimTypeInt(signed=False, label="UInt32"), "OctetString": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_OCTET_STRING", pack=False, align=None), "UTCTime": SimStruct({"wYear": SimTypeShort(signed=False, label="UInt16"), "wMonth": SimTypeShort(signed=False, label="UInt16"), "wDayOfWeek": SimTypeShort(signed=False, label="UInt16"), "wDay": SimTypeShort(signed=False, label="UInt16"), "wHour": SimTypeShort(signed=False, label="UInt16"), "wMinute": SimTypeShort(signed=False, label="UInt16"), "wSecond": SimTypeShort(signed=False, label="UInt16"), "wMilliseconds": SimTypeShort(signed=False, label="UInt16")}, name="SYSTEMTIME", pack=False, align=None), "LargeInteger": SimTypeBottom(label="LARGE_INTEGER"), "ClassName": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "ProviderSpecific": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_PROV_SPECIFIC", pack=False, align=None), "pCaseIgnoreList": SimTypePointer(SimStruct({"Next": SimTypePointer(SimTypeBottom(label="ADS_CASEIGNORE_LIST"), offset=0), "String": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_CASEIGNORE_LIST", pack=False, align=None), offset=0), "pOctetList": SimTypePointer(SimStruct({"Next": SimTypePointer(SimTypeBottom(label="ADS_OCTET_LIST"), offset=0), "Length": SimTypeInt(signed=False, label="UInt32"), "Data": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_OCTET_LIST", pack=False, align=None), offset=0), "pPath": SimTypePointer(SimStruct({"Type": SimTypeInt(signed=False, label="UInt32"), "VolumeName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Path": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_PATH", pack=False, align=None), offset=0), "pPostalAddress": SimTypePointer(SimStruct({"PostalAddress": SimTypeFixedSizeArray(SimTypePointer(SimTypeChar(label="Char"), offset=0), 6)}, name="ADS_POSTALADDRESS", pack=False, align=None), offset=0), "Timestamp": SimStruct({"WholeSeconds": SimTypeInt(signed=False, label="UInt32"), "EventID": SimTypeInt(signed=False, label="UInt32")}, name="ADS_TIMESTAMP", pack=False, align=None), "BackLink": SimStruct({"RemoteID": SimTypeInt(signed=False, label="UInt32"), "ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_BACKLINK", pack=False, align=None), "pTypedName": SimTypePointer(SimStruct({"ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Level": SimTypeInt(signed=False, label="UInt32"), "Interval": SimTypeInt(signed=False, label="UInt32")}, name="ADS_TYPEDNAME", pack=False, align=None), offset=0), "Hold": SimStruct({"ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Amount": SimTypeInt(signed=False, label="UInt32")}, name="ADS_HOLD", pack=False, align=None), "pNetAddress": SimTypePointer(SimStruct({"AddressType": SimTypeInt(signed=False, label="UInt32"), "AddressLength": SimTypeInt(signed=False, label="UInt32"), "Address": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NETADDRESS", pack=False, align=None), offset=0), "pReplicaPointer": SimTypePointer(SimStruct({"ServerName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "ReplicaType": SimTypeInt(signed=False, label="UInt32"), "ReplicaNumber": SimTypeInt(signed=False, label="UInt32"), "Count": SimTypeInt(signed=False, label="UInt32"), "ReplicaAddressHints": SimTypePointer(SimStruct({"AddressType": SimTypeInt(signed=False, label="UInt32"), "AddressLength": SimTypeInt(signed=False, label="UInt32"), "Address": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NETADDRESS", pack=False, align=None), offset=0)}, name="ADS_REPLICAPOINTER", pack=False, align=None), offset=0), "pFaxNumber": SimTypePointer(SimStruct({"TelephoneNumber": SimTypePointer(SimTypeChar(label="Char"), offset=0), "NumberOfBits": SimTypeInt(signed=False, label="UInt32"), "Parameters": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_FAXNUMBER", pack=False, align=None), offset=0), "Email": SimStruct({"Address": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Type": SimTypeInt(signed=False, label="UInt32")}, name="ADS_EMAIL", pack=False, align=None), "SecurityDescriptor": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NT_SECURITY_DESCRIPTOR", pack=False, align=None), "pDNWithBinary": SimTypePointer(SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpBinaryValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pszDNString": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_DN_WITH_BINARY", pack=False, align=None), offset=0), "pDNWithString": SimTypePointer(SimStruct({"pszStringValue": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pszDNString": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_DN_WITH_STRING", pack=False, align=None), offset=0)}, name="<anon>", label="None")}, name="ADSVALUE", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pVariant", "dwNumVariant", "ppAdsValues", "pdwNumValues"]), # 'AdsTypeToPropVariant': SimTypeFunction([SimTypePointer(SimStruct({"dwType": SimTypeInt(signed=False, label="ADSTYPEENUM"), "Anonymous": SimUnion({"DNString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "CaseExactString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "CaseIgnoreString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "PrintableString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "NumericString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "Boolean": SimTypeInt(signed=False, label="UInt32"), "Integer": SimTypeInt(signed=False, label="UInt32"), "OctetString": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_OCTET_STRING", pack=False, align=None), "UTCTime": SimStruct({"wYear": SimTypeShort(signed=False, label="UInt16"), "wMonth": SimTypeShort(signed=False, label="UInt16"), "wDayOfWeek": SimTypeShort(signed=False, label="UInt16"), "wDay": SimTypeShort(signed=False, label="UInt16"), "wHour": SimTypeShort(signed=False, label="UInt16"), "wMinute": SimTypeShort(signed=False, label="UInt16"), "wSecond": SimTypeShort(signed=False, label="UInt16"), "wMilliseconds": SimTypeShort(signed=False, label="UInt16")}, name="SYSTEMTIME", pack=False, align=None), "LargeInteger": SimTypeBottom(label="LARGE_INTEGER"), "ClassName": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "ProviderSpecific": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_PROV_SPECIFIC", pack=False, align=None), "pCaseIgnoreList": SimTypePointer(SimStruct({"Next": SimTypePointer(SimTypeBottom(label="ADS_CASEIGNORE_LIST"), offset=0), "String": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_CASEIGNORE_LIST", pack=False, align=None), offset=0), "pOctetList": SimTypePointer(SimStruct({"Next": SimTypePointer(SimTypeBottom(label="ADS_OCTET_LIST"), offset=0), "Length": SimTypeInt(signed=False, label="UInt32"), "Data": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_OCTET_LIST", pack=False, align=None), offset=0), "pPath": SimTypePointer(SimStruct({"Type": SimTypeInt(signed=False, label="UInt32"), "VolumeName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Path": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_PATH", pack=False, align=None), offset=0), "pPostalAddress": SimTypePointer(SimStruct({"PostalAddress": SimTypeFixedSizeArray(SimTypePointer(SimTypeChar(label="Char"), offset=0), 6)}, name="ADS_POSTALADDRESS", pack=False, align=None), offset=0), "Timestamp": SimStruct({"WholeSeconds": SimTypeInt(signed=False, label="UInt32"), "EventID": SimTypeInt(signed=False, label="UInt32")}, name="ADS_TIMESTAMP", pack=False, align=None), "BackLink": SimStruct({"RemoteID": SimTypeInt(signed=False, label="UInt32"), "ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_BACKLINK", pack=False, align=None), "pTypedName": SimTypePointer(SimStruct({"ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Level": SimTypeInt(signed=False, label="UInt32"), "Interval": SimTypeInt(signed=False, label="UInt32")}, name="ADS_TYPEDNAME", pack=False, align=None), offset=0), "Hold": SimStruct({"ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Amount": SimTypeInt(signed=False, label="UInt32")}, name="ADS_HOLD", pack=False, align=None), "pNetAddress": SimTypePointer(SimStruct({"AddressType": SimTypeInt(signed=False, label="UInt32"), "AddressLength": SimTypeInt(signed=False, label="UInt32"), "Address": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NETADDRESS", pack=False, align=None), offset=0), "pReplicaPointer": SimTypePointer(SimStruct({"ServerName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "ReplicaType": SimTypeInt(signed=False, label="UInt32"), "ReplicaNumber": SimTypeInt(signed=False, label="UInt32"), "Count": SimTypeInt(signed=False, label="UInt32"), "ReplicaAddressHints": SimTypePointer(SimStruct({"AddressType": SimTypeInt(signed=False, label="UInt32"), "AddressLength": SimTypeInt(signed=False, label="UInt32"), "Address": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NETADDRESS", pack=False, align=None), offset=0)}, name="ADS_REPLICAPOINTER", pack=False, align=None), offset=0), "pFaxNumber": SimTypePointer(SimStruct({"TelephoneNumber": SimTypePointer(SimTypeChar(label="Char"), offset=0), "NumberOfBits": SimTypeInt(signed=False, label="UInt32"), "Parameters": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_FAXNUMBER", pack=False, align=None), offset=0), "Email": SimStruct({"Address": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Type": SimTypeInt(signed=False, label="UInt32")}, name="ADS_EMAIL", pack=False, align=None), "SecurityDescriptor": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NT_SECURITY_DESCRIPTOR", pack=False, align=None), "pDNWithBinary": SimTypePointer(SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpBinaryValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pszDNString": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_DN_WITH_BINARY", pack=False, align=None), offset=0), "pDNWithString": SimTypePointer(SimStruct({"pszStringValue": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pszDNString": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_DN_WITH_STRING", pack=False, align=None), offset=0)}, name="<anon>", label="None")}, name="ADSVALUE", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32"), SimTypePointer(SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), offset=0)], SimTypeInt(signed=True, label="Int32"), arg_names=["pAdsValues", "dwNumValues", "pVariant"]), # 'AdsFreeAdsValues': SimTypeFunction([SimTypePointer(SimStruct({"dwType": SimTypeInt(signed=False, label="ADSTYPEENUM"), "Anonymous": SimUnion({"DNString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "CaseExactString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "CaseIgnoreString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "PrintableString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "NumericString": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "Boolean": SimTypeInt(signed=False, label="UInt32"), "Integer": SimTypeInt(signed=False, label="UInt32"), "OctetString": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_OCTET_STRING", pack=False, align=None), "UTCTime": SimStruct({"wYear": SimTypeShort(signed=False, label="UInt16"), "wMonth": SimTypeShort(signed=False, label="UInt16"), "wDayOfWeek": SimTypeShort(signed=False, label="UInt16"), "wDay": SimTypeShort(signed=False, label="UInt16"), "wHour": SimTypeShort(signed=False, label="UInt16"), "wMinute": SimTypeShort(signed=False, label="UInt16"), "wSecond": SimTypeShort(signed=False, label="UInt16"), "wMilliseconds": SimTypeShort(signed=False, label="UInt16")}, name="SYSTEMTIME", pack=False, align=None), "LargeInteger": SimTypeBottom(label="LARGE_INTEGER"), "ClassName": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "ProviderSpecific": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_PROV_SPECIFIC", pack=False, align=None), "pCaseIgnoreList": SimTypePointer(SimStruct({"Next": SimTypePointer(SimTypeBottom(label="ADS_CASEIGNORE_LIST"), offset=0), "String": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_CASEIGNORE_LIST", pack=False, align=None), offset=0), "pOctetList": SimTypePointer(SimStruct({"Next": SimTypePointer(SimTypeBottom(label="ADS_OCTET_LIST"), offset=0), "Length": SimTypeInt(signed=False, label="UInt32"), "Data": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_OCTET_LIST", pack=False, align=None), offset=0), "pPath": SimTypePointer(SimStruct({"Type": SimTypeInt(signed=False, label="UInt32"), "VolumeName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Path": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_PATH", pack=False, align=None), offset=0), "pPostalAddress": SimTypePointer(SimStruct({"PostalAddress": SimTypeFixedSizeArray(SimTypePointer(SimTypeChar(label="Char"), offset=0), 6)}, name="ADS_POSTALADDRESS", pack=False, align=None), offset=0), "Timestamp": SimStruct({"WholeSeconds": SimTypeInt(signed=False, label="UInt32"), "EventID": SimTypeInt(signed=False, label="UInt32")}, name="ADS_TIMESTAMP", pack=False, align=None), "BackLink": SimStruct({"RemoteID": SimTypeInt(signed=False, label="UInt32"), "ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_BACKLINK", pack=False, align=None), "pTypedName": SimTypePointer(SimStruct({"ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Level": SimTypeInt(signed=False, label="UInt32"), "Interval": SimTypeInt(signed=False, label="UInt32")}, name="ADS_TYPEDNAME", pack=False, align=None), offset=0), "Hold": SimStruct({"ObjectName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Amount": SimTypeInt(signed=False, label="UInt32")}, name="ADS_HOLD", pack=False, align=None), "pNetAddress": SimTypePointer(SimStruct({"AddressType": SimTypeInt(signed=False, label="UInt32"), "AddressLength": SimTypeInt(signed=False, label="UInt32"), "Address": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NETADDRESS", pack=False, align=None), offset=0), "pReplicaPointer": SimTypePointer(SimStruct({"ServerName": SimTypePointer(SimTypeChar(label="Char"), offset=0), "ReplicaType": SimTypeInt(signed=False, label="UInt32"), "ReplicaNumber": SimTypeInt(signed=False, label="UInt32"), "Count": SimTypeInt(signed=False, label="UInt32"), "ReplicaAddressHints": SimTypePointer(SimStruct({"AddressType": SimTypeInt(signed=False, label="UInt32"), "AddressLength": SimTypeInt(signed=False, label="UInt32"), "Address": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NETADDRESS", pack=False, align=None), offset=0)}, name="ADS_REPLICAPOINTER", pack=False, align=None), offset=0), "pFaxNumber": SimTypePointer(SimStruct({"TelephoneNumber": SimTypePointer(SimTypeChar(label="Char"), offset=0), "NumberOfBits": SimTypeInt(signed=False, label="UInt32"), "Parameters": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_FAXNUMBER", pack=False, align=None), offset=0), "Email": SimStruct({"Address": SimTypePointer(SimTypeChar(label="Char"), offset=0), "Type": SimTypeInt(signed=False, label="UInt32")}, name="ADS_EMAIL", pack=False, align=None), "SecurityDescriptor": SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0)}, name="ADS_NT_SECURITY_DESCRIPTOR", pack=False, align=None), "pDNWithBinary": SimTypePointer(SimStruct({"dwLength": SimTypeInt(signed=False, label="UInt32"), "lpBinaryValue": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "pszDNString": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_DN_WITH_BINARY", pack=False, align=None), offset=0), "pDNWithString": SimTypePointer(SimStruct({"pszStringValue": SimTypePointer(SimTypeChar(label="Char"), offset=0), "pszDNString": SimTypePointer(SimTypeChar(label="Char"), offset=0)}, name="ADS_DN_WITH_STRING", pack=False, align=None), offset=0)}, name="<anon>", label="None")}, name="ADSVALUE", pack=False, align=None), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeBottom(label="Void"), arg_names=["pAdsValues", "dwNumValues"]), # 'BinarySDToSecurityDescriptor': SimTypeFunction([SimTypePointer(SimStruct({"Revision": SimTypeChar(label="Byte"), "Sbz1": SimTypeChar(label="Byte"), "Control": SimTypeShort(signed=False, label="UInt16"), "Owner": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "Group": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "Sacl": SimTypePointer(SimStruct({"AclRevision": SimTypeChar(label="Byte"), "Sbz1": SimTypeChar(label="Byte"), "AclSize": SimTypeShort(signed=False, label="UInt16"), "AceCount": SimTypeShort(signed=False, label="UInt16"), "Sbz2": SimTypeShort(signed=False, label="UInt16")}, name="ACL", pack=False, align=None), offset=0), "Dacl": SimTypePointer(SimStruct({"AclRevision": SimTypeChar(label="Byte"), "Sbz1": SimTypeChar(label="Byte"), "AclSize": SimTypeShort(signed=False, label="UInt16"), "AceCount": SimTypeShort(signed=False, label="UInt16"), "Sbz2": SimTypeShort(signed=False, label="UInt16")}, name="ACL", pack=False, align=None), offset=0)}, name="SECURITY_DESCRIPTOR", pack=False, align=None), offset=0), SimTypePointer(SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["pSecurityDescriptor", "pVarsec", "pszServerName", "userName", "passWord", "dwFlags"]), # 'SecurityDescriptorToBinarySD': SimTypeFunction([SimStruct({"Anonymous": SimUnion({"Anonymous": SimStruct({"vt": SimTypeShort(signed=False, label="UInt16"), "wReserved1": SimTypeShort(signed=False, label="UInt16"), "wReserved2": SimTypeShort(signed=False, label="UInt16"), "wReserved3": SimTypeShort(signed=False, label="UInt16"), "Anonymous": SimUnion({"llVal": SimTypeLongLong(signed=True, label="Int64"), "lVal": SimTypeInt(signed=True, label="Int32"), "bVal": SimTypeChar(label="Byte"), "iVal": SimTypeShort(signed=True, label="Int16"), "fltVal": SimTypeFloat(size=32), "dblVal": SimTypeFloat(size=64), "boolVal": SimTypeShort(signed=True, label="Int16"), "__OBSOLETE__VARIANT_BOOL": SimTypeShort(signed=True, label="Int16"), "scode": SimTypeInt(signed=True, label="Int32"), "cyVal": SimTypeBottom(label="CY"), "date": SimTypeFloat(size=64), "bstrVal": SimTypePointer(SimTypeChar(label="Char"), offset=0), "punkVal": SimTypeBottom(label="IUnknown"), "pdispVal": SimTypeBottom(label="IDispatch"), "parray": SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), "pbVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "piVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "plVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pllVal": SimTypePointer(SimTypeLongLong(signed=True, label="Int64"), offset=0), "pfltVal": SimTypePointer(SimTypeFloat(size=32), offset=0), "pdblVal": SimTypePointer(SimTypeFloat(size=64), offset=0), "pboolVal": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "__OBSOLETE__VARIANT_PBOOL": SimTypePointer(SimTypeShort(signed=True, label="Int16"), offset=0), "pscode": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "pcyVal": SimTypePointer(SimTypeBottom(label="CY"), offset=0), "pdate": SimTypePointer(SimTypeFloat(size=64), offset=0), "pbstrVal": SimTypePointer(SimTypePointer(SimTypeChar(label="Char"), offset=0), offset=0), "ppunkVal": SimTypePointer(SimTypeBottom(label="IUnknown"), offset=0), "ppdispVal": SimTypePointer(SimTypeBottom(label="IDispatch"), offset=0), "pparray": SimTypePointer(SimTypePointer(SimStruct({"cDims": SimTypeShort(signed=False, label="UInt16"), "fFeatures": SimTypeShort(signed=False, label="UInt16"), "cbElements": SimTypeInt(signed=False, label="UInt32"), "cLocks": SimTypeInt(signed=False, label="UInt32"), "pvData": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "rgsabound": SimTypePointer(SimStruct({"cElements": SimTypeInt(signed=False, label="UInt32"), "lLbound": SimTypeInt(signed=True, label="Int32")}, name="SAFEARRAYBOUND", pack=False, align=None), offset=0)}, name="SAFEARRAY", pack=False, align=None), offset=0), offset=0), "pvarVal": SimTypePointer(SimTypeBottom(label="VARIANT"), offset=0), "byref": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "cVal": SimTypeBottom(label="CHAR"), "uiVal": SimTypeShort(signed=False, label="UInt16"), "ulVal": SimTypeInt(signed=False, label="UInt32"), "ullVal": SimTypeLongLong(signed=False, label="UInt64"), "intVal": SimTypeInt(signed=True, label="Int32"), "uintVal": SimTypeInt(signed=False, label="UInt32"), "pdecVal": SimTypePointer(SimTypeBottom(label="DECIMAL"), offset=0), "pcVal": SimTypePointer(SimTypeChar(label="Byte"), offset=0), "puiVal": SimTypePointer(SimTypeShort(signed=False, label="UInt16"), offset=0), "pulVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "pullVal": SimTypePointer(SimTypeLongLong(signed=False, label="UInt64"), offset=0), "pintVal": SimTypePointer(SimTypeInt(signed=True, label="Int32"), offset=0), "puintVal": SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), "Anonymous": SimStruct({"pvRecord": SimTypePointer(SimTypeBottom(label="Void"), offset=0), "pRecInfo": SimTypeBottom(label="IRecordInfo")}, name="_Anonymous_e__Struct", pack=False, align=None)}, name="<anon>", label="None")}, name="_Anonymous_e__Struct", pack=False, align=None), "decVal": SimTypeBottom(label="DECIMAL")}, name="<anon>", label="None")}, name="VARIANT", pack=False, align=None), SimTypePointer(SimTypePointer(SimStruct({"Revision": SimTypeChar(label="Byte"), "Sbz1": SimTypeChar(label="Byte"), "Control": SimTypeShort(signed=False, label="UInt16"), "Owner": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "Group": SimTypePointer(SimTypeInt(signed=True, label="Int"), label="IntPtr", offset=0), "Sacl": SimTypePointer(SimStruct({"AclRevision": SimTypeChar(label="Byte"), "Sbz1": SimTypeChar(label="Byte"), "AclSize": SimTypeShort(signed=False, label="UInt16"), "AceCount": SimTypeShort(signed=False, label="UInt16"), "Sbz2": SimTypeShort(signed=False, label="UInt16")}, name="ACL", pack=False, align=None), offset=0), "Dacl": SimTypePointer(SimStruct({"AclRevision": SimTypeChar(label="Byte"), "Sbz1": SimTypeChar(label="Byte"), "AclSize": SimTypeShort(signed=False, label="UInt16"), "AceCount": SimTypeShort(signed=False, label="UInt16"), "Sbz2": SimTypeShort(signed=False, label="UInt16")}, name="ACL", pack=False, align=None), offset=0)}, name="SECURITY_DESCRIPTOR", pack=False, align=None), offset=0), offset=0), SimTypePointer(SimTypeInt(signed=False, label="UInt32"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypePointer(SimTypeChar(label="Char"), offset=0), SimTypeInt(signed=False, label="UInt32")], SimTypeInt(signed=True, label="Int32"), arg_names=["vVarSecDes", "ppSecurityDescriptor", "pdwSDLength", "pszServerName", "userName", "passWord", "dwFlags"]), } lib.set_prototypes(prototypes)
882.424242
10,594
0.746446
6,426
58,240
6.723778
0.049953
0.067559
0.112574
0.098688
0.962043
0.960655
0.956998
0.955956
0.949638
0.93957
0
0.025525
0.057555
58,240
65
10,595
896
0.76166
0.000481
0
0
0
0
0.22104
0.008596
0
0
0
0
0
1
0
false
0.083333
0.138889
0
0.138889
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
9
5fe22b97281533204e305f90512560e23d53c7d6
22,990
py
Python
dlkit/abstract_osid/osid/search_orders.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
2
2018-02-23T12:16:11.000Z
2020-10-08T17:54:24.000Z
dlkit/abstract_osid/osid/search_orders.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
87
2017-04-21T18:57:15.000Z
2021-12-13T19:43:57.000Z
dlkit/abstract_osid/osid/search_orders.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
1
2018-03-01T16:44:25.000Z
2018-03-01T16:44:25.000Z
"""Implementations of osid abstract base class search_orders.""" # pylint: disable=invalid-name # Method names comply with OSID specification. # pylint: disable=no-init # Abstract classes do not define __init__. # pylint: disable=too-few-public-methods # Some interfaces are specified as 'markers' and include no methods. # pylint: disable=too-many-public-methods # Number of methods are defined in specification # pylint: disable=too-many-ancestors # Inheritance defined in specification # pylint: disable=too-many-arguments # Argument signature defined in specification. # pylint: disable=duplicate-code # All apparent duplicates have been inspected. They aren't. import abc class OsidSearchOrder: """``OsidSearchOrder`` specifies preferred ordering of search results. An ``OsidSearchOrder`` is available from an search session and supplied to an ``OsidSearch`` interface. OsidSearch os = session.getObjectSearch(); os.limitResultSet(1, 25); OsidSearchOrder order = session.getObjectSearchOrder(); order.orderByDisplayName(); os.orderResults(order); OsidQuery queru; query = session.getObjectQuery(); query.addDescriptionMatch("*food*", wildcardStringMatchType, true); ObjectSearchResults results = session.getObjectsBySearch(query, os); ObjectList list = results.getObjectList(); """ __metaclass__ = abc.ABCMeta class OsidIdentifiableSearchOrder: """``OsidIdentifiableSearchOrder`` specifies preferred ordering of search results. An ``OsidSearchOrder`` is available from an search session and supplied to an ``OsidSearch``. """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_id(self, style): """Specifies a preference for ordering the result set by the ``Id``. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass class OsidExtensibleSearchOrder: """``OsidExtensibleSearchOrder`` specifies preferred ordering of search results. An ``OsidSearchOrder`` is available from an search session and supplied to an ``OsidSearch``. """ __metaclass__ = abc.ABCMeta class OsidBrowsableSearchOrder: """``OsidBrowsableSearchOrder`` specifies preferred ordering of search results. An ``OsidSearchOrder`` is available from an search session and supplied to an ``OsidSearch``. """ __metaclass__ = abc.ABCMeta class OsidTemporalSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_effective(self, style): """Specifies a preference for ordering the result set by the effective status. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_start_date(self, style): """Specifies a preference for ordering the result set by the start date. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_end_date(self, style): """Specifies a preference for ordering the result set by the end date. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass class OsidSubjugateableSearchOrder: """An interface for specifying the ordering of dependent object search results.""" __metaclass__ = abc.ABCMeta class OsidAggregateableSearchOrder: """An interface for specifying the ordering of assemblage search results.""" __metaclass__ = abc.ABCMeta class OsidContainableSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_sequestered(self, style): """Specifies a preference for ordering the result set by the sequestered flag. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass class OsidSourceableSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_provider(self, style): """Specifies a preference for ordering the results by provider. The element of the provider to order is not specified but may be managed through the provider ordering interface. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_provider_search_order(self): """Tests if a ``ProviderSearchOrder`` interface is available. :return: ``true`` if a provider search order interface is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_provider_search_order(self): """Gets the search order interface for a provider. :return: the provider search order interface :rtype: ``osid.resource.ResourceSearchOrder`` :raise: ``Unimplemented`` -- ``supports_provider_search_order()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_provider_search_order()`` is ``true``.* """ return # osid.resource.ResourceSearchOrder provider_search_order = property(fget=get_provider_search_order) class OsidFederateableSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta class OsidOperableSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_active(self, style): """Specifies a preference for ordering the result set by the active status. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_enabled(self, style): """Specifies a preference for ordering the result set by the administratively enabled status. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_disabled(self, style): """Specifies a preference for ordering the result set by the administratively disabled status. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_operational(self, style): """Specifies a preference for ordering the results by the operational status. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass class OsidObjectSearchOrder: """``OsidObjectSearchOrder`` specifies preferred ordering of search results. An ``OsidSearchOrder`` is available from an search session and supplied to an ``OsidSearch``. OsidObjectSearch os = session.getObjectSearch(); os.limitResultSet(1, 25); OsidObjectSearchOrder order = session.getObjectSearchOrder(); order.orderByDisplayName(); os.orderResults(order); OsidObjectQuery query; query = session.getObjectQuery(); query.addDescriptionMatch("*food*", wildcardStringMatchType, true); ObjectSearchResults results = session.getObjectsBySearch(query, os); ObjectList list = results.getObjectList(); """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_display_name(self, style): """Specifies a preference for ordering the result set by the display name. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_description(self, style): """Specifies a preference for ordering the result set by the description. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_genus_type(self, style): """Specifies a preference for ordering the result set by the genus type. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_state(self, process_id, style): """Orders by the state in a given ``Process``. :param process_id: a process ``Id`` :type process_id: ``osid.id.Id`` :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``process_id`` or ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_cumulative_rating(self, book_id, style): """Orders by the cumulative rating in a given ``Book``. :param book_id: a book ``Id`` :type book_id: ``osid.id.Id`` :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``book_id`` or ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_statistic(self, meter_id, style): """Orders by a statistic for a given ``Meter``. :param meter_id: a meter ``Id`` :type meter_id: ``osid.id.Id`` :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``meter_id`` or ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_create_time(self, style): """Orders by the timestamp of the first journal entry. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_last_modified_time(self, style): """Orders by the timestamp of the last journal entry. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass class OsidRelationshipSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_end_reason(self, style): """Specifies a preference for ordering the results by the end reason state. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_end_reason_search_order(self): """Tests if a ``StateSearchOrder`` is available. :return: ``true`` if a state search order is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_end_reason_search_order(self): """Gets the search order for a state. :return: the state search order :rtype: ``osid.process.StateSearchOrder`` :raise: ``Unimplemented`` -- ``supports_end_reason_search_order()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_end_reason_search_order()`` is ``true``.* """ return # osid.process.StateSearchOrder end_reason_search_order = property(fget=get_end_reason_search_order) class OsidCatalogSearchOrder: """An interface for specifying the ordering of catalog search results.""" __metaclass__ = abc.ABCMeta class OsidRuleSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_rule(self, style): """Specifies a preference for ordering the results by the associated rule. The element of the rule to order is not specified but may be managed through a ``RuleSearchOrder``. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_rule_search_order(self): """Tests if a ``RuleSearchOrder`` is available. :return: ``true`` if a rule search order is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_rule_search_order(self): """Gets the search order for a rule. :return: the rule search order :rtype: ``osid.rules.RuleSearchOrder`` :raise: ``Unimplemented`` -- ``supports_rule_search_order()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_rule_search_order()`` is ``true``.* """ return # osid.rules.RuleSearchOrder rule_search_order = property(fget=get_rule_search_order) class OsidEnablerSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_schedule(self, style): """Specifies a preference for ordering the results by the associated schedule. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_schedule_search_order(self): """Tests if a ``ScheduleSearchOrder`` is available. :return: ``true`` if a schedule search order is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_schedule_search_order(self): """Gets the search order for a schedule. :return: the schedule search order :rtype: ``osid.calendaring.ScheduleSearchOrder`` :raise: ``Unimplemented`` -- ``supports_schedule_search_order() is false`` *compliance: optional -- This method must be implemented if ``supports_schedule_search_order()`` is true.* """ return # osid.calendaring.ScheduleSearchOrder schedule_search_order = property(fget=get_schedule_search_order) @abc.abstractmethod def order_by_event(self, style): """Specifies a preference for ordering the results by the associated event. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_event_search_order(self): """Tests if an ``EventSearchOrder`` is available. :return: ``true`` if an event search order is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_event_search_order(self): """Gets the search order for an event. :return: the event search order :rtype: ``osid.calendaring.EventSearchOrder`` :raise: ``Unimplemented`` -- ``supports_event_search_order() is false`` *compliance: optional -- This method must be implemented if ``supports_event_search_order()`` is true.* """ return # osid.calendaring.EventSearchOrder event_search_order = property(fget=get_event_search_order) @abc.abstractmethod def order_by_cyclic_event(self, style): """Orders the results by cyclic event. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_cyclic_event_search_order(self): """Tests if a cyclic event search order is available. :return: ``true`` if a cyclic event search order is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_cyclic_event_search_order(self): """Gets the cyclic event search order. :return: the cyclic event search order :rtype: ``osid.calendaring.cycle.CyclicEventSearchOrder`` :raise: ``IllegalState`` -- ``supports_cyclic_event_search_order()`` is ``false`` *compliance: mandatory -- This method must be implemented.* """ return # osid.calendaring.cycle.CyclicEventSearchOrder cyclic_event_search_order = property(fget=get_cyclic_event_search_order) @abc.abstractmethod def order_by_demographic(self, style): """Specifies a preference for ordering the results by the associated demographic resource. :param style: search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def supports_demographic_search_order(self): """Tests if a ``ResourceSearchOrder`` is available. :return: ``true`` if a resource search order is available, ``false`` otherwise :rtype: ``boolean`` *compliance: mandatory -- This method must be implemented.* """ return # boolean @abc.abstractmethod def get_demographic_search_order(self): """Gets the search order for a demographic resource. :return: the resource search order :rtype: ``osid.resource.ResourceSearchOrder`` :raise: ``Unimplemented`` -- ``supports_demographic_search_order()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_demographic_search_order()`` is ``true``.* """ return # osid.resource.ResourceSearchOrder demographic_search_order = property(fget=get_demographic_search_order) class OsidConstrainerSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta class OsidProcessorSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta class OsidGovernatorSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta class OsidCompendiumSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def order_by_start_date(self, style): """Specifies a preference for ordering the result set by the start date. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_end_date(self, style): """Specifies a preference for ordering the result set by the end date. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_interpolated(self, style): """Specifies a preference for ordering the result set by interpolated results. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass @abc.abstractmethod def order_by_extrapolated(self, style): """Specifies a preference for ordering the result set by extrapolated results. :param style: the search order style :type style: ``osid.SearchOrderStyle`` :raise: ``NullArgument`` -- ``style`` is ``null`` *compliance: mandatory -- This method must be implemented.* """ pass class OsidCapsuleSearchOrder: """An interface for specifying the ordering of search results.""" __metaclass__ = abc.ABCMeta
31.109608
102
0.652371
2,454
22,990
5.991035
0.08965
0.068086
0.057135
0.045708
0.808802
0.778398
0.731805
0.694259
0.658278
0.643042
0
0.000344
0.24167
22,990
738
103
31.151762
0.842951
0.645237
0
0.619318
0
0
0
0
0
0
0
0
0
1
0.238636
false
0.159091
0.005682
0
0.602273
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
7
5ff5d9e1f591a8552035fcc9f2cb0a13c2000dfe
14,986
py
Python
google/cloud/datastore_v1/proto/datastore_pb2_grpc.py
tswast/python-datastore
ddbbb03fc42bf53e698b3869a660a9938b3339e8
[ "Apache-2.0" ]
null
null
null
google/cloud/datastore_v1/proto/datastore_pb2_grpc.py
tswast/python-datastore
ddbbb03fc42bf53e698b3869a660a9938b3339e8
[ "Apache-2.0" ]
null
null
null
google/cloud/datastore_v1/proto/datastore_pb2_grpc.py
tswast/python-datastore
ddbbb03fc42bf53e698b3869a660a9938b3339e8
[ "Apache-2.0" ]
null
null
null
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.cloud.datastore_v1.proto import ( datastore_pb2 as google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2, ) class DatastoreStub(object): """Each RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Lookup = channel.unary_unary( "/google.datastore.v1.Datastore/Lookup", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.LookupRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.LookupResponse.FromString, ) self.RunQuery = channel.unary_unary( "/google.datastore.v1.Datastore/RunQuery", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RunQueryRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RunQueryResponse.FromString, ) self.BeginTransaction = channel.unary_unary( "/google.datastore.v1.Datastore/BeginTransaction", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.BeginTransactionRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.BeginTransactionResponse.FromString, ) self.Commit = channel.unary_unary( "/google.datastore.v1.Datastore/Commit", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.CommitRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.CommitResponse.FromString, ) self.Rollback = channel.unary_unary( "/google.datastore.v1.Datastore/Rollback", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RollbackRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RollbackResponse.FromString, ) self.AllocateIds = channel.unary_unary( "/google.datastore.v1.Datastore/AllocateIds", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.AllocateIdsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.AllocateIdsResponse.FromString, ) self.ReserveIds = channel.unary_unary( "/google.datastore.v1.Datastore/ReserveIds", request_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.ReserveIdsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.ReserveIdsResponse.FromString, ) class DatastoreServicer(object): """Each RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request. """ def Lookup(self, request, context): """Looks up entities by key. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def RunQuery(self, request, context): """Queries for entities. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def BeginTransaction(self, request, context): """Begins a new transaction. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def Commit(self, request, context): """Commits a transaction, optionally creating, deleting or modifying some entities. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def Rollback(self, request, context): """Rolls back a transaction. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def AllocateIds(self, request, context): """Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ReserveIds(self, request, context): """Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def add_DatastoreServicer_to_server(servicer, server): rpc_method_handlers = { "Lookup": grpc.unary_unary_rpc_method_handler( servicer.Lookup, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.LookupRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.LookupResponse.SerializeToString, ), "RunQuery": grpc.unary_unary_rpc_method_handler( servicer.RunQuery, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RunQueryRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RunQueryResponse.SerializeToString, ), "BeginTransaction": grpc.unary_unary_rpc_method_handler( servicer.BeginTransaction, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.BeginTransactionRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.BeginTransactionResponse.SerializeToString, ), "Commit": grpc.unary_unary_rpc_method_handler( servicer.Commit, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.CommitRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.CommitResponse.SerializeToString, ), "Rollback": grpc.unary_unary_rpc_method_handler( servicer.Rollback, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RollbackRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RollbackResponse.SerializeToString, ), "AllocateIds": grpc.unary_unary_rpc_method_handler( servicer.AllocateIds, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.AllocateIdsRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.AllocateIdsResponse.SerializeToString, ), "ReserveIds": grpc.unary_unary_rpc_method_handler( servicer.ReserveIds, request_deserializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.ReserveIdsRequest.FromString, response_serializer=google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.ReserveIdsResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( "google.datastore.v1.Datastore", rpc_method_handlers ) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class Datastore(object): """Each RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request. """ @staticmethod def Lookup( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/Lookup", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.LookupRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.LookupResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def RunQuery( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/RunQuery", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RunQueryRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RunQueryResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def BeginTransaction( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/BeginTransaction", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.BeginTransactionRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.BeginTransactionResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def Commit( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/Commit", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.CommitRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.CommitResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def Rollback( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/Rollback", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RollbackRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.RollbackResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def AllocateIds( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/AllocateIds", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.AllocateIdsRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.AllocateIdsResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def ReserveIds( request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.datastore.v1.Datastore/ReserveIds", google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.ReserveIdsRequest.SerializeToString, google_dot_cloud_dot_datastore__v1_dot_proto_dot_datastore__pb2.ReserveIdsResponse.FromString, options, channel_credentials, call_credentials, compression, wait_for_ready, timeout, metadata, )
40.612466
139
0.694782
1,561
14,986
6.236387
0.105061
0.106009
0.061839
0.07509
0.859373
0.84602
0.84602
0.787776
0.787776
0.787776
0
0.009091
0.243961
14,986
368
140
40.722826
0.850132
0.118711
0
0.640678
1
0
0.075437
0.045647
0
0
0
0
0
1
0.054237
false
0
0.00678
0.023729
0.094915
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
272157f32f51ada72400325ad9c702fec3ef24c5
143
py
Python
openrec/tf2/data/__init__.py
pbaiz/openrec
a00de2345844858194ef43ab6845342114a5be93
[ "Apache-2.0" ]
399
2018-01-04T15:24:02.000Z
2022-03-31T09:39:05.000Z
openrec/tf2/data/__init__.py
pbaiz/openrec
a00de2345844858194ef43ab6845342114a5be93
[ "Apache-2.0" ]
26
2018-01-14T04:01:28.000Z
2022-02-09T23:36:32.000Z
openrec/tf2/data/__init__.py
pbaiz/openrec
a00de2345844858194ef43ab6845342114a5be93
[ "Apache-2.0" ]
97
2017-12-22T07:07:35.000Z
2022-01-24T19:04:02.000Z
from openrec.tf2.data.utils import _DataStore from openrec.tf2.data.utils import _ParallelDataset from openrec.tf2.data.dataset import Dataset
35.75
51
0.853147
21
143
5.714286
0.428571
0.275
0.35
0.45
0.483333
0.483333
0
0
0
0
0
0.022901
0.083916
143
3
52
47.666667
0.89313
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
2721f9d58a8ae2f7d1b9f422a9eab03857f586d1
5,351
py
Python
epytope/Data/pssms/arb/mat/B_2703_9.py
christopher-mohr/epytope
8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd
[ "BSD-3-Clause" ]
7
2021-02-01T18:11:28.000Z
2022-01-31T19:14:07.000Z
epytope/Data/pssms/arb/mat/B_2703_9.py
christopher-mohr/epytope
8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd
[ "BSD-3-Clause" ]
22
2021-01-02T15:25:23.000Z
2022-03-14T11:32:53.000Z
epytope/Data/pssms/arb/mat/B_2703_9.py
christopher-mohr/epytope
8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd
[ "BSD-3-Clause" ]
4
2021-05-28T08:50:38.000Z
2022-03-14T11:45:32.000Z
B_2703_9 = {0: {'A': -3.8044363249505272e-06, 'C': -3.344080385404882e-06, 'E': -4.764236598387883e-06, 'D': -4.29953665358684e-06, 'G': -3.8044363249505272e-06, 'F': -5.2549950237957095e-06, 'I': -5.2549950237957095e-06, 'H': -3.8044363249505272e-06, 'K': -3.344080385404882e-06, 'M': -3.344080385404882e-06, 'L': -4.29953665358684e-06, 'N': -3.8044363249505272e-06, 'Q': -3.8044363249505272e-06, 'P': -3.8044363249505272e-06, 'S': -5.2549950237957095e-06, 'R': -4.764236598387883e-06, 'T': -3.8044363249505272e-06, 'W': -3.8044363249505272e-06, 'V': -4.764236598387883e-06, 'Y': -5.2549950237957095e-06}, 1: {'A': -4.29953665358684e-06, 'C': -2.388626219192371e-06, 'E': -4.764236598387883e-06, 'D': -4.29953665358684e-06, 'G': -4.29953665358684e-06, 'F': -3.8044363249505272e-06, 'I': -5.2549950237957095e-06, 'H': -3.8044363249505272e-06, 'K': -3.8044363249505272e-06, 'M': -5.2549950237957095e-06, 'L': -2.388626219192371e-06, 'N': -4.29953665358684e-06, 'Q': -5.2549950237957095e-06, 'P': -4.29953665358684e-06, 'S': -5.2549950237957095e-06, 'R': -5.2549950237957095e-06, 'T': -2.866353039522888e-06, 'W': -4.29953665358684e-06, 'V': -3.8044363249505272e-06, 'Y': -3.8044363249505272e-06}, 2: {'A': -3.8044363249505272e-06, 'C': -4.29953665358684e-06, 'E': -4.29953665358684e-06, 'D': -4.764236598387883e-06, 'G': -4.29953665358684e-06, 'F': -4.29953665358684e-06, 'I': -3.8044363249505272e-06, 'H': -3.8044363249505272e-06, 'K': -3.8044363249505272e-06, 'M': -4.29953665358684e-06, 'L': -2.866353039522888e-06, 'N': -4.29953665358684e-06, 'Q': -4.764236598387883e-06, 'P': -3.8044363249505272e-06, 'S': -3.8044363249505272e-06, 'R': -3.8044363249505272e-06, 'T': -3.8044363249505272e-06, 'W': -4.764236598387883e-06, 'V': -4.764236598387883e-06, 'Y': -4.29953665358684e-06}, 3: {'A': -5.2549950237957095e-06, 'C': -3.8044363249505272e-06, 'E': -5.2549950237957095e-06, 'D': -3.8044363249505272e-06, 'G': -4.764236598387883e-06, 'F': -4.764236598387883e-06, 'I': -3.8044363249505272e-06, 'H': -3.8044363249505272e-06, 'K': -4.764236598387883e-06, 'M': -3.8044363249505272e-06, 'L': -4.764236598387883e-06, 'N': -3.8044363249505272e-06, 'Q': -3.8044363249505272e-06, 'P': -3.344080385404882e-06, 'S': -4.29953665358684e-06, 'R': -4.29953665358684e-06, 'T': -4.29953665358684e-06, 'W': -4.29953665358684e-06, 'V': -5.2549950237957095e-06, 'Y': -3.8044363249505272e-06}, 4: {'A': -5.2549950237957095e-06, 'C': -3.8044363249505272e-06, 'E': -3.8044363249505272e-06, 'D': -3.8044363249505272e-06, 'G': -3.344080385404882e-06, 'F': -5.2549950237957095e-06, 'I': -4.764236598387883e-06, 'H': -3.8044363249505272e-06, 'K': -4.29953665358684e-06, 'M': -3.8044363249505272e-06, 'L': -5.2549950237957095e-06, 'N': -3.8044363249505272e-06, 'Q': -3.8044363249505272e-06, 'P': -4.764236598387883e-06, 'S': -4.29953665358684e-06, 'R': -4.29953665358684e-06, 'T': -3.8044363249505272e-06, 'W': -3.8044363249505272e-06, 'V': -4.764236598387883e-06, 'Y': -4.29953665358684e-06}, 5: {'A': -4.29953665358684e-06, 'C': -3.8044363249505272e-06, 'E': -3.8044363249505272e-06, 'D': -5.2549950237957095e-06, 'G': -4.764236598387883e-06, 'F': -3.8044363249505272e-06, 'I': -5.2549950237957095e-06, 'H': -3.8044363249505272e-06, 'K': -3.8044363249505272e-06, 'M': -3.8044363249505272e-06, 'L': -3.344080385404882e-06, 'N': -4.29953665358684e-06, 'Q': -4.29953665358684e-06, 'P': -4.764236598387883e-06, 'S': -4.764236598387883e-06, 'R': -3.8044363249505272e-06, 'T': -4.29953665358684e-06, 'W': -4.29953665358684e-06, 'V': -4.29953665358684e-06, 'Y': -3.8044363249505272e-06}, 6: {'A': -4.29953665358684e-06, 'C': -4.764236598387883e-06, 'E': -4.29953665358684e-06, 'D': -3.8044363249505272e-06, 'G': -3.8044363249505272e-06, 'F': -4.29953665358684e-06, 'I': -4.29953665358684e-06, 'H': -5.2549950237957095e-06, 'K': -3.8044363249505272e-06, 'M': -3.8044363249505272e-06, 'L': -2.388626219192371e-06, 'N': -4.764236598387883e-06, 'Q': -3.8044363249505272e-06, 'P': -4.764236598387883e-06, 'S': -3.8044363249505272e-06, 'R': -3.8044363249505272e-06, 'T': -4.764236598387883e-06, 'W': -5.2549950237957095e-06, 'V': -4.764236598387883e-06, 'Y': -4.764236598387883e-06}, 7: {'A': -5.2549950237957095e-06, 'C': -3.8044363249505272e-06, 'E': -4.764236598387883e-06, 'D': -3.8044363249505272e-06, 'G': -3.8044363249505272e-06, 'F': -3.344080385404882e-06, 'I': -4.29953665358684e-06, 'H': -3.8044363249505272e-06, 'K': -3.8044363249505272e-06, 'M': -3.8044363249505272e-06, 'L': -3.8044363249505272e-06, 'N': -3.8044363249505272e-06, 'Q': -3.8044363249505272e-06, 'P': -4.29953665358684e-06, 'S': -4.764236598387883e-06, 'R': -3.8044363249505272e-06, 'T': -5.2549950237957095e-06, 'W': -3.8044363249505272e-06, 'V': -4.29953665358684e-06, 'Y': -5.2549950237957095e-06}, 8: {'A': -5.2549950237957095e-06, 'C': -4.764236598387883e-06, 'E': -3.8044363249505272e-06, 'D': -4.29953665358684e-06, 'G': -4.0, 'F': -3.8044363249505272e-06, 'I': -3.8044363249505272e-06, 'H': -3.8044363249505272e-06, 'K': -4.29953665358684e-06, 'M': -4.29953665358684e-06, 'L': -2.866353039522888e-06, 'N': -3.8044363249505272e-06, 'Q': -3.8044363249505272e-06, 'P': -4.0, 'S': -3.8044363249505272e-06, 'R': -2.388626219192371e-06, 'T': -3.8044363249505272e-06, 'W': -4.29953665358684e-06, 'V': -2.866353039522888e-06, 'Y': -2.388626219192371e-06}, -1: {'slope': 0.001953125, 'intercept': -0.0021484375}}
5,351
5,351
0.686601
737
5,351
4.982361
0.059701
0.352941
0.392157
0.045752
0.805283
0.733388
0.565632
0.497277
0.497277
0.452614
0
0.662982
0.07008
5,351
1
5,351
5,351
0.07496
0
0
0
0
0
0.036248
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
0
1
1
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
e34d01731a4580975c759e336f22d6a1248769d8
6,609
py
Python
macop/callbacks/classicals.py
prise-3d/macop
6ca7b03c0d6650993cad974c5bde9c2a0d56f4a8
[ "MIT" ]
6
2020-08-30T19:12:00.000Z
2022-03-22T09:53:11.000Z
macop/callbacks/classicals.py
prise-3d/macop
6ca7b03c0d6650993cad974c5bde9c2a0d56f4a8
[ "MIT" ]
null
null
null
macop/callbacks/classicals.py
prise-3d/macop
6ca7b03c0d6650993cad974c5bde9c2a0d56f4a8
[ "MIT" ]
2
2020-11-27T11:19:00.000Z
2021-03-02T19:50:32.000Z
"""Classical Checkpoints classes implementations """ # main imports import os import logging import numpy as np # module imports from macop.callbacks.base import Callback from macop.utils.progress import macop_text, macop_line class BasicCheckpoint(Callback): """ BasicCheckpoint is used for loading previous computations and start again after loading checkpoint Attributes: algo: {:class:`~macop.algorithms.base.Algorithm`} -- main algorithm instance reference every: {int} -- checkpoint frequency used (based on number of evaluations) filepath: {str} -- file path where checkpoints will be saved """ def run(self): """ Check if necessary to do backup based on `every` variable """ # get current best solution solution = self.algo.result currentEvaluation = self.algo.getGlobalEvaluation() # backup if necessary if currentEvaluation % self._every == 0: logging.info("Checkpoint is done into " + self._filepath) solution_data = "" solutionSize = len(solution.data) for index, val in enumerate(solution.data): solution_data += str(val) if index < solutionSize - 1: solution_data += ' ' line = str(currentEvaluation) + ';' + solution_data + ';' + str( solution.fitness) + ';\n' # check if file exists if not os.path.exists(self._filepath): with open(self._filepath, 'w') as f: f.write(line) else: with open(self._filepath, 'a') as f: f.write(line) def load(self): """ Load last backup line of solution and set algorithm state (best solution and evaluations) at this backup """ if os.path.exists(self._filepath): logging.info('Load best solution from last checkpoint') with open(self._filepath) as f: # get last line and read data lastline = f.readlines()[-1] data = lastline.split(';') # get evaluation information globalEvaluation = int(data[0]) if self.algo.getParent() is not None: self.algo.getParent().setEvaluation(globalEvaluation) else: self.algo.setEvaluation(globalEvaluation) # get best solution data information solution_data = list(map(int, data[1].split(' '))) if self.algo.result is None: self.algo.result = self.algo.initialiser() self.algo.result.data = np.array(solution_data) self.algo.result.fitness = float(data[2]) macop_line(self.algo) macop_text(self.algo, f'Checkpoint found from `{self._filepath}` file.') macop_text( self.algo, f'Restart algorithm from evaluation {self.algo.getEvaluation()}.' ) else: macop_text( self.algo, 'No backup found... Start running algorithm from evaluation 0.' ) logging.info( "Can't load backup... Backup filepath not valid in Checkpoint") macop_line(self.algo) class ContinuousCheckpoint(Callback): """ ContinuousCheckpoint is used for loading previous computations and start again after loading checkpoint (only continuous solution) Attributes: algo: {:class:`~macop.algorithms.base.Algorithm`} -- main algorithm instance reference every: {int} -- checkpoint frequency used (based on number of evaluations) filepath: {str} -- file path where checkpoints will be saved """ def run(self): """ Check if necessary to do backup based on `every` variable """ # get current best solution solution = self.algo.result currentEvaluation = self.algo.getGlobalEvaluation() # backup if necessary if currentEvaluation % self._every == 0: logging.info("Checkpoint is done into " + self._filepath) solution_data = "" solutionSize = len(solution.data) for index, val in enumerate(solution.data): solution_data += str(val) if index < solutionSize - 1: solution_data += ' ' line = str(currentEvaluation) + ';' + solution_data + ';' + str( solution.fitness) + ';\n' # check if file exists if not os.path.exists(self._filepath): with open(self._filepath, 'w') as f: f.write(line) else: with open(self._filepath, 'a') as f: f.write(line) def load(self): """ Load last backup line of solution and set algorithm state (best solution and evaluations) at this backup """ if os.path.exists(self._filepath): logging.info('Load best solution from last checkpoint') with open(self._filepath) as f: # get last line and read data lastline = f.readlines()[-1] data = lastline.split(';') # get evaluation information globalEvaluation = int(data[0]) if self.algo.getParent() is not None: self.algo.getParent().setEvaluation(globalEvaluation) else: self.algo.setEvaluation(globalEvaluation) # get best solution data information solution_data = list(map(float, data[1].split(' '))) if self.algo.result is None: self.algo.result = self.algo.initialiser() self.algo.result.data = np.array(solution_data) self.algo.result.fitness = float(data[2]) macop_line(self.algo) macop_text(self.algo, f'Checkpoint found from `{self._filepath}` file.') macop_text( self.algo, f'Restart algorithm from evaluation {self.algo.getEvaluation()}.' ) else: macop_text( self.algo, 'No backup found... Start running algorithm from evaluation 0.' ) logging.info( "Can't load backup... Backup filepath not valid in Checkpoint") macop_line(self.algo)
33.892308
134
0.555001
684
6,609
5.304094
0.190058
0.070562
0.038589
0.033076
0.914553
0.914553
0.914553
0.914553
0.914553
0.914553
0
0.003278
0.35376
6,609
194
135
34.06701
0.846172
0.218187
0
0.878505
0
0
0.120969
0.011216
0
0
0
0
0
1
0.037383
false
0
0.046729
0
0.102804
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
8b63ff13e4ca6d7f4a574e50583914ca22a71a75
24,750
py
Python
server/msh/test/test_01_net.py
VanMenoz92/msh
b2a1b71083065ec3ebb097c05f58e79073578ecf
[ "Apache-2.0" ]
1
2021-11-29T07:46:29.000Z
2021-11-29T07:46:29.000Z
server/msh/test/test_01_net.py
VanMenoz92/msh
b2a1b71083065ec3ebb097c05f58e79073578ecf
[ "Apache-2.0" ]
null
null
null
server/msh/test/test_01_net.py
VanMenoz92/msh
b2a1b71083065ec3ebb097c05f58e79073578ecf
[ "Apache-2.0" ]
1
2019-05-07T22:37:26.000Z
2019-05-07T22:37:26.000Z
from msh import Msh from unittest import TestCase from webapp3 import Request from controller import Net from module import cmd_esp, DbManager from test import simulate_login_admin, read_xml, simulate_os_command, simulate_login_user, simulate_request_http class TestNet(TestCase): def test_no_payload(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Questa API ha bisogno di un payload') def test_payload_not_json(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.body = b'dfsfs' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Il payload deve essere in formato JSON') def test_payload_empty(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.body = b'{}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Il campo tipo_operazione è obbligatorio') def test_payload_with_operazione_not_exist(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.body = b'{' \ b' "tipo_operazione":"dsgsd"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'].find('Il campo tipo_operazione deve assumere uno dei seguenti valori:'), 0) def test_payload_with_operazione_exist_not_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.body = b'{' \ b' "tipo_operazione":"list"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Devi effettuare la login per utilizzare questa API') def test_payload_with_operazione_list_logged_admin(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"list"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_list_logged_user(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_user().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"list"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_type_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"type"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_scan_ok_logged(self): read_xml() simulate_os_command("scan-ok") simulate_request_http("mac_vendor") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"scan"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_scan_ko_logged(self): read_xml() simulate_os_command("scan-ko") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"scan"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Errore netscan') def test_payload_with_operazione_command_without_type_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"command"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Per l\'operazione scelta è obbligatorio il campo tipo') def test_payload_with_operazione_command_and_type_not_exist_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"command",' \ b' "tipo":"dfsf"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'].find('Il campo tipo deve assumere uno dei seguenti valori'), 0) def test_payload_with_operazione_command_and_type_exist_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"command",' \ b' "tipo":"NET"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_delete_logged_user(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_user().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"delete"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'La funzione richiesta può essere eseguita solo da un ADMIN') def test_payload_with_operazione_delete_without_mac_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"delete"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Per l\'operazione scelta è obbligatorio il campo mac') def test_payload_with_operazione_delete_mac_not_exists_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"delete",' \ b' "mac":"FF:FF:FF:FF:FF:FF"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'].find('Il campo mac deve assumere uno dei seguenti valori: '), 0) def test_payload_with_operazione_delete_mac_exists_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"delete",' \ b' "mac":"EE:FF:AA:BB:00:33"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_update_no_data_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"update",' \ b' "mac":"A1:FF:AA:BB:00:33"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'].find('Nessun campo da aggiornare, i possibili campi da aggiornare sono'), 0) def test_payload_with_operazione_update_user_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"update",' \ b' "mac":"A1:FF:AA:BB:00:33",' \ b' "user":"test",' \ b' "password":"test"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_update_code_empty_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"update",' \ b' "mac":"A1:FF:AA:BB:00:33",' \ b' "codice":""' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Il campo codice non può essere valorizzato con una stringa vuota') def test_payload_with_operazione_update_code_duplicate_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"update",' \ b' "mac":"A1:FF:AA:BB:00:33",' \ b' "codice":"device_test_duplicato"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Esiste già un dispositivo con questo codice') def test_payload_with_operazione_update_code_ok_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"update",' \ b' "mac":"A1:FF:AA:BB:00:33",' \ b' "codice":"device_test_rinominato"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'OK') def test_payload_with_operazione_cmd_without_dispositivo_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Per l\'operazione scelta è obbligatorio il campo dispositivo') def test_payload_with_operazione_cmd_dispositivo_not_exists_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"dfsf"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'].find('Il campo dispositivo deve assumere uno dei seguenti valori: '), 0) def test_payload_with_operazione_cmd_dispositivo_exists_without_comando_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_duplicato"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], 'Per l\'operazione scelta è obbligatorio il campo comando') def test_payload_with_operazione_cmd_dispositivo_exists_comando_not_exists_logged(self): read_xml() request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_duplicato",' \ b' "comando":"fasdfs"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'].find('Il campo comando deve assumere uno dei seguenti valori: '), 0) def test_payload_with_operazione_cmd_ping_ok_logged(self): read_xml() simulate_os_command("ping-ok") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_duplicato",' \ b' "comando":"online"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_ping_fail_logged(self): read_xml() simulate_os_command("ping-fail") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_duplicato",' \ b' "comando":"online"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_ping_ko_logged(self): read_xml() simulate_os_command("ping-ko") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_duplicato",' \ b' "comando":"online"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "Errore ping") def test_payload_with_operazione_cmd_pcwin_on_ok_logged(self): read_xml() simulate_os_command("pcwin-on-ok") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_pc_win",' \ b' "comando":"on"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_pcwin_on_fail_logged(self): read_xml() simulate_os_command("pcwin-on-fail") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_pc_win",' \ b' "comando":"on"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_pcwin_on_ko_logged(self): read_xml() simulate_os_command("pcwin-on-ko") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_pc_win",' \ b' "comando":"on"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "Errore pcwin on") def test_payload_with_operazione_cmd_pcwin_off_ok_logged(self): read_xml() simulate_os_command("pcwin-off-ok") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_pc_win",' \ b' "comando":"off"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_pcwin_off_fail_logged(self): read_xml() simulate_os_command("pcwin-off-fail") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_pc_win",' \ b' "comando":"off"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_pcwin_off_ko_logged(self): read_xml() simulate_os_command("pcwin-off-ko") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_pc_win",' \ b' "comando":"off"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "Errore pcwin off") def test_payload_with_operazione_cmd_ap_on_ko_logged(self): read_xml() simulate_os_command("ap-error") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_ap",' \ b' "comando":"up"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "Errore comando su AP") def test_payload_with_operazione_cmd_ap_on_no_interface_logged(self): read_xml() simulate_os_command("ap-no-interface") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_ap",' \ b' "comando":"up"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "Nessuna interfaccia WiFi rilevata") def test_payload_with_operazione_cmd_ap_on_ok_logged(self): read_xml() simulate_os_command("ap-on") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_ap",' \ b' "comando":"up"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_payload_with_operazione_cmd_ap_off_ok_logged(self): read_xml() simulate_os_command("ap-off") request = Request.blank('/api/net') request.method = 'POST' request.headers['Cookie'] = simulate_login_admin().headers['Set-Cookie'] request.body = b'{' \ b' "tipo_operazione":"cmd",' \ b' "dispositivo":"device_test_ap",' \ b' "comando":"up"' \ b'}' response = request.get_response(Msh.app) self.assertEqual(response.status_int, 200) self.assertEqual(response.json['output'], "OK") def test_calculate_start_ip_one(self): ip = ['192', '168', '1', '1'] subnet = ['255', '255', '0', '0'] response = Net.calculate_start(ip, subnet) self.assertEqual(response['ip'].split('.'), ['192', '168', '0', '1']) def test_calculate_start_ip_two(self): ip = ['192', '168', '1', '1'] subnet = ['255', '0', '0', '0'] response = Net.calculate_start(ip, subnet) self.assertEqual(response['ip'].split('.'), ['192', '0', '0', '1']) def test_cmd_esp_ok(self): read_xml() DbManager() simulate_request_http("esp_ok") response = cmd_esp('127.0.0.1', 'test') self.assertEqual(response['output'], 'OK') DbManager.close_db() def test_cmd_esp_ko(self): read_xml() DbManager() simulate_request_http("esp_ko") response = cmd_esp('127.0.0.1', 'test') self.assertNotEqual(response['output'], 'OK') DbManager.close_db()
44.67509
125
0.574869
2,693
24,750
5.059413
0.062755
0.089174
0.136734
0.062972
0.927193
0.919486
0.906716
0.890862
0.842128
0.809468
0
0.011902
0.290505
24,750
553
126
44.755877
0.764009
0
0
0.771654
0
0
0.187071
0.067354
0
0
0
0
0.161417
1
0.084646
false
0.001969
0.011811
0
0.098425
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
8b91863449ecfd919b421f235c73ef6e6d7e69c5
10,800
py
Python
backend/revaluation/tests.py
StichtingIAPC/swipe
d1ea35a40813d2d5e9cf9edde33148c0a825efc4
[ "BSD-3-Clause-Clear" ]
null
null
null
backend/revaluation/tests.py
StichtingIAPC/swipe
d1ea35a40813d2d5e9cf9edde33148c0a825efc4
[ "BSD-3-Clause-Clear" ]
null
null
null
backend/revaluation/tests.py
StichtingIAPC/swipe
d1ea35a40813d2d5e9cf9edde33148c0a825efc4
[ "BSD-3-Clause-Clear" ]
null
null
null
from django.test import TestCase from tools.testing import TestData from revaluation.models import RevaluationDocument, NoStockExistsError, RevaluationLine, CostError from stock.models import StockChangeSet, Stock from stock.stocklabel import OrderLabel from money.models import Cost from decimal import Decimal class RevaluationTests(TestCase, TestData): def setUp(self): self.setup_base_data() def test_revaluation_of_non_existent_general_stock(self): stock_addition = [{"article": self.articletype_2, "book_value": self.cost_system_currency_1, "count": 5, "is_in": True}] StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) with self.assertRaises(NoStockExistsError): RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, self.cost_system_currency_1, None, None)], memo="") def test_revaluation_of_wrong_label_stock(self): stock_addition = [{"article": self.articletype_2, "book_value": self.cost_system_currency_1, "count": 5, "is_in": True, "label": OrderLabel(1)}] StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) with self.assertRaises(NoStockExistsError): RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, self.cost_system_currency_1, None, None)], memo="") def test_revaluation_single_general_stock_line(self): stock_addition = [] COUNT = 5 stock_addition.append({"article": self.articletype_1, "book_value": self.cost_system_currency_1, "count": COUNT, "is_in": True}) StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, self.cost_system_currency_2, None, None)], memo="") reval_doc = RevaluationDocument.objects.get() reval_line = RevaluationLine.objects.get() self.assertEqual(reval_line.revaluation_document, reval_doc) self.assertEqual(reval_line.former_cost, self.cost_system_currency_1) self.assertEqual(reval_line.new_cost, self.cost_system_currency_2) self.assertEqual(reval_line.count, COUNT) self.assertEqual(reval_line.article_type, self.articletype_1) def test_revaluation_of_labeled_stock(self): stock_addition = [] COUNT = 5 stock_addition.append({"article": self.articletype_1, "book_value": self.cost_system_currency_1, "count": COUNT, "is_in": True, "label": OrderLabel(1)}) StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, self.cost_system_currency_2, OrderLabel, 1)], memo="") reval_doc = RevaluationDocument.objects.get() reval_line = RevaluationLine.objects.get() self.assertEqual(reval_line.revaluation_document, reval_doc) self.assertEqual(reval_line.former_cost, self.cost_system_currency_1) self.assertEqual(reval_line.new_cost, self.cost_system_currency_2) self.assertEqual(reval_line.count, COUNT) self.assertEqual(reval_line.article_type, self.articletype_1) def test_revaluation_multiple_stocks(self): stock_addition = [] COUNT_1 = 5 COUNT_2 = 3 stock_addition.append({"article": self.articletype_1, "book_value": self.cost_system_currency_1, "count": COUNT_1, "is_in": True, }) stock_addition.append({"article": self.articletype_2, "book_value": self.cost_system_currency_3, "count": COUNT_2, "is_in": True, }) StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, self.cost_system_currency_2, None, None), (self.articletype_2, self.cost_system_currency_4, None, None)], memo="") reval_doc = RevaluationDocument.objects.get() reval_line = RevaluationLine.objects.all() self.assertEqual(len(reval_line), 2) if reval_line[0].article_type == self.articletype_1: reval_1 = reval_line[0] reval_2 = reval_line[1] else: reval_1 = reval_line[1] reval_2 = reval_line[0] self.assertEqual(reval_1.revaluation_document, reval_doc) self.assertEqual(reval_1.former_cost, self.cost_system_currency_1) self.assertEqual(reval_1.new_cost, self.cost_system_currency_2) self.assertEqual(reval_1.count, COUNT_1) self.assertEqual(reval_1.article_type, self.articletype_1) self.assertEqual(reval_2.revaluation_document, reval_doc) self.assertEqual(reval_2.former_cost, self.cost_system_currency_3) self.assertEqual(reval_2.new_cost, self.cost_system_currency_4) self.assertEqual(reval_2.count, COUNT_2) self.assertEqual(reval_2.article_type, self.articletype_2) def test_shorthand_stock_method(self): stock_addition = [] COUNT_1 = 5 COUNT_2 = 3 stock_addition.append({"article": self.articletype_1, "book_value": self.cost_system_currency_1, "count": COUNT_1, "is_in": True, }) stock_addition.append({"article": self.articletype_2, "book_value": self.cost_system_currency_3, "count": COUNT_2, "is_in": True, }) StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) RevaluationDocument.create_revaluation_document_stock(user=self.user_1, article_type_cost_combination=[ (self.articletype_1, self.cost_system_currency_2) ], memo="") reval_doc = RevaluationDocument.objects.get() reval_line = RevaluationLine.objects.get() self.assertEqual(reval_line.revaluation_document, reval_doc) self.assertEqual(reval_line.former_cost, self.cost_system_currency_1) self.assertEqual(reval_line.new_cost, self.cost_system_currency_2) self.assertEqual(reval_line.count, COUNT_1) self.assertEqual(reval_line.article_type, self.articletype_1) def test_negative_price(self): stock_addition = [{"article": self.articletype_2, "book_value": self.cost_system_currency_1, "count": 5, "is_in": True}] StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) with self.assertRaises(CostError): RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, Cost(amount=Decimal(-3.14), currency=self.currency_eur), None, None)], memo="") def test_one_article_multiple_labels(self): stock_addition = [] COUNT_1 = 5 COUNT_2 = 3 stock_addition.append({"article": self.articletype_1, "book_value": self.cost_system_currency_1, "count": COUNT_1, "is_in": True, }) stock_addition.append({"article": self.articletype_1, "book_value": self.cost_system_currency_3, "count": COUNT_2, "is_in": True, "label": OrderLabel(1) }) StockChangeSet.construct(description="Test", entries=stock_addition, source=StockChangeSet.SOURCE_TEST_DO_NOT_USE) RevaluationDocument.create_revaluation_document(user=self.user_1, article_type_cost_label_combinations=[ (self.articletype_1, self.cost_system_currency_2, None, None), ], memo="") reval_doc = RevaluationDocument.objects.get() reval_line = RevaluationLine.objects.get() self.assertEqual(reval_line.revaluation_document, reval_doc) self.assertEqual(reval_line.former_cost, self.cost_system_currency_1) self.assertEqual(reval_line.new_cost, self.cost_system_currency_2) self.assertEqual(reval_line.count, COUNT_1) self.assertEqual(reval_line.article_type, self.articletype_1) # Assure no change in labeled stock st = Stock.objects.get(article=self.articletype_1, labeltype=OrderLabel.labeltype) self.assertEqual(st.book_value, self.cost_system_currency_3)
56.25
126
0.585093
1,073
10,800
5.524697
0.092265
0.043185
0.075574
0.118758
0.837213
0.820344
0.804825
0.778846
0.772267
0.772267
0
0.016973
0.334444
10,800
191
127
56.544503
0.807735
0.003056
0
0.710983
0
0
0.031967
0
0
0
0
0
0.202312
1
0.052023
false
0
0.040462
0
0.098266
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4787a493bc723991cb3c8417515caa5a9078da34
1,484
py
Python
home/hairygael/GESTURES/relax.py
rv8flyboy/pyrobotlab
4e04fb751614a5cb6044ea15dcfcf885db8be65a
[ "Apache-2.0" ]
63
2015-02-03T18:49:43.000Z
2022-03-29T03:52:24.000Z
home/hairygael/GESTURES/relax.py
hirwaHenryChristian/pyrobotlab
2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9
[ "Apache-2.0" ]
16
2016-01-26T19:13:29.000Z
2018-11-25T21:20:51.000Z
home/hairygael/GESTURES/relax.py
hirwaHenryChristian/pyrobotlab
2debb381fc2db4be1e7ea6e5252a50ae0de6f4a9
[ "Apache-2.0" ]
151
2015-01-03T18:55:54.000Z
2022-03-04T07:04:23.000Z
def relax(): neopixel.setAnimation("Color Wipe", 0, 0, 20, 1) sleep(2) neopixel.setAnimation("Ironman", 0, 0, 255, 1) if (i01.eyesTracking.getOpenCV().capturing): global MoveBodyRandom MoveBodyRandom=0 global MoveHeadRandom MoveHeadRandom=0 i01.setHandSpeed("left", 0.85, 0.85, 0.85, 0.85, 0.85, 0.85) i01.setHandSpeed("right", 0.85, 0.85, 0.85, 0.85, 0.85, 0.85) i01.setArmSpeed("right", 0.75, 0.85, 0.65, 0.85) i01.setArmSpeed("left", 0.95, 0.65, 0.75, 0.75) i01.setHeadSpeed(0.85, 0.85) i01.setTorsoSpeed(0.75, 0.55, 1.0) i01.moveHead(79,100) i01.moveArm("left",5,84,28,14) i01.moveArm("right",5,82,28,16) i01.moveHand("left",92,33,37,71,66,25) i01.moveHand("right",81,66,82,60,105,113) i01.moveTorso(95,90,90) else: global MoveBodyRandom MoveBodyRandom=1 global MoveHeadRandom MoveHeadRandom=1 i01.setHandSpeed("left", 0.85, 0.85, 0.85, 0.85, 0.85, 0.85) i01.setHandSpeed("right", 0.85, 0.85, 0.85, 0.85, 0.85, 0.85) i01.setArmSpeed("right", 0.75, 0.85, 0.65, 0.85) i01.setArmSpeed("left", 0.95, 0.65, 0.75, 0.75) i01.setHeadSpeed(0.85, 0.85) i01.setTorsoSpeed(0.75, 0.55, 1.0) #i01.moveHead(79,100) i01.moveArm("left",5,84,28,14) i01.moveArm("right",5,82,28,16) i01.moveHand("left",92,33,37,71,66,25) i01.moveHand("right",81,66,82,60,105,113) i01.moveTorso(95,90,90)
33.727273
67
0.59973
255
1,484
3.490196
0.219608
0.107865
0.107865
0.148315
0.707865
0.707865
0.707865
0.707865
0.707865
0.707865
0
0.269395
0.209569
1,484
43
68
34.511628
0.489344
0.013477
0
0.702703
0
0
0.061001
0
0
0
0
0
0
1
0.027027
false
0
0
0
0.027027
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
47f00a9867b1334ef26a10c4d5e4a487d50abff7
343
py
Python
Curso em Vídeo/Mundo 1 Fundamentos/Desafios/desafio016.py
henriqueumeda/-Estudo-python
28e93a377afa4732037a29eb74d4bc7c9e24b62f
[ "MIT" ]
null
null
null
Curso em Vídeo/Mundo 1 Fundamentos/Desafios/desafio016.py
henriqueumeda/-Estudo-python
28e93a377afa4732037a29eb74d4bc7c9e24b62f
[ "MIT" ]
null
null
null
Curso em Vídeo/Mundo 1 Fundamentos/Desafios/desafio016.py
henriqueumeda/-Estudo-python
28e93a377afa4732037a29eb74d4bc7c9e24b62f
[ "MIT" ]
null
null
null
from math import floor, trunc numero = float(input('Digite um valor: ')) print('O valor digitado foi {} e a sua porção inteira é {}'.format(numero, int(numero))) print('O valor digitado foi {} e a sua porção inteira é {}'.format(numero, floor(numero))) print('O valor digitado foi {} e a sua porção inteira é {}'.format(numero, trunc(numero)))
68.6
90
0.708455
56
343
4.339286
0.410714
0.074074
0.135802
0.234568
0.703704
0.703704
0.703704
0.703704
0.703704
0.703704
0
0
0.142857
343
5
91
68.6
0.826531
0
0
0
0
0
0.494186
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.6
0
0
0
null
0
0
1
0
1
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
8
9a0b75a27e593b4acef1e4aadf79fd9790d89bbd
15,710
py
Python
nova/tests/unit/virt/libvirt/volume/test_glusterfs.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/virt/libvirt/volume/test_glusterfs.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/virt/libvirt/volume/test_glusterfs.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
2
2017-07-20T17:31:34.000Z
2020-07-24T02:42:19.000Z
begin_unit comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n' comment|'# a copy of the License at' nl|'\n' comment|'#' nl|'\n' comment|'# http://www.apache.org/licenses/LICENSE-2.0' nl|'\n' comment|'#' nl|'\n' comment|'# Unless required by applicable law or agreed to in writing, software' nl|'\n' comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT' nl|'\n' comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the' nl|'\n' comment|'# License for the specific language governing permissions and limitations' nl|'\n' comment|'# under the License.' nl|'\n' nl|'\n' name|'import' name|'os' newline|'\n' nl|'\n' name|'import' name|'mock' newline|'\n' name|'from' name|'oslo_concurrency' name|'import' name|'processutils' newline|'\n' nl|'\n' name|'from' name|'nova' op|'.' name|'tests' op|'.' name|'unit' op|'.' name|'virt' op|'.' name|'libvirt' op|'.' name|'volume' name|'import' name|'test_volume' newline|'\n' name|'from' name|'nova' name|'import' name|'utils' newline|'\n' name|'from' name|'nova' op|'.' name|'virt' op|'.' name|'libvirt' name|'import' name|'utils' name|'as' name|'libvirt_utils' newline|'\n' name|'from' name|'nova' op|'.' name|'virt' op|'.' name|'libvirt' op|'.' name|'volume' name|'import' name|'glusterfs' newline|'\n' nl|'\n' nl|'\n' name|'class' name|'LibvirtGlusterfsVolumeDriverTestCase' op|'(' nl|'\n' DECL|class|LibvirtGlusterfsVolumeDriverTestCase name|'test_volume' op|'.' name|'LibvirtVolumeBaseTestCase' op|')' op|':' newline|'\n' nl|'\n' DECL|member|test_libvirt_glusterfs_driver indent|' ' name|'def' name|'test_libvirt_glusterfs_driver' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'mnt_base' op|'=' string|"'/mnt'" newline|'\n' name|'self' op|'.' name|'flags' op|'(' name|'glusterfs_mount_point_base' op|'=' name|'mnt_base' op|',' name|'group' op|'=' string|"'libvirt'" op|')' newline|'\n' nl|'\n' name|'libvirt_driver' op|'=' name|'glusterfs' op|'.' name|'LibvirtGlusterfsVolumeDriver' op|'(' name|'self' op|'.' name|'fake_conn' op|')' newline|'\n' name|'self' op|'.' name|'stubs' op|'.' name|'Set' op|'(' name|'libvirt_utils' op|',' string|"'is_mounted'" op|',' name|'lambda' name|'x' op|',' name|'d' op|':' name|'False' op|')' newline|'\n' name|'export_string' op|'=' string|"'192.168.1.1:/volume-00001'" newline|'\n' name|'export_mnt_base' op|'=' name|'os' op|'.' name|'path' op|'.' name|'join' op|'(' name|'mnt_base' op|',' nl|'\n' name|'utils' op|'.' name|'get_hash_str' op|'(' name|'export_string' op|')' op|')' newline|'\n' nl|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' nl|'\n' string|"'name'" op|':' name|'self' op|'.' name|'name' op|'}' op|'}' newline|'\n' name|'libvirt_driver' op|'.' name|'connect_volume' op|'(' name|'connection_info' op|',' name|'self' op|'.' name|'disk_info' op|')' newline|'\n' name|'libvirt_driver' op|'.' name|'disconnect_volume' op|'(' name|'connection_info' op|',' string|'"vde"' op|')' newline|'\n' nl|'\n' name|'device_path' op|'=' name|'os' op|'.' name|'path' op|'.' name|'join' op|'(' name|'export_mnt_base' op|',' nl|'\n' name|'connection_info' op|'[' string|"'data'" op|']' op|'[' string|"'name'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'connection_info' op|'[' string|"'data'" op|']' op|'[' string|"'device_path'" op|']' op|',' name|'device_path' op|')' newline|'\n' name|'expected_commands' op|'=' op|'[' nl|'\n' op|'(' string|"'mkdir'" op|',' string|"'-p'" op|',' name|'export_mnt_base' op|')' op|',' nl|'\n' op|'(' string|"'mount'" op|',' string|"'-t'" op|',' string|"'glusterfs'" op|',' name|'export_string' op|',' name|'export_mnt_base' op|')' op|',' nl|'\n' op|'(' string|"'umount'" op|',' name|'export_mnt_base' op|')' op|']' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'expected_commands' op|',' name|'self' op|'.' name|'executes' op|')' newline|'\n' nl|'\n' DECL|member|test_libvirt_glusterfs_driver_get_config dedent|'' name|'def' name|'test_libvirt_glusterfs_driver_get_config' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'mnt_base' op|'=' string|"'/mnt'" newline|'\n' name|'self' op|'.' name|'flags' op|'(' name|'glusterfs_mount_point_base' op|'=' name|'mnt_base' op|',' name|'group' op|'=' string|"'libvirt'" op|')' newline|'\n' nl|'\n' name|'libvirt_driver' op|'=' name|'glusterfs' op|'.' name|'LibvirtGlusterfsVolumeDriver' op|'(' name|'self' op|'.' name|'fake_conn' op|')' newline|'\n' name|'export_string' op|'=' string|"'192.168.1.1:/volume-00001'" newline|'\n' name|'export_mnt_base' op|'=' name|'os' op|'.' name|'path' op|'.' name|'join' op|'(' name|'mnt_base' op|',' nl|'\n' name|'utils' op|'.' name|'get_hash_str' op|'(' name|'export_string' op|')' op|')' newline|'\n' name|'file_path' op|'=' name|'os' op|'.' name|'path' op|'.' name|'join' op|'(' name|'export_mnt_base' op|',' name|'self' op|'.' name|'name' op|')' newline|'\n' nl|'\n' comment|'# Test default format - raw' nl|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' nl|'\n' string|"'name'" op|':' name|'self' op|'.' name|'name' op|',' nl|'\n' string|"'device_path'" op|':' name|'file_path' op|'}' op|'}' newline|'\n' name|'conf' op|'=' name|'libvirt_driver' op|'.' name|'get_config' op|'(' name|'connection_info' op|',' name|'self' op|'.' name|'disk_info' op|')' newline|'\n' name|'tree' op|'=' name|'conf' op|'.' name|'format_dom' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'_assertFileTypeEquals' op|'(' name|'tree' op|',' name|'file_path' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'raw'" op|',' name|'tree' op|'.' name|'find' op|'(' string|"'./driver'" op|')' op|'.' name|'get' op|'(' string|"'type'" op|')' op|')' newline|'\n' nl|'\n' comment|'# Test specified format - qcow2' nl|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' nl|'\n' string|"'name'" op|':' name|'self' op|'.' name|'name' op|',' nl|'\n' string|"'device_path'" op|':' name|'file_path' op|',' nl|'\n' string|"'format'" op|':' string|"'qcow2'" op|'}' op|'}' newline|'\n' name|'conf' op|'=' name|'libvirt_driver' op|'.' name|'get_config' op|'(' name|'connection_info' op|',' name|'self' op|'.' name|'disk_info' op|')' newline|'\n' name|'tree' op|'=' name|'conf' op|'.' name|'format_dom' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'_assertFileTypeEquals' op|'(' name|'tree' op|',' name|'file_path' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'qcow2'" op|',' name|'tree' op|'.' name|'find' op|'(' string|"'./driver'" op|')' op|'.' name|'get' op|'(' string|"'type'" op|')' op|')' newline|'\n' nl|'\n' DECL|member|test_libvirt_glusterfs_driver_already_mounted dedent|'' name|'def' name|'test_libvirt_glusterfs_driver_already_mounted' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'mnt_base' op|'=' string|"'/mnt'" newline|'\n' name|'self' op|'.' name|'flags' op|'(' name|'glusterfs_mount_point_base' op|'=' name|'mnt_base' op|',' name|'group' op|'=' string|"'libvirt'" op|')' newline|'\n' nl|'\n' name|'libvirt_driver' op|'=' name|'glusterfs' op|'.' name|'LibvirtGlusterfsVolumeDriver' op|'(' name|'self' op|'.' name|'fake_conn' op|')' newline|'\n' name|'export_string' op|'=' string|"'192.168.1.1:/volume-00001'" newline|'\n' name|'export_mnt_base' op|'=' name|'os' op|'.' name|'path' op|'.' name|'join' op|'(' name|'mnt_base' op|',' nl|'\n' name|'utils' op|'.' name|'get_hash_str' op|'(' name|'export_string' op|')' op|')' newline|'\n' nl|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' nl|'\n' string|"'name'" op|':' name|'self' op|'.' name|'name' op|'}' op|'}' newline|'\n' name|'libvirt_driver' op|'.' name|'connect_volume' op|'(' name|'connection_info' op|',' name|'self' op|'.' name|'disk_info' op|')' newline|'\n' name|'libvirt_driver' op|'.' name|'disconnect_volume' op|'(' name|'connection_info' op|',' string|'"vde"' op|')' newline|'\n' nl|'\n' name|'expected_commands' op|'=' op|'[' nl|'\n' op|'(' string|"'findmnt'" op|',' string|"'--target'" op|',' name|'export_mnt_base' op|',' nl|'\n' string|"'--source'" op|',' name|'export_string' op|')' op|',' nl|'\n' op|'(' string|"'umount'" op|',' name|'export_mnt_base' op|')' op|']' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'expected_commands' op|',' name|'self' op|'.' name|'executes' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'.' name|'object' op|'(' name|'glusterfs' op|'.' name|'utils' op|',' string|"'execute'" op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'.' name|'object' op|'(' name|'glusterfs' op|'.' name|'LOG' op|',' string|"'debug'" op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'.' name|'object' op|'(' name|'glusterfs' op|'.' name|'LOG' op|',' string|"'exception'" op|')' newline|'\n' DECL|member|test_libvirt_glusterfs_driver_umount_error name|'def' name|'test_libvirt_glusterfs_driver_umount_error' op|'(' name|'self' op|',' name|'mock_LOG_exception' op|',' nl|'\n' name|'mock_LOG_debug' op|',' name|'mock_utils_exe' op|')' op|':' newline|'\n' indent|' ' name|'export_string' op|'=' string|"'192.168.1.1:/volume-00001'" newline|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' nl|'\n' string|"'name'" op|':' name|'self' op|'.' name|'name' op|'}' op|'}' newline|'\n' name|'libvirt_driver' op|'=' name|'glusterfs' op|'.' name|'LibvirtGlusterfsVolumeDriver' op|'(' name|'self' op|'.' name|'fake_conn' op|')' newline|'\n' name|'mock_utils_exe' op|'.' name|'side_effect' op|'=' name|'processutils' op|'.' name|'ProcessExecutionError' op|'(' nl|'\n' name|'None' op|',' name|'None' op|',' name|'None' op|',' string|"'umount'" op|',' string|"'umount: target is busy.'" op|')' newline|'\n' name|'libvirt_driver' op|'.' name|'disconnect_volume' op|'(' name|'connection_info' op|',' string|'"vde"' op|')' newline|'\n' name|'self' op|'.' name|'assertTrue' op|'(' name|'mock_LOG_debug' op|'.' name|'called' op|')' newline|'\n' nl|'\n' DECL|member|test_libvirt_glusterfs_driver_with_opts dedent|'' name|'def' name|'test_libvirt_glusterfs_driver_with_opts' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'mnt_base' op|'=' string|"'/mnt'" newline|'\n' name|'self' op|'.' name|'flags' op|'(' name|'glusterfs_mount_point_base' op|'=' name|'mnt_base' op|',' name|'group' op|'=' string|"'libvirt'" op|')' newline|'\n' nl|'\n' name|'libvirt_driver' op|'=' name|'glusterfs' op|'.' name|'LibvirtGlusterfsVolumeDriver' op|'(' name|'self' op|'.' name|'fake_conn' op|')' newline|'\n' name|'self' op|'.' name|'stubs' op|'.' name|'Set' op|'(' name|'libvirt_utils' op|',' string|"'is_mounted'" op|',' name|'lambda' name|'x' op|',' name|'d' op|':' name|'False' op|')' newline|'\n' name|'export_string' op|'=' string|"'192.168.1.1:/volume-00001'" newline|'\n' name|'options' op|'=' string|"'-o backupvolfile-server=192.168.1.2'" newline|'\n' name|'export_mnt_base' op|'=' name|'os' op|'.' name|'path' op|'.' name|'join' op|'(' name|'mnt_base' op|',' nl|'\n' name|'utils' op|'.' name|'get_hash_str' op|'(' name|'export_string' op|')' op|')' newline|'\n' nl|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' nl|'\n' string|"'name'" op|':' name|'self' op|'.' name|'name' op|',' nl|'\n' string|"'options'" op|':' name|'options' op|'}' op|'}' newline|'\n' name|'libvirt_driver' op|'.' name|'connect_volume' op|'(' name|'connection_info' op|',' name|'self' op|'.' name|'disk_info' op|')' newline|'\n' name|'libvirt_driver' op|'.' name|'disconnect_volume' op|'(' name|'connection_info' op|',' string|'"vde"' op|')' newline|'\n' nl|'\n' name|'expected_commands' op|'=' op|'[' nl|'\n' op|'(' string|"'mkdir'" op|',' string|"'-p'" op|',' name|'export_mnt_base' op|')' op|',' nl|'\n' op|'(' string|"'mount'" op|',' string|"'-t'" op|',' string|"'glusterfs'" op|',' nl|'\n' string|"'-o'" op|',' string|"'backupvolfile-server=192.168.1.2'" op|',' nl|'\n' name|'export_string' op|',' name|'export_mnt_base' op|')' op|',' nl|'\n' op|'(' string|"'umount'" op|',' name|'export_mnt_base' op|')' op|',' nl|'\n' op|']' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'expected_commands' op|',' name|'self' op|'.' name|'executes' op|')' newline|'\n' nl|'\n' DECL|member|test_libvirt_glusterfs_libgfapi dedent|'' name|'def' name|'test_libvirt_glusterfs_libgfapi' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'flags' op|'(' name|'qemu_allowed_storage_drivers' op|'=' op|'[' string|"'gluster'" op|']' op|',' name|'group' op|'=' string|"'libvirt'" op|')' newline|'\n' name|'libvirt_driver' op|'=' name|'glusterfs' op|'.' name|'LibvirtGlusterfsVolumeDriver' op|'(' name|'self' op|'.' name|'fake_conn' op|')' newline|'\n' name|'self' op|'.' name|'stubs' op|'.' name|'Set' op|'(' name|'libvirt_utils' op|',' string|"'is_mounted'" op|',' name|'lambda' name|'x' op|',' name|'d' op|':' name|'False' op|')' newline|'\n' name|'export_string' op|'=' string|"'192.168.1.1:/volume-00001'" newline|'\n' name|'name' op|'=' string|"'volume-00001'" newline|'\n' nl|'\n' name|'connection_info' op|'=' op|'{' string|"'data'" op|':' op|'{' string|"'export'" op|':' name|'export_string' op|',' string|"'name'" op|':' name|'name' op|'}' op|'}' newline|'\n' nl|'\n' name|'disk_info' op|'=' op|'{' nl|'\n' string|'"dev"' op|':' string|'"vde"' op|',' nl|'\n' string|'"type"' op|':' string|'"disk"' op|',' nl|'\n' string|'"bus"' op|':' string|'"virtio"' op|',' nl|'\n' op|'}' newline|'\n' nl|'\n' name|'libvirt_driver' op|'.' name|'connect_volume' op|'(' name|'connection_info' op|',' name|'disk_info' op|')' newline|'\n' name|'conf' op|'=' name|'libvirt_driver' op|'.' name|'get_config' op|'(' name|'connection_info' op|',' name|'disk_info' op|')' newline|'\n' name|'tree' op|'=' name|'conf' op|'.' name|'format_dom' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'network'" op|',' name|'tree' op|'.' name|'get' op|'(' string|"'type'" op|')' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'raw'" op|',' name|'tree' op|'.' name|'find' op|'(' string|"'./driver'" op|')' op|'.' name|'get' op|'(' string|"'type'" op|')' op|')' newline|'\n' nl|'\n' name|'source' op|'=' name|'tree' op|'.' name|'find' op|'(' string|"'./source'" op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'gluster'" op|',' name|'source' op|'.' name|'get' op|'(' string|"'protocol'" op|')' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'volume-00001/volume-00001'" op|',' name|'source' op|'.' name|'get' op|'(' string|"'name'" op|')' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'192.168.1.1'" op|',' name|'source' op|'.' name|'find' op|'(' string|"'./host'" op|')' op|'.' name|'get' op|'(' string|"'name'" op|')' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'24007'" op|',' name|'source' op|'.' name|'find' op|'(' string|"'./host'" op|')' op|'.' name|'get' op|'(' string|"'port'" op|')' op|')' newline|'\n' nl|'\n' name|'libvirt_driver' op|'.' name|'disconnect_volume' op|'(' name|'connection_info' op|',' string|'"vde"' op|')' newline|'\n' dedent|'' dedent|'' endmarker|'' end_unit
12.689822
88
0.608912
2,306
15,710
4.042498
0.081093
0.171852
0.078309
0.067582
0.846492
0.833083
0.794357
0.762819
0.738683
0.725166
0
0.009023
0.089943
15,710
1,237
89
12.700081
0.643002
0
0
0.947454
0
0
0.392489
0.05767
0
0
0
0
0.012126
0
null
null
0
0.005659
null
null
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
9a21fe703a732339172e3e2e5d38a6bf1efcc34c
1,927
py
Python
_drafts/re_escape.py
hstk30/hstk30.github.io
0a6457f17d9dc3f7ac12b3e5a8563f9dfea7860e
[ "Apache-2.0" ]
null
null
null
_drafts/re_escape.py
hstk30/hstk30.github.io
0a6457f17d9dc3f7ac12b3e5a8563f9dfea7860e
[ "Apache-2.0" ]
null
null
null
_drafts/re_escape.py
hstk30/hstk30.github.io
0a6457f17d9dc3f7ac12b3e5a8563f9dfea7860e
[ "Apache-2.0" ]
null
null
null
import re p = re.compile(r'\d+') p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping') p = re.compile('\d+') p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping') p = re.compile('\section') p.findall('wegwg\section') p = re.compile(r'\section') p.findall('wegwg\section') p = re.compile(r'\\section') p.findall('wegwg\section') p = re.compile(r'\\\\section') p.findall('wegwg\section') p = re.compile(r'\\\section') p.findall('wegwg\section') '\s' '\\t' '\\a' '\a' p = re.compile('\\\\section') p.findall('wegwg\section') p = re.compile('\section') p.findall('wegwg\section') p = re.compile(r'\\section') p = re.compile('\\section') p.findall('wegwg\section') p = re.compile('\\pection') p = re.compile('\\pection') p = re.compile('\\pection') p = re.compile('\\\pection') '\p' p.findall('wegwg\pection') p = re.compile(r'\pection') p = re.compile(r'\\pection') p.findall('wegwg\pection') p = re.compile('\section') p.findall('wegwg\section') p = re.compile('\\section') p.findall('wegwg\section') p = re.compile('\\\section') p.findall('wegwg\section') p = re.compile(r'\\section') p.findall('wegwg\section') '\s' '\\\secotr' '\\\\secotr' '\\\\\secotr' '\\\\\\secotr' '\\\\\\tecotr' '\\\\\tecotr' '\\\\tecotr' '\\\tecotr' '\\tecotr' '\tecotr' '\t ecotr' '\t' '\\t' '个人股\t' '个人股\t gfweg' '个人股\n gfweg' print('gweg \t weg') print('gweg \n weg') print('\s') print('\\s') print('\\\s') print('\\\\s') print('\\\\t') print('\\\t') print('\\\tfewg') p = re.compile('\section') p.findall('wegwg ection') p = re.compile('\pection') p = re.compile('\\pection') p = re.compile('\\\pection') p.findall('wegwg\pection') p = re.compile('\\\\pection') p.findall('wegwg\pection') p = re.compile('\tection') p.findall('wegwg\tection') print(p.findall('wegwg\tection')[0]) print('\s') print('\s') print('\\s') print('\\t') print('\t') '\' print('\') print('\\') '\\' ?print ? print %history -f re_escape.py
20.72043
71
0.620654
290
1,927
4.12069
0.134483
0.067782
0.225941
0.217573
0.833473
0.803347
0.803347
0.732218
0.709623
0.709623
0
0.007416
0.090296
1,927
92
72
20.945652
0.674273
0
0
0.478261
0
0
0.425013
0
0
0
0
0
0
0
null
null
0
0.01087
null
null
0.206522
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
9
7be7eb785e34900179b62c6225b027c9cd43b779
112
py
Python
main_site/views.py
enisemir/eticaret
5435af11330ae453d3a098a422f124af58771e7b
[ "Apache-2.0" ]
null
null
null
main_site/views.py
enisemir/eticaret
5435af11330ae453d3a098a422f124af58771e7b
[ "Apache-2.0" ]
null
null
null
main_site/views.py
enisemir/eticaret
5435af11330ae453d3a098a422f124af58771e7b
[ "Apache-2.0" ]
null
null
null
from django.shortcuts import render_to_response def index(request): return render_to_response("home.html")
22.4
47
0.803571
16
112
5.375
0.8125
0.186047
0.372093
0
0
0
0
0
0
0
0
0
0.116071
112
5
48
22.4
0.868687
0
0
0
0
0
0.079646
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
7
d00b8d9613d8cf7e02f189473037107a8c61b21b
9,892
py
Python
instructions/math.py
kimi641/pyJVM
9e2b2392044a8ddd41ff8dda18a26e307776ae34
[ "MIT" ]
null
null
null
instructions/math.py
kimi641/pyJVM
9e2b2392044a8ddd41ff8dda18a26e307776ae34
[ "MIT" ]
1
2021-01-21T09:38:24.000Z
2021-01-21T09:38:24.000Z
instructions/math.py
kimi641/pyJVM
9e2b2392044a8ddd41ff8dda18a26e307776ae34
[ "MIT" ]
null
null
null
import struct import instructions.base import rtda class DADD(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopDouble() v1 = statk.PopDouble() result = v1 + v2 stack.PushDouble(result) class FADD(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopFloat() v1 = statk.PopFloat() result = v1 + v2 stack.PushFloat(result) class IADD(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() result = v1 + v2 stack.PushInt(result) class LADD(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = stack.PopLong() result = v1 + v2 stack.PushLong(result) class IAND(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = statk.PopInt() result = v1 and v2 stack.PushInt(result) class LAND(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = statk.PopLong() result = v1 and v2 stack.PushLong(result) class DDIV(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopDouble() v1 = statk.PopDouble() result = v1 / v2 stack.PushDouble(result) class FDIV(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopFloat() v1 = statk.PopFloat() result = v1 / v2 stack.PushFloat(result) class IDIV(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = statk.PopInt() if v2 == 0: raise("java.lang.ArithmeticException: / by zero") result = v1 / v2 stack.PushInt(result) class LDIV(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = statk.PopLong() if v2 == 0: raise("java.lang.ArithmeticException: / by zero") result = v1 / v2 stack.PushLong(result) class IINC: def FetchOperands(self, reader:instructions.base.BytecodeReader): self.Index = reader.ReadUint8() self.Const = reader.ReadInt8() def Execute(self, frame:rtda.Frame): localVars = frame.LocalVars() val = localVars.GetInt(self.Index) val += self.Const localVars.SetInt(self.Index, val) class DMUL(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): v2 = stack.PopDouble() v1 = statk.PopDouble() result = v1 * v2 stack.PushDouble(result) class FMUL(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): v2 = stack.PopFloat() v1 = statk.PopFloat() result = v1 * v2 stack.PushFloat(result) class IMUL(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): v2 = stack.PopInt() v1 = statk.PopInt() result = v1 * v2 stack.PushInt(result) class LMUL(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): v2 = stack.PopLong() v1 = statk.PopLong() result = v1 * v2 stack.PushLong(result) class DNEG(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): val = stack.PopDouble() stack.PushDouble(-val) class FNEG(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): val = stack.PopFloat() stack.PushDouble(-val) class INEG(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): val = stack.PopInt() stack.PushDouble(-val) class LNEG(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): val = stack.PopLong() stack.PushDouble(-val) class IOR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() result = v1 or v2 stack.PushInt(result) class LOR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = stack.PopLong() result = v1 or v2 stack.PushLong(result) class DREM(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopDouble() v1 = statk.PopDouble() result = v1 % v2 stack.PushDouble(result) class FREM(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopFloat() v1 = statk.PopFloat() result = v1 % v2 stack.PushFloat(result) class IREM(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() if v2 == 0: raise("java.lang.ArithmeticException: / by zero") result = v1 % v2 stack.PushInt(result) class LREM(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = stack.PopLong() if v2 == 0: raise("java.lang.ArithmeticException: / by zero") result = v1 % v2 stack.PushLong(result) class ISHL(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() bits = struct.pack('>i', v2) s = struct.unpack('>I', bits)[0] & 0x3f result = v1 << s stack.PushInt(result) class ISHR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() bits = struct.pack('>i', v2) s = struct.unpack('>I', bits)[0] & 0x3f result = v1 >> s stack.PushInt(result) class IUSHR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() bits = struct.pack('>i', v2) s = struct.unpack('>I', bits)[0] & 0x1f bits1 = struct.pack('>i', v1) s1 = struct.unpack('>I', bits1)[0] result = struct.unpack('>i', struct.pack('>I',s1 >> s))[0] stack.PushInt(result) class LSHL(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopLong() bits = struct.pack('>i', v2) s = struct.unpack('>I', bits)[0] & 0x3f result = v1 << s stack.PushLong(result) class LSHR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopLong() bits = struct.pack('>i', v2) s = struct.unpack('>I', bits)[0] & 0x3f result = v1 >> s stack.PushLong(result) class LUSHR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopLong() bits = struct.pack('>i', v2) s = struct.unpack('>I', bits)[0] & 0x1f bits1 = struct.pack('>l', v1) s1 = struct.unpack('>L', bits1)[0] result = struct.unpack('>l', struct.pack('>L',s1 >> s))[0] stack.PushInt(result) class DSUB(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopDouble() v1 = stack.PopDouble() result = v1 - v2 stack.PushDouble(result) class FSUB(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopFloat() v1 = stack.PopFloat() result = v1 - v2 stack.PushFloat(result) class ISUB(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() result = v1 - v2 stack.PushInt(result) class LSUB(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = stack.PopLong() result = v1 - v2 stack.PushLong(result) class IXOR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopInt() v1 = stack.PopInt() result = v1 ^ v2 stack.PushInt(result) class LXOR(instructions.base.NoOperandsInstruction): def Execute(self, frame:rtda.Frame): stack = frame.OperandStack() v2 = stack.PopLong() v1 = stack.PopLong() result = v1 ^ v2 stack.PushLong(result)
31.807074
69
0.61292
1,082
9,892
5.603512
0.085952
0.066964
0.085436
0.115949
0.903348
0.876959
0.87234
0.863434
0.828633
0.828633
0
0.023048
0.263142
9,892
310
70
31.909677
0.808753
0
0
0.783088
0
0
0.020218
0.012131
0
0
0.002426
0
0
1
0.139706
false
0
0.011029
0
0.286765
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d0cfc4d05036b485fbed555de972cffdb8469910
1,042
py
Python
M1/ex009.py
jefersondevsouza/CursoPython
3ee7fadfa44b4351ce9bdb1029261afe5bab6bbf
[ "MIT" ]
1
2022-01-21T00:12:18.000Z
2022-01-21T00:12:18.000Z
M1/ex009.py
jefersondevsouza/CursoPython
3ee7fadfa44b4351ce9bdb1029261afe5bab6bbf
[ "MIT" ]
null
null
null
M1/ex009.py
jefersondevsouza/CursoPython
3ee7fadfa44b4351ce9bdb1029261afe5bab6bbf
[ "MIT" ]
null
null
null
num = int(input('Digite o numero para a tabuada: ')) contador = 0 print('-' * 12) print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) contador = contador + 1 print('{} * {:2} = {:2}'.format(num, contador, (num*contador))) print('-' * 12)
40.076923
63
0.589251
133
1,042
4.616541
0.120301
0.394137
0.125407
0.232899
0.903909
0.903909
0.903909
0.903909
0.903909
0.903909
0
0.041249
0.139155
1,042
25
64
41.68
0.643255
0
0
0.92
0
0
0.201536
0
0
0
0
0
0
1
0
false
0
0
0
0
0.52
0
0
0
null
1
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
10
1900d5d41bb8a1ee9fbb3dcd1eb284e995ad7966
80
py
Python
tests/test_package.py
ikasat/code2vec
49d80bba24b66046179db8873fc7928b1cd0e53c
[ "Apache-2.0" ]
null
null
null
tests/test_package.py
ikasat/code2vec
49d80bba24b66046179db8873fc7928b1cd0e53c
[ "Apache-2.0" ]
null
null
null
tests/test_package.py
ikasat/code2vec
49d80bba24b66046179db8873fc7928b1cd0e53c
[ "Apache-2.0" ]
null
null
null
def test_import_code2vec(): import code2vec assert code2vec.__version__
20
31
0.775
9
80
6.222222
0.666667
0.5
0
0
0
0
0
0
0
0
0
0.045455
0.175
80
3
32
26.666667
0.80303
0
0
0
0
0
0
0
0
0
0
0
0.333333
1
0.333333
true
0
0.666667
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
7
efc4e53e2d42bf267ef7ea772140d84dba879115
3,020
py
Python
forms.py
Andrew30/bc-14-inventory_management_app
7d35843c743847aeac75ae7d8337d78abbb86469
[ "MIT" ]
null
null
null
forms.py
Andrew30/bc-14-inventory_management_app
7d35843c743847aeac75ae7d8337d78abbb86469
[ "MIT" ]
null
null
null
forms.py
Andrew30/bc-14-inventory_management_app
7d35843c743847aeac75ae7d8337d78abbb86469
[ "MIT" ]
null
null
null
from flask_wtf import Form from wtforms import StringField, SubmitField, DateField from wtforms.validators import DataRequired class AddAssets(Form): name = StringField('Asset Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) serial = StringField('Serial Number', validators=[DataRequired()]) date = DateField('DatePicker', validators=[DataRequired()]) submit = SubmitField('Submit') class AssignAsset(Form): name = StringField('Asset Name', validators=[DataRequired()]) person = StringField('Assigned To', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) transaction = StringField('Transaction ID', validators=[DataRequired()]) serial = StringField('Serial Number', validators=[DataRequired()]) da = DateField('DatePicker', validators=[DataRequired()]) dt = DateField('DatePicker', validators=[DataRequired()]) submit = SubmitField('Submit') class ClaimAssets(Form): name = StringField('Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) person = StringField('Assigned To', validators=[DataRequired()]) serial = StringField('Serial Number', validators=[DataRequired()]) submit = SubmitField('Submit') class LostItems(Form): name = StringField('Asset Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) serial = StringField('Serial Number', validators=[DataRequired()]) da = DateField('DatePicker', validators=[DataRequired()]) dt = DateField('DatePicker', validators=[DataRequired()]) submit = SubmitField('Submit') class Notices(Form): name = StringField('Asset Name', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) submit = SubmitField('Submit') class AssignedAssets(Form): name = StringField('Asset Name', validators=[DataRequired()]) person = StringField('Assigned To', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) transaction = StringField('Transaction ID', validators=[DataRequired()]) serial = StringField('Serial Number', validators=[DataRequired()]) da = DateField('DatePicker', validators=[DataRequired()]) dt = DateField('DatePicker', validators=[DataRequired()]) submit = SubmitField('Submit') class ListAssets(Form): name = StringField('Asset Name', validators=[DataRequired()]) person = StringField('Assigned To', validators=[DataRequired()]) description = StringField('Description', validators=[DataRequired()]) transaction = StringField('Transaction ID', validators=[DataRequired()]) serial = StringField('Serial Number', validators=[DataRequired()]) da = DateField('DatePicker', validators=[DataRequired()]) dt = DateField('DatePicker', validators=[DataRequired()]) submit = SubmitField('Submit')
45.757576
76
0.718212
257
3,020
8.435798
0.132296
0.365314
0.120387
0.170203
0.904059
0.904059
0.878229
0.878229
0.762915
0.762915
0
0
0.131126
3,020
66
77
45.757576
0.82622
0
0
0.773585
0
0
0.144654
0
0
0
0
0
0
1
0
false
0
0.056604
0
1
0
0
0
0
null
1
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
10
56022a4f678a95829b068ba78eb2ecec36d950dd
7,645
py
Python
tests/test_html_utils.py
allison-casey/parse_quest_manual
55ffdd93ca4045c60a4a78241f95707889ecbbe9
[ "MIT" ]
null
null
null
tests/test_html_utils.py
allison-casey/parse_quest_manual
55ffdd93ca4045c60a4a78241f95707889ecbbe9
[ "MIT" ]
4
2019-04-08T04:51:56.000Z
2019-04-09T02:18:26.000Z
tests/test_html_utils.py
allison-casey/parse_quest_manual
55ffdd93ca4045c60a4a78241f95707889ecbbe9
[ "MIT" ]
null
null
null
from bs4 import BeautifulSoup import bs4 from parse_quest_manual import html_utils from pprint import pprint def test_parse_table(): source = ''' <table> <tbody> <tr> <td> <p><strong>Name</strong></p> </td> <td> <p><strong>DT</strong></p> </td> <td> <p><strong>Value</strong></p> </td> <td> <p><strong>Weight</strong></p> </td> <td> <p><strong>Traits</strong></p> </td> </tr> <tr> <td> <p>Advanced radiation suit</p> </td> <td> <p>2 DT</p> </td> <td> <p>12 caps</p> </td> <td> <p>7 lbs.</p> </td> <td> <p>+4 rad res., <em>Bodysuit</em></p> </td> </tr> </tbody> </table> ''' soup = BeautifulSoup(source.strip(), 'html.parser') test_table = soup.find('table') assert html_utils.parse_table(test_table) == [{ 'name': 'advanced radiation suit', 'dt': 2, 'value': 12, 'weight': 7, 'traits': ['+4 rad res', 'bodysuit'] }] def test_chunk_categories(): source = ''' <h2>something</h2> <p>some stuff before the items</p> <h3>Armor Sets</h3> <table></table> <h3>Helmets</h3> <p>some descriptions</p> <h4>some sub types</h4> <h1>a different section</h1> ''' soup = BeautifulSoup(source.strip(), 'html.parser') test_document = soup.find('h3') result = html_utils.chunk_categories(test_document) assert [category['category'] for category in result] == ['armor sets', 'helmets'] assert [len(category['content']) for category in result] == [1, 2] def test_parse_contents(): armor = ''' <table> <tbody> <tr> <td><p><strong>Name</strong></p></td> <td><p><strong>DT</strong></p></td> <td><p><strong>Value</strong></p></td> <td><p><strong>Weight</strong></p></td> <td><p><strong>Traits</strong></p></td> </tr> <tr> <td><p>Advanced radiation suit</p></td> <td><p>2 DT</p></td> <td><p>12 caps</p></td> <td><p>7 lbs.</p></td> <td><p>+4 rad res., <em>Bodysuit</em></p></td> </tr> </tbody> </table>''' helmets = ''' <table> <tbody> <tr> <td><p><strong>Name</strong></p></td> <td><p><strong>DT</strong></p></td> <td><p><strong>Value</strong></p></td> <td><p><strong>Weight</strong></p></td> <td><p><strong>Traits</strong></p></td> </tr> <tr> <td><p>Baseball cap</p></td> <td><p>0 DT</p></td> <td><p>1 caps</p></td> <td><p>1 lbs.</p></td> <td><p>+1 Melee weapons</p></td> </tr> </tbody> </table>''' source = ''' <h2>something</h2> <p>some stuff before the items</p> <h3>Armor Sets</h3> <h5>Special armors</h5> {} <h3>Helmets</h3> <h4>Hats</h4> {} <h4>Light Helmets</h4> <h5>Recon</h5> {} <p>some descriptions</p> <h4>some sub types</h4> <h1>a different section</h1>'''.format(armor, helmets, helmets) soup = BeautifulSoup(source, 'html.parser') categories = html_utils.chunk_categories(soup.find("h3")) categories = html_utils.parse_contents(categories) assert categories == [ { 'category': 'armor sets', 'content': [{ 'subtype': 'special armors', 'items': [{ 'name': 'advanced radiation suit', 'dt': 2, 'value': 12, 'weight': 7, 'traits': ['+4 rad res', 'bodysuit'] }] }] }, { 'category': 'helmets', 'content': [ { 'type': 'hats', 'items': [ { 'name': 'baseball cap', 'dt': 0, 'value': 1, 'weight': 1, 'traits': ['+1 melee weapons'] }, ] }, { 'type': 'light helmets', 'subtype': 'recon', 'items': [ { 'name': 'baseball cap', 'dt': 0, 'value': 1, 'weight': 1, 'traits': ['+1 melee weapons'] }, ] }, ] }, ] def test_parse_categories(): armor = ''' <table> <tbody> <tr> <td><p><strong>Name</strong></p></td> <td><p><strong>DT</strong></p></td> <td><p><strong>Value</strong></p></td> <td><p><strong>Weight</strong></p></td> <td><p><strong>Traits</strong></p></td> </tr> <tr> <td><p>Advanced radiation suit</p></td> <td><p>2 DT</p></td> <td><p>12 caps</p></td> <td><p>7 lbs.</p></td> <td><p>+4 rad res., <em>Bodysuit</em></p></td> </tr> </tbody> </table>''' helmets = ''' <table> <tbody> <tr> <td><p><strong>Name</strong></p></td> <td><p><strong>DT</strong></p></td> <td><p><strong>Value</strong></p></td> <td><p><strong>Weight</strong></p></td> <td><p><strong>Traits</strong></p></td> </tr> <tr> <td><p>Baseball cap</p></td> <td><p>0 DT</p></td> <td><p>1 caps</p></td> <td><p>1 lbs.</p></td> <td><p>+1 Melee weapons</p></td> </tr> </tbody> </table>''' source = ''' <h2>something</h2> <p>some stuff before the items</p> <h3>Armor Sets</h3> <h5>Special armors</h5> {} <h3>Helmets</h3> <h4>Hats</h4> {} <p>some descriptions</p> <h4>some sub types</h4> <h1>a different section</h1>'''.format(armor, helmets) soup = BeautifulSoup(source, 'html.parser') assert html_utils.parse_categories(soup.find('h3')) == [ { 'category': 'armor sets', 'content': [{ 'subtype': 'special armors', 'items': [{ 'name': 'advanced radiation suit', 'dt': 2, 'value': 12, 'weight': 7, 'traits': ['+4 rad res', 'bodysuit'] }] }] }, { 'category': 'helmets', 'content': [{ 'type': 'hats', 'items': [{ 'name': 'baseball cap', 'dt': 0, 'value': 1, 'weight': 1, 'traits': ['+1 melee weapons'] }] }] }, ]
27.401434
70
0.373708
754
7,645
3.755968
0.114058
0.052966
0.070621
0.084746
0.784958
0.784958
0.759181
0.72952
0.72952
0.72952
0
0.023229
0.442511
7,645
278
71
27.5
0.641248
0
0
0.745318
0
0
0.6017
0.126619
0
0
0
0
0.018727
1
0.014981
false
0
0.014981
0
0.029963
0.003745
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4be634626e0566757667d613920a2830d413bcda
103
py
Python
pybliometrics/scopus/classes/__init__.py
fabiosangregorio/scopus
b8e72df8881d6eb24788ab1012387c55b088d2f2
[ "MIT" ]
11
2019-07-03T03:35:48.000Z
2021-07-19T06:04:19.000Z
pybliometrics/scopus/classes/__init__.py
fabiosangregorio/scopus
b8e72df8881d6eb24788ab1012387c55b088d2f2
[ "MIT" ]
null
null
null
pybliometrics/scopus/classes/__init__.py
fabiosangregorio/scopus
b8e72df8881d6eb24788ab1012387c55b088d2f2
[ "MIT" ]
6
2020-02-10T20:49:54.000Z
2021-03-26T18:00:26.000Z
from pybliometrics.scopus.classes.retrieval import * from pybliometrics.scopus.classes.search import *
34.333333
52
0.84466
12
103
7.25
0.583333
0.390805
0.528736
0.689655
0
0
0
0
0
0
0
0
0.07767
103
2
53
51.5
0.915789
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
ef419a8a7a47cb91cebfa1ad1dd7217a2e1ba4dd
9,907
py
Python
scraper/scraper/items.py
richiebful/real-estate-scrape
6b7a90c489da96a45b25ca30900e3543bcd3fb6a
[ "MIT" ]
null
null
null
scraper/scraper/items.py
richiebful/real-estate-scrape
6b7a90c489da96a45b25ca30900e3543bcd3fb6a
[ "MIT" ]
null
null
null
scraper/scraper/items.py
richiebful/real-estate-scrape
6b7a90c489da96a45b25ca30900e3543bcd3fb6a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import scrapy from scrapy.loader.processors import Join, MapCompose, TakeFirst from datetime import datetime from decimal import Decimal def strip_string(s: str): if s != None: return s.strip() else: return None def parse_us_date(s: str): return datetime.strptime(s, '%m/%d/%Y') def parse_us_dollars(s: str): return Decimal(s.replace('$', '').replace(',', '')) class Parcel(scrapy.Item): """Capture parcel-level data from the "General Information" page on the portal site""" parcel_id = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) property_address = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=Join("\n") ) municipality = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) owner_name = scrapy.Field( input_processor=MapCompose(strip_string) ) school_district = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) neighborhood_code = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) tax_code = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) owner_code = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) clean_green = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) zoning_class = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) recording_date = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_date), output_processor=TakeFirst() ) use_code = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) sale_date = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_date), output_processor=TakeFirst() ) homestead = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) sale_price = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) farmstead = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) deed_book = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) deed_page = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) lot_area = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) abatement = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) # this section depends on current_year current_year = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) cy_market_land_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) cy_market_building_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) cy_market_total_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) py_market_land_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) py_market_building_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) py_market_total_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) cy_assessed_land_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) cy_assessed_building_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) cy_assessed_total_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) py_assessed_land_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) py_assessed_building_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) py_assessed_total_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) owner_mailing = scrapy.Field( output_processor=Join("\n") ) class Building(scrapy.Item): """Capture parcel-level data from the "Building Information" page on the portal site""" parcel_id = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) use_code = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) number_rooms = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) style = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) condition = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) stories = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) year_built = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) exterior_finish = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) roof_type = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) total_rooms = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) basement = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) bedrooms = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) grade = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) full_baths = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) half_baths = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) fireplaces = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) heating = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) cooling = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) basement_garage = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) living_area = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) class PreviousOwner(scrapy.Item): """Capture all the previous owners of a parcel from the 'Owner History' page""" parcel_id = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) owner = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) sale_date = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_date), output_processor=TakeFirst() ) sale_price = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) class PreviousTaxBill(scrapy.Item): """Capture recent tax payments from the page 'Tax Info'""" #top level elements parcel_id = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) millage_rate = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) taxable_market_value = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) #row elements year_assessed = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) paid_status = scrapy.Field( input_processor=MapCompose(strip_string), output_processor=TakeFirst() ) tax_amount = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) penalty_amount = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) interest_amount = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) total_amount = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_dollars), output_processor=TakeFirst() ) date_paid = scrapy.Field( input_processor=MapCompose(strip_string, parse_us_date), output_processor=TakeFirst() ) # class Residential
32.270358
91
0.685576
1,026
9,907
6.296296
0.128655
0.115789
0.165944
0.259288
0.85743
0.857121
0.857121
0.85
0.837926
0.828483
0
0.00013
0.224992
9,907
306
92
32.375817
0.841235
0.040073
0
0.498258
0
0
0.001476
0
0
0
0
0
0
1
0.010453
false
0
0.013937
0.006969
0.289199
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
ef50f59e5603f945f4ccc3a1058577018eb43cdf
6,343
py
Python
QDgym_extended/QDgym_deterministic_envs.py
adaptive-intelligent-robotics/QDgym_extended
99375c07b1bb328fd451a80629863c05813b6eeb
[ "MIT" ]
null
null
null
QDgym_extended/QDgym_deterministic_envs.py
adaptive-intelligent-robotics/QDgym_extended
99375c07b1bb328fd451a80629863c05813b6eeb
[ "MIT" ]
null
null
null
QDgym_extended/QDgym_deterministic_envs.py
adaptive-intelligent-robotics/QDgym_extended
99375c07b1bb328fd451a80629863c05813b6eeb
[ "MIT" ]
null
null
null
import gym gym.logger.set_level(40) import numpy as np from pybullet_envs.gym_locomotion_envs import WalkerBaseBulletEnv from . import DeterministicAnt, DeterministicHalfCheetah, DeterministicWalker2D, DeterministicHumanoid, DeterministicHopper class QDDeterministicAntBulletEnv(WalkerBaseBulletEnv): def __init__(self, render=False): self.robot = DeterministicAnt() super().__init__(self.robot, render=render) self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(4)]) self.desc_acc = np.array([0.0 for _ in range(4)]) print(f"The behavioural desciptor is {len(self.desc)}-dimentional", f"and defined as proportion of feet contact time with the ground in the order {self.robot.foot_list}") def reset(self): r = super().reset() self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(4)]) self.desc_acc = np.array([0.0 for _ in range(4)]) return r def step(self, a): state, reward, done, info = super().step(a) self.desc_acc += self.robot.feet_contact self.tot_reward += reward self.T += 1 self.alive = (self.__dict__["_alive"] >= 0.0) self.desc = self.desc_acc / self.T info["bc"] = self.desc info["x_pos"] = None return state, reward, done, info class QDDeterministicHalfCheetahBulletEnv(WalkerBaseBulletEnv): def __init__(self, render=False): self.robot = DeterministicHalfCheetah() super().__init__(self.robot, render=render) self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(2)]) self.desc_acc = np.array([0.0 for _ in range(2)]) print(f"The behavioural desciptor is {len(self.desc)}-dimentional", f"and defined as proportion of feet contact time with the ground in the order {[self.robot.foot_list[0] , self.robot.foot_list[3]]}") def reset(self): r = super().reset() self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(2)]) self.desc_acc = np.array([0.0 for _ in range(2)]) return r def step(self, a): state, reward, done, info = super().step(a) self.desc_acc[0] += self.robot.feet_contact[0] self.desc_acc[1] += self.robot.feet_contact[3] self.tot_reward += reward self.T += 1 self.alive = (self.__dict__["_alive"] >= 0.0) self.desc = self.desc_acc / self.T info["bc"] = self.desc info["x_pos"] = None return state, reward, done, info class QDDeterministicWalker2DBulletEnv(WalkerBaseBulletEnv): def __init__(self, render=False): self.robot = DeterministicWalker2D() super().__init__(self.robot, render=render) self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(2)]) self.desc_acc = np.array([0.0 for _ in range(2)]) print(f"The behavioural desciptor is {len(self.desc)}-dimentional", f"and defined as proportion of feet contact time with the ground in the order {self.robot.foot_list}") def reset(self): r = super().reset() self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(2)]) self.desc_acc = np.array([0.0 for _ in range(2)]) return r def step(self, a): state, reward, done, info = super().step(a) self.desc_acc += self.robot.feet_contact self.tot_reward += reward self.T += 1 self.alive = (self.__dict__["_alive"] >= 0.0) self.desc = self.desc_acc / self.T info["bc"] = self.desc info["x_pos"] = None return state, reward, done, info class QDDeterministicHumanoidBulletEnv(WalkerBaseBulletEnv): def __init__(self, render=False): self.robot = DeterministicHumanoid() super().__init__(self.robot, render=render) self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(2)]) self.desc_acc = np.array([0.0 for _ in range(2)]) print(f"The behavioural desciptor is {len(self.desc)}-dimentional", f"and defined as proportion of feet contact time with the ground in the order {self.robot.foot_list}") def reset(self): r = super().reset() self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(2)]) self.desc_acc = np.array([0.0 for _ in range(2)]) return r def step(self, a): state, reward, done, info = super().step(a) self.desc_acc += self.robot.feet_contact self.tot_reward += reward self.T += 1 self.alive = (self.__dict__["_alive"] >= 0.0) self.desc = self.desc_acc / self.T info["bc"] = self.desc info["x_pos"] = None return state, reward, done, info class QDDeterministicHopperBulletEnv(WalkerBaseBulletEnv): def __init__(self, render=False): self.robot = DeterministicHopper() super().__init__(self.robot, render=render) self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(1)]) self.desc_acc = np.array([0.0 for _ in range(1)]) print(f"The behavioural desciptor is {len(self.desc)}-dimentional", f"and defined as proportion of feet contact time with the ground in the order {self.robot.foot_list}") def reset(self): r = super().reset() self.T = 0 self.tot_reward = 0.0 self.desc = np.array([0.0 for _ in range(1)]) self.desc_acc = np.array([0.0 for _ in range(1)]) return r def step(self, a): state, reward, done, info = super().step(a) self.desc_acc += self.robot.feet_contact self.tot_reward += reward self.T += 1 self.alive = (self.__dict__["_alive"] >= 0.0) self.desc = self.desc_acc / self.T info["bc"] = self.desc info["x_pos"] = None return state, reward, done, info if __name__ == "__main__": env = QDDeterministicHalfCheetahBulletEnv() env.reset() a = env.action_space.sample() env.step(a) print(env.alive) print(env.desc)
32.362245
147
0.599716
884
6,343
4.132353
0.098416
0.100739
0.063236
0.049275
0.819874
0.819874
0.819874
0.819874
0.751437
0.751437
0
0.02513
0.272269
6,343
195
148
32.528205
0.766248
0
0
0.831081
0
0.033784
0.138578
0.043828
0
0
0
0
0
1
0.101351
false
0
0.027027
0
0.22973
0.047297
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
32ab7c95b09e4bfcf722f93439334d2266b3cb6e
45
py
Python
keys/seed_key.py
Colt-Zero/spyro06-source
60fcc0d252e084f667d4c46a5bbf07313d91f5a3
[ "Unlicense" ]
null
null
null
keys/seed_key.py
Colt-Zero/spyro06-source
60fcc0d252e084f667d4c46a5bbf07313d91f5a3
[ "Unlicense" ]
null
null
null
keys/seed_key.py
Colt-Zero/spyro06-source
60fcc0d252e084f667d4c46a5bbf07313d91f5a3
[ "Unlicense" ]
null
null
null
SEED_KEY="b2ac7c56c41ef0fb316dd90ca97a65cd"
22.5
44
0.888889
3
45
13
1
0
0
0
0
0
0
0
0
0
0
0.372093
0.044444
45
1
45
45
0.534884
0
0
0
0
0
0.711111
0.711111
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7