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
45d87d158f4d8bd52af8ab9c7424374e121be100
133
py
Python
commander/thirdparty/covertutils/shells/impl/__init__.py
how2how/ToyHome
4457b1d28e21ed6fd4ab980a0f7fed345c570ae3
[ "Apache-2.0" ]
1
2020-07-26T01:08:30.000Z
2020-07-26T01:08:30.000Z
commander/thirdparty/covertutils/shells/impl/__init__.py
how2how/ToyHome
4457b1d28e21ed6fd4ab980a0f7fed345c570ae3
[ "Apache-2.0" ]
null
null
null
commander/thirdparty/covertutils/shells/impl/__init__.py
how2how/ToyHome
4457b1d28e21ed6fd4ab980a0f7fed345c570ae3
[ "Apache-2.0" ]
null
null
null
from covertutils.shells.impl.extendableshell import ExtendableShell from covertutils.shells.impl.standardshell import StandardShell
33.25
67
0.887218
14
133
8.428571
0.5
0.254237
0.355932
0.423729
0
0
0
0
0
0
0
0
0.067669
133
3
68
44.333333
0.951613
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
b311c0797ef660f142ced85a177a4b4435dcc477
27,740
py
Python
4° Período/Programação de Computadores/Bingo Nerd/trabalho_3_bingo_geek.py
sullyvan15/UVV
2390cc2881792d036db1d8b098fe366f47cd98c3
[ "MIT" ]
null
null
null
4° Período/Programação de Computadores/Bingo Nerd/trabalho_3_bingo_geek.py
sullyvan15/UVV
2390cc2881792d036db1d8b098fe366f47cd98c3
[ "MIT" ]
1
2020-10-07T23:33:21.000Z
2020-10-08T01:15:11.000Z
4° Período/Programação de Computadores/Bingo Nerd/trabalho_3_bingo_geek.py
sullyvan15/Universidade-Vila-Velha
2390cc2881792d036db1d8b098fe366f47cd98c3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Trabalho 3 - Bingo Geek.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1tB6COK3WuIhupeOUJADy-JwPYLe1mvN7 <?xml version="1.0" encoding="UTF-8"?> <html> <body> <header></header> <CENTER> <img src="https://www.uvv.br/wp-content/themes/uvvBr/templates/assets//img/logouvv.svg" alt="UVV-LOGO" style = width="100px"; height="100px"> </CENTER> <CENTER><b>Laboratório de Programação - Python</b><br/> <CENTER><b>Prof.: Alessandro Bertolani Oliveira</b> <CENTER><b>Bingo Nerd - Hexadecimal</b><br/></CENTER><br/> # NOMES DO GRUPO: ## Nome 1: ## Nome 2: ## Nome 3: # DESCRIÇÃO DO TRABALHO: BINGO NERD (HEXADECIMAL) ![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAasAAAGQCAYAAAAQrE8DAAAgAElEQVR4Ae2dzXHcOre1ncJ7Rl9Z7DeALwbH4PEZKwOn4BCOWqpbTsSJKIweH+mOdGuDBAmCG2yQ+FuQl6u6mj/AxuZaBB4Q3Wp/eX8afr1dL4/vzw8/+MLUwPhz/fqbXmH6Y/uN+PT29PBTfLLH+I7pmelT4hPHP/hx3/apL/9eL39/4T94BcxA+Pz1G3yif3iC//s//+//C6D+cBm6uHwDrJfL9y6S/YOT/Hj5739MnyKs+rgLxKw3wgreLMIK3qI5QcJqlgJ6g7CCtmebHGG11QTxCGGF6IqeE2Gl64J2lLBCc+ROPoTVHYFAThNWIEZEpEFYRYgEUISwAjDhSAqE1RG12pUlrNppf7RlwuqoYm3KE1ZtdD/dKmF1WrqqFQmrqnInNUZYJclXrTJhVU3qPA0RVnl0LB2FsCqtcL74hFU+LUtGIqxKqlsgNmFVQNQCIQmrAqIWCklYFRI2c1jCKrOgpcMRVqUVzhOfsMqjY40ohFUNldPbIKzSNawagbCqKvfpxgir09JVr0hYVZf8VIOE1SnZ2lUirNppf6RlwuqIWm3LElZt9Y9tnbCKVQqkHGEFYsSdNAirOwIBnSasgMzYSYWw2hEH8RRhhejKNifCaqsJ6hHCCtWZdV6E1VoP+D3CCt4ikyBh1YdPkiVh1YdXhFUfPs1ZElazFNAbhBW0PavkCKuVHLA7hBWsNXpihJWuC9pRwgrNkXA+hFVYG6QzhBWSGxG5EFYRIgEUIawATIhMgbCKFKpxMcKqsQFHmyesjirWpjxh1Ub3M60SVmdUq1+HsKqveVKLhFWSfNUqE1bVpE5uiLBKlrBKAMKqisz5GiGs8mlZMhJhVVLdvLEJq7x6lopGWJVStlBcwqqQsJnDElaZBS0YjrAqKG7G0IRVRjFrhCKsaqic3gZhla5hrQiEVS2l09ohrNL0q16bsKou+akGCatTsjWpRFg1kf1wo4TVYcnaViCs2uof2zphFatU+3KEVXsPYjIgrGJUAipDWAGZsZMKYbUjDtgpwgrMkEA6hFVAGNTDhBWqM+u8CKu1Hsh7hBWyO0tuhNWiRRdbhFUXNn0hrPrwSbIkrPrwirDqw6c5S8JqlgJ6g7CCtmeVHGG1kgN2h7CCtUZPjLDSdUE7SlihORLOh7AKa4N0hrBCciMiF8IqQiSAIoQVgAmRKRBWkUI1LkZYNTbgaPOE1VHF2pQnrNrofqZVwuqMavXrEFb1NU9qkbBKkq9aZcKqmtTJDRFWyRJWCUBYVZE5XyOEVT4tS0YirEqqmzc2YZVXz1LRCKtSyhaKS1gVEjZzWMIqs6AFwxFWBcXNGJqwyihmjVCEVQ2V09sgrNI1rBWBsKqldFo7hFWaftVrE1bVJT/VIGF1SrYmlQirJrIfbvRTw0oGjLenh597LzP4Pz38fH8afr1fv/42r+eHH4eVrFSBsKokdGIzhFWigBWrE1YVxU5o6lPD6v3l8v3tevk4+hJgJWhatCphVVTebMEJq2xSFg9EWBWXOEsDnxpWb89fvx0FlZQnrM7fWzJIy0turPNRtjUlnon7z1/D9izekV5hNft3QGfrTU/+uHfMnwgrGRv/vV7+/jjgs6tZi+1uYCXLdG/X4XVeqrNLdt67dBgrpGyfgZW0Y2OgvSM/WcmNv+g93ETHPc/M+eev30IaG/9kGXeMcxtj43rjXofkLl65x1C3ZeCSfvV2Fc/clYjhVZbQtYmHrFrYPqnVk3O9DIQ9wGr1MYU35rljYozm20n81FefHn6i3qOSVxewOgQdZ/A7VG/VSS8fUhfROGRYndJb6SDS4cbB0x04l20ZKBG9cXMSLXqA1QicRds1rOzx4SYDnFzf6LEPNVtu+96DV+iwOtKvpKx7H2rbob4lx7XyKMc+Haxcs8aZ/rZjiSnmBpBlwulxWAYW85pmLTEzlBYmIsNqO2PbDl6bwdCDVUwM9E4l94XcX+iwkkF644c3aXPPy3Wd+RwYtS/Z/vuZYHVP6z3P0fvVJ4PVcHOXLGR7u0Rx+ZClDXuj9vYODauDg980ED5aD+4PhGa54iZPA7YO6nsfsJJlWm9C4fSNzVPXdG5Tx4/h7zsxEf1Ch1XMBG70ZH+JPDR5t36i96suYSUzABFekjeDgnzrb/qKut8ZVFhdh1f5cFFuUnk3T1Ty1XX5XCywRu/HbbWPDCuTmxmohpt4ZF6iq3y+YT4TWQ+MbufY60gS152EtNL+SLvosApN5CRve52+J+KhnLN9avL0UerIgKp5LAOhrWfjor33BivRU/xzxz/pS9JP9rQ149s8kVBWnMAngXK95hpl0N670Jbn/JmFHeQssPZyGz+cXw+SdiYRenc77F7sFucMEJzP5VrksNem3FDa+e1Atp4FrjuS9Wu4WS+M1x19c0nyvjd4aDrVPKb1DfHJau4/6dp+J+9yTss1FFMri3IMHVYhH2LGP6vxegw1oHq0kw47Dlp/bR209y5g5Zs1iryeGZjBUBnEtc5jzQm+K3FQjEOHlaaTeeqdZ3QjiNzBbpzBW0At7+LpFmLDDR0CokEfsNr7zMp8k3P17UDXM81nObb1y/g5L/WG6rU8jg6raRXI+XvRcTncHb9C45/V1RsHH9U+B75c2ymslgHNNcxse4J7JjmG78QgrOw9nvwug7bvkXQsN/C2M+54M0HPj+HGQ9juAVaikzaR8P2S/ZhZtwwm/mxd9kNP2wg+GQ2ul8cYELfK91D/8MY/ydmAbJ4sjisa2weAOI9baSDtdgGrQ2ZdLx9S3op6BlZ2GcTGQHrv7clq3VFmCK1m2vsD5nYWaQdT5CesXmAV8GczqYvpEz0+VUnfRn+ykvzsPR/z7oJ348k0EddixkxIWo6FXcBqXG8dXifhzSzIDNrmj0XnAXDuYO6sW4OVnBdDBWruywya/IJFtvtxvU5ufdrOtDcdyj49OR8Y60Bbf+6VLfEMgXqAVUh3fUDc+ubK1OPgZ/OHh5X5JZ7j4984Rtp+d/lYQez54cfG5+mpDPVJuAtY2ZtKe9dnhsPNlt0uS1w+kGfkNu/Qu7kBgZcp3bw1b7TZmwYitdxmcjLcZO3dbRNlGx1Wkt96sBpeTc7m9zSVr7TvLAVqkxJ3wojiSSgPdFiF8pbjWh+TCfr2nPH0UfrVWGf9mf94L4zHtL63l0Otc93DShvoBFBWQA1WUsee7+29F1htB8Nxhucu0VrtY2fl245JWFkNj777n1n4vsiAtYaZ+Ld9ulJB5TwRH82rRfmuYaX79GoGduXPRbaeLk9e9hxhlXAXys0knUkGQPN1TfkbK/lJHu1R1iwhLctDhFWC8AlV9cHu8qE9CYXAJsdtCv7gOs0EYX/DUXJHfoL39XSXiERz6W928Fre15MDvf+Z2bl8xvJoJpL2v98JfNXd+tvyHR1WofFPn6gvf9emfQSyeLmFlD1HWJ28G2WGoAJn/nbLVnQrtgyMWl17/mRKTav18mSld5RlEuGLuH1qGmfyclw/h/3tJXRYbfvV8OpOJDTN5Zi5LvVHb7f90A5+8i51fc9R9pFhNY5h+9q6Ohutpz/ulbFCdDevafnP7mvjohwz50GfjOGXAaVz+Gbc3Z8+0wkZTViVHSZCnklHCLUcmliEvV7P8kNxWx1Hh5XoIv1gq+/276tsGXnaGiF3bPCU+sh9DhlW2jKr9SP0Lvfevfte+qJfH9kjuR54WB01y117PzNo3jO59fkenqz0JaT7A9botfbBrz84Lr9s0dqPUPs9wEpy1wYtfxCTfXeioT81+x6t95EHQmRY+cu1mjfuMX85V7s/t0/Vo1fIHsl1wMPKJDgvO4QGssH8uKk/o5hMmX6sU+qO9d2Op5mJfKwHWI2TBDNDN/+f1Ti4DbfYjiSdxnrldkSzTCH/T1LgJ52QfOsFVqKZDNZhAI2/o+lqO/ozAky2zb58NmX/5wL5LNl+VjXN4KWMGwNpGxlWsuIwTihCY5+AZhz/pGyMrt6YavvoDf2LZyZvWaJ0n0hiLrhFGTHDDALyw6jTyweUlpfUW706GOy065BjPcAqlPvR467XMT4fjV+yvMkddO0/dN3SR2y/knfZD5U9cly0QPYPGVauzuKHua8Ojn9ujJ63u4JVz0Lnyv1PglUuzVrE6RFWLXRCaLMXWCFo1TIHwqql+ifaJqxOiNagCmHVQPSTTRJWJ4WrXI2wqix4anOEVaqCdeoTVnV0ztEKYZVDxfIxCKvyGmdtgbDKKmexYIRVMWmzByassktaJCBhVUTWckEJq3La5oxMWOVUs2wswqqsvrmiE1a5lKwUh7CqJHRiM4RVooAVqxNWFcVOaIqwShCvRVXCqoXqx9skrI5r1qoGYdVK+WPtElbH9GpemrBqbkFUAoRVlEwQhQgrCBvuJkFY3ZUIqwBhheVHKBvCKqQM3nHCCs8TLSPCSlMF+BhhBWyOkxph5YgBvklYgRs0pUdY9eHTnCVhNUsBvUFYQduzSo6wWskBu0NYwVqjJ0ZY6bqgHSWs0BwJ50NYhbVBOkNYIbkRkQthFSESQBHCCsCEyBQIq0ihGhcjrBobcLR5wuqoYm3KE1ZtdD/TKmF1RrX6dQir+pontUhYJclXrTJhVU3q5IYIq2QJqwQgrKrInK8RwiqfliUjEVYl1c0bm7DKq2epaIRVKWULxSWsCgmbOSxhlVnQguEIq4LiZgxNWGUUs0YowqqGyultEFbpGtaKQFjVUjqtHcIqTb/qtQmr6pKfapCwOiVbk0qEVRPZDzdKWB2WrG0Fwqqt/rGtE1axSrUvR1i19yAmA8IqRiWgMoQVkBk7qRBWO+KAnSKswAwJpENYBYRBPUxYoTqzzouwWuuBvEdYIbuz5EZYLVp0sUVYdWHTF8KqD58kS8KqD68Iqz58mrMkrGYpoDcIK2h7VskRVis5YHcIK1hr9MQIK10XtKOEFZoj4XwIq7A2SGcIKyQ3InIhrCJEAihCWAGYEJkCYRUpVONihFVjA442T1gdVaxNecKqje5nWiWszqhWvw5hVV/zpBYJqyT5qlUmrKpJndwQYZUsYZUAhFUVmfM1Qljl07JkJMKqpLp5YxNWefUsFY2wKqVsobiEVSFhM4clrDILWjAcYVVQ3IyhCauMYtYIRVjVUDm9DcIqXcNaEQirWkqntUNYpelXvTZhVV3yUw0SVqdka1KJsGoi++FGCavDkrWtQFi11T+2dcIqVqn25Qir9h7EZEBYxagEVEY61tvz129AKTEVRQHCShEF9BBhBWqMl9YMq/en4ZfM2vnC1cB0quvX3+KV2aZfsPfr29PDz3fxih7BemRWKa6XRzP2sU9B+2S8kj71NPz6Ijsf//w1yIyQL0wNxB8ZBP+9Xv6mV5geSd8Rb95fLt/FK/YlXJ+MVy///Y+ZWHD8gx/3ZUVJvPoiA6D31MVdQAW4DAhoipKSDIQyAVRO8RCYAlwGBDMkkM68DEhYBRQCO2weh/mZFZgr23QIq60mqEcIK1Rn1nkRVms94PcIK3iLTIKEVR8+SZaEVR9eEVZ9+DRnSVjNUkBvEFbQ9qySI6xWcsDuEFaw1uiJEVa6LmhHCSs0R8L5EFZhbZDOEFZIbkTkQlhFiARQhLACMCEyBcIqUqjGxQirxgYcbZ6wOqpYm/KEVRvdz7RKWJ1RrX4dwqq+5kktElZJ8lWrTFhVkzq5IcIqWcIqAQirKjLna4SwyqdlyUiEVUl188YmrPLqWSoaYVVK2UJxCatCwmYOS1hlFrRgOMKqoLgZQxNWGcWsEYqwqqFyehuEVbqGtSIQVrWUTmuHsErTr3ptwqq65KcaJKxOydakEmHVRPbDjRJWhyVrW4Gwaqt/bOuEVaxS7csRVu09iMmAsIpRCagMYQVkxk4qhNWOOGCnCCswQwLpEFYBYVAPE1aozqzzIqzWeiDvEVbI7iy5EVaLFl1sEVZd2PSFsOrDJ8mSsOrDK8KqD5/mLAmrWQroDcIK2p5VcoTVSg7YHcIK1ho9McJK1wXtKGGF5kg4H8IqrA3SGcIKyY2IXAirCJEAihBWACZEpkBYRQrVuBhh1diAo80TVkcVa1OesGqj+5lWCaszqtWvQ1jV1zypRcIqSb5qlQmralInN0RYJUtYJQBhVUXmfI0QVvm0LBmJsCqpbt7YhFVePUtFI6xKKVsoLmFVSNjMYQmrzIIWDEdYFRQ3Y2jCKqOYNUIRVjVUTm+DsErXsFYEwqqW0mntEFZp+lWvTVhVl/xUg4TVKdmaVCKsmsh+uFHC6rBkbSsQVm31j22dsIpVqn05wqq9BzEZEFYxKgGVIayAzNhJhbDaEQfsFGEFZkggHcIqIAzqYcIK1Zl1XoTVWg/kPcIK2Z0lN8Jq0aKLLcKqC5v4Q7Z92GSyJKz6MIuw6sOnOUvCapYCeoNPVtD2rJIjrFZywO4QVrDW6IkRVrouaEcJKzRHwvkQVmFtkM4QVkhuRORCWEWIBFCEsAIwITIFwipSqMbFCKvGBhxtnrA6qlib8oRVG93PtEpYnVGtfh3Cqr7mSS0SVknyVatMWFWTOrkhwipZwioBCKsqMudrhLDKp2XJSIRVSXXzxias8upZKlqXsDJJv1y+y4Dw8c9fg30vJRJS3M8MK99X8VZeSPrH5tIjrN6ev34z99fTw883eV0vj3Id2jWLV7bfWZ+0d6PDy+X7+8vl+7/Xy9+heFobtY6hwipW41o6tW7HjA/PDz++yI3UOpnY9k2Hul4+3rwXYkeIvabYcp8ZVnIP+p7Kvgx0sfqglDODtHSsDv6N/Wm4adqPx4abwMu9FBngw+W3fdOWfX8afrlxELZRYfV2HV6tbvvv4t3wKtrKhANB0xI59Amr69ffmnmIHSG3aZ8ZVu8hX69ff+fWsXS8HmAlnT9+QBQADa92QngaVoBe9g+r9eTgs46D3cFKOosGqvHYcJML2huIxg56eZSZogyO80tmJdfL4736e7FrnOsJVpKrAZBo/fzwww50mk6yhPR2Dc/u9+pq8Vofk3zlmlvnEWp/7AexM3d3MBxuElNm8OF+6JZfb8v9EMqp1XFUWJm+460exWoeuvfsfSlA623sk3vWXFcvy4DTWvpmCdAx8TF008d2sJDRobg1j0tuPTzqazPvPV3Nde11TG8ZqqbmZ9qyg8KZujXqnB8Ih1fJT67P6XN7/dE7N9avcY2xbfQHK5lk2Nd6MrB4stbZDPTjhNzzY1M/OH7G6lmqXH+wurOOuzdzC30mshjsGAc6OKLDSp6QQgPh3oQoVGfxZt35SnWIXHGRYaVNJBydb2bWPc28l+Nj37CfH4ZhNSz15xjuwDrc5B7JpXOOOD3Byh/fzAAeWD4Xj6w+h5Z7Qce+rmAlHcXvPOp+4EPG2CerMSZep5IbDxlWcjPtLeXZgc52IPse60uovo2D9I4NK335T/usY4TSWN4dKMOwuuzOzOUeQfJJcoGFlfIkpHkUWpWwsJI66ji5t5IRGENbetcXrFTRt59zaIaKyFPHu0mnkzKjiXrHNeYCGgYNqzufO4Vgoy/tKr4Cft4R6rxyr4lXofOtjocg44LIz80MEtL3nP4wfsborETYgc+blUtdaVNeiKCSa+0KVl4fGCd62hi2rERoE0gZ+8w9ah4AtvX37gf//qi13w2s9A/gh9v4tOUPbPoXLUKdRYzRZh5iZi0jYtvBh5UygE0DWRBWytLu5Ovmq7uInmjemYEAEFahWbgLIu16/GPSl7RB0K5KjOfi+qUfu/Z+T7Da13fpe3bJXVu18EEk96o2/qEt13YDK7mhfEGt6AHYqMsRYye7PLqdU1vPtbFrd5x77UHDSr6tIzNw8welymxN+XupEUpLJxOPrfbjk+/6nMS+pxHCeVhYBVYnjmq2DyvPM/vUdb18oA2Act2osNJXHMLazuOj00fU/qX8rZs6Bir99eh9krN8N7DaA5Jmqh3wfLHWX7LwZ372RhheETuVXAsyrFytNb+0Jyu13PREok1QpFO57aBuo8JK6ytnNCWsyt95uld2jNp7X/4eTn9qWvchvYyJr074y1+53kIXsNIeZWWZQZKXywqK7ayx28vXB0DPeGdmYuuhvH8mWI1Lu572zux7PL+dUGjQQ/HH5oEKK/Vp9cQE4DSs+AULe4vcfQ/DSvqEfW37z/iEtQBJe2qajj2Oy8LbPjY9pRFWd13yCuimDTeBmBkUxg8JNz8XIx3TC2Ue+efHZWd5wj8WejLz49Xe/0ywGjuK39nGzyGP+lrbh3vtwcJK/k5Pue8l33vX5J4Pw2oYv8Dk/sG9+UzYDK6vdoLpxmq9jboMGDOxED211QnxeP7cSvkIRbsH/GNok0JzrbLqYi+s9Y2jta/PDPxBTttfnr5sXLlg6ZjuK/S0JYOprYfy/qlgFfhii99ptvuYf1bg3iOwsAr8+Yc2sXOvRwYuFzShp2LpS269HrZ7gpU2iQ6uQDiTdX1iKGNm+AlN4iL5Bw8r6STbwUoDk34sFsLaLEa7MVqb91lgJYN5iq+IEwn33kCFlXT4cYBS+ktg+XvuG855wsp1u8y29sSkjUkhT/0JiOlz7s/MTT+Bpj0MaO2Uucr4qPiwUr+9pHQ0ZWlDBkNX9NHU7X97MJm9+Zq0dOp4KeuU/Cyw0pd2432VDlZH8XOtoMJKrmZf++FV7jHzMn3P+zxj+hx4Z7LBJ6tzt8ymViysQitD4vMmqHdgnoj446fyeb9XtfouNKwmiGw+izo6I5eOJcqun9LGn9QfbwivQ07GuaCr7kygwV5gpc7WnK/CaueP+ur++UFArmaHkWElopzXf5wkhJ6s5P5sJvrJhmGXAQPL5DIuCWTMK1DG9CUHOGagn/5fMXO92kTEjnvO8uFJSYtUg4ZVaMZgTJIPiu1/Ejf9qrc2EzGmTTOM/RnldlaP2PE+A6zWk4ZF96CvgadrKV+kV2QICg+rk7+ablcbgk9WEbP5DPJmDYEKq/MTivWKkoilf6N66Xt2oojcp6BhpcMnvPwT/KBx+omSI+YjPlXJTdczrOyTkHQI2zmW9+2XYdwRSfduv45bv/Y2OqxEj3EA01cVFl/cAW24yXUtdd1z4zbyYBe6Bz4frLZfQIpZpUKcnLuewcIqNHO71xl0wI3/26w+SPbV4XqAVahjzAOd8v9W3ZschLyL/QKNe9PX2O4BVqKDGQDUycO6X4j+UtZqF5qp3+uftj7S++eB1fiL965Prs76ytJUB+ybf27edtvcq4hfXTeJjd8ENP9Ror2hQkbMFyT/RYVWbzJjjitLh9N/YSADpdl+fviB9nVNe132vQdYSa4ymIkP9mWfquTcnj/2Ov138UWrZwHol2+93wusrE7TZ1CPfp+QfhfqE8Zb+2UMuyzvfE5iY6O/27EFLU97DwlkpN/vvaR/3RsbTbxprDMxvT9HQLt+Px8zdiPCyk+U+6MCvcDqT/fLDjR/ug49XD8qrHrQrmaOhFVNtTO0RVhlELFCCMKqgsiZmiCsMglZOAxhVVjg3OEJq9yKlolHWJXRtURUwqqEqvljElb5NS0akbAqKm+24IRVNimLByKsikucpQHCKouM9YIQVvW0TmmJsEpRr25dwqqu3mdbI6zOKteoHmHVSPiDzRJWBwVrWJywaij+gaYJqwNiIRQlrBBcuJ8DYXVfI5QShBWKE/t5EFb7+sCdJazgLFETIqxUWSAPElaQtmySIqw2kmAfIKyw/bHZEVZWCfx3wgrfI8mQsOrDpzlLwmqWAnqDsIK2Z5UcYbWSA3aHsIK1Rk+MsNJ1QTtKWKE5Es6HsAprg3SGsEJyIyIXwipCJIAihBWACZEpEFaRQjUuRlg1NuBo84TVUcXalCes2uh+plXC6oxq9esQVvU1T2qRsEqSr1plwqqa1MkNEVbJElYJQFhVkTlfI4RVPi1LRiKsSqqbNzZhlVfPUtEIq1LKFopLWBUSNnNYwiqzoAXDEVYFxc0YmrDKKGaNUIRVDZXT2yCs0jWsFYGwqqV0WjuEVZp+1WsTVtUlP9UgYXVKtiaVCKsmsh9ulLA6LFnbCoRVW/1jWyesYpVqX46wau9BTAaEVYxKQGUIKyAzdlIhrHbEATtFWIEZEkiHsAoIg3qYsEJ1Zp0XYbXWA3mPsEJ2Z8mNsFq06GKLsOrCpi+EVR8+SZaEVR9eEVZ9+DRnSVjNUkBvEFbQ9qySI6xWcsDuEFaw1uiJEVa6LmhHCSs0R8L5EFZhbZDOEFZIbkTkQlhFiARQhLACMCEyBcIqUqjGxQirxgYcbZ6wOqpYm/KEVRvdz7RKWJ1RrX4dwqq+5kktElZJ8lWrTFhVkzq5IcIqWcIqAQirKjLna4SwyqdlyUiEVUl188YmrPLqWSoaYVVK2UJxCatCwmYOS1hlFrRgOMKqoLgZQxNWGcWsEYqwqqFyehuEVbqGtSIQVrWUTmuHsErTr3ptwqq65KcaJKxOydakEmHVRPbDjRJWhyVrW4Gwaqt/bOuEVaxS7csRVu09iMmAsIpRCagMYQVkxk4qhNWOOGCnCCswQwLpEFYBYVAPE1aozqzzIqzWeiDvEVbI7iy5EVaLFl1sEVZd2MQfsu3DJpMlYdWHWYRVHz7NWRJWsxTQG3yygrZnlRxhtZIDdoewgrVGT4yw0nVBO0pYoTkSzoewCmuDdIawQnIjIhfCKkIkgCKEFYAJkSkQVpFCNS5GWDU24GjzhNVRxdqUJ6za6H6mVcLqjGr16xBW9TVPapGwSpKvWmXCqprUyQ0RVskSVglAWFWROV8jhFU+LUtGIqxKqps3NmGVV89S0QirUsoWiktYFRI2c1jCKrOgBcMRVgXFzRiasMooZo1QhFUNldPbIKzSNawVgbCqpXRaO4RVmn7VaxNW1SU/1SBhdUq2JpUIqyayH26UsDosWdsKhFVb/WNbJ6xilWpfjrBq70FMBoRVjEpAZQgrIDN2UiGsdsQBOxMqSkIAACAASURBVEVYgRkSSIewCgiDepiwQnVmnRdhtdYDeY+wQnZnyY2wWrToYouw6sIm/pBtHzaZLAmrPswirPrwac5SOtbb89dv8wFuQCrAJytIW9SkCCtVFriDM6zenh5+yiD4/nL5zhemBsafp+GXfbqiT5g+iS9mABSv2J+gxxPbpzj+4fYl24fMRP3p4eeX96fh17/Xy9/mgMze+YLTQPwRn6Rj0Svce9T49Pzww3jFfgTXj9yxzQyEMqng+AftkwWV+PRFOhjccx8T2ihgTOMy4EYXtANcBkRzJJyPmVy8XL6HS/AMggLzMiBhhWDH/RzsEuD9kizRUgHCqqX6x9qWCaA8YR2rxdK1FSCsaiue2B5hlShgpeqEVSWhMzRDWGUQsUIIwqqCyDmbIKxyqlkuFmFVTtvckQmr3IqWiUdYldG1WFTCqpi0WQMTVlnlLBqMsCoqb7bghFU2KesEIqzq6JzaCmGVqmC9+oRVPa1TWiKsUtRrUJewaiD6iSYJqxOiNapCWDUS/mCzhNVBwVoXJ6xaOxDXPmEVpxNCKcIKwYX7ORBW9zWCKkFYQdkRTIawCkoDd4KwgrNETYiwUmXBPUhY4XrjZkZYuWpgbxNW2P7Y7Agrq0Qn74RVH0YRVn34JFkSVn14RVj14dOcJWE1SwG9QVhB27NKjrBayQG7Q1jBWqMnRljpuqAdJazQHAnnQ1iFtUE6Q1ghuRGRC2EVIRJAEcIKwITIFAirSKEaFyOsGhtwtHnC6qhibcoTVm10P9MqYXVGtfp1CKv6mie1SFglyVetMmFVTerkhgirZAmrBCCsqsicrxHCKp+WJSMRViXVzRubsMqrZ6lohFUpZQvFJawKCZs5LGGVWdCC4QirguJmDE1YZRSzRijCqobK6W0QVuka1opAWNVSOq0dwipNv+q1Cavqkp9qkLA6JVuTSoRVE9kPN0pYHZasbQXCqq3+sa0TVrFKtS9HWLX3ICYDwipGJaAyhBWQGTupEFY74oCdIqzADAmkQ1gFhEE9TFihOrPOi7Ba64G8R1ghu7PkRlgtWnSxRVh1YdMXwqoPnyRLwqoPrwirPnyasySsZimgNwgraHtWyRFWKzlgdwgrWGv0xAgrXRe0o4QVmiPhfAirsDZIZwgrJDciciGsIkQCKEJYAZgQmQJhFSlU42KEVWMDjjZPWB1VrE15wqqN7mdaJazOqFa/DmFVX/OkFgmrJPmqVSasqkmd3BBhlSxhlQCEVRWZ8zVCWOXTsmQkwqqkunljE1Z59SwVjbAqpWyhuIRVIWEzhyWsMgtaMBxhVVDcjKEJq4xi1ghFWNVQOb0Nwipdw1oRCKtaSqe1Q1il6Ve9NmFVXfJTDRJWp2RrUomwaiL74UYJq8OSta1AWLXVP7Z1wipWqfblCKv2HsRkQFjFqARUhrACMmMnFcJqRxywU4QVmCGBdP5YWL09f/1mBv6nh59v8rpeHmWACegEcxgdVqKrvD7++Wu49zID+svlu9yEMAJnSgQNVqLxrh8HPbgb75+/hkxSFg9DWBWXOEsDfxysRjANt7fr5UN/mXOPWdQtEAQeVtfhVdc1pPfl4/1p+FVAqqYhkWAludz3RO774fX9+vW39BGpExJQBg0pGxHTxBN/ZQITitf6OGHV2oG49v8YWI0ddg9S/mA6vIo4cTLWK4UOKzPYBScCvsbjvtSpp2CdlpBgZZ52D3oiIBJf5GnMV0yO3QeV5vXwugdBv51a+4RVLaXT2ukWVnYwMLM2meU9PfwMSXEcVLajDa+hmK2Of0ZYySzd1XP06/Io3sqAaV/mqRh4hu5fg3jlHmu1PekZWEmw93rofbhJfTf36clqZ3UiFGs6DuZhb7Ay+U5PwHKP+f5svfL6kvSrl8t3t1wP293BSkQOLUFos0AxIVT+3uwQccYPDytZ8jk8ix9utrOMy7R3Brsr5gzdXoO8ywDSB6xkOc+8duCzXmXYh1VMvMvH3gDr6lhjuydYjeOf1z8CE3UzVuz2xeHWE7S6gpXAY28g1AaH/cFvuJnZuxlglTV4sBmgdNxeYWWejmRGN72mAVIGSvms5CY3orm+Ox67/iMNeP6g2gOs/P6yNxEU3+w1BmHlDZqy/Bjqs0gTwR5gZQbq8ERw8xm7+OX2lb1t/z6wPqO9dwGrqXPc/UDX7wDBTiWzDa9jiTHj2v4ILbdzIpnWJ6zWy3y+nuKTPXaokwF/1oUEq+BnTIHJmL4SMdzclQu9zGUzaIqvIWChfOmiB1gF9LZLuyvdj/QhB2KrGLY/Ir13AavgzX4dn4z+vV7+lhvfn2mrj8zywbEzS/TNkA4p5/1YfrlW+53CajXQiXair9H65fLd1dpc3/ThvvgwdrzQF2P2IdjKI3t9KDPW4KQtBCv58wNl+ci9nsDgqQ54Iyy3Hu71w5reocMq6N/kkYx/Vq/QmKf5uT62nozYeEjv8LAKLeO5HSckaKiuOziG6qIeN4N5YJBByDmkuV3uW96Xdfd7g1ZosJMBE+GatRzkHou5R7W6uY+FBru9zyu0CaK7cnEEVnI946Rj8XwcKDH8+1SwCiyjT34+mvEj9GcHympT7nsxJR4+rMxnGuubXIQ3g8H0WZMx4unhpwxqrhiTQfZReXrH6CBunke2+4XV2kN3VucP6uKtDCB2UjEuzyr1gTsXEqzk/honCWsN92ClTzqWvnMUVuKn6/kEq/mzyiN9IHdZdFgZ/6YfL9DGNPtkNU7q1h6LztpkUPdv8Te3xjniQcMq/Ei7XVKwHcHtgJqxciyHcK1ifEZY2c5mNV3PwnWvtQ5o6yO89w6rcQbuD3zLYKb1LRn0Q9qH+rI/wQzVL3m8B1jZ61/3jdEf2390jfXlPb3s5QPBD3ut/js0rPTZnd+Btvt2Rq51KMLKvwXy7p/xzJ1gSDaab3YyMr8DL4XKNfQOK93H87Dik1Wefqb1DQsrTePQeBdaGrZjZ55s80aBhpU2izCPtfKHoubvrWRpYfuVczvr1uvrM428spaL1uuTlXQa/zV6N9z8b4VpHXKG1PqD/+BMvpwDcZGRYBUamPxJgntlmgdyzJbR+t3uk5X6VeoFfjZui/eunqyUz6ROwcr8ComyagE8CewOVm6HkRt7XKf1RR87QehRV2aNoU5hBAH+cVV0WAUmCIe+CGE8nb7dKYO+GfjVwQ7rj0vde6oHWPmTBJv/2Ke2KxZuvzkKK628nVTadlu9fxZYhcY7bWlPALedAGJP5KFhpS1FaDf4tiOMv4gwziiVTjfOzjezciPGMnPZnG/Vmdx2/wRYudfrbqtfEgD5SSM3T9mGgtXBWbQ+4VhPDLZ9zvQztc9o/VgGSvtE4GtXe78rWCmTNqujPnEff+PR1TRUTjx1y6FtQ8NKmynoT1Y+kBbRQx1vXk58fvghABjLuU9o299EQzCvT1iNHcbobPWeNHeWm8xAJ4O8DB5yY7p6a/eC8XDnb+bc+rW38WDl95EtLLzJ2upbtP4kUYOV+OvrHOp/fj/269Xc7wpWy2R69sfCSjRz+tN8fnyCGl7N2GH+OyR3nFvuC82/mj7cawsaVpK82inEMPkpl8DvBLodKzyLWEwazdzuI3Uoa6S54YDXlcOdZauvq7vtKMvgNtwkluzvxtxZ0rWatXhHgtU0AfAGL/HD11gfxKScu5Qkg4b2lBsf7/IRWoJs4dVngpXo6var+O3lJ89aeBDTZgew0v4+Y3/g8ztCaFZ+38jlCS1GzBplPi2spl+B1iYnez7JQFxD96Nt9AGrO/1o+jKL9B/3+sOwioynPIG58WtvfyZYiXahZde9fuQ+ndXWP7Y9eFjJhSyz7YjOEJhpHwfW+pemYwUtXQ4dVkdhYzuQ3IjhJ4CA7wGvS3sQE/+zwMoHlVx7ymqFgCFGv5pleoKV1r800BwaMwE90fzvAlaSuBmk119b9pY1hptmmnvR0sl2l5RsfOBB8HPCavxCzAir0FKUCyxTBm7Qc+81JFgdXxoabjI7l8HBvSa7fRxW4294ukuJNhbC+2eElegq46G+XGv7Ev5/tePeH93ASpKWZM2NNX2OMX+m4S1TuBeobY+dbfsfkom5oQ6qxWlxDB1WZpB+uXyXGXnMSwZFf5IxQuvyKOeMx9PfaNmy6B7JfYEEK9PJI/2QvGPu6xhvpUxsvJg2S5XpClbTZ/Wu/nu6zN47Y6b0I/+jkr0YKOfMtcgSsj9goCTIPNYKoMNqne2fu4cEqz/Xhbgr7wlWcVf0OUsRVp35Slj1YRhh1YdPkiVh1YdXhFUfPs1ZElazFNAbhBW0PavkCKuVHLA7hBWsNXpihJWuC9pRwgrNkXA+hFVYG6QzhBWSGxG5EFYRIgEUIawATIhMgbCKFKpxMcKqsQFHmyesjirWpjxh1Ub3M60SVmdUq1+HsKqveVKLhFWSfNUqE1bVpE5uiLBKlrBKAMKqisz5GiGs8mlZMhJhVVLdvLEJq7x6lopGWJVStlBcwqqQsJnDElaZBS0YjrAqKG7G0IRVRjFrhCKsaqic3gZhla5hrQiEVS2l09ohrNL0q16bsKou+akGCatTsjWpRFg1kf1wo4TVYcnaViCs2uof2zphFatU+3KEVXsPYjIgrGJUAipDWAGZsZMKYbUjDtgpwgrMkEA6hFVAGNTDhBWqM+u8CKu1Hsh7hBWyO0tuhNWiRRdbhFUXNkH9FyF9KNYuS8KqnfZHWiasjqgFUJawAjAhIgU+WUWIBFKEsAIx4k4ahNUdgdBOE1Zojuj5EFa6LohHCStEV7Y5EVZbTaCPEFbQ9szJEVazFPAbhBW8RSZBwqoPn+YsCatZCugNwgranlVyhNVKDtgdwgrWGj0xwkrXBe0oYYXmSDgfwiqsDdIZwgrJjYhcCKsIkQCKEFYAJkSmQFhFCtW4GGHV2ICjzRNWRxVrU56waqP7mVYJqzOq1a9DWNXXPKlFwipJvmqVCatqUic3RFglS1glAGFVReZ8jRBW+bQsGYmwKqlu3tiEVV49S0UjrEopWyguYVVI2MxhCavMghYMR1gVFDdjaMIqo5g1QhFWNVROb4OwStewVgTCqpbSae0QVmn6Va9NWFWX/FSDhNUp2ZpUIqyayH64UcLqsGRtKxBWbfWPbZ2wilWqfTnCqr0HMRkQVjEqAZUhrIDM2EmFsNoRB+wUYQVmSCAdwiogDOphwgrVmXVehNVaD+Q9wgrZnSU3wmrRoostwqoLm/j/WfVhk8mSsOrDLMKqD5/mLAmrWQroDT5ZQduzSo6wWskBu0NYwVqjJ0ZY6bqgHSWs0BwJ50NYhbVBOkNYIbkRkYt0rLfnr98iirJIQwUIq4biH2yasDooWKPiM6xkxv7xz1+DdDK+MDUQf96eHn5K56JXmB5J3xFv3l8u38Ur9iVcn4xXL//9j/jE8Q/bJ/FKJuni1Zf3p+GXmWE8P/wQ4/jC08D4c/36m17heeP3FzMAilfsS9BjielTT8Mv9qlO+tTT8OvLv9fL342e7tjsAQWkc3EZ8IBgjYrKTFBA1ah5NntAAQOsl8v3A1VYtIEC8zIgYdVA/RNNygBIWJ0QrnIVwqqy4AnNEVYJ4lWsSlhVFDtHU4RVDhXLxyCsymucqwXCKpeSZeMQVmX1zR6dsMouaZGAhFURWYsEJayKyJo9KGGVXdKyAQmrsvrmik5Y5VKyfBzCqrzGOVogrHKoWDEGYVVR7ISmCKsE8SpXJawqC36yOcLqpHCtqhFWrZQ/1i5hdUyvlqUJq5bqx7dNWMVrBVGSsIKw4W4ShNVdiWAKEFYwVuwmQljtyoN3krDC80TLiLDSVME8Rlhh+uJnRVj5ioDvE1bgBk3pEVZ9+CRZElZ9eEVY9eHTnCVhNUsBvUFYQduzSo6wWskBu0NYwVqjJ0ZY6bqgHSWs0BwJ50NYhbVBOkNYIbkRkQthFSESQBHCCsCEyBQIq0ihGhcjrBobcLR5wuqoYm3KE1ZtdD/TKmF1RrX6dQir+pontUhYJclXrTJhVU3q5IYIq2QJqwQgrKrInK8RwiqfliUjEVYl1c0bm7DKq2epaIRVKWULxSWsCgmbOSxhlVnQguEIq4LiZgxNWGUUs0YowqqGyultEFbpGtaKQFjVUjqtHcIqTb/qtQmr6pKfapCwOiVbk0qEVRPZDzdKWB2WrG0Fwqqt/rGtE1axSrUvR1i19yAmA8IqRiWgMoQVkBk7qRBWO+KAnSKswAwJpENYBYRBPUxYoTqzzouwWuuBvEdYIbuz5EZYLVp0sUVYdWHTF8KqD58kS8KqD68Iqz58mrMkrGYpoDcIK2h7VskRVis5YHcIK1hr9MQIK10XtKOEFZoj4XwIq7A2SGcIKyQ3InIhrCJEAihCWAGYEJkCYRUpVONihFVjA442T1gdVaxNecKqje5nWiWszqhWvw5hVV/zpBYJqyT5qlUmrKpJndwQYZUsYZUAhFUVmfM1Qljl07JkJMKqpLp5YxNWefUsFY2wKqVsobiEVSFhM4clrDILWjAcYVVQ3IyhCauMYtYIRVjVUDm9DcIqXcNaEQirWkqntUNYpelXvTZhVV3yUw0SVqdka1KJsGoi++FGCavDkrWtQFi11T+2dcIqVqn25Qir9h7EZEBYxagEVIawAjJjJxXCakccsFOEFZghgXQIq4AwqIcJK1Rn1nkRVms9kPcIK2R3ltwIq0WLLrYIqy5s4g/Z9mGTyZKw6sMswqoPn+YsUWElHf7t6eHn+8vl+72XLStPH/bC3p6/fvv3evn7Xl2pIzetrYf6zicrVGe2eX1GWMn995n6k7hGWG3vXegjuLAaXt+ul48jr/fr199W7LfrcIuvO9ykrnRGWx/tnbBCcyScz2eE1dv1SH+UvmfKP4ZVan+ma1h9/PPXIINCexnrZYAKK4FHPGws1IZXq9yxzmXrXz5c4NlYCO+EFYILcTl8Rlid64/Sr4ZX1JWLbmEloFpm48OrmPP+NPySGy90i8pSk5QZjTSzCTOjMMdeLt9D9ZCOw8Jq1P7Qk5V0DKvtWVgZQD49/LRxUN57gZUMAGa5SOsX0qeeH37sDV62T43+rftULxNJZFhZ6JjxTfyQSeHTw0/tJeOY1dzWOz6BvHxIHJR+5ObRLaxEUN2IZQB0LzTGPCmz1zHdeK22PxmsblZHHVbDzUwkVgPp8lS1+K97bmO3eO8BVmbAi1q6HW4CJV/HmD4lbfj10PZRYSVj0TIh1+777TELGt0bpz+Z8TO0VDjcEMfBLmElH8IvA9XaMDHJ7wy6cet6Szzcx2C5rr5gNdymAfFR8jYvAc8Cn3nJQfPIdjzXT62cdGh50nbLtd5Gh5XAZ7nnQ31hfdzO2s19GJwsrutIG5qPrf1x24eF1Wr1aKur5p/VWt798+rYqJSTeq7XrlYtt7uElT4LH820ZllR5Ub0Tbu378ewsRDeO4PVvMx3TzsVQsqsXOuEBlZg3xBEh1XKrF2uTetDcm9O5x79JwLEwc/ek6iwOjOhsE+yWj/RxjUznihP14h+dQerkLi28/iGaIOgW0YzVWKhzdRtx0KFVWhJSZ6C7RdhpAPI5yP2MxIZJObrUr6gId65dYNtKE/TNm6rd7lW8apV+zHtLpO+cXlomtgJaALf7ByXW7WVDX/WrvTT2euY3GqWgYXVaqJtv7E3vEo/0MY18c3qpo9rw6vcl/Y1eiRx109tvpc2Zuv3rmAlA9dqxiYfNHpfeXZBpM8eF0Ot+Lrxy0BqyyG89wYrvyO4+65XAQ8ivrAx3KTzIXjj5tADrERzeUk/cXOXbR1YY9/RZ/zrz7X8wRL5zwxQYWUG55fLd7mXfI98faVfuf1AO+/2vd1t5fNJ//5osW/0kAkg8s1khVkNaE8PP0d4ebMC55sscnE+zNzZxxxXWbd1B1JbDuEdFVbKTPouaKSO1TShc0HO2HuAldVee9eeYt0+ocNs/FOCrZeYH9jb60aFlc3Pf9eebMUvt5zm3y6g7NOVF8eN2Xq7G1itxR/Mt8hkQPANcDuUiKt1KjHbCr95WptM8+PY8q3fUWG19mc9gfA9cvZn0GwHuNgY6xl9a39s+73DajUxtAOZM+MO9RvHW3eyMvts9UF67w1W2zFtOxk42R+NZ+74iORTF7CSm8ntBHZGLk+D7nHZ9iETGgTNEoh5otqu2WpxUExDhZXJyw5qke9up9B9Gn+pwnhlPtPSvdKellv71TOstJm736+mVYvAZ1vLREO8a+3FvfZ7gpXaz5SnoRCsbF+S9y30rG9b+N3TsMZ5eFhtOo5jjA8xDTJTp9p8iOhDbrPvtFPDiNg2UGGld47pg3v5QHj6yrqUG8E0fthrr3vsPLazjO/aQKdD7fLhgs/GbPneK6z0J6btn3OEB7q1h1O/4pNVhpsxNJbJveaH1/qJ1p/0fms8hPMMHlbrTjEu+cjANM4wtG8tLb9mYQ2cOqAyC7TfsNl2MLTBz14LKqy0znHkiUeFlfP5o71+6ZibiYU8yYFNLnqF1bq/Sb/YfoHFn92Ld6ZPKt/otF5pA6r1tPV7L09WGlg0AImeWn/UyoYAKPVb++K33xmstlCxncF/18Q232KaZvayhGguXu1g228M+sK12u8MVrt/rCuTCKsjYWWVaPe+9WD7RCXZrcut/yBboOX3RbMPNplwVe4GVt43n/d0Jaxchyttb2d6ccDSYOWnrBk6dTS4R2Cbe1+wMjPzV9FZBjj3Zb+lKdcj16b5LOXtddv3kGdo32bt6ckqvPJweZRz5qlp+q9fzP7q27Pbid0aZmN/1by0nrZ+7wFW2kceZqxyvvTi6qh5oK10hPqT7ZduzNbb8E9Wi5iy5Ld5BT+LknquuGaQdz4vmaDkfmNp/CaMMkC6cVpvw8JKfUKNmliYiYEGq9GjlecBv9ez+9YeSfvosDLLP9IfDvom5c096HyJxp0oTODb+sQnq6TbUvcpfN/r5c3kcfrvQEy/2vo0+Yq4bAsPqz2HNUN8SNn6diYfgpQcl3i2POr7p4PVNDOM8SfoHeBACA8r/w/sHfgEdZ76iAGdtyQlfWecWAa+sRl4AkDoZ+hPVpreo0fbp1qrZ3jyd38CGRpDbexW713DSjMkJPTYkcJGCQRamXCkXVRYaV7sDXr2nMzE5frPwirk9xFNS5RFh5VcszbZs76E3u2ETvuzkVAdtC+/+H6jw0r/xZD9yfXZ/mj99TVC2O8dVpvH2JDY+ge/46+CiwgIZsTkgAqrMwOfAMpe81FYSXviqa2P9t4DrJZvl9lvxS7fpDX6Op81Wn/c/jUOorKcFJoEDjdkj+w9gw4ruZes/iutd1YUjsPK+Aj7Wb141TWsJHmZma9eO+AxH1I+PfyUWaHcAPZm7ekdFVaqF743zr4MYq4HUl8GPzOpkP++QnnZc1IW3bMeYDV7Fqmn9Bv38ynrwTiYXh4N/ORzsOnX1+159Hd0WIl+s1dOH9rT9bP1J6uB3Ftd/Dbgnjl/yjlUWP0p+sdeZw+wir2Wz16uB1h9dg9irk8ATFjFKAVShrACMeJOGoTVHYGAThNWQGbspEJY7YiDeIqwQnRlmxNhtdUE9QhhherMOi/Caq0H/B5hBW+RSZCw6sMnyZKw6sMrwqoPn+YsCatZCugNwgranlVyhNVKDtgdwgrWGj0xwkrXBe0oYYXmSDgfwiqsDdIZwgrJjYhcCKsIkQCKEFYAJkSmQFhFCtW4GGHV2ICjzRNWRxVrU56waqP7mVYJqzOq1a9DWNXXPKlFwipJvmqVCatqUic3RFglS1glAGFVReZ8jRBW+bQsGYmwKqlu3tiEVV49S0UjrEopWyguYVVI2MxhCavMghYMR1gVFDdjaMIqo5g1QhFWNVROb4OwStewVgTCqpbSae0QVmn6Va9NWFWX/FSDhNUp2ZpUIqyayH64UcLqsGRtKxBWbfWPbZ2wilWqfTnCqr0HMRkQVjEqAZUhrIDM2EmFsNoRB+wUYQVmSCAdwiogDOphwgrVmXVehNVaD+Q9wgrZnSU3wmrRoostwqoLm74QVn34JFkSVn14RVj14dOcJWE1SwG9QVhB27NKjrBayQG7Q1jBWqMnRljpuqAdJazQHAnnQ1iFtUE6Q1ghuRGRC2EVIRJAEcIKwITIFAirSKEaFyOsGhtwtHnC6qhibcoTVm10P9MqYXVGtfp1CKv6mie1SFglyVetMmFVTerkhgirZAmrBCCsqsicrxHCKp+WJSMRViXVzRubsMqrZ6lohFUpZQvFJawKCZs5LGGVWdCC4QirguJmDE1YZRSzRijCqobK6W0QVuka1opAWNVSOq0dwipNv+q1Cavqkp9qkLA6JVuTSoRVE9kPN0pYHZasbQXCqq3+sa0TVrFKtS9HWLX3ICYDwipGJaAyhBWQGTupEFY74oCdIqzADAmkQ1gFhEE9TFihOrPOi7Ba64G8R1ghu7PkRlgtWnSxRVh1YRN/yLYPm0yWhFUfZhFWffg0Z0lYzVJAb/DJCtqeVXKE1UoO2B3CCtYaPTHCStcF7ShhheZIOB/CKqwN0hnCCsmNiFwIqwiRAIoQVgAmRKZAWEUK1bgYYdXYgKPNE1ZHFWtTnrBqo/uZVgmrM6rVr0NY1dc8qUXCKkm+apUJq2pSJzdEWCVLWCUAYVVF5nyNEFb5tCwZibAqqW7e2IRVXj1LRSOsSilbKC5hVUjYzGEJq8yCFgxHWBUUN2NowiqjmDVCEVY1VE5vg7BK17BWBMKqltJp7RBWafpVr01YVZf8VIOE1SnZmlQirJrIfrhRwuqwZG0rEFZt9Y9tnbCKVap9OcKqvQcxGRBWMSoBlSGsgMzYSYWw2hEH7BRhBWZIIB3CKiAM6mHCCtWZdV6E1VoP5D3CCtmdJTfCatGiiy3Cqgub+EO2fdhksiSs+jCLsOrDpzlLwmqWAnqDT1bQ9qySI6xWcsDuEFaw1uiJEVa6LmhHp5g02gAAALBJREFUCSs0R8L5EFZhbZDOEFZIbkTkQlhFiARQhLACMCEyBcIqUqjGxQirxgYcbZ6wOqpYm/KEVRvdz7RKWJ1RrX4dwqq+5kktElZJ8lWrTFhVkzq5IcIqWcIqAQirKjLna0Q61tvz12/5IjJSCQUIqxKqlolJWJXRNXfUGVbvT8MvY9rzww+ZvfOFp4Hx5/r1N73C88bvL29PDz/FJ/8497G8M31KfOL4Bz/m2z71fynYqhX0skGeAAAAAElFTkSuQmCC) **BINGO HEXADECIMAL**: Fazer um Projeto em Python que desenvolva as sequintes funções (**def**): &#10139; **Criar Cartela ()** &#10139; **Conversão Decimal-Hexadecimal ()** &#10139; **Sortear Pedra ()** &#10139; **Conferir Pedra ()** &#10139; **Exibir Cartela Hexadecimal ()** &#10139; **Exibir Pontuação ()** &#10139; **Exibir Vencedor/Premiação ()** ## DESENVOLVER AS FUNÇÕES AQUI: """ # BIBLIOTECAS AQUI: import numpy import pandas # USAR O PANDAS SOMENTE NA EXIBIÇÃO: CARTELAS / NÚMEROS SORTEADOS """ FUNÇÃO: Criar Cartela (4 x 4), com a seguintes características: 1: Números Aleatórios: Intervalo entre [16, 159]; 2: Criar em Decimal (Base 10: 0, 1, 2, 3, 4, 5, 6, 7, 8 e 9) 3: NÃO pode ter NÚMEROS REPETIDOS na cartela. Caso seja sorteado um número repetido, o sorteio deve ser refeito até sair um número que ainda não foi sorteado na partida. 3: PARÂMETRO NOMINAL: Inserir (de forma OPCIONAL) o Nome do Jogador na Cartela. """ def criarCartela(nominal = False): # FUNÇÃO: Conversão Decimal-Hexadecimal () # FUNÇÃO: Sortear uma (1) Pedra: RANDOM DECIMAL: [16, 159] # FUNÇÃO: Conferir Pedra # FUNÇÃO: Exibir Cartela Hexadecimal: 4 x 4 # FUNÇÃO: Exibir Pontuação # FUNÇÃO: Exibir Vencedor/Premiação # Premiação: R$ 100 - Cada pedra sorteada antes do Vencedor + R$ Maior Número (Decimal) da Cartela. """## DESENVOLVER A INTERFACE AQUI:""" opcao = 0 TAMANHO = 4 cartela1 = numpy.zeros((TAMANHO, TAMANHO), dtype=int) cartela2 = numpy.zeros((TAMANHO, TAMANHO), dtype=int) cartela3 = numpy.zeros((TAMANHO, TAMANHO), dtype=int) while True: print('BINGO HEXADECIMAL - MENU:') print('Opção 1: Criar/Exibir Cartela: ') print('Opção 2: Sortear/Exibir Pedra') print('Opção ?: ... desenvolvida pelo grupo') print('Opção 0: Sair do Programa') opcao = int(input('Qual a sua Opção: ')) if opcao == 0: print('TCHAU!!! - BOA SORTE') break elif (opcao != 1 and opcao != 2): print('Opcao Incorreta. Escolha de novo.') else: # Usar as Funções (def) a partir aqui: opcao = 1 """## DICAS PARA EXIBIR MELHOR A CARTELA / NÚMEROS SORTEADOS: &#10139; **IMPORTANTE**: USAR O PANDAS **SOMENTE** NA EXIBIÇÃO. """ # SEM FORMATAÇÃO, bem feio!!!: :-( # Usar a CRIATIVIDADE DO GRUPO !!! / Pesquisa para EXIBIR A CARTELA (EM HEXADECIMAL): # Por exemplo: Pesquisar a Biblioteca de Plotagem Gráfica do Python: matplotlib import matplotlib.pyplot as plt cartela1 # USAR O PANDAS SOMENTE NA EXIBIÇÃO: # Usar a CRIATIVIDADE DO GRUPO !!! / Pesquisa para EXIBIR A CARTELA (EM HEXADECIMAL): cartela1 = pandas.DataFrame(cartela2, index=['LINHA 1', 'LINHA 2', 'LINHA 3', 'LINHA 4'], columns=['COLUNA A', 'COLUNA B', 'COLUNA C', 'COLUNA D']) cartela1 """## ATENÇÃO - PROBLEMA :-| : O método RANDINT repeti números já sorteados. &#10139; **IMPORTANTE**: Temos que resolver este problema ? Criar Função Nova !!! """ def sortearSemRepeticao(_dataset): # Criar uma função que crie um conjunto de dados (dataset), sem valores repetidos !!! # Inserir no dataset, somente números não repetidos dentro do intervalo [INICIO, FIM] boaSorte = 0 """ ---> PROBLEMA: O método RANDINT repeti números já sorteados. **IMPORTANTE**: Como resolver este problema ? Criar Função Nova !!! """ import numpy INICIO = 0 FIM = 10 TAMANHO = 10 sorteados = numpy.random.randint(INICIO, FIM, TAMANHO) # Intervalo: [0, 9] sorteados """# Referência Bibliográfica: <div class="hint"> <b>APRENDA+ :</b><br/> &#10139; Site oficial <b>Python</b>: <a href="https://www.python.org/">Link</a><br/> &#10139; Dica 1: Data Science: <b>Biblioteca Machine Learning: scikitlearn</b>: <a href="https://scikit-learn.org/stable/">Link</a><br/> &#10139; Dica 2: Data Science: <b>Biblioteca Plotagem Gráfica: matplotlib</b>: <a href="https://matplotlib.org/3.1.1/index.html">Link</a><br/> &#10139; Dica 3: Data Science: <b>Biblioteca Estrutura de Dados Tabular: pandas (dataframe)</b>: <a href="https://pandas.pydata.org/pandas-docs/stable/index.html">Link</a><br/> &#10139; Dica 4: Data Science: <b>Introdução à Biblioteca: pandas (dataframe)</b>: <a href="https://colab.research.google.com/notebooks/mlcc/intro_to_pandas.ipynb">Link</a><br/> &#10139; IDE JUPTER: <b>Pacote Anaconda (usar Python Offline)</b>: <a href="https://anaconda.org">Link</a><br/> &#10139; IDE PYTHON: <b>PyCharm (usar Python Offline)</b>: <a href="https://www.jetbrains.com/pycharm/">Link</a><br/> &#10139; Sistema Numérico Computacional: <b>DECIMAL-HEXADECIMAL ???</b>: <a href="https://pt.wikipedia.org/wiki/Sistema_de_numera%C3%A7%C3%A3o_hexadecimal">Link</a><br/> </div> """
170.184049
22,224
0.909156
1,370
27,740
18.40438
0.641606
0.002221
0.001904
0.00349
0.079004
0.073689
0.061712
0.008646
0.004997
0.004997
0
0.123915
0.036193
27,740
163
22,225
170.184049
0.819158
0.034607
0
0.111111
1
0
0.242345
0
0
1
0
0.01227
0
0
null
null
0
0.111111
null
null
0.194444
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
null
1
0
1
0
1
0
0
0
0
0
0
0
0
7
b355e128f342934d54ecfdeff6d784bbfa05ba72
1,908
py
Python
assignment01b.py
Vivikar/pythoniasa19fall
b9e26b0e01afdfad694246fffa241570a51f4791
[ "MIT" ]
2
2019-12-26T22:31:13.000Z
2019-12-27T07:32:35.000Z
assignment01b.py
alina0501/pythoniasa19fall
e9e1b7249cb7488f1185fa46d2d7ea28bc2bc593
[ "MIT" ]
1
2019-10-27T11:08:32.000Z
2019-10-27T11:08:32.000Z
assignment01b.py
alina0501/pythoniasa19fall
e9e1b7249cb7488f1185fa46d2d7ea28bc2bc593
[ "MIT" ]
25
2019-09-10T11:18:03.000Z
2019-12-10T16:04:19.000Z
""" Assignment 1-B (optional) ========================= This assignment is similar to 1-A except that the poem is in Russian now. >>> print(poem()) Вот дом, который построил Джек. --- А это пшеница, Которая в тёмном чулане хранится В доме, который построил Джек. --- А это весёлая птица-синица, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. --- Вот кот, Который пугает и ловит синицу, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. --- Вот пёс без хвоста, Который за шиворот треплет кота, Который пугает и ловит синицу, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. --- А это корова безрогая, Лягнувшая старого пса без хвоста, Который за шиворот треплет кота, Который пугает и ловит синицу, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. --- А это старушка, седая и строгая, Которая доит корову безрогую, Лягнувшую старого пса без хвоста, Который за шиворот треплет кота, Который пугает и ловит синицу, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. --- А это ленивый и толстый пастух, Который бранится с коровницей строгою, Которая доит корову безрогую, Лягнувшую старого пса без хвоста, Который за шиворот треплет кота, Который пугает и ловит синицу, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. --- Вот два петуха, Которые будят того пастуха, Который бранится с коровницей строгою, Которая доит корову безрогую, Лягнувшую старого пса без хвоста, Который за шиворот треплет кота, Который пугает и ловит синицу, Которая часто ворует пшеницу, Которая в тёмном чулане хранится В доме, который построил Джек. <BLANKLINE> """ def poem(): return '' if __name__ == '__main__': import doctest doctest.testmod()
24.151899
73
0.76782
279
1,908
5.222222
0.297491
0.092656
0.117364
0.109815
0.807824
0.792038
0.792038
0.792038
0.792038
0.792038
0
0.001248
0.159853
1,908
78
74
24.461538
0.907673
0.944444
0
0
0
0
0.081633
0
0
0
0
0
0
1
0.2
true
0
0.2
0.2
0.6
0
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
1
0
0
1
1
0
0
10
b360a45e2ac31a6482eea3211090bf9970ecb205
327,678
py
Python
code/python/QuotesAPIforDigitalPortals/v2/fds/sdk/QuotesAPIforDigitalPortals/api/instrument_api.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
6
2022-02-07T16:34:18.000Z
2022-03-30T08:04:57.000Z
code/python/QuotesAPIforDigitalPortals/v2/fds/sdk/QuotesAPIforDigitalPortals/api/instrument_api.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
2
2022-02-07T05:25:57.000Z
2022-03-07T14:18:04.000Z
code/python/QuotesAPIforDigitalPortals/v2/fds/sdk/QuotesAPIforDigitalPortals/api/instrument_api.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
null
null
null
""" Prime Developer Trial No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from multiprocessing.pool import ApplyResult import typing from fds.sdk.QuotesAPIforDigitalPortals.api_client import ApiClient, Endpoint as _Endpoint from fds.sdk.QuotesAPIforDigitalPortals.model_utils import ( # noqa: F401 check_allowed_values, check_validations, date, datetime, file_type, none_type, validate_and_convert_types ) from fds.sdk.QuotesAPIforDigitalPortals.exceptions import ApiException from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object10 import InlineObject10 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object11 import InlineObject11 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object12 import InlineObject12 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object13 import InlineObject13 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object14 import InlineObject14 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object15 import InlineObject15 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_object9 import InlineObject9 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20042 import InlineResponse20042 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20043 import InlineResponse20043 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20044 import InlineResponse20044 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20045 import InlineResponse20045 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20046 import InlineResponse20046 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20047 import InlineResponse20047 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20048 import InlineResponse20048 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20049 import InlineResponse20049 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20050 import InlineResponse20050 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20051 import InlineResponse20051 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20052 import InlineResponse20052 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20053 import InlineResponse20053 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20054 import InlineResponse20054 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20055 import InlineResponse20055 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20056 import InlineResponse20056 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20057 import InlineResponse20057 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20058 import InlineResponse20058 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20059 import InlineResponse20059 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20060 import InlineResponse20060 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20061 import InlineResponse20061 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20062 import InlineResponse20062 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20063 import InlineResponse20063 from fds.sdk.QuotesAPIforDigitalPortals.model.inline_response20087 import InlineResponse20087 class InstrumentApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client self.get_instrument_background_text_list_by_instrument_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20044,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/backgroundText/listByInstrument', 'operation_id': 'get_instrument_background_text_list_by_instrument', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_compliance_property_list_by_instrument_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20049,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/complianceProperty/listByInstrument', 'operation_id': 'get_instrument_compliance_property_list_by_instrument', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_composite_get_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20050,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/composite/get', 'operation_id': 'get_instrument_composite_get', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_coupon_day_count_convention_type_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20052,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/coupon/dayCountConvention/type/list', 'operation_id': 'get_instrument_coupon_day_count_convention_type_list', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'attributes', 'language', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_coupon_interest_rate_type_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20053,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/coupon/interestRate/type/list', 'operation_id': 'get_instrument_coupon_interest_rate_type_list', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'attributes', 'language', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_coupon_key_data_get_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20054,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/coupon/keyData/get', 'operation_id': 'get_instrument_coupon_key_data_get', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_coupon_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20051,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/coupon/list', 'operation_id': 'get_instrument_coupon_list', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_cross_reference_get_by_isin_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20055,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/crossReference/getByISIN', 'operation_id': 'get_instrument_cross_reference_get_by_isin', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'isin', 'attributes', ], 'required': [ 'isin', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, }, 'allowed_values': { }, 'openapi_types': { 'isin': (str,), 'attributes': ([str],), }, 'attribute_map': { 'isin': 'isin', 'attributes': '_attributes', }, 'location_map': { 'isin': 'query', 'attributes': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_cross_reference_get_by_wkn_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20055,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/crossReference/getByWKN', 'operation_id': 'get_instrument_cross_reference_get_by_wkn', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'wkn', 'attributes', ], 'required': [ 'wkn', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'wkn', 'attributes', ] }, root_map={ 'validations': { ('wkn',): { 'max_length': 6, 'min_length': 6, 'regex': { 'pattern': r'^[A-Z0-9]*$', # noqa: E501 }, }, ('attributes',): { 'max_items': 50, }, }, 'allowed_values': { }, 'openapi_types': { 'wkn': (str,), 'attributes': ([str],), }, 'attribute_map': { 'wkn': 'wkn', 'attributes': '_attributes', }, 'location_map': { 'wkn': 'query', 'attributes': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_cross_reference_history_get_by_isin_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20058,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/crossReference/history/getByISIN', 'operation_id': 'get_instrument_cross_reference_history_get_by_isin', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'isin', 'attributes', 'pagination_offset', 'pagination_limit', ], 'required': [ 'isin', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'pagination_offset', 'pagination_limit', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('pagination_offset',): { 'inclusive_minimum': 0, }, ('pagination_limit',): { 'inclusive_maximum': 500, 'inclusive_minimum': 0, }, }, 'allowed_values': { }, 'openapi_types': { 'isin': (str,), 'attributes': ([str],), 'pagination_offset': (float,), 'pagination_limit': (float,), }, 'attribute_map': { 'isin': 'isin', 'attributes': '_attributes', 'pagination_offset': '_paginationOffset', 'pagination_limit': '_paginationLimit', }, 'location_map': { 'isin': 'query', 'attributes': 'query', 'pagination_offset': 'query', 'pagination_limit': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_cross_reference_history_get_by_wkn_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20058,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/crossReference/history/getByWKN', 'operation_id': 'get_instrument_cross_reference_history_get_by_wkn', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'wkn', 'attributes', 'pagination_offset', 'pagination_limit', ], 'required': [ 'wkn', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'wkn', 'attributes', 'pagination_offset', 'pagination_limit', ] }, root_map={ 'validations': { ('wkn',): { 'max_length': 6, 'min_length': 6, 'regex': { 'pattern': r'^[A-Z0-9]*$', # noqa: E501 }, }, ('attributes',): { 'max_items': 50, }, ('pagination_offset',): { 'inclusive_minimum': 0, }, ('pagination_limit',): { 'inclusive_maximum': 500, 'inclusive_minimum': 0, }, }, 'allowed_values': { }, 'openapi_types': { 'wkn': (str,), 'attributes': ([str],), 'pagination_offset': (float,), 'pagination_limit': (float,), }, 'attribute_map': { 'wkn': 'wkn', 'attributes': '_attributes', 'pagination_offset': '_paginationOffset', 'pagination_limit': '_paginationLimit', }, 'location_map': { 'wkn': 'query', 'attributes': 'query', 'pagination_offset': 'query', 'pagination_limit': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_exchange_rate_get_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20059,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/exchangeRate/get', 'operation_id': 'get_instrument_exchange_rate_get', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'target', 'source', 'attributes', 'language', ], 'required': [ 'target', 'source', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'target': (float,), 'source': (float,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'target': 'target', 'source': 'source', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'target': 'query', 'source': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_exchange_rate_get_by_iso_code_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20059,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/exchangeRate/getByISOCode', 'operation_id': 'get_instrument_exchange_rate_get_by_iso_code', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'target', 'source', 'attributes', 'language', ], 'required': [ 'target', 'source', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'target', 'source', 'attributes', 'language', ] }, root_map={ 'validations': { ('target',): { 'max_length': 3, 'min_length': 3, }, ('source',): { 'max_length': 3, 'min_length': 3, }, ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'target': (str,), 'source': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'target': 'target', 'source': 'source', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'target': 'query', 'source': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_get_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20042,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/get', 'operation_id': 'get_instrument_get', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_get_by_notation_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20043,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/getByNotation', 'operation_id': 'get_instrument_get_by_notation', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_legal_entity_background_text_list_by_instrument_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20060,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/legalEntity/backgroundText/listByInstrument', 'operation_id': 'get_instrument_legal_entity_background_text_list_by_instrument', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_legal_entity_compliance_property_list_by_instrument_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20061,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/legalEntity/complianceProperty/listByInstrument', 'operation_id': 'get_instrument_legal_entity_compliance_property_list_by_instrument', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_mifid_get_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20062,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/mifid/get', 'operation_id': 'get_instrument_mifid_get', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'id', 'attributes', 'language', ], 'required': [ 'id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ 'attributes', 'language', ] }, root_map={ 'validations': { ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, }, 'allowed_values': { }, 'openapi_types': { 'id': (str,), 'attributes': ([str],), 'language': (str,), }, 'attribute_map': { 'id': 'id', 'attributes': '_attributes', 'language': '_language', }, 'location_map': { 'id': 'query', 'attributes': 'query', 'language': 'query', }, 'collection_format_map': { 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.get_instrument_search_basic_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20087,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/search/basic', 'operation_id': 'get_instrument_search_basic', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'search_value', 'nsins', 'asset_class', 'only_active', 'attributes', 'language', 'pagination_offset', 'pagination_limit', ], 'required': [ 'search_value', ], 'nullable': [ ], 'enum': [ 'nsins', 'asset_class', ], 'validation': [ 'search_value', 'nsins', 'attributes', 'language', 'pagination_offset', 'pagination_limit', ] }, root_map={ 'validations': { ('search_value',): { 'max_length': 200, 'min_length': 3, 'regex': { 'pattern': r'^[ -!#-&(-+--\/0-:=?-Za-z\w"]*$', # noqa: E501 }, }, ('nsins',): { }, ('attributes',): { 'max_items': 50, }, ('language',): { 'max_length': 2, 'min_length': 2, }, ('pagination_offset',): { 'inclusive_minimum': 0, }, ('pagination_limit',): { 'inclusive_maximum': 500, 'inclusive_minimum': 0, }, }, 'allowed_values': { ('nsins',): { "WKN": "wkn", "VALOR": "valor", "CUSIP": "cusip", "SEDOL": "sedol" }, ('asset_class',): { "INDEX": "index", "STOCK": "stock", "FUND": "fund", "ETF": "etf", "DEBT": "debt", "INVESTMENTPRODUCT": "investmentProduct", "LEVERAGEDPRODUCT": "leveragedProduct", "CURRENCY": "currency", "COMMODITY": "commodity", "OPTION": "option", "FUTURE": "future", "INTERESTRATE": "interestRate" }, }, 'openapi_types': { 'search_value': (str,), 'nsins': ([str],), 'asset_class': (str,), 'only_active': (bool,), 'attributes': ([str],), 'language': (str,), 'pagination_offset': (float,), 'pagination_limit': (float,), }, 'attribute_map': { 'search_value': 'searchValue', 'nsins': 'nsins', 'asset_class': 'assetClass', 'only_active': 'onlyActive', 'attributes': '_attributes', 'language': '_language', 'pagination_offset': '_paginationOffset', 'pagination_limit': '_paginationLimit', }, 'location_map': { 'search_value': 'query', 'nsins': 'query', 'asset_class': 'query', 'only_active': 'query', 'attributes': 'query', 'language': 'query', 'pagination_offset': 'query', 'pagination_limit': 'query', }, 'collection_format_map': { 'nsins': 'csv', 'attributes': 'csv', } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.post_instrument_background_text_type_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20045,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/backgroundText/type/list', 'operation_id': 'post_instrument_background_text_type_list', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject9,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.post_instrument_benchmark_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20046,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/benchmark/list', 'operation_id': 'post_instrument_benchmark_list', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject10,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.post_instrument_category_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20047,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/category/list', 'operation_id': 'post_instrument_category_list', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject11,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.post_instrument_compliance_property_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20048,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/complianceProperty/list', 'operation_id': 'post_instrument_compliance_property_list', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject12,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.post_instrument_cross_reference_list_by_isin_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20056,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/crossReference/listByISIN', 'operation_id': 'post_instrument_cross_reference_list_by_isin', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [ 'body', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject13,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.post_instrument_cross_reference_list_by_wkn_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20057,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/crossReference/listByWKN', 'operation_id': 'post_instrument_cross_reference_list_by_wkn', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [ 'body', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject14,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.post_instrument_rating_grade_list_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (InlineResponse20063,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/instrument/rating/grade/list', 'operation_id': 'post_instrument_rating_grade_list', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'body', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'body': (InlineObject15,), }, 'attribute_map': { }, 'location_map': { 'body': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) @staticmethod def apply_kwargs_defaults(kwargs, return_http_data_only, async_req): kwargs["async_req"] = async_req kwargs["_return_http_data_only"] = return_http_data_only kwargs["_preload_content"] = kwargs.get("_preload_content", True) kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) kwargs["_content_type"] = kwargs.get("_content_type") kwargs["_host_index"] = kwargs.get("_host_index") def get_instrument_background_text_list_by_instrument( self, id, **kwargs ) -> InlineResponse20044: """Background texts of an instrument. # noqa: E501 Background texts of an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20044 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_background_text_list_by_instrument_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20044, int, typing.MutableMapping]: """Background texts of an instrument. # noqa: E501 Background texts of an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20044 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_background_text_list_by_instrument_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20044]": """Background texts of an instrument. # noqa: E501 Background texts of an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20044] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_background_text_list_by_instrument_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20044, int, typing.MutableMapping]]": """Background texts of an instrument. # noqa: E501 Background texts of an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20044, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_compliance_property_list_by_instrument( self, id, **kwargs ) -> InlineResponse20049: """Compliance properties of an instrument. # noqa: E501 Compliance properties of an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20049 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_compliance_property_list_by_instrument_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20049, int, typing.MutableMapping]: """Compliance properties of an instrument. # noqa: E501 Compliance properties of an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20049 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_compliance_property_list_by_instrument_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20049]": """Compliance properties of an instrument. # noqa: E501 Compliance properties of an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20049] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_compliance_property_list_by_instrument_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20049, int, typing.MutableMapping]]": """Compliance properties of an instrument. # noqa: E501 Compliance properties of an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20049, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_composite_get( self, id, **kwargs ) -> InlineResponse20050: """Composite instrument and its components. # noqa: E501 Composite instrument and its components. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of a composite instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20050 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_composite_get_endpoint.call_with_http_info(**kwargs) def get_instrument_composite_get_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20050, int, typing.MutableMapping]: """Composite instrument and its components. # noqa: E501 Composite instrument and its components. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of a composite instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20050 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_composite_get_endpoint.call_with_http_info(**kwargs) def get_instrument_composite_get_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20050]": """Composite instrument and its components. # noqa: E501 Composite instrument and its components. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of a composite instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20050] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_composite_get_endpoint.call_with_http_info(**kwargs) def get_instrument_composite_get_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20050, int, typing.MutableMapping]]": """Composite instrument and its components. # noqa: E501 Composite instrument and its components. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of a composite instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20050, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_composite_get_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_day_count_convention_type_list( self, **kwargs ) -> InlineResponse20052: """List of day count convention types. # noqa: E501 List of day count convention types. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20052 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.get_instrument_coupon_day_count_convention_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_day_count_convention_type_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20052, int, typing.MutableMapping]: """List of day count convention types. # noqa: E501 List of day count convention types. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20052 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.get_instrument_coupon_day_count_convention_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_day_count_convention_type_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20052]": """List of day count convention types. # noqa: E501 List of day count convention types. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20052] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.get_instrument_coupon_day_count_convention_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_day_count_convention_type_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20052, int, typing.MutableMapping]]": """List of day count convention types. # noqa: E501 List of day count convention types. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20052, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.get_instrument_coupon_day_count_convention_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_interest_rate_type_list( self, **kwargs ) -> InlineResponse20053: """List of interest rate types. # noqa: E501 List of interest rate types. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20053 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.get_instrument_coupon_interest_rate_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_interest_rate_type_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20053, int, typing.MutableMapping]: """List of interest rate types. # noqa: E501 List of interest rate types. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20053 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.get_instrument_coupon_interest_rate_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_interest_rate_type_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20053]": """List of interest rate types. # noqa: E501 List of interest rate types. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20053] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.get_instrument_coupon_interest_rate_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_interest_rate_type_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20053, int, typing.MutableMapping]]": """List of interest rate types. # noqa: E501 List of interest rate types. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20053, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.get_instrument_coupon_interest_rate_type_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_key_data_get( self, id, **kwargs ) -> InlineResponse20054: """Interest rate details for selected periods of an interest-bearing instrument. # noqa: E501 Interest rate details for selected periods of an interest-bearing instrument; any other instrument yields empty values. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20054 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_coupon_key_data_get_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_key_data_get_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20054, int, typing.MutableMapping]: """Interest rate details for selected periods of an interest-bearing instrument. # noqa: E501 Interest rate details for selected periods of an interest-bearing instrument; any other instrument yields empty values. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20054 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_coupon_key_data_get_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_key_data_get_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20054]": """Interest rate details for selected periods of an interest-bearing instrument. # noqa: E501 Interest rate details for selected periods of an interest-bearing instrument; any other instrument yields empty values. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20054] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_coupon_key_data_get_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_key_data_get_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20054, int, typing.MutableMapping]]": """Interest rate details for selected periods of an interest-bearing instrument. # noqa: E501 Interest rate details for selected periods of an interest-bearing instrument; any other instrument yields empty values. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20054, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_coupon_key_data_get_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_list( self, id, **kwargs ) -> InlineResponse20051: """List of coupons for an interest-bearing instrument. # noqa: E501 List of coupons for an interest-bearing instrument; any other instrument yields empty values. The endpoint provides details regarding the coupon period, the respective interest rate, and payable amount (the latter only for instruments with a fixed nominal value). The list of coupons is generally not available for a perpetual, i.e. without a predefined maturity date, interst-bearing instrument. If there is no entitled provider supplying a full list of coupons, the list will be synthesized from summary data available from entitled suppliers (if any). Since the exact product terms are not known, e.g. the handling of holidays and weekends, the list may be imprecise. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20051 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_coupon_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_list_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20051, int, typing.MutableMapping]: """List of coupons for an interest-bearing instrument. # noqa: E501 List of coupons for an interest-bearing instrument; any other instrument yields empty values. The endpoint provides details regarding the coupon period, the respective interest rate, and payable amount (the latter only for instruments with a fixed nominal value). The list of coupons is generally not available for a perpetual, i.e. without a predefined maturity date, interst-bearing instrument. If there is no entitled provider supplying a full list of coupons, the list will be synthesized from summary data available from entitled suppliers (if any). Since the exact product terms are not known, e.g. the handling of holidays and weekends, the list may be imprecise. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20051 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_coupon_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_list_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20051]": """List of coupons for an interest-bearing instrument. # noqa: E501 List of coupons for an interest-bearing instrument; any other instrument yields empty values. The endpoint provides details regarding the coupon period, the respective interest rate, and payable amount (the latter only for instruments with a fixed nominal value). The list of coupons is generally not available for a perpetual, i.e. without a predefined maturity date, interst-bearing instrument. If there is no entitled provider supplying a full list of coupons, the list will be synthesized from summary data available from entitled suppliers (if any). Since the exact product terms are not known, e.g. the handling of holidays and weekends, the list may be imprecise. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20051] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_coupon_list_endpoint.call_with_http_info(**kwargs) def get_instrument_coupon_list_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20051, int, typing.MutableMapping]]": """List of coupons for an interest-bearing instrument. # noqa: E501 List of coupons for an interest-bearing instrument; any other instrument yields empty values. The endpoint provides details regarding the coupon period, the respective interest rate, and payable amount (the latter only for instruments with a fixed nominal value). The list of coupons is generally not available for a perpetual, i.e. without a predefined maturity date, interst-bearing instrument. If there is no entitled provider supplying a full list of coupons, the list will be synthesized from summary data available from entitled suppliers (if any). Since the exact product terms are not known, e.g. the handling of holidays and weekends, the list may be imprecise. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20051, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_coupon_list_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_isin( self, isin, **kwargs ) -> InlineResponse20055: """Translate ISIN to instrument. # noqa: E501 Translate a given ISIN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20055 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_isin_with_http_info( self, isin, **kwargs ) -> typing.Tuple[InlineResponse20055, int, typing.MutableMapping]: """Translate ISIN to instrument. # noqa: E501 Translate a given ISIN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20055 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_isin_async( self, isin, **kwargs ) -> "ApplyResult[InlineResponse20055]": """Translate ISIN to instrument. # noqa: E501 Translate a given ISIN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20055] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_isin_with_http_info_async( self, isin, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20055, int, typing.MutableMapping]]": """Translate ISIN to instrument. # noqa: E501 Translate a given ISIN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20055, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_wkn( self, wkn, **kwargs ) -> InlineResponse20055: """Translate WKN to instrument. # noqa: E501 Translate a given WKN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20055 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_wkn_with_http_info( self, wkn, **kwargs ) -> typing.Tuple[InlineResponse20055, int, typing.MutableMapping]: """Translate WKN to instrument. # noqa: E501 Translate a given WKN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20055 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_wkn_async( self, wkn, **kwargs ) -> "ApplyResult[InlineResponse20055]": """Translate WKN to instrument. # noqa: E501 Translate a given WKN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20055] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_get_by_wkn_with_http_info_async( self, wkn, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20055, int, typing.MutableMapping]]": """Translate WKN to instrument. # noqa: E501 Translate a given WKN to the respective most recent instrument identifier, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20055, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_isin( self, isin, **kwargs ) -> InlineResponse20058: """ISIN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given ISIN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20058 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_history_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_isin_with_http_info( self, isin, **kwargs ) -> typing.Tuple[InlineResponse20058, int, typing.MutableMapping]: """ISIN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given ISIN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20058 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_history_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_isin_async( self, isin, **kwargs ) -> "ApplyResult[InlineResponse20058]": """ISIN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given ISIN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20058] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_history_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_isin_with_http_info_async( self, isin, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20058, int, typing.MutableMapping]]": """ISIN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given ISIN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: isin (str): Source ISIN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20058, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['isin'] = \ isin return self.get_instrument_cross_reference_history_get_by_isin_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_wkn( self, wkn, **kwargs ) -> InlineResponse20058: """WKN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given WKN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20058 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_history_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_wkn_with_http_info( self, wkn, **kwargs ) -> typing.Tuple[InlineResponse20058, int, typing.MutableMapping]: """WKN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given WKN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20058 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_history_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_wkn_async( self, wkn, **kwargs ) -> "ApplyResult[InlineResponse20058]": """WKN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given WKN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20058] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_history_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_cross_reference_history_get_by_wkn_with_http_info_async( self, wkn, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20058, int, typing.MutableMapping]]": """WKN to instrument translation history. # noqa: E501 Retrieve the complete translation history of a given WKN to the respective instrument association from the Cross Reference Service. The results are sorted in descending order, starting with the most recent. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: wkn (str): Source WKN to be translated. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 10.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20058, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['wkn'] = \ wkn return self.get_instrument_cross_reference_history_get_by_wkn_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get( self, target, source, **kwargs ) -> InlineResponse20059: """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the identifier of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: target (float): Identifier of the target main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. source (float): Identifier of the source main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20059 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_with_http_info( self, target, source, **kwargs ) -> typing.Tuple[InlineResponse20059, int, typing.MutableMapping]: """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the identifier of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: target (float): Identifier of the target main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. source (float): Identifier of the source main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20059 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_async( self, target, source, **kwargs ) -> "ApplyResult[InlineResponse20059]": """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the identifier of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: target (float): Identifier of the target main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. source (float): Identifier of the source main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20059] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_with_http_info_async( self, target, source, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20059, int, typing.MutableMapping]]": """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the identifier of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: target (float): Identifier of the target main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. source (float): Identifier of the source main currency. See endpoint `/basic/valueUnit/currency/main/list` for valid values. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20059, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_by_iso_code( self, target, source, **kwargs ) -> InlineResponse20059: """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the ISO 4217 code of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: target (str): ISO 4217 code of the target main currency. source (str): ISO 4217 code of the source main currency. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20059 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_by_iso_code_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_by_iso_code_with_http_info( self, target, source, **kwargs ) -> typing.Tuple[InlineResponse20059, int, typing.MutableMapping]: """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the ISO 4217 code of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: target (str): ISO 4217 code of the target main currency. source (str): ISO 4217 code of the source main currency. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20059 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_by_iso_code_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_by_iso_code_async( self, target, source, **kwargs ) -> "ApplyResult[InlineResponse20059]": """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the ISO 4217 code of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: target (str): ISO 4217 code of the target main currency. source (str): ISO 4217 code of the source main currency. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20059] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_by_iso_code_endpoint.call_with_http_info(**kwargs) def get_instrument_exchange_rate_get_by_iso_code_with_http_info_async( self, target, source, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20059, int, typing.MutableMapping]]": """Retrieve an exchange rate instrument identifier. # noqa: E501 Retrieve an exchange rate instrument identifier using the ISO 4217 code of the main currencies represented by that exchange rate. An error is returned if one of the provided parameters is invalid or if no instrument is associated with the given combination of parameters. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: target (str): ISO 4217 code of the target main currency. source (str): ISO 4217 code of the source main currency. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20059, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['target'] = \ target kwargs['source'] = \ source return self.get_instrument_exchange_rate_get_by_iso_code_endpoint.call_with_http_info(**kwargs) def get_instrument_get( self, id, **kwargs ) -> InlineResponse20042: """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20042 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_get_endpoint.call_with_http_info(**kwargs) def get_instrument_get_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20042, int, typing.MutableMapping]: """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20042 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_get_endpoint.call_with_http_info(**kwargs) def get_instrument_get_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20042]": """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20042] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_get_endpoint.call_with_http_info(**kwargs) def get_instrument_get_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20042, int, typing.MutableMapping]]": """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20042, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_get_endpoint.call_with_http_info(**kwargs) def get_instrument_get_by_notation( self, id, **kwargs ) -> InlineResponse20043: """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of a notation. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20043 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_get_by_notation_endpoint.call_with_http_info(**kwargs) def get_instrument_get_by_notation_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20043, int, typing.MutableMapping]: """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of a notation. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20043 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_get_by_notation_endpoint.call_with_http_info(**kwargs) def get_instrument_get_by_notation_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20043]": """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of a notation. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20043] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_get_by_notation_endpoint.call_with_http_info(**kwargs) def get_instrument_get_by_notation_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20043, int, typing.MutableMapping]]": """Basic data for an instrument. # noqa: E501 Basic data for an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of a notation. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20043, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_get_by_notation_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_background_text_list_by_instrument( self, id, **kwargs ) -> InlineResponse20060: """Role-specific background texts of legal entities related to an instrument. # noqa: E501 Role-specific background texts of legal entities related to an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20060 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_legal_entity_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_background_text_list_by_instrument_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20060, int, typing.MutableMapping]: """Role-specific background texts of legal entities related to an instrument. # noqa: E501 Role-specific background texts of legal entities related to an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20060 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_legal_entity_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_background_text_list_by_instrument_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20060]": """Role-specific background texts of legal entities related to an instrument. # noqa: E501 Role-specific background texts of legal entities related to an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20060] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_legal_entity_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_background_text_list_by_instrument_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20060, int, typing.MutableMapping]]": """Role-specific background texts of legal entities related to an instrument. # noqa: E501 Role-specific background texts of legal entities related to an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20060, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_legal_entity_background_text_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_compliance_property_list_by_instrument( self, id, **kwargs ) -> InlineResponse20061: """Role-specific compliance properties of legal entities related to an instrument. # noqa: E501 Role-specic compliance properties of legal entities related to an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20061 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_legal_entity_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_compliance_property_list_by_instrument_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20061, int, typing.MutableMapping]: """Role-specific compliance properties of legal entities related to an instrument. # noqa: E501 Role-specic compliance properties of legal entities related to an instrument. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20061 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_legal_entity_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_compliance_property_list_by_instrument_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20061]": """Role-specific compliance properties of legal entities related to an instrument. # noqa: E501 Role-specic compliance properties of legal entities related to an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20061] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_legal_entity_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_legal_entity_compliance_property_list_by_instrument_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20061, int, typing.MutableMapping]]": """Role-specific compliance properties of legal entities related to an instrument. # noqa: E501 Role-specic compliance properties of legal entities related to an instrument. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of an instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20061, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_legal_entity_compliance_property_list_by_instrument_endpoint.call_with_http_info(**kwargs) def get_instrument_mifid_get( self, id, **kwargs ) -> InlineResponse20062: """MiFID II data for a financial instrument. # noqa: E501 MiFID II data for a specified financial instrument. The instruments governed by MiFID II are called \"investment products\". # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: id (str): Identifier of the instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20062 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['id'] = \ id return self.get_instrument_mifid_get_endpoint.call_with_http_info(**kwargs) def get_instrument_mifid_get_with_http_info( self, id, **kwargs ) -> typing.Tuple[InlineResponse20062, int, typing.MutableMapping]: """MiFID II data for a financial instrument. # noqa: E501 MiFID II data for a specified financial instrument. The instruments governed by MiFID II are called \"investment products\". # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: id (str): Identifier of the instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20062 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['id'] = \ id return self.get_instrument_mifid_get_endpoint.call_with_http_info(**kwargs) def get_instrument_mifid_get_async( self, id, **kwargs ) -> "ApplyResult[InlineResponse20062]": """MiFID II data for a financial instrument. # noqa: E501 MiFID II data for a specified financial instrument. The instruments governed by MiFID II are called \"investment products\". # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: id (str): Identifier of the instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20062] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['id'] = \ id return self.get_instrument_mifid_get_endpoint.call_with_http_info(**kwargs) def get_instrument_mifid_get_with_http_info_async( self, id, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20062, int, typing.MutableMapping]]": """MiFID II data for a financial instrument. # noqa: E501 MiFID II data for a specified financial instrument. The instruments governed by MiFID II are called \"investment products\". # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: id (str): Identifier of the instrument. Keyword Args: attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20062, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['id'] = \ id return self.get_instrument_mifid_get_endpoint.call_with_http_info(**kwargs) def get_instrument_search_basic( self, search_value, **kwargs ) -> InlineResponse20087: """Basic search for instruments. # noqa: E501 Search for instruments whose ISIN, specified NSINs, or name match the search value according to a tolerant full-text match algorithm. Better matching results appear in the response before less relevant matches. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: search_value (str): The search value of the instruments searching for. It may be enclosed in double quotes (\"). No escaping is provided, therefore it is impossible to specify a search string containing double quotes. Relevance of word starts is indicated by a phrase starting with a space character, such as \" daimler\". Keyword Args: nsins ([str]): A set of NSIN kinds to consider in the search. If the parameter is absent or the value is empty, all valid NSIN kinds are searched.. [optional] asset_class (str): A parameter to limit the output to a particular asset class.. [optional] only_active (bool): If true, restricts the result to active instruments.. [optional] if omitted the server will use the default value of True attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 20.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20087 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['search_value'] = \ search_value return self.get_instrument_search_basic_endpoint.call_with_http_info(**kwargs) def get_instrument_search_basic_with_http_info( self, search_value, **kwargs ) -> typing.Tuple[InlineResponse20087, int, typing.MutableMapping]: """Basic search for instruments. # noqa: E501 Search for instruments whose ISIN, specified NSINs, or name match the search value according to a tolerant full-text match algorithm. Better matching results appear in the response before less relevant matches. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: search_value (str): The search value of the instruments searching for. It may be enclosed in double quotes (\"). No escaping is provided, therefore it is impossible to specify a search string containing double quotes. Relevance of word starts is indicated by a phrase starting with a space character, such as \" daimler\". Keyword Args: nsins ([str]): A set of NSIN kinds to consider in the search. If the parameter is absent or the value is empty, all valid NSIN kinds are searched.. [optional] asset_class (str): A parameter to limit the output to a particular asset class.. [optional] only_active (bool): If true, restricts the result to active instruments.. [optional] if omitted the server will use the default value of True attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 20.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20087 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['search_value'] = \ search_value return self.get_instrument_search_basic_endpoint.call_with_http_info(**kwargs) def get_instrument_search_basic_async( self, search_value, **kwargs ) -> "ApplyResult[InlineResponse20087]": """Basic search for instruments. # noqa: E501 Search for instruments whose ISIN, specified NSINs, or name match the search value according to a tolerant full-text match algorithm. Better matching results appear in the response before less relevant matches. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: search_value (str): The search value of the instruments searching for. It may be enclosed in double quotes (\"). No escaping is provided, therefore it is impossible to specify a search string containing double quotes. Relevance of word starts is indicated by a phrase starting with a space character, such as \" daimler\". Keyword Args: nsins ([str]): A set of NSIN kinds to consider in the search. If the parameter is absent or the value is empty, all valid NSIN kinds are searched.. [optional] asset_class (str): A parameter to limit the output to a particular asset class.. [optional] only_active (bool): If true, restricts the result to active instruments.. [optional] if omitted the server will use the default value of True attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 20.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20087] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['search_value'] = \ search_value return self.get_instrument_search_basic_endpoint.call_with_http_info(**kwargs) def get_instrument_search_basic_with_http_info_async( self, search_value, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20087, int, typing.MutableMapping]]": """Basic search for instruments. # noqa: E501 Search for instruments whose ISIN, specified NSINs, or name match the search value according to a tolerant full-text match algorithm. Better matching results appear in the response before less relevant matches. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: search_value (str): The search value of the instruments searching for. It may be enclosed in double quotes (\"). No escaping is provided, therefore it is impossible to specify a search string containing double quotes. Relevance of word starts is indicated by a phrase starting with a space character, such as \" daimler\". Keyword Args: nsins ([str]): A set of NSIN kinds to consider in the search. If the parameter is absent or the value is empty, all valid NSIN kinds are searched.. [optional] asset_class (str): A parameter to limit the output to a particular asset class.. [optional] only_active (bool): If true, restricts the result to active instruments.. [optional] if omitted the server will use the default value of True attributes ([str]): Limit the attributes returned in the response to the specified set.. [optional] language (str): ISO 639-1 code of the language.. [optional] pagination_offset (float): Non-negative number of entries to skip, or 0 (default).. [optional] if omitted the server will use the default value of 0.0 pagination_limit (float): Non-negative maximum number of entries to return.. [optional] if omitted the server will use the default value of 20.0 _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20087, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['search_value'] = \ search_value return self.get_instrument_search_basic_endpoint.call_with_http_info(**kwargs) def post_instrument_background_text_type_list( self, **kwargs ) -> InlineResponse20045: """List of background text types for instruments. # noqa: E501 List of background text types for instruments. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: body (InlineObject9): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20045 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.post_instrument_background_text_type_list_endpoint.call_with_http_info(**kwargs) def post_instrument_background_text_type_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20045, int, typing.MutableMapping]: """List of background text types for instruments. # noqa: E501 List of background text types for instruments. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: body (InlineObject9): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20045 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.post_instrument_background_text_type_list_endpoint.call_with_http_info(**kwargs) def post_instrument_background_text_type_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20045]": """List of background text types for instruments. # noqa: E501 List of background text types for instruments. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: body (InlineObject9): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20045] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.post_instrument_background_text_type_list_endpoint.call_with_http_info(**kwargs) def post_instrument_background_text_type_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20045, int, typing.MutableMapping]]": """List of background text types for instruments. # noqa: E501 List of background text types for instruments. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: body (InlineObject9): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20045, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.post_instrument_background_text_type_list_endpoint.call_with_http_info(**kwargs) def post_instrument_benchmark_list( self, **kwargs ) -> InlineResponse20046: """List of benchmarks of a financial instrument. # noqa: E501 Provides a list of benchmark notations for a selected financial instrument, optionally restricted to specific benchmark types. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: body (InlineObject10): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20046 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.post_instrument_benchmark_list_endpoint.call_with_http_info(**kwargs) def post_instrument_benchmark_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20046, int, typing.MutableMapping]: """List of benchmarks of a financial instrument. # noqa: E501 Provides a list of benchmark notations for a selected financial instrument, optionally restricted to specific benchmark types. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: body (InlineObject10): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20046 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.post_instrument_benchmark_list_endpoint.call_with_http_info(**kwargs) def post_instrument_benchmark_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20046]": """List of benchmarks of a financial instrument. # noqa: E501 Provides a list of benchmark notations for a selected financial instrument, optionally restricted to specific benchmark types. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: body (InlineObject10): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20046] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.post_instrument_benchmark_list_endpoint.call_with_http_info(**kwargs) def post_instrument_benchmark_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20046, int, typing.MutableMapping]]": """List of benchmarks of a financial instrument. # noqa: E501 Provides a list of benchmark notations for a selected financial instrument, optionally restricted to specific benchmark types. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: body (InlineObject10): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20046, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.post_instrument_benchmark_list_endpoint.call_with_http_info(**kwargs) def post_instrument_category_list( self, **kwargs ) -> InlineResponse20047: """List of categories assigned to a specific instrument the application is entitled to see. # noqa: E501 List of categories assigned to a specific instrument the application is entitled to see. Optionally it is possible to restrict the output to only list those for a specific category dataset. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: body (InlineObject11): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20047 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.post_instrument_category_list_endpoint.call_with_http_info(**kwargs) def post_instrument_category_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20047, int, typing.MutableMapping]: """List of categories assigned to a specific instrument the application is entitled to see. # noqa: E501 List of categories assigned to a specific instrument the application is entitled to see. Optionally it is possible to restrict the output to only list those for a specific category dataset. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: body (InlineObject11): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20047 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.post_instrument_category_list_endpoint.call_with_http_info(**kwargs) def post_instrument_category_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20047]": """List of categories assigned to a specific instrument the application is entitled to see. # noqa: E501 List of categories assigned to a specific instrument the application is entitled to see. Optionally it is possible to restrict the output to only list those for a specific category dataset. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: body (InlineObject11): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20047] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.post_instrument_category_list_endpoint.call_with_http_info(**kwargs) def post_instrument_category_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20047, int, typing.MutableMapping]]": """List of categories assigned to a specific instrument the application is entitled to see. # noqa: E501 List of categories assigned to a specific instrument the application is entitled to see. Optionally it is possible to restrict the output to only list those for a specific category dataset. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: body (InlineObject11): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20047, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.post_instrument_category_list_endpoint.call_with_http_info(**kwargs) def post_instrument_compliance_property_list( self, **kwargs ) -> InlineResponse20048: """List of compliance properties for instruments. # noqa: E501 List of compliance properties for instruments. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: body (InlineObject12): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20048 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.post_instrument_compliance_property_list_endpoint.call_with_http_info(**kwargs) def post_instrument_compliance_property_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20048, int, typing.MutableMapping]: """List of compliance properties for instruments. # noqa: E501 List of compliance properties for instruments. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: body (InlineObject12): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20048 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.post_instrument_compliance_property_list_endpoint.call_with_http_info(**kwargs) def post_instrument_compliance_property_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20048]": """List of compliance properties for instruments. # noqa: E501 List of compliance properties for instruments. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: body (InlineObject12): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20048] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.post_instrument_compliance_property_list_endpoint.call_with_http_info(**kwargs) def post_instrument_compliance_property_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20048, int, typing.MutableMapping]]": """List of compliance properties for instruments. # noqa: E501 List of compliance properties for instruments. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: body (InlineObject12): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20048, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.post_instrument_compliance_property_list_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_isin( self, body, **kwargs ) -> InlineResponse20056: """Translate a list of ISINs to instruments. # noqa: E501 Translate a given list of ISINs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: body (InlineObject13): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20056 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_isin_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_isin_with_http_info( self, body, **kwargs ) -> typing.Tuple[InlineResponse20056, int, typing.MutableMapping]: """Translate a list of ISINs to instruments. # noqa: E501 Translate a given list of ISINs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: body (InlineObject13): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20056 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_isin_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_isin_async( self, body, **kwargs ) -> "ApplyResult[InlineResponse20056]": """Translate a list of ISINs to instruments. # noqa: E501 Translate a given list of ISINs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: body (InlineObject13): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20056] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_isin_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_isin_with_http_info_async( self, body, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20056, int, typing.MutableMapping]]": """Translate a list of ISINs to instruments. # noqa: E501 Translate a given list of ISINs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: body (InlineObject13): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20056, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_isin_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_wkn( self, body, **kwargs ) -> InlineResponse20057: """Translate a list of WKNs to instruments. # noqa: E501 Translate a given list of WKNs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: body (InlineObject14): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20057 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_wkn_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_wkn_with_http_info( self, body, **kwargs ) -> typing.Tuple[InlineResponse20057, int, typing.MutableMapping]: """Translate a list of WKNs to instruments. # noqa: E501 Translate a given list of WKNs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: body (InlineObject14): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20057 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_wkn_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_wkn_async( self, body, **kwargs ) -> "ApplyResult[InlineResponse20057]": """Translate a list of WKNs to instruments. # noqa: E501 Translate a given list of WKNs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: body (InlineObject14): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20057] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_wkn_endpoint.call_with_http_info(**kwargs) def post_instrument_cross_reference_list_by_wkn_with_http_info_async( self, body, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20057, int, typing.MutableMapping]]": """Translate a list of WKNs to instruments. # noqa: E501 Translate a given list of WKNs to the respective most recent instrument identifiers, retrieved from the Cross Reference Service. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: body (InlineObject14): Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20057, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['body'] = \ body return self.post_instrument_cross_reference_list_by_wkn_endpoint.call_with_http_info(**kwargs) def post_instrument_rating_grade_list( self, **kwargs ) -> InlineResponse20063: """List of rating grades for a list of instruments. # noqa: E501 List of rating grades for a list of instruments. The list can be restricted to rating grades belonging to particular rating systems. # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: body (InlineObject15): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20063 Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.post_instrument_rating_grade_list_endpoint.call_with_http_info(**kwargs) def post_instrument_rating_grade_list_with_http_info( self, **kwargs ) -> typing.Tuple[InlineResponse20063, int, typing.MutableMapping]: """List of rating grades for a list of instruments. # noqa: E501 List of rating grades for a list of instruments. The list can be restricted to rating grades belonging to particular rating systems. # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: body (InlineObject15): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: InlineResponse20063 Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.post_instrument_rating_grade_list_endpoint.call_with_http_info(**kwargs) def post_instrument_rating_grade_list_async( self, **kwargs ) -> "ApplyResult[InlineResponse20063]": """List of rating grades for a list of instruments. # noqa: E501 List of rating grades for a list of instruments. The list can be restricted to rating grades belonging to particular rating systems. # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: body (InlineObject15): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[InlineResponse20063] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.post_instrument_rating_grade_list_endpoint.call_with_http_info(**kwargs) def post_instrument_rating_grade_list_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[InlineResponse20063, int, typing.MutableMapping]]": """List of rating grades for a list of instruments. # noqa: E501 List of rating grades for a list of instruments. The list can be restricted to rating grades belonging to particular rating systems. # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: body (InlineObject15): [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(InlineResponse20063, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.post_instrument_rating_grade_list_endpoint.call_with_http_info(**kwargs)
47.277161
694
0.576066
35,789
327,678
5.131521
0.01425
0.03058
0.022085
0.021519
0.979505
0.975824
0.962794
0.955873
0.945549
0.943622
0
0.013397
0.361047
327,678
6,930
695
47.283983
0.863763
0.589911
0
0.732886
1
0
0.160115
0.048714
0
0
0
0
0
1
0.037403
false
0
0.013056
0
0.087509
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
2fbd81c68184eb8325f3d8946ed726b2c50f07f0
56,741
py
Python
sdk/python/pulumi_azure/apimanagement/api.py
henriktao/pulumi-azure
f1cbcf100b42b916da36d8fe28be3a159abaf022
[ "ECL-2.0", "Apache-2.0" ]
109
2018-06-18T00:19:44.000Z
2022-02-20T05:32:57.000Z
sdk/python/pulumi_azure/apimanagement/api.py
henriktao/pulumi-azure
f1cbcf100b42b916da36d8fe28be3a159abaf022
[ "ECL-2.0", "Apache-2.0" ]
663
2018-06-18T21:08:46.000Z
2022-03-31T20:10:11.000Z
sdk/python/pulumi_azure/apimanagement/api.py
henriktao/pulumi-azure
f1cbcf100b42b916da36d8fe28be3a159abaf022
[ "ECL-2.0", "Apache-2.0" ]
41
2018-07-19T22:37:38.000Z
2022-03-14T10:56:26.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . import outputs from ._inputs import * __all__ = ['ApiArgs', 'Api'] @pulumi.input_type class ApiArgs: def __init__(__self__, *, api_management_name: pulumi.Input[str], resource_group_name: pulumi.Input[str], revision: pulumi.Input[str], description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, import_: Optional[pulumi.Input['ApiImportArgs']] = None, name: Optional[pulumi.Input[str]] = None, oauth2_authorization: Optional[pulumi.Input['ApiOauth2AuthorizationArgs']] = None, openid_authentication: Optional[pulumi.Input['ApiOpenidAuthenticationArgs']] = None, path: Optional[pulumi.Input[str]] = None, protocols: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, revision_description: Optional[pulumi.Input[str]] = None, service_url: Optional[pulumi.Input[str]] = None, soap_pass_through: Optional[pulumi.Input[bool]] = None, source_api_id: Optional[pulumi.Input[str]] = None, subscription_key_parameter_names: Optional[pulumi.Input['ApiSubscriptionKeyParameterNamesArgs']] = None, subscription_required: Optional[pulumi.Input[bool]] = None, version: Optional[pulumi.Input[str]] = None, version_description: Optional[pulumi.Input[str]] = None, version_set_id: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a Api resource. :param pulumi.Input[str] api_management_name: The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. :param pulumi.Input[str] resource_group_name: The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. :param pulumi.Input[str] revision: The Revision which used for this API. :param pulumi.Input[str] description: A description of the API Management API, which may include HTML formatting tags. :param pulumi.Input[str] display_name: The display name of the API. :param pulumi.Input['ApiImportArgs'] import_: A `import` block as documented below. :param pulumi.Input[str] name: The name of the API Management API. Changing this forces a new resource to be created. :param pulumi.Input['ApiOauth2AuthorizationArgs'] oauth2_authorization: An `oauth2_authorization` block as documented below. :param pulumi.Input['ApiOpenidAuthenticationArgs'] openid_authentication: An `openid_authentication` block as documented below. :param pulumi.Input[str] path: The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. :param pulumi.Input[Sequence[pulumi.Input[str]]] protocols: A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. :param pulumi.Input[str] revision_description: The description of the Api Revision of the API Management API. :param pulumi.Input[str] service_url: Absolute URL of the backend service implementing this API. :param pulumi.Input[bool] soap_pass_through: Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. :param pulumi.Input[str] source_api_id: The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` :param pulumi.Input['ApiSubscriptionKeyParameterNamesArgs'] subscription_key_parameter_names: A `subscription_key_parameter_names` block as documented below. :param pulumi.Input[bool] subscription_required: Should this API require a subscription key? :param pulumi.Input[str] version: The Version number of this API, if this API is versioned. :param pulumi.Input[str] version_description: The description of the Api Version of the API Management API. :param pulumi.Input[str] version_set_id: The ID of the Version Set which this API is associated with. """ pulumi.set(__self__, "api_management_name", api_management_name) pulumi.set(__self__, "resource_group_name", resource_group_name) pulumi.set(__self__, "revision", revision) if description is not None: pulumi.set(__self__, "description", description) if display_name is not None: pulumi.set(__self__, "display_name", display_name) if import_ is not None: pulumi.set(__self__, "import_", import_) if name is not None: pulumi.set(__self__, "name", name) if oauth2_authorization is not None: pulumi.set(__self__, "oauth2_authorization", oauth2_authorization) if openid_authentication is not None: pulumi.set(__self__, "openid_authentication", openid_authentication) if path is not None: pulumi.set(__self__, "path", path) if protocols is not None: pulumi.set(__self__, "protocols", protocols) if revision_description is not None: pulumi.set(__self__, "revision_description", revision_description) if service_url is not None: pulumi.set(__self__, "service_url", service_url) if soap_pass_through is not None: pulumi.set(__self__, "soap_pass_through", soap_pass_through) if source_api_id is not None: pulumi.set(__self__, "source_api_id", source_api_id) if subscription_key_parameter_names is not None: pulumi.set(__self__, "subscription_key_parameter_names", subscription_key_parameter_names) if subscription_required is not None: pulumi.set(__self__, "subscription_required", subscription_required) if version is not None: pulumi.set(__self__, "version", version) if version_description is not None: pulumi.set(__self__, "version_description", version_description) if version_set_id is not None: pulumi.set(__self__, "version_set_id", version_set_id) @property @pulumi.getter(name="apiManagementName") def api_management_name(self) -> pulumi.Input[str]: """ The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. """ return pulumi.get(self, "api_management_name") @api_management_name.setter def api_management_name(self, value: pulumi.Input[str]): pulumi.set(self, "api_management_name", value) @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> pulumi.Input[str]: """ The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. """ return pulumi.get(self, "resource_group_name") @resource_group_name.setter def resource_group_name(self, value: pulumi.Input[str]): pulumi.set(self, "resource_group_name", value) @property @pulumi.getter def revision(self) -> pulumi.Input[str]: """ The Revision which used for this API. """ return pulumi.get(self, "revision") @revision.setter def revision(self, value: pulumi.Input[str]): pulumi.set(self, "revision", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ A description of the API Management API, which may include HTML formatting tags. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ The display name of the API. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @property @pulumi.getter(name="import") def import_(self) -> Optional[pulumi.Input['ApiImportArgs']]: """ A `import` block as documented below. """ return pulumi.get(self, "import_") @import_.setter def import_(self, value: Optional[pulumi.Input['ApiImportArgs']]): pulumi.set(self, "import_", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ The name of the API Management API. Changing this forces a new resource to be created. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter(name="oauth2Authorization") def oauth2_authorization(self) -> Optional[pulumi.Input['ApiOauth2AuthorizationArgs']]: """ An `oauth2_authorization` block as documented below. """ return pulumi.get(self, "oauth2_authorization") @oauth2_authorization.setter def oauth2_authorization(self, value: Optional[pulumi.Input['ApiOauth2AuthorizationArgs']]): pulumi.set(self, "oauth2_authorization", value) @property @pulumi.getter(name="openidAuthentication") def openid_authentication(self) -> Optional[pulumi.Input['ApiOpenidAuthenticationArgs']]: """ An `openid_authentication` block as documented below. """ return pulumi.get(self, "openid_authentication") @openid_authentication.setter def openid_authentication(self, value: Optional[pulumi.Input['ApiOpenidAuthenticationArgs']]): pulumi.set(self, "openid_authentication", value) @property @pulumi.getter def path(self) -> Optional[pulumi.Input[str]]: """ The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. """ return pulumi.get(self, "path") @path.setter def path(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "path", value) @property @pulumi.getter def protocols(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. """ return pulumi.get(self, "protocols") @protocols.setter def protocols(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "protocols", value) @property @pulumi.getter(name="revisionDescription") def revision_description(self) -> Optional[pulumi.Input[str]]: """ The description of the Api Revision of the API Management API. """ return pulumi.get(self, "revision_description") @revision_description.setter def revision_description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "revision_description", value) @property @pulumi.getter(name="serviceUrl") def service_url(self) -> Optional[pulumi.Input[str]]: """ Absolute URL of the backend service implementing this API. """ return pulumi.get(self, "service_url") @service_url.setter def service_url(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "service_url", value) @property @pulumi.getter(name="soapPassThrough") def soap_pass_through(self) -> Optional[pulumi.Input[bool]]: """ Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. """ return pulumi.get(self, "soap_pass_through") @soap_pass_through.setter def soap_pass_through(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "soap_pass_through", value) @property @pulumi.getter(name="sourceApiId") def source_api_id(self) -> Optional[pulumi.Input[str]]: """ The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` """ return pulumi.get(self, "source_api_id") @source_api_id.setter def source_api_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "source_api_id", value) @property @pulumi.getter(name="subscriptionKeyParameterNames") def subscription_key_parameter_names(self) -> Optional[pulumi.Input['ApiSubscriptionKeyParameterNamesArgs']]: """ A `subscription_key_parameter_names` block as documented below. """ return pulumi.get(self, "subscription_key_parameter_names") @subscription_key_parameter_names.setter def subscription_key_parameter_names(self, value: Optional[pulumi.Input['ApiSubscriptionKeyParameterNamesArgs']]): pulumi.set(self, "subscription_key_parameter_names", value) @property @pulumi.getter(name="subscriptionRequired") def subscription_required(self) -> Optional[pulumi.Input[bool]]: """ Should this API require a subscription key? """ return pulumi.get(self, "subscription_required") @subscription_required.setter def subscription_required(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "subscription_required", value) @property @pulumi.getter def version(self) -> Optional[pulumi.Input[str]]: """ The Version number of this API, if this API is versioned. """ return pulumi.get(self, "version") @version.setter def version(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "version", value) @property @pulumi.getter(name="versionDescription") def version_description(self) -> Optional[pulumi.Input[str]]: """ The description of the Api Version of the API Management API. """ return pulumi.get(self, "version_description") @version_description.setter def version_description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "version_description", value) @property @pulumi.getter(name="versionSetId") def version_set_id(self) -> Optional[pulumi.Input[str]]: """ The ID of the Version Set which this API is associated with. """ return pulumi.get(self, "version_set_id") @version_set_id.setter def version_set_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "version_set_id", value) @pulumi.input_type class _ApiState: def __init__(__self__, *, api_management_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, import_: Optional[pulumi.Input['ApiImportArgs']] = None, is_current: Optional[pulumi.Input[bool]] = None, is_online: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, oauth2_authorization: Optional[pulumi.Input['ApiOauth2AuthorizationArgs']] = None, openid_authentication: Optional[pulumi.Input['ApiOpenidAuthenticationArgs']] = None, path: Optional[pulumi.Input[str]] = None, protocols: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, revision: Optional[pulumi.Input[str]] = None, revision_description: Optional[pulumi.Input[str]] = None, service_url: Optional[pulumi.Input[str]] = None, soap_pass_through: Optional[pulumi.Input[bool]] = None, source_api_id: Optional[pulumi.Input[str]] = None, subscription_key_parameter_names: Optional[pulumi.Input['ApiSubscriptionKeyParameterNamesArgs']] = None, subscription_required: Optional[pulumi.Input[bool]] = None, version: Optional[pulumi.Input[str]] = None, version_description: Optional[pulumi.Input[str]] = None, version_set_id: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering Api resources. :param pulumi.Input[str] api_management_name: The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. :param pulumi.Input[str] description: A description of the API Management API, which may include HTML formatting tags. :param pulumi.Input[str] display_name: The display name of the API. :param pulumi.Input['ApiImportArgs'] import_: A `import` block as documented below. :param pulumi.Input[bool] is_current: Is this the current API Revision? :param pulumi.Input[bool] is_online: Is this API Revision online/accessible via the Gateway? :param pulumi.Input[str] name: The name of the API Management API. Changing this forces a new resource to be created. :param pulumi.Input['ApiOauth2AuthorizationArgs'] oauth2_authorization: An `oauth2_authorization` block as documented below. :param pulumi.Input['ApiOpenidAuthenticationArgs'] openid_authentication: An `openid_authentication` block as documented below. :param pulumi.Input[str] path: The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. :param pulumi.Input[Sequence[pulumi.Input[str]]] protocols: A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. :param pulumi.Input[str] resource_group_name: The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. :param pulumi.Input[str] revision: The Revision which used for this API. :param pulumi.Input[str] revision_description: The description of the Api Revision of the API Management API. :param pulumi.Input[str] service_url: Absolute URL of the backend service implementing this API. :param pulumi.Input[bool] soap_pass_through: Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. :param pulumi.Input[str] source_api_id: The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` :param pulumi.Input['ApiSubscriptionKeyParameterNamesArgs'] subscription_key_parameter_names: A `subscription_key_parameter_names` block as documented below. :param pulumi.Input[bool] subscription_required: Should this API require a subscription key? :param pulumi.Input[str] version: The Version number of this API, if this API is versioned. :param pulumi.Input[str] version_description: The description of the Api Version of the API Management API. :param pulumi.Input[str] version_set_id: The ID of the Version Set which this API is associated with. """ if api_management_name is not None: pulumi.set(__self__, "api_management_name", api_management_name) if description is not None: pulumi.set(__self__, "description", description) if display_name is not None: pulumi.set(__self__, "display_name", display_name) if import_ is not None: pulumi.set(__self__, "import_", import_) if is_current is not None: pulumi.set(__self__, "is_current", is_current) if is_online is not None: pulumi.set(__self__, "is_online", is_online) if name is not None: pulumi.set(__self__, "name", name) if oauth2_authorization is not None: pulumi.set(__self__, "oauth2_authorization", oauth2_authorization) if openid_authentication is not None: pulumi.set(__self__, "openid_authentication", openid_authentication) if path is not None: pulumi.set(__self__, "path", path) if protocols is not None: pulumi.set(__self__, "protocols", protocols) if resource_group_name is not None: pulumi.set(__self__, "resource_group_name", resource_group_name) if revision is not None: pulumi.set(__self__, "revision", revision) if revision_description is not None: pulumi.set(__self__, "revision_description", revision_description) if service_url is not None: pulumi.set(__self__, "service_url", service_url) if soap_pass_through is not None: pulumi.set(__self__, "soap_pass_through", soap_pass_through) if source_api_id is not None: pulumi.set(__self__, "source_api_id", source_api_id) if subscription_key_parameter_names is not None: pulumi.set(__self__, "subscription_key_parameter_names", subscription_key_parameter_names) if subscription_required is not None: pulumi.set(__self__, "subscription_required", subscription_required) if version is not None: pulumi.set(__self__, "version", version) if version_description is not None: pulumi.set(__self__, "version_description", version_description) if version_set_id is not None: pulumi.set(__self__, "version_set_id", version_set_id) @property @pulumi.getter(name="apiManagementName") def api_management_name(self) -> Optional[pulumi.Input[str]]: """ The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. """ return pulumi.get(self, "api_management_name") @api_management_name.setter def api_management_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "api_management_name", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ A description of the API Management API, which may include HTML formatting tags. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ The display name of the API. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @property @pulumi.getter(name="import") def import_(self) -> Optional[pulumi.Input['ApiImportArgs']]: """ A `import` block as documented below. """ return pulumi.get(self, "import_") @import_.setter def import_(self, value: Optional[pulumi.Input['ApiImportArgs']]): pulumi.set(self, "import_", value) @property @pulumi.getter(name="isCurrent") def is_current(self) -> Optional[pulumi.Input[bool]]: """ Is this the current API Revision? """ return pulumi.get(self, "is_current") @is_current.setter def is_current(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "is_current", value) @property @pulumi.getter(name="isOnline") def is_online(self) -> Optional[pulumi.Input[bool]]: """ Is this API Revision online/accessible via the Gateway? """ return pulumi.get(self, "is_online") @is_online.setter def is_online(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "is_online", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ The name of the API Management API. Changing this forces a new resource to be created. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter(name="oauth2Authorization") def oauth2_authorization(self) -> Optional[pulumi.Input['ApiOauth2AuthorizationArgs']]: """ An `oauth2_authorization` block as documented below. """ return pulumi.get(self, "oauth2_authorization") @oauth2_authorization.setter def oauth2_authorization(self, value: Optional[pulumi.Input['ApiOauth2AuthorizationArgs']]): pulumi.set(self, "oauth2_authorization", value) @property @pulumi.getter(name="openidAuthentication") def openid_authentication(self) -> Optional[pulumi.Input['ApiOpenidAuthenticationArgs']]: """ An `openid_authentication` block as documented below. """ return pulumi.get(self, "openid_authentication") @openid_authentication.setter def openid_authentication(self, value: Optional[pulumi.Input['ApiOpenidAuthenticationArgs']]): pulumi.set(self, "openid_authentication", value) @property @pulumi.getter def path(self) -> Optional[pulumi.Input[str]]: """ The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. """ return pulumi.get(self, "path") @path.setter def path(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "path", value) @property @pulumi.getter def protocols(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. """ return pulumi.get(self, "protocols") @protocols.setter def protocols(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "protocols", value) @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> Optional[pulumi.Input[str]]: """ The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. """ return pulumi.get(self, "resource_group_name") @resource_group_name.setter def resource_group_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "resource_group_name", value) @property @pulumi.getter def revision(self) -> Optional[pulumi.Input[str]]: """ The Revision which used for this API. """ return pulumi.get(self, "revision") @revision.setter def revision(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "revision", value) @property @pulumi.getter(name="revisionDescription") def revision_description(self) -> Optional[pulumi.Input[str]]: """ The description of the Api Revision of the API Management API. """ return pulumi.get(self, "revision_description") @revision_description.setter def revision_description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "revision_description", value) @property @pulumi.getter(name="serviceUrl") def service_url(self) -> Optional[pulumi.Input[str]]: """ Absolute URL of the backend service implementing this API. """ return pulumi.get(self, "service_url") @service_url.setter def service_url(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "service_url", value) @property @pulumi.getter(name="soapPassThrough") def soap_pass_through(self) -> Optional[pulumi.Input[bool]]: """ Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. """ return pulumi.get(self, "soap_pass_through") @soap_pass_through.setter def soap_pass_through(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "soap_pass_through", value) @property @pulumi.getter(name="sourceApiId") def source_api_id(self) -> Optional[pulumi.Input[str]]: """ The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` """ return pulumi.get(self, "source_api_id") @source_api_id.setter def source_api_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "source_api_id", value) @property @pulumi.getter(name="subscriptionKeyParameterNames") def subscription_key_parameter_names(self) -> Optional[pulumi.Input['ApiSubscriptionKeyParameterNamesArgs']]: """ A `subscription_key_parameter_names` block as documented below. """ return pulumi.get(self, "subscription_key_parameter_names") @subscription_key_parameter_names.setter def subscription_key_parameter_names(self, value: Optional[pulumi.Input['ApiSubscriptionKeyParameterNamesArgs']]): pulumi.set(self, "subscription_key_parameter_names", value) @property @pulumi.getter(name="subscriptionRequired") def subscription_required(self) -> Optional[pulumi.Input[bool]]: """ Should this API require a subscription key? """ return pulumi.get(self, "subscription_required") @subscription_required.setter def subscription_required(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "subscription_required", value) @property @pulumi.getter def version(self) -> Optional[pulumi.Input[str]]: """ The Version number of this API, if this API is versioned. """ return pulumi.get(self, "version") @version.setter def version(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "version", value) @property @pulumi.getter(name="versionDescription") def version_description(self) -> Optional[pulumi.Input[str]]: """ The description of the Api Version of the API Management API. """ return pulumi.get(self, "version_description") @version_description.setter def version_description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "version_description", value) @property @pulumi.getter(name="versionSetId") def version_set_id(self) -> Optional[pulumi.Input[str]]: """ The ID of the Version Set which this API is associated with. """ return pulumi.get(self, "version_set_id") @version_set_id.setter def version_set_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "version_set_id", value) class Api(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, api_management_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, import_: Optional[pulumi.Input[pulumi.InputType['ApiImportArgs']]] = None, name: Optional[pulumi.Input[str]] = None, oauth2_authorization: Optional[pulumi.Input[pulumi.InputType['ApiOauth2AuthorizationArgs']]] = None, openid_authentication: Optional[pulumi.Input[pulumi.InputType['ApiOpenidAuthenticationArgs']]] = None, path: Optional[pulumi.Input[str]] = None, protocols: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, revision: Optional[pulumi.Input[str]] = None, revision_description: Optional[pulumi.Input[str]] = None, service_url: Optional[pulumi.Input[str]] = None, soap_pass_through: Optional[pulumi.Input[bool]] = None, source_api_id: Optional[pulumi.Input[str]] = None, subscription_key_parameter_names: Optional[pulumi.Input[pulumi.InputType['ApiSubscriptionKeyParameterNamesArgs']]] = None, subscription_required: Optional[pulumi.Input[bool]] = None, version: Optional[pulumi.Input[str]] = None, version_description: Optional[pulumi.Input[str]] = None, version_set_id: Optional[pulumi.Input[str]] = None, __props__=None): """ Manages an API within an API Management Service. ## Example Usage ```python import pulumi import pulumi_azure as azure example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") example_service = azure.apimanagement.Service("exampleService", location=example_resource_group.location, resource_group_name=example_resource_group.name, publisher_name="My Company", publisher_email="company@exmaple.com", sku_name="Developer_1") example_api = azure.apimanagement.Api("exampleApi", resource_group_name=example_resource_group.name, api_management_name=example_service.name, revision="1", display_name="Example API", path="example", protocols=["https"], import_=azure.apimanagement.ApiImportArgs( content_format="swagger-link-json", content_value="http://conferenceapi.azurewebsites.net/?format=json", )) ``` ## Import API Management API's can be imported using the `resource id`, e.g. ```sh $ pulumi import azure:apimanagement/api:Api example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/apis/api1 ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] api_management_name: The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. :param pulumi.Input[str] description: A description of the API Management API, which may include HTML formatting tags. :param pulumi.Input[str] display_name: The display name of the API. :param pulumi.Input[pulumi.InputType['ApiImportArgs']] import_: A `import` block as documented below. :param pulumi.Input[str] name: The name of the API Management API. Changing this forces a new resource to be created. :param pulumi.Input[pulumi.InputType['ApiOauth2AuthorizationArgs']] oauth2_authorization: An `oauth2_authorization` block as documented below. :param pulumi.Input[pulumi.InputType['ApiOpenidAuthenticationArgs']] openid_authentication: An `openid_authentication` block as documented below. :param pulumi.Input[str] path: The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. :param pulumi.Input[Sequence[pulumi.Input[str]]] protocols: A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. :param pulumi.Input[str] resource_group_name: The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. :param pulumi.Input[str] revision: The Revision which used for this API. :param pulumi.Input[str] revision_description: The description of the Api Revision of the API Management API. :param pulumi.Input[str] service_url: Absolute URL of the backend service implementing this API. :param pulumi.Input[bool] soap_pass_through: Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. :param pulumi.Input[str] source_api_id: The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` :param pulumi.Input[pulumi.InputType['ApiSubscriptionKeyParameterNamesArgs']] subscription_key_parameter_names: A `subscription_key_parameter_names` block as documented below. :param pulumi.Input[bool] subscription_required: Should this API require a subscription key? :param pulumi.Input[str] version: The Version number of this API, if this API is versioned. :param pulumi.Input[str] version_description: The description of the Api Version of the API Management API. :param pulumi.Input[str] version_set_id: The ID of the Version Set which this API is associated with. """ ... @overload def __init__(__self__, resource_name: str, args: ApiArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Manages an API within an API Management Service. ## Example Usage ```python import pulumi import pulumi_azure as azure example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") example_service = azure.apimanagement.Service("exampleService", location=example_resource_group.location, resource_group_name=example_resource_group.name, publisher_name="My Company", publisher_email="company@exmaple.com", sku_name="Developer_1") example_api = azure.apimanagement.Api("exampleApi", resource_group_name=example_resource_group.name, api_management_name=example_service.name, revision="1", display_name="Example API", path="example", protocols=["https"], import_=azure.apimanagement.ApiImportArgs( content_format="swagger-link-json", content_value="http://conferenceapi.azurewebsites.net/?format=json", )) ``` ## Import API Management API's can be imported using the `resource id`, e.g. ```sh $ pulumi import azure:apimanagement/api:Api example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/apis/api1 ``` :param str resource_name: The name of the resource. :param ApiArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(ApiArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, api_management_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, import_: Optional[pulumi.Input[pulumi.InputType['ApiImportArgs']]] = None, name: Optional[pulumi.Input[str]] = None, oauth2_authorization: Optional[pulumi.Input[pulumi.InputType['ApiOauth2AuthorizationArgs']]] = None, openid_authentication: Optional[pulumi.Input[pulumi.InputType['ApiOpenidAuthenticationArgs']]] = None, path: Optional[pulumi.Input[str]] = None, protocols: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, revision: Optional[pulumi.Input[str]] = None, revision_description: Optional[pulumi.Input[str]] = None, service_url: Optional[pulumi.Input[str]] = None, soap_pass_through: Optional[pulumi.Input[bool]] = None, source_api_id: Optional[pulumi.Input[str]] = None, subscription_key_parameter_names: Optional[pulumi.Input[pulumi.InputType['ApiSubscriptionKeyParameterNamesArgs']]] = None, subscription_required: Optional[pulumi.Input[bool]] = None, version: Optional[pulumi.Input[str]] = None, version_description: Optional[pulumi.Input[str]] = None, version_set_id: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = ApiArgs.__new__(ApiArgs) if api_management_name is None and not opts.urn: raise TypeError("Missing required property 'api_management_name'") __props__.__dict__["api_management_name"] = api_management_name __props__.__dict__["description"] = description __props__.__dict__["display_name"] = display_name __props__.__dict__["import_"] = import_ __props__.__dict__["name"] = name __props__.__dict__["oauth2_authorization"] = oauth2_authorization __props__.__dict__["openid_authentication"] = openid_authentication __props__.__dict__["path"] = path __props__.__dict__["protocols"] = protocols if resource_group_name is None and not opts.urn: raise TypeError("Missing required property 'resource_group_name'") __props__.__dict__["resource_group_name"] = resource_group_name if revision is None and not opts.urn: raise TypeError("Missing required property 'revision'") __props__.__dict__["revision"] = revision __props__.__dict__["revision_description"] = revision_description __props__.__dict__["service_url"] = service_url __props__.__dict__["soap_pass_through"] = soap_pass_through __props__.__dict__["source_api_id"] = source_api_id __props__.__dict__["subscription_key_parameter_names"] = subscription_key_parameter_names __props__.__dict__["subscription_required"] = subscription_required __props__.__dict__["version"] = version __props__.__dict__["version_description"] = version_description __props__.__dict__["version_set_id"] = version_set_id __props__.__dict__["is_current"] = None __props__.__dict__["is_online"] = None super(Api, __self__).__init__( 'azure:apimanagement/api:Api', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, api_management_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None, import_: Optional[pulumi.Input[pulumi.InputType['ApiImportArgs']]] = None, is_current: Optional[pulumi.Input[bool]] = None, is_online: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, oauth2_authorization: Optional[pulumi.Input[pulumi.InputType['ApiOauth2AuthorizationArgs']]] = None, openid_authentication: Optional[pulumi.Input[pulumi.InputType['ApiOpenidAuthenticationArgs']]] = None, path: Optional[pulumi.Input[str]] = None, protocols: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, revision: Optional[pulumi.Input[str]] = None, revision_description: Optional[pulumi.Input[str]] = None, service_url: Optional[pulumi.Input[str]] = None, soap_pass_through: Optional[pulumi.Input[bool]] = None, source_api_id: Optional[pulumi.Input[str]] = None, subscription_key_parameter_names: Optional[pulumi.Input[pulumi.InputType['ApiSubscriptionKeyParameterNamesArgs']]] = None, subscription_required: Optional[pulumi.Input[bool]] = None, version: Optional[pulumi.Input[str]] = None, version_description: Optional[pulumi.Input[str]] = None, version_set_id: Optional[pulumi.Input[str]] = None) -> 'Api': """ Get an existing Api resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] api_management_name: The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. :param pulumi.Input[str] description: A description of the API Management API, which may include HTML formatting tags. :param pulumi.Input[str] display_name: The display name of the API. :param pulumi.Input[pulumi.InputType['ApiImportArgs']] import_: A `import` block as documented below. :param pulumi.Input[bool] is_current: Is this the current API Revision? :param pulumi.Input[bool] is_online: Is this API Revision online/accessible via the Gateway? :param pulumi.Input[str] name: The name of the API Management API. Changing this forces a new resource to be created. :param pulumi.Input[pulumi.InputType['ApiOauth2AuthorizationArgs']] oauth2_authorization: An `oauth2_authorization` block as documented below. :param pulumi.Input[pulumi.InputType['ApiOpenidAuthenticationArgs']] openid_authentication: An `openid_authentication` block as documented below. :param pulumi.Input[str] path: The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. :param pulumi.Input[Sequence[pulumi.Input[str]]] protocols: A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. :param pulumi.Input[str] resource_group_name: The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. :param pulumi.Input[str] revision: The Revision which used for this API. :param pulumi.Input[str] revision_description: The description of the Api Revision of the API Management API. :param pulumi.Input[str] service_url: Absolute URL of the backend service implementing this API. :param pulumi.Input[bool] soap_pass_through: Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. :param pulumi.Input[str] source_api_id: The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` :param pulumi.Input[pulumi.InputType['ApiSubscriptionKeyParameterNamesArgs']] subscription_key_parameter_names: A `subscription_key_parameter_names` block as documented below. :param pulumi.Input[bool] subscription_required: Should this API require a subscription key? :param pulumi.Input[str] version: The Version number of this API, if this API is versioned. :param pulumi.Input[str] version_description: The description of the Api Version of the API Management API. :param pulumi.Input[str] version_set_id: The ID of the Version Set which this API is associated with. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _ApiState.__new__(_ApiState) __props__.__dict__["api_management_name"] = api_management_name __props__.__dict__["description"] = description __props__.__dict__["display_name"] = display_name __props__.__dict__["import_"] = import_ __props__.__dict__["is_current"] = is_current __props__.__dict__["is_online"] = is_online __props__.__dict__["name"] = name __props__.__dict__["oauth2_authorization"] = oauth2_authorization __props__.__dict__["openid_authentication"] = openid_authentication __props__.__dict__["path"] = path __props__.__dict__["protocols"] = protocols __props__.__dict__["resource_group_name"] = resource_group_name __props__.__dict__["revision"] = revision __props__.__dict__["revision_description"] = revision_description __props__.__dict__["service_url"] = service_url __props__.__dict__["soap_pass_through"] = soap_pass_through __props__.__dict__["source_api_id"] = source_api_id __props__.__dict__["subscription_key_parameter_names"] = subscription_key_parameter_names __props__.__dict__["subscription_required"] = subscription_required __props__.__dict__["version"] = version __props__.__dict__["version_description"] = version_description __props__.__dict__["version_set_id"] = version_set_id return Api(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="apiManagementName") def api_management_name(self) -> pulumi.Output[str]: """ The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. """ return pulumi.get(self, "api_management_name") @property @pulumi.getter def description(self) -> pulumi.Output[Optional[str]]: """ A description of the API Management API, which may include HTML formatting tags. """ return pulumi.get(self, "description") @property @pulumi.getter(name="displayName") def display_name(self) -> pulumi.Output[str]: """ The display name of the API. """ return pulumi.get(self, "display_name") @property @pulumi.getter(name="import") def import_(self) -> pulumi.Output[Optional['outputs.ApiImport']]: """ A `import` block as documented below. """ return pulumi.get(self, "import_") @property @pulumi.getter(name="isCurrent") def is_current(self) -> pulumi.Output[bool]: """ Is this the current API Revision? """ return pulumi.get(self, "is_current") @property @pulumi.getter(name="isOnline") def is_online(self) -> pulumi.Output[bool]: """ Is this API Revision online/accessible via the Gateway? """ return pulumi.get(self, "is_online") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ The name of the API Management API. Changing this forces a new resource to be created. """ return pulumi.get(self, "name") @property @pulumi.getter(name="oauth2Authorization") def oauth2_authorization(self) -> pulumi.Output[Optional['outputs.ApiOauth2Authorization']]: """ An `oauth2_authorization` block as documented below. """ return pulumi.get(self, "oauth2_authorization") @property @pulumi.getter(name="openidAuthentication") def openid_authentication(self) -> pulumi.Output[Optional['outputs.ApiOpenidAuthentication']]: """ An `openid_authentication` block as documented below. """ return pulumi.get(self, "openid_authentication") @property @pulumi.getter def path(self) -> pulumi.Output[str]: """ The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. """ return pulumi.get(self, "path") @property @pulumi.getter def protocols(self) -> pulumi.Output[Sequence[str]]: """ A list of protocols the operations in this API can be invoked. Possible values are `http` and `https`. """ return pulumi.get(self, "protocols") @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> pulumi.Output[str]: """ The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. """ return pulumi.get(self, "resource_group_name") @property @pulumi.getter def revision(self) -> pulumi.Output[str]: """ The Revision which used for this API. """ return pulumi.get(self, "revision") @property @pulumi.getter(name="revisionDescription") def revision_description(self) -> pulumi.Output[Optional[str]]: """ The description of the Api Revision of the API Management API. """ return pulumi.get(self, "revision_description") @property @pulumi.getter(name="serviceUrl") def service_url(self) -> pulumi.Output[str]: """ Absolute URL of the backend service implementing this API. """ return pulumi.get(self, "service_url") @property @pulumi.getter(name="soapPassThrough") def soap_pass_through(self) -> pulumi.Output[Optional[bool]]: """ Should this API expose a SOAP frontend, rather than a HTTP frontend? Defaults to `false`. """ return pulumi.get(self, "soap_pass_through") @property @pulumi.getter(name="sourceApiId") def source_api_id(self) -> pulumi.Output[Optional[str]]: """ The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` """ return pulumi.get(self, "source_api_id") @property @pulumi.getter(name="subscriptionKeyParameterNames") def subscription_key_parameter_names(self) -> pulumi.Output['outputs.ApiSubscriptionKeyParameterNames']: """ A `subscription_key_parameter_names` block as documented below. """ return pulumi.get(self, "subscription_key_parameter_names") @property @pulumi.getter(name="subscriptionRequired") def subscription_required(self) -> pulumi.Output[Optional[bool]]: """ Should this API require a subscription key? """ return pulumi.get(self, "subscription_required") @property @pulumi.getter def version(self) -> pulumi.Output[str]: """ The Version number of this API, if this API is versioned. """ return pulumi.get(self, "version") @property @pulumi.getter(name="versionDescription") def version_description(self) -> pulumi.Output[Optional[str]]: """ The description of the Api Version of the API Management API. """ return pulumi.get(self, "version_description") @property @pulumi.getter(name="versionSetId") def version_set_id(self) -> pulumi.Output[str]: """ The ID of the Version Set which this API is associated with. """ return pulumi.get(self, "version_set_id")
48.496581
201
0.671472
6,665
56,741
5.493773
0.04036
0.08682
0.070352
0.06489
0.95248
0.941801
0.932161
0.924295
0.919216
0.896193
0
0.003131
0.2289
56,741
1,169
202
48.538067
0.833749
0.327629
0
0.846154
1
0
0.135009
0.048745
0
0
0
0
0
1
0.16716
false
0.039941
0.048817
0
0.316568
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
2fe9bac42e4ad672e0311e1692e03f68501ea194
83
py
Python
TextFeatureExtractor/TextFeatureExtractor.py
Nexusger/TextFeatureExtractor
0ef33b3e5844b4f7919814aaba35534d013bf333
[ "MIT" ]
null
null
null
TextFeatureExtractor/TextFeatureExtractor.py
Nexusger/TextFeatureExtractor
0ef33b3e5844b4f7919814aaba35534d013bf333
[ "MIT" ]
null
null
null
TextFeatureExtractor/TextFeatureExtractor.py
Nexusger/TextFeatureExtractor
0ef33b3e5844b4f7919814aaba35534d013bf333
[ "MIT" ]
null
null
null
"""All feature related stuff""" import nltk def _getIndexName(): return 'message'
16.6
31
0.73494
10
83
6
1
0
0
0
0
0
0
0
0
0
0
0
0.13253
83
5
32
16.6
0.833333
0.301205
0
0
0
0
0.132075
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
1
1
0
0
7
640ebfefc9d4d6e804ef34efa435ae829ff7fe8d
5,670
py
Python
sentiment/public_sentiment.py
nextweek-0/Public-opinion-monitoring
2b2e1013af3e2563def5a15c76942c942fc85c01
[ "Apache-2.0" ]
null
null
null
sentiment/public_sentiment.py
nextweek-0/Public-opinion-monitoring
2b2e1013af3e2563def5a15c76942c942fc85c01
[ "Apache-2.0" ]
null
null
null
sentiment/public_sentiment.py
nextweek-0/Public-opinion-monitoring
2b2e1013af3e2563def5a15c76942c942fc85c01
[ "Apache-2.0" ]
null
null
null
from flask import Flask,render_template,request import os import pymysql app = Flask(__name__) # 差评与好评数 @app.route("/") def ps(): connent = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='594546594546wsl', db='sentiment', charset='utf8mb4') cursor = connent.cursor() # 全部评论数 try: sql = 'select sentiment from st where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' all_hp = cursor.execute(sql) sql = 'select sentiment from st where QUARTER(createtime)=QUARTER(now()) and sentiment = 0' all_cp = cursor.execute(sql) except: pass # 环境评论数 try: sql = 'select sentiment from env where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' env_hp = cursor.execute(sql) sql = 'select sentiment from env where QUARTER(createtime)=QUARTER(now()) and sentiment = 0' env_cp = cursor.execute(sql) except: pass # 价格 try: sql = 'select sentiment from price where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' price_hp = cursor.execute(sql) sql = 'select sentiment from price where QUARTER(createtime)=QUARTER(now()) and sentiment = 0' price_cp = cursor.execute(sql) except: pass # 味道 try: sql = 'select sentiment from taste where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' taste_hp = cursor.execute(sql) sql = 'select sentiment from taste where QUARTER(createtime)=QUARTER(now()) and sentiment = 0' taste_cp = cursor.execute(sql) except: pass # reviews =cursor.fetchall() # for review in reviews: # print(review[0]) cursor.close() connent.close() return render_template('ps.html', all_hp=all_hp, all_cp=all_cp, env_hp=env_hp, env_cp=env_cp, price_hp=price_hp, price_cp=price_cp, taste_hp=taste_hp, taste_cp=taste_cp ) # 全部评论 @app.route("/all") def all_review(): connent = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='594546594546wsl', db='sentiment', charset='utf8mb4') cursor = connent.cursor() sql = 'select review from st where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) hp = cursor.fetchall() # hp = list(hp[-20:]) # for i,review in enumerate(hp): # hp[i] = hp[i][0] hp = hp[-20:] sql = 'select review from st where QUARTER(createtime)=QUARTER(now()) and sentiment = 0' cursor.execute(sql) cp = cursor.fetchall() cp = cp[-20:] cursor.close() connent.close() return render_template('all.html', hp=hp, cp=cp) # 环境评论 @app.route("/env") def env_review(): connent = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='594546594546wsl', db='sentiment', charset='utf8mb4') cursor = connent.cursor() sql = 'select review from env where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) hp = cursor.fetchall()[:20] sql = 'select review from env where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) cp = cursor.fetchall()[:20] cursor.close() connent.close() return render_template('env.html', hp=hp, cp=cp) # 价格评论 @app.route("/price") def price_review(): connent = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='594546594546wsl', db='sentiment', charset='utf8mb4') cursor = connent.cursor() sql = 'select review from price where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) hp = cursor.fetchall()[:20] sql = 'select review from price where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) cp = cursor.fetchall()[:20] cursor.close() connent.close() return render_template('price.html', hp=hp, cp=cp) # 味道评论 @app.route("/taste") def taste_review(): connent = pymysql.connect(host='127.0.0.1', port=3306, user='root', password='594546594546wsl', db='sentiment', charset='utf8mb4') cursor = connent.cursor() sql = 'select review from taste where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) hp = cursor.fetchall()[:20] sql = 'select review from taste where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' cursor.execute(sql) cp = cursor.fetchall()[:20] cursor.close() connent.close() return render_template('taste.html', hp=hp, cp=cp) if __name__ == '__main__': app.run(host='0.0.0.0', port=5000, debug=True) # def all_review(): # # connent = pymysql.connect(host='127.0.0.1', port=3306, # user='root', password='594546594546wsl', # db='sentiment', charset='utf8mb4') # cursor = connent.cursor() # # sql = 'select review from st where QUARTER(createtime)=QUARTER(now()) and sentiment = 1' # cursor.execute(sql) # hp = cursor.fetchall() # hp = list(hp[-20:]) # for i,review in enumerate(hp): # hp[i] = hp[i][0] # sql = 'select review from st where QUARTER(createtime)=QUARTER(now()) and sentiment = 0' # cursor.execute(sql) # cp = cursor.fetchall() # cp = cp[-20:] # print(hp) # # # all_review()
30.815217
103
0.591534
692
5,670
4.777457
0.109827
0.049002
0.119782
0.157895
0.862371
0.843618
0.80974
0.796733
0.761041
0.761041
0
0.047158
0.270723
5,670
184
104
30.815217
0.752358
0.149735
0
0.568807
0
0
0.342947
0.113689
0
0
0
0
0
1
0.045872
false
0.082569
0.027523
0
0.119266
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
641aa1f45dab52100cd357490e9f669b5f34bc1d
7,822
py
Python
Documentation/DataFormats/python/RecoTracker_dataformats.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
Documentation/DataFormats/python/RecoTracker_dataformats.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
Documentation/DataFormats/python/RecoTracker_dataformats.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
''' Created on Jun 26, 2013 @author: Mantas Stankevicius @contact: mantas.stankevicius@cern.ch http://cmsdoxy.web.cern.ch/cmsdoxy/dataformats/ @responsible: ''' json = { "full": { "title": "RecoTracker collections (in RECO and AOD)", "data": [ { "instance": "dedxHarmonic2", "container": "*", "desc": "No documentation" }, { "instance": "trackExtrapolator", "container": "*", "desc": "No documentation" }, { "instance": "generalTracks", "container": "recoTrackExtras", "desc": "Track extra for the generalTracks.The trajectory state at the inner and outer most measurements" }, { "instance": "generalTracks", "container": "recoTracks", "desc": "Collection of tracks obtained with tracker-standalone reconstruction and officially supported by the Tracker DPG group. Such a collection can contain tracks from different tracking algorithms" }, { "instance": "extraFromSeeds", "container": "uints", "desc": "No documentation" }, { "instance": "extraFromSeeds", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "beamhaloTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "generalTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "beamhaloTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "beamhaloTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "rsWithMaterialTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "rsWithMaterialTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "rsWithMaterialTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "ctfPixelLess", "container": "*", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "dedxDiscrimASmi", "container": "*", "desc": "No documentation" }, { "instance": "dedxTruncated40", "container": "*", "desc": "No documentation" } ] }, "aod": { "title": "RecoTracker collections (in AOD only)", "data": [ { "instance": "rsWithMaterialTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "generalTracks", "container": "recoTracks", "desc": "Collection of tracks obtained with tracker-standalone reconstruction and officially supported by the Tracker DPG group. Such a collection can contain tracks from different tracking algorithms" }, { "instance": "beamhaloTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "ctfPixelLess", "container": "recoTracks", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "dedxDiscrimASmi", "container": "*", "desc": "No documentation" }, { "instance": "dedxHarmonic2", "container": "*", "desc": "No documentation" }, { "instance": "trackExtrapolator", "container": "*", "desc": "No documentation" } ] }, "reco": { "title": "RecoTracker collections (in RECO only)", "data": [ { "instance": "dedxHarmonic2", "container": "*", "desc": "No documentation" }, { "instance": "trackExtrapolator", "container": "*", "desc": "No documentation" }, { "instance": "generalTracks", "container": "recoTrackExtras", "desc": "Track extra for the generalTracks.The trajectory state at the inner and outer most measurements" }, { "instance": "generalTracks", "container": "recoTracks", "desc": "Collection of tracks obtained with tracker-standalone reconstruction and officially supported by the Tracker DPG group. Such a collection can contain tracks from different tracking algorithms" }, { "instance": "extraFromSeeds", "container": "uints", "desc": "No documentation" }, { "instance": "extraFromSeeds", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "beamhaloTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "generalTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "beamhaloTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "beamhaloTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "rsWithMaterialTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "regionalCosmicTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "rsWithMaterialTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "rsWithMaterialTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "recoTrackExtras", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "recoTracks", "desc": "No documentation" }, { "instance": "ctfPixelLess", "container": "*", "desc": "No documentation" }, { "instance": "conversionStepTracks", "container": "TrackingRecHitsOwned", "desc": "No documentation" }, { "instance": "dedxDiscrimASmi", "container": "*", "desc": "No documentation" }, { "instance": "dedxTruncated40", "container": "*", "desc": "No documentation" } ] } }
26.696246
208
0.534007
503
7,822
8.304175
0.157058
0.068949
0.218339
0.290879
0.955231
0.93943
0.93943
0.93943
0.913335
0.913335
0
0.002435
0.317438
7,822
292
209
26.787671
0.779921
0.019816
0
0.574468
0
0.010638
0.577484
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
ffb929a1126ccc388aa6afd655869a931150c237
1,414
py
Python
images_api/tests/test_api.py
mgoodnight/py-s3-img-resize
be5ebff37b09b8d6608ff32109f77bd966efd0ab
[ "MIT" ]
null
null
null
images_api/tests/test_api.py
mgoodnight/py-s3-img-resize
be5ebff37b09b8d6608ff32109f77bd966efd0ab
[ "MIT" ]
null
null
null
images_api/tests/test_api.py
mgoodnight/py-s3-img-resize
be5ebff37b09b8d6608ff32109f77bd966efd0ab
[ "MIT" ]
null
null
null
def test_basic(client, flask_file_request_args): res = client.post('/image', **flask_file_request_args) assert res.status_code == 201 assert res.get_json()['success'][0] == 'foobar.jpg' def test_no_file(client): res = client.post('/image') assert res.status_code == 400 assert res.get_json()['error'] == 'Missing image' def test_no_extension(client, flask_file_no_extension): res = client.post('/image', **flask_file_no_extension) assert res.status_code == 400 assert res.get_json()['error'] == 'Cannot determine image type' def test_preserve(client, flask_file_request_args): res = client.post('/image?preserve=1&width=100', **flask_file_request_args) json = res.get_json() assert res.status_code == 201 assert json['success'][0] == 'foobar.jpg' assert json['success'][1] == 'foobar-orig.jpg' def test_append_resize(client, flask_file_request_args): res = client.post('/image?append=1&width=100&height=100', **flask_file_request_args) assert res.status_code == 201 assert res.get_json()['success'][0] == 'foobar-100x100.jpg' def test_preserve_resize(client, flask_file_request_args): res = client.post('/image?preserve=1&width=100&height=100', **flask_file_request_args) json = res.get_json() assert res.status_code == 201 assert json['success'][0] == 'foobar.jpg' assert json['success'][1] == 'foobar-orig.jpg'
33.666667
90
0.698727
205
1,414
4.565854
0.185366
0.096154
0.136752
0.17094
0.787393
0.784188
0.755342
0.755342
0.755342
0.682692
0
0.039768
0.146393
1,414
41
91
34.487805
0.735708
0
0
0.428571
0
0
0.204385
0.071429
0
0
0
0
0.5
1
0.214286
false
0
0
0
0.214286
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
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
0
0
0
8
4480d50533d7bd328f2754a06241c259a15893ef
104,916
py
Python
sensha_uncompiled_version05-06-2019/sprites.py
JonasMht/Sensha-Game-2019
4e0733abeebf92901ce490f21758ab08bba1b6e0
[ "MIT" ]
null
null
null
sensha_uncompiled_version05-06-2019/sprites.py
JonasMht/Sensha-Game-2019
4e0733abeebf92901ce490f21758ab08bba1b6e0
[ "MIT" ]
null
null
null
sensha_uncompiled_version05-06-2019/sprites.py
JonasMht/Sensha-Game-2019
4e0733abeebf92901ce490f21758ab08bba1b6e0
[ "MIT" ]
null
null
null
# sprites.py """ Importe le code du fichier <<ai_system.py>> """ from ai_system import * #import code from settings """ Classe Map - But : dessiner une carte donnee en fonction du niveau de jeu selectionne - Fonctionnement : redimensionne la carte en fonction de la resolution de l'ecran. Gere le deplacement de la carte et partage sa position avec la classe Prgm() - Utilisation : est ajoutee a la classe Virtuals() au debut d'une partie et est lue a chaque boucle """ class Map(): def __init__(self, glob): self.glob = glob self._layer = 0 self._type = "func_sprite_prime" self.indicative_width = 2.5 self.indicative_height = 1 self.indicative_pos = vec(0,0.075) self.spd = vec(0, 0) self.acc = vec(0, 0) self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) i = self.glob.game_lvl*(15/95) self.image = self.glob.sprite["map"][int(i)] self.image = pg.transform.scale(self.image, (math.ceil(self.indicative_width * self.glob.data["screen_width"]), math.ceil(self.indicative_height * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.mouse1_x = self.glob.mouse_pos.x self.mouse2_x = self.glob.mouse_pos.x self.map_offset = 0 self.rect.x = self.pos.x self.rect.y = self.pos.y self.glob.map_instance = self self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : est lue a chaque boucle et effectue des calculs de vitesse de glissment de la carte """ def update(self): self.acc = vec(0, 0) self.keyboard_scroll() self.acc.x += self.spd.x * - 0.4 self.spd.x += self.acc.x speedX = int(self.spd.x * self.glob.fps_stab * (self.glob.data["screen_height"]/720)) if self.glob.mouse_pos.y > self.pos.y and self.glob.mouse_pos.y < self.pos.y + self.rect.h: self.mouse_scroll() self.pos.x += speedX if self.pos.x + self.spd.x > 0 or self.pos.x + self.spd.x < self.glob.data["screen_width"] - self.rect.w: if self.pos.x + self.spd.x > 0: self.spd.x = 0 self.pos.x = 0 self.acc = vec(0,0) if self.pos.x + self.spd.x < self.glob.data["screen_width"] - self.rect.w: self.spd.x = 0 self.pos.x = self.glob.data["screen_width"] - self.rect.w self.acc = vec(0,0) """position change var to be transfered to virtual change create virtual change var such as I can write a modif for all + parametrics""" self.map_offset = self.pos.x - self.rect.x self.glob.map_instance = self self.rect.x = self.pos.x self.rect.y = self.pos.y """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille de la carte si la resolution de l'ecran est modifiee """ def prime_update(self): if self.glob.Resol_Check.change: if self.glob.data["screen_height"] == 720: self.pos = self.pos * (2/3) else: self.pos = self.pos * (3/2) self.image = pg.transform.scale(self.image, (math.ceil(self.indicative_width * self.glob.data["screen_width"]), math.ceil(self.indicative_height * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.x = self.pos.x self.rect.y = self.pos.y self.spd.x = 0 self.map_offset = 0 self.glob.map_instance = self """ Fonction mouse_scroll - Fonctionnement : si le bouton droit de la souris est active : calcule la distance en abscisse entre la position de la souris actuelle et celle de la boucle precedente et fait coulisser la carte """ def mouse_scroll(self): self.mouse1_x = self.glob.mouse_pos.x if pg.mouse.get_pressed()[2]: self.spd.x = (self.mouse1_x - self.mouse2_x) / self.glob.fps_stab speedX = int(self.spd.x * self.glob.fps_stab) self.acc = vec(0,0) self.mouse2_x = self.glob.mouse_pos.x """ Fonction keyboard_scroll - Fonctionnement : si un bouton directionnel du clavier est active : fait coulisser la carte """ def keyboard_scroll(self): keys = pg.key.get_pressed() if keys[pg.K_LEFT] or keys[pg.K_a]: self.acc += vec(15, 0) if keys[pg.K_RIGHT] or keys[pg.K_d]: self.acc -= vec(15, 0) """ Classe Turret - But : gerer les parametres de la tourelle - Fonctionnement : selon ses parametres, la tourelle sera positionnee par rapport a la position relative du chassis. Elle va acquerir la cible et engager un protocole de combat en envoyant des projectiles kinetics. - Utilisation : la classe sera liee au chassis par un partage de variables. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Turret(): def __init__(self, glob, image_file, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.pos = self.glob.pos self.pos_adj = vec(0,0) self.recoil = vec(0,0) self.recoil_act = False self.recoil_phase = "back" self.fire = False self.fire_range = 0 self.fire_rate = 0 self.go = False self.salvo = 1 self.salvo_count = 0 self.salvo_interval = 0.001 self.rot = self.glob.rot self.former_rot = 0 self.rot_speed = 2 self.rot_target = 0 self.timer = Timer() self.timer1 = Timer() self.timer2 = Timer() self.timer3 = Timer() self.image_file = image_file self.image = image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.projectile_image = 0 self.projectile_speed = 0 self.projectile_damage = 0 self.fire_sound = 0 self.explosion_anim = 0 self.explosion_sound = 0 self.trail_anim = 0 self.rect = self.image.get_rect() """ Fonction update - Fonctionnement : elle va modifier la position de la tourelle en fonction de la position du chassis. Elle va s'occuper de l'acquisition de la cible et engager un protocole de combat definit par des parametres de depart. """ def update(self): self.fire = False self.pos = self.glob.pos + self.pos_adj.rotate(-self.glob.rot) + self.recoil.rotate(-self.rot) if self.glob.hp > 0: Turret_AI(self) if self.fire: self.go = True if self.go == True: if self.timer3.chrono(self.salvo_interval): self.recoil_act = True self.recoil.x = 0 self.recoil_phase = "back" Kinetic_Projectile(self ,self.projectile_image, self.projectile_speed , self.projectile_damage, self.fire_sound, self.trail_anim, self.explosion_anim, self.explosion_sound) self.salvo_count += 1 if self.salvo_count >= self.salvo: self.go = False self.salvo_count = 0 if self.recoil_act: if self.timer1.chrono(self.fire_rate/50): if self.recoil_phase == "back" and self.recoil.x > -0.003 * self.glob.glob.data["screen_width"]: self.recoil.x -= 2 * 0.0007813 * self.glob.glob.data["screen_width"] elif self.recoil_phase == "back": self.recoil.x -= 0.0007813 * self.glob.glob.data["screen_width"] if self.recoil.x <= -0.005 * self.glob.glob.data["screen_width"]: self.recoil_phase = "forward" if self.recoil_phase == "forward" and self.recoil.x < 0: self.recoil.x += 0.0007813 * self.glob.glob.data["screen_width"] elif self.recoil_phase == "forward": self.recoil_act = False self.recoil_phase = "back" self.recoil.x = 0 if self.former_rot >= self.rot + 5 or self.former_rot <= self.rot -5: self.image = pg.transform.rotate(self.original_image, self.rot) self.former_rot = self.rot self.rect = self.image.get_rect() self.rect.center = self.pos """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille de la tourelle si la resolution de l'ecran est modifiee """ def prime_update(self): if self.glob.glob.Resol_Check.change: if self.glob.glob.data["screen_height"] == 720: self.pos_adj = self.pos_adj * (2/3) self.recoil = self.recoil * (2/3) self.pos = self.glob.pos + self.pos_adj.rotate(-self.glob.rot) + self.recoil.rotate(-self.rot) else: self.pos_adj = self.pos_adj * (3/2) self.recoil = self.recoil * (3/2) self.pos = self.glob.pos + self.pos_adj.rotate(-self.glob.rot) + self.recoil.rotate(-self.rot) self.image = self.image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.image = pg.transform.rotate(self.original_image, self.rot) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Launcher - But : gerer les parametres du lance missile - Fonctionnement : selon ses parametres, la tourelle sera positionnee par rapport a la position relative du chassis. Elle va acquerir la cible et engager un protocole de combat en envoyant des missiles balistiques. - Utilisation : la classe sera liee au chassis par un partage de variables. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Launcher(): def __init__(self, glob, image_file, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.pos = self.glob.pos self.pos_adj = vec(0,0) self.recoil = vec(0,0) self.recoil_act = False self.recoil_phase = "back" self.fire = False self.fire_range = 0 self.fire_rate = 0 # How many roclets per batch? self.salvo = 0 # How much time between two rockets self.salvo_interval = 0 # When to shoot? self.go = False # How many salvos fired? self.salvo_count = 0 self.rot = self.glob.rot self.former_rot = 0 self.rot_speed = 2 self.rot_target = 0 self.timer = Timer() self.timer1 = Timer() self.timer2 = Timer() self.timer3 = Timer() self.image_file = image_file self.image = image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.projectile_image = 0 self.projectile_speed = 0 self.projectile_damage = 0 self.fire_sound = 0 self.explosion_anim = 0 self.explosion_sound = 0 self.trail_anim = 0 self.missile_rot_speed = 0 self.rect = self.image.get_rect() """ Fonction update - Fonctionnement : elle va modifier la position du lance missile en fonction de la position du chassis. Elle va s'occuper de l'acquisition de la cible et engager un protocole de combat definit par des parametres de depart. """ def update(self): self.fire = False self.pos = self.glob.pos + self.pos_adj.rotate(-self.glob.rot) + self.recoil.rotate(-self.rot) if self.glob.hp > 0: Turret_AI(self) if self.fire: self.go = True if self.go == True: if self.timer3.chrono(self.salvo_interval): self.recoil_act = True self.recoil.x = 0 self.recoil_phase = "back" Ballistic_Missile(self ,self.projectile_image, self.projectile_speed, self.missile_rot_speed, self.projectile_damage, self.fire_sound, self.trail_anim, self.explosion_anim, self.explosion_sound) self.salvo_count += 1 if self.salvo_count >= self.salvo: self.go = False self.salvo_count = 0 self.recoil.x = 0 if self.recoil_act: if self.timer1.chrono(self.fire_rate/50): if self.recoil_phase == "back" and self.recoil.x > -0.003 * self.glob.glob.data["screen_width"]: self.recoil.x -= 2 * 0.0007813 * self.glob.glob.data["screen_width"] elif self.recoil_phase == "back": self.recoil.x -= 0.0007813 * self.glob.glob.data["screen_width"] if self.recoil.x <= -0.005 * self.glob.glob.data["screen_width"]: self.recoil_phase = "forward" if self.recoil_phase == "forward" and self.recoil.x < 0: self.recoil.x += 0.0007813 * self.glob.glob.data["screen_width"] elif self.recoil_phase == "forward": self.recoil_act = False self.recoil_phase = "back" self.recoil.x = 0 if self.former_rot >= self.rot + 5 or self.former_rot <= self.rot -5: self.image = pg.transform.rotate(self.original_image, self.rot) self.former_rot = self.rot self.rect = self.image.get_rect() self.rect.center = self.pos """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du lance missile si la resolution de l'ecran est modifiee """ def prime_update(self): if self.glob.glob.Resol_Check.change: if self.glob.glob.data["screen_height"] == 720: self.pos_adj = self.pos_adj * (2/3) self.recoil = self.recoil * (2/3) self.pos = self.glob.pos + self.pos_adj.rotate(-self.glob.rot) + self.recoil.rotate(-self.rot) else: self.pos_adj = self.pos_adj * (3/2) self.recoil = self.recoil * (3/2) self.pos = self.glob.pos + self.pos_adj.rotate(-self.glob.rot) + self.recoil.rotate(-self.rot) self.image = self.image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.image = pg.transform.rotate(self.original_image, self.rot) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Body - But : gerer les parametres du corps et son ombre - Fonctionnement : dessine le corps et son ombre - Utilisation : la classe sera liee au chassis par un partage de variables. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Body(): def __init__(self, glob, image_file, layer): self.glob = glob self._layer = layer self._type = "func_sprite_shadow_prime" self.pos = self.glob.pos self.rot = 0 self.former_rot = 0 self.image_file = image_file self.image = image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.rect = self.image.get_rect() self.shadow = self.image.copy() self.shadow.fill((0, 0, 0, 90), None, pg.BLEND_RGBA_MULT) self.original_shadow = self.shadow.copy() self.shadow_rect = self.shadow.get_rect() """ Fonction update - Fonctionnement : elle va modifier la position du corps et de l'ombre en fonction de la position du chassis. """ def update(self): self.pos = self.glob.pos self.rot = self.glob.rot if self.former_rot >= self.rot + 5 or self.former_rot <= self.rot -5: self.image = pg.transform.rotate(self.original_image, self.rot) self.rect = self.image.get_rect() self.shadow = pg.transform.rotate(self.original_shadow, self.rot) self.shadow_rect = self.image.get_rect() self.former_rot = self.rot self.rect.center = self.pos self.shadow_rect.center = self.pos + vec(-5,5) """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du corps et de l'ombre si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.glob.Resol_Check.change: self.image = self.image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.image = pg.transform.rotate(self.original_image, self.rot) self.rect = self.image.get_rect() self.shadow = self.image.copy() self.shadow.fill((0, 0, 0, 90), None, pg.BLEND_RGBA_MULT) self.original_shadow = self.shadow.copy() self.shadow_rect = self.shadow.get_rect() self.rect.center = self.pos self.shadow_rect.center = self.pos + vec(-5,5) """ Classe Kinetic_Projectile - But : gerer les parametres du projectile cinetique - Fonctionnement : dessiner le projectile et le fait avancer selon sa vitesse. Si collision, transmettre le dommage et jouer l'animation d'explosion. - Utilisation : la classe Kinetic_Projectile() sera appelee quand la tourelle tire. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Kinetic_Projectile(): def __init__(self, glob, image_file, speed, damage, fire_sound, trail_anim, explosion_anim, explosion_sound): self.glob = glob self._layer = 5 # Layer of projectiles self._type = "func_sprite_prime" self.damage = damage self.rot = self.glob.rot self.spd = vec(speed * (self.glob.glob.glob.data["screen_height"]/720), 0) # to be defined self.max_dist = self.glob.fire_range # to be defined self.pos = self.glob.pos + vec(self.glob.rect.w/2, 0).rotate(-self.rot) # to be defined self.start_pos = vec(self.pos.x, self.pos.y) self.hit = False self.trail_anim = trail_anim self.explosion_anim = explosion_anim self.explosion_sound = explosion_sound self.image_file = image_file self.image = image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.rect = self.image.get_rect() self.radius = int(self.rect.w/2) self.timer = Timer() self.timer1 = Timer() self.glob.glob.glob.sound_repertoire.append(fire_sound) self.image = pg.transform.rotate(self.original_image, self.rot) self.glob.glob.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : elle va modifier la position du projectile cinetique en fonction de sa vitesse. """ def update(self): self.pos += self.spd.rotate(-self.rot) * self.glob.glob.glob.fps_stab self.pos.x += self.glob.glob.glob.map_instance.map_offset self.start_pos.x += self.glob.glob.glob.map_instance.map_offset if self.max_dist <= math.sqrt((self.pos.x - self.start_pos.x)**2 + (self.pos.y - self.start_pos.y)**2): self.hit = True self.rect = self.image.get_rect() self.rect.center = self.pos self.Explode() if self.hit == False and self.trail_anim != "None" and self.timer1.chrono(0.01): pos = vec(self.pos.x/self.glob.glob.glob.data["screen_width"], self.pos.y/self.glob.glob.glob.data["screen_height"]) Animation_Player(self.glob.glob.glob, self.trail_anim, 0.01, pos + vec(-0.005,0).rotate(-self.rot), self.rot, 0.003, 0.02, 6) """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du projectile cinetique si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.glob.glob.Resol_Check.change: if self.glob.glob.glob.data["screen_height"] == 720: self.pos = self.pos * (2/3) else: self.pos = self.pos * (3/2) self.image = self.image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.image = pg.transform.rotate(self.original_image, self.rot) self.rect = self.image.get_rect() self.rect.center = self.pos self.radius = int(self.rect.w/2) """ Fonction Explode - Fonctionnement : est lue dans la boucle update et verifie la condition self.hit. Si self.hit positif, alors lancer l'animation de l'explsion. """ def Explode(self): if self.hit == True: self.glob.glob.glob.sound_repertoire.append(self.explosion_sound) pos = vec(self.pos.x/self.glob.glob.glob.data["screen_width"], self.pos.y/self.glob.glob.glob.data["screen_height"]) Animation_Player(self.glob.glob.glob, self.explosion_anim, 0.01, pos, self.rot, 0.04, 0.071, 6) self.glob.glob.glob.all_virtuals.remove([self]) """ Classe Ballistic_Missile - But : gerer les parametres du missile balistique - Fonctionnement : dessiner le missile et le fait avancer selon sa vitesse et sa cible. Si collision, transmettre le dommage et jouer l'animation d'explosion, sinon dessiner une trainee de fumee. - Utilisation : la classe Ballistic_Missile() sera appelee quand le lance missile tire. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Ballistic_Missile(): def __init__(self, glob, image_file, speed, missile_rot_speed, damage, fire_sound, trail_anim, explosion_anim, explosion_sound): self.glob = glob self._layer = 5 # Layer of projectiles self._type = "func_sprite_prime" self.damage = damage self.rot = self.glob.rot + random.randint(-60,60) self.former_rot = 0 self.rot_speed = missile_rot_speed self.spd = vec(speed * (self.glob.glob.glob.data["screen_height"]/720), 0) # to be defined self.max_dist = self.glob.fire_range # to be defined self.pos = self.glob.pos + vec(self.glob.rect.w/2, 0).rotate(-self.rot) # to be defined self.start_pos = vec(self.pos.x, self.pos.y) self.rot_target = 0 self.hit = False self.trail_anim = trail_anim self.explosion_anim = explosion_anim self.explosion_sound = explosion_sound self.image_file = image_file self.image = image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.rect = self.image.get_rect() self.radius = int(self.rect.w/2) self.timer = Timer() self.timer1 = Timer() self.glob.glob.glob.sound_repertoire.append(fire_sound) if self.former_rot >= self.rot + 5 or self.former_rot <= self.rot -5: self.image = pg.transform.rotate(self.original_image, self.rot) self.former_rot = self.rot self.glob.glob.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : elle va modifier la position du missile balistique en fonction de sa vitesse et de sa cible. """ def update(self): rads = math.atan2(self.glob.glob.pin.y - self.pos.y, self.glob.glob.pin.x - self.pos.x) rads %= -2 * math.pi self.rot_target = math.degrees(-rads) Targeting(self) self.pos += self.spd.rotate(-self.rot) * self.glob.glob.glob.fps_stab self.pos.x += self.glob.glob.glob.map_instance.map_offset self.start_pos.x += self.glob.glob.glob.map_instance.map_offset if self.max_dist <= math.sqrt((self.pos.x - self.start_pos.x)**2 + (self.pos.y - self.start_pos.y)**2): self.hit = True self.rect = self.image.get_rect() self.rect.center = self.pos self.Explode() if self.hit == False and self.trail_anim != "None" and self.timer1.chrono(0.01): pos = vec(self.pos.x/self.glob.glob.glob.data["screen_width"], self.pos.y/self.glob.glob.glob.data["screen_height"]) self.image = pg.transform.rotate(self.original_image, self.rot) Animation_Player(self.glob.glob.glob, self.trail_anim, 0.05, pos + vec(-0.01,random.uniform(-0.002,0.002)).rotate(-self.rot), self.rot, 0.006, 0.05, 6) """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du missile balistique si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.glob.glob.Resol_Check.change: if self.glob.glob.glob.data["screen_height"] == 720: self.pos = self.pos * (2/3) else: self.pos = self.pos * (3/2) self.image = self.image_file self.image = pg.transform.scale(self.image, (math.ceil((self.image.get_rect().w / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)), math.ceil((self.image.get_rect().h / DIVIDENT) * (self.glob.glob.glob.data["screen_height"]/720)))) self.image = pg.transform.rotate(self.image, -90) self.original_image = self.image.copy() self.image = pg.transform.rotate(self.original_image, self.rot) self.rect = self.image.get_rect() self.rect.center = self.pos self.radius = int(self.rect.w/2) """ Fonction Explode - Fonctionnement : est lue dans la boucle update et verifie la condition self.hit. Si self.hit positif, alors lancer l'animation de l'explsion. """ def Explode(self): if self.hit == True: self.glob.glob.glob.sound_repertoire.append(self.explosion_sound) pos = vec(self.pos.x/self.glob.glob.glob.data["screen_width"], self.pos.y/self.glob.glob.glob.data["screen_height"]) Animation_Player(self.glob.glob.glob, self.explosion_anim, 0.01, pos, self.rot, 0.04, 0.071, 6) self.glob.glob.glob.all_virtuals.remove([self]) """ Classe Button - But : gerer les differents parametres du bouton - Fonctionnement : verifie les conditions: rest , hover et active (curseur au repos, curseur au-dessus, clique) - Utilisation : la classe Button() est appelee dans les interfaces utilisateurs (menu/menu cheat). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Button(): def __init__(self, glob, text, font, size, pos, w, h, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.text = text self.font = font self.size = size self.indicative_width = w self.indicative_height = h self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.border = 4 * (self.glob.data["screen_width"]/1280) self.rest_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.rest_image.fill((61, 209, 177, 255)) self.rest_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.rest_image_boder.fill((27, 32, 26, 230)) self.rest_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.original_rest_image = self.rest_image.copy() self.hover_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.hover_image.fill((83, 252, 241, 255)) self.hover_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.hover_image_boder.fill((27, 32, 26, 230)) self.hover_image.blit(self.hover_image_boder, (self.border/2,self.border/2)) self.original_hover_image = self.hover_image.copy() self.active_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.active_image.fill((221, 150, 37, 255)) self.active_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.active_image_boder.fill((27, 32, 26, 230)) self.active_image.blit(self.active_image_boder, (self.border/2,self.border/2)) self.original_active_image = self.active_image.copy() self.image = self.rest_image.copy() self.rect = self.image.get_rect() self.click = False self.active = False self.trigger = False self.rect.center = self.pos self.glob.all_virtuals.add([self]) self.caption = Text(self.glob, self.text, WHITE, self.font, self.size, pos, self._layer) """ Fonction update - Fonctionnement : elle va verifier les differents conditions du bouton en fonction de la position et l'etat de la souris (clique). """ def update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.rest_image = pg.transform.scale(self.original_rest_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.hover_image = pg.transform.scale(self.original_hover_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.active_image = pg.transform.scale(self.original_active_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.rest_image.copy() self.rect = self.image.get_rect() self.rect.center = self.pos if self.active == True: self.active = False if self.glob.mouse_pos.x > self.pos.x - (self.rect.w/2) and self.glob.mouse_pos.x < self.pos.x + (self.rect.w/2) and self.glob.mouse_pos.y > self.pos.y - (self.rect.h/2) and self.glob.mouse_pos.y < self.pos.y + (self.rect.h/2): # change button style to hover self.image = self.hover_image.copy() if pg.mouse.get_pressed()[0]: # change button style to pressing self.click = True self.image = self.active_image.copy() else: if self.click: self.click = False self.active = True self.trigger = True else: self.click = False self.image = self.rest_image.copy() if self.active: self.glob.sound_repertoire.append(self.glob.sounds[12]) """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du bouton si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.rest_image = pg.transform.scale(self.original_rest_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.hover_image = pg.transform.scale(self.original_hover_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.active_image = pg.transform.scale(self.original_active_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.rest_image.copy() self.rect = self.image.get_rect() self.rect.center = self.pos def change(self): self.caption.text = self.text self.caption.change() self.rect.center = self.pos """ Classe Image_Button - But : gerer les differents parametres du bouton a image - Fonctionnement : verifie les conditions: rest , hover et active (curseur au repos, curseur au-dessus, clique) - Utilisation : la classe Image_Button() est appelee dans les interfaces utilisateurs (crossfader dans le menu option). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Image_Button(): def __init__(self, glob, rest_image, hover_image, active_image, pos, w, h, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.indicative_width = w self.indicative_height = h self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.original_rest_image = rest_image.copy() self.rest_image = pg.transform.scale(self.original_rest_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.original_hover_image = hover_image.copy() self.hover_image = pg.transform.scale(self.original_hover_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.original_active_image = active_image.copy() self.active_image = pg.transform.scale(self.original_active_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.rest_image.copy() self.rect = self.image.get_rect() self.click = False self.active = False self.trigger = False self.rect.center = self.pos self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : elle va verifier les differents conditions du bouton image en fonction de la position et l'etat de la souris (clique). """ def update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.rest_image = pg.transform.scale(self.original_rest_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.hover_image = pg.transform.scale(self.original_hover_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.active_image = pg.transform.scale(self.original_active_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.rest_image.copy() self.rect = self.image.get_rect() self.rect.center = self.pos if self.active == True: self.active = False if self.image == self.hover_image: self.image = self.rest_image if self.glob.mouse_pos.x > self.pos.x - (self.rect.w/2) and self.glob.mouse_pos.x < self.pos.x + (self.rect.w/2) and self.glob.mouse_pos.y > self.pos.y - (self.rect.h/2) and self.glob.mouse_pos.y < self.pos.y + (self.rect.h/2): # change button style to hover self.image = self.hover_image if pg.mouse.get_pressed()[0]: # change button style to pressing self.click = True else: if self.click: self.click = False self.active = True self.trigger = True if self.click == True and pg.mouse.get_pressed()[0]: self.image = self.active_image elif self.click == True: self.click = False self.image = self.rest_image if self.active: self.glob.sound_repertoire.append(self.glob.sounds[12]) """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du bouton image si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.rest_image = pg.transform.scale(self.original_rest_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.hover_image = pg.transform.scale(self.original_hover_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.active_image = pg.transform.scale(self.original_active_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.rest_image.copy() self.rect = self.image.get_rect() self.rect.center = self.pos def change(self): self.rect.center = self.pos """ Classe Text - But : gerer les differents parametres du texte - Fonctionnement : transfomre un texte en image selon des parametres definis - Utilisation : la classe Text() est appelee dans les interfaces utilisateurs (menu/menu cheat). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Text(): def __init__(self, glob, text, color, font_name, size, pos, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.text = text self.color = color self.font_name = font_name self.size = size self.font = self.Roboto_Light_Font = pg.font.Font('files/fonts/{}.ttf'.format(self.font_name), int(self.size * (self.glob.data["screen_width"]/1280))) self.hidden = False self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.image = self.font.render("{}".format(self.text), False, self.color) self.rect = self.image.get_rect() self.rect.center = self.pos self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : change la position et la taille du texte si la resolution de l'ecran est modifiee. """ def update(self): #Check for resol. change and update if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.font = self.Roboto_Light_Font = pg.font.Font('files/fonts/{}.ttf'.format(self.font_name), int(self.size * (self.glob.data["screen_width"]/1280))) self.image = self.font.render("{}".format(self.text), False, self.color) self.rect = self.image.get_rect() self.rect.center = self.pos """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du texte si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.font = self.Roboto_Light_Font = pg.font.Font('files/fonts/{}.ttf'.format(self.font_name), int(self.size * (self.glob.data["screen_width"]/1280))) self.image = self.font.render("{}".format(self.text), False, self.color) self.rect = self.image.get_rect() self.rect.center = self.pos if self.hidden: self.image.set_alpha(0) else: self.image.set_alpha(255) """ Fonction change - Fonctionnement : valide les modifications de texte ou de position faites par une classe associee. """ def change(self): self.image = self.font.render("{}".format(self.text), False, self.color) if self.hidden: self.image.set_alpha(0) else: self.image.set_alpha(255) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Decorated_Text - But : encadrer un texte dans un rectangle colore - Fonctionnement : transfomre un texte en image selon des parametres definis et le colle par dessus un rectange de couleur - Utilisation : la classe Decorated_Text() est appelee dans les interfaces utilisateurs principalement comme titre (menu/menu cheat). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Decorated_Text(): def __init__(self, glob, text, color, font, size, pos, w, h, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.text = text self.font = font self.size = size self.indicative_width = w self.indicative_height = h self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.border = 4 * (self.glob.data["screen_width"]/1280) self.bar_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"]))) self.bar_image.fill((221, 150, 37, 255)) self.bar_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border)) self.bar_image_boder.fill((27, 32, 26, 230)) self.bar_image.blit(self.bar_image_boder, (self.border/2,self.border/2)) self.original_bar_image = self.bar_image.copy() self.image = self.bar_image.copy() self.hidden = False self.rect = self.image.get_rect() self.rect.center = self.pos self.glob.all_virtuals.add([self]) self.caption = Text(self.glob, self.text, color, self.font, self.size, pos, self._layer) """ Fonction update - Fonctionnement : change la position et la taille du texte, ainsi que son rectangle si la resolution de l'ecran est modifiee. """ def update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.bar_image = pg.transform.scale(self.original_bar_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.bar_image.copy() self.rect = self.image.get_rect() self.rect.center = self.pos self.caption.pos = self.pos self.caption.change() """ Fonction prime_update - Fonctionnement : change la position et la taille du texte, ainsi que son rectangle si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.bar_image = pg.transform.scale(self.original_bar_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = self.bar_image.copy() self.rect = self.image.get_rect() self.rect.center = self.pos self.caption.pos = self.pos self.caption.change() if self.hidden: self.image.set_alpha(0) self.caption.hidden = True else: self.image.set_alpha(255) self.caption.hidden = False self.caption.pos = self.pos self.caption.change() """ Fonction change - Fonctionnement : valide les modifications de texte, de taille de rectangle ou de position faites par une classe associee. """ def change(self): self.caption.text = self.text if self.hidden: self.image.set_alpha(0) self.caption.hidden = True else: self.image.set_alpha(255) self.caption.hidden = False self.caption.pos = self.pos self.caption.change() self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Progression_Bar - But : gerer les differents parametres d'une barre de progression. - Fonctionnement : va dessiner un rectangle de couleur proportionnel à progression (self.progression). - Utilisation : la classe Progression_Bar() est appelee dans le jeu pour representer une progression (vie, temps de contruction, [...]). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Progression_Bar(): def __init__(self, glob, pos, w, h, color, direct, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.indicative_width = w self.indicative_height = h self.width = self.indicative_width * self.glob.data["screen_width"] self.height = self.indicative_height * self.glob.data["screen_height"] self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.progression = 1 self.direct = direct self.color = color self.image = pg.Surface(((self.width),(self.height))) self.bar_image = pg.Surface((self.width,self.height)) self.bar_image.fill((27, 32, 26, 230)) self.prg_bar_image = pg.Surface(((self.width),self.height)) self.prg_bar_image.fill(self.color) self.image.blit(self.bar_image, (0,0)) self.hidden = False self.rect = self.image.get_rect() self.rect.center = self.pos self.glob.all_virtuals.add([self]) def update(self): pass """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille de la barre de progression si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.width = self.indicative_width * self.glob.data["screen_width"] self.height = self.indicative_height * self.glob.data["screen_height"] self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.image = pg.Surface(((self.width),(self.height))) self.bar_image = pg.Surface((self.width,self.height)) self.bar_image.fill((27, 32, 26, 230)) self.prg_bar_image = pg.Surface((self.width,self.height)) self.prg_bar_image.fill(self.color) self.image.blit(self.bar_image, (0,0)) if self.direct == "Left": self.image.blit(self.prg_bar_image, (-self.width*(1-self.progression),0)) else: self.image.blit(self.prg_bar_image, (self.width*(1-self.progression),0)) self.rect = self.image.get_rect() self.rect.center = self.pos if self.hidden: self.image.set_alpha(0) else: self.image.set_alpha(255) """ Fonction change - Fonctionnement : valide les modifications de la barre de progression (prends en compte la variable self.progression), de taille de rectangle ou de position faites par une classe associee. """ def change(self): if self.hidden: self.image.set_alpha(0) else: self.image.set_alpha(255) self.image = pg.Surface(((self.width),(self.height))) self.image.blit(self.bar_image, (0,0)) if self.direct == "Left": self.image.blit(self.prg_bar_image, (-self.width*(1-self.progression),0)) else: self.image.blit(self.prg_bar_image, (self.width*(1-self.progression),0)) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Sound_Pitcher - But : gerer les differents parametres cross fader et permettre a l'utilisateur de changer le volume sonore. - Fonctionnement : modifie le volume sonore selon la position du curseur (crossfader). - Utilisation : la classe Sound_Pitcher() est appelee dans les le menu options. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Sound_Pitcher(): def __init__(self, glob, pos, width, data_name, layer): self.glob = glob self._layer = layer self._type = "func_prime" self.data_name = data_name self.indicative_pos = pos self.indicative_width = width self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.width = self.indicative_width * self.glob.data["screen_width"] self.cursor_pos_x = self.glob.data[self.data_name]*((self.indicative_pos.x + self.indicative_width/2) - (self.indicative_pos.x - self.indicative_width/2)) + (self.indicative_pos.x - self.indicative_width/2) #self.fond = Picture(self.glob, pg.Surface((500,500)), self.pos, self.width, 10, 7) #self.fond.image.fill(BLACK) self.line = Image(self.glob, pg.Surface((1,1), pg.SRCALPHA), self.indicative_pos, self.indicative_width, 0.0025, self._layer) self.line.image.fill((255,255,255,200)) Image(self.glob, self.glob.sprite["interface"][4], self.indicative_pos + vec(-self.indicative_width/2 - 0.012,0), 0.007, 0.025, self._layer) Image(self.glob, self.glob.sprite["interface"][5], self.indicative_pos + vec(self.indicative_width/2 + 0.012,0), 0.007, 0.025, self._layer) self.button = Image_Button(self.glob, self.glob.sprite["interface"][1],self.glob.sprite["interface"][2], self.glob.sprite["interface"][3], vec(self.cursor_pos_x, self.indicative_pos.y), 0.015625, 0.0277778, self._layer) #self.button = Button(self.glob, dimensions de base, position, redimensionnage (x,y), layer 7) self.glob.all_virtuals.add([self]) Text(self.glob, self.data_name, WHITE, "Kanit-Regular", 25, self.indicative_pos + vec(0,-0.05), self._layer) """ Fonction update - Fonctionnement : elle va verifier les differents conditions du cross fader en fonction de la position du curseur. """ def update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.width = self.indicative_width * self.glob.data["screen_width"] self.cursor_pos_x = self.glob.data[self.data_name]*((self.indicative_pos.x + self.indicative_width/2) - (self.indicative_pos.x - self.indicative_width/2)) + (self.indicative_pos.x - self.indicative_width/2) self.button.pos.x = self.cursor_pos_x * self.glob.data["screen_width"] self.button.change() self.line.image.fill((255,255,255,200)) if self.button.click: self.button.pos.x = self.glob.mouse_pos.x if self.button.pos.x < self.pos.x - self.width/2: self.button.pos.x = self.pos.x - self.width/2 elif self.button.pos.x > self.pos.x + self.width/2: self.button.pos.x = self.pos.x + self.width/2 try: self.glob.data[self.data_name] = (self.button.pos.x - (self.pos.x - self.width/2))/((self.pos.x + self.width/2) - (self.pos.x - self.width/2)) except: self.glob.data[self.data_name] = 0 if self.data_name == "music_sound_lvl": pg.mixer.music.set_volume(self.glob.data["music_sound_lvl"]) elif self.data_name == "fx_sound_lvl": for i in self.glob.sounds: i.set_volume(self.glob.data["fx_sound_lvl"]) self.button.change() """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille du cross fader si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.width = self.indicative_width * self.glob.data["screen_width"] self.cursor_pos_x = self.glob.data[self.data_name]*((self.indicative_pos.x + self.indicative_width/2) - (self.indicative_pos.x - self.indicative_width/2)) + (self.indicative_pos.x - self.indicative_width/2) self.button.pos.x = self.cursor_pos_x * self.glob.data["screen_width"] self.button.change() self.line.image.fill((255,255,255,200)) def change(self): pass """ Classe Image() - But : gerer les differents parametres d'une image. - Fonctionnement : transfomre et positionne une image en fonction des parametres definis. - Utilisation : la classe Image() est appelee dans les interfaces utilisateurs (menu). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Image(): def __init__(self, glob, image, pos, w, h, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.indicative_width = w self.indicative_height = h self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.original_image = image self.image = pg.transform.scale(self.original_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.center = self.pos self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : change la position et la taille de l'image, ainsi que son rectangle si la resolution de l'ecran est modifiee. """ def update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.image = pg.transform.scale(self.original_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.center = self.pos """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille de l'image, ainsi que son rectangle si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.image = pg.transform.scale(self.original_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.center = self.pos def change(self): self.image = pg.transform.scale(self.original_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Animation_Player - But : jouer une animation de sprites - Fonctionnement : a intervalle regulier, va lire progressivement (du debut a la fin) toutes les images contenues dans une liste. - Utilisation : la classe Animation_Player() est appelee par des classes (exposion des projectiles, feu d'un tank détruit). Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Animation_Player(): def __init__(self, glob, animation, interval, pos, rot, w, h, layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.indicative_width = w self.indicative_height = h self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.rot = rot self.animation = animation self.anim_count = 0 self.interval = interval self.sprite_count = len(self.animation) self.original_image = animation[0] self.image = pg.transform.scale(self.original_image, (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = pg.transform.rotate(self.image, self.rot - 90) self.rect = self.image.get_rect() self.rect.center = self.pos self.timer =Timer() self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : lit selon un intervalle defini une suite d'images resulant en une animation """ def update(self): self.pos.x += self.glob.map_instance.map_offset if self.timer.chrono(self.interval): self.anim_count += 1 self.image = pg.transform.scale(self.animation[self.anim_count], (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = pg.transform.rotate(self.image, self.rot - 90) self.rect = self.image.get_rect() self.rect.center = self.pos if self.anim_count + 1 >= self.sprite_count: self.glob.all_virtuals.remove([self]) """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille des frames de l'animation si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: if self.glob.data["screen_height"] == 720: self.pos = self.pos * (2/3) else: self.pos = self.pos * (3/2) self.image = pg.transform.scale(self.animation[self.anim_count], (int(self.indicative_width * self.glob.data["screen_width"]), int(self.indicative_height * self.glob.data["screen_height"]))) self.image = pg.transform.rotate(self.image, self.rot - 90) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Game_Frame - But : placer la barre du haut et la barre du bas dans l'interface du jeu - Fonctionnement : placer les barres du jeu. - Utilisation : la classe Game_Frame() est appelee dans les le jeu. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Game_Frame(): def __init__(self, glob,layer): self.glob = glob self._layer = layer self._type = "func_sprite_prime" self.pos = vec(self.glob.data["screen_width"]/2, self.glob.data["screen_height"]/2) self.border = 2 * (self.glob.data["screen_width"]/1280) self.top_bar = pg.Surface(((1.0 * self.glob.data["screen_width"]),(0.08 * self.glob.data["screen_height"])), pg.SRCALPHA) self.top_bar.fill((61, 209, 177, 255)) self.top_bar_boder = pg.Surface(((1.0 * self.glob.data["screen_width"])-self.border,(0.08 * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.top_bar_boder.fill((27, 32, 26, 230)) self.top_bar.blit(self.top_bar_boder, (self.border/2,self.border/2)) self.bottom_bar = pg.Surface(((1.0 * self.glob.data["screen_width"]),(0.1 * self.glob.data["screen_height"])), pg.SRCALPHA) self.bottom_bar.fill((61, 209, 177, 255)) self.bottom_bar_boder = pg.Surface(((1.0 * self.glob.data["screen_width"])-self.border,(0.1 * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.bottom_bar_boder.fill((27, 32, 26, 230)) self.bottom_bar.blit(self.bottom_bar_boder, (self.border/2,self.border/2)) self.image = pg.Surface((self.glob.data["screen_width"],self.glob.data["screen_height"]), pg.SRCALPHA) self.image.blit(self.top_bar, (0,0)) self.image.blit(self.bottom_bar, (0,(0.9 * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.center = self.pos self.glob.all_virtuals.add([self]) def update(self): pass """ Fonction prime_update - Fonctionnement : sera lue quand la classe est gelee / change la position et la taille des barres si la resolution de l'ecran est modifiee. """ def prime_update(self): if self.glob.Resol_Check.change: self.pos = vec(self.glob.data["screen_width"]/2, self.glob.data["screen_height"]/2) self.border = 2 * (self.glob.data["screen_width"]/1280) self.top_bar = pg.Surface(((1.0 * self.glob.data["screen_width"]),(0.08 * self.glob.data["screen_height"])), pg.SRCALPHA) self.top_bar.fill((61, 209, 177, 255)) self.top_bar_boder = pg.Surface(((1.0 * self.glob.data["screen_width"])-self.border,(0.08 * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.top_bar_boder.fill((27, 32, 26, 230)) self.top_bar.blit(self.top_bar_boder, (self.border/2,self.border/2)) self.bottom_bar = pg.Surface(((1.0 * self.glob.data["screen_width"]),(0.1 * self.glob.data["screen_height"])), pg.SRCALPHA) self.bottom_bar.fill((61, 209, 177, 255)) self.bottom_bar_boder = pg.Surface(((1.0 * self.glob.data["screen_width"])-self.border,(0.1 * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.bottom_bar_boder.fill((27, 32, 26, 230)) self.bottom_bar.blit(self.bottom_bar_boder, (self.border/2,self.border/2)) self.image = pg.Surface((self.glob.data["screen_width"],self.glob.data["screen_height"]), pg.SRCALPHA) self.image.blit(self.top_bar, (0,0)) self.image.blit(self.bottom_bar, (0,(0.9 * self.glob.data["screen_height"]))) self.rect = self.image.get_rect() self.rect.center = self.pos """ Classe Selection_Button - But : gerer la selection des vehicules a placer dans la barre de construction. - Fonctionnement : va contenir un prix, un nom de vehicule et une image. Va communiquer ses donnees avec Build_Button() pour placer un vehicule dans le menu de construction. - Utilisation : la classe Selection_Button() est appelee dans les le menu de selection. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Selection_Button(): def __init__(self, glob, pos, w, h, Object, button_num, layer): self.glob = glob self._layer = layer self._type = "func_sprite" self.indicative_width = w self.indicative_height = h self.width = self.indicative_width * self.glob.data["screen_width"] self.height = self.indicative_height * self.glob.data["screen_height"] self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.button_num = button_num self.object = "{}".format(Object) self.price = 0 self.selection = False #Tank frame icons self.frame = [] self.border = 4 * (self.glob.data["screen_width"]/1280) self.rest_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.rest_image.fill((61, 209, 177, 255)) self.rest_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.rest_image_boder.fill((27, 32, 26, 230)) self.rest_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.hover_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.hover_image.fill((83, 252, 241, 255)) self.hover_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.hover_image_boder.fill((27, 32, 26, 230)) self.hover_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.active_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.active_image.fill((221, 150, 37, 255)) self.active_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.active_image_boder.fill((27, 32, 26, 230)) self.active_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.inactive_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"])), pg.SRCALPHA) self.inactive_image.fill((41, 109, 97, 255)) self.inactive_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.inactive_image_boder.fill((17, 22, 16, 230)) self.inactive_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.price_tag = Decorated_Text(self.glob, "-{}".format(self.price), WHITE_BLUE, "Roboto-Light", 10, self.indicative_pos - vec(0, 0.04), self.indicative_width , 0.02, self._layer) self.image = self.rest_image.copy() self.estimation() #self.price += self.price * reduc #self.build_time += self.build_time * reduc self.price_tag.text = "-{}".format(self.price) self.price_tag.change() self.rect = self.image.get_rect() self.click = False self.active = False self.trigger = False self.rect.center = self.pos self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : elle va verifier les differentes conditions du bouton de selection en fonction de la position du curseur et partager ses donnees avec self.glob.mouse_select_holder. """ def update(self): if self.price <= self.glob.data["credit"]: if self.glob.mouse_pos.x > self.pos.x - (self.rect.w/2) and self.glob.mouse_pos.x < self.pos.x + (self.rect.w/2) and self.glob.mouse_pos.y > self.pos.y - (self.rect.h/2) and self.glob.mouse_pos.y < self.pos.y + (self.rect.h/2): # change button style to hover self.image = self.hover_image.copy() phenotype(self) if pg.mouse.get_pressed()[0]: # change button style to pressing self.click = True self.image = self.active_image.copy() phenotype(self) else: if self.click: self.click = False self.active = True self.trigger = True else: self.image = self.rest_image.copy() phenotype(self) self.click = False else: self.image = self.inactive_image.copy() phenotype(self) if self.object == self.glob.mouse_select_holder: self.image = self.active_image.copy() phenotype(self) # state of the button if self.active == True: self.active = False self.selection = True self.glob.mouse_select_holder = self.object if self.selection == True and self.glob.mouse_pos.y < 0.9 * self.glob.data["screen_height"]: if pg.mouse.get_pressed()[0] or pg.mouse.get_pressed()[1] or pg.mouse.get_pressed()[2]: self.selection = False self.glob.mouse_select_holder = "None" if self.selection == True and self.glob.mouse_select_holder == "None" and self.glob.mouse_pos.y > 0.9 * self.glob.data["screen_height"]: self.glob.data["credit"] -= self.price self.selection = False def change(self): self.rect.center = self.pos """ Fonction estimation - Fonctionnement : va lier un prix a un nom de tank. """ def estimation(self): if self.object == "Rover_1": self.price = 25 elif self.object == "Rover_2": self.price = 40 elif self.object == "Rover_3": self.price = 60 elif self.object == "Rover_4": self.price = 85 elif self.object == "Rover_5": self.price = 120 elif self.object == "Rocket_1": self.price = 50 elif self.object == "Rocket_2": self.price = 65 elif self.object == "Rocket_3": self.price = 95 elif self.object == "Rocket_4": self.price = 140 elif self.object == "Panther_1": self.price = 40 elif self.object == "Panther_2": self.price = 60 elif self.object == "Panther_3": self.price = 85 elif self.object == "Panther_4": self.price = 120 elif self.object == "Flak_1": self.price = 35 elif self.object == "Flak_2": self.price = 50 elif self.object == "Flak_3": self.price = 75 elif self.object == "Flak_4": self.price = 100 elif self.object == "Flak_5": self.price = 120 elif self.object == "Tanker_1": self.price = 50 elif self.object == "Tanker_2": self.price = 85 elif self.object == "Tanker_3": self.price = 125 elif self.object == "Tanker_4": self.price = 150 self.price -= int(self.price * (self.glob.data["equip_cost_lvl"] / 15)) phenotype(self) """ Classe Upgrade_Button - But : gerer les differents parametres du bouton d'amelioration et permettre a l'utilisateur de debloquer des amelioration. - Fonctionnement : le bouton contient un prix qui est soustrait aux credits du joueur s'il le selectionne et va debloquer une amelioration. - Utilisation : la classe Upgrade_Button() est appelee dans les le menu des emelioration. Cette classe est ajoutee aux Virtuals() sa fonction update() sera donc lue chaque boucle. """ class Upgrade_Button(): def __init__(self, glob, pos, w, h, Object, button_num, layer): # button num or evel lvl self.glob = glob self._layer = layer self._type = "func_sprite" self.indicative_width = w self.indicative_height = h self.width = self.indicative_width * self.glob.data["screen_width"] self.height = self.indicative_height * self.glob.data["screen_height"] self.indicative_pos = pos self.pos = vec(self.indicative_pos.x * self.glob.data["screen_width"], self.indicative_pos.y * self.glob.data["screen_height"]) self.button_num = button_num self.object = "{}".format(Object) self.price = 0 self.selection = False self.state = "None" #Tank frame icons self.frame = [] self.border = 4 * (self.glob.data["screen_width"]/1280) self.rest_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"]))) self.rest_image.fill((61, 209, 177, 255)) self.rest_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.rest_image_boder.fill((27, 32, 26, 230)) self.rest_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.hover_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"]))) self.hover_image.fill((83, 252, 241, 255)) self.hover_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border), pg.SRCALPHA) self.hover_image_boder.fill((27, 32, 26, 230)) self.hover_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.active_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"]))) self.active_image.fill((221, 150, 37, 255)) self.active_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border)) self.active_image_boder.fill((27, 32, 26, 230)) self.active_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.inactive_image = pg.Surface(((self.indicative_width * self.glob.data["screen_width"]),(self.indicative_height * self.glob.data["screen_height"]))) self.inactive_image.fill((41, 109, 97, 255)) self.inactive_image_boder = pg.Surface(((self.indicative_width * self.glob.data["screen_width"])-self.border,(self.indicative_height * self.glob.data["screen_height"])-self.border)) self.inactive_image_boder.fill((17, 22, 16, 230)) self.inactive_image.blit(self.rest_image_boder, (self.border/2,self.border/2)) self.price_tag = Decorated_Text(self.glob, "-{}".format(self.price), WHITE_BLUE, "Roboto-Light", 10, self.indicative_pos - vec(0, 0.04), self.indicative_width , 0.02, self._layer) if self.glob.data["{}".format(self.object)] < self.button_num: self.state = "Locked" self.image = self.inactive_image.copy() self.estimation() self.price_tag.text = "-{}".format(self.price) icon(self, self.glob.sprite["interface"][25], vec(0,0), 0.7) self.price_tag.hidden = False if self.glob.data["{}".format(self.object)] + 1 < self.button_num: self.image.set_alpha(0) self.price_tag.hidden = True self.price_tag.change() elif self.glob.data["{}".format(self.object)] >= self.button_num: self.state = "Earned" self.image = self.active_image.copy() phenotype(self) self.image.set_alpha(255) self.price_tag.hidden = True self.price_tag.change() self.rect = self.image.get_rect() self.click = False self.active = False self.trigger = False self.rect.center = self.pos self.glob.all_virtuals.add([self]) """ Fonction update - Fonctionnement : elle va verifier les differentes conditions du bouton amelioration en fonction de la position du curseur et partager ses donnees avec self.glob.data[objet]. """ def update(self): if self.state == "Locked" and self.glob.data["{}".format(self.object)] + 1 >= self.button_num: self.image.set_alpha(255) if self.price <= self.glob.data["credit"]: if self.glob.mouse_pos.x > self.pos.x - (self.rect.w/2) and self.glob.mouse_pos.x < self.pos.x + (self.rect.w/2) and self.glob.mouse_pos.y > self.pos.y - (self.rect.h/2) and self.glob.mouse_pos.y < self.pos.y + (self.rect.h/2): # change button style to hover self.image = self.hover_image.copy() phenotype(self) if pg.mouse.get_pressed()[0]: # change button style to pressing self.click = True self.image = self.active_image.copy() phenotype(self) else: if self.click: self.click = False self.active = True self.trigger = True else: self.image = self.rest_image.copy() phenotype(self) self.click = False else: self.image = self.inactive_image.copy() phenotype(self) icon(self, self.glob.sprite["interface"][25], vec(0,0), 0.7) self.price_tag.hidden = False self.price_tag.text = "-{}".format(self.price) self.change() # state of the button if self.active == True: self.active = False self.glob.sound_repertoire.append(self.glob.sounds[10]) self.state = "Earned" self.image = self.active_image.copy() phenotype(self) self.price_tag.hidden = True self.price_tag.change() self.glob.data["{}".format(self.object)] += 1 self.glob.data["credit"] -= self.price def change(self): self.rect.center = self.pos self.price_tag.change() """ Fonction estimation - Fonctionnement : va lier un prix a un nom d'amelioration. """ def estimation(self): if self.object == "credit_gain_lvl": self.price = 250 + 150 * (self.button_num - 1) elif self.object == "cannon_1_lvl": self.price = 50 + 75 * (self.button_num - 1) elif self.object == "cannon_2_lvl": self.price = 50 + 75 * (self.button_num - 1) elif self.object == "cannon_3_lvl": self.price = 85 + 75 * (self.button_num - 1) elif self.object == "cannon_4_lvl": self.price = 150 + 100 * (self.button_num - 1) elif self.object == "base_shielding_lvl": self.price = 75 + 45 * (self.button_num - 1) elif self.object == "energy_production_lvl": self.price = 75 + 75 * (self.button_num - 1) elif self.object == "energy_storage_lvl": self.price = 50 + 75 * (self.button_num - 1) elif self.object == "build_time_lvl": self.price = 85 + 75 * (self.button_num - 1) if self.object == "equip_cost_lvl": self.price = 65 + 75 * (self.button_num - 1) elif self.object == "build_slots": self.price = 50 + 125 * (self.button_num - 1) elif self.object == "rover_lvl": self.price = 50 + 125 * (self.button_num - 1) elif self.object == "rocket_lvl": self.price = 150 + 125 * (self.button_num - 1) elif self.object == "panther_lvl": self.price = + 75 + 125 * (self.button_num - 1) elif self.object == "flak_lvl": self.price = 75 + 125 * (self.button_num - 1) elif self.object == "tanker_lvl": self.price = 100 + 125 * (self.button_num - 1) phenotype(self) """ Fonction icon - Fonctionnement : permets de coller une image sur une autre image en modifiant sa position et/ou sa taille. """ # Separate function def icon(self, img, pos_adj, shrink): height = int((img.get_rect().h * (self.height / img.get_rect().h) - self.border)*shrink) width = int((img.get_rect().w * (height/img.get_rect().h))) center = vec((self.width - width)/2 + pos_adj.x * self.glob.data["screen_width"] , (self.height - height)/2+ pos_adj.y * self.glob.data["screen_width"]) self.image.blit(pg.transform.scale(img, (width , height)), (center.x,center.y)) """ Fonction phenotype - Fonctionnement : permets de faire un collage de differents images permettant de creer une icone complexe en fonction du nom de l'objet. """ def phenotype(self): if self.object == "Rover_1": self.frame.append(icon(self, self.glob.sprite["obj"][2], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][41], vec(0,0.002), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.object == "Rover_2": self.frame.append(icon(self, self.glob.sprite["obj"][3], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][42], vec(0,0.002), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.object == "Rover_3": self.frame.append(icon(self, self.glob.sprite["obj"][4], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][43], vec(0,0.002), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.object == "Rover_4": self.frame.append(icon(self, self.glob.sprite["obj"][5], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.009), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][44], vec(0,0.002), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) elif self.object == "Rover_5": self.frame.append(icon(self, self.glob.sprite["obj"][6], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][40], vec(0,-0.009), 0.3)) self.frame.append(icon(self, self.glob.sprite["obj"][45], vec(0,0.002), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][15], vec(0.008,0.008), 0.4)) elif self.object == "Rocket_1": self.frame.append(icon(self, self.glob.sprite["obj"][7], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][46], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.object == "Rocket_2": self.frame.append(icon(self, self.glob.sprite["obj"][8], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][47], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.object == "Rocket_3": self.frame.append(icon(self, self.glob.sprite["obj"][9], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][48], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.object == "Rocket_4": self.frame.append(icon(self, self.glob.sprite["obj"][11], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][49], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) elif self.object == "Panther_1": self.frame.append(icon(self, self.glob.sprite["obj"][11], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][50], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.object == "Panther_2": self.frame.append(icon(self, self.glob.sprite["obj"][12], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][51], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.object == "Panther_3": self.frame.append(icon(self, self.glob.sprite["obj"][13], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][52], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.object == "Panther_4": self.frame.append(icon(self, self.glob.sprite["obj"][14], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][53], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) elif self.object == "Flak_1": self.frame.append(icon(self, self.glob.sprite["obj"][11], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][54], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.object == "Flak_2": self.frame.append(icon(self, self.glob.sprite["obj"][12], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][55], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.object == "Flak_3": self.frame.append(icon(self, self.glob.sprite["obj"][13], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][56], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.object == "Flak_4": self.frame.append(icon(self, self.glob.sprite["obj"][14], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][57], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) elif self.object == "Flak_5": self.frame.append(icon(self, self.glob.sprite["obj"][14], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][58], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][15], vec(0.008,0.008), 0.4)) elif self.object == "Tanker_1": self.frame.append(icon(self, self.glob.sprite["obj"][15], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.object == "Tanker_2": self.frame.append(icon(self, self.glob.sprite["obj"][16], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.object == "Tanker_3": self.frame.append(icon(self, self.glob.sprite["obj"][17], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.object == "Tanker_4": self.frame.append(icon(self, self.glob.sprite["obj"][18], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) elif self.object == "BaseDefence_1": self.frame.append(icon(self, self.glob.sprite["obj"][24], vec(0,0), 1)) elif self.object == "BaseDefence_2": self.frame.append(icon(self, self.glob.sprite["obj"][29], vec(0,0), 1)) elif self.object == "BaseDefence_3": self.frame.append(icon(self, self.glob.sprite["obj"][30], vec(0,0), 1)) elif self.object == "credit_gain_lvl": self.frame.append(icon(self, self.glob.sprite["interface"][23], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][8], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "cannon_1_lvl": self.frame.append(icon(self, self.glob.sprite["obj"][29], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "cannon_2_lvl": self.frame.append(icon(self, self.glob.sprite["obj"][29], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "cannon_3_lvl": self.frame.append(icon(self, self.glob.sprite["obj"][28], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "cannon_4_lvl": self.frame.append(icon(self, self.glob.sprite["obj"][30], vec(0,0), 0.7)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "base_shielding_lvl": self.frame.append(icon(self, self.glob.sprite["interface"][22], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "energy_production_lvl": self.frame.append(icon(self, self.glob.sprite["interface"][20], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][6], vec(-0.008,-0.008), 0.6)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "energy_storage_lvl": self.frame.append(icon(self, self.glob.sprite["interface"][7], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][6], vec(-0.008,-0.008), 0.6)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "build_time_lvl": self.frame.append(icon(self, self.glob.sprite["interface"][20], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "equip_cost_lvl": self.frame.append(icon(self, self.glob.sprite["interface"][26], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][8], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "build_slots": self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "rover_lvl": if self.button_num == 1: self.frame.append(icon(self, self.glob.sprite["obj"][2], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][41], vec(0,0.002), 1)) elif self.button_num == 2: self.frame.append(icon(self, self.glob.sprite["obj"][3], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][42], vec(0,0.002), 1)) elif self.button_num == 3: self.frame.append(icon(self, self.glob.sprite["obj"][4], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][43], vec(0,0.002), 1)) elif self.button_num == 4: self.frame.append(icon(self, self.glob.sprite["obj"][5], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.009), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][44], vec(0,0.002), 1)) elif self.button_num == 5: self.frame.append(icon(self, self.glob.sprite["obj"][6], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][40], vec(0,-0.009), 0.3)) self.frame.append(icon(self, self.glob.sprite["obj"][45], vec(0,0.002), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "rocket_lvl": if self.button_num == 1: self.frame.append(icon(self, self.glob.sprite["obj"][7], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][46], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.button_num == 2: self.frame.append(icon(self, self.glob.sprite["obj"][8], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][47], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.button_num == 3: self.frame.append(icon(self, self.glob.sprite["obj"][9], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][48], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.button_num == 4: self.frame.append(icon(self, self.glob.sprite["obj"][11], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,-0.003), 0.5)) self.frame.append(icon(self, self.glob.sprite["obj"][49], vec(0,0.0085), 0.3)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "panther_lvl": if self.button_num == 1: self.frame.append(icon(self, self.glob.sprite["obj"][11], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][50], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.button_num == 2: self.frame.append(icon(self, self.glob.sprite["obj"][12], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][51], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.button_num == 3: self.frame.append(icon(self, self.glob.sprite["obj"][13], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][52], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.button_num == 4: self.frame.append(icon(self, self.glob.sprite["obj"][14], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][53], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "flak_lvl": if self.button_num == 1: self.frame.append(icon(self, self.glob.sprite["obj"][11], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][54], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.button_num == 2: self.frame.append(icon(self, self.glob.sprite["obj"][12], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][55], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.button_num == 3: self.frame.append(icon(self, self.glob.sprite["obj"][13], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][56], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.button_num == 4: self.frame.append(icon(self, self.glob.sprite["obj"][14], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][57], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) elif self.button_num == 5: self.frame.append(icon(self, self.glob.sprite["obj"][14], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][58], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["interface"][15], vec(0.008,0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4)) elif self.object == "tanker_lvl": if self.button_num == 1: self.frame.append(icon(self, self.glob.sprite["obj"][15], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][11], vec(0.008,0.008), 0.4)) elif self.button_num == 2: self.frame.append(icon(self, self.glob.sprite["obj"][16], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][12], vec(0.008,0.008), 0.4)) elif self.button_num == 3: self.frame.append(icon(self, self.glob.sprite["obj"][17], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][13], vec(0.008,0.008), 0.4)) elif self.button_num == 4: self.frame.append(icon(self, self.glob.sprite["obj"][18], vec(0,0), 1)) self.frame.append(icon(self, self.glob.sprite["obj"][39], vec(0,0), 0.5)) self.frame.append(icon(self, self.glob.sprite["interface"][14], vec(0.008,0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][21], vec(-0.008,-0.008), 0.4)) self.frame.append(icon(self, self.glob.sprite["interface"][10 + self.button_num], vec(0.008,0.008), 0.4))
47.408947
255
0.617294
14,900
104,916
4.236376
0.040805
0.080226
0.055448
0.058743
0.9084
0.889151
0.863471
0.844444
0.825006
0.819984
0
0.036182
0.238953
104,916
2,212
256
47.43038
0.754365
0.009274
0
0.855735
0
0
0.062565
0.000735
0
0
0
0
0
1
0.046446
false
0.002111
0.000704
0
0.059113
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
44963bf0fd5b87fe055400a1dbbfa6ed5505d9da
34,390
py
Python
pecan/tests/test_hooks.py
rackerlabs/pecan
b046c1e965e2a37758c5092402a92b46217d58b4
[ "BSD-3-Clause" ]
null
null
null
pecan/tests/test_hooks.py
rackerlabs/pecan
b046c1e965e2a37758c5092402a92b46217d58b4
[ "BSD-3-Clause" ]
null
null
null
pecan/tests/test_hooks.py
rackerlabs/pecan
b046c1e965e2a37758c5092402a92b46217d58b4
[ "BSD-3-Clause" ]
null
null
null
from webtest import TestApp from six import b as b_ from six import u as u_ from six.moves import cStringIO as StringIO from webob import Response from pecan import make_app, expose, redirect, abort from pecan.hooks import ( PecanHook, TransactionHook, HookController, RequestViewerHook ) from pecan.configuration import Config from pecan.decorators import transactional, after_commit, after_rollback from pecan.tests import PecanTestCase class TestHooks(PecanTestCase): def test_basic_single_hook(self): run_hook = [] class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' class SimpleHook(PecanHook): def on_route(self, state): run_hook.append('on_route') def before(self, state): run_hook.append('before') def after(self, state): run_hook.append('after') def on_error(self, state, e): run_hook.append('error') app = TestApp(make_app(RootController(), hooks=[SimpleHook()])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 4 assert run_hook[0] == 'on_route' assert run_hook[1] == 'before' assert run_hook[2] == 'inside' assert run_hook[3] == 'after' def test_basic_multi_hook(self): run_hook = [] class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' class SimpleHook(PecanHook): def __init__(self, id): self.id = str(id) def on_route(self, state): run_hook.append('on_route' + self.id) def before(self, state): run_hook.append('before' + self.id) def after(self, state): run_hook.append('after' + self.id) def on_error(self, state, e): run_hook.append('error' + self.id) app = TestApp(make_app(RootController(), hooks=[ SimpleHook(1), SimpleHook(2), SimpleHook(3) ])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 10 assert run_hook[0] == 'on_route1' assert run_hook[1] == 'on_route2' assert run_hook[2] == 'on_route3' assert run_hook[3] == 'before1' assert run_hook[4] == 'before2' assert run_hook[5] == 'before3' assert run_hook[6] == 'inside' assert run_hook[7] == 'after3' assert run_hook[8] == 'after2' assert run_hook[9] == 'after1' def test_partial_hooks(self): run_hook = [] class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello World!' @expose() def causeerror(self): return [][1] class ErrorHook(PecanHook): def on_error(self, state, e): run_hook.append('error') class OnRouteHook(PecanHook): def on_route(self, state): run_hook.append('on_route') app = TestApp(make_app(RootController(), hooks=[ ErrorHook(), OnRouteHook() ])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello World!') assert len(run_hook) == 2 assert run_hook[0] == 'on_route' assert run_hook[1] == 'inside' run_hook = [] try: response = app.get('/causeerror') except Exception as e: assert isinstance(e, IndexError) assert len(run_hook) == 2 assert run_hook[0] == 'on_route' assert run_hook[1] == 'error' def test_on_error_response_hook(self): run_hook = [] class RootController(object): @expose() def causeerror(self): return [][1] class ErrorHook(PecanHook): def on_error(self, state, e): run_hook.append('error') r = Response() r.text = u_('on_error') return r app = TestApp(make_app(RootController(), hooks=[ ErrorHook() ])) response = app.get('/causeerror') assert len(run_hook) == 1 assert run_hook[0] == 'error' assert response.text == 'on_error' def test_prioritized_hooks(self): run_hook = [] class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' class SimpleHook(PecanHook): def __init__(self, id, priority=None): self.id = str(id) if priority: self.priority = priority def on_route(self, state): run_hook.append('on_route' + self.id) def before(self, state): run_hook.append('before' + self.id) def after(self, state): run_hook.append('after' + self.id) def on_error(self, state, e): run_hook.append('error' + self.id) papp = make_app(RootController(), hooks=[ SimpleHook(1, 3), SimpleHook(2, 2), SimpleHook(3, 1) ]) app = TestApp(papp) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 10 assert run_hook[0] == 'on_route3' assert run_hook[1] == 'on_route2' assert run_hook[2] == 'on_route1' assert run_hook[3] == 'before3' assert run_hook[4] == 'before2' assert run_hook[5] == 'before1' assert run_hook[6] == 'inside' assert run_hook[7] == 'after1' assert run_hook[8] == 'after2' assert run_hook[9] == 'after3' def test_basic_isolated_hook(self): run_hook = [] class SimpleHook(PecanHook): def on_route(self, state): run_hook.append('on_route') def before(self, state): run_hook.append('before') def after(self, state): run_hook.append('after') def on_error(self, state, e): run_hook.append('error') class SubSubController(object): @expose() def index(self): run_hook.append('inside_sub_sub') return 'Deep inside here!' class SubController(HookController): __hooks__ = [SimpleHook()] @expose() def index(self): run_hook.append('inside_sub') return 'Inside here!' sub = SubSubController() class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' sub = SubController() app = TestApp(make_app(RootController())) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 1 assert run_hook[0] == 'inside' run_hook = [] response = app.get('/sub/') assert response.status_int == 200 assert response.body == b_('Inside here!') assert len(run_hook) == 3 assert run_hook[0] == 'before' assert run_hook[1] == 'inside_sub' assert run_hook[2] == 'after' run_hook = [] response = app.get('/sub/sub/') assert response.status_int == 200 assert response.body == b_('Deep inside here!') assert len(run_hook) == 3 assert run_hook[0] == 'before' assert run_hook[1] == 'inside_sub_sub' assert run_hook[2] == 'after' def test_isolated_hook_with_global_hook(self): run_hook = [] class SimpleHook(PecanHook): def __init__(self, id): self.id = str(id) def on_route(self, state): run_hook.append('on_route' + self.id) def before(self, state): run_hook.append('before' + self.id) def after(self, state): run_hook.append('after' + self.id) def on_error(self, state, e): run_hook.append('error' + self.id) class SubController(HookController): __hooks__ = [SimpleHook(2)] @expose() def index(self): run_hook.append('inside_sub') return 'Inside here!' class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' sub = SubController() app = TestApp(make_app(RootController(), hooks=[SimpleHook(1)])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 4 assert run_hook[0] == 'on_route1' assert run_hook[1] == 'before1' assert run_hook[2] == 'inside' assert run_hook[3] == 'after1' run_hook = [] response = app.get('/sub/') assert response.status_int == 200 assert response.body == b_('Inside here!') assert len(run_hook) == 6 assert run_hook[0] == 'on_route1' assert run_hook[1] == 'before2' assert run_hook[2] == 'before1' assert run_hook[3] == 'inside_sub' assert run_hook[4] == 'after1' assert run_hook[5] == 'after2' class TestTransactionHook(PecanTestCase): def test_transaction_hook(self): run_hook = [] class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' @expose() def redirect(self): redirect('/') @expose() def error(self): return [][1] def gen(event): return lambda: run_hook.append(event) app = TestApp(make_app(RootController(), hooks=[ TransactionHook( start=gen('start'), start_ro=gen('start_ro'), commit=gen('commit'), rollback=gen('rollback'), clear=gen('clear') ) ])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 3 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'inside' assert run_hook[2] == 'clear' run_hook = [] response = app.post('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 4 assert run_hook[0] == 'start' assert run_hook[1] == 'inside' assert run_hook[2] == 'commit' assert run_hook[3] == 'clear' # # test hooks for GET /redirect # This controller should always be non-transactional # run_hook = [] response = app.get('/redirect') assert response.status_int == 302 assert len(run_hook) == 2 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' # # test hooks for POST /redirect # This controller should always be transactional, # even in the case of redirects # run_hook = [] response = app.post('/redirect') assert response.status_int == 302 assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'commit' assert run_hook[2] == 'clear' run_hook = [] try: response = app.post('/error') except IndexError: pass assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' def test_transaction_hook_with_after_actions(self): run_hook = [] def action(name): def action_impl(): run_hook.append(name) return action_impl class RootController(object): @expose() @after_commit(action('action-one')) def index(self): run_hook.append('inside') return 'Index Method!' @expose() @transactional() @after_commit(action('action-two')) def decorated(self): run_hook.append('inside') return 'Decorated Method!' @expose() @after_rollback(action('action-three')) def rollback(self): abort(500) @expose() @transactional() @after_rollback(action('action-four')) def rollback_decorated(self): abort(500) def gen(event): return lambda: run_hook.append(event) app = TestApp(make_app(RootController(), hooks=[ TransactionHook( start=gen('start'), start_ro=gen('start_ro'), commit=gen('commit'), rollback=gen('rollback'), clear=gen('clear') ) ])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Index Method!') assert len(run_hook) == 3 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'inside' assert run_hook[2] == 'clear' run_hook = [] response = app.post('/') assert response.status_int == 200 assert response.body == b_('Index Method!') assert len(run_hook) == 5 assert run_hook[0] == 'start' assert run_hook[1] == 'inside' assert run_hook[2] == 'commit' assert run_hook[3] == 'action-one' assert run_hook[4] == 'clear' run_hook = [] response = app.get('/decorated') assert response.status_int == 200 assert response.body == b_('Decorated Method!') assert len(run_hook) == 7 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'inside' assert run_hook[4] == 'commit' assert run_hook[5] == 'action-two' assert run_hook[6] == 'clear' run_hook = [] response = app.get('/rollback', expect_errors=True) assert response.status_int == 500 assert len(run_hook) == 2 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' run_hook = [] response = app.post('/rollback', expect_errors=True) assert response.status_int == 500 assert len(run_hook) == 4 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'action-three' assert run_hook[3] == 'clear' run_hook = [] response = app.get('/rollback_decorated', expect_errors=True) assert response.status_int == 500 assert len(run_hook) == 6 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'rollback' assert run_hook[4] == 'action-four' assert run_hook[5] == 'clear' run_hook = [] response = app.get('/fourohfour', status=404) assert response.status_int == 404 assert len(run_hook) == 2 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' def test_transaction_hook_with_transactional_decorator(self): run_hook = [] class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' @expose() def redirect(self): redirect('/') @expose() @transactional() def redirect_transactional(self): redirect('/') @expose() @transactional(False) def redirect_rollback(self): redirect('/') @expose() def error(self): return [][1] @expose() @transactional(False) def error_rollback(self): return [][1] @expose() @transactional() def error_transactional(self): return [][1] def gen(event): return lambda: run_hook.append(event) app = TestApp(make_app(RootController(), hooks=[ TransactionHook( start=gen('start'), start_ro=gen('start_ro'), commit=gen('commit'), rollback=gen('rollback'), clear=gen('clear') ) ])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 3 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'inside' assert run_hook[2] == 'clear' run_hook = [] # test hooks for / response = app.post('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 4 assert run_hook[0] == 'start' assert run_hook[1] == 'inside' assert run_hook[2] == 'commit' assert run_hook[3] == 'clear' # # test hooks for GET /redirect # This controller should always be non-transactional # run_hook = [] response = app.get('/redirect') assert response.status_int == 302 assert len(run_hook) == 2 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' # # test hooks for POST /redirect # This controller should always be transactional, # even in the case of redirects # run_hook = [] response = app.post('/redirect') assert response.status_int == 302 assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'commit' assert run_hook[2] == 'clear' # # test hooks for GET /redirect_transactional # This controller should always be transactional, # even in the case of redirects # run_hook = [] response = app.get('/redirect_transactional') assert response.status_int == 302 assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'commit' assert run_hook[4] == 'clear' # # test hooks for POST /redirect_transactional # This controller should always be transactional, # even in the case of redirects # run_hook = [] response = app.post('/redirect_transactional') assert response.status_int == 302 assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'commit' assert run_hook[2] == 'clear' # # test hooks for GET /redirect_rollback # This controller should always be transactional, # *except* in the case of redirects # run_hook = [] response = app.get('/redirect_rollback') assert response.status_int == 302 assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'rollback' assert run_hook[4] == 'clear' # # test hooks for POST /redirect_rollback # This controller should always be transactional, # *except* in the case of redirects # run_hook = [] response = app.post('/redirect_rollback') assert response.status_int == 302 assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' # # Exceptions (other than HTTPFound) should *always* # rollback no matter what # run_hook = [] try: response = app.post('/error') except IndexError: pass assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' run_hook = [] try: response = app.get('/error') except IndexError: pass assert len(run_hook) == 2 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' run_hook = [] try: response = app.post('/error_transactional') except IndexError: pass assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' run_hook = [] try: response = app.get('/error_transactional') except IndexError: pass assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'rollback' assert run_hook[4] == 'clear' run_hook = [] try: response = app.post('/error_rollback') except IndexError: pass assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' run_hook = [] try: response = app.get('/error_rollback') except IndexError: pass assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'rollback' assert run_hook[4] == 'clear' def test_transaction_hook_with_transactional_class_decorator(self): run_hook = [] @transactional() class RootController(object): @expose() def index(self): run_hook.append('inside') return 'Hello, World!' @expose() def redirect(self): redirect('/') @expose() @transactional(False) def redirect_rollback(self): redirect('/') @expose() def error(self): return [][1] @expose(generic=True) def generic(self): pass @generic.when(method='GET') def generic_get(self): run_hook.append('inside') return 'generic get' @generic.when(method='POST') def generic_post(self): run_hook.append('inside') return 'generic post' def gen(event): return lambda: run_hook.append(event) app = TestApp(make_app(RootController(), hooks=[ TransactionHook( start=gen('start'), start_ro=gen('start_ro'), commit=gen('commit'), rollback=gen('rollback'), clear=gen('clear') ) ])) response = app.get('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 6 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'inside' assert run_hook[4] == 'commit' assert run_hook[5] == 'clear' run_hook = [] # test hooks for / response = app.post('/') assert response.status_int == 200 assert response.body == b_('Hello, World!') assert len(run_hook) == 4 assert run_hook[0] == 'start' assert run_hook[1] == 'inside' assert run_hook[2] == 'commit' assert run_hook[3] == 'clear' # # test hooks for GET /redirect # This controller should always be transactional, # even in the case of redirects # run_hook = [] response = app.get('/redirect') assert response.status_int == 302 assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'commit' assert run_hook[4] == 'clear' # # test hooks for POST /redirect # This controller should always be transactional, # even in the case of redirects # run_hook = [] response = app.post('/redirect') assert response.status_int == 302 assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'commit' assert run_hook[2] == 'clear' # # test hooks for GET /redirect_rollback # This controller should always be transactional, # *except* in the case of redirects # run_hook = [] response = app.get('/redirect_rollback') assert response.status_int == 302 assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'rollback' assert run_hook[4] == 'clear' # # test hooks for POST /redirect_rollback # This controller should always be transactional, # *except* in the case of redirects # run_hook = [] response = app.post('/redirect_rollback') assert response.status_int == 302 assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' # # Exceptions (other than HTTPFound) should *always* # rollback no matter what # run_hook = [] try: response = app.post('/error') except IndexError: pass assert len(run_hook) == 3 assert run_hook[0] == 'start' assert run_hook[1] == 'rollback' assert run_hook[2] == 'clear' run_hook = [] try: response = app.get('/error') except IndexError: pass assert len(run_hook) == 5 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'rollback' assert run_hook[4] == 'clear' # # test hooks for GET /generic # This controller should always be transactional, # run_hook = [] response = app.get('/generic') assert response.status_int == 200 assert response.body == b_('generic get') assert len(run_hook) == 6 assert run_hook[0] == 'start_ro' assert run_hook[1] == 'clear' assert run_hook[2] == 'start' assert run_hook[3] == 'inside' assert run_hook[4] == 'commit' assert run_hook[5] == 'clear' # # test hooks for POST /generic # This controller should always be transactional, # run_hook = [] response = app.post('/generic') assert response.status_int == 200 assert response.body == b_('generic post') assert len(run_hook) == 4 assert run_hook[0] == 'start' assert run_hook[1] == 'inside' assert run_hook[2] == 'commit' assert run_hook[3] == 'clear' def test_transaction_hook_with_broken_hook(self): """ In a scenario where a preceding hook throws an exception, ensure that TransactionHook still rolls back properly. """ run_hook = [] class RootController(object): @expose() def index(self): return 'Hello, World!' def gen(event): return lambda: run_hook.append(event) class MyCustomException(Exception): pass class MyHook(PecanHook): def on_route(self, state): raise MyCustomException('BROKEN!') app = TestApp(make_app(RootController(), hooks=[ MyHook(), TransactionHook( start=gen('start'), start_ro=gen('start_ro'), commit=gen('commit'), rollback=gen('rollback'), clear=gen('clear') ) ])) self.assertRaises( MyCustomException, app.get, '/' ) assert len(run_hook) == 1 assert run_hook[0] == 'clear' class TestRequestViewerHook(PecanTestCase): def test_basic_single_default_hook(self): _stdout = StringIO() class RootController(object): @expose() def index(self): return 'Hello, World!' app = TestApp( make_app( RootController(), hooks=lambda: [ RequestViewerHook(writer=_stdout) ] ) ) response = app.get('/') out = _stdout.getvalue() assert response.status_int == 200 assert response.body == b_('Hello, World!') assert 'path' in out assert 'method' in out assert 'status' in out assert 'method' in out assert 'params' in out assert 'hooks' in out assert '200 OK' in out assert "['RequestViewerHook']" in out assert '/' in out def test_bad_response_from_app(self): """When exceptions are raised the hook deals with them properly""" _stdout = StringIO() class RootController(object): @expose() def index(self): return 'Hello, World!' app = TestApp( make_app( RootController(), hooks=lambda: [ RequestViewerHook(writer=_stdout) ] ) ) response = app.get('/404', expect_errors=True) out = _stdout.getvalue() assert response.status_int == 404 assert 'path' in out assert 'method' in out assert 'status' in out assert 'method' in out assert 'params' in out assert 'hooks' in out assert '404 Not Found' in out assert "['RequestViewerHook']" in out assert '/' in out def test_single_item(self): _stdout = StringIO() class RootController(object): @expose() def index(self): return 'Hello, World!' app = TestApp( make_app( RootController(), hooks=lambda: [ RequestViewerHook( config={'items': ['path']}, writer=_stdout ) ] ) ) response = app.get('/') out = _stdout.getvalue() assert response.status_int == 200 assert response.body == b_('Hello, World!') assert '/' in out assert 'path' in out assert 'method' not in out assert 'status' not in out assert 'method' not in out assert 'params' not in out assert 'hooks' not in out assert '200 OK' not in out assert "['RequestViewerHook']" not in out def test_single_blacklist_item(self): _stdout = StringIO() class RootController(object): @expose() def index(self): return 'Hello, World!' app = TestApp( make_app( RootController(), hooks=lambda: [ RequestViewerHook( config={'blacklist': ['/']}, writer=_stdout ) ] ) ) response = app.get('/') out = _stdout.getvalue() assert response.status_int == 200 assert response.body == b_('Hello, World!') assert out == '' def test_item_not_in_defaults(self): _stdout = StringIO() class RootController(object): @expose() def index(self): return 'Hello, World!' app = TestApp( make_app( RootController(), hooks=lambda: [ RequestViewerHook( config={'items': ['date']}, writer=_stdout ) ] ) ) response = app.get('/') out = _stdout.getvalue() assert response.status_int == 200 assert response.body == b_('Hello, World!') assert 'date' in out assert 'method' not in out assert 'status' not in out assert 'method' not in out assert 'params' not in out assert 'hooks' not in out assert '200 OK' not in out assert "['RequestViewerHook']" not in out assert '/' not in out def test_hook_formatting(self): hooks = ['<pecan.hooks.RequestViewerHook object at 0x103a5f910>'] viewer = RequestViewerHook() formatted = viewer.format_hooks(hooks) assert formatted == ['RequestViewerHook'] def test_deal_with_pecan_configs(self): """If config comes from pecan.conf convert it to dict""" conf = Config(conf_dict={'items': ['url']}) viewer = RequestViewerHook(conf) assert viewer.items == ['url']
28.096405
74
0.520529
3,657
34,390
4.724638
0.059065
0.13167
0.138442
0.04445
0.857854
0.83534
0.814736
0.789385
0.77891
0.745167
0
0.019803
0.364205
34,390
1,223
75
28.119379
0.770409
0.054551
0
0.790433
0
0
0.093342
0.004939
0
0
0.00034
0
0.386105
1
0.103645
false
0.012528
0.01139
0.020501
0.193622
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
4496c917a1922ff134fcc3e0c87efa7693e18c37
37,147
py
Python
transfer_app/tests.py
qbrc-cnap/cnap
624683e91a64c3b4934b578c59db850242d2f94c
[ "MIT" ]
1
2021-07-08T14:06:04.000Z
2021-07-08T14:06:04.000Z
transfer_app/tests.py
qbrc-cnap/cnap
624683e91a64c3b4934b578c59db850242d2f94c
[ "MIT" ]
12
2020-02-12T00:10:53.000Z
2021-06-10T21:24:45.000Z
transfer_app/tests.py
qbrc-cnap/cnap
624683e91a64c3b4934b578c59db850242d2f94c
[ "MIT" ]
null
null
null
import sys from Crypto.Cipher import DES import base64 from django.test import TestCase import unittest.mock as mock from rest_framework.test import APIClient from rest_framework import status from django.urls import reverse from django.contrib.auth import get_user_model from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from base.models import Resource from transfer_app.models import Transfer, TransferCoordinator, FailedTransfer # a method for creating a reasonable test dataset: def create_data(testcase_obj): # create two users-- one is admin, other is regular testcase_obj.regular_user = get_user_model().objects.create_user(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') testcase_obj.admin_user = get_user_model().objects.create_user(email=settings.ADMIN_TEST_EMAIL, password='abcd123!', is_staff=True) testcase_obj.other_user = get_user_model().objects.create_user(email=settings.OTHER_TEST_EMAIL, password='abcd123!') # create a couple of Resources owned by admin: r1 = Resource.objects.create( source = 'google_bucket', path='gs://a/b/admin_owned1.txt', size=500, owner=testcase_obj.admin_user, ) r2 = Resource.objects.create( source='google_storage', path='in some user dropbox1', size=500, owner=testcase_obj.admin_user, ) # create a couple of resources owned by the regular user: r3 = Resource.objects.create( source='google_storage', path='gs://a/b/reg_owned1.txt', size=500, owner=testcase_obj.regular_user, ) r4 = Resource.objects.create( source='google_storage', path='gs://a/b/reg_owned2.txt', size=500, owner=testcase_obj.regular_user, ) r5 = Resource.objects.create( source='google_storage', path='in some user dropbox2', size=500, owner=testcase_obj.regular_user, ) # create a batch of Transfers: tc1 = TransferCoordinator.objects.create() tc2 = TransferCoordinator.objects.create() tc3 = TransferCoordinator.objects.create() tc4 = TransferCoordinator.objects.create() # create Transfer instances for the Resources above # An admin-owned download transfer t1 = Transfer.objects.create( download=True, resource = r1, destination = 'dropbox', coordinator = tc1, originator = testcase_obj.admin_user ) # Create two downloads and one upload owned by a regular user: t2 = Transfer.objects.create( download=True, resource = r3, destination = 'dropbox', coordinator = tc2, originator = testcase_obj.regular_user ) t3 = Transfer.objects.create( download=True, resource = r4, destination = 'dropbox', coordinator = tc2, originator = testcase_obj.regular_user ) t4 = Transfer.objects.create( download=False, resource = r5, destination = 'our system', coordinator = tc3, originator = testcase_obj.regular_user ) # now create a Transfer that was originated by an admin, but the Resource is owned by # a regular user t5 = Transfer.objects.create( download=False, resource = r5, destination = 'our system', coordinator = tc4, originator = testcase_obj.admin_user ) ''' Tests for listing Transfers: - lists all Transfers if requested by admin - If non-admin request, lists only those owned by that user ''' class TransferListTestCase(TestCase): def setUp(self): create_data(self) def test_list_all_transfers_for_admin(self): ''' This tests that the admin can list all existing Transfers ''' t = Transfer.objects.all() admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('transfer-list') response = admin_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 5) def test_nonadmin_list_returns_only_owned_transfers(self): ''' This tests that a regular user can only list the Transfer objects they originated. Note that this does NOT list the Transfers that happened for Resources they owned. ''' reg_user = get_user_model().objects.get(email=settings.REGULAR_TEST_EMAIL) user_transfers = Transfer.objects.user_transfers(reg_user) reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('transfer-list') response = reg_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 3) def test_list_download_transfers_for_admin(self): ''' This tests that the admin can list all the downloads, regardless of user ''' t = Transfer.objects.all() admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('transfer-list') url = '%s?download=true' % url response = admin_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 3) def test_list_upload_transfers_for_admin(self): ''' This tests that the admin can list all the uploads, regardless of user ''' t = Transfer.objects.all() admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('transfer-list') url = '%s?download=false' % url response = admin_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 2) def test_list_download_transfers_for_reguser(self): ''' This tests that the regular user can list all their downloads ''' t = Transfer.objects.all() reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('transfer-list') url = '%s?download=true' % url response = reg_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 2) def test_list_upload_transfers_for_reguser(self): ''' This tests that the regular user can list all their uploads Note that there were multiple uploads of this user's files. However, only one of those was originated by this regular user; the other was transferred by an admin ''' t = Transfer.objects.all() reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('transfer-list') url = '%s?download=false' % url response = reg_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 1) ''' Test for retrieving a specific Transfer: - returns 404 if the pk does not exist regardless of user - returns 404 if a non-admin user requests a Transfer owned by someone else - returns correctly if admin requests Transfer owned by someone else - returns correctly if admin requests Transfer owned by themself ''' class TransferDetailTestCase(TestCase): def setUp(self): create_data(self) def test_return_404_for_missing_transfer(self): admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('transfer-detail', args=[666,]) # some non-existant pk response = admin_client.get(url) self.assertEqual(response.status_code,404) reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('transfer-detail', args=[666,]) # some non-existant pk response = reg_client.get(url) self.assertEqual(response.status_code,404) def test_admin_user_can_query_own_transfer(self): admin_user = get_user_model().objects.get(email=settings.ADMIN_TEST_EMAIL) t = Transfer.objects.user_transfers(admin_user) instance = t[0] admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('transfer-detail', args=[instance.pk,]) response = admin_client.get(url) self.assertEqual(response.status_code, 200) # check that the Resource 'wrapped' by the Transfer is in fact # owned by the admin: data = response.data resource_pk = data['resource'] r = Resource.objects.get(pk=resource_pk) owner = r.get_owner() self.assertEqual(owner, admin_user) def test_admin_user_can_query_others_transfer(self): # get an instance of a regular user's Transfer reg_user = get_user_model().objects.get(email=settings.REGULAR_TEST_EMAIL) t = Transfer.objects.user_transfers(reg_user) instance = t[0] # create admin client: admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('transfer-detail', args=[instance.pk,]) response = admin_client.get(url) self.assertEqual(response.status_code, 200) # check that the Resource 'wrapped' by the Transfer is in fact # owned by the other/regular user: data = response.data resource_pk = data['resource'] r = Resource.objects.get(pk=resource_pk) owner = r.get_owner() self.assertEqual(owner, reg_user) def test_regular_user_can_query_own_transfer(self): # get an instance of a regular user's Transfer reg_user = get_user_model().objects.get(email=settings.REGULAR_TEST_EMAIL) t = Transfer.objects.user_transfers(reg_user) instance = t[0] # create regular client: reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('transfer-detail', args=[instance.pk,]) response = reg_client.get(url) self.assertEqual(response.status_code, 200) # check that the Resource 'wrapped' by the Transfer is in fact # owned by the other/regular user: data = response.data resource_pk = data['resource'] r = Resource.objects.get(pk=resource_pk) owner = r.get_owner() self.assertEqual(owner, reg_user) def test_regular_user_cannot_query_others_transfer(self): # get an instance of another user's Transfer (here, the admins) admin_user = get_user_model().objects.get(email=settings.ADMIN_TEST_EMAIL) t = Transfer.objects.user_transfers(admin_user) instance = t[0] # create regular client: reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('transfer-detail', args=[instance.pk,]) response = reg_client.get(url) self.assertEqual(response.status_code, 404) ''' Tests for UserTransferList: - non-admin receives 403 - using a pk (of a user) that does not exist returns a 404 - properly returns a list of Transfers for a particular owner ''' class UserTransferListTestCase(TestCase): def setUp(self): create_data(self) def test_404_from_nonexistent_user_for_user_transfer_list(self): # query all existing users, get the max pk, then add 1 # to guarantee a non-existent user's pk all_users = get_user_model().objects.all() all_user_pks = [x.pk for x in all_users] max_pk = max(all_user_pks) nonexistent_user_pk = max_pk + 1 admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('user-transfer-list', args=[nonexistent_user_pk,]) response = admin_client.get(url) self.assertEqual(response.status_code, 404) def test_non_admin_user_gets_403_for_user_specific_transfer_list(self): ''' regular users cannot access the /resources/user/<user pk>/ endpoint which lists the resources belonging to a specific user. That functionality is already handled by a request to the /resources/ endpoint ''' client = APIClient() client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') # get the regular user's pk: u = get_user_model().objects.filter(email=settings.REGULAR_TEST_EMAIL)[0] reguser_pk = u.pk url = reverse('user-transfer-list', args=[reguser_pk]) response = client.get(url) self.assertEqual(response.status_code,403) def test_admin_user_correctly_can_get_user_specific_transfer_list(self): # establish the admin client: client = APIClient() client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') # get the regular user's pk: u = get_user_model().objects.filter(email=settings.REGULAR_TEST_EMAIL)[0] reguser_pk = u.pk url = reverse('user-transfer-list', args=[reguser_pk]) response = client.get(url) data = response.data self.assertEqual(response.status_code,200) self.assertEqual(len(response.data), 3) owner_status = [] for item in data: resource_pk = item['resource'] resource_obj = Resource.objects.get(pk=resource_pk) owner_status.append(resource_obj.owner == u) self.assertTrue(all(owner_status)) ''' Tests for batch list (TransferCoordinator): - lists all TransferCoordinators if requested by admin - If non-admin request, lists only TransferCoordinator objects owned by that user ''' class TransferCoordinatorListTestCase(TestCase): def setUp(self): create_data(self) def test_list_all_transfercoordinators_for_admin(self): admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('batch-list') response = admin_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 4) def test_nonadmin_list_returns_only_owned_transfers(self): reg_user = get_user_model().objects.get(email=settings.REGULAR_TEST_EMAIL) user_tc = TransferCoordinator.objects.user_transfer_coordinators(reg_user) user_tc_pk = set([x.pk for x in user_tc]) # the primary keys of the reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('batch-list') response = reg_client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 2) data = response.data result_set = set() for item in data: result_set.add(item['id']) self.assertTrue(user_tc_pk == result_set) def test_unauthenticated_user_gets_403_for_transfercoordinator_list(self): client = APIClient() url = reverse('batch-list') response = client.get(url) self.assertEqual(response.status_code, 403) ''' Tests for batch detail (TransferCoordinator): - returns 404 if the pk does not exist regardless of requesting user - returns 404 if a non-admin user requests a TransferCoordinator owned by someone else - returns correctly if admin requests TransferCoordinator owned by someone else - returns correctly if admin requests TransferCoordinator owned by themself ''' class TransferCoordinatorDetailTestCase(TestCase): def setUp(self): create_data(self) def test_return_404_for_missing_tc(self): admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('batch-detail', args=[666,]) # some non-existant pk response = admin_client.get(url) self.assertEqual(response.status_code,404) reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('batch-detail', args=[666,]) # some non-existant pk response = reg_client.get(url) self.assertEqual(response.status_code,404) def test_admin_user_can_query_own_tc(self): admin_user = get_user_model().objects.get(email=settings.ADMIN_TEST_EMAIL) t = TransferCoordinator.objects.user_transfer_coordinators(admin_user) instance = t[0] admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('batch-detail', args=[instance.pk,]) response = admin_client.get(url) self.assertEqual(response.status_code, 200) # check that the Resource 'wrapped' by the TransferCoordinator is in fact # owned by the admin: data = response.data tc_pk = data['id'] transfers = Transfer.objects.filter(coordinator__pk = tc_pk) owners = list(set([t.resource.owner for t in transfers])) self.assertTrue(len(owners) == 1) self.assertTrue(owners[0] == admin_user) def test_admin_user_can_query_others_tc(self): # get an instance of a regular user's TransferCoordinator reg_user = get_user_model().objects.get(email=settings.REGULAR_TEST_EMAIL) t = TransferCoordinator.objects.user_transfer_coordinators(reg_user) instance = t[0] # create admin client: admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('batch-detail', args=[instance.pk,]) response = admin_client.get(url) self.assertEqual(response.status_code, 200) # check that the TransferCoordinator is in fact # owned by the regular user: data = response.data tc_pk = data['id'] tc = TransferCoordinator.objects.get(pk=tc_pk) transfers_for_this_tc = Transfer.objects.filter(coordinator=tc) owners = list(set([x.resource.owner for x in transfers_for_this_tc])) self.assertEqual(len(owners), 1) self.assertEqual(owners[0], reg_user) def test_regular_user_can_query_own_tc(self): # get an instance of a regular user's TransferCoordinator reg_user = get_user_model().objects.get(email=settings.REGULAR_TEST_EMAIL) t = TransferCoordinator.objects.user_transfer_coordinators(reg_user) instance = t[0] # create regular client: reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('batch-detail', args=[instance.pk,]) response = reg_client.get(url) self.assertEqual(response.status_code, 200) # check that the TransferCoordinator is in fact # owned by the other/regular user: data = response.data tc_pk = data['id'] transfers = Transfer.objects.filter(coordinator__pk = tc_pk) owners = list(set([t.resource.owner for t in transfers])) self.assertTrue(len(owners) == 1) self.assertTrue(owners[0] == reg_user) def test_regular_user_cannot_query_others_tc(self): # get an instance of another user's TransferCoordinator (here, the admins) admin_user = get_user_model().objects.get(email=settings.ADMIN_TEST_EMAIL) t = TransferCoordinator.objects.user_transfer_coordinators(admin_user) instance = t[0] # create regular client: reg_client = APIClient() reg_client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') url = reverse('batch-detail', args=[instance.pk,]) response = reg_client.get(url) self.assertEqual(response.status_code, 404) ''' Tests for UserBatchList (TransferCoordinator): - non-admin receives 403 - using a pk that does not exist returns a 404 - properly returns a list of TransferCoordinators for a particular owner ''' class TransferCoordinatorUserListCase(TestCase): def setUp(self): create_data(self) def test_404_from_nonexistent_user_for_user_tc_list(self): # query all existing users, get the max pk, then add 1 # to guarantee a non-existent user's pk all_users = get_user_model().objects.all() all_user_pks = [x.pk for x in all_users] max_pk = max(all_user_pks) nonexistent_user_pk = max_pk + 1 admin_client = APIClient() admin_client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') url = reverse('user-batch-list', args=[nonexistent_user_pk,]) response = admin_client.get(url) self.assertEqual(response.status_code, 404) def test_non_admin_user_gets_403_for_user_specific_tc_list(self): ''' regular users cannot access the /resources/user/<user pk>/ endpoint which lists the resources belonging to a specific user. That functionality is already handled by a request to the /resources/ endpoint ''' client = APIClient() client.login(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') # get the regular user's pk: u = get_user_model().objects.filter(email=settings.REGULAR_TEST_EMAIL)[0] reguser_pk = u.pk url = reverse('user-batch-list', args=[reguser_pk]) response = client.get(url) self.assertEqual(response.status_code,403) def test_admin_user_correctly_can_get_user_specific_tc_list(self): # establish the admin client: client = APIClient() client.login(email=settings.ADMIN_TEST_EMAIL, password='abcd123!') # get the regular user's pk: u = get_user_model().objects.filter(email=settings.REGULAR_TEST_EMAIL)[0] reguser_pk = u.pk url = reverse('user-batch-list', args=[reguser_pk]) response = client.get(url) data = response.data self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 2) # check that the TransferCoordinators returned are all properly owned by reg_user owner_list = [] for item in data: tc_pk = item['id'] transfers = Transfer.objects.filter(coordinator__pk = tc_pk) owners = [t.resource.owner for t in transfers] owner_list.extend(owners) owner_list = list(set(owner_list)) self.assertTrue(len(owner_list) == 1) self.assertTrue(owner_list[0] == u) ''' Tests for completion marking: - unauthenticated requests are rejected - marks the particular transfer complete - if not the final transfer, TransferCoordinator stays 'incomplete' - if it is the final transfer, TransferCoordinator marked complete ''' class CompletionMarkingTestCase(TestCase): def setUp(self): self.regular_user = get_user_model().objects.create_user(email=settings.REGULAR_TEST_EMAIL, password='abcd123!') # create a couple of resources owned by the regular user: self.r1 = Resource.objects.create( source='google_storage', path='gs://a/b/reg_owned1.txt', size=500, owner=self.regular_user, ) self.r2 = Resource.objects.create( source='google_storage', path='gs://a/b/reg_owned2.txt', size=500, owner=self.regular_user, ) self.tc1 = TransferCoordinator.objects.create() self.t1 = Transfer.objects.create( download=True, resource = self.r1, destination = 'dropbox', coordinator = self.tc1, originator = self.regular_user ) self.t2 = Transfer.objects.create( download=True, resource = self.r2, destination = 'dropbox', coordinator = self.tc1, originator = self.regular_user ) # create a couple of resources owned by the regular user representing # uploaded objects self.r3 = Resource.objects.create( source='dropbox', path='gs://a/b/reg_owned3.txt', size=500, owner=self.regular_user, is_active = False ) self.r4 = Resource.objects.create( source='dropbox', path='gs://a/b/reg_owned4.txt', size=500, owner=self.regular_user, is_active = False ) self.tc2 = TransferCoordinator.objects.create() self.t3 = Transfer.objects.create( download=False, resource = self.r3, destination = 'gs://a/b/reg_owned3.txt', coordinator = self.tc2, originator = self.regular_user ) self.t4 = Transfer.objects.create( download=False, resource = self.r4, destination = 'gs://a/b/reg_owned4.txt', coordinator = self.tc2, originator = self.regular_user ) self.tc3 = TransferCoordinator.objects.create() self.t5 = Transfer.objects.create( download=False, resource = self.r3, destination = 'gs://a/b/reg_owned3.txt', coordinator = self.tc3, originator = self.regular_user) def test_single_worker_completion_signal(self): ''' This tests where one of many workers has completed. Not ALL have completed, so the TransferCoordinator stays incomplete ''' # query the database and get the TransferCoordinator and its Transfer instances: tc_pk = self.tc1.pk tc = TransferCoordinator.objects.get(pk=tc_pk) transfers = Transfer.objects.filter(coordinator = tc) d = {} token = settings.CONFIG_PARAMS['token'] obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(token) b64_str = base64.encodestring(enc_token) d['token'] = b64_str d['transfer_pk'] = self.t1.pk d['coordinator_pk'] = tc_pk d['success'] = True client = APIClient() url = reverse('transfer-complete') response = client.post(url, d, format='json') self.assertEqual(response.status_code, 200) # query database to see that the Transfer was marked complete, but the # coordinator is still incomplete t = Transfer.objects.get(pk=self.t1.pk) self.assertTrue(t.completed) tc = TransferCoordinator.objects.get(pk=tc_pk) self.assertEqual(tc.completed, False) @mock.patch('transfer_app.views.utils') def test_full_completion_signal(self, mock_utils): ''' This tests where both of two workers have completed. ALL have completed, so the TransferCoordinator becomes complete ''' mock_utils.post_completion = mock.MagicMock() # query the database and get the TransferCoordinator and its Transfer instances: tc_pk = self.tc1.pk tc = TransferCoordinator.objects.get(pk=tc_pk) transfers = Transfer.objects.filter(coordinator = tc) token = settings.CONFIG_PARAMS['token'] obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(token) b64_str = base64.encodestring(enc_token) d1 = {} d1['token'] = b64_str d1['transfer_pk'] = self.t1.pk d1['coordinator_pk'] = tc_pk d1['success'] = True d2 = {} d2['token'] = b64_str d2['transfer_pk'] = self.t2.pk d2['coordinator_pk'] = tc_pk d2['success'] = True client = APIClient() url = reverse('transfer-complete') response1 = client.post(url, d1, format='json') self.assertEqual(response1.status_code, 200) response2 = client.post(url, d2, format='json') self.assertEqual(response2.status_code, 200) # query database to see that the Transfer was marked complete t1 = Transfer.objects.get(pk=self.t1.pk) self.assertTrue(t1.completed) t2 = Transfer.objects.get(pk=self.t2.pk) self.assertTrue(t2.completed) tc = TransferCoordinator.objects.get(pk=tc_pk) self.assertTrue(tc.completed) @mock.patch('transfer_app.views.utils') def test_failed_transfer_cleans_up_resource(self, mock_utils): ''' This tests where both of two workers have completed. One has failed. We test that the Resource object corresponding to the failed transfer is removed and that we log the failed transfer in the database. ALL transfers have completed, so the TransferCoordinator becomes complete also ''' mock_utils.post_completion = mock.MagicMock() # query the database and get the TransferCoordinator tc_pk = self.tc2.pk tc = TransferCoordinator.objects.get(pk=tc_pk) # check that we do not have any failedtransfers so far: ft = FailedTransfer.objects.all() self.assertTrue(len(ft) == 0) # get the primary key for the Resource which will fail to transfer: failed_resource = self.r3 failed_resource_pk = failed_resource.pk failed_resource_path = failed_resource.path token = settings.CONFIG_PARAMS['token'] obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(token) b64_str = base64.encodestring(enc_token) # make the first Transfer fail d1 = {} d1['token'] = b64_str d1['transfer_pk'] = self.t3.pk d1['coordinator_pk'] = tc_pk d1['success'] = False # this transfer was a success: d2 = {} d2['token'] = b64_str d2['transfer_pk'] = self.t4.pk d2['coordinator_pk'] = tc_pk d2['success'] = True # mock the worker machines communicating back: client = APIClient() url = reverse('transfer-complete') response1 = client.post(url, d1, format='json') self.assertEqual(response1.status_code, 200) response2 = client.post(url, d2, format='json') self.assertEqual(response2.status_code, 200) # query database to see that the second Transfer was marked complete t = Transfer.objects.get(pk=self.t4.pk) self.assertTrue(t.completed) # check that the resource was marked active since it succeeded: r_pk = self.t4.resource.pk r = Resource.objects.get(pk=r_pk) self.assertTrue(r.is_active) # check that we added a FailedTransfer to the database: ft = FailedTransfer.objects.all() self.assertTrue(len(ft) == 1) ft = ft[0] self.assertEqual(ft.intended_path, failed_resource_path) # check that the failed transfer led to the resource # being removed with self.assertRaises(ObjectDoesNotExist): r = Resource.objects.get(pk=failed_resource_pk) # check that the TransferCoordinator was marked complete. tc = TransferCoordinator.objects.get(pk=tc_pk) self.assertTrue(tc.completed) @mock.patch('transfer_app.views.utils') def test_single_failed_transfer_cleans_up_resource(self, mock_utils): ''' This tests where a single transfer has failed. We test that the Resource object corresponding to the failed transfer is removed and that we log the failed transfer in the database. ALL transfers have completed, so the TransferCoordinator becomes complete also ''' mock_utils.post_completion = mock.MagicMock() # query the database and get the TransferCoordinator tc_pk = self.tc3.pk tc = TransferCoordinator.objects.get(pk=tc_pk) # check that we do not have any failedtransfers so far: ft = FailedTransfer.objects.all() self.assertTrue(len(ft) == 0) # get the primary key for the Resource which will fail to transfer: failed_resource = self.r3 failed_resource_pk = failed_resource.pk failed_resource_path = failed_resource.path token = settings.CONFIG_PARAMS['token'] obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(token) b64_str = base64.encodestring(enc_token) # make the first Transfer fail d1 = {} d1['token'] = b64_str d1['transfer_pk'] = self.t5.pk d1['coordinator_pk'] = tc_pk d1['success'] = False # mock the worker machines communicating back: client = APIClient() url = reverse('transfer-complete') response1 = client.post(url, d1, format='json') self.assertEqual(response1.status_code, 200) # check that we added a FailedTransfer to the database: ft = FailedTransfer.objects.all() self.assertTrue(len(ft) == 1) ft = ft[0] self.assertEqual(ft.intended_path, failed_resource_path) # check that the failed transfer led to the resource # being removed with self.assertRaises(ObjectDoesNotExist): r = Resource.objects.get(pk=failed_resource_pk) # check that the TransferCoordinator was marked complete. tc = TransferCoordinator.objects.get(pk=tc_pk) self.assertTrue(tc.completed) a_t = all_transfers = Transfer.objects.filter(coordinator = tc) print(a_t) for x in a_t: print('here is x: %s' % x) self.assertTrue(mock_utils.post_completion.called) def test_completion_signal_with_wrong_token_is_rejected(self): ''' This tests where a bad token is sent. Should reject with 404 ''' # query the database and get the TransferCoordinator and its Transfer instances: tc = TransferCoordinator.objects.get(pk=self.tc1.pk) transfers = Transfer.objects.filter(coordinator = tc) bad_token = 'xxxxYYYY' obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(bad_token) bad_b64_str = base64.encodestring(enc_token) d1 = {} d1['token'] = bad_b64_str d1['transfer_pk'] = 1 d1['coordinator_pk'] = 1 d1['success'] = True client = APIClient() url = reverse('transfer-complete') response1 = client.post(url, d1, format='json') self.assertEqual(response1.status_code, 404) def test_incorrect_transfer_pk_on_completion(self): ''' This tests where an incorrect pk is given for the transfer ''' # query the database and get the TransferCoordinator and its Transfer instances: tc = TransferCoordinator.objects.get(pk=self.tc1.pk) transfers = Transfer.objects.filter(coordinator = tc) d = {} token = settings.CONFIG_PARAMS['token'] obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(token) b64_str = base64.encodestring(enc_token) d['token'] = b64_str d['transfer_pk'] = 100 # an invalid pk d['success'] = True client = APIClient() url = reverse('transfer-complete') response = client.post(url, d, format='json') self.assertEqual(response.status_code, 400) def test_bad_payload_on_completion(self): ''' This tests where required info is missing in the request ''' # query the database and get the TransferCoordinator and its Transfer instances: tc = TransferCoordinator.objects.get(pk=self.tc1.pk) transfers = Transfer.objects.filter(coordinator = tc) d = {} token = settings.CONFIG_PARAMS['token'] obj=DES.new(settings.CONFIG_PARAMS['enc_key'], DES.MODE_ECB) enc_token = obj.encrypt(token) b64_str = base64.encodestring(enc_token) d['token'] = b64_str # note: missing the transfer_pk key d['success'] = True client = APIClient() url = reverse('transfer-complete') response = client.post(url, d, format='json') self.assertEqual(response.status_code, 400) @mock.patch('transfer_app.utils.send_email') def test_post_completion_with_only_failures(self, mock_email_send): ''' If none of the transfers are successful, test that the correct behavior happens ''' from transfer_app.utils import post_completion # this coord does not have any Transfer objects associated with it. empty_coordinator = TransferCoordinator.objects.create() post_completion(empty_coordinator, [settings.REGULAR_TEST_EMAIL,]) self.assertTrue(mock_email_send.called)
38.295876
135
0.655961
4,602
37,147
5.124946
0.078444
0.034344
0.021624
0.030528
0.826754
0.807971
0.792453
0.76731
0.754717
0.706339
0
0.01822
0.249441
37,147
969
136
38.335397
0.827696
0.159125
0
0.707278
0
0
0.062416
0.011502
0
0
0
0
0.123418
1
0.064873
false
0.047468
0.022152
0
0.098101
0.003165
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
927cefa71dabae9112ede886dafbbcb0dae5b491
11,909
py
Python
test/test_utils.py
jks-liu/noiseplanet
907b2bb9a93df48a266ad01c7cad0d8ef2367e78
[ "Apache-2.0" ]
27
2020-06-13T21:00:53.000Z
2022-03-29T03:22:06.000Z
test/test_utils.py
voodooed/noiseplanet
fca79ef3b81826a5286d566ebf3bf9340df13201
[ "Apache-2.0" ]
12
2020-12-24T08:14:00.000Z
2022-02-06T18:01:51.000Z
test/test_utils.py
voodooed/noiseplanet
fca79ef3b81826a5286d566ebf3bf9340df13201
[ "Apache-2.0" ]
9
2020-08-28T16:06:54.000Z
2022-01-26T01:05:02.000Z
# -*- coding: utf-8 -*- """ Created on Sun Jan 19 17:33:44 2020 @author: arthurd """ import json import numpy as np import pandas as pd from noiseplanet import utils def test_df_to_geojson(): geojson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.914903366028505, 45.7852725976994, 308.5739246938037 ] }, "properties": { "leq_mean": 40.07053, "marker-color": "#B8D6D1", "accuracy": 96, "location_utc": 1507071853948, "leq_utc": 1507071853144, "leq_id": 4, "bearing": 215.15285, "speed": 0.22279137, "leq_100": 27.960316, "leq_125": 27.812155, "leq_160": 24.650198, "leq_200": 25.09629, "leq_250": 21.228565, "leq_315": 21.56663, "leq_400": 26.527437, "leq_500": 29.834623, "leq_630": 27.973343, "leq_800": 28.65164, "leq_1000": 29.625328, "leq_1250": 27.457666, "leq_1600": 24.705, "leq_2000": 26.625557, "leq_2500": 30.395763, "leq_3150": 25.542177, "leq_4000": 25.08086, "leq_5000": 24.600506, "leq_6300": 26.505657, "leq_8000": 25.828566, "leq_10000": 20.198694, "leq_12500": 15.001841, "leq_16000": 10.275352 } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.9148443050763015, 45.78526148961034, 299.0012617091176 ] }, "properties": { "leq_mean": 41.105766, "marker-color": "#B8D6D1", "accuracy": 128, "location_utc": 1507071854948, "leq_utc": 1507071854216, "leq_id": 5, "bearing": 239.0649, "speed": 0.14811344, "leq_100": 9.679459, "leq_125": 13.061665, "leq_160": 14.144692, "leq_200": 20.06505, "leq_250": 18.503063, "leq_315": 22.471695, "leq_400": 27.914675, "leq_500": 28.075678, "leq_630": 29.18336, "leq_800": 30.089338, "leq_1000": 32.148552, "leq_1250": 30.177233, "leq_1600": 27.067488, "leq_2000": 29.18854, "leq_2500": 32.27753, "leq_3150": 28.223087, "leq_4000": 29.28262, "leq_5000": 27.599894, "leq_6300": 28.638742, "leq_8000": 28.081095, "leq_10000": 21.839924, "leq_12500": 16.590805, "leq_16000": 11.953764 } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.914792221261604, 45.78528816803448, 292.51776728496185 ] }, "properties": { "leq_mean": 41.523438, "marker-color": "#B8D6D1", "accuracy": 128, "location_utc": 1507071855948, "leq_utc": 1507071855340, "leq_id": 6, "bearing": 300.32434, "speed": 0.13124688, "leq_100": 8.998961, "leq_125": 12.450066, "leq_160": 13.862192, "leq_200": 20.57264, "leq_250": 17.827635, "leq_315": 22.80262, "leq_400": 27.544498, "leq_500": 27.598087, "leq_630": 29.47041, "leq_800": 30.46653, "leq_1000": 32.52231, "leq_1250": 30.676237, "leq_1600": 27.500904, "leq_2000": 30.069105, "leq_2500": 32.984486, "leq_3150": 28.696085, "leq_4000": 29.280056, "leq_5000": 28.045334, "leq_6300": 29.626554, "leq_8000": 28.745527, "leq_10000": 22.237398, "leq_12500": 16.701935, "leq_16000": 11.957227 } } ] } df = utils.geojson_to_df(geojson, normalize_header=True) print(df) def test_df_to_geojson(): geojson = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.914903366028505, 45.7852725976994, 308.5739246938037 ] }, "properties": { "leq_mean": 40.07053, "marker-color": "#B8D6D1", "accuracy": 96, "location_utc": 1507071853948, "leq_utc": 1507071853144, "leq_id": 4, "bearing": 215.15285, "speed": 0.22279137, "leq_100": 27.960316, "leq_125": 27.812155, "leq_160": 24.650198, "leq_200": 25.09629, "leq_250": 21.228565, "leq_315": 21.56663, "leq_400": 26.527437, "leq_500": 29.834623, "leq_630": 27.973343, "leq_800": 28.65164, "leq_1000": 29.625328, "leq_1250": 27.457666, "leq_1600": 24.705, "leq_2000": 26.625557, "leq_2500": 30.395763, "leq_3150": 25.542177, "leq_4000": 25.08086, "leq_5000": 24.600506, "leq_6300": 26.505657, "leq_8000": 25.828566, "leq_10000": 20.198694, "leq_12500": 15.001841, "leq_16000": 10.275352 } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.9148443050763015, 45.78526148961034, 299.0012617091176 ] }, "properties": { "leq_mean": 41.105766, "marker-color": "#B8D6D1", "accuracy": 128, "location_utc": 1507071854948, "leq_utc": 1507071854216, "leq_id": 5, "bearing": 239.0649, "speed": 0.14811344, "leq_100": 9.679459, "leq_125": 13.061665, "leq_160": 14.144692, "leq_200": 20.06505, "leq_250": 18.503063, "leq_315": 22.471695, "leq_400": 27.914675, "leq_500": 28.075678, "leq_630": 29.18336, "leq_800": 30.089338, "leq_1000": 32.148552, "leq_1250": 30.177233, "leq_1600": 27.067488, "leq_2000": 29.18854, "leq_2500": 32.27753, "leq_3150": 28.223087, "leq_4000": 29.28262, "leq_5000": 27.599894, "leq_6300": 28.638742, "leq_8000": 28.081095, "leq_10000": 21.839924, "leq_12500": 16.590805, "leq_16000": 11.953764 } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 4.914792221261604, 45.78528816803448, 292.51776728496185 ] }, "properties": { "leq_mean": 41.523438, "marker-color": "#B8D6D1", "accuracy": 128, "location_utc": 1507071855948, "leq_utc": 1507071855340, "leq_id": 6, "bearing": 300.32434, "speed": 0.13124688, "leq_100": 8.998961, "leq_125": 12.450066, "leq_160": 13.862192, "leq_200": 20.57264, "leq_250": 17.827635, "leq_315": 22.80262, "leq_400": 27.544498, "leq_500": 27.598087, "leq_630": 29.47041, "leq_800": 30.46653, "leq_1000": 32.52231, "leq_1250": 30.676237, "leq_1600": 27.500904, "leq_2000": 30.069105, "leq_2500": 32.984486, "leq_3150": 28.696085, "leq_4000": 29.280056, "leq_5000": 28.045334, "leq_6300": 29.626554, "leq_8000": 28.745527, "leq_10000": 22.237398, "leq_12500": 16.701935, "leq_16000": 11.957227 } } ] } df = pd.DataFrame(geojson) df = utils.df_geojson(df) print(df) if __name__ == "__main__": # DataFrame <-> GeoJSON test_df_to_geojson() # print('1/ Read a geojson and convert it in dataframe\n') # trackname = 'track_1' # filename = 'data/track/' + trackname + '.geojson' # with open(filename) as f: # geojson = json.load(f) # df = utils.geojson_to_df(geojson, extract_coordinates=True) # print(df.head()) # print('\n2/ Write a dataframe in a geojson format') # print("2.1/ Let's add one extra column, stats for example :\n") # stats = np.random.randint(20, 40, size=len(df)) # df['stats'] = stats # print(df.head()) # print('2.2/ Write the new geojson') # properties = ['location_utc', # 'bearing', # 'speed', # 'accuracy', # 'leq_id', # 'leq_utc', # 'leq_mean', # 'leq_100', # 'marker-color', # 'stats'] # gj = utils.df_to_geojson(df, properties, geometry_type='type', # lat='latitude', lon='longitude', z='elevation') # with open('data/test_write.geojson', 'w') as f: # json.dump(gj, f) # print('file wrinten in data/test_write.geojson') # print("\n2.3/ Let's see the new file :\n") # with open('data/test_write.geojson') as f: # geojson_new = json.load(f) # df_new = utils.geojson_to_df(geojson_new, extract_coordinates=True) # print(df_new.head()) # trackname = 'meta_1' # filename = 'data/track/' + trackname + '.properties' # props = utils.properties_to_df(filename)
33.832386
69
0.392644
1,041
11,909
4.292027
0.248799
0.0188
0.025515
0.030886
0.815801
0.785586
0.76231
0.76231
0.76231
0.76231
0
0.365209
0.485431
11,909
351
70
33.928775
0.363903
0.120833
0
0.850174
0
0
0.177859
0
0
0
0
0
0
1
0.006969
false
0
0.013937
0
0.020906
0.006969
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
92a6e8d452051b7e9b2287e949fcce30f9e39549
2,794
py
Python
project/pro1-hog/tests/04.py
zltshadow/CS61A-2019-summer
0f5dd0be5f51927364aec1bc974526837328b695
[ "MIT" ]
3
2021-11-21T06:09:39.000Z
2022-03-12T08:05:27.000Z
project/pro1-hog/tests/04.py
zltshadow/CS61A-2019-summer
0f5dd0be5f51927364aec1bc974526837328b695
[ "MIT" ]
null
null
null
project/pro1-hog/tests/04.py
zltshadow/CS61A-2019-summer
0f5dd0be5f51927364aec1bc974526837328b695
[ "MIT" ]
null
null
null
test = { 'name': 'Question 4', 'points': 2, 'suites': [ { 'cases': [ { 'code': r""" >>> is_swap(56, 32) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(56, 35) True """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(89, 91) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(19, 19) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(123, 12) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(26, 2) True """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(12, 2) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(8, 108) True """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(36, 35) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(1, 2) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(2, 2) True """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(134, 51) True >>> is_swap(128, 2) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(85, 108) True """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(20, 0) False """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(10, 1) True """, 'hidden': False, 'locked': False }, { 'code': r""" >>> is_swap(10, 16) False """, 'hidden': False, 'locked': False } ], 'scored': True, 'setup': r""" >>> from hog import * """, 'teardown': '', 'type': 'doctest' } ] }
19.006803
30
0.27738
199
2,794
3.809045
0.226131
0.134565
0.147757
0.23219
0.819261
0.763852
0.763852
0.763852
0.763852
0.360158
0
0.051958
0.552255
2,794
146
31
19.136986
0.553957
0
0
0.561644
0
0
0.464567
0
0
0
0
0
0
1
0
false
0
0.006849
0
0.006849
0
0
0
0
null
0
0
1
1
1
1
1
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
2bd4504e980f5cabebf2c452d7798133da599e0c
609
py
Python
permutations/scratch.py
anzharip/algorithm-and-datastructure
b83273330066ace02ecccfe834acdd998d21b5a4
[ "MIT" ]
null
null
null
permutations/scratch.py
anzharip/algorithm-and-datastructure
b83273330066ace02ecccfe834acdd998d21b5a4
[ "MIT" ]
null
null
null
permutations/scratch.py
anzharip/algorithm-and-datastructure
b83273330066ace02ecccfe834acdd998d21b5a4
[ "MIT" ]
null
null
null
[[1, 2, 3]] [[1, 2, 3], [1, 3, 2]] [[1, 2, 3], [1, 3, 2], [2, 1, 3]] [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1]] [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 2, 1]] [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2]] [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 2, 1], [3, 1, 2]] [[1, 2, 3]] [[1, 3, 2], [1, 3, 2]] [[2, 1, 3], [2, 1, 3], [2, 1, 3]] [[2, 3, 1], [2, 3, 1], [2, 3, 1], [2, 3, 1]] [[3, 2, 1], [3, 2, 1], [3, 2, 1], [3, 2, 1], [3, 2, 1]] [[3, 1, 2], [3, 1, 2], [3, 1, 2], [3, 1, 2], [3, 1, 2], [3, 1, 2]] [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]
38.0625
66
0.26601
162
609
1
0.018519
0.37037
0.481481
0.518519
1
1
1
1
1
0.981481
0
0.363229
0.267652
609
16
67
38.0625
0
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
1
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
0
0
0
0
0
1
0
0
0
0
0
0
13
a64d8f07c08c05e09546187649b2f79ef163c80e
4,269
py
Python
excercises/Week_2/E1.py
vpalacio/p4ne
3bb861ec46be2ede84b4dbb92d19081cce3643eb
[ "MIT" ]
null
null
null
excercises/Week_2/E1.py
vpalacio/p4ne
3bb861ec46be2ede84b4dbb92d19081cce3643eb
[ "MIT" ]
null
null
null
excercises/Week_2/E1.py
vpalacio/p4ne
3bb861ec46be2ede84b4dbb92d19081cce3643eb
[ "MIT" ]
null
null
null
(applied_python)[vpalacio@ip-172-30-0-38 ~]$ python Python 2.7.10 (default, Dec 8 2015, 18:25:23) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> import pysnmp >>> import paramiko >>> >>> dir (pysnmp) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', 'majorVersionId', 'version', 'x'] >>> dir (paramiko) ['AUTH_FAILED', 'AUTH_PARTIALLY_SUCCESSFUL', 'AUTH_SUCCESSFUL', 'Agent', 'AgentKey', 'AuthHandler', 'AuthenticationException', 'AutoAddPolicy', 'BadAuthenticationType', 'BadHostKeyException', 'BaseSFTP', 'BufferedFile', 'Channel', 'ChannelException', 'ChannelFile', 'DSSKey', 'ECDSAKey', 'GSSAuth', 'GSS_AUTH_AVAILABLE', 'HostKeys', 'InteractiveQuery', 'Message', 'MissingHostKeyPolicy', 'OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED', 'OPEN_FAILED_CONNECT_FAILED', 'OPEN_FAILED_RESOURCE_SHORTAGE', 'OPEN_FAILED_UNKNOWN_CHANNEL_TYPE', 'OPEN_SUCCEEDED', 'PKey', 'Packetizer', 'PasswordRequiredException', 'ProxyCommand', 'ProxyCommandFailure', 'RSAKey', 'RejectPolicy', 'SFTP', 'SFTPAttributes', 'SFTPClient', 'SFTPError', 'SFTPFile', 'SFTPHandle', 'SFTPServer', 'SFTPServerInterface', 'SFTP_BAD_MESSAGE', 'SFTP_CONNECTION_LOST', 'SFTP_EOF', 'SFTP_FAILURE', 'SFTP_NO_CONNECTION', 'SFTP_NO_SUCH_FILE', 'SFTP_OK', 'SFTP_OP_UNSUPPORTED', 'SFTP_PERMISSION_DENIED', 'SSHClient', 'SSHConfig', 'SSHException', 'SecurityOptions', 'ServerInterface', 'SubsystemHandler', 'Transport', 'WarningPolicy', '__all__', '__author__', '__builtins__', '__doc__', '__file__', '__license__', '__name__', '__package__', '__path__', '__version__', '__version_info__', '_version', 'agent', 'auth_handler', 'ber', 'buffered_pipe', 'channel', 'client', 'common', 'compress', 'config', 'dsskey', 'ecdsakey', 'file', 'hostkeys', 'io_sleep', 'kex_gex', 'kex_group1', 'kex_group14', 'kex_gss', 'message', 'packet', 'pipe', 'pkey', 'primes', 'proxy', 'py3compat', 'resource', 'rsakey', 'server', 'sftp', 'sftp_attr', 'sftp_client', 'sftp_file', 'sftp_handle', 'sftp_server', 'sftp_si', 'ssh_exception', 'ssh_gss', 'sys', 'transport', 'util'] >>> >>> >>> from pprint import pprint >>> pprint (dir(pysnmp)) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', 'majorVersionId', 'version', 'x'] >>> pprint (dir(paramiko)) ['AUTH_FAILED', 'AUTH_PARTIALLY_SUCCESSFUL', 'AUTH_SUCCESSFUL', 'Agent', 'AgentKey', 'AuthHandler', 'AuthenticationException', 'AutoAddPolicy', 'BadAuthenticationType', 'BadHostKeyException', 'BaseSFTP', 'BufferedFile', 'Channel', 'ChannelException', 'ChannelFile', 'DSSKey', 'ECDSAKey', 'GSSAuth', 'GSS_AUTH_AVAILABLE', 'HostKeys', 'InteractiveQuery', 'Message', 'MissingHostKeyPolicy', 'OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED', 'OPEN_FAILED_CONNECT_FAILED', 'OPEN_FAILED_RESOURCE_SHORTAGE', 'OPEN_FAILED_UNKNOWN_CHANNEL_TYPE', 'OPEN_SUCCEEDED', 'PKey', 'Packetizer', 'PasswordRequiredException', 'ProxyCommand', 'ProxyCommandFailure', 'RSAKey', 'RejectPolicy', 'SFTP', 'SFTPAttributes', 'SFTPClient', 'SFTPError', 'SFTPFile', 'SFTPHandle', 'SFTPServer', 'SFTPServerInterface', 'SFTP_BAD_MESSAGE', 'SFTP_CONNECTION_LOST', 'SFTP_EOF', 'SFTP_FAILURE', 'SFTP_NO_CONNECTION', 'SFTP_NO_SUCH_FILE', 'SFTP_OK', 'SFTP_OP_UNSUPPORTED', 'SFTP_PERMISSION_DENIED', 'SSHClient', 'SSHConfig', 'SSHException', 'SecurityOptions', 'ServerInterface', 'SubsystemHandler', 'Transport', 'WarningPolicy', '__all__', '__author__', '__builtins__', '__doc__', '__file__', '__license__', '__name__', '__package__', '__path__', '__version__', '__version_info__', '_version', 'agent', 'auth_handler', 'ber', 'buffered_pipe', 'channel', 'client', 'common', 'compress', 'config', 'dsskey', 'ecdsakey', 'file', 'hostkeys', 'io_sleep', 'kex_gex', 'kex_group1', 'kex_group14', 'kex_gss', 'message', 'packet', 'pipe', 'pkey', 'primes', 'proxy', 'py3compat', 'resource', 'rsakey', 'server', 'sftp', 'sftp_attr', 'sftp_client', 'sftp_file', 'sftp_handle', 'sftp_server', 'sftp_si', 'ssh_exception', 'ssh_gss', 'sys', 'transport', 'util'] >>> ... >>> print pysnmp.version (4, 3, 2) >>> print paramiko.__version__ 1.16.0
29.239726
1,703
0.699227
420
4,269
6.5
0.359524
0.029304
0.021978
0.032234
0.906227
0.906227
0.906227
0.906227
0.906227
0.906227
0
0.014107
0.103303
4,269
146
1,704
29.239726
0.69906
0
0
0.123288
0
0
0.634895
0.113349
0
0
0
0
0
0
null
null
0.013699
0.020548
null
null
0.034247
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
9
a6a6164e801c2059475e31780a89692085bd6265
2,627
py
Python
api/gsn-api/gsndb/migrations/0002_auto_20190221_2338.py
DonovanDarko/gsn
a6e76fcf7abea4559157de35edff9c184c944898
[ "ISC" ]
2
2019-01-15T22:46:03.000Z
2019-04-09T01:34:19.000Z
api/gsn_api/gsndb/migrations/0002_auto_20190221_2338.py
MrYetly/gsn
1b49a5db31f5e19c0d39ee7f3b8783b55c3bf81d
[ "ISC" ]
null
null
null
api/gsn_api/gsndb/migrations/0002_auto_20190221_2338.py
MrYetly/gsn
1b49a5db31f5e19c0d39ee7f3b8783b55c3bf81d
[ "ISC" ]
3
2019-03-22T03:25:46.000Z
2019-03-30T20:59:29.000Z
# Generated by Django 2.1.5 on 2019-02-21 23:38 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('gsndb', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.AddField( model_name='referral', name='user', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='grade', name='calendar', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Calendar'), ), migrations.AddField( model_name='grade', name='course', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Course'), ), migrations.AddField( model_name='grade', name='student', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Student'), ), migrations.AddField( model_name='course', name='school', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.School'), ), migrations.AddField( model_name='behavior', name='calendar', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Calendar'), ), migrations.AddField( model_name='behavior', name='school', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.School'), ), migrations.AddField( model_name='behavior', name='student', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Student'), ), migrations.AddField( model_name='attendance', name='calendar', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Calendar'), ), migrations.AddField( model_name='attendance', name='school', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.School'), ), migrations.AddField( model_name='attendance', name='student', field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gsndb.Student'), ), ]
35.5
110
0.601827
268
2,627
5.794776
0.179104
0.066967
0.108178
0.169994
0.782357
0.782357
0.710882
0.710882
0.710882
0.710882
0
0.009937
0.272174
2,627
73
111
35.986301
0.802301
0.01713
0
0.742424
1
0
0.117054
0
0
0
0
0
0
1
0
false
0
0.045455
0
0.106061
0
0
0
0
null
0
0
1
0
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
a6db48588583afe7ca76a8524b77b3c0e5059855
20,437
py
Python
Chas_Campbell_Gravitational_Engine/Version_1/unit_tests.py
Jay4C/Python-Macros-For_FreeCAD
12ce5441a26731377fa43e86ccd2be675740d3a0
[ "MIT" ]
null
null
null
Chas_Campbell_Gravitational_Engine/Version_1/unit_tests.py
Jay4C/Python-Macros-For_FreeCAD
12ce5441a26731377fa43e86ccd2be675740d3a0
[ "MIT" ]
null
null
null
Chas_Campbell_Gravitational_Engine/Version_1/unit_tests.py
Jay4C/Python-Macros-For_FreeCAD
12ce5441a26731377fa43e86ccd2be675740d3a0
[ "MIT" ]
null
null
null
import os import time import unittest import pywinauto.mouse import pywinauto.keyboard class UnitTestsChasCampbellGravitationalEngineVersion1(unittest.TestCase): # ok # https://www.visseriefixations.fr/tiges-filetees/acier-classe-4-6/tige-filetee-acier-4-6-brut-din-975/tige-filetee-m20-acier-4-6-brut-din-975.html def test_part_tige_filetee_m20_1000l(self): print("test_part_tige_filetee_m20_1000l") if os.path.exists("part_tige_filetee_m20_1000l.py"): os.remove("part_tige_filetee_m20_1000l.py") else: print("The file does not exist") # Writing to file with open("part_tige_filetee_m20_1000l.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Drawing, math, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "tige_filetee_m20_1000l" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 # tige_filetee_m20_1000l tige_filetee_m20_1000l = Part.makeCylinder(20/2, 1000) Part.show(tige_filetee_m20_1000l) DOC.recompute() __objs__ = [] __objs__.append(FreeCAD.getDocument("tige_filetee_m20_1000l").getObject("Shape")) stl_file = u"part_tige_filetee_m20_1000l.stl" Mesh.export(__objs__, stl_file) setview() """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"part_tige_filetee_m20_1000l.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') # ok # https://www.visseriefixations.fr/ecrous/ecrous-autofreines/ecrou-hexagonal-autofreine-nylstop/ecrou-nylstop-acier-zingue-blanc-din-985/ecrou-nylstop-m20-z-blanc-din-985.html def test_part_ecrou_20m(self): print("test_part_ecrou_20m") if os.path.exists("part_ecrou_20m.py"): os.remove("part_ecrou_20m.py") else: print("The file does not exist") # Writing to file with open("part_ecrou_20m.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "part_ecrou_20m" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 d1 = 20 e = 32.95 h = 20 cylinder_1 = Part.makeCylinder(e/2, h) cylinder_2 = Part.makeCylinder(d1/2, h) cylinder_1 = cylinder_1.cut(cylinder_2) Part.show(cylinder_1) DOC.recompute() __objs__=[] __objs__.append(FreeCAD.getDocument("part_ecrou_20m").getObject("Shape")) stl_file = u"part_ecrou_20m.stl" Mesh.export(__objs__, stl_file) setview() """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"part_ecrou_20m.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') # ok # https://www.visseriefixations.fr/rondelles-circlips/rondelles-plates/sans-chanfrein/serie-etroite-z/acier/rondelle-z-acier-zingue-blanc-nfe-25513/rondelle-z-0-20-z-blanc-nfe-25513.html def test_part_rondelle_20m(self): print("test_part_rondelle_20m") if os.path.exists("part_rondelle_20m.py"): os.remove("part_rondelle_20m.py") else: print("The file does not exist") # Writing to file with open("part_rondelle_20m.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "part_rondelle_20m" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 d1 = 21 d2 = 36 s = 3 cylinder_1 = Part.makeCylinder(d2/2, s) cylinder_2 = Part.makeCylinder(d1/2, s) cylinder_1 = cylinder_1.cut(cylinder_2) Part.show(cylinder_1) DOC.recompute() __objs__=[] __objs__.append(FreeCAD.getDocument("part_rondelle_20m").getObject("Shape")) stl_file = u"part_rondelle_20m.stl" Mesh.export(__objs__, stl_file) setview() """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"part_rondelle_20m.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') # ok # https://www.mypalletsonline.com/fr/palette-occasion-1000x1200/197-palette-bois-1000-x-1200-recycle-demi-lourde-3s.html def test_part_support_masselotte(self): print("test_part_support_masselotte") if os.path.exists("part_support_masselotte.py"): os.remove("part_support_masselotte.py") else: print("The file does not exist") # Writing to file with open("part_support_masselotte.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "part_support_masselotte" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 length = 1200 width = 70 thickness = 20 box_1 = Part.makeBox(length, width, thickness) cylinder_1 = Part.makeCylinder(20/2, 20) # box_1 cut by cylinder_1 cylinder_1_vector = FreeCAD.Vector(600, 35, 0) cylinder_1.translate(cylinder_1_vector) box_1 = box_1.cut(cylinder_1) Part.show(box_1) DOC.recompute() __objs__=[] __objs__.append(FreeCAD.getDocument("part_support_masselotte").getObject("Shape")) stl_file = u"part_support_masselotte.stl" Mesh.export(__objs__, stl_file) setview() """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"part_support_masselotte.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') # ok # https://www.mypalletsonline.com/fr/palette-occasion-1000x1200/197-palette-bois-1000-x-1200-recycle-demi-lourde-3s.html def test_part_masselotte(self): print("test_part_masselotte") if os.path.exists("part_masselotte.py"): os.remove("part_masselotte.py") else: print("The file does not exist") # Writing to file with open("part_masselotte.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "part_masselotte" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 length = 200 width = 70 thickness = 20 box_1 = Part.makeBox(length, width, thickness) Part.show(box_1) DOC.recompute() __objs__=[] __objs__.append(FreeCAD.getDocument("part_masselotte").getObject("Shape")) stl_file = u"part_masselotte.stl" Mesh.export(__objs__, stl_file) setview() """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"part_masselotte.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') # ok def test_assembly_slice_flywheel(self): print("test_assembly_slice_flywheel") if os.path.exists("assembly_slice_flywheel.py"): os.remove("assembly_slice_flywheel.py") else: print("The file does not exist") # Writing to file with open("assembly_slice_flywheel.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Drawing, math, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "assembly_slice_flywheel" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 # part_support_masselotte Mesh.insert(u"part_support_masselotte.stl","assembly_slice_flywheel") FreeCADGui.getDocument("assembly_slice_flywheel").getObject("part_support_masselotte").ShapeColor = (0.10,0.10,0.10) FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_support_masselotte").Placement = App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(0,0,1),0)) # part_masselotte Mesh.insert(u"part_masselotte.stl","assembly_slice_flywheel") FreeCADGui.getDocument("assembly_slice_flywheel").getObject("part_masselotte").ShapeColor = (0.90,0.80,0.70) FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte").Placement = App.Placement(App.Vector(1000,0,-25),App.Rotation(App.Vector(1,0,0),90)) # part_masselotte for i in range(1, 10): x = 1000 y = -i * 20 z = -25 Mesh.insert(u"part_masselotte.stl","assembly_slice_flywheel") FreeCADGui.getDocument("assembly_slice_flywheel").getObject("part_masselotte00" + str(i)).ShapeColor = (0.90,0.80,0.70) FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte00" + str(i)).Placement = App.Placement(App.Vector(x,y,z),App.Rotation(App.Vector(1,0,0),90)) # part_masselotte for i in range(10, 20): x = 1000 y = 90 + 20 * (i-10) z = -25 Mesh.insert(u"part_masselotte.stl","assembly_slice_flywheel") FreeCADGui.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i)).ShapeColor = (0.90,0.80,0.70) FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i)).Placement = App.Placement(App.Vector(x,y,z),App.Rotation(App.Vector(1,0,0),90)) # part_masselotte for i in range(20, 30): x = 0 y = -20 * (i - 20) z = -25 Mesh.insert(u"part_masselotte.stl","assembly_slice_flywheel") FreeCADGui.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i)).ShapeColor = (0.90,0.80,0.70) FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i)).Placement = App.Placement(App.Vector(x,y,z),App.Rotation(App.Vector(1,0,0),90)) # part_masselotte for i in range(30, 40): x = 0 y = 90 + 20 * (i-30) z = -25 Mesh.insert(u"part_masselotte.stl","assembly_slice_flywheel") FreeCADGui.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i)).ShapeColor = (0.90,0.80,0.70) FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i)).Placement = App.Placement(App.Vector(x,y,z),App.Rotation(App.Vector(1,0,0),90)) setview() # Export assembly_slice_flywheel __objs__=[] __objs__.append(FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_support_masselotte")) __objs__.append(FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte")) for i in range(1, 10): __objs__.append(FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte00" + str(i))) for i in range(10, 20): __objs__.append(FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i))) for i in range(20, 30): __objs__.append(FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i))) for i in range(30, 40): __objs__.append(FreeCAD.getDocument("assembly_slice_flywheel").getObject("part_masselotte0" + str(i))) Mesh.export(__objs__,u"assembly_slice_flywheel.stl") del __objs__ """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"assembly_slice_flywheel.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') # ok def test_assembly_flywheel(self): print("test_assembly_flywheel") if os.path.exists("assembly_flywheel.py"): os.remove("assembly_flywheel.py") else: print("The file does not exist") # Writing to file with open("assembly_flywheel.py", "w") as file: # Writing data to a file file.write("""import FreeCAD, Part, Drawing, math, Mesh DOC = FreeCAD.activeDocument() DOC_NAME = "assembly_flywheel" def clear_doc(): # Clear the active document deleting all the objects for obj in DOC.Objects: DOC.removeObject(obj.Name) def setview(): # Rearrange View FreeCAD.Gui.SendMsgToActiveView("ViewFit") FreeCAD.Gui.activeDocument().activeView().viewAxometric() if DOC is None: FreeCAD.newDocument(DOC_NAME) FreeCAD.setActiveDocument(DOC_NAME) DOC = FreeCAD.activeDocument() else: clear_doc() # EPS= tolerance to use to cut the parts EPS = 0.10 EPS_C = EPS * -0.5 # part_tige_filetee_m20_1000l Mesh.insert(u"part_tige_filetee_m20_1000l.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_tige_filetee_m20_1000l").ShapeColor = (0.40,0.20,0.10) FreeCAD.getDocument("assembly_flywheel").getObject("part_tige_filetee_m20_1000l").Placement = App.Placement(App.Vector(600,35,-(1000-20)/2),App.Rotation(App.Vector(0,0,1),0)) # assembly_slice_flywheel Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel").ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel").Placement = App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(0,0,1),0)) # assembly_slice_flywheel for i in range(1, 7): z = 70 * i Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).Placement = App.Placement(App.Vector(0,0,z),App.Rotation(App.Vector(0,0,1),0)) # assembly_slice_flywheel for i in range(7, 13): z = -70 * (i - 6) if i < 10: Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i)).Placement = App.Placement(App.Vector(0,0,z),App.Rotation(App.Vector(0,0,1),0)) else: Mesh.insert(u"assembly_slice_flywheel.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel0" + str(i)).ShapeColor = (0.10,0.20,0.40) FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel0" + str(i)).Placement = App.Placement(App.Vector(0,0,z),App.Rotation(App.Vector(0,0,1),0)) setview() # part_rondelle_20m Mesh.insert(u"part_rondelle_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_rondelle_20m").ShapeColor = (0.90,0.70,0.50) FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m").Placement = App.Placement(App.Vector(600,35,70*6 + 20),App.Rotation(App.Vector(0,0,1),0)) # part_rondelle_20m Mesh.insert(u"part_rondelle_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_rondelle_20m001").ShapeColor = (0.90,0.70,0.50) FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m001").Placement = App.Placement(App.Vector(600,35,-70*6 - 3),App.Rotation(App.Vector(0,0,1),0)) # part_ecrou_20m Mesh.insert(u"part_ecrou_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_ecrou_20m").ShapeColor = (0.30,0.60,0.90) FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m").Placement = App.Placement(App.Vector(600,35,70*6 + 20 + 3),App.Rotation(App.Vector(0,0,1),0)) # part_ecrou_20m Mesh.insert(u"part_ecrou_20m.stl","assembly_flywheel") FreeCADGui.getDocument("assembly_flywheel").getObject("part_ecrou_20m001").ShapeColor = (0.30,0.60,0.90) FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m001").Placement = App.Placement(App.Vector(600,35,-70*6 - 3 - 20),App.Rotation(App.Vector(0,0,1),0)) # Export assembly_flywheel __objs__=[] __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_tige_filetee_m20_1000l")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel")) for i in range(1, 10): __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel00" + str(i))) for i in range(10, 13): __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("assembly_slice_flywheel0" + str(i))) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_rondelle_20m001")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m")) __objs__.append(FreeCAD.getDocument("assembly_flywheel").getObject("part_ecrou_20m001")) Mesh.export(__objs__,u"assembly_flywheel.stl") del __objs__ """) time.sleep(3) pywinauto.mouse.click(button="left", coords=(460, 750)) time.sleep(3) pywinauto.mouse.click(button="left", coords=(70, 670)) time.sleep(3) pywinauto.keyboard.send_keys( 'exec{(}open{(}"assembly_flywheel.py"{)}.read{(}{)}{)}' ) time.sleep(3) pywinauto.keyboard.send_keys('{ENTER}') if __name__ == '__main__': unittest.main()
29.112536
190
0.692714
2,758
20,437
4.914793
0.075417
0.048912
0.066617
0.039248
0.91398
0.875839
0.844633
0.816525
0.810697
0.758392
0
0.05142
0.164506
20,437
701
191
29.154066
0.74243
0.050692
0
0.680089
0
0.067114
0.783524
0.488232
0
0
0
0
0
1
0.01566
false
0
0.026846
0
0.044743
0.03132
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
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
471588d00821053c66db6a34ef4b8a86d3fe161b
29
py
Python
tca9555/__init__.py
leloup314/TCA9555
bd1b9c21a4baff5af10e0cd67b9889822a7c8709
[ "MIT" ]
null
null
null
tca9555/__init__.py
leloup314/TCA9555
bd1b9c21a4baff5af10e0cd67b9889822a7c8709
[ "MIT" ]
null
null
null
tca9555/__init__.py
leloup314/TCA9555
bd1b9c21a4baff5af10e0cd67b9889822a7c8709
[ "MIT" ]
null
null
null
from .tca9555 import TCA9555
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0.32
0.137931
29
1
29
29
0.64
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
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
5b39435466bc3690c4a2161bc8e18aea0b710ff5
47
py
Python
examples/phobos/tests/test_std_concurrency.py
kinke/autowrap
2f042df3f292aa39b1da0b9607fbe3424f56ff4a
[ "BSD-3-Clause" ]
47
2019-07-16T10:38:07.000Z
2022-03-30T16:34:24.000Z
examples/phobos/tests/test_std_concurrency.py
kinke/autowrap
2f042df3f292aa39b1da0b9607fbe3424f56ff4a
[ "BSD-3-Clause" ]
199
2019-06-17T23:24:40.000Z
2021-06-16T16:41:36.000Z
examples/phobos/tests/test_std_concurrency.py
kinke/autowrap
2f042df3f292aa39b1da0b9607fbe3424f56ff4a
[ "BSD-3-Clause" ]
7
2019-09-13T18:03:49.000Z
2022-01-17T03:53:00.000Z
def test_import(): import std_concurrency
11.75
26
0.744681
6
47
5.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.191489
47
3
27
15.666667
0.868421
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
1
0
1.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
7
752c2fcefb026e700beec906120f096faf02660d
3,188
py
Python
rock-paper-scissors.py
dzaimov01/Rock-Paper-Scissors
caa250de26cd51f57393433304b72bf87bd50393
[ "MIT" ]
null
null
null
rock-paper-scissors.py
dzaimov01/Rock-Paper-Scissors
caa250de26cd51f57393433304b72bf87bd50393
[ "MIT" ]
null
null
null
rock-paper-scissors.py
dzaimov01/Rock-Paper-Scissors
caa250de26cd51f57393433304b72bf87bd50393
[ "MIT" ]
null
null
null
import random print('Enter rock, paper or scissors: ') user_input = input() possible_answers = ['rock', 'paper', 'scissors'] computer_answer = possible_answers[random.randint(0, 2)] computer_score = 0 user_score = 0 games_played = 0 while user_input != 'end': if user_input == 'rock': if computer_answer == 'paper': computer_score += 1 print('Computer won! Enter another one: ') user_input = input() computer_answer = possible_answers[random.randint(0, 2)] games_played += 1 if computer_answer == 'scissors': user_score += 1 print('User won!') print('Enter another one: ') user_input = input() computer_answer = possible_answers[random.randint(0, 2)] games_played += 1 if computer_answer == 'rock': print('Draw! Enter rock, paper or scissors again: ') user_input = input() games_played += 1 computer_answer = possible_answers[random.randint(0, 2)] elif user_input == 'paper': if computer_answer == 'scissors': computer_score += 1 print('Computer won!') print('Enter another one: ') user_input = input() computer_answer = possible_answers[random.randint(0, 2)] games_played += 1 if computer_answer == 'rock': user_score += 1 print('User won!') print('Enter another one: ') user_input = input() computer_answer = possible_answers[random.randint(0, 2)] games_played += 1 if computer_answer == 'paper': print('Draw! Enter rock, paper or scissors again: ') user_input = input() games_played += 1 computer_answer = possible_answers[random.randint(0, 2)] elif user_input == 'scissors': if computer_answer == 'rock': computer_score += 1 print('Computer won!') print('Enter another one: ') user_input = input() computer_answer = possible_answers[random.randint(0, 2)] games_played += 1 if computer_answer == 'paper': user_score += 1 print('User won!') print('Enter another one: ') user_input = input() computer_answer = possible_answers[random.randint(0, 2)] games_played += 1 if computer_answer == 'scissors': print('Draw! Enter rock, paper or scissors again: ') user_input = input() games_played += 1 computer_answer = possible_answers[random.randint(0, 2)] else: break if computer_score > user_score: print('You lose! Try again! Your score is ', user_score, ' and computer score is ', computer_score, ' he won ', computer_score-user_score, ' games more.') elif user_score > computer_score: print('You won! Your score is ', user_score, ' and computer score is ', computer_score, ' you won ', user_score - computer_score, ' games more.') else: print('Draw! You have played ', games_played, ' games')
38.878049
104
0.574028
361
3,188
4.861496
0.113573
0.151567
0.079772
0.165242
0.764103
0.750427
0.733333
0.733333
0.708262
0.708262
0
0.017463
0.31744
3,188
82
105
38.878049
0.789063
0
0
0.75641
0
0
0.188774
0
0
0
0
0
0
1
0
false
0
0.012821
0
0.012821
0.230769
0
0
0
null
0
0
1
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
0
0
0
0
0
0
0
0
0
7
75406f1c936beae2e52e73a0138c36197de4f481
118
py
Python
SEMImportScaleCrop_4924010623d611e88ff4448a5b5d70c0/__init__.py
BraunMichael/DragonflyPlugins
63ccb088ae1f601c8a4a49c7bcf618c6c9aebaa8
[ "MIT" ]
null
null
null
SEMImportScaleCrop_4924010623d611e88ff4448a5b5d70c0/__init__.py
BraunMichael/DragonflyPlugins
63ccb088ae1f601c8a4a49c7bcf618c6c9aebaa8
[ "MIT" ]
null
null
null
SEMImportScaleCrop_4924010623d611e88ff4448a5b5d70c0/__init__.py
BraunMichael/DragonflyPlugins
63ccb088ae1f601c8a4a49c7bcf618c6c9aebaa8
[ "MIT" ]
null
null
null
from .SEMImportScaleCrop_4924010623d611e88ff4448a5b5d70c0 import SEMImportScaleCrop_4924010623d611e88ff4448a5b5d70c0
59
117
0.949153
6
118
18.333333
0.666667
0.909091
0
0
0
0
0
0
0
0
0
0.424779
0.042373
118
1
118
118
0.548673
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
1
0
0
0
0
0
0
0
0
0
1
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
f32dd0bb8220070025bb109f0db1d8568d38f02e
128
py
Python
python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_0/_pkg0_0_0_0/_pkg0_0_0_0_1/_mod0_0_0_0_1_3.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_0/_pkg0_0_0_0/_pkg0_0_0_0_1/_mod0_0_0_0_1_3.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_0/_pkg0_0_0_0/_pkg0_0_0_0_1/_mod0_0_0_0_1_3.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
name0_0_0_0_1_3_0 = None name0_0_0_0_1_3_1 = None name0_0_0_0_1_3_2 = None name0_0_0_0_1_3_3 = None name0_0_0_0_1_3_4 = None
14.222222
24
0.820313
40
128
1.875
0.175
0.266667
0.466667
0.533333
0.88
0.88
0.746667
0
0
0
0
0.318182
0.140625
128
9
25
14.222222
0.363636
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
1
1
1
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
f3789dde3c7675fe310db093e1411404026f2a54
10,484
py
Python
layers/gated_gcn_layer.py
karl-zhao/benchmarking-gnns-pyg
23d2c823f16ead554b22ff31c41d5bd8074b133e
[ "MIT" ]
17
2020-12-03T12:20:04.000Z
2021-09-15T05:43:03.000Z
layers/gated_gcn_layer.py
karl-zhao/benchmarking-gnns-pyg
23d2c823f16ead554b22ff31c41d5bd8074b133e
[ "MIT" ]
null
null
null
layers/gated_gcn_layer.py
karl-zhao/benchmarking-gnns-pyg
23d2c823f16ead554b22ff31c41d5bd8074b133e
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch_geometric.typing import OptTensor from torch_scatter import scatter from torch_geometric.nn.conv import MessagePassing """ ResGatedGCN: Residual Gated Graph ConvNets An Experimental Study of Neural Networks for Variable Graphs (Xavier Bresson and Thomas Laurent, ICLR 2018) https://arxiv.org/pdf/1711.07553v2.pdf """ class GatedGCNLayer(nn.Module): """ Param: [] """ def __init__(self, input_dim, output_dim, dropout, batch_norm, residual=False): super().__init__() self.in_channels = input_dim self.out_channels = output_dim self.dropout = dropout self.batch_norm = batch_norm self.residual = residual if input_dim != output_dim: self.residual = False self.A = nn.Linear(input_dim, output_dim, bias=True) self.B = nn.Linear(input_dim, output_dim, bias=True) self.C = nn.Linear(input_dim, output_dim, bias=True) self.D = nn.Linear(input_dim, output_dim, bias=True) self.E = nn.Linear(input_dim, output_dim, bias=True) self.bn_node_h = nn.BatchNorm1d(output_dim) self.bn_node_e = nn.BatchNorm1d(output_dim) def message_func(self, edges): Bh_j = edges.src['Bh'] e_ij = edges.data['Ce'] + edges.src['Dh'] + edges.dst['Eh'] # e_ij = Ce_ij + Dhi + Ehj edges.data['e'] = e_ij return {'Bh_j' : Bh_j, 'e_ij' : e_ij} def reduce_func(self, nodes): Ah_i = nodes.data['Ah'] Bh_j = nodes.mailbox['Bh_j'] e = nodes.mailbox['e_ij'] sigma_ij = torch.sigmoid(e) # sigma_ij = sigmoid(e_ij) #h = Ah_i + torch.mean( sigma_ij * Bh_j, dim=1 ) # hi = Ahi + mean_j alpha_ij * Bhj h = Ah_i + torch.sum( sigma_ij * Bh_j, dim=1 ) / ( torch.sum( sigma_ij, dim=1 ) + 1e-6 ) # hi = Ahi + sum_j eta_ij/sum_j' eta_ij' * Bhj <= dense attention return {'h' : h} def forward(self, g, h, e): h_in = h # for residual connection e_in = e # for residual connection g.ndata['h'] = h g.ndata['Ah'] = self.A(h) g.ndata['Bh'] = self.B(h) g.ndata['Dh'] = self.D(h) g.ndata['Eh'] = self.E(h) g.edata['e'] = e g.edata['Ce'] = self.C(e) g.update_all(self.message_func,self.reduce_func) h = g.ndata['h'] # result of graph convolution e = g.edata['e'] # result of graph convolution if self.batch_norm: h = self.bn_node_h(h) # batch normalization e = self.bn_node_e(e) # batch normalization h = F.relu(h) # non-linear activation e = F.relu(e) # non-linear activation if self.residual: h = h_in + h # residual connection e = e_in + e # residual connection h = F.dropout(h, self.dropout, training=self.training) e = F.dropout(e, self.dropout, training=self.training) return h, e def __repr__(self): return '{}(in_channels={}, out_channels={})'.format(self.__class__.__name__, self.in_channels, self.out_channels) """ ResGatedGCN: Residual Gated Graph ConvNets for pyg implement, is made by myself An Experimental Study of Neural Networks for Variable Graphs (Xavier Bresson and Thomas Laurent, ICLR 2018) https://arxiv.org/pdf/1711.07553v2.pdf """ class ResGatedGCNLayer(MessagePassing): """ Param: [] """ def __init__(self, input_dim, output_dim, dropout, batch_norm, residual=False): super().__init__() self.in_channels = input_dim self.out_channels = output_dim self.dropout = dropout self.batch_norm = batch_norm self.residual = residual if input_dim != output_dim: self.residual = False self.A = nn.Linear(input_dim, output_dim, bias=True) self.B = nn.Linear(input_dim, output_dim, bias=True) self.C = nn.Linear(input_dim, output_dim, bias=True) self.D = nn.Linear(input_dim, output_dim, bias=True) self.E = nn.Linear(input_dim, output_dim, bias=True) def message(self, x_j: Tensor, alpha_j: Tensor, alpha_i: Tensor, Ah: Tensor ,edge_weight: OptTensor): e_ij = edge_weight + alpha_j + alpha_i # e_ij = edges.data['Ce'] + edges.src['Dh'] + edges.dst['Eh'] # e_ij = Ce_ij + Dhi + Ehj return [x_j, e_ij, Ah] def aggregate(self, inputs, index, ptr=None, dim_size=None): Ah_i = inputs[2] Bh_j = inputs[0] sigma_ij = torch.sigmoid(inputs[1]) e = inputs[1] # aa=scatter(sigma_ij * Bh_j, index, dim=self.node_dim, dim_size=dim_size, # reduce='add') h = Ah_i + scatter(sigma_ij*Bh_j, index, dim= self.node_dim, dim_size=dim_size, reduce='add') / (scatter(sigma_ij, index, dim=self.node_dim, dim_size=dim_size, reduce='sum') + 1e-6) return [h, e] # hi = Ahi + sum_j eta_ij/sum_j' eta_ij' * Bhj <= dense attention def forward(self, h, edge_index, edge_weight): # h = conv(h, edge_index, e)g, h, e h_in = h # for residual connection e_in = edge_weight # for residual connection Ah = self.A(h) Bh = self.B(h) Dh = self.D(h) Eh = self.E(h) Ce = self.C(edge_weight) # g.update_all(self.message_func, self.reduce_func) m = self.propagate(edge_index, x=(Bh,Bh), alpha=(Dh,Eh), Ah=Ah, edge_weight=Ce, size=None) h = m[0] # result of graph convolution e = m[1] # result of graph convolution return h, e def __repr__(self): return '{}(in_channels={}, out_channels={})'.format(self.__class__.__name__, self.in_channels, self.out_channels) ############################################################## # # Additional layers for edge feature/representation analysis # ############################################################## class GatedGCNLayerEdgeFeatOnly(nn.Module): """ Param: [] """ def __init__(self, input_dim, output_dim, dropout, batch_norm, residual=False): super().__init__() self.in_channels = input_dim self.out_channels = output_dim self.dropout = dropout self.batch_norm = batch_norm self.residual = residual if input_dim != output_dim: self.residual = False self.A = nn.Linear(input_dim, output_dim, bias=True) self.B = nn.Linear(input_dim, output_dim, bias=True) self.D = nn.Linear(input_dim, output_dim, bias=True) self.E = nn.Linear(input_dim, output_dim, bias=True) self.bn_node_h = nn.BatchNorm1d(output_dim) def message_func(self, edges): Bh_j = edges.src['Bh'] e_ij = edges.src['Dh'] + edges.dst['Eh'] # e_ij = Dhi + Ehj edges.data['e'] = e_ij return {'Bh_j' : Bh_j, 'e_ij' : e_ij} def reduce_func(self, nodes): Ah_i = nodes.data['Ah'] Bh_j = nodes.mailbox['Bh_j'] e = nodes.mailbox['e_ij'] sigma_ij = torch.sigmoid(e) # sigma_ij = sigmoid(e_ij) h = Ah_i + torch.sum( sigma_ij * Bh_j, dim=1 ) / ( torch.sum( sigma_ij, dim=1 ) + 1e-6 ) # hi = Ahi + sum_j eta_ij/sum_j' eta_ij' * Bhj <= dense attention return {'h' : h} def forward(self, g, h, e): h_in = h # for residual connection g.ndata['h'] = h g.ndata['Ah'] = self.A(h) g.ndata['Bh'] = self.B(h) g.ndata['Dh'] = self.D(h) g.ndata['Eh'] = self.E(h) g.update_all(self.message_func,self.reduce_func) h = g.ndata['h'] # result of graph convolution if self.batch_norm: h = self.bn_node_h(h) # batch normalization h = F.relu(h) # non-linear activation if self.residual: h = h_in + h # residual connection h = F.dropout(h, self.dropout, training=self.training) return h, e def __repr__(self): return '{}(in_channels={}, out_channels={})'.format(self.__class__.__name__, self.in_channels, self.out_channels) ############################################################## class GatedGCNLayerIsotropic(nn.Module): """ Param: [] """ def __init__(self, input_dim, output_dim, dropout, batch_norm, residual=False): super().__init__() self.in_channels = input_dim self.out_channels = output_dim self.dropout = dropout self.batch_norm = batch_norm self.residual = residual if input_dim != output_dim: self.residual = False self.A = nn.Linear(input_dim, output_dim, bias=True) self.B = nn.Linear(input_dim, output_dim, bias=True) self.bn_node_h = nn.BatchNorm1d(output_dim) def message_func(self, edges): Bh_j = edges.src['Bh'] return {'Bh_j' : Bh_j} def reduce_func(self, nodes): Ah_i = nodes.data['Ah'] Bh_j = nodes.mailbox['Bh_j'] h = Ah_i + torch.sum( Bh_j, dim=1 ) # hi = Ahi + sum_j Bhj return {'h' : h} def forward(self, g, h, e): h_in = h # for residual connection g.ndata['h'] = h g.ndata['Ah'] = self.A(h) g.ndata['Bh'] = self.B(h) g.update_all(self.message_func,self.reduce_func) h = g.ndata['h'] # result of graph convolution if self.batch_norm: h = self.bn_node_h(h) # batch normalization h = F.relu(h) # non-linear activation if self.residual: h = h_in + h # residual connection h = F.dropout(h, self.dropout, training=self.training) return h, e def __repr__(self): return '{}(in_channels={}, out_channels={})'.format(self.__class__.__name__, self.in_channels, self.out_channels)
36.402778
170
0.550839
1,406
10,484
3.872688
0.108108
0.052893
0.061708
0.074931
0.82865
0.805877
0.800184
0.800184
0.797245
0.782002
0
0.006948
0.313621
10,484
287
171
36.529617
0.749722
0.126955
0
0.761658
0
0
0.028956
0
0
0
0
0
0
1
0.103627
false
0.010363
0.036269
0.020725
0.243523
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
f3c1df4a08db6c99610aac429eb2c1c3ca7ff115
380
py
Python
tests/formatters/test__format_number.py
LCBRU/lbrc_flask
f5f6c3f3832a9040e941c6398b7f150e567d4762
[ "MIT" ]
null
null
null
tests/formatters/test__format_number.py
LCBRU/lbrc_flask
f5f6c3f3832a9040e941c6398b7f150e567d4762
[ "MIT" ]
null
null
null
tests/formatters/test__format_number.py
LCBRU/lbrc_flask
f5f6c3f3832a9040e941c6398b7f150e567d4762
[ "MIT" ]
null
null
null
from lbrc_flask.formatters import format_number def test__format_number__Small(): assert format_number(2) == '2' def test__format_number__LessThanAThousand(): assert format_number(999) == '999' def test__format_number__AThousand(): assert format_number(1035) == '1,035' def test__format_number__Millions(): assert format_number(12_030_234) == '12,030,234'
21.111111
52
0.757895
52
380
5
0.423077
0.415385
0.2
0.292308
0
0
0
0
0
0
0
0.097561
0.136842
380
17
53
22.352941
0.695122
0
0
0
0
0
0.05
0
0
0
0
0
0.444444
1
0.444444
true
0
0.111111
0
0.555556
0
0
0
0
null
1
1
1
0
0
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
1
0
0
0
1
0
0
7
343c1ade1510ef15eec688d3512346d2df63fac5
3,941
py
Python
intro/part06-08_recipe_search/src/recipe_search.py
Hannah-Abi/python-pro-21
2ce32c4bf118054329d19afdf83c50561be1ada8
[ "MIT" ]
null
null
null
intro/part06-08_recipe_search/src/recipe_search.py
Hannah-Abi/python-pro-21
2ce32c4bf118054329d19afdf83c50561be1ada8
[ "MIT" ]
null
null
null
intro/part06-08_recipe_search/src/recipe_search.py
Hannah-Abi/python-pro-21
2ce32c4bf118054329d19afdf83c50561be1ada8
[ "MIT" ]
null
null
null
# Write your solution here def search_by_name(filename: str, word: str): recipe_list = [] formated_recipe = [] found_recipes = [] with open(filename) as new_file: for line in new_file: line = line.replace("\n", "") recipe_list.append(line) while True: if '' in recipe_list: recipe_dict = {} point = recipe_list.index('') recipe_dict['name'] = recipe_list[0] recipe_dict['time'] = recipe_list[1] recipe_dict['recipe'] = recipe_list[2:point] recipe_list = recipe_list[point+1:] formated_recipe.append(recipe_dict) else: recipe_dict = {} recipe_dict['name'] = recipe_list[0] recipe_dict['time'] = recipe_list[1] recipe_dict['recipe'] = recipe_list[2:point] formated_recipe.append(recipe_dict) break for r in formated_recipe: if word.lower() in r['name'].lower(): found_recipes.append(r['name']) return found_recipes def search_by_time(filename: str, prep_time: int): recipe_list = [] formated_recipe = [] found_recipes = [] with open(filename) as new_file: for line in new_file: line = line.replace("\n", "") recipe_list.append(line) while True: if '' in recipe_list: recipe_dict = {} point = recipe_list.index('') recipe_dict['name'] = recipe_list[0] recipe_dict['time'] = recipe_list[1] recipe_dict['recipe'] = recipe_list[2:point] recipe_list = recipe_list[point+1:] formated_recipe.append(recipe_dict) else: recipe_dict = {} recipe_dict['name'] = recipe_list[0] recipe_dict['time'] = recipe_list[1] recipe_dict['recipe'] = recipe_list[2:point] formated_recipe.append(recipe_dict) break for r in formated_recipe: if int(r['time']) <= prep_time: found_recipes.append(f"{r['name']}, preparation time {r['time']} min") return found_recipes def search_by_ingredient(filename: str, ingredient: str): recipe_list = [] formated_recipe = [] found_recipes = [] with open(filename) as new_file: for line in new_file: line = line.replace("\n", "") recipe_list.append(line) while True: if '' in recipe_list: recipe_dict = {} point = recipe_list.index('') recipe_dict['name'] = recipe_list[0] recipe_dict['time'] = recipe_list[1] recipe_dict['recipe'] = recipe_list[2:point] recipe_list = recipe_list[point+1:] formated_recipe.append(recipe_dict) else: recipe_dict = {} recipe_dict['name'] = recipe_list[0] recipe_dict['time'] = recipe_list[1] recipe_dict['recipe'] = recipe_list[2:point] formated_recipe.append(recipe_dict) break for r in formated_recipe: if ingredient in r['recipe']: found_recipes.append(f"{r['name']}, preparation time {r['time']} min") return found_recipes if __name__ == "__main__": #found_recipes = search_by_name("recipes1.txt", "cake") #for recipe in found_recipes: #print(recipe) #found_recipes = search_by_name("recipes2.txt", "oat") #for recipe in found_recipes: #print(recipe) #found_recipes = search_by_time("recipes1.txt", 20) #for recipe in found_recipes: #print(recipe) found_recipes = search_by_ingredient("recipes1.txt", "eggs") for recipe in found_recipes: print(recipe)
36.155963
82
0.549099
446
3,941
4.571749
0.127803
0.176557
0.070623
0.058852
0.868563
0.854831
0.835213
0.818539
0.818539
0.818539
0
0.010353
0.338239
3,941
108
83
36.490741
0.771472
0.077138
0
0.875
0
0
0.061224
0
0
0
0
0
0
1
0.034091
false
0
0
0
0.068182
0.011364
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
344d8b64a3e7e9623b502612aa96e0d06e40bbe3
125
py
Python
code/models/__init__.py
haozheng95/XueLangTianchi
60665f3c00e0b096577a752ed8b28eaadef7210d
[ "MIT" ]
97
2018-07-17T02:22:09.000Z
2021-11-07T17:16:03.000Z
code/models/__init__.py
haozheng95/XueLangTianchi
60665f3c00e0b096577a752ed8b28eaadef7210d
[ "MIT" ]
3
2018-07-20T01:54:35.000Z
2020-05-08T07:35:44.000Z
code/models/__init__.py
haozheng95/XueLangTianchi
60665f3c00e0b096577a752ed8b28eaadef7210d
[ "MIT" ]
41
2018-07-18T08:21:52.000Z
2022-02-11T07:08:10.000Z
from .NetWork import VGG16_bo from .NetWork import VGG19_bo from .ResNet import ResNet18_bo from .ResNet import ResNet152_bo
25
32
0.84
20
125
5.05
0.45
0.178218
0.336634
0.356436
0
0
0
0
0
0
0
0.082569
0.128
125
4
33
31.25
0.844037
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
3462ed51b5d90be746a7420454e27a407d3b0cf6
38
py
Python
tripgo_parser/__init__.py
yifchen5/tripgo_parser
a8bb3270a159632c88d977212ee50ba41288fc18
[ "MIT" ]
null
null
null
tripgo_parser/__init__.py
yifchen5/tripgo_parser
a8bb3270a159632c88d977212ee50ba41288fc18
[ "MIT" ]
null
null
null
tripgo_parser/__init__.py
yifchen5/tripgo_parser
a8bb3270a159632c88d977212ee50ba41288fc18
[ "MIT" ]
1
2021-08-03T11:02:34.000Z
2021-08-03T11:02:34.000Z
from . import parse from . import get
12.666667
19
0.736842
6
38
4.666667
0.666667
0.714286
0
0
0
0
0
0
0
0
0
0
0.210526
38
2
20
19
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
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
0
1
0
1
0
1
0
0
7
347a35b2d5ed149df130945354cc06dbd80ed4af
106
py
Python
dindin_approval/models/__init__.py
LuoChao-aleo/odooDingDing-1
c2b8d569a8103b1ad38a487c4ca26e3cd6a42c07
[ "Apache-2.0" ]
7
2019-05-01T10:10:11.000Z
2022-02-09T06:10:51.000Z
dindin_approval/models/__init__.py
LuoChao-aleo/odooDingDing-1
c2b8d569a8103b1ad38a487c4ca26e3cd6a42c07
[ "Apache-2.0" ]
null
null
null
dindin_approval/models/__init__.py
LuoChao-aleo/odooDingDing-1
c2b8d569a8103b1ad38a487c4ca26e3cd6a42c07
[ "Apache-2.0" ]
6
2019-05-03T07:09:47.000Z
2020-06-24T17:16:56.000Z
# -*- coding: utf-8 -*- from . import approval_template from . import approval_control from . import main
21.2
31
0.726415
14
106
5.357143
0.642857
0.4
0.48
0
0
0
0
0
0
0
0
0.011236
0.160377
106
5
32
21.2
0.831461
0.198113
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
cacaaad62babfaa8260329ac6a93c8021a8150a2
117
py
Python
astro_cloud_tests/auth/test_digital_ocean.py
RichardScottOZ/astro-cloud
f45d002566e97007f1bdfa7dce9094ec27c3f912
[ "MIT" ]
1
2022-02-02T11:03:54.000Z
2022-02-02T11:03:54.000Z
astro_cloud_tests/auth/test_digital_ocean.py
RichardScottOZ/astro-cloud
f45d002566e97007f1bdfa7dce9094ec27c3f912
[ "MIT" ]
2
2020-10-13T17:31:09.000Z
2021-04-04T22:31:03.000Z
astro_cloud_tests/auth/test_digital_ocean.py
RichardScottOZ/astro-cloud
f45d002566e97007f1bdfa7dce9094ec27c3f912
[ "MIT" ]
1
2022-02-02T11:04:37.000Z
2022-02-02T11:04:37.000Z
def test__digital_ocean_auth(): import requests from astro_cloud.auth.digital_ocean import DigitalOceanAuth
23.4
63
0.811966
15
117
5.933333
0.733333
0.269663
0
0
0
0
0
0
0
0
0
0
0.145299
117
4
64
29.25
0.89
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0
0.666667
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
7
1b0d32ac1c8c7bae12caf7b037dea8db99ac8901
4,126
py
Python
OTree_Experiment/EN_Part_2/pages.py
Arkhemis/Personality_VideoGames
f560fdadb07f6a747e555362f5ea625b7f34820d
[ "CC-BY-4.0" ]
null
null
null
OTree_Experiment/EN_Part_2/pages.py
Arkhemis/Personality_VideoGames
f560fdadb07f6a747e555362f5ea625b7f34820d
[ "CC-BY-4.0" ]
null
null
null
OTree_Experiment/EN_Part_2/pages.py
Arkhemis/Personality_VideoGames
f560fdadb07f6a747e555362f5ea625b7f34820d
[ "CC-BY-4.0" ]
null
null
null
from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants import os import subprocess import sys import random from . import models bff = [] for i in range(1,46): bff.append(str(i)) ssvs = ["power", "achievement", "hedonism", "stimulation", "selfdirection", "universalism", "benevolence", "tradition", "conformity", "security"] def reverse(nombre): if nombre == 5: nombre = 1 elif nombre == 4: nombre = 2 elif nombre == 2: nombre = 4 elif nombre == 1: nombre = 5 return nombre class psly(Page): form_model = "player" debug_fill_forms_randomly = True def get_form_fields(self): res = ["bff_{}".format(str(bff[i + 1])) for i in range(-1,25)] return res class lysp(Page): form_model = "player" debug_fill_forms_randomly = True def get_form_fields(self): res = ["bff_{}".format(str(bff[i + 1])) for i in range(25,43)] return res """ class SVSS(Page): form_model = "player" def get_form_fields(self): res = ["ssvs_{}".format(str(ssvs[i + 1])) for i in range(-1,9)] return res def before_next_page(self): EXT = self.player.bff_1 + reverse(self.player.bff_6) + self.player.bff_11 + self.player.bff_16 + reverse(self.player.bff_21) + self.player.bff_26 + reverse(self.player.bff_31) + self.player.bff_36 AGR = reverse(self.player.bff_2) + self.player.bff_7 + reverse(self.player.bff_12) + self.player.bff_17 + self.player.bff_22 + reverse(self.player.bff_27) + self.player.bff_32 + reverse(self.player.bff_37) + self.player.bff_42 + reverse(self.player.bff_45) CON = self.player.bff_3 + reverse(self.player.bff_8) + self.player.bff_13 + reverse(self.player.bff_18) + reverse(self.player.bff_23) + self.player.bff_28 + self.player.bff_33 + self.player.bff_38 + reverse(self.player.bff_43) NEU = self.player.bff_4 + reverse(self.player.bff_9) + self.player.bff_14 + self.player.bff_19 + reverse(self.player.bff_24) + self.player.bff_29 + reverse(self.player.bff_34) + self.player.bff_39 OPE = self.player.bff_5 + self.player.bff_10 + self.player.bff_15 + self.player.bff_20 + self.player.bff_25 + self.player.bff_30 + reverse(self.player.bff_35) + self.player.bff_40 + reverse(self.player.bff_41) + self.player.bff_44 Types = {'EXT': EXT, 'AGR': AGR, 'CON': CON, 'NEU': NEU, 'OPE': OPE} Max_Type = max(Types, key=Types.get) print(Max_Type) print(EXT, AGR, CON, NEU, OPE) self.participant.vars['Personality'] = Max_Type """ class svtt(Page): def before_next_page(self): EXT = self.player.bff_1 + reverse(self.player.bff_6) + self.player.bff_11 + self.player.bff_16 + reverse(self.player.bff_21) + self.player.bff_26 + reverse(self.player.bff_31) + self.player.bff_36 AGR = reverse(self.player.bff_2) + self.player.bff_7 + reverse(self.player.bff_12) + self.player.bff_17 + self.player.bff_22 + reverse(self.player.bff_27) + self.player.bff_32 + reverse(self.player.bff_37) + self.player.bff_42 CON = self.player.bff_3 + reverse(self.player.bff_8) + self.player.bff_13 + reverse(self.player.bff_18) + reverse(self.player.bff_23) + self.player.bff_28 + self.player.bff_33 + self.player.bff_38 + reverse(self.player.bff_43) NEU = self.player.bff_4 + reverse(self.player.bff_9) + self.player.bff_14 + self.player.bff_19 + reverse(self.player.bff_24) + self.player.bff_29 + reverse(self.player.bff_34) + self.player.bff_39 OPE = self.player.bff_5 + self.player.bff_10 + self.player.bff_15 + self.player.bff_20 + self.player.bff_25 + self.player.bff_30 + reverse(self.player.bff_35) + self.player.bff_40 + reverse(self.player.bff_41) + self.player.bff_44 Types = {'EXT': EXT, 'AGR': AGR, 'CON': CON, 'NEU': NEU, 'OPE': OPE} Max_Type = max(Types, key=Types.get) print(Max_Type) print(EXT, AGR, CON, NEU, OPE) self.participant.vars['Personality'] = Max_Type page_sequence = [psly, lysp, svtt]
49.710843
145
0.666747
647
4,126
4.066461
0.185471
0.338274
0.439757
0.250855
0.798176
0.793615
0.784873
0.779171
0.779171
0.779171
0
0.054725
0.18953
4,126
82
146
50.317073
0.732057
0
0
0.153846
0
0
0.059462
0
0
0
0
0
0
1
0.076923
false
0
0.153846
0
0.423077
0.038462
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
0
0
0
0
0
0
0
0
0
8
1b36bc1f81eba85e00737694799c50b698165861
143
py
Python
19.04.2022/strings/teste.py
N0N4T0/python-codes
ac2b884f86749a8b179ff972cdb316ec4e005b32
[ "MIT" ]
null
null
null
19.04.2022/strings/teste.py
N0N4T0/python-codes
ac2b884f86749a8b179ff972cdb316ec4e005b32
[ "MIT" ]
null
null
null
19.04.2022/strings/teste.py
N0N4T0/python-codes
ac2b884f86749a8b179ff972cdb316ec4e005b32
[ "MIT" ]
null
null
null
# empresa = 'Google' # print(empresa[0]) # print(empresa[:3]) # print(empresa[3:]) # print(empresa[1:3]) print("\"I'm groot\", said Groot")
14.3
34
0.608392
21
143
4.142857
0.47619
0.551724
0.298851
0.413793
0.436782
0
0
0
0
0
0
0.040323
0.132867
143
9
35
15.888889
0.66129
0.657343
0
0
0
0
0.302326
0
0
0
0
0
0
1
0
true
0
0
0
0
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
0
0
0
1
0
7
1ba65821d29948e8d65cd7dbf6ae1a525364b748
101
py
Python
3.py
jackiboi307/isEven---Python
3a7a4f006282dc16dd33b525c46f260788113a1e
[ "Unlicense" ]
null
null
null
3.py
jackiboi307/isEven---Python
3a7a4f006282dc16dd33b525c46f260788113a1e
[ "Unlicense" ]
null
null
null
3.py
jackiboi307/isEven---Python
3a7a4f006282dc16dd33b525c46f260788113a1e
[ "Unlicense" ]
null
null
null
def isEven(num): return len(([""]*abs(num))[:abs(num)//2]) == len(([""]*abs(num))[abs(num)//2:])
33.666667
83
0.49505
16
101
3.125
0.4375
0.48
0.36
0.48
0.64
0.64
0
0
0
0
0
0.021978
0.09901
101
2
84
50.5
0.527473
0
0
0
0
0
0
0
0
0
0
0
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
0
0
0
1
0
0
0
1
0
0
0
7
1baadcb2ab6ba4d14164bc125ad29cfd8f0e95ba
3,229
py
Python
main.py
fmarco/covid-19_italia_backend
858c29158d72b2f968fecd35f2c6b97d3ca495e8
[ "MIT" ]
null
null
null
main.py
fmarco/covid-19_italia_backend
858c29158d72b2f968fecd35f2c6b97d3ca495e8
[ "MIT" ]
null
null
null
main.py
fmarco/covid-19_italia_backend
858c29158d72b2f968fecd35f2c6b97d3ca495e8
[ "MIT" ]
null
null
null
from datetime import datetime from fastapi import FastAPI import pandas import numpy app = FastAPI() BASE_URL = 'https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/' DATE_FORMAT = '%Y-%m-%d %H:%M:%S' @app.get('/national_trend/') def national_trend(start_at: str = None, end_at: str = None): if start_at is not None: start_at = pandas.to_datetime(f'{start_at} 18:00', format=DATE_FORMAT) if end_at is not None: end_at = pandas.to_datetime(f'{end_at} 18:00', format=DATE_FORMAT) data_frame = pandas.read_csv( f'{BASE_URL}dati-andamento-nazionale/dpc-covid19-ita-andamento-nazionale.csv' ) data_frame['data'] = pandas.to_datetime( data_frame['data'].str.strip(), format=DATE_FORMAT ) if start_at is not None: data_frame = data_frame[data_frame['data'] >= start_at] if end_at is not None: data_frame = data_frame[data_frame['data'] <= end_at] data_frame = data_frame.replace({numpy.nan: None}) return { 'data': data_frame.to_dict(orient='records'), 'count': data_frame.shape[0] } @app.get('/region_trend/') def region_trend(region: str = None, start_at: str = None, end_at: str = None): if start_at is not None: start_at = pandas.to_datetime(f'{start_at} 18:00', format=DATE_FORMAT) if end_at is not None: end_at = pandas.to_datetime(f'{end_at} 18:00', format=DATE_FORMAT) data_frame = pandas.read_csv( f'{BASE_URL}dati-regioni/dpc-covid19-ita-regioni.csv' ) data_frame['data'] = pandas.to_datetime( data_frame['data'].str.strip(), format=DATE_FORMAT ) if start_at is not None: data_frame = data_frame[data_frame['data'] >= start_at] if end_at is not None: data_frame = data_frame[data_frame['data'] <= end_at] if region is not None: data_frame = data_frame[data_frame['denominazione_regione'] == region] data_frame = data_frame.replace({numpy.nan: None}) return { 'data': data_frame.to_dict(orient='records'), 'count': data_frame.shape[0] } @app.get('/province_trend/') def province_trend(region: str = None, province: str = None, start_at: str = None, end_at: str = None): if start_at is not None: start_at = pandas.to_datetime(f'{start_at} 18:00', format=DATE_FORMAT) if end_at is not None: end_at = pandas.to_datetime(f'{end_at} 18:00', format=DATE_FORMAT) data_frame = pandas.read_csv( f'{BASE_URL}dati-province/dpc-covid19-ita-province.csv' ) data_frame['data'] = pandas.to_datetime( data_frame['data'].str.strip(), format=DATE_FORMAT ) if start_at is not None: data_frame = data_frame[data_frame['data'] >= start_at] if end_at is not None: data_frame = data_frame[data_frame['data'] <= end_at] if region is not None: data_frame = data_frame[data_frame['denominazione_regione'] == region] if province is not None: data_frame = data_frame[data_frame['denominazione_provincia'] == province] data_frame = data_frame.replace({numpy.nan: None}) return { 'data': data_frame.to_dict(orient='records'), 'count': data_frame.shape[0] }
35.877778
103
0.659647
485
3,229
4.140206
0.136082
0.215139
0.213645
0.188247
0.800299
0.800299
0.800299
0.800299
0.800299
0.800299
0
0.013699
0.208733
3,229
89
104
36.280899
0.772211
0
0
0.658228
0
0
0.169765
0.074659
0
0
0
0
0
1
0.037975
false
0
0.050633
0
0.126582
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
0
0
0
0
0
0
0
0
0
9
1bc1a098de7dd8bf26d7f300625e8bdefbd6c2f8
94
py
Python
modules/rabbitmq/__init__.py
Infosecurity-LLC/callback_translator
a9e598756460c78e40aa63089fe87fee68dfb623
[ "Apache-2.0" ]
1
2022-02-04T10:00:20.000Z
2022-02-04T10:00:20.000Z
modules/rabbitmq/__init__.py
Infosecurity-LLC/callback_translator
a9e598756460c78e40aa63089fe87fee68dfb623
[ "Apache-2.0" ]
null
null
null
modules/rabbitmq/__init__.py
Infosecurity-LLC/callback_translator
a9e598756460c78e40aa63089fe87fee68dfb623
[ "Apache-2.0" ]
1
2022-02-04T10:00:22.000Z
2022-02-04T10:00:22.000Z
from modules.rabbitmq.consumer import Consumer from modules.rabbitmq.producer import Producer
31.333333
46
0.87234
12
94
6.833333
0.5
0.268293
0.463415
0
0
0
0
0
0
0
0
0
0.085106
94
2
47
47
0.953488
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
945411903c078d16e18a3dd7f75485f2119effca
14,454
py
Python
modeling/wsdan/attention.py
zyxwvu321/Classifer_SSL_Longtail
e6c09414c49e695b0f4221a3c6245ae3929a1788
[ "MIT" ]
null
null
null
modeling/wsdan/attention.py
zyxwvu321/Classifer_SSL_Longtail
e6c09414c49e695b0f4221a3c6245ae3929a1788
[ "MIT" ]
null
null
null
modeling/wsdan/attention.py
zyxwvu321/Classifer_SSL_Longtail
e6c09414c49e695b0f4221a3c6245ae3929a1788
[ "MIT" ]
null
null
null
############################################################ # File: attention.py # # Created: 2019-11-05 19:19:08 # # Author : wvinzh # # Email : wvinzh@qq.com # # ------------------------------------------ # # Description:attention.py # # Copyright@2019 wvinzh, HUST # ############################################################ import numpy as np import random import torch import torchvision.transforms as transforms import torch.nn.functional as F import time def attention_crop(attention_maps,input_image): # start = time.time() B,N,W,H = input_image.shape input_tensor = input_image batch_size, num_parts, height, width = attention_maps.shape attention_maps = torch.nn.functional.interpolate(attention_maps.detach(),size=(W,H),mode='bilinear') part_weights = F.avg_pool2d(attention_maps,(W,H)).reshape(batch_size,-1) part_weights = torch.add(torch.sqrt(part_weights),1e-12) part_weights = torch.div(part_weights,torch.sum(part_weights,dim=1).unsqueeze(1)).cpu() part_weights = part_weights.numpy() ret_imgs = [] # print(part_weights[3]) for i in range(batch_size): attention_map = attention_maps[i] part_weight = part_weights[i] selected_index = np.random.choice( np.arange(0, num_parts), 1, p=part_weight)[0] mask = attention_map[selected_index, :, :] # print(type(mask)) # mask = (mask-mask.min())/(mask.max()-mask.min()) threshold = random.uniform(0.4, 0.6) # threshold = 0.5 # itemindex = np.where(mask >= threshold) itemindex = np.where(mask >= mask.max() * threshold) # itemindex = torch.nonzero(mask >= threshold) padding_h = int(0.1*H) padding_w = int(0.1*W) height_min = itemindex[0].min() height_min = max(0,height_min-padding_h) height_max = itemindex[0].max() + padding_h width_min = itemindex[1].min() width_min = max(0,width_min-padding_w) width_max = itemindex[1].max() + padding_w out_img = input_tensor[i][:,height_min:height_max,width_min:width_max].unsqueeze(0) out_img = torch.nn.functional.interpolate(out_img,size=(W,H),mode='bilinear',align_corners=True) out_img = out_img.squeeze(0) # print(out_img.shape) ret_imgs.append(out_img) ret_imgs = torch.stack(ret_imgs) return ret_imgs def attention_drop(attention_maps,input_image): B,N,W,H = input_image.shape input_tensor = input_image batch_size, num_parts, height, width = attention_maps.shape attention_maps = torch.nn.functional.interpolate(attention_maps.detach(),size=(W,H),mode='bilinear') part_weights = F.avg_pool2d(attention_maps,(W,H)).reshape(batch_size,-1) part_weights = torch.add(torch.sqrt(part_weights),1e-12) part_weights = torch.div(part_weights,torch.sum(part_weights,dim=1).unsqueeze(1)).cpu().numpy() # attention_maps = torch.nn.functional.interpolate(attention_maps,size=(W,H),mode='bilinear', align_corners=True) # print(part_weights.shape) masks = [] for i in range(batch_size): attention_map = attention_maps[i].detach() part_weight = part_weights[i] selected_index = np.random.choice( np.arange(0, num_parts), 1, p=part_weight)[0] mask = attention_map[selected_index:selected_index + 1, :, :] # soft mask # threshold = random.uniform(0.2, 0.5) # threshold = 0.5 # mask = (mask-mask.min())/(mask.max()-mask.min()) # mask = (mask < threshold).float() threshold = random.uniform(0.2, 0.5) mask = (mask < threshold * mask.max()).float() masks.append(mask) masks = torch.stack(masks) # print(masks.shape) ret = input_tensor*masks return ret def attention_crop_drop(attention_maps,input_image): # start = time.time() B,N,W,H = input_image.shape input_tensor = input_image batch_size, num_parts, height, width = attention_maps.shape attention_maps = torch.nn.functional.interpolate(attention_maps.detach(),size=(W,H),mode='bilinear') part_weights = F.avg_pool2d(attention_maps.detach(),(W,H)).reshape(batch_size,-1) part_weights = torch.add(torch.sqrt(part_weights),1e-12) part_weights = torch.div(part_weights,torch.sum(part_weights,dim=1).unsqueeze(1)).cpu() part_weights = part_weights.numpy() # print(part_weights.shape) ret_imgs = [] masks = [] # print(part_weights[3]) for i in range(batch_size): attention_map = attention_maps[i] part_weight = part_weights[i] selected_index = np.random.choice(np.arange(0, num_parts), 1, p=part_weight)[0] selected_index2 = np.random.choice(np.arange(0, num_parts), 1, p=part_weight)[0] ## create crop imgs mask = attention_map[selected_index, :, :] # mask = (mask-mask.min())/(mask.max()-mask.min()) threshold = random.uniform(0.4, 0.6) # threshold = 0.5 itemindex = np.where(mask >= mask.max()*threshold) # print(itemindex.shape) # itemindex = torch.nonzero(mask >= threshold*mask.max()) padding_h = int(0.1*H) padding_w = int(0.1*W) height_min = itemindex[0].min() height_min = max(0,height_min-padding_h) height_max = itemindex[0].max() + padding_h width_min = itemindex[1].min() width_min = max(0,width_min-padding_w) width_max = itemindex[1].max() + padding_w # print('numpy',height_min,height_max,width_min,width_max) out_img = input_tensor[i][:,height_min:height_max,width_min:width_max].unsqueeze(0) out_img = torch.nn.functional.interpolate(out_img,size=(W,H),mode='bilinear',align_corners=True) out_img = out_img.squeeze(0) ret_imgs.append(out_img) ## create drop imgs mask2 = attention_map[selected_index2:selected_index2 + 1, :, :] threshold = random.uniform(0.2, 0.5) mask2 = (mask2 < threshold * mask2.max()).float() masks.append(mask2) # bboxes = np.asarray(bboxes, np.float32) crop_imgs = torch.stack(ret_imgs) masks = torch.stack(masks) drop_imgs = input_tensor*masks return (crop_imgs,drop_imgs) def mask2bbox(attention_maps,input_image,sz_crp): input_tensor = input_image B,C,H,W = input_tensor.shape batch_size, num_parts, Hh, Ww = attention_maps.shape attention_maps = torch.nn.functional.interpolate(attention_maps,size=(H,W),mode='bilinear')#bug fix ret_imgs = [] # print(part_weights[3]) for i in range(batch_size): attention_map = attention_maps[i] # print(attention_map.shape) mask = attention_map.mean(dim=0) # print(type(mask)) mask = (mask-mask.min())/(mask.max()-mask.min()) threshold = random.uniform(0.4, 0.6) #threshold = 0.1 #max_activate = mask.max() min_activate = threshold# * max_activate itemindex = torch.nonzero(mask >= min_activate) padding_h = int(0.05*H) padding_w = int(0.05*W) height_min = itemindex[:, 0].min() height_min = max(0,height_min-padding_h) height_max = itemindex[:, 0].max() + padding_h width_min = itemindex[:, 1].min() width_min = max(0,width_min-padding_w) width_max = itemindex[:, 1].max() + padding_w # print(height_min,height_max,width_min,width_max) out_img = input_tensor[i][:,height_min:height_max,width_min:width_max].unsqueeze(0) out_img = torch.nn.functional.interpolate(out_img,size=sz_crp,mode='bilinear',align_corners=True) out_img = out_img.squeeze(0) # print(out_img.shape) ret_imgs.append(out_img) ret_imgs = torch.stack(ret_imgs) # print(ret_imgs.shape) return ret_imgs def calculate_pooling_center_loss(features, centers, label, alfa=0.95): # centers = model.centers # print('111111111',sum(sum(centers))) # mse_loss = torch.nn.MSELoss() features = features.reshape(features.shape[0], -1) # print(features.shape) centers_batch = centers[label] # print(centers_batch) # print(centers_batch.shape,centers.shape) centers_batch = torch.nn.functional.normalize(centers_batch, dim=-1) diff = (1-alfa)*(features.detach() - centers_batch) distance = torch.pow(features - centers_batch,2) distance = torch.sum(distance, dim=-1) center_loss = torch.mean(distance) # loss2 = mse_loss(features,centers_batch) # print('================',center_loss.item(),loss2.item()) return center_loss, diff # def attention_crop_drop2(attention_maps,input_image,sz_crp): # # start = time.time() # B,N,W,H = input_image.shape # input_tensor = input_image # batch_size, num_parts, height, width = attention_maps.shape # attention_maps = torch.nn.functional.interpolate(attention_maps.detach(),size=(W,H),mode='bilinear') # part_weights = F.avg_pool2d(attention_maps.detach(),(W,H)).reshape(batch_size,-1) # part_weights = torch.add(torch.sqrt(part_weights),1e-12) # part_weights = torch.div(part_weights,torch.sum(part_weights,dim=1).unsqueeze(1)).cpu() # part_weights = part_weights.numpy() # # print(part_weights.shape) # ret_imgs = [] # masks = [] # # print(part_weights[3]) # for i in range(batch_size): # attention_map = attention_maps[i] # part_weight = part_weights[i] # selected_index = np.random.choice(np.arange(0, num_parts), 1, p=part_weight)[0] # selected_index2 = np.random.choice(np.arange(0, num_parts), 1, p=part_weight)[0] # ## create crop imgs # mask = attention_map[selected_index, :, :] # # mask = (mask-mask.min())/(mask.max()-mask.min()) # threshold = random.uniform(0.4, 0.6) # # threshold = 0.5 # # itemindex = np.where(mask >= mask.max()*threshold) # # print(itemindex.shape) # itemindex = torch.nonzero(mask >= threshold*mask.max()) # padding_h = int(0.1*H) # padding_w = int(0.1*W) # height_min = itemindex[:,0].min() # height_min = max(0,height_min-padding_h) # height_max = itemindex[:,0].max() + padding_h # width_min = itemindex[:,1].min() # width_min = max(0,width_min-padding_w) # width_max = itemindex[:,1].max() + padding_w # # print(height_min,height_max,width_min,width_max) # out_img = input_tensor[i][:,height_min:height_max,width_min:width_max].unsqueeze(0) # out_img = torch.nn.functional.interpolate(out_img,size=sz_crp,mode='bilinear',align_corners=True) # out_img = out_img.squeeze(0) # ret_imgs.append(out_img) # ## create drop imgs # mask2 = attention_map[selected_index2:selected_index2 + 1, :, :] # threshold = random.uniform(0.2, 0.5) # mask2 = (mask2 < threshold * mask2.max()).float() # masks.append(mask2) # # bboxes = np.asarray(bboxes, np.float32) # crop_imgs = torch.stack(ret_imgs) # masks = torch.stack(masks) # drop_imgs = input_tensor*masks # return (crop_imgs,drop_imgs) def attention_crop_drop2(attention_maps,input_image,sz_crp): # start = time.time() B,N,W,H = input_image.shape input_tensor = input_image batch_size, num_parts, height, width = attention_maps.shape part_weights = F.adaptive_avg_pool2d(F.relu(attention_maps.detach()), 1).reshape(batch_size,-1) part_weights = torch.add(torch.sqrt(part_weights),1e-12) part_weights = torch.div(part_weights,torch.sum(part_weights,dim=1,keepdim=True)).cpu().numpy() attention_maps = torch.nn.functional.interpolate(attention_maps.detach(),size=(W,H),mode='bilinear',align_corners=True) # print(part_weights.shape) ret_imgs = [] masks = [] # print(part_weights[3]) for i in range(batch_size): attention_map = attention_maps[i] part_weight = part_weights[i] selected_index = np.random.choice(np.arange(0, num_parts), 1, p=part_weight)[0] selected_index2 = np.random.choice(np.arange(0, num_parts), 1, p=part_weight)[0] ## create crop imgs mask = attention_map[selected_index, :, :] # mask = (mask-mask.min())/(mask.max()-mask.min()) threshold = random.uniform(0.4, 0.6) # threshold = 0.5 # itemindex = np.where(mask >= mask.max()*threshold) # print(itemindex.shape) itemindex = torch.nonzero(mask >= threshold*mask.max()) padding_h = int(0.1*H) padding_w = int(0.1*W) height_min = itemindex[:,0].min() height_min = max(0,height_min-padding_h) height_max = itemindex[:,0].max() + padding_h width_min = itemindex[:,1].min() width_min = max(0,width_min-padding_w) width_max = itemindex[:,1].max() + padding_w # print(height_min,height_max,width_min,width_max) out_img = input_tensor[i][:,height_min:height_max,width_min:width_max].unsqueeze(0) out_img = torch.nn.functional.interpolate(out_img,size=sz_crp,mode='bilinear',align_corners=True) out_img = out_img.squeeze(0) ret_imgs.append(out_img) ## create drop imgs mask2 = attention_map[selected_index2:selected_index2 + 1, :, :] threshold = random.uniform(0.2, 0.5) mask2 = (mask2 < threshold * mask2.max()).float() masks.append(mask2) # bboxes = np.asarray(bboxes, np.float32) crop_imgs = torch.stack(ret_imgs) masks = torch.stack(masks) drop_imgs = input_tensor*masks return (crop_imgs,drop_imgs) if __name__ == '__main__': import torch a = torch.rand(4*26*26*32).reshape(4, 32, 26, 26) # a = torch.Tensor((4, 32, 26, 26)) img = torch.arange(4*3*448*448.0).reshape(4, 3, 448, 448) # a = torch.arange(4*1*1*8.0).reshape(4, 8, 1, 1) # b = torch.ones(10*1*1*8).reshape(10, 8) # label = torch.LongTensor([1, 2, 3, 4]) # a = torch.div(a,4*26*26*8) # ret = attention_drop2(a,img) ret1 = attention_crop_drop(a,img) ret2 = attention_crop_drop2(a,img) # ret2 = attention_crop2(a,img) # ret = calculate_pooling_center_loss(a, b, label) # print(ret) # print(ret.shape,ret2.shape) # print(type(ret),type(ret2))
43.8
123
0.631797
1,994
14,454
4.362086
0.082247
0.063233
0.027593
0.03863
0.804898
0.79593
0.792711
0.782594
0.77926
0.7788
0
0.028851
0.215857
14,454
329
124
43.933131
0.738574
0.338799
0
0.747191
0
0
0.008615
0
0
0
0
0
0
1
0.033708
false
0
0.039326
0
0.106742
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
ca0a441907fdccc1138f49fb1ac314d76ccf9ced
250,838
py
Python
streaming-api-client/proto/monitoring_pb2.py
karthikeyan-dhandapani/central-examples-only
8112a14113b31ae790698f1f8d66690d3327ca7f
[ "MIT" ]
null
null
null
streaming-api-client/proto/monitoring_pb2.py
karthikeyan-dhandapani/central-examples-only
8112a14113b31ae790698f1f8d66690d3327ca7f
[ "MIT" ]
null
null
null
streaming-api-client/proto/monitoring_pb2.py
karthikeyan-dhandapani/central-examples-only
8112a14113b31ae790698f1f8d66690d3327ca7f
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='monitoring.proto', package='', syntax='proto2', serialized_options=None, serialized_pb=_b('\n\x10monitoring.proto\"y\n\tIpAddress\x12\"\n\x02\x61\x66\x18\x01 \x02(\x0e\x32\x16.IpAddress.addr_family\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x02(\x0c\":\n\x0b\x61\x64\x64r_family\x12\x14\n\x10\x41\x44\x44R_FAMILY_INET\x10\x02\x12\x15\n\x11\x41\x44\x44R_FAMILY_INET6\x10\n\"\x1a\n\nMacAddress\x12\x0c\n\x04\x61\x64\x64r\x18\x01 \x02(\x0c\"\xc6\x01\n\x05Swarm\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x10\n\x08swarm_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1b\n\x06status\x18\x04 \x01(\x0e\x32\x07.Status:\x02UP\x12%\n\x11public_ip_address\x18\x05 \x01(\x0b\x32\n.IpAddress\x12\x1e\n\nip_address\x18\x06 \x01(\x0b\x32\n.IpAddress\x12\x18\n\x10\x66irmware_version\x18\x07 \x01(\t\"\x8a\x02\n\x06Tunnel\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x10\n\x08swarm_id\x18\x02 \x01(\t\x12\x1b\n\x05index\x18\x03 \x01(\x0e\x32\x0c.TunnelIndex\x12 \n\x0b\x63rypto_type\x18\x04 \x01(\x0e\x32\x0b.CryptoType\x12\x11\n\tpeer_name\x18\x05 \x01(\t\x12\x1f\n\x0bpeer_tun_ip\x18\x06 \x01(\x0b\x32\n.IpAddress\x12\x1d\n\ttunnel_ip\x18\x07 \x01(\x0b\x32\n.IpAddress\x12\x1b\n\x06status\x18\x08 \x01(\x0e\x32\x07.Status:\x02UP\x12\x0e\n\x06\x61\x63tive\x18\t \x01(\x08\x12\x0e\n\x06uptime\x18\n \x01(\r\"\xfd\x07\n\tInterface\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x11\n\tdevice_id\x18\x02 \x01(\t\x12\x1c\n\x07macaddr\x18\x03 \x01(\x0b\x32\x0b.MacAddress\x12\x1b\n\x06status\x18\x04 \x01(\x0e\x32\x07.Status:\x02UP\x12\x1a\n\x06ipaddr\x18\x05 \x01(\x0b\x32\n.IpAddress\x12&\n\x0b\x64uplex_mode\x18\x06 \x01(\x0e\x32\x11.Interface.Duplex\x12\x0c\n\x04name\x18\x07 \x01(\t\x12\x13\n\x0bport_number\x18\x08 \x01(\t\x12!\n\x04type\x18\t \x01(\x0e\x32\x13.Interface.IntfType\x12\x0c\n\x04mode\x18\n \x01(\t\x12\x0c\n\x04vlan\x18\x0b \x01(\r\x12*\n\x07has_poe\x18\x0c \x01(\x0e\x32\x15.Interface.PoeSupport:\x02NA\x12\x1e\n\tpoe_state\x18\r \x01(\x0e\x32\x07.Status:\x02UP\x12\x1f\n\noper_state\x18\x0e \x01(\x0e\x32\x07.Status:\x02UP\x12 \n\x0b\x61\x64min_state\x18\x0f \x01(\x0e\x32\x07.Status:\x02UP\x12#\n\x05speed\x18\x10 \x01(\x0e\x32\x14.Interface.SpeedType\x12\x0b\n\x03mux\x18\x11 \x01(\r\x12\x0f\n\x07trusted\x18\x12 \x01(\r\x12\x0c\n\x04slot\x18\x13 \x01(\t\x12%\n\x08phy_type\x18\x14 \x01(\x0e\x32\x13.Interface.PortType\x12\x10\n\x08sub_type\x18\x15 \x01(\t\x12\x14\n\x0c\x61llowed_vlan\x18\x16 \x03(\r\"&\n\x06\x44uplex\x12\x08\n\x04HALF\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\"\x91\x01\n\x08IntfType\x12\x0c\n\x08\x45THERNET\x10\x01\x12\x0c\n\x08LOOPBACK\x10\x02\x12\x08\n\x04VLAN\x10\x03\x12\n\n\x06TUNNEL\x10\x04\x12\x10\n\x0cPORT_CHANNEL\x10\x05\x12\x0b\n\x07STANDBY\x10\x06\x12\n\n\x06\x42RIDGE\x10\x07\x12\t\n\x05SPLIT\x10\x08\x12\t\n\x05STACK\x10\t\x12\x08\n\x04MGMT\x10\n\x12\x08\n\x04NONE\x10\x0b\"l\n\tSpeedType\x12\x11\n\rSPEED_INVALID\x10\x00\x12\x0e\n\nSPEED_AUTO\x10\x01\x12\x0c\n\x08SPEED_10\x10\x02\x12\r\n\tSPEED_100\x10\x03\x12\x0e\n\nSPEED_1000\x10\x04\x12\x0f\n\x0bSPEED_10000\x10\x05\"J\n\x08PortType\x12\x0b\n\x07PT_RJ45\x10\x00\x12\x0b\n\x07PT_GBIC\x10\x01\x12\r\n\tPT_SERIAL\x10\x02\x12\n\n\x06PT_USB\x10\x03\x12\t\n\x05PT_X2\x10\x04\"6\n\nPoeSupport\x12\x06\n\x02NA\x10\x00\x12\r\n\tSUPPORTED\x10\x01\x12\x11\n\rNOT_SUPPORTED\x10\x02\"l\n\x07VapInfo\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x11\n\tdevice_id\x18\x02 \x01(\t\x12\x1e\n\tradio_mac\x18\x03 \x01(\x0b\x32\x0b.MacAddress\x12\r\n\x05\x65ssid\x18\x04 \x01(\x0c\"\xbb\x01\n\x05Radio\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x11\n\tdevice_id\x18\x02 \x01(\t\x12\r\n\x05index\x18\x03 \x01(\r\x12\x1c\n\x07macaddr\x18\x04 \x01(\x0b\x32\x0b.MacAddress\x12\x1b\n\x06status\x18\x05 \x01(\x0e\x32\x07.Status:\x02UP\x12\x0f\n\x07\x63hannel\x18\x06 \x01(\t\x12\x0c\n\x04\x62\x61nd\x18\x07 \x01(\r\x12\x15\n\rchannel_width\x18\x08 \x01(\r\"\xf4\x02\n\x02\x41p\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x0e\n\x06serial\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1c\n\x07macaddr\x18\x04 \x01(\x0b\x32\x0b.MacAddress\x12\x12\n\ncluster_id\x18\x05 \x01(\t\x12\x1b\n\x06status\x18\x06 \x01(\x0e\x32\x07.Status:\x02UP\x12\x1e\n\nip_address\x18\x07 \x01(\x0b\x32\n.IpAddress\x12\r\n\x05model\x18\x08 \x01(\t\x12\x11\n\tmesh_role\x18\t \x01(\t\x12\x0c\n\x04mode\x18\n \x01(\t\x12\x14\n\x0cswarm_master\x18\x0b \x01(\x08\x12\x17\n\x0fmodem_connected\x18\x0c \x01(\x08\x12#\n\x0buplink_type\x18\r \x01(\x0e\x32\x0e.Ap.UplinkType\"<\n\nUplinkType\x12\x0c\n\x08\x45THERNET\x10\x01\x12\x08\n\x04MESH\x10\x02\x12\x0b\n\x07STATION\x10\x03\x12\t\n\x05MODEM\x10\x04\"k\n\x07Network\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x10\n\x08swarm_id\x18\x02 \x01(\t\x12\r\n\x05\x65ssid\x18\x03 \x01(\x0c\x12\x10\n\x08security\x18\x04 \x01(\t\x12\x0c\n\x04type\x18\x05 \x01(\t\"\xc9\x02\n\x0eWirelessClient\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x1c\n\x07macaddr\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1e\n\nip_address\x18\x04 \x01(\x0b\x32\n.IpAddress\x12\x10\n\x08username\x18\x05 \x01(\t\x12\x19\n\x11\x61ssociated_device\x18\x06 \x01(\t\x12\x1e\n\tradio_mac\x18\x07 \x01(\x0b\x32\x0b.MacAddress\x12\x0f\n\x07network\x18\x08 \x01(\x0c\x12\x11\n\tuser_role\x18\t \x01(\t\x12\x14\n\x0cmanufacturer\x18\n \x01(\t\x12\x0f\n\x07os_type\x18\x0b \x01(\t\x12\x12\n\nconnection\x18\x0c \x01(\t\x12\x10\n\x08maxspeed\x18\r \x01(\r\x12\x0c\n\x04vlan\x18\x0e \x01(\r\"\xad\x01\n\x0eHardwareModule\x12\r\n\x05index\x18\x01 \x01(\r\x12.\n\x06status\x18\x02 \x01(\x0e\x32\x1e.HardwareModule.HardwareStatus\"\\\n\x0eHardwareStatus\x12\x06\n\x02OK\x10\x00\x12\t\n\x05\x45RROR\x10\x01\x12\x11\n\rNOT_CONNECTED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x12\x0b\n\x07STANDBY\x10\x04\x12\x0b\n\x07OFFLINE\x10\x05\"\xe6\x04\n\x06Switch\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x0e\n\x06serial\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1c\n\x07macaddr\x18\x04 \x01(\x0b\x32\x0b.MacAddress\x12\r\n\x05model\x18\x05 \x01(\t\x12\x1b\n\x06status\x18\x06 \x01(\x0e\x32\x07.Status:\x02UP\x12%\n\x11public_ip_address\x18\x07 \x01(\x0b\x32\n.IpAddress\x12\x1e\n\nip_address\x18\x08 \x01(\x0b\x32\n.IpAddress\x12\x18\n\x10\x66irmware_version\x18\t \x01(\t\x12#\n\x0f\x64\x65\x66\x61ult_gateway\x18\n \x01(\x0b\x32\n.IpAddress\x12\x13\n\x0b\x64\x65vice_mode\x18\x0b \x01(\r\x12\x14\n\x0cuplink_ports\x18\x0c \x03(\t\x12\x11\n\tmax_slots\x18\r \x01(\r\x12\x12\n\nused_slots\x18\x0e \x03(\t\x12+\n\x12management_modules\x18\x0f \x03(\x0b\x32\x0f.HardwareModule\x12\'\n\x0epower_supplies\x18\x10 \x03(\x0b\x32\x0f.HardwareModule\x12\x10\n\x08stack_id\x18\x11 \x01(\t\x12\x17\n\x0fstack_member_id\x18\x12 \x01(\r\x12\x32\n\x11stack_member_role\x18\x13 \x01(\x0e\x32\x17.Switch.StackMemberRole\"F\n\x0fStackMemberRole\x12\x0b\n\x07UNKNOWN\x10\x01\x12\r\n\tCOMMANDER\x10\x02\x12\x0b\n\x07STANDBY\x10\x03\x12\n\n\x06MEMBER\x10\x04\"\xb0\x03\n\x0bSwitchStack\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x10\n\x08stack_id\x18\x02 \x01(\t\x12\x1b\n\x06status\x18\x03 \x01(\x0e\x32\x07.Status:\x02UP\x12,\n\x08topology\x18\x04 \x01(\x0e\x32\x1a.SwitchStack.StackTopology\x12(\n\x06policy\x18\x05 \x01(\x0e\x32\x18.SwitchStack.StackPolicy\x12\x18\n\x10\x66irmware_version\x18\x06 \x01(\t\x12\x15\n\rvsf_domain_id\x18\x07 \x01(\r\"]\n\rStackTopology\x12\x0e\n\nSTANDALONE\x10\x01\x12\t\n\x05\x43HAIN\x10\x02\x12\x08\n\x04RING\x10\x03\x12\x08\n\x04MESH\x10\x04\x12\x10\n\x0cPARTIAL_MESH\x10\x05\x12\x0b\n\x07UNKNOWN\x10\x06\"i\n\x0bStackPolicy\x12\x17\n\x13STACK_SPLIT_UNKNOWN\x10\x00\x12\x1f\n\x1bSTACK_SPLIT_ONE_FRAGMENT_UP\x10\x01\x12 \n\x1cSTACK_SPLIT_ALL_FRAGMENTS_UP\x10\x02\"\x8a\x02\n\x0bWiredClient\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x1c\n\x07macaddr\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1e\n\nip_address\x18\x04 \x01(\x0b\x32\n.IpAddress\x12\x10\n\x08username\x18\x05 \x01(\t\x12\x19\n\x11\x61ssociated_device\x18\x06 \x01(\t\x12\"\n\rinterface_mac\x18\x07 \x01(\x0b\x32\x0b.MacAddress\x12\x11\n\tuser_role\x18\x08 \x01(\t\x12\x0c\n\x04vlan\x18\t \x01(\r\x12\x1c\n\tauth_type\x18\n \x01(\x0e\x32\t.AuthType\"\xa3\x02\n\x12MobilityController\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x0e\n\x06serial\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x1c\n\x07macaddr\x18\x04 \x01(\x0b\x32\x0b.MacAddress\x12\r\n\x05model\x18\x05 \x01(\t\x12\x1b\n\x06status\x18\x06 \x01(\x0e\x32\x07.Status:\x02UP\x12%\n\x11public_ip_address\x18\x07 \x01(\x0b\x32\n.IpAddress\x12\x1e\n\nip_address\x18\x08 \x01(\x0b\x32\n.IpAddress\x12\x18\n\x10\x66irmware_version\x18\t \x01(\t\x12#\n\x0f\x64\x65\x66\x61ult_gateway\x18\n \x01(\x0b\x32\n.IpAddress\"\xe3\x01\n\x06Uplink\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x11\n\tdevice_id\x18\x02 \x01(\t\x12\x12\n\nlink_index\x18\x03 \x01(\x04\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x10\n\x08priority\x18\x06 \x01(\r\x12\x17\n\x06status\x18\x07 \x01(\x0e\x32\x07.Status\x12\x1b\n\nwan_status\x18\x08 \x01(\x0e\x32\x07.Status\x12\x0c\n\x04vlan\x18\t \x01(\r\x12\x18\n\x10vlan_description\x18\n \x01(\t\"\xf1\x01\n\tIkeTunnel\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x11\n\tdevice_id\x18\x02 \x01(\t\x12\x0e\n\x06map_id\x18\x03 \x01(\x04\x12\x1d\n\x08peer_mac\x18\x04 \x01(\x0b\x32\x0b.MacAddress\x12\x1e\n\tlocal_mac\x18\x05 \x01(\x0b\x32\x0b.MacAddress\x12\x1a\n\x06src_ip\x18\x06 \x01(\x0b\x32\n.IpAddress\x12\x1a\n\x06\x64st_ip\x18\x07 \x01(\x0b\x32\n.IpAddress\x12\x17\n\x06status\x18\x08 \x01(\x0e\x32\x07.Status\x12\x10\n\x08map_name\x18\t \x01(\t\"\xba\x02\n\x0b\x44\x65viceStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\r\x12\x0e\n\x06uptime\x18\x03 \x01(\x04\x12\x17\n\x0f\x63pu_utilization\x18\x04 \x01(\r\x12\x11\n\tmem_total\x18\x05 \x01(\x04\x12\x10\n\x08mem_free\x18\x06 \x01(\x04\x12\x19\n\x11power_consumption\x18\x07 \x01(\r\x12\x11\n\tfan_speed\x18\x08 \x01(\r\x12\x13\n\x0btemperature\x18\t \x01(\r\x12\x1b\n\nfan_status\x18\n \x01(\x0e\x32\x07.Status\x12\x11\n\tmax_power\x18\x0b \x01(\r\x12\x17\n\x0fpoe_consumption\x18\x0c \x01(\r\x12\x12\n\npoe_budget\x18\r \x01(\r\x12\x17\n\x0fmem_utilization\x18\x0e \x01(\x04\"\xd2\x01\n\nRadioStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x1c\n\x07macaddr\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\x12\x10\n\x08tx_drops\x18\x06 \x01(\r\x12\x10\n\x08tx_power\x18\x07 \x01(\r\x12\x13\n\x0bnoise_floor\x18\x08 \x01(\r\x12\x13\n\x0butilization\x18\t \x01(\r\x12\x0e\n\x06rx_bad\x18\n \x01(\x04\"\x85\x01\n\x08VapStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x1e\n\tradio_mac\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x0f\n\x07network\x18\x03 \x01(\x0c\x12\x11\n\ttimestamp\x18\x04 \x01(\r\x12\x10\n\x08tx_bytes\x18\x05 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x06 \x01(\x04\"s\n\x0bTunnelStats\x12\x10\n\x08swarm_id\x18\x01 \x01(\t\x12\x1b\n\x05index\x18\x02 \x01(\x0e\x32\x0c.TunnelIndex\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\"\xcf\x01\n\x0b\x43lientStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x1c\n\x07macaddr\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\x12\x12\n\nrx_retries\x18\x06 \x01(\r\x12\x12\n\ntx_retries\x18\x07 \x01(\r\x12\r\n\x05speed\x18\x08 \x01(\r\x12\x14\n\x0csignal_in_db\x18\t \x01(\r\x12\x0b\n\x03snr\x18\n \x01(\r\"\x9d\x05\n\x0eInterfaceStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x1c\n\x07macaddr\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\x12\x19\n\x11power_consumption\x18\x06 \x01(\r\x12\x11\n\tin_errors\x18\x07 \x01(\r\x12\x12\n\nout_errors\x18\x08 \x01(\r\x12\x13\n\x0bin_discards\x18\t \x01(\r\x12\x14\n\x0cout_discards\x18\n \x01(\r\x12\x12\n\nin_packets\x18\x0b \x01(\r\x12\x13\n\x0bout_packets\x18\x0c \x01(\r\x12\x14\n\x0cin_other_err\x18\r \x01(\r\x12\x18\n\x10in_multicast_pkt\x18\x0e \x01(\r\x12\x18\n\x10in_broadcast_pkt\x18\x0f \x01(\r\x12\x16\n\x0ein_unicast_pkt\x18\x10 \x01(\r\x12\x19\n\x11out_multicast_pkt\x18\x11 \x01(\r\x12\x19\n\x11out_broadcast_pkt\x18\x12 \x01(\r\x12\x17\n\x0fout_unicast_pkt\x18\x13 \x01(\r\x12\x0e\n\x06in_fcs\x18\x14 \x01(\r\x12\x14\n\x0cin_alignment\x18\x15 \x01(\r\x12\x1f\n\x17out_excessive_collision\x18\x16 \x01(\r\x12\x12\n\nin_jabbers\x18\x17 \x01(\r\x12\x15\n\rin_fragmented\x18\x18 \x01(\r\x12\x10\n\x08in_giant\x18\x19 \x01(\r\x12\x0f\n\x07in_runt\x18\x1a \x01(\r\x12\x15\n\rout_collision\x18\x1b \x01(\r\x12\x1a\n\x12out_late_collision\x18\x1c \x01(\r\x12\x14\n\x0cout_deferred\x18\x1d \x01(\r\"\xbc\x01\n\x0bUplinkStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0f\n\x07link_id\x18\x02 \x01(\r\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\x12\x17\n\x0ftunnel_tx_bytes\x18\x06 \x01(\x04\x12\x17\n\x0ftunnel_rx_bytes\x18\x07 \x01(\x04\x12\x0e\n\x06map_id\x18\x08 \x01(\x04\x12\x10\n\x08map_name\x18\t \x01(\t\"\x94\x01\n\x0eUplinkWanStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0f\n\x07link_id\x18\x02 \x01(\r\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x18\n\x10\x63ompressed_bytes\x18\x04 \x01(\x04\x12\x1a\n\x12uncompressed_bytes\x18\x05 \x01(\x04\x12\x15\n\rsavings_bytes\x18\x06 \x01(\x04\"V\n\nModemStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\r\x12\x10\n\x08tx_bytes\x18\x03 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x04 \x01(\x04\"h\n\tRoleStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x11\n\tuser_role\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\"c\n\tVlanStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0c\n\x04vlan\x18\x02 \x01(\r\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\"d\n\tSsidStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\r\n\x05\x65ssid\x18\x02 \x01(\x0c\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x10\n\x08tx_bytes\x18\x04 \x01(\x04\x12\x10\n\x08rx_bytes\x18\x05 \x01(\x04\"\xb8\x01\n\x12TunnelIpProbeStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\"\n\x0ctunnel_index\x18\x02 \x01(\x0e\x32\x0c.TunnelIndex\x12!\n\rprobe_ip_addr\x18\x03 \x01(\x0b\x32\n.IpAddress\x12\x14\n\x0cprobe_status\x18\x04 \x01(\r\x12\x1d\n\x15ip_probe_pkt_loss_pct\x18\x05 \x01(\r\x12\x13\n\x0btunnel_name\x18\x06 \x01(\t\"\xb0\x03\n\x12UplinkIpProbeStats\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0f\n\x07link_id\x18\x02 \x01(\r\x12\x11\n\ttimestamp\x18\x03 \x01(\r\x12\x1e\n\nip_address\x18\x04 \x01(\x0b\x32\n.IpAddress\x12\x0c\n\x04vlan\x18\x05 \x01(\r\x12\x0f\n\x07\x61vg_rtt\x18\x06 \x01(\x04\x12\x0f\n\x07max_rtt\x18\x07 \x01(\x04\x12\x0f\n\x07min_rtt\x18\x08 \x01(\x04\x12\x12\n\navg_jitter\x18\t \x01(\x04\x12\x12\n\nmax_jitter\x18\n \x01(\x04\x12\x12\n\nmin_jitter\x18\x0b \x01(\x04\x12\x13\n\x0bmos_quality\x18\x0c \x01(\x04\x12\x16\n\x0esd_avg_latency\x18\r \x01(\x04\x12\x16\n\x0e\x64s_avg_latency\x18\x0e \x01(\x04\x12\x15\n\rsd_avg_jitter\x18\x0f \x01(\x04\x12\x15\n\rds_avg_jitter\x18\x10 \x01(\x04\x12\x14\n\x0cprobe_status\x18\x11 \x01(\r\x12\x10\n\x08loss_pct\x18\x12 \x01(\r\x12\x14\n\x0cvpnc_ip_addr\x18\x13 \x01(\x04\x12\x15\n\rprobe_ip_addr\x18\x14 \x01(\x04\"\xd8\x01\n\x0fUplinkSpeedtest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x1d\n\tserver_ip\x18\x02 \x01(\x0b\x32\n.IpAddress\x12\x0c\n\x04vlan\x18\x03 \x01(\r\x12\x10\n\x08protocol\x18\x04 \x01(\t\x12\x14\n\x0cupstream_bps\x18\x05 \x01(\x04\x12\x16\n\x0e\x64ownstream_bps\x18\x06 \x01(\x04\x12\x11\n\ttime_secs\x18\x07 \x01(\r\x12\x17\n\x0fupstream_jitter\x18\x08 \x01(\x02\x12\x19\n\x11\x64ownstream_jitter\x18\t \x01(\x02\"\xe6\r\n\tWIDSEvent\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12(\n\nevent_type\x18\x02 \x01(\x0e\x32\x14.WIDSEvent.EventType\x12\x1c\n\x07macaddr\x18\x03 \x01(\x0b\x32\x0b.MacAddress\x12\x13\n\x0b\x64\x65tected_ap\x18\x04 \x01(\t\x12*\n\x0b\x61ttack_type\x18\x05 \x01(\x0e\x32\x15.WIDSEvent.AttackType\x12\x0f\n\x07\x63hannel\x18\x06 \x01(\t\x12\x0f\n\x07network\x18\x07 \x01(\x0c\"U\n\tEventType\x12\t\n\x05ROGUE\x10\x01\x12\x0f\n\x0bINTERFERING\x10\x02\x12\x19\n\x15INFRASTRUCTURE_ATTACK\x10\x03\x12\x11\n\rCLIENT_ATTACK\x10\x04\"\xb5\x0b\n\nAttackType\x12\x1c\n\x18\x44\x45TECT_VALID_SSID_MISUSE\x10\x01\x12\x18\n\x14\x44\x45TECT_ADHOC_NETWORK\x10\x02\x12\x13\n\x0f\x44\x45TECT_AP_FLOOD\x10\x03\x12\x1a\n\x16\x44\x45TECT_WIRELESS_BRIDGE\x10\x04\x12\x1d\n\x19\x44\x45TECT_INVALID_MAC_OUI_AP\x10\x05\x12\x1e\n\x1a\x44\x45TECT_INVALID_MAC_OUI_STA\x10\x06\x12\x12\n\x0e\x44\x45TECT_BAD_WEP\x10\x07\x12\x1b\n\x17\x44\x45TECT_AP_IMPERSONATION\x10\x08\x12\x19\n\x15\x44\x45TECT_WINDOWS_BRIDGE\x10\t\x12!\n\x1dSIGNATURE_DEAUTH_BROADCAST_AP\x10\n\x12\"\n\x1eSIGNATURE_DEAUTH_BROADCAST_STA\x10\x0b\x12\x18\n\x14\x44\x45TECT_HT_GREENFIELD\x10\x0c\x12\"\n\x1e\x44\x45TECT_HT_40MHZ_INTOLERANCE_AP\x10\r\x12#\n\x1f\x44\x45TECT_HT_40MHZ_INTOLERANCE_STA\x10\x0e\x12\x17\n\x13\x44\x45TECT_CLIENT_FLOOD\x10\x0f\x12!\n\x1d\x44\x45TECT_ADHOC_USING_VALID_SSID\x10\x10\x12\x16\n\x12\x44\x45TECT_AP_SPOOFING\x10\x11\x12%\n!DETECT_INVALID_ADDRESSCOMBINATION\x10\x12\x12\x19\n\x15\x44\x45TECT_MALFORMED_HTIE\x10\x13\x12\x1e\n\x1a\x44\x45TECT_MALFORMED_ASSOC_REQ\x10\x14\x12\x16\n\x12\x44\x45TECT_OVERFLOW_IE\x10\x15\x12\x1d\n\x19\x44\x45TECT_OVERFLOW_EAPOL_KEY\x10\x16\x12#\n\x1f\x44\x45TECT_MALFORMED_LARGE_DURATION\x10\x17\x12(\n$DETECT_MALFORMED_FRAME_WRONG_CHANNEL\x10\x18\x12\x1f\n\x1b\x44\x45TECT_MALFORMED_FRAME_AUTH\x10\x19\x12\x1b\n\x17\x44\x45TECT_CTS_RATE_ANOMALY\x10\x1a\x12\x1b\n\x17\x44\x45TECT_RTS_RATE_ANOMALY\x10\x1b\x12\x1e\n\x1aSIGNATURE_DEAUTH_BROADCAST\x10\x1c\x12%\n!SIGNATURE_DEASSOCIATION_BROADCAST\x10\x1d\x12\x1f\n\x1b\x44\x45TECT_RATE_ANOMALIES_BY_AP\x10\x1e\x12 \n\x1c\x44\x45TECT_RATE_ANOMALIES_BY_STA\x10\x1f\x12\x1b\n\x17\x44\x45TECT_EAP_RATE_ANOMALY\x10 \x12\x19\n\x15\x44\x45TECT_DISCONNECT_STA\x10!\x12\x1c\n\x18SIGNATURE_ASLEAP_FROM_AP\x10\"\x12\x1d\n\x19SIGNATURE_ASLEAP_FROM_STA\x10#\x12\x1d\n\x19SIGNATURE_AIRJACK_FROM_AP\x10$\x12\x1e\n\x1aSIGNATURE_AIRJACK_FROM_STA\x10%\x12\'\n#DETECT_STATION_DISCONNECT_ATTACK_AP\x10&\x12\x1c\n\x18\x44\x45TECT_UNENCRYPTED_VALID\x10\'\x12\x18\n\x14\x44\x45TECT_OMERTA_ATTACK\x10(\x12\x1d\n\x19\x44\x45TECT_TKIP_REPLAY_ATTACK\x10)\x12\x1a\n\x16\x44\x45TECT_CHOPCHOP_ATTACK\x10*\x12\x13\n\x0f\x44\x45TECT_FATAJACK\x10+\x12&\n\"DETECT_VALID_CLIENT_MISASSOCIATION\x10,\x12\x1b\n\x17\x44\x45TECT_BLOCK_ACK_ATTACK\x10-\x12\x1c\n\x18\x44\x45TECT_HOTSPOTTER_ATTACK\x10.\x12 \n\x1c\x44\x45TECT_POWER_SAVE_DOS_ATTACK\x10/\"\xb1\x05\n\x13\x41irMonitorRogueInfo\x12;\n\nmatch_type\x18\x01 \x01(\x0e\x32\'.AirMonitorRogueInfo.wms_rap_match_type\x12\x1e\n\tmatch_mac\x18\x02 \x01(\x0b\x32\x0b.MacAddress\x12\x1c\n\x08match_ip\x18\x03 \x01(\x0b\x32\n.IpAddress\x12\x14\n\x0cmonitor_name\x18\x04 \x01(\t\x12\x43\n\x0enat_match_type\x18\x05 \x01(\x0e\x32+.AirMonitorRogueInfo.wms_rap_nat_match_type\"\xc6\x02\n\x12wms_rap_match_type\x12\x0f\n\x0bRAP_MT_NONE\x10\x00\x12\x11\n\rRAP_MT_CFG_WM\x10\x01\x12\x11\n\rRAP_MT_ETH_WM\x10\x02\x12\x10\n\x0cRAP_MT_AP_WM\x10\x03\x12\x11\n\rRAP_MT_EXT_WM\x10\x04\x12\x11\n\rRAP_MT_MANUAL\x10\x05\x12\x15\n\x11RAP_MT_BASE_BSSID\x10\x06\x12\x0e\n\nRAP_MT_EMS\x10\x07\x12\x14\n\x10RAP_MT_ETH_GW_WM\x10\x08\x12\x14\n\x10RAP_MT_CLASS_OFF\x10\t\x12\x13\n\x0fRAP_MT_AP_BSSID\x10\n\x12\x16\n\x12RAP_MT_PROP_ETH_WM\x10\x0b\x12\x12\n\x0eRAP_MT_AP_RULE\x10\x0c\x12\x14\n\x10RAP_MT_SYSTEM_WM\x10\r\x12\x17\n\x13RAP_MT_SYSTEM_GW_WM\x10\x0e\"{\n\x16wms_rap_nat_match_type\x12\x10\n\x0cRAP_NMT_NONE\x10\x00\x12\x11\n\rRAP_NMT_EQUAL\x10\x01\x12\x14\n\x10RAP_NMT_PLUS_ONE\x10\x02\x12\x15\n\x11RAP_NMT_MINUS_ONE\x10\x03\x12\x0f\n\x0bRAP_NMT_OUI\x10\x04\"\xe7\x02\n\nRogueEvent\x12\x1c\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x03\x41\x44\x44\x12\x13\n\x0b\x64\x65tected_ap\x18\x02 \x01(\t\x12\x1c\n\x07macaddr\x18\x03 \x01(\x0b\x32\x0b.MacAddress\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\r\x12\x0f\n\x07network\x18\x05 \x01(\x0c\x12\x35\n\tencr_type\x18\x06 \x01(\x0e\x32\".RogueEvent.wms_snmp_encr_protocol\x12&\n\x08\x61m_rogue\x18\x07 \x01(\x0b\x32\x14.AirMonitorRogueInfo\"\x86\x01\n\x16wms_snmp_encr_protocol\x12\x1a\n\x16WMS_SNMP_WPA_ENCR_OPEN\x10\x00\x12\x19\n\x15WMS_SNMP_WPA_ENCR_WEP\x10\x01\x12\x19\n\x15WMS_SNMP_WPA_ENCR_WPA\x10\x02\x12\x1a\n\x16WMS_SNMP_WPA_ENCR_WPA2\x10\x03\"\x9f\x01\n\x10\x44\x65viceNeighbours\x12\x1f\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x07.Action:\x06UPDATE\x12\x11\n\tdevice_id\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\t\x12\x18\n\x10remote_device_id\x18\x04 \x01(\t\x12\x13\n\x0bremote_port\x18\x05 \x01(\t\x12\x1a\n\x12remote_port_number\x18\x06 \x01(\t\"\xf1\t\n\x15MonitoringInformation\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x02(\t\x12#\n\rdata_elements\x18\x02 \x03(\x0e\x32\x0c.DataElement\x12\x16\n\x06swarms\x18\x03 \x03(\x0b\x32\x06.Swarm\x12\x10\n\x03\x61ps\x18\x04 \x03(\x0b\x32\x03.Ap\x12\x1a\n\x08networks\x18\x05 \x03(\x0b\x32\x08.Network\x12\x16\n\x06radios\x18\x06 \x03(\x0b\x32\x06.Radio\x12\x16\n\x04vaps\x18\x07 \x03(\x0b\x32\x08.VapInfo\x12\x1e\n\ninterfaces\x18\x08 \x03(\x0b\x32\n.Interface\x12\x18\n\x07tunnels\x18\t \x03(\x0b\x32\x07.Tunnel\x12)\n\x10wireless_clients\x18\n \x03(\x0b\x32\x0f.WirelessClient\x12\x19\n\x08switches\x18\x0b \x03(\x0b\x32\x07.Switch\x12#\n\rwired_clients\x18\x0c \x03(\x0b\x32\x0c.WiredClient\x12\"\n\x0c\x64\x65vice_stats\x18\r \x03(\x0b\x32\x0c.DeviceStats\x12 \n\x0bradio_stats\x18\x0e \x03(\x0b\x32\x0b.RadioStats\x12(\n\x0finterface_stats\x18\x0f \x03(\x0b\x32\x0f.InterfaceStats\x12\x1c\n\tvap_stats\x18\x10 \x03(\x0b\x32\t.VapStats\x12\"\n\x0c\x63lient_stats\x18\x11 \x03(\x0b\x32\x0c.ClientStats\x12\"\n\x0ctunnel_stats\x18\x12 \x03(\x0b\x32\x0c.TunnelStats\x12\x1f\n\x0bwids_events\x18\x13 \x03(\x0b\x32\n.WIDSEvent\x12 \n\x0bmodem_stats\x18\x14 \x03(\x0b\x32\x0b.ModemStats\x12\x1e\n\nrole_stats\x18\x15 \x03(\x0b\x32\n.RoleStats\x12\x1e\n\nvlan_stats\x18\x16 \x03(\x0b\x32\n.VlanStats\x12\x1e\n\nssid_stats\x18\x17 \x03(\x0b\x32\n.SsidStats\x12*\n\ripprobe_stats\x18\x18 \x03(\x0b\x32\x13.TunnelIpProbeStats\x12!\n\x0crogue_events\x18\x19 \x03(\x0b\x32\x0b.RogueEvent\x12\x31\n\x14mobility_controllers\x18\x1a \x03(\x0b\x32\x13.MobilityController\x12\x18\n\x07uplinks\x18\x1b \x03(\x0b\x32\x07.Uplink\x12\"\n\x0cuplink_stats\x18\x1c \x03(\x0b\x32\x0c.UplinkStats\x12)\n\x10uplink_wan_stats\x18\x1d \x03(\x0b\x32\x0f.UplinkWanStats\x12/\n\x12uplink_probe_stats\x18\x1e \x03(\x0b\x32\x13.UplinkIpProbeStats\x12*\n\x10uplink_speedtest\x18\x1f \x03(\x0b\x32\x10.UplinkSpeedtest\x12,\n\x11\x64\x65vice_neighbours\x18 \x03(\x0b\x32\x11.DeviceNeighbours\x12#\n\x0cnotification\x18! \x03(\x0b\x32\r.Notification\x12#\n\rswitch_stacks\x18\" \x03(\x0b\x32\x0c.SwitchStack\x12\x1f\n\x0bike_tunnels\x18# \x03(\x0b\x32\n.IkeTunnel\x12)\n\x10switch_vlan_info\x18$ \x01(\x0b\x32\x0f.SwitchVlanInfo\"\xdf\x03\n\x1aMonitoringStateInformation\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x02(\t\x12\x31\n\x14mobility_controllers\x18\x02 \x03(\x0b\x32\x13.MobilityController\x12\x19\n\x08switches\x18\x03 \x03(\x0b\x32\x07.Switch\x12\x16\n\x06swarms\x18\x04 \x03(\x0b\x32\x06.Swarm\x12\x10\n\x03\x61ps\x18\x05 \x03(\x0b\x32\x03.Ap\x12\x16\n\x04vaps\x18\x06 \x03(\x0b\x32\x08.VapInfo\x12\x16\n\x06radios\x18\x07 \x03(\x0b\x32\x06.Radio\x12\x1e\n\ninterfaces\x18\x08 \x03(\x0b\x32\n.Interface\x12\x1a\n\x08networks\x18\t \x03(\x0b\x32\x08.Network\x12\x18\n\x07tunnels\x18\n \x03(\x0b\x32\x07.Tunnel\x12)\n\x10wireless_clients\x18\x0b \x03(\x0b\x32\x0f.WirelessClient\x12#\n\rwired_clients\x18\x0c \x03(\x0b\x32\x0c.WiredClient\x12\x18\n\x07uplinks\x18\r \x03(\x0b\x32\x07.Uplink\x12#\n\rswitch_stacks\x18\x0e \x03(\x0b\x32\x0c.SwitchStack\x12\x1f\n\x0bike_tunnels\x18\x0f \x03(\x0b\x32\n.IkeTunnel\"*\n\x0cKeyValueData\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xe2\x02\n\x0cNotification\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x12\n\nsetting_id\x18\x03 \x01(\t\x12\x11\n\tdevice_id\x18\x04 \x01(\t\x12(\n\x08severity\x18\x05 \x01(\x0e\x32\x16.Notification.Severity\x12\x11\n\ttimestamp\x18\x06 \x01(\r\x12.\n\x05state\x18\x07 \x01(\x0e\x32\x1f.Notification.NotificationState\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x12\x1c\n\x05\x65xtra\x18\t \x03(\x0b\x32\r.KeyValueData\"G\n\x08Severity\x12\n\n\x06Normal\x10\x01\x12\x0b\n\x07Warning\x10\x02\x12\t\n\x05Minor\x10\x03\x12\t\n\x05Major\x10\x04\x12\x0c\n\x08\x43ritical\x10\x05\"(\n\x11NotificationState\x12\x08\n\x04Open\x10\x00\x12\t\n\x05\x43lose\x10\x01\"?\n\x0eSwitchVlanInfo\x12\x11\n\tdevice_id\x18\x01 \x02(\t\x12\x1a\n\x05vlans\x18\x02 \x03(\x0b\x32\x0b.SwitchVlan\"T\n\nSwitchVlan\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x14\n\x0ctagged_ports\x18\x03 \x03(\t\x12\x16\n\x0euntagged_ports\x18\x04 \x03(\t*)\n\x06\x41\x63tion\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x12\n\n\x06UPDATE\x10\x03*\x1a\n\x06Status\x12\x06\n\x02UP\x10\x01\x12\x08\n\x04\x44OWN\x10\x02*&\n\x0bTunnelIndex\x12\x0b\n\x07PRIMARY\x10\x00\x12\n\n\x06\x42\x41\x43KUP\x10\x01*\"\n\nCryptoType\x12\x0b\n\x07\x43\x41_CERT\x10\x00\x12\x07\n\x03PSK\x10\x01*\x84\x05\n\x0b\x44\x61taElement\x12\x14\n\x10STATE_CONTROLLER\x10\x01\x12\x10\n\x0cSTATE_SWITCH\x10\x02\x12\x0f\n\x0bSTATE_SWARM\x10\x03\x12\x0c\n\x08STATE_AP\x10\x04\x12\r\n\tSTATE_VAP\x10\x05\x12\x0f\n\x0bSTATE_RADIO\x10\x06\x12\x13\n\x0fSTATE_INTERFACE\x10\x07\x12\x11\n\rSTATE_NETWORK\x10\x08\x12\x10\n\x0cSTATE_TUNNEL\x10\t\x12\x18\n\x14STATE_WIRELESSCLIENT\x10\n\x12\x15\n\x11STATE_WIREDCLIENT\x10\x0b\x12\x10\n\x0cSTATE_UPLINK\x10\x0c\x12\x0f\n\x0bSTAT_DEVICE\x10\r\x12\x0e\n\nSTAT_RADIO\x10\x0e\x12\x0c\n\x08STAT_VAP\x10\x0f\x12\x12\n\x0eSTAT_INTERFACE\x10\x10\x12\x0f\n\x0bSTAT_CLIENT\x10\x11\x12\x0f\n\x0bSTAT_TUNNEL\x10\x12\x12\x0e\n\nSTAT_MODEM\x10\x13\x12\r\n\tSTAT_ROLE\x10\x14\x12\r\n\tSTAT_VLAN\x10\x15\x12\r\n\tSTAT_SSID\x10\x16\x12\x10\n\x0cSTAT_IPPROBE\x10\x17\x12\x0f\n\x0bSTAT_UPLINK\x10\x18\x12\x12\n\x0eSTAT_UPLINKWAN\x10\x19\x12\x16\n\x12STAT_UPLINKIPPROBE\x10\x1a\x12\x0f\n\x0b\x45VENTS_WIDS\x10\x1b\x12\x10\n\x0c\x45VENTS_ROGUE\x10\x1c\x12\x1a\n\x16STATS_UPLINK_SPEEDTEST\x10\x1d\x12\x15\n\x11\x44\x45VICE_NEIGHBOURS\x10\x1e\x12\x11\n\rNOTIFICATIONS\x10\x1f\x12\x10\n\x0cSWITCH_STACK\x10 \x12\x14\n\x10STATE_IKE_TUNNEL\x10!\x12\x0f\n\x0bSWITCH_VLAN\x10\"*\xf7\x05\n\x08\x41uthType\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08MAC_AUTH\x10\x02\x12\x0e\n\nDOT1X_AUTH\x10\x03\x12\x0b\n\x07L3_AUTH\x10\x04\x12\x10\n\x0c\x43ONSOLE_AUTH\x10\x05\x12\x0f\n\x0bTELNET_AUTH\x10\x06\x12\x0e\n\nWEBUI_AUTH\x10\x07\x12\x0c\n\x08SSH_AUTH\x10\x08\x12\x0c\n\x08WEB_AUTH\x10\t\x12\r\n\tSNMP_AUTH\x10\n\x12\x11\n\rSSH_NONE_AUTH\x10\x0b\x12\x0c\n\x08LMA_AUTH\x10\x0c\x12\x0c\n\x08\x41NY_AUTH\x10\r\x12\x12\n\x0e\x43\x41PTIVE_PORTAL\x10\x0e\x12\x0c\n\x08VPN_AUTH\x10\x0f\x12\x15\n\x11STATEFUL_KERBEROS\x10\x10\x12\x15\n\x11RADIUS_ACCOUNTING\x10\x11\x12\r\n\tSECURE_ID\x10\x12\x12\x13\n\x0fSTATEFUL_RADIUS\x10\x13\x12\x15\n\x11SWITCH_MANAGEMENT\x10\x14\x12\x11\n\rDOT1X_MACHINE\x10\x15\x12\x0e\n\nDOT1X_USER\x10\x16\x12\x0f\n\x0b\x44OT1X_WIRED\x10\x17\x12\x17\n\x13\x44OT1X_WIRED_MACHINE\x10\x18\x12\x14\n\x10\x44OT1X_WIRED_USER\x10\x19\x12\x0e\n\nPUB_COOKIE\x10\x1a\x12\x10\n\x0cTACACAS_PLUS\x10\x1b\x12\x11\n\rWIRELESS_XSEC\x10\x1c\x12\x19\n\x15WIRELESS_XSEC_MACHINE\x10\x1d\x12\x16\n\x12WIRELESS_XSEC_USER\x10\x1e\x12\x17\n\x13WIRELESS_XSEC_WIRED\x10\x1f\x12\x1f\n\x1bWIRELESS_XSEC_WIRED_MACHINE\x10 \x12\x1c\n\x18WIRELESS_XSEC_WIRED_USER\x10!\x12\x11\n\rSTATEFUL_NTLM\x10\"\x12\n\n\x06RAP_AP\x10#\x12\x0b\n\x07VIA_WEB\x10$\x12\x1a\n\x16GENERIC_INTERFACE_SPEC\x10%\x12\x11\n\rTRANSPORT_VPN\x10&\x12\x0b\n\x07VIA_VPN\x10\'\x12\x13\n\x0fNUM_AUTH_CLIENT\x10(') ) _ACTION = _descriptor.EnumDescriptor( name='Action', full_name='Action', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='ADD', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DELETE', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='UPDATE', index=2, number=3, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13578, serialized_end=13619, ) _sym_db.RegisterEnumDescriptor(_ACTION) Action = enum_type_wrapper.EnumTypeWrapper(_ACTION) _STATUS = _descriptor.EnumDescriptor( name='Status', full_name='Status', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='UP', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOWN', index=1, number=2, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13621, serialized_end=13647, ) _sym_db.RegisterEnumDescriptor(_STATUS) Status = enum_type_wrapper.EnumTypeWrapper(_STATUS) _TUNNELINDEX = _descriptor.EnumDescriptor( name='TunnelIndex', full_name='TunnelIndex', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='PRIMARY', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BACKUP', index=1, number=1, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13649, serialized_end=13687, ) _sym_db.RegisterEnumDescriptor(_TUNNELINDEX) TunnelIndex = enum_type_wrapper.EnumTypeWrapper(_TUNNELINDEX) _CRYPTOTYPE = _descriptor.EnumDescriptor( name='CryptoType', full_name='CryptoType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='CA_CERT', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PSK', index=1, number=1, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13689, serialized_end=13723, ) _sym_db.RegisterEnumDescriptor(_CRYPTOTYPE) CryptoType = enum_type_wrapper.EnumTypeWrapper(_CRYPTOTYPE) _DATAELEMENT = _descriptor.EnumDescriptor( name='DataElement', full_name='DataElement', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='STATE_CONTROLLER', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_SWITCH', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_SWARM', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_AP', index=3, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_VAP', index=4, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_RADIO', index=5, number=6, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_INTERFACE', index=6, number=7, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_NETWORK', index=7, number=8, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_TUNNEL', index=8, number=9, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_WIRELESSCLIENT', index=9, number=10, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_WIREDCLIENT', index=10, number=11, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_UPLINK', index=11, number=12, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_DEVICE', index=12, number=13, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_RADIO', index=13, number=14, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_VAP', index=14, number=15, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_INTERFACE', index=15, number=16, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_CLIENT', index=16, number=17, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_TUNNEL', index=17, number=18, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_MODEM', index=18, number=19, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_ROLE', index=19, number=20, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_VLAN', index=20, number=21, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_SSID', index=21, number=22, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_IPPROBE', index=22, number=23, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_UPLINK', index=23, number=24, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_UPLINKWAN', index=24, number=25, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STAT_UPLINKIPPROBE', index=25, number=26, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='EVENTS_WIDS', index=26, number=27, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='EVENTS_ROGUE', index=27, number=28, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATS_UPLINK_SPEEDTEST', index=28, number=29, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DEVICE_NEIGHBOURS', index=29, number=30, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='NOTIFICATIONS', index=30, number=31, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SWITCH_STACK', index=31, number=32, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATE_IKE_TUNNEL', index=32, number=33, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SWITCH_VLAN', index=33, number=34, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13726, serialized_end=14370, ) _sym_db.RegisterEnumDescriptor(_DATAELEMENT) DataElement = enum_type_wrapper.EnumTypeWrapper(_DATAELEMENT) _AUTHTYPE = _descriptor.EnumDescriptor( name='AuthType', full_name='AuthType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='NONE', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='MAC_AUTH', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOT1X_AUTH', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='L3_AUTH', index=3, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CONSOLE_AUTH', index=4, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TELNET_AUTH', index=5, number=6, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WEBUI_AUTH', index=6, number=7, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SSH_AUTH', index=7, number=8, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WEB_AUTH', index=8, number=9, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SNMP_AUTH', index=9, number=10, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SSH_NONE_AUTH', index=10, number=11, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='LMA_AUTH', index=11, number=12, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='ANY_AUTH', index=12, number=13, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CAPTIVE_PORTAL', index=13, number=14, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='VPN_AUTH', index=14, number=15, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATEFUL_KERBEROS', index=15, number=16, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RADIUS_ACCOUNTING', index=16, number=17, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SECURE_ID', index=17, number=18, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATEFUL_RADIUS', index=18, number=19, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SWITCH_MANAGEMENT', index=19, number=20, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOT1X_MACHINE', index=20, number=21, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOT1X_USER', index=21, number=22, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOT1X_WIRED', index=22, number=23, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOT1X_WIRED_MACHINE', index=23, number=24, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DOT1X_WIRED_USER', index=24, number=25, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PUB_COOKIE', index=25, number=26, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TACACAS_PLUS', index=26, number=27, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WIRELESS_XSEC', index=27, number=28, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WIRELESS_XSEC_MACHINE', index=28, number=29, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WIRELESS_XSEC_USER', index=29, number=30, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WIRELESS_XSEC_WIRED', index=30, number=31, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WIRELESS_XSEC_WIRED_MACHINE', index=31, number=32, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WIRELESS_XSEC_WIRED_USER', index=32, number=33, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATEFUL_NTLM', index=33, number=34, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_AP', index=34, number=35, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='VIA_WEB', index=35, number=36, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='GENERIC_INTERFACE_SPEC', index=36, number=37, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TRANSPORT_VPN', index=37, number=38, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='VIA_VPN', index=38, number=39, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='NUM_AUTH_CLIENT', index=39, number=40, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=14373, serialized_end=15132, ) _sym_db.RegisterEnumDescriptor(_AUTHTYPE) AuthType = enum_type_wrapper.EnumTypeWrapper(_AUTHTYPE) ADD = 1 DELETE = 2 UPDATE = 3 UP = 1 DOWN = 2 PRIMARY = 0 BACKUP = 1 CA_CERT = 0 PSK = 1 STATE_CONTROLLER = 1 STATE_SWITCH = 2 STATE_SWARM = 3 STATE_AP = 4 STATE_VAP = 5 STATE_RADIO = 6 STATE_INTERFACE = 7 STATE_NETWORK = 8 STATE_TUNNEL = 9 STATE_WIRELESSCLIENT = 10 STATE_WIREDCLIENT = 11 STATE_UPLINK = 12 STAT_DEVICE = 13 STAT_RADIO = 14 STAT_VAP = 15 STAT_INTERFACE = 16 STAT_CLIENT = 17 STAT_TUNNEL = 18 STAT_MODEM = 19 STAT_ROLE = 20 STAT_VLAN = 21 STAT_SSID = 22 STAT_IPPROBE = 23 STAT_UPLINK = 24 STAT_UPLINKWAN = 25 STAT_UPLINKIPPROBE = 26 EVENTS_WIDS = 27 EVENTS_ROGUE = 28 STATS_UPLINK_SPEEDTEST = 29 DEVICE_NEIGHBOURS = 30 NOTIFICATIONS = 31 SWITCH_STACK = 32 STATE_IKE_TUNNEL = 33 SWITCH_VLAN = 34 NONE = 1 MAC_AUTH = 2 DOT1X_AUTH = 3 L3_AUTH = 4 CONSOLE_AUTH = 5 TELNET_AUTH = 6 WEBUI_AUTH = 7 SSH_AUTH = 8 WEB_AUTH = 9 SNMP_AUTH = 10 SSH_NONE_AUTH = 11 LMA_AUTH = 12 ANY_AUTH = 13 CAPTIVE_PORTAL = 14 VPN_AUTH = 15 STATEFUL_KERBEROS = 16 RADIUS_ACCOUNTING = 17 SECURE_ID = 18 STATEFUL_RADIUS = 19 SWITCH_MANAGEMENT = 20 DOT1X_MACHINE = 21 DOT1X_USER = 22 DOT1X_WIRED = 23 DOT1X_WIRED_MACHINE = 24 DOT1X_WIRED_USER = 25 PUB_COOKIE = 26 TACACAS_PLUS = 27 WIRELESS_XSEC = 28 WIRELESS_XSEC_MACHINE = 29 WIRELESS_XSEC_USER = 30 WIRELESS_XSEC_WIRED = 31 WIRELESS_XSEC_WIRED_MACHINE = 32 WIRELESS_XSEC_WIRED_USER = 33 STATEFUL_NTLM = 34 RAP_AP = 35 VIA_WEB = 36 GENERIC_INTERFACE_SPEC = 37 TRANSPORT_VPN = 38 VIA_VPN = 39 NUM_AUTH_CLIENT = 40 _IPADDRESS_ADDR_FAMILY = _descriptor.EnumDescriptor( name='addr_family', full_name='IpAddress.addr_family', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='ADDR_FAMILY_INET', index=0, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='ADDR_FAMILY_INET6', index=1, number=10, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=83, serialized_end=141, ) _sym_db.RegisterEnumDescriptor(_IPADDRESS_ADDR_FAMILY) _INTERFACE_DUPLEX = _descriptor.EnumDescriptor( name='Duplex', full_name='Interface.Duplex', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='HALF', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='FULL', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='AUTO', index=2, number=3, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1235, serialized_end=1273, ) _sym_db.RegisterEnumDescriptor(_INTERFACE_DUPLEX) _INTERFACE_INTFTYPE = _descriptor.EnumDescriptor( name='IntfType', full_name='Interface.IntfType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='ETHERNET', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='LOOPBACK', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='VLAN', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='TUNNEL', index=3, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PORT_CHANNEL', index=4, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STANDBY', index=5, number=6, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='BRIDGE', index=6, number=7, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SPLIT', index=7, number=8, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STACK', index=8, number=9, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='MGMT', index=9, number=10, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='NONE', index=10, number=11, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1276, serialized_end=1421, ) _sym_db.RegisterEnumDescriptor(_INTERFACE_INTFTYPE) _INTERFACE_SPEEDTYPE = _descriptor.EnumDescriptor( name='SpeedType', full_name='Interface.SpeedType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='SPEED_INVALID', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SPEED_AUTO', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SPEED_10', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SPEED_100', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SPEED_1000', index=4, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SPEED_10000', index=5, number=5, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1423, serialized_end=1531, ) _sym_db.RegisterEnumDescriptor(_INTERFACE_SPEEDTYPE) _INTERFACE_PORTTYPE = _descriptor.EnumDescriptor( name='PortType', full_name='Interface.PortType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='PT_RJ45', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PT_GBIC', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PT_SERIAL', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PT_USB', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PT_X2', index=4, number=4, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1533, serialized_end=1607, ) _sym_db.RegisterEnumDescriptor(_INTERFACE_PORTTYPE) _INTERFACE_POESUPPORT = _descriptor.EnumDescriptor( name='PoeSupport', full_name='Interface.PoeSupport', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='NA', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SUPPORTED', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='NOT_SUPPORTED', index=2, number=2, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1609, serialized_end=1663, ) _sym_db.RegisterEnumDescriptor(_INTERFACE_POESUPPORT) _AP_UPLINKTYPE = _descriptor.EnumDescriptor( name='UplinkType', full_name='Ap.UplinkType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='ETHERNET', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='MESH', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STATION', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='MODEM', index=3, number=4, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=2278, serialized_end=2338, ) _sym_db.RegisterEnumDescriptor(_AP_UPLINKTYPE) _HARDWAREMODULE_HARDWARESTATUS = _descriptor.EnumDescriptor( name='HardwareStatus', full_name='HardwareModule.HardwareStatus', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='OK', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='ERROR', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='NOT_CONNECTED', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='ACTIVE', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STANDBY', index=4, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='OFFLINE', index=5, number=5, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=2863, serialized_end=2955, ) _sym_db.RegisterEnumDescriptor(_HARDWAREMODULE_HARDWARESTATUS) _SWITCH_STACKMEMBERROLE = _descriptor.EnumDescriptor( name='StackMemberRole', full_name='Switch.StackMemberRole', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='COMMANDER', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STANDBY', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='MEMBER', index=3, number=4, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=3502, serialized_end=3572, ) _sym_db.RegisterEnumDescriptor(_SWITCH_STACKMEMBERROLE) _SWITCHSTACK_STACKTOPOLOGY = _descriptor.EnumDescriptor( name='StackTopology', full_name='SwitchStack.StackTopology', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='STANDALONE', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CHAIN', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RING', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='MESH', index=3, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='PARTIAL_MESH', index=4, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='UNKNOWN', index=5, number=6, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=3807, serialized_end=3900, ) _sym_db.RegisterEnumDescriptor(_SWITCHSTACK_STACKTOPOLOGY) _SWITCHSTACK_STACKPOLICY = _descriptor.EnumDescriptor( name='StackPolicy', full_name='SwitchStack.StackPolicy', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='STACK_SPLIT_UNKNOWN', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STACK_SPLIT_ONE_FRAGMENT_UP', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='STACK_SPLIT_ALL_FRAGMENTS_UP', index=2, number=2, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=3902, serialized_end=4007, ) _sym_db.RegisterEnumDescriptor(_SWITCHSTACK_STACKPOLICY) _WIDSEVENT_EVENTTYPE = _descriptor.EnumDescriptor( name='EventType', full_name='WIDSEvent.EventType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='ROGUE', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='INTERFERING', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='INFRASTRUCTURE_ATTACK', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='CLIENT_ATTACK', index=3, number=4, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=8509, serialized_end=8594, ) _sym_db.RegisterEnumDescriptor(_WIDSEVENT_EVENTTYPE) _WIDSEVENT_ATTACKTYPE = _descriptor.EnumDescriptor( name='AttackType', full_name='WIDSEvent.AttackType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='DETECT_VALID_SSID_MISUSE', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_ADHOC_NETWORK', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_AP_FLOOD', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_WIRELESS_BRIDGE', index=3, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_INVALID_MAC_OUI_AP', index=4, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_INVALID_MAC_OUI_STA', index=5, number=6, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_BAD_WEP', index=6, number=7, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_AP_IMPERSONATION', index=7, number=8, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_WINDOWS_BRIDGE', index=8, number=9, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_DEAUTH_BROADCAST_AP', index=9, number=10, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_DEAUTH_BROADCAST_STA', index=10, number=11, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_HT_GREENFIELD', index=11, number=12, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_HT_40MHZ_INTOLERANCE_AP', index=12, number=13, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_HT_40MHZ_INTOLERANCE_STA', index=13, number=14, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_CLIENT_FLOOD', index=14, number=15, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_ADHOC_USING_VALID_SSID', index=15, number=16, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_AP_SPOOFING', index=16, number=17, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_INVALID_ADDRESSCOMBINATION', index=17, number=18, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_MALFORMED_HTIE', index=18, number=19, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_MALFORMED_ASSOC_REQ', index=19, number=20, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_OVERFLOW_IE', index=20, number=21, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_OVERFLOW_EAPOL_KEY', index=21, number=22, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_MALFORMED_LARGE_DURATION', index=22, number=23, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_MALFORMED_FRAME_WRONG_CHANNEL', index=23, number=24, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_MALFORMED_FRAME_AUTH', index=24, number=25, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_CTS_RATE_ANOMALY', index=25, number=26, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_RTS_RATE_ANOMALY', index=26, number=27, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_DEAUTH_BROADCAST', index=27, number=28, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_DEASSOCIATION_BROADCAST', index=28, number=29, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_RATE_ANOMALIES_BY_AP', index=29, number=30, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_RATE_ANOMALIES_BY_STA', index=30, number=31, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_EAP_RATE_ANOMALY', index=31, number=32, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_DISCONNECT_STA', index=32, number=33, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_ASLEAP_FROM_AP', index=33, number=34, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_ASLEAP_FROM_STA', index=34, number=35, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_AIRJACK_FROM_AP', index=35, number=36, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='SIGNATURE_AIRJACK_FROM_STA', index=36, number=37, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_STATION_DISCONNECT_ATTACK_AP', index=37, number=38, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_UNENCRYPTED_VALID', index=38, number=39, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_OMERTA_ATTACK', index=39, number=40, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_TKIP_REPLAY_ATTACK', index=40, number=41, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_CHOPCHOP_ATTACK', index=41, number=42, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_FATAJACK', index=42, number=43, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_VALID_CLIENT_MISASSOCIATION', index=43, number=44, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_BLOCK_ACK_ATTACK', index=44, number=45, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_HOTSPOTTER_ATTACK', index=45, number=46, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='DETECT_POWER_SAVE_DOS_ATTACK', index=46, number=47, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=8597, serialized_end=10058, ) _sym_db.RegisterEnumDescriptor(_WIDSEVENT_ATTACKTYPE) _AIRMONITORROGUEINFO_WMS_RAP_MATCH_TYPE = _descriptor.EnumDescriptor( name='wms_rap_match_type', full_name='AirMonitorRogueInfo.wms_rap_match_type', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='RAP_MT_NONE', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_CFG_WM', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_ETH_WM', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_AP_WM', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_EXT_WM', index=4, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_MANUAL', index=5, number=5, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_BASE_BSSID', index=6, number=6, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_EMS', index=7, number=7, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_ETH_GW_WM', index=8, number=8, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_CLASS_OFF', index=9, number=9, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_AP_BSSID', index=10, number=10, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_PROP_ETH_WM', index=11, number=11, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_AP_RULE', index=12, number=12, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_SYSTEM_WM', index=13, number=13, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_MT_SYSTEM_GW_WM', index=14, number=14, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=10299, serialized_end=10625, ) _sym_db.RegisterEnumDescriptor(_AIRMONITORROGUEINFO_WMS_RAP_MATCH_TYPE) _AIRMONITORROGUEINFO_WMS_RAP_NAT_MATCH_TYPE = _descriptor.EnumDescriptor( name='wms_rap_nat_match_type', full_name='AirMonitorRogueInfo.wms_rap_nat_match_type', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='RAP_NMT_NONE', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_NMT_EQUAL', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_NMT_PLUS_ONE', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_NMT_MINUS_ONE', index=3, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='RAP_NMT_OUI', index=4, number=4, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=10627, serialized_end=10750, ) _sym_db.RegisterEnumDescriptor(_AIRMONITORROGUEINFO_WMS_RAP_NAT_MATCH_TYPE) _ROGUEEVENT_WMS_SNMP_ENCR_PROTOCOL = _descriptor.EnumDescriptor( name='wms_snmp_encr_protocol', full_name='RogueEvent.wms_snmp_encr_protocol', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='WMS_SNMP_WPA_ENCR_OPEN', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WMS_SNMP_WPA_ENCR_WEP', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WMS_SNMP_WPA_ENCR_WPA', index=2, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='WMS_SNMP_WPA_ENCR_WPA2', index=3, number=3, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=10978, serialized_end=11112, ) _sym_db.RegisterEnumDescriptor(_ROGUEEVENT_WMS_SNMP_ENCR_PROTOCOL) _NOTIFICATION_SEVERITY = _descriptor.EnumDescriptor( name='Severity', full_name='Notification.Severity', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='Normal', index=0, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='Warning', index=1, number=2, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='Minor', index=2, number=3, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='Major', index=3, number=4, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='Critical', index=4, number=5, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13312, serialized_end=13383, ) _sym_db.RegisterEnumDescriptor(_NOTIFICATION_SEVERITY) _NOTIFICATION_NOTIFICATIONSTATE = _descriptor.EnumDescriptor( name='NotificationState', full_name='Notification.NotificationState', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='Open', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='Close', index=1, number=1, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=13385, serialized_end=13425, ) _sym_db.RegisterEnumDescriptor(_NOTIFICATION_NOTIFICATIONSTATE) _IPADDRESS = _descriptor.Descriptor( name='IpAddress', full_name='IpAddress', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='af', full_name='IpAddress.af', index=0, number=1, type=14, cpp_type=8, label=2, has_default_value=False, default_value=2, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='addr', full_name='IpAddress.addr', index=1, number=2, type=12, cpp_type=9, label=2, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _IPADDRESS_ADDR_FAMILY, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=20, serialized_end=141, ) _MACADDRESS = _descriptor.Descriptor( name='MacAddress', full_name='MacAddress', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='addr', full_name='MacAddress.addr', index=0, number=1, type=12, cpp_type=9, label=2, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=143, serialized_end=169, ) _SWARM = _descriptor.Descriptor( name='Swarm', full_name='Swarm', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Swarm.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='swarm_id', full_name='Swarm.swarm_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='Swarm.name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Swarm.status', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='public_ip_address', full_name='Swarm.public_ip_address', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='Swarm.ip_address', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='firmware_version', full_name='Swarm.firmware_version', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=172, serialized_end=370, ) _TUNNEL = _descriptor.Descriptor( name='Tunnel', full_name='Tunnel', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Tunnel.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='swarm_id', full_name='Tunnel.swarm_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='index', full_name='Tunnel.index', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='crypto_type', full_name='Tunnel.crypto_type', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='peer_name', full_name='Tunnel.peer_name', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='peer_tun_ip', full_name='Tunnel.peer_tun_ip', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnel_ip', full_name='Tunnel.tunnel_ip', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Tunnel.status', index=7, number=8, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='active', full_name='Tunnel.active', index=8, number=9, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uptime', full_name='Tunnel.uptime', index=9, number=10, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=373, serialized_end=639, ) _INTERFACE = _descriptor.Descriptor( name='Interface', full_name='Interface', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Interface.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='Interface.device_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='Interface.macaddr', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Interface.status', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ipaddr', full_name='Interface.ipaddr', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='duplex_mode', full_name='Interface.duplex_mode', index=5, number=6, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='Interface.name', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='port_number', full_name='Interface.port_number', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='type', full_name='Interface.type', index=8, number=9, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mode', full_name='Interface.mode', index=9, number=10, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='Interface.vlan', index=10, number=11, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='has_poe', full_name='Interface.has_poe', index=11, number=12, type=14, cpp_type=8, label=1, has_default_value=True, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='poe_state', full_name='Interface.poe_state', index=12, number=13, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='oper_state', full_name='Interface.oper_state', index=13, number=14, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='admin_state', full_name='Interface.admin_state', index=14, number=15, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='speed', full_name='Interface.speed', index=15, number=16, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mux', full_name='Interface.mux', index=16, number=17, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='trusted', full_name='Interface.trusted', index=17, number=18, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='slot', full_name='Interface.slot', index=18, number=19, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='phy_type', full_name='Interface.phy_type', index=19, number=20, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sub_type', full_name='Interface.sub_type', index=20, number=21, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='allowed_vlan', full_name='Interface.allowed_vlan', index=21, number=22, type=13, cpp_type=3, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _INTERFACE_DUPLEX, _INTERFACE_INTFTYPE, _INTERFACE_SPEEDTYPE, _INTERFACE_PORTTYPE, _INTERFACE_POESUPPORT, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=642, serialized_end=1663, ) _VAPINFO = _descriptor.Descriptor( name='VapInfo', full_name='VapInfo', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='VapInfo.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='VapInfo.device_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radio_mac', full_name='VapInfo.radio_mac', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='essid', full_name='VapInfo.essid', index=3, number=4, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1665, serialized_end=1773, ) _RADIO = _descriptor.Descriptor( name='Radio', full_name='Radio', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Radio.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='Radio.device_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='index', full_name='Radio.index', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='Radio.macaddr', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Radio.status', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='channel', full_name='Radio.channel', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='band', full_name='Radio.band', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='channel_width', full_name='Radio.channel_width', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1776, serialized_end=1963, ) _AP = _descriptor.Descriptor( name='Ap', full_name='Ap', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Ap.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serial', full_name='Ap.serial', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='Ap.name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='Ap.macaddr', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cluster_id', full_name='Ap.cluster_id', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Ap.status', index=5, number=6, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='Ap.ip_address', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model', full_name='Ap.model', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mesh_role', full_name='Ap.mesh_role', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mode', full_name='Ap.mode', index=9, number=10, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='swarm_master', full_name='Ap.swarm_master', index=10, number=11, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='modem_connected', full_name='Ap.modem_connected', index=11, number=12, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplink_type', full_name='Ap.uplink_type', index=12, number=13, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _AP_UPLINKTYPE, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1966, serialized_end=2338, ) _NETWORK = _descriptor.Descriptor( name='Network', full_name='Network', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Network.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='swarm_id', full_name='Network.swarm_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='essid', full_name='Network.essid', index=2, number=3, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='security', full_name='Network.security', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='type', full_name='Network.type', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2340, serialized_end=2447, ) _WIRELESSCLIENT = _descriptor.Descriptor( name='WirelessClient', full_name='WirelessClient', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='WirelessClient.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='WirelessClient.macaddr', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='WirelessClient.name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='WirelessClient.ip_address', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='username', full_name='WirelessClient.username', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='associated_device', full_name='WirelessClient.associated_device', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radio_mac', full_name='WirelessClient.radio_mac', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='network', full_name='WirelessClient.network', index=7, number=8, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='user_role', full_name='WirelessClient.user_role', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='manufacturer', full_name='WirelessClient.manufacturer', index=9, number=10, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='os_type', full_name='WirelessClient.os_type', index=10, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='connection', full_name='WirelessClient.connection', index=11, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='maxspeed', full_name='WirelessClient.maxspeed', index=12, number=13, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='WirelessClient.vlan', index=13, number=14, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2450, serialized_end=2779, ) _HARDWAREMODULE = _descriptor.Descriptor( name='HardwareModule', full_name='HardwareModule', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='index', full_name='HardwareModule.index', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='HardwareModule.status', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _HARDWAREMODULE_HARDWARESTATUS, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2782, serialized_end=2955, ) _SWITCH = _descriptor.Descriptor( name='Switch', full_name='Switch', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Switch.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serial', full_name='Switch.serial', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='Switch.name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='Switch.macaddr', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model', full_name='Switch.model', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Switch.status', index=5, number=6, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='public_ip_address', full_name='Switch.public_ip_address', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='Switch.ip_address', index=7, number=8, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='firmware_version', full_name='Switch.firmware_version', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_gateway', full_name='Switch.default_gateway', index=9, number=10, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_mode', full_name='Switch.device_mode', index=10, number=11, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplink_ports', full_name='Switch.uplink_ports', index=11, number=12, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_slots', full_name='Switch.max_slots', index=12, number=13, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='used_slots', full_name='Switch.used_slots', index=13, number=14, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='management_modules', full_name='Switch.management_modules', index=14, number=15, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='power_supplies', full_name='Switch.power_supplies', index=15, number=16, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stack_id', full_name='Switch.stack_id', index=16, number=17, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stack_member_id', full_name='Switch.stack_member_id', index=17, number=18, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stack_member_role', full_name='Switch.stack_member_role', index=18, number=19, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _SWITCH_STACKMEMBERROLE, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2958, serialized_end=3572, ) _SWITCHSTACK = _descriptor.Descriptor( name='SwitchStack', full_name='SwitchStack', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='SwitchStack.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stack_id', full_name='SwitchStack.stack_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='SwitchStack.status', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='topology', full_name='SwitchStack.topology', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='policy', full_name='SwitchStack.policy', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='firmware_version', full_name='SwitchStack.firmware_version', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vsf_domain_id', full_name='SwitchStack.vsf_domain_id', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _SWITCHSTACK_STACKTOPOLOGY, _SWITCHSTACK_STACKPOLICY, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3575, serialized_end=4007, ) _WIREDCLIENT = _descriptor.Descriptor( name='WiredClient', full_name='WiredClient', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='WiredClient.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='WiredClient.macaddr', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='WiredClient.name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='WiredClient.ip_address', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='username', full_name='WiredClient.username', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='associated_device', full_name='WiredClient.associated_device', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='interface_mac', full_name='WiredClient.interface_mac', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='user_role', full_name='WiredClient.user_role', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='WiredClient.vlan', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='auth_type', full_name='WiredClient.auth_type', index=9, number=10, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4010, serialized_end=4276, ) _MOBILITYCONTROLLER = _descriptor.Descriptor( name='MobilityController', full_name='MobilityController', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='MobilityController.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serial', full_name='MobilityController.serial', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='MobilityController.name', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='MobilityController.macaddr', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='model', full_name='MobilityController.model', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='MobilityController.status', index=5, number=6, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='public_ip_address', full_name='MobilityController.public_ip_address', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='MobilityController.ip_address', index=7, number=8, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='firmware_version', full_name='MobilityController.firmware_version', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_gateway', full_name='MobilityController.default_gateway', index=9, number=10, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4279, serialized_end=4570, ) _UPLINK = _descriptor.Descriptor( name='Uplink', full_name='Uplink', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='Uplink.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='Uplink.device_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='link_index', full_name='Uplink.link_index', index=2, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='Uplink.name', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='description', full_name='Uplink.description', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='priority', full_name='Uplink.priority', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='Uplink.status', index=6, number=7, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wan_status', full_name='Uplink.wan_status', index=7, number=8, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='Uplink.vlan', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan_description', full_name='Uplink.vlan_description', index=9, number=10, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4573, serialized_end=4800, ) _IKETUNNEL = _descriptor.Descriptor( name='IkeTunnel', full_name='IkeTunnel', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='IkeTunnel.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='IkeTunnel.device_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='map_id', full_name='IkeTunnel.map_id', index=2, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='peer_mac', full_name='IkeTunnel.peer_mac', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='local_mac', full_name='IkeTunnel.local_mac', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='src_ip', full_name='IkeTunnel.src_ip', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dst_ip', full_name='IkeTunnel.dst_ip', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='IkeTunnel.status', index=7, number=8, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='map_name', full_name='IkeTunnel.map_name', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4803, serialized_end=5044, ) _DEVICESTATS = _descriptor.Descriptor( name='DeviceStats', full_name='DeviceStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='DeviceStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='DeviceStats.timestamp', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uptime', full_name='DeviceStats.uptime', index=2, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='cpu_utilization', full_name='DeviceStats.cpu_utilization', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mem_total', full_name='DeviceStats.mem_total', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mem_free', full_name='DeviceStats.mem_free', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='power_consumption', full_name='DeviceStats.power_consumption', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fan_speed', full_name='DeviceStats.fan_speed', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='temperature', full_name='DeviceStats.temperature', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='fan_status', full_name='DeviceStats.fan_status', index=9, number=10, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_power', full_name='DeviceStats.max_power', index=10, number=11, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='poe_consumption', full_name='DeviceStats.poe_consumption', index=11, number=12, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='poe_budget', full_name='DeviceStats.poe_budget', index=12, number=13, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mem_utilization', full_name='DeviceStats.mem_utilization', index=13, number=14, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5047, serialized_end=5361, ) _RADIOSTATS = _descriptor.Descriptor( name='RadioStats', full_name='RadioStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='RadioStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='RadioStats.macaddr', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='RadioStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='RadioStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='RadioStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_drops', full_name='RadioStats.tx_drops', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_power', full_name='RadioStats.tx_power', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='noise_floor', full_name='RadioStats.noise_floor', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='utilization', full_name='RadioStats.utilization', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bad', full_name='RadioStats.rx_bad', index=9, number=10, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5364, serialized_end=5574, ) _VAPSTATS = _descriptor.Descriptor( name='VapStats', full_name='VapStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='VapStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radio_mac', full_name='VapStats.radio_mac', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='network', full_name='VapStats.network', index=2, number=3, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='VapStats.timestamp', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='VapStats.tx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='VapStats.rx_bytes', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5577, serialized_end=5710, ) _TUNNELSTATS = _descriptor.Descriptor( name='TunnelStats', full_name='TunnelStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='swarm_id', full_name='TunnelStats.swarm_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='index', full_name='TunnelStats.index', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='TunnelStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='TunnelStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='TunnelStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5712, serialized_end=5827, ) _CLIENTSTATS = _descriptor.Descriptor( name='ClientStats', full_name='ClientStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='ClientStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='ClientStats.macaddr', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='ClientStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='ClientStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='ClientStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_retries', full_name='ClientStats.rx_retries', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_retries', full_name='ClientStats.tx_retries', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='speed', full_name='ClientStats.speed', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='signal_in_db', full_name='ClientStats.signal_in_db', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='snr', full_name='ClientStats.snr', index=9, number=10, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5830, serialized_end=6037, ) _INTERFACESTATS = _descriptor.Descriptor( name='InterfaceStats', full_name='InterfaceStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='InterfaceStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='InterfaceStats.macaddr', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='InterfaceStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='InterfaceStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='InterfaceStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='power_consumption', full_name='InterfaceStats.power_consumption', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_errors', full_name='InterfaceStats.in_errors', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_errors', full_name='InterfaceStats.out_errors', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_discards', full_name='InterfaceStats.in_discards', index=8, number=9, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_discards', full_name='InterfaceStats.out_discards', index=9, number=10, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_packets', full_name='InterfaceStats.in_packets', index=10, number=11, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_packets', full_name='InterfaceStats.out_packets', index=11, number=12, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_other_err', full_name='InterfaceStats.in_other_err', index=12, number=13, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_multicast_pkt', full_name='InterfaceStats.in_multicast_pkt', index=13, number=14, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_broadcast_pkt', full_name='InterfaceStats.in_broadcast_pkt', index=14, number=15, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_unicast_pkt', full_name='InterfaceStats.in_unicast_pkt', index=15, number=16, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_multicast_pkt', full_name='InterfaceStats.out_multicast_pkt', index=16, number=17, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_broadcast_pkt', full_name='InterfaceStats.out_broadcast_pkt', index=17, number=18, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_unicast_pkt', full_name='InterfaceStats.out_unicast_pkt', index=18, number=19, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_fcs', full_name='InterfaceStats.in_fcs', index=19, number=20, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_alignment', full_name='InterfaceStats.in_alignment', index=20, number=21, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_excessive_collision', full_name='InterfaceStats.out_excessive_collision', index=21, number=22, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_jabbers', full_name='InterfaceStats.in_jabbers', index=22, number=23, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_fragmented', full_name='InterfaceStats.in_fragmented', index=23, number=24, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_giant', full_name='InterfaceStats.in_giant', index=24, number=25, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='in_runt', full_name='InterfaceStats.in_runt', index=25, number=26, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_collision', full_name='InterfaceStats.out_collision', index=26, number=27, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_late_collision', full_name='InterfaceStats.out_late_collision', index=27, number=28, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='out_deferred', full_name='InterfaceStats.out_deferred', index=28, number=29, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6040, serialized_end=6709, ) _UPLINKSTATS = _descriptor.Descriptor( name='UplinkStats', full_name='UplinkStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='UplinkStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='link_id', full_name='UplinkStats.link_id', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='UplinkStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='UplinkStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='UplinkStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnel_tx_bytes', full_name='UplinkStats.tunnel_tx_bytes', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnel_rx_bytes', full_name='UplinkStats.tunnel_rx_bytes', index=6, number=7, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='map_id', full_name='UplinkStats.map_id', index=7, number=8, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='map_name', full_name='UplinkStats.map_name', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6712, serialized_end=6900, ) _UPLINKWANSTATS = _descriptor.Descriptor( name='UplinkWanStats', full_name='UplinkWanStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='UplinkWanStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='link_id', full_name='UplinkWanStats.link_id', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='UplinkWanStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='compressed_bytes', full_name='UplinkWanStats.compressed_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uncompressed_bytes', full_name='UplinkWanStats.uncompressed_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='savings_bytes', full_name='UplinkWanStats.savings_bytes', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=6903, serialized_end=7051, ) _MODEMSTATS = _descriptor.Descriptor( name='ModemStats', full_name='ModemStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='ModemStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='ModemStats.timestamp', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='ModemStats.tx_bytes', index=2, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='ModemStats.rx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7053, serialized_end=7139, ) _ROLESTATS = _descriptor.Descriptor( name='RoleStats', full_name='RoleStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='RoleStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='user_role', full_name='RoleStats.user_role', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='RoleStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='RoleStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='RoleStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7141, serialized_end=7245, ) _VLANSTATS = _descriptor.Descriptor( name='VlanStats', full_name='VlanStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='VlanStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='VlanStats.vlan', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='VlanStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='VlanStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='VlanStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7247, serialized_end=7346, ) _SSIDSTATS = _descriptor.Descriptor( name='SsidStats', full_name='SsidStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='SsidStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='essid', full_name='SsidStats.essid', index=1, number=2, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='SsidStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tx_bytes', full_name='SsidStats.tx_bytes', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rx_bytes', full_name='SsidStats.rx_bytes', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7348, serialized_end=7448, ) _TUNNELIPPROBESTATS = _descriptor.Descriptor( name='TunnelIpProbeStats', full_name='TunnelIpProbeStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='TunnelIpProbeStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnel_index', full_name='TunnelIpProbeStats.tunnel_index', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='probe_ip_addr', full_name='TunnelIpProbeStats.probe_ip_addr', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='probe_status', full_name='TunnelIpProbeStats.probe_status', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_probe_pkt_loss_pct', full_name='TunnelIpProbeStats.ip_probe_pkt_loss_pct', index=4, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnel_name', full_name='TunnelIpProbeStats.tunnel_name', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7451, serialized_end=7635, ) _UPLINKIPPROBESTATS = _descriptor.Descriptor( name='UplinkIpProbeStats', full_name='UplinkIpProbeStats', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='UplinkIpProbeStats.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='link_id', full_name='UplinkIpProbeStats.link_id', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='UplinkIpProbeStats.timestamp', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ip_address', full_name='UplinkIpProbeStats.ip_address', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='UplinkIpProbeStats.vlan', index=4, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='avg_rtt', full_name='UplinkIpProbeStats.avg_rtt', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_rtt', full_name='UplinkIpProbeStats.max_rtt', index=6, number=7, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='min_rtt', full_name='UplinkIpProbeStats.min_rtt', index=7, number=8, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='avg_jitter', full_name='UplinkIpProbeStats.avg_jitter', index=8, number=9, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='max_jitter', full_name='UplinkIpProbeStats.max_jitter', index=9, number=10, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='min_jitter', full_name='UplinkIpProbeStats.min_jitter', index=10, number=11, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mos_quality', full_name='UplinkIpProbeStats.mos_quality', index=11, number=12, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sd_avg_latency', full_name='UplinkIpProbeStats.sd_avg_latency', index=12, number=13, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ds_avg_latency', full_name='UplinkIpProbeStats.ds_avg_latency', index=13, number=14, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='sd_avg_jitter', full_name='UplinkIpProbeStats.sd_avg_jitter', index=14, number=15, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ds_avg_jitter', full_name='UplinkIpProbeStats.ds_avg_jitter', index=15, number=16, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='probe_status', full_name='UplinkIpProbeStats.probe_status', index=16, number=17, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='loss_pct', full_name='UplinkIpProbeStats.loss_pct', index=17, number=18, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vpnc_ip_addr', full_name='UplinkIpProbeStats.vpnc_ip_addr', index=18, number=19, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='probe_ip_addr', full_name='UplinkIpProbeStats.probe_ip_addr', index=19, number=20, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=7638, serialized_end=8070, ) _UPLINKSPEEDTEST = _descriptor.Descriptor( name='UplinkSpeedtest', full_name='UplinkSpeedtest', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='UplinkSpeedtest.device_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='server_ip', full_name='UplinkSpeedtest.server_ip', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan', full_name='UplinkSpeedtest.vlan', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='protocol', full_name='UplinkSpeedtest.protocol', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='upstream_bps', full_name='UplinkSpeedtest.upstream_bps', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='downstream_bps', full_name='UplinkSpeedtest.downstream_bps', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='time_secs', full_name='UplinkSpeedtest.time_secs', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='upstream_jitter', full_name='UplinkSpeedtest.upstream_jitter', index=7, number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='downstream_jitter', full_name='UplinkSpeedtest.downstream_jitter', index=8, number=9, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8073, serialized_end=8289, ) _WIDSEVENT = _descriptor.Descriptor( name='WIDSEvent', full_name='WIDSEvent', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='WIDSEvent.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='event_type', full_name='WIDSEvent.event_type', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='WIDSEvent.macaddr', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='detected_ap', full_name='WIDSEvent.detected_ap', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='attack_type', full_name='WIDSEvent.attack_type', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='channel', full_name='WIDSEvent.channel', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='network', full_name='WIDSEvent.network', index=6, number=7, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _WIDSEVENT_EVENTTYPE, _WIDSEVENT_ATTACKTYPE, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=8292, serialized_end=10058, ) _AIRMONITORROGUEINFO = _descriptor.Descriptor( name='AirMonitorRogueInfo', full_name='AirMonitorRogueInfo', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='match_type', full_name='AirMonitorRogueInfo.match_type', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='match_mac', full_name='AirMonitorRogueInfo.match_mac', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='match_ip', full_name='AirMonitorRogueInfo.match_ip', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='monitor_name', full_name='AirMonitorRogueInfo.monitor_name', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='nat_match_type', full_name='AirMonitorRogueInfo.nat_match_type', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _AIRMONITORROGUEINFO_WMS_RAP_MATCH_TYPE, _AIRMONITORROGUEINFO_WMS_RAP_NAT_MATCH_TYPE, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10061, serialized_end=10750, ) _ROGUEEVENT = _descriptor.Descriptor( name='RogueEvent', full_name='RogueEvent', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='RogueEvent.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='detected_ap', full_name='RogueEvent.detected_ap', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='macaddr', full_name='RogueEvent.macaddr', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='channel', full_name='RogueEvent.channel', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='network', full_name='RogueEvent.network', index=4, number=5, type=12, cpp_type=9, label=1, has_default_value=False, default_value=_b(""), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='encr_type', full_name='RogueEvent.encr_type', index=5, number=6, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='am_rogue', full_name='RogueEvent.am_rogue', index=6, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _ROGUEEVENT_WMS_SNMP_ENCR_PROTOCOL, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=10753, serialized_end=11112, ) _DEVICENEIGHBOURS = _descriptor.Descriptor( name='DeviceNeighbours', full_name='DeviceNeighbours', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='action', full_name='DeviceNeighbours.action', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=True, default_value=3, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='DeviceNeighbours.device_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='port', full_name='DeviceNeighbours.port', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='remote_device_id', full_name='DeviceNeighbours.remote_device_id', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='remote_port', full_name='DeviceNeighbours.remote_port', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='remote_port_number', full_name='DeviceNeighbours.remote_port_number', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11115, serialized_end=11274, ) _MONITORINGINFORMATION = _descriptor.Descriptor( name='MonitoringInformation', full_name='MonitoringInformation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='customer_id', full_name='MonitoringInformation.customer_id', index=0, number=1, type=9, cpp_type=9, label=2, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='data_elements', full_name='MonitoringInformation.data_elements', index=1, number=2, type=14, cpp_type=8, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='swarms', full_name='MonitoringInformation.swarms', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='aps', full_name='MonitoringInformation.aps', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='networks', full_name='MonitoringInformation.networks', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radios', full_name='MonitoringInformation.radios', index=5, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vaps', full_name='MonitoringInformation.vaps', index=6, number=7, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='interfaces', full_name='MonitoringInformation.interfaces', index=7, number=8, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnels', full_name='MonitoringInformation.tunnels', index=8, number=9, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wireless_clients', full_name='MonitoringInformation.wireless_clients', index=9, number=10, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='switches', full_name='MonitoringInformation.switches', index=10, number=11, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wired_clients', full_name='MonitoringInformation.wired_clients', index=11, number=12, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_stats', full_name='MonitoringInformation.device_stats', index=12, number=13, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radio_stats', full_name='MonitoringInformation.radio_stats', index=13, number=14, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='interface_stats', full_name='MonitoringInformation.interface_stats', index=14, number=15, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vap_stats', full_name='MonitoringInformation.vap_stats', index=15, number=16, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='client_stats', full_name='MonitoringInformation.client_stats', index=16, number=17, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnel_stats', full_name='MonitoringInformation.tunnel_stats', index=17, number=18, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wids_events', full_name='MonitoringInformation.wids_events', index=18, number=19, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='modem_stats', full_name='MonitoringInformation.modem_stats', index=19, number=20, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='role_stats', full_name='MonitoringInformation.role_stats', index=20, number=21, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlan_stats', full_name='MonitoringInformation.vlan_stats', index=21, number=22, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ssid_stats', full_name='MonitoringInformation.ssid_stats', index=22, number=23, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ipprobe_stats', full_name='MonitoringInformation.ipprobe_stats', index=23, number=24, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='rogue_events', full_name='MonitoringInformation.rogue_events', index=24, number=25, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mobility_controllers', full_name='MonitoringInformation.mobility_controllers', index=25, number=26, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplinks', full_name='MonitoringInformation.uplinks', index=26, number=27, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplink_stats', full_name='MonitoringInformation.uplink_stats', index=27, number=28, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplink_wan_stats', full_name='MonitoringInformation.uplink_wan_stats', index=28, number=29, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplink_probe_stats', full_name='MonitoringInformation.uplink_probe_stats', index=29, number=30, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplink_speedtest', full_name='MonitoringInformation.uplink_speedtest', index=30, number=31, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_neighbours', full_name='MonitoringInformation.device_neighbours', index=31, number=32, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='notification', full_name='MonitoringInformation.notification', index=32, number=33, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='switch_stacks', full_name='MonitoringInformation.switch_stacks', index=33, number=34, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ike_tunnels', full_name='MonitoringInformation.ike_tunnels', index=34, number=35, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='switch_vlan_info', full_name='MonitoringInformation.switch_vlan_info', index=35, number=36, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=11277, serialized_end=12542, ) _MONITORINGSTATEINFORMATION = _descriptor.Descriptor( name='MonitoringStateInformation', full_name='MonitoringStateInformation', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='customer_id', full_name='MonitoringStateInformation.customer_id', index=0, number=1, type=9, cpp_type=9, label=2, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='mobility_controllers', full_name='MonitoringStateInformation.mobility_controllers', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='switches', full_name='MonitoringStateInformation.switches', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='swarms', full_name='MonitoringStateInformation.swarms', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='aps', full_name='MonitoringStateInformation.aps', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vaps', full_name='MonitoringStateInformation.vaps', index=5, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='radios', full_name='MonitoringStateInformation.radios', index=6, number=7, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='interfaces', full_name='MonitoringStateInformation.interfaces', index=7, number=8, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='networks', full_name='MonitoringStateInformation.networks', index=8, number=9, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tunnels', full_name='MonitoringStateInformation.tunnels', index=9, number=10, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wireless_clients', full_name='MonitoringStateInformation.wireless_clients', index=10, number=11, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='wired_clients', full_name='MonitoringStateInformation.wired_clients', index=11, number=12, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='uplinks', full_name='MonitoringStateInformation.uplinks', index=12, number=13, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='switch_stacks', full_name='MonitoringStateInformation.switch_stacks', index=13, number=14, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ike_tunnels', full_name='MonitoringStateInformation.ike_tunnels', index=14, number=15, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=12545, serialized_end=13024, ) _KEYVALUEDATA = _descriptor.Descriptor( name='KeyValueData', full_name='KeyValueData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='KeyValueData.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='KeyValueData.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13026, serialized_end=13068, ) _NOTIFICATION = _descriptor.Descriptor( name='Notification', full_name='Notification', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='id', full_name='Notification.id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='type', full_name='Notification.type', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='setting_id', full_name='Notification.setting_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='Notification.device_id', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='severity', full_name='Notification.severity', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='Notification.timestamp', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='state', full_name='Notification.state', index=6, number=7, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='description', full_name='Notification.description', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='extra', full_name='Notification.extra', index=8, number=9, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _NOTIFICATION_SEVERITY, _NOTIFICATION_NOTIFICATIONSTATE, ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13071, serialized_end=13425, ) _SWITCHVLANINFO = _descriptor.Descriptor( name='SwitchVlanInfo', full_name='SwitchVlanInfo', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='SwitchVlanInfo.device_id', index=0, number=1, type=9, cpp_type=9, label=2, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='vlans', full_name='SwitchVlanInfo.vlans', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13427, serialized_end=13490, ) _SWITCHVLAN = _descriptor.Descriptor( name='SwitchVlan', full_name='SwitchVlan', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='id', full_name='SwitchVlan.id', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='name', full_name='SwitchVlan.name', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='tagged_ports', full_name='SwitchVlan.tagged_ports', index=2, number=3, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='untagged_ports', full_name='SwitchVlan.untagged_ports', index=3, number=4, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=13492, serialized_end=13576, ) _IPADDRESS.fields_by_name['af'].enum_type = _IPADDRESS_ADDR_FAMILY _IPADDRESS_ADDR_FAMILY.containing_type = _IPADDRESS _SWARM.fields_by_name['action'].enum_type = _ACTION _SWARM.fields_by_name['status'].enum_type = _STATUS _SWARM.fields_by_name['public_ip_address'].message_type = _IPADDRESS _SWARM.fields_by_name['ip_address'].message_type = _IPADDRESS _TUNNEL.fields_by_name['action'].enum_type = _ACTION _TUNNEL.fields_by_name['index'].enum_type = _TUNNELINDEX _TUNNEL.fields_by_name['crypto_type'].enum_type = _CRYPTOTYPE _TUNNEL.fields_by_name['peer_tun_ip'].message_type = _IPADDRESS _TUNNEL.fields_by_name['tunnel_ip'].message_type = _IPADDRESS _TUNNEL.fields_by_name['status'].enum_type = _STATUS _INTERFACE.fields_by_name['action'].enum_type = _ACTION _INTERFACE.fields_by_name['macaddr'].message_type = _MACADDRESS _INTERFACE.fields_by_name['status'].enum_type = _STATUS _INTERFACE.fields_by_name['ipaddr'].message_type = _IPADDRESS _INTERFACE.fields_by_name['duplex_mode'].enum_type = _INTERFACE_DUPLEX _INTERFACE.fields_by_name['type'].enum_type = _INTERFACE_INTFTYPE _INTERFACE.fields_by_name['has_poe'].enum_type = _INTERFACE_POESUPPORT _INTERFACE.fields_by_name['poe_state'].enum_type = _STATUS _INTERFACE.fields_by_name['oper_state'].enum_type = _STATUS _INTERFACE.fields_by_name['admin_state'].enum_type = _STATUS _INTERFACE.fields_by_name['speed'].enum_type = _INTERFACE_SPEEDTYPE _INTERFACE.fields_by_name['phy_type'].enum_type = _INTERFACE_PORTTYPE _INTERFACE_DUPLEX.containing_type = _INTERFACE _INTERFACE_INTFTYPE.containing_type = _INTERFACE _INTERFACE_SPEEDTYPE.containing_type = _INTERFACE _INTERFACE_PORTTYPE.containing_type = _INTERFACE _INTERFACE_POESUPPORT.containing_type = _INTERFACE _VAPINFO.fields_by_name['action'].enum_type = _ACTION _VAPINFO.fields_by_name['radio_mac'].message_type = _MACADDRESS _RADIO.fields_by_name['action'].enum_type = _ACTION _RADIO.fields_by_name['macaddr'].message_type = _MACADDRESS _RADIO.fields_by_name['status'].enum_type = _STATUS _AP.fields_by_name['action'].enum_type = _ACTION _AP.fields_by_name['macaddr'].message_type = _MACADDRESS _AP.fields_by_name['status'].enum_type = _STATUS _AP.fields_by_name['ip_address'].message_type = _IPADDRESS _AP.fields_by_name['uplink_type'].enum_type = _AP_UPLINKTYPE _AP_UPLINKTYPE.containing_type = _AP _NETWORK.fields_by_name['action'].enum_type = _ACTION _WIRELESSCLIENT.fields_by_name['action'].enum_type = _ACTION _WIRELESSCLIENT.fields_by_name['macaddr'].message_type = _MACADDRESS _WIRELESSCLIENT.fields_by_name['ip_address'].message_type = _IPADDRESS _WIRELESSCLIENT.fields_by_name['radio_mac'].message_type = _MACADDRESS _HARDWAREMODULE.fields_by_name['status'].enum_type = _HARDWAREMODULE_HARDWARESTATUS _HARDWAREMODULE_HARDWARESTATUS.containing_type = _HARDWAREMODULE _SWITCH.fields_by_name['action'].enum_type = _ACTION _SWITCH.fields_by_name['macaddr'].message_type = _MACADDRESS _SWITCH.fields_by_name['status'].enum_type = _STATUS _SWITCH.fields_by_name['public_ip_address'].message_type = _IPADDRESS _SWITCH.fields_by_name['ip_address'].message_type = _IPADDRESS _SWITCH.fields_by_name['default_gateway'].message_type = _IPADDRESS _SWITCH.fields_by_name['management_modules'].message_type = _HARDWAREMODULE _SWITCH.fields_by_name['power_supplies'].message_type = _HARDWAREMODULE _SWITCH.fields_by_name['stack_member_role'].enum_type = _SWITCH_STACKMEMBERROLE _SWITCH_STACKMEMBERROLE.containing_type = _SWITCH _SWITCHSTACK.fields_by_name['action'].enum_type = _ACTION _SWITCHSTACK.fields_by_name['status'].enum_type = _STATUS _SWITCHSTACK.fields_by_name['topology'].enum_type = _SWITCHSTACK_STACKTOPOLOGY _SWITCHSTACK.fields_by_name['policy'].enum_type = _SWITCHSTACK_STACKPOLICY _SWITCHSTACK_STACKTOPOLOGY.containing_type = _SWITCHSTACK _SWITCHSTACK_STACKPOLICY.containing_type = _SWITCHSTACK _WIREDCLIENT.fields_by_name['action'].enum_type = _ACTION _WIREDCLIENT.fields_by_name['macaddr'].message_type = _MACADDRESS _WIREDCLIENT.fields_by_name['ip_address'].message_type = _IPADDRESS _WIREDCLIENT.fields_by_name['interface_mac'].message_type = _MACADDRESS _WIREDCLIENT.fields_by_name['auth_type'].enum_type = _AUTHTYPE _MOBILITYCONTROLLER.fields_by_name['action'].enum_type = _ACTION _MOBILITYCONTROLLER.fields_by_name['macaddr'].message_type = _MACADDRESS _MOBILITYCONTROLLER.fields_by_name['status'].enum_type = _STATUS _MOBILITYCONTROLLER.fields_by_name['public_ip_address'].message_type = _IPADDRESS _MOBILITYCONTROLLER.fields_by_name['ip_address'].message_type = _IPADDRESS _MOBILITYCONTROLLER.fields_by_name['default_gateway'].message_type = _IPADDRESS _UPLINK.fields_by_name['action'].enum_type = _ACTION _UPLINK.fields_by_name['status'].enum_type = _STATUS _UPLINK.fields_by_name['wan_status'].enum_type = _STATUS _IKETUNNEL.fields_by_name['action'].enum_type = _ACTION _IKETUNNEL.fields_by_name['peer_mac'].message_type = _MACADDRESS _IKETUNNEL.fields_by_name['local_mac'].message_type = _MACADDRESS _IKETUNNEL.fields_by_name['src_ip'].message_type = _IPADDRESS _IKETUNNEL.fields_by_name['dst_ip'].message_type = _IPADDRESS _IKETUNNEL.fields_by_name['status'].enum_type = _STATUS _DEVICESTATS.fields_by_name['fan_status'].enum_type = _STATUS _RADIOSTATS.fields_by_name['macaddr'].message_type = _MACADDRESS _VAPSTATS.fields_by_name['radio_mac'].message_type = _MACADDRESS _TUNNELSTATS.fields_by_name['index'].enum_type = _TUNNELINDEX _CLIENTSTATS.fields_by_name['macaddr'].message_type = _MACADDRESS _INTERFACESTATS.fields_by_name['macaddr'].message_type = _MACADDRESS _TUNNELIPPROBESTATS.fields_by_name['tunnel_index'].enum_type = _TUNNELINDEX _TUNNELIPPROBESTATS.fields_by_name['probe_ip_addr'].message_type = _IPADDRESS _UPLINKIPPROBESTATS.fields_by_name['ip_address'].message_type = _IPADDRESS _UPLINKSPEEDTEST.fields_by_name['server_ip'].message_type = _IPADDRESS _WIDSEVENT.fields_by_name['action'].enum_type = _ACTION _WIDSEVENT.fields_by_name['event_type'].enum_type = _WIDSEVENT_EVENTTYPE _WIDSEVENT.fields_by_name['macaddr'].message_type = _MACADDRESS _WIDSEVENT.fields_by_name['attack_type'].enum_type = _WIDSEVENT_ATTACKTYPE _WIDSEVENT_EVENTTYPE.containing_type = _WIDSEVENT _WIDSEVENT_ATTACKTYPE.containing_type = _WIDSEVENT _AIRMONITORROGUEINFO.fields_by_name['match_type'].enum_type = _AIRMONITORROGUEINFO_WMS_RAP_MATCH_TYPE _AIRMONITORROGUEINFO.fields_by_name['match_mac'].message_type = _MACADDRESS _AIRMONITORROGUEINFO.fields_by_name['match_ip'].message_type = _IPADDRESS _AIRMONITORROGUEINFO.fields_by_name['nat_match_type'].enum_type = _AIRMONITORROGUEINFO_WMS_RAP_NAT_MATCH_TYPE _AIRMONITORROGUEINFO_WMS_RAP_MATCH_TYPE.containing_type = _AIRMONITORROGUEINFO _AIRMONITORROGUEINFO_WMS_RAP_NAT_MATCH_TYPE.containing_type = _AIRMONITORROGUEINFO _ROGUEEVENT.fields_by_name['action'].enum_type = _ACTION _ROGUEEVENT.fields_by_name['macaddr'].message_type = _MACADDRESS _ROGUEEVENT.fields_by_name['encr_type'].enum_type = _ROGUEEVENT_WMS_SNMP_ENCR_PROTOCOL _ROGUEEVENT.fields_by_name['am_rogue'].message_type = _AIRMONITORROGUEINFO _ROGUEEVENT_WMS_SNMP_ENCR_PROTOCOL.containing_type = _ROGUEEVENT _DEVICENEIGHBOURS.fields_by_name['action'].enum_type = _ACTION _MONITORINGINFORMATION.fields_by_name['data_elements'].enum_type = _DATAELEMENT _MONITORINGINFORMATION.fields_by_name['swarms'].message_type = _SWARM _MONITORINGINFORMATION.fields_by_name['aps'].message_type = _AP _MONITORINGINFORMATION.fields_by_name['networks'].message_type = _NETWORK _MONITORINGINFORMATION.fields_by_name['radios'].message_type = _RADIO _MONITORINGINFORMATION.fields_by_name['vaps'].message_type = _VAPINFO _MONITORINGINFORMATION.fields_by_name['interfaces'].message_type = _INTERFACE _MONITORINGINFORMATION.fields_by_name['tunnels'].message_type = _TUNNEL _MONITORINGINFORMATION.fields_by_name['wireless_clients'].message_type = _WIRELESSCLIENT _MONITORINGINFORMATION.fields_by_name['switches'].message_type = _SWITCH _MONITORINGINFORMATION.fields_by_name['wired_clients'].message_type = _WIREDCLIENT _MONITORINGINFORMATION.fields_by_name['device_stats'].message_type = _DEVICESTATS _MONITORINGINFORMATION.fields_by_name['radio_stats'].message_type = _RADIOSTATS _MONITORINGINFORMATION.fields_by_name['interface_stats'].message_type = _INTERFACESTATS _MONITORINGINFORMATION.fields_by_name['vap_stats'].message_type = _VAPSTATS _MONITORINGINFORMATION.fields_by_name['client_stats'].message_type = _CLIENTSTATS _MONITORINGINFORMATION.fields_by_name['tunnel_stats'].message_type = _TUNNELSTATS _MONITORINGINFORMATION.fields_by_name['wids_events'].message_type = _WIDSEVENT _MONITORINGINFORMATION.fields_by_name['modem_stats'].message_type = _MODEMSTATS _MONITORINGINFORMATION.fields_by_name['role_stats'].message_type = _ROLESTATS _MONITORINGINFORMATION.fields_by_name['vlan_stats'].message_type = _VLANSTATS _MONITORINGINFORMATION.fields_by_name['ssid_stats'].message_type = _SSIDSTATS _MONITORINGINFORMATION.fields_by_name['ipprobe_stats'].message_type = _TUNNELIPPROBESTATS _MONITORINGINFORMATION.fields_by_name['rogue_events'].message_type = _ROGUEEVENT _MONITORINGINFORMATION.fields_by_name['mobility_controllers'].message_type = _MOBILITYCONTROLLER _MONITORINGINFORMATION.fields_by_name['uplinks'].message_type = _UPLINK _MONITORINGINFORMATION.fields_by_name['uplink_stats'].message_type = _UPLINKSTATS _MONITORINGINFORMATION.fields_by_name['uplink_wan_stats'].message_type = _UPLINKWANSTATS _MONITORINGINFORMATION.fields_by_name['uplink_probe_stats'].message_type = _UPLINKIPPROBESTATS _MONITORINGINFORMATION.fields_by_name['uplink_speedtest'].message_type = _UPLINKSPEEDTEST _MONITORINGINFORMATION.fields_by_name['device_neighbours'].message_type = _DEVICENEIGHBOURS _MONITORINGINFORMATION.fields_by_name['notification'].message_type = _NOTIFICATION _MONITORINGINFORMATION.fields_by_name['switch_stacks'].message_type = _SWITCHSTACK _MONITORINGINFORMATION.fields_by_name['ike_tunnels'].message_type = _IKETUNNEL _MONITORINGINFORMATION.fields_by_name['switch_vlan_info'].message_type = _SWITCHVLANINFO _MONITORINGSTATEINFORMATION.fields_by_name['mobility_controllers'].message_type = _MOBILITYCONTROLLER _MONITORINGSTATEINFORMATION.fields_by_name['switches'].message_type = _SWITCH _MONITORINGSTATEINFORMATION.fields_by_name['swarms'].message_type = _SWARM _MONITORINGSTATEINFORMATION.fields_by_name['aps'].message_type = _AP _MONITORINGSTATEINFORMATION.fields_by_name['vaps'].message_type = _VAPINFO _MONITORINGSTATEINFORMATION.fields_by_name['radios'].message_type = _RADIO _MONITORINGSTATEINFORMATION.fields_by_name['interfaces'].message_type = _INTERFACE _MONITORINGSTATEINFORMATION.fields_by_name['networks'].message_type = _NETWORK _MONITORINGSTATEINFORMATION.fields_by_name['tunnels'].message_type = _TUNNEL _MONITORINGSTATEINFORMATION.fields_by_name['wireless_clients'].message_type = _WIRELESSCLIENT _MONITORINGSTATEINFORMATION.fields_by_name['wired_clients'].message_type = _WIREDCLIENT _MONITORINGSTATEINFORMATION.fields_by_name['uplinks'].message_type = _UPLINK _MONITORINGSTATEINFORMATION.fields_by_name['switch_stacks'].message_type = _SWITCHSTACK _MONITORINGSTATEINFORMATION.fields_by_name['ike_tunnels'].message_type = _IKETUNNEL _NOTIFICATION.fields_by_name['severity'].enum_type = _NOTIFICATION_SEVERITY _NOTIFICATION.fields_by_name['state'].enum_type = _NOTIFICATION_NOTIFICATIONSTATE _NOTIFICATION.fields_by_name['extra'].message_type = _KEYVALUEDATA _NOTIFICATION_SEVERITY.containing_type = _NOTIFICATION _NOTIFICATION_NOTIFICATIONSTATE.containing_type = _NOTIFICATION _SWITCHVLANINFO.fields_by_name['vlans'].message_type = _SWITCHVLAN DESCRIPTOR.message_types_by_name['IpAddress'] = _IPADDRESS DESCRIPTOR.message_types_by_name['MacAddress'] = _MACADDRESS DESCRIPTOR.message_types_by_name['Swarm'] = _SWARM DESCRIPTOR.message_types_by_name['Tunnel'] = _TUNNEL DESCRIPTOR.message_types_by_name['Interface'] = _INTERFACE DESCRIPTOR.message_types_by_name['VapInfo'] = _VAPINFO DESCRIPTOR.message_types_by_name['Radio'] = _RADIO DESCRIPTOR.message_types_by_name['Ap'] = _AP DESCRIPTOR.message_types_by_name['Network'] = _NETWORK DESCRIPTOR.message_types_by_name['WirelessClient'] = _WIRELESSCLIENT DESCRIPTOR.message_types_by_name['HardwareModule'] = _HARDWAREMODULE DESCRIPTOR.message_types_by_name['Switch'] = _SWITCH DESCRIPTOR.message_types_by_name['SwitchStack'] = _SWITCHSTACK DESCRIPTOR.message_types_by_name['WiredClient'] = _WIREDCLIENT DESCRIPTOR.message_types_by_name['MobilityController'] = _MOBILITYCONTROLLER DESCRIPTOR.message_types_by_name['Uplink'] = _UPLINK DESCRIPTOR.message_types_by_name['IkeTunnel'] = _IKETUNNEL DESCRIPTOR.message_types_by_name['DeviceStats'] = _DEVICESTATS DESCRIPTOR.message_types_by_name['RadioStats'] = _RADIOSTATS DESCRIPTOR.message_types_by_name['VapStats'] = _VAPSTATS DESCRIPTOR.message_types_by_name['TunnelStats'] = _TUNNELSTATS DESCRIPTOR.message_types_by_name['ClientStats'] = _CLIENTSTATS DESCRIPTOR.message_types_by_name['InterfaceStats'] = _INTERFACESTATS DESCRIPTOR.message_types_by_name['UplinkStats'] = _UPLINKSTATS DESCRIPTOR.message_types_by_name['UplinkWanStats'] = _UPLINKWANSTATS DESCRIPTOR.message_types_by_name['ModemStats'] = _MODEMSTATS DESCRIPTOR.message_types_by_name['RoleStats'] = _ROLESTATS DESCRIPTOR.message_types_by_name['VlanStats'] = _VLANSTATS DESCRIPTOR.message_types_by_name['SsidStats'] = _SSIDSTATS DESCRIPTOR.message_types_by_name['TunnelIpProbeStats'] = _TUNNELIPPROBESTATS DESCRIPTOR.message_types_by_name['UplinkIpProbeStats'] = _UPLINKIPPROBESTATS DESCRIPTOR.message_types_by_name['UplinkSpeedtest'] = _UPLINKSPEEDTEST DESCRIPTOR.message_types_by_name['WIDSEvent'] = _WIDSEVENT DESCRIPTOR.message_types_by_name['AirMonitorRogueInfo'] = _AIRMONITORROGUEINFO DESCRIPTOR.message_types_by_name['RogueEvent'] = _ROGUEEVENT DESCRIPTOR.message_types_by_name['DeviceNeighbours'] = _DEVICENEIGHBOURS DESCRIPTOR.message_types_by_name['MonitoringInformation'] = _MONITORINGINFORMATION DESCRIPTOR.message_types_by_name['MonitoringStateInformation'] = _MONITORINGSTATEINFORMATION DESCRIPTOR.message_types_by_name['KeyValueData'] = _KEYVALUEDATA DESCRIPTOR.message_types_by_name['Notification'] = _NOTIFICATION DESCRIPTOR.message_types_by_name['SwitchVlanInfo'] = _SWITCHVLANINFO DESCRIPTOR.message_types_by_name['SwitchVlan'] = _SWITCHVLAN DESCRIPTOR.enum_types_by_name['Action'] = _ACTION DESCRIPTOR.enum_types_by_name['Status'] = _STATUS DESCRIPTOR.enum_types_by_name['TunnelIndex'] = _TUNNELINDEX DESCRIPTOR.enum_types_by_name['CryptoType'] = _CRYPTOTYPE DESCRIPTOR.enum_types_by_name['DataElement'] = _DATAELEMENT DESCRIPTOR.enum_types_by_name['AuthType'] = _AUTHTYPE _sym_db.RegisterFileDescriptor(DESCRIPTOR) IpAddress = _reflection.GeneratedProtocolMessageType('IpAddress', (_message.Message,), dict( DESCRIPTOR = _IPADDRESS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:IpAddress) )) _sym_db.RegisterMessage(IpAddress) MacAddress = _reflection.GeneratedProtocolMessageType('MacAddress', (_message.Message,), dict( DESCRIPTOR = _MACADDRESS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:MacAddress) )) _sym_db.RegisterMessage(MacAddress) Swarm = _reflection.GeneratedProtocolMessageType('Swarm', (_message.Message,), dict( DESCRIPTOR = _SWARM, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Swarm) )) _sym_db.RegisterMessage(Swarm) Tunnel = _reflection.GeneratedProtocolMessageType('Tunnel', (_message.Message,), dict( DESCRIPTOR = _TUNNEL, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Tunnel) )) _sym_db.RegisterMessage(Tunnel) Interface = _reflection.GeneratedProtocolMessageType('Interface', (_message.Message,), dict( DESCRIPTOR = _INTERFACE, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Interface) )) _sym_db.RegisterMessage(Interface) VapInfo = _reflection.GeneratedProtocolMessageType('VapInfo', (_message.Message,), dict( DESCRIPTOR = _VAPINFO, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:VapInfo) )) _sym_db.RegisterMessage(VapInfo) Radio = _reflection.GeneratedProtocolMessageType('Radio', (_message.Message,), dict( DESCRIPTOR = _RADIO, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Radio) )) _sym_db.RegisterMessage(Radio) Ap = _reflection.GeneratedProtocolMessageType('Ap', (_message.Message,), dict( DESCRIPTOR = _AP, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Ap) )) _sym_db.RegisterMessage(Ap) Network = _reflection.GeneratedProtocolMessageType('Network', (_message.Message,), dict( DESCRIPTOR = _NETWORK, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Network) )) _sym_db.RegisterMessage(Network) WirelessClient = _reflection.GeneratedProtocolMessageType('WirelessClient', (_message.Message,), dict( DESCRIPTOR = _WIRELESSCLIENT, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:WirelessClient) )) _sym_db.RegisterMessage(WirelessClient) HardwareModule = _reflection.GeneratedProtocolMessageType('HardwareModule', (_message.Message,), dict( DESCRIPTOR = _HARDWAREMODULE, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:HardwareModule) )) _sym_db.RegisterMessage(HardwareModule) Switch = _reflection.GeneratedProtocolMessageType('Switch', (_message.Message,), dict( DESCRIPTOR = _SWITCH, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Switch) )) _sym_db.RegisterMessage(Switch) SwitchStack = _reflection.GeneratedProtocolMessageType('SwitchStack', (_message.Message,), dict( DESCRIPTOR = _SWITCHSTACK, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:SwitchStack) )) _sym_db.RegisterMessage(SwitchStack) WiredClient = _reflection.GeneratedProtocolMessageType('WiredClient', (_message.Message,), dict( DESCRIPTOR = _WIREDCLIENT, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:WiredClient) )) _sym_db.RegisterMessage(WiredClient) MobilityController = _reflection.GeneratedProtocolMessageType('MobilityController', (_message.Message,), dict( DESCRIPTOR = _MOBILITYCONTROLLER, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:MobilityController) )) _sym_db.RegisterMessage(MobilityController) Uplink = _reflection.GeneratedProtocolMessageType('Uplink', (_message.Message,), dict( DESCRIPTOR = _UPLINK, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Uplink) )) _sym_db.RegisterMessage(Uplink) IkeTunnel = _reflection.GeneratedProtocolMessageType('IkeTunnel', (_message.Message,), dict( DESCRIPTOR = _IKETUNNEL, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:IkeTunnel) )) _sym_db.RegisterMessage(IkeTunnel) DeviceStats = _reflection.GeneratedProtocolMessageType('DeviceStats', (_message.Message,), dict( DESCRIPTOR = _DEVICESTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:DeviceStats) )) _sym_db.RegisterMessage(DeviceStats) RadioStats = _reflection.GeneratedProtocolMessageType('RadioStats', (_message.Message,), dict( DESCRIPTOR = _RADIOSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:RadioStats) )) _sym_db.RegisterMessage(RadioStats) VapStats = _reflection.GeneratedProtocolMessageType('VapStats', (_message.Message,), dict( DESCRIPTOR = _VAPSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:VapStats) )) _sym_db.RegisterMessage(VapStats) TunnelStats = _reflection.GeneratedProtocolMessageType('TunnelStats', (_message.Message,), dict( DESCRIPTOR = _TUNNELSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:TunnelStats) )) _sym_db.RegisterMessage(TunnelStats) ClientStats = _reflection.GeneratedProtocolMessageType('ClientStats', (_message.Message,), dict( DESCRIPTOR = _CLIENTSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:ClientStats) )) _sym_db.RegisterMessage(ClientStats) InterfaceStats = _reflection.GeneratedProtocolMessageType('InterfaceStats', (_message.Message,), dict( DESCRIPTOR = _INTERFACESTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:InterfaceStats) )) _sym_db.RegisterMessage(InterfaceStats) UplinkStats = _reflection.GeneratedProtocolMessageType('UplinkStats', (_message.Message,), dict( DESCRIPTOR = _UPLINKSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:UplinkStats) )) _sym_db.RegisterMessage(UplinkStats) UplinkWanStats = _reflection.GeneratedProtocolMessageType('UplinkWanStats', (_message.Message,), dict( DESCRIPTOR = _UPLINKWANSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:UplinkWanStats) )) _sym_db.RegisterMessage(UplinkWanStats) ModemStats = _reflection.GeneratedProtocolMessageType('ModemStats', (_message.Message,), dict( DESCRIPTOR = _MODEMSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:ModemStats) )) _sym_db.RegisterMessage(ModemStats) RoleStats = _reflection.GeneratedProtocolMessageType('RoleStats', (_message.Message,), dict( DESCRIPTOR = _ROLESTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:RoleStats) )) _sym_db.RegisterMessage(RoleStats) VlanStats = _reflection.GeneratedProtocolMessageType('VlanStats', (_message.Message,), dict( DESCRIPTOR = _VLANSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:VlanStats) )) _sym_db.RegisterMessage(VlanStats) SsidStats = _reflection.GeneratedProtocolMessageType('SsidStats', (_message.Message,), dict( DESCRIPTOR = _SSIDSTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:SsidStats) )) _sym_db.RegisterMessage(SsidStats) TunnelIpProbeStats = _reflection.GeneratedProtocolMessageType('TunnelIpProbeStats', (_message.Message,), dict( DESCRIPTOR = _TUNNELIPPROBESTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:TunnelIpProbeStats) )) _sym_db.RegisterMessage(TunnelIpProbeStats) UplinkIpProbeStats = _reflection.GeneratedProtocolMessageType('UplinkIpProbeStats', (_message.Message,), dict( DESCRIPTOR = _UPLINKIPPROBESTATS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:UplinkIpProbeStats) )) _sym_db.RegisterMessage(UplinkIpProbeStats) UplinkSpeedtest = _reflection.GeneratedProtocolMessageType('UplinkSpeedtest', (_message.Message,), dict( DESCRIPTOR = _UPLINKSPEEDTEST, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:UplinkSpeedtest) )) _sym_db.RegisterMessage(UplinkSpeedtest) WIDSEvent = _reflection.GeneratedProtocolMessageType('WIDSEvent', (_message.Message,), dict( DESCRIPTOR = _WIDSEVENT, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:WIDSEvent) )) _sym_db.RegisterMessage(WIDSEvent) AirMonitorRogueInfo = _reflection.GeneratedProtocolMessageType('AirMonitorRogueInfo', (_message.Message,), dict( DESCRIPTOR = _AIRMONITORROGUEINFO, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:AirMonitorRogueInfo) )) _sym_db.RegisterMessage(AirMonitorRogueInfo) RogueEvent = _reflection.GeneratedProtocolMessageType('RogueEvent', (_message.Message,), dict( DESCRIPTOR = _ROGUEEVENT, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:RogueEvent) )) _sym_db.RegisterMessage(RogueEvent) DeviceNeighbours = _reflection.GeneratedProtocolMessageType('DeviceNeighbours', (_message.Message,), dict( DESCRIPTOR = _DEVICENEIGHBOURS, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:DeviceNeighbours) )) _sym_db.RegisterMessage(DeviceNeighbours) MonitoringInformation = _reflection.GeneratedProtocolMessageType('MonitoringInformation', (_message.Message,), dict( DESCRIPTOR = _MONITORINGINFORMATION, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:MonitoringInformation) )) _sym_db.RegisterMessage(MonitoringInformation) MonitoringStateInformation = _reflection.GeneratedProtocolMessageType('MonitoringStateInformation', (_message.Message,), dict( DESCRIPTOR = _MONITORINGSTATEINFORMATION, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:MonitoringStateInformation) )) _sym_db.RegisterMessage(MonitoringStateInformation) KeyValueData = _reflection.GeneratedProtocolMessageType('KeyValueData', (_message.Message,), dict( DESCRIPTOR = _KEYVALUEDATA, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:KeyValueData) )) _sym_db.RegisterMessage(KeyValueData) Notification = _reflection.GeneratedProtocolMessageType('Notification', (_message.Message,), dict( DESCRIPTOR = _NOTIFICATION, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:Notification) )) _sym_db.RegisterMessage(Notification) SwitchVlanInfo = _reflection.GeneratedProtocolMessageType('SwitchVlanInfo', (_message.Message,), dict( DESCRIPTOR = _SWITCHVLANINFO, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:SwitchVlanInfo) )) _sym_db.RegisterMessage(SwitchVlanInfo) SwitchVlan = _reflection.GeneratedProtocolMessageType('SwitchVlan', (_message.Message,), dict( DESCRIPTOR = _SWITCHVLAN, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:SwitchVlan) )) _sym_db.RegisterMessage(SwitchVlan) # @@protoc_insertion_point(module_scope)
44.896725
28,170
0.736954
33,181
250,838
5.290196
0.034749
0.06613
0.080634
0.051762
0.772506
0.732895
0.719536
0.702217
0.671978
0.662635
0
0.052776
0.137196
250,838
5,586
28,171
44.904762
0.758289
0.009129
0
0.713648
1
0.005392
0.148016
0.093928
0
0
0
0
0
1
0
false
0
0.001116
0
0.001116
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
ca11f827143d0cd75eee06d96906e78a71f6a997
1,994
py
Python
2d/uniaxial_traction/test_benchmark.py
cgeudeker/mpm-benchmarks
072d39cda3fb4f8ddde8879bc98ec9cf7bc4383b
[ "CC-BY-4.0" ]
5
2019-05-28T16:41:03.000Z
2021-08-04T21:34:42.000Z
2d/uniaxial_traction/test_benchmark.py
cgeudeker/mpm-benchmarks
072d39cda3fb4f8ddde8879bc98ec9cf7bc4383b
[ "CC-BY-4.0" ]
18
2018-11-16T06:35:24.000Z
2022-03-16T01:49:37.000Z
2d/uniaxial_traction/test_benchmark.py
cgeudeker/mpm-benchmarks
072d39cda3fb4f8ddde8879bc98ec9cf7bc4383b
[ "CC-BY-4.0" ]
9
2018-11-15T08:57:51.000Z
2022-03-23T19:14:47.000Z
import os import pathlib import pandas as pd # Get current path os.chdir(pathlib.Path(__file__).parent.absolute()) # Nodal forces results ## Step 300 df = pd.read_hdf('results/uniaxial-nodal-forces-2d/particles0300.h5', 'table') assert round(df['stress_xx'].min() - 0.5925210678182377, 8) == 0.0 assert round(df['stress_xx'].max() - 0.5974539476363379, 8) == 0.0 ## Step 510 df = pd.read_hdf('results/uniaxial-nodal-forces-2d/particles0510.h5', 'table') assert round(df['stress_xx'].min() - 1.0026665338366039, 8) == 0.0 assert round(df['stress_xx'].max() - 1.0112231542459431, 8) == 0.0 ## Step 750 df = pd.read_hdf('results/uniaxial-nodal-forces-2d/particles0750.h5', 'table') assert round(df['stress_xx'].min() - 1.0000053000532143, 8) == 0.0 assert round(df['stress_xx'].max() - 1.0000225119807862, 8) == 0.0 ## Step 990 df = pd.read_hdf('results/uniaxial-nodal-forces-2d/particles0990.h5', 'table') assert round(df['stress_xx'].min() - 0.9999990078443788, 8) == 0.0 assert round(df['stress_xx'].max() - 0.9999990292713694, 8) == 0.0 # Particle traction results ## Step 300 df = pd.read_hdf('results/uniaxial-particle-traction-2d/particles0300.h5', 'table') assert round(df['stress_xx'].min() - 0.4450086768966724, 8) == 0.0 assert round(df['stress_xx'].max() - 0.5966527842046769, 8) == 0.0 ## Step 510 df = pd.read_hdf('results/uniaxial-particle-traction-2d/particles0510.h5', 'table') assert round(df['stress_xx'].min() - 0.7528092313640623, 8) == 0.0 assert round(df['stress_xx'].max() - 1.0109599915279937, 8) == 0.0 ## Step 750 df = pd.read_hdf('results/uniaxial-particle-traction-2d/particles0750.h5', 'table') assert round(df['stress_xx'].min() - 0.7500090055681591, 8) == 0.0 assert round(df['stress_xx'].max() - 1.0000224746314728, 8) == 0.0 ## Step 990 df = pd.read_hdf('results/uniaxial-particle-traction-2d/particles0990.h5', 'table') assert round(df['stress_xx'].min() - 0.750002924022295, 8) == 0.0 assert round(df['stress_xx'].max() - 0.9999997782938734, 8) == 0.0
40.693878
83
0.705617
312
1,994
4.419872
0.189103
0.127629
0.150834
0.22045
0.728064
0.728064
0.728064
0.728064
0.728064
0.588832
0
0.217706
0.099298
1,994
48
84
41.541667
0.550111
0.067703
0
0
0
0
0.324089
0.224035
0
0
0
0
0.571429
1
0
false
0
0.107143
0
0.107143
0
0
0
0
null
0
0
1
0
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
7
0471a02e8681f1aa6b26b9877785adf006ffafb7
24,568
py
Python
train_network.py
HaoZhang1018/STDFusionNet
e4d6dbb2d995032ed93880e90262834e1edaa65f
[ "MIT" ]
12
2021-03-27T05:47:40.000Z
2022-03-06T14:38:20.000Z
train_network.py
Melon-Xu/STDFusionNet-1
8bc8ba4f94d8caded932655c6dbd0ba9e4f590d5
[ "MIT" ]
1
2021-05-21T07:01:35.000Z
2021-05-25T14:44:55.000Z
train_network.py
Melon-Xu/STDFusionNet-1
8bc8ba4f94d8caded932655c6dbd0ba9e4f590d5
[ "MIT" ]
7
2021-04-01T07:25:44.000Z
2022-03-28T13:28:50.000Z
import tensorflow as tf from utils import weights_spectral_norm class STDFusionNet(): def vi_feature_extraction_network(self, vi_image): with tf.compat.v1.variable_scope('vi_extraction_network'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [5, 5, 1, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(vi_image, weights, strides=[1, 1, 1, 1], padding='SAME') + bias # conv1 = tf.contrib.layers.batch_norm(conv1, decay=0.9, updates_collections=None, epsilon=1e-5, scale=True) conv1 = tf.nn.leaky_relu(conv1) block1_input = conv1 # state size: 16 with tf.compat.v1.variable_scope('block1'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block1_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias block1_output = tf.nn.leaky_relu(conv3 + block1_input) block2_input = block1_output with tf.compat.v1.variable_scope('block2'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block2_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block2_input, weights, strides=[1, 1, 1, 1], padding='SAME') block2_output = tf.nn.leaky_relu(conv3 + identity_conv) block3_input = block2_output with tf.compat.v1.variable_scope('block3'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block3_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 32, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [64], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block3_input, weights, strides=[1, 1, 1, 1], padding='SAME') block3_output = tf.nn.leaky_relu(conv3 + identity_conv) encoding_feature = block3_output return encoding_feature def ir_feature_extraction_network(self, ir_image): with tf.compat.v1.variable_scope('ir_extraction_network'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [5, 5, 1, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(ir_image, weights, strides=[1, 1, 1, 1], padding='SAME') + bias # conv1 = tf.contrib.layers.batch_norm(conv1, decay=0.9, updates_collections=None, epsilon=1e-5, scale=True) conv1 = tf.nn.leaky_relu(conv1) block1_input = conv1 # state size: 16 with tf.compat.v1.variable_scope('block1'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block1_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias block1_output = tf.nn.leaky_relu(conv3 + block1_input) block2_input = block1_output with tf.compat.v1.variable_scope('block2'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block2_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block2_input, weights, strides=[1, 1, 1, 1], padding='SAME') block2_output = tf.nn.leaky_relu(conv3 + identity_conv) block3_input = block2_output with tf.compat.v1.variable_scope('block3'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block3_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 32, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [64], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block3_input, weights, strides=[1, 1, 1, 1], padding='SAME') block3_output = tf.nn.leaky_relu(conv3 + identity_conv) encoding_feature = block3_output return encoding_feature def feature_reconstruction_network(self, feature): with tf.compat.v1.variable_scope('reconstruction_network'): block1_input = feature with tf.compat.v1.variable_scope('block1'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 128, 128], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [128], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block1_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 128, 128], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [128], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 128, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [64], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 128, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block1_input, weights, strides=[1, 1, 1, 1], padding='SAME') block1_output = tf.nn.elu(conv3 + identity_conv) block2_input = block1_output with tf.compat.v1.variable_scope('block2'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 64, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [64], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block2_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 64, 64], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [64], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 64, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 64, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block2_input, weights, strides=[1, 1, 1, 1], padding='SAME') block2_output = tf.nn.elu(conv3 + identity_conv) block3_input = block2_output with tf.compat.v1.variable_scope('block3'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block3_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 32, 32], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [32], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 32, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block3_input, weights, strides=[1, 1, 1, 1], padding='SAME') block3_output = tf.nn.leaky_relu(conv3 + identity_conv) block4_input = block3_output with tf.compat.v1.variable_scope('block4'): with tf.compat.v1.variable_scope('conv1'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv1 = tf.nn.conv2d(block4_input, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv1 = tf.nn.leaky_relu(conv1) with tf.compat.v1.variable_scope('conv2'): weights = tf.compat.v1.get_variable("w", [3, 3, 16, 16], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [16], initializer=tf.constant_initializer(0.0)) conv2 = tf.nn.conv2d(conv1, weights, strides=[1, 1, 1, 1], padding='SAME') + bias conv2 = tf.nn.leaky_relu(conv2) with tf.compat.v1.variable_scope('conv3'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 1], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) bias = tf.compat.v1.get_variable("b", [1], initializer=tf.constant_initializer(0.0)) conv3 = tf.nn.conv2d(conv2, weights, strides=[1, 1, 1, 1], padding='SAME') + bias with tf.variable_scope('identity_conv'): weights = tf.compat.v1.get_variable("w", [1, 1, 16, 1], initializer=tf.truncated_normal_initializer(stddev=1e-3)) #weights = weights_spectral_norm(weights) identity_conv = tf.nn.conv2d(block4_input, weights, strides=[1, 1, 1, 1], padding='SAME') block4_output = tf.nn.tanh(conv3 + identity_conv) fusion_image = block4_output return fusion_image def STDFusion_model(self, vi_image, ir_image): with tf.variable_scope("STDFusion_model"): vi_feature = self.vi_feature_extraction_network(vi_image) ir_feature = self.ir_feature_extraction_network(ir_image) feature = tf.concat([vi_feature, ir_feature], axis=-1) f_image = self.feature_reconstruction_network(feature) return f_image
74.902439
125
0.528452
2,760
24,568
4.533696
0.030435
0.023655
0.093503
0.074802
0.954288
0.954288
0.954288
0.940622
0.940622
0.940622
0
0.061887
0.352165
24,568
327
126
75.131498
0.724303
0.075057
0
0.87218
0
0
0.028408
0.002863
0
0
0
0
0
1
0.015038
false
0
0.007519
0
0.041353
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
04837dc57de649aebcde4b5eb63fa17c98297ca2
60,023
py
Python
src/rimuc/resources.py
srackham/rimu-py
3da67cb362b6d34fd363e9f4ce5e0afb019baa4c
[ "MIT" ]
null
null
null
src/rimuc/resources.py
srackham/rimu-py
3da67cb362b6d34fd363e9f4ce5e0afb019baa4c
[ "MIT" ]
4
2020-03-24T17:59:43.000Z
2021-06-02T00:48:53.000Z
src/rimuc/resources.py
srackham/rimu-py
3da67cb362b6d34fd363e9f4ce5e0afb019baa4c
[ "MIT" ]
null
null
null
# Generated automatically from resource files. Do not edit. from typing import Dict resources: Dict[str, str] = { 'sequel-footer.rmu': r'''/* Used by rimuc `--layout sequel` option. */ // Close main and article divs. </div> </div> {--highlightjs=}.+skip {--highlightjs-scripts} {--mathjax!}{--mathjax-scripts} {--no-toc!}.+skip <script> window.onload = function() { document.getElementById('sidebar').appendChild(document.getElementById('toc')); // Ensure custom TOC is child of sidebar. var headings = [].slice.call(document.body.querySelectorAll('#article > h1, #article > h2, #article > h3')); headings.forEach(function(heading) { {--header-links!} setHeaderLink(heading); appendTocEntry(heading); }); if (isSmallScreen()) { toggleToc(); // Hide TOC. } } </script> {--header-links=}.+skip <script> function setHeaderLink(heading) { var id = heading.getAttribute('id'); if (id) { var link = document.createElement('a'); link.classList.add('header-link'); link.setAttribute('href', '#' + id); heading.appendChild(link); } } </script> {--no-toc!}.+skip <script> function appendTocEntry(heading) { var id = heading.getAttribute('id'); if (heading.classList.contains('no-auto-toc')) { return; } var container = document.getElementById('auto-toc'); if (container === null) { return; } var tocLink = document.createElement('a'); tocLink.setAttribute('href', '#' + id); tocLink.textContent = heading.textContent; var tocEntry = document.createElement('div'); tocEntry.setAttribute('class', heading.tagName.toLowerCase()); tocEntry.appendChild(tocLink); container.appendChild(tocEntry); } </script> {--no-toc!}.+skip <script> document.onclick = function (event) { if (event.target.matches('#toc-button') || event.target.matches('#toc a') && isSmallScreen()) { {--!} Toggle TOC if TOC button or small-screen TOC link is clicked. toggleToc(); } } function toggleToc() { document.body.classList.toggle('hide-toc'); } function isSmallScreen() { return window.matchMedia('{--small-screen}').matches; } // matches() polyfill for old browsers. if (!Element.prototype.matches) { var p = Element.prototype; if (p.webkitMatchesSelector) // Chrome <34, SF<7.1, iOS<8 p.matches = p.webkitMatchesSelector; if (p.msMatchesSelector) // IE9/10/11 & Edge p.matches = p.msMatchesSelector; if (p.mozMatchesSelector) // FF<34 p.matches = p.mozMatchesSelector; } </script> </body> </html>''', 'plain-footer.rmu': r'''</body> </html>''', 'manpage.txt': r'''NAME rimuc - convert Rimu source to HTML SYNOPSIS rimuc [OPTIONS...] [FILES...] DESCRIPTION Reads Rimu source markup from stdin, converts them to HTML then writes the HTML to stdout. If FILES are specified the Rimu source is read from FILES. The contents of files with an .html extension are passed directly to the output. An input file named '-' is read from stdin. If a file named .rimurc exists in the user's home directory then its contents is processed (with --safe-mode 0). This behavior can be disabled with the --no-rimurc option. Inputs are processed in the following order: .rimurc file then --prepend-file option files then --prepend option source and finally FILES... OPTIONS -h, --help Display help message. --html-replacement TEXT Embedded HTML is replaced by TEXT when --safe-mode is set to 2. Defaults to '<mark>replaced HTML</mark>'. --layout LAYOUT Generate a styled HTML document. rimuc includes the following built-in document layouts: 'classic': Desktop-centric layout. 'flex': Flexbox mobile layout (experimental). 'plain': Unstyled HTML layout. 'sequel': Responsive cross-device layout. If only one source file is specified and the --output option is not specified then the output is written to a same-named file with an .html extension. This option enables --header-ids. -s, --styled Style output using default layout. Shortcut for '--layout sequel --header-ids --no-toc' -o, --output OUTFILE Write output to file OUTFILE instead of stdout. If OUTFILE is a hyphen '-' write to stdout. --pass Pass the stdin input verbatim to the output. -p, --prepend SOURCE Process the Rimu SOURCE text (immediately after --prepend-file option files). Rendered with --safe-mode 0. This option can be specified multiple times. --prepend-file PREPEND_FILE Process the PREPEND_FILE contents (immediately after .rimurc file). Rendered with --safe-mode 0. This option can be specified multiple times. --no-rimurc Do not process .rimurc from the user's home directory. --safe-mode NUMBER Non-zero safe modes ignore: Definition elements; API option elements; HTML attributes in Block Attributes elements. Also specifies how to process HTML elements: --safe-mode 0 renders HTML (default). --safe-mode 1 ignores HTML. --safe-mode 2 replaces HTML with --html-replacement option value. --safe-mode 3 renders HTML as text. Add 4 to --safe-mode to ignore Block Attribute elements. Add 8 to --safe-mode to allow Macro Definitions. --theme THEME, --lang LANG, --title TITLE, --highlightjs, --mathjax, --no-toc, --custom-toc, --section-numbers, --header-ids, --header-links Shortcuts for the following prepended macro definitions: --prepend "{--custom-toc}='true'" --prepend "{--header-ids}='true'" --prepend "{--header-links}='true'" --prepend "{--highlightjs}='true'" --prepend "{--lang}='LANG'" --prepend "{--mathjax}='true'" --prepend "{--no-toc}='true'" --prepend "{--section-numbers}='true'" --prepend "{--theme}='THEME'" --prepend "{--title}='TITLE'" --version Print version number. LAYOUT OPTIONS The following options are available when the --layout option specifies a built-in layout: Option Description _______________________________________________________________ --custom-toc Set to a non-blank value if a custom table of contents is used. --header-links Set to a non-blank value to generate h2 and h3 header header links. --highlightjs Set to non-blank value to enable syntax highlighting with Highlight.js. --lang HTML document language attribute value. --mathjax Set to a non-blank value to enable MathJax. --no-toc Set to a non-blank value to suppress table of contents generation. --section-numbers Apply h2 and h3 section numbering. --theme Styling theme. Theme names: 'legend', 'graystone', 'vintage'. --title HTML document title. _______________________________________________________________ These options are translated by rimuc to corresponding layout macro definitions using the --prepend option. LAYOUT CLASSES The following CSS classes are available for use in Rimu Block Attributes elements when the --layout option specifies a built-in layout: CSS class Description ______________________________________________________________ align-center Text alignment center. align-left Text alignment left. align-right Text alignment right. bordered Adds table borders. cite Quote and verse attribution. dl-horizontal Format labeled lists horizontally. dl-numbered Number labeled list items. dl-counter Prepend dl item counter to element content. ol-counter Prepend ol item counter to element content. ul-counter Prepend ul item counter to element content. no-auto-toc Exclude heading from table of contents. no-page-break Avoid page break inside the element. no-print Do not print. page-break Force page break before the element. preserve-breaks Honor line breaks in source text. sidebar Sidebar format (paragraphs, division blocks). verse Verse format (paragraphs, division blocks). ______________________________________________________________ PREDEFINED MACROS Macro name Description _______________________________________________________________ -- Blank macro (empty string). The Blank macro cannot be redefined. --header-ids Set to a non-blank value to generate h1, h2 and h3 header id attributes. _______________________________________________________________''', 'classic-header.rmu': r'''/* Used by rimuc `--layout classic` option. */ /* Default values for styling themes and content options. */ {--section-numbers?} = '' {--lang?} = '' {--title?} = '&nbsp;' {--theme?} = '' {--no-toc?} = '' {--custom-toc?} = '' {--header-links?} = '' {--small-screen?} = '(max-width: 800px)' {--meta?} = '<meta charset="UTF-8"> {--!} Make old IE versions use the latest rendering engine. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">' // Additional <head> child elements. {--head?} = '' {--highlightjs?} = '' {--highlightjs-css} = '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">' {--highlightjs-scripts} = '<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> <script> hljs.configure({languages: []}); hljs.initHighlightingOnLoad(); </script>' {--mathjax?} = '' {--mathjax-scripts} = '<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script>' // List item CSS counters. {--dl-counter} = '<span class="dl-counter"></span>' {--ol-counter} = '<span class="ol-counter"></span>' {--ul-counter} = '<span class="ul-counter"></span>' // Classic layout specific. {--dropdown-toc?} = '' /* Legend theme. */ {--theme!.*\blegend\b.*}.+skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#34495e' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#428bca' {--border-radius?} = '0' {--max-text-width?} = '50rem' .. /* Vintage theme. */ {--theme!.*\bvintage\b.*}.+skip // Default to this theme if none of the built-in themes is specified. {--theme!.*\b(legend|vintage|graystone)\b.*}.-skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#527bbd' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#527bbd' {--border-radius?} = '4px' {--max-text-width?} = '50rem' .. /* Graystone theme. */ {--theme!.*\bgraystone\b.*}.+skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#888' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#888' {--border-radius?} = '0' {--max-text-width?} = '50rem' .. /* Private layout parameters. */ // Accomodate the new default TOC generation and --no-toc option. // DEPRECATED --sidebar-toc: Used internally, external definition tolerated for backward comaptibility. {--dropdown-toc!}.+skip .. {--sidebar-toc?} = 'yes' .. {--dropdown-toc=}.+skip .. {--sidebar-toc?} = '' .. // DEPRECATED --toc: If --toc is non-blank make --sidebar-toc non-blank. {--toc?} = '' {--sidebar-toc} = '{--toc}{--sidebar-toc}' // Ensures no TOC. {--no-toc=}.+skip .. {--dropdown-toc} = '' {--sidebar-toc} = '' .. /* HTML header */ <!DOCTYPE HTML> {--lang=}<html> {--lang!}<html lang="{--lang}"> <head> {--meta} <title>{--title}</title> {--highlightjs!}{--highlightjs-css} /* Layout independent styles */ <style> :root { font-size: 16px; line-height: 20px; color: {--text-color}; background-color: {--primary-background}; font-family: {--sans-font}; } * { margin: 0; padding: 0; white-space: inherit; box-sizing: border-box; } h1, h2, h3, h4, h5, h6 { margin: 10px 0; color: {--primary-color}; } h1 { font-size: 2.2rem; line-height: 40px;} h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; } h4 { font-size: 1.1rem; } h5 { font-size: 1.0rem; } h6 { font-size: 0.9rem; } h2, h3, h4, h5, h6 { line-height: normal; margin-top: 1.0rem; margin-bottom: 0.2rem; } h2 { margin-top: 1.5rem; border-bottom: 1px solid {--border-color}; } img { max-width: 100%; } table { border-collapse: collapse; width: 100%; } td, th { text-align: left; vertical-align: top; } {--!} tbody necessary because: https://stackoverflow.com/questions/7490364/why-do-browsers-still-inject-tbody-in-html5 table.bordered > tbody > tr > th, table.bordered > tbody > tr > td { border: 1px solid {--border-color}; } a, a:hover { color: {--primary-color}; } a { text-decoration: none; } a:hover { text-decoration: underline; } p, pre, li, dt, dd, blockquote p { line-height: 1.45; margin-top: 0.5rem; margin-bottom: 0.5rem; } ul, ol { padding: 0; margin: 0 0 10px 25px; } dt { margin-bottom: 0; font-style: italic; } dd { margin-left: 1.0rem; margin-top: 0; } blockquote { padding: 0 0 0 15px; border: none; border-left: 5px solid #eeeeee; font-family: {--serif-font}; width: 80%; margin: 1.5em 0; color: #383838; } .cite { color: #777; padding: 5px 0; } .cite::before { content: "\2014 \2009"; } code { font-family: {--mono-font}; {--!} Monspace fonts are relatively oversized. font-size: {--mono-size}; background-color: {--code-background}; } {--highlightjs!} .hljs { background-color: {--code-background}; } pre { font-family: {--mono-font}; line-height: normal; white-space: pre-wrap; background-color: {--code-background}; border: 1px solid {--border-color}; border-radius: {--border-radius}; padding: 6px; } .light-background { background-color: {--code-background}; border: none; white-space: pre-wrap; } *:not(pre) > code { white-space: nowrap; } .dl-horizontal > dd { margin-top: 1.0rem; } pre > code { background-color: inherit; {--!} highlight.js tweak. padding: 0; } pre span { {--!} highlight.js tweak. opacity: 1 !important; } {--!} Rimu classes. {--!} Apply verse class to Normal Paragraphs and Division blocks. .verse { margin: 1.5em 20px; } div.verse p, p.verse { font-family: {--serif-font}; white-space: pre; margin-top: 0.75rem; margin-bottom: 0.75rem; } {--!} Apply sidebar class to Normal Paragraphs and Division blocks. .sidebar { border: 1px solid {--border-color}; border-radius: {--border-radius}; background: {--sidebar-background}; padding: 10px; margin: 1.5em 0; } div.sidebar *:first-child { margin-top: 0.2rem; } {--!} Force page break before the element. .page-break { page-break-before: always; } {--!} Avoid page breaks inside the element. .no-page-break { page-break-inside: avoid; } {--!} Text block alignment classes. .align-left { text-align: left; } .align-center { text-align: center; } .align-right { text-align: right; } {--!} Preserve line breaks. .preserve-breaks { white-space: pre; } {--!} DEPRECATED: Use `preserve-breaks` instead. .line-breaks { white-space: pre; } {--!} Horizontal labeled list. .dl-horizontal:before, .dl-horizontal:after { display: table; content: ""; line-height: 0; } .dl-horizontal:after { clear: both; } .dl-horizontal > dt { float: left; clear: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; margin-top: 1.0rem; width: 25%; } .dl-horizontal > dd { margin-left: 25%; padding-left: 1.0rem; } {--!} List item counters. dl { counter-reset: dl-counter; } dl > dt { counter-increment: dl-counter; } ol { counter-reset: ol-counter; } ol > li { counter-increment: ol-counter; } ul { counter-reset: ul-counter; } ul > li { counter-increment: ul-counter; } {--!} Prefix list counter to counter class element content. .dl-counter:before { content: counter(dl-counter) " "; } .ol-counter:before { content: counter(ol-counter) " "; } .ul-counter:before { content: counter(ul-counter) " "; } {--!} Number labeled list items. .dl-numbered > dt:before { content: counter(dl-counter) ". "; } {--!} Printing. @media print { .no-print, .no-print * { display: none !important; } a:hover { text-decoration: none !important; } } </style> {--section-numbers=}.+skip <style> /* Section numbers. */ body,h1 { counter-reset: h2-counter; } h2 { counter-reset: h3-counter; } #article > h2:before { content: counter(h2-counter) ". "; counter-increment: h2-counter; } #article > h3:before { content: counter(h2-counter) "." counter(h3-counter) ". "; counter-increment: h3-counter; } </style> // Common to --sidebar-toc and --dropdown-toc. {--no-toc!}.+skip <style> #toc { padding-left: 1rem; } #toc h2 { font-size: 125%; margin-top:1.0rem; margin-left: 0; } #toc .h1 { font-size: 110%; font-weight: bold; margin-top: 0.5rem; margin-bottom: 0.4rem; } #toc .h2 { margin-top: 0.4rem; } #toc .h3 { margin-left: 1.5rem; font-size: 90%; } #toc div[class^="h"]:nth-child(even) { background-color: #f8f8f8; } #auto-toc { width: 100%; } </style> {--header-links=}.+skip <style> .header-link { text-decoration: none; color: lightgray; visibility: hidden; } .header-link:hover { text-decoration: none; color: gray; } .header-link::before { content: " \00b6"; } h2:hover > .header-link, h3:hover > .header-link { visibility: visible; } @media print { .header-link { display: none !important; } } </style> /* Layout styles */ <style> #article { padding-left: 2rem; padding-right: 1rem; max-width: {--max-text-width}; } </style> {--sidebar-toc=}.+skip <style> #article { margin-left: 20rem; } #toc { position: fixed; top: 0; left: 0; bottom: 0; width: 20rem; border-right: 1px solid #cccccc; overflow-y: auto; overflow-x: hidden; box-shadow: 0 0 3px rgba(0, 0, 0, 0.35); } @media screen and {--small-screen} { {--!} Sidebar TOC hidden as it does not work on small screens. #article { margin-left: 0; } #toc { display: none !important; } } </style> {--dropdown-toc=}.+skip <style> .show-toc #toc { display: block !important; } #toc-button { position: fixed; top: 22px; left: 15px; z-index: 1; cursor: pointer; color: silver; font-size: 3.2rem; } #toc { display: none; position: fixed; top: 55px; left: 17px; right: 10%; z-index: 1; max-width: 30rem; max-height: 80%; overflow-y: auto; background-color: {--primary-background}; box-shadow: 0 0 10px rgba(0, 0, 0, 0.35); } #article { margin-left: 2rem; } </style> // Format (non-layout) related styles. <style> @media screen and {--small-screen} { body { font-size: 20px; } } @media print { #article { margin-left: 0; max-width: 100%; } } </style> /* Theme related styles */ {--theme!.*\bgraystone\b.*}.+skip <style> h1, h2 { text-transform: uppercase; } </style> {--head} </head> <body> // Include dropdown TOC button. {--dropdown-toc=}.+skip <div id="toc-button" class="no-print">&#8801;</div> // Include TOC unless a custom TOC is specified. .+skip {--no-toc=}.-skip {--custom-toc!}.+skip <div id="toc" class="no-print"> <div id="auto-toc"></div> </div> <div id="article">''', 'v8-footer.rmu': r'''/* Used by rimuc `--layout v8` option. DEPRECATED: This layout is no longer maintained, for Rimu version 8 compatibility. */ // Close contents div. </div> {--highlightjs!}<script src="https://yandex.st/highlightjs/7.3/highlight.min.js"></script><script>hljs.initHighlightingOnLoad();</script> {--mathjax!}<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script> <script> window.onload = function() { var headings = [].slice.call(document.body.querySelectorAll('#contents > h1, #contents > h2, #contents > h3')); headings.forEach(function(heading, index) { var title = heading.textContent; var id = heading.getAttribute('id'); if (!id) { id = slugify(title); heading.setAttribute('id', id); } if (index === 0 && heading.tagName === 'H1') { id = ''; // Go to top of page. } {--sidebar-toc!} appendTocEntry(heading, id); {--dropdown-toc!} appendTocEntry(heading, id); }); } function slugify(text) { var slug = text.replace(/\s+/g, '-') // Replace spaces with dashes. .replace(/[^\w-]/g, '') // Retain alphanumeric, '-' and '_' characters. .toLowerCase() if (!slug) slug = 'x'; if (document.getElementById(slug)) { // Another element already has that id. var i = 2, prefix = slug; while (document.getElementById(slug = prefix + '-' + i++)) {} } return slug; } </script> .+skip {--sidebar-toc!}.-skip {--dropdown-toc!}.-skip <script> function appendTocEntry(heading, id) { if (heading.classList.contains('no-auto-toc')) { return; } var container = document.getElementById('auto-toc'); if (container === null) { return; } var tocLink = document.createElement('a'); tocLink.setAttribute('href', '#' + id); tocLink.textContent = heading.textContent; var tocEntry = document.createElement('div'); tocEntry.setAttribute('class', heading.tagName.toLowerCase()); tocEntry.appendChild(tocLink); container.appendChild(tocEntry); } </script> {--dropdown-toc=}.+skip <script> function toggleToc() { document.getElementById("toc").classList.toggle('toc-visible'); } window.onclick = function(event) { if (!Element.prototype.matches) { // matches() polyfill for old browsers. var p = Element.prototype; if (p.webkitMatchesSelector) // Chrome <34, SF<7.1, iOS<8 p.matches = p.webkitMatchesSelector; if (p.msMatchesSelector) // IE9/10/11 & Edge p.matches = p.msMatchesSelector; if (p.mozMatchesSelector) // FF<34 p.matches = p.mozMatchesSelector; } if (!event.target.matches('#toc-button, #toc, #toc :not(a)')) { // Hide TOC if clicked outside TOC or on TOC link. var toc = document.getElementById('toc'); if (toc.classList.contains('toc-visible')) { toc.classList.remove('toc-visible'); } } } </script> </body> </html>''', 'classic-footer.rmu': r'''/* Used by rimuc.js --styled option. */ // Close article div. </div> {--highlightjs=}.+skip {--highlightjs-scripts} {--mathjax!}{--mathjax-scripts} .+skip {--no-toc=}.-skip {--header-links!}.-skip <script> window.onload = function() { var headings = [].slice.call(document.body.querySelectorAll('#article > h1, #article > h2, #article > h3')); headings.forEach(function(heading) { {--header-links!} setHeaderLink(heading); {--no-toc=} appendTocEntry(heading); }); } </script> {--header-links=}.+skip <script> function setHeaderLink(heading) { var id = heading.getAttribute('id'); if (id) { var link = document.createElement('a'); link.classList.add('header-link'); link.setAttribute('href', '#' + id); heading.appendChild(link); } } </script> {--no-toc!}.+skip <script> function appendTocEntry(heading) { var id = heading.getAttribute('id'); if (heading.classList.contains('no-auto-toc')) { return; } var container = document.getElementById('auto-toc'); if (container === null) { return; } var tocLink = document.createElement('a'); tocLink.setAttribute('href', '#' + id); tocLink.textContent = heading.textContent; var tocEntry = document.createElement('div'); tocEntry.setAttribute('class', heading.tagName.toLowerCase()); tocEntry.appendChild(tocLink); container.appendChild(tocEntry); } </script> {--dropdown-toc=}.+skip <script> // matches() polyfill for old browsers. if (!Element.prototype.matches) { var p = Element.prototype; if (p.webkitMatchesSelector) // Chrome <34, SF<7.1, iOS<8 p.matches = p.webkitMatchesSelector; if (p.msMatchesSelector) // IE9/10/11 & Edge p.matches = p.msMatchesSelector; if (p.mozMatchesSelector) // FF<34 p.matches = p.mozMatchesSelector; } window.onclick = function(event) { var body = document.getElementsByTagName('body')[0]; if (event.target.matches('#toc-button, #toc a')) { // Toggle TOC if TOC button or TOC link is clicked. body.classList.toggle('show-toc'); } else if (!event.target.matches('#toc, #toc *')) { // Hide TOC if clicked outside TOC. body.classList.remove('show-toc'); } } </script> </body> </html>''', 'v8-header.rmu': r'''/* Used by rimuc `--layout v8` option. DEPRECATED: This layout is no longer maintained, for Rimu version 8 compatibility. Styled using Bootstrap. Syntax highlighting with Highlight.js Bootstrap and Highlight.js sourced from CDNs. */ // Set macro default values. {--highlightjs?} = '' {--mathjax?} = '' {--section-numbers?} = '' {--lang?} = '' {--title?} = '&nbsp;' {--custom-toc?} = '' {--theme?} = 'default' {--sidebar-toc?} = '' {--dropdown-toc?} = '' // DEPRECATED --toc: If --toc is non-blank make --sidebar-toc non-blank. {--toc?} = '' {--sidebar-toc} = '{--toc}{--sidebar-toc}' <!DOCTYPE HTML> <html lang="{--lang}"> <head> {--!} Force IE into Standards mode. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="UTF-8"> <title>{--title}</title> <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css"> <link rel="stylesheet" href="https://yandex.st/highlightjs/7.3/styles/default.min.css"> <style> /* Bootstrap tweaks. */ body { margin: 1em; max-width: 50em; font-family: Arial, Helvetica, sans-serif; } h1, h2, h3, h4, h5, h6 { color: #527bbd; } h1 { font-size: 2.2em; } h2 { font-size: 1.5em; } h3 { font-size: 1.2em; } h4 { font-size: 1.1em; } h5 { font-size: 1.0em; } h6 { font-size: 0.9em; } h2, h3, h4, h5, h6 { line-height: normal; margin-top: 1.0em; margin-bottom: 0.2em; } h2 { margin-top: 1.5em; border-bottom: 1px solid rgba(0, 0, 0, 0.15); } a, a:hover { color: #527bbd; } li, dd { margin-bottom: 0.25em; } p, pre, li, dt, dd, blockquote p { font-size: inherit; line-height: 1.45; margin-top: 0.5em; margin-bottom: 0.5em; } blockquote { border: none; border-left: 5px solid #eeeeee; font-family: Georgia, serif; font-style: italic; width: 80%; margin: 1.5em 0; color: #383838; } .cite { font-style: italic; color:#777; padding:5px 0; } .cite::before { content: "\2014 \2009"; } pre { padding: 6px; line-height: normal; } .light-background { background-color: #f8f8f8; border: none; } code { color: inherit; font-size: inherit; } *:not(pre) > code { border: none; background-color: #f8f8f8; } .dl-horizontal > dt { text-align: left; margin-top: 1.0em; } .dl-horizontal > dd { margin-top: 1.0em; } /* highlight.js tweaks. */ pre > code { background-color: inherit; padding: 0; } pre span { opacity: 1 !important; } /* Rimu styles. */ {--!} Apply verse class to Normal Paragraphs and Division blocks. .verse { margin: 1.5em 20px; } div.verse p, p.verse { font-family: Georgia, serif; white-space:pre; margin-top: 0.75em; margin-bottom: 0.75em; } {--!} Apply sidebar class to Normal Paragraphs and Division blocks. .sidebar { border: 1px solid silver; border-radius:4px; background: #ffffee; padding: 10px; margin: 1.5em 20px; } div.sidebar *:first-child { margin-top: 0.2em; } /* List item counters and definition list numbering. */ {--!} List item counters. dl { counter-reset: dl-counter; } dl > dt { counter-increment: dl-counter; } ol { counter-reset: ol-counter; } ol > li { counter-increment: ol-counter; } ul { counter-reset: ul-counter; } ul > li { counter-increment: ul-counter; } {--!} Prefix list counter to counter class element content. .dl-counter:before { content: counter(dl-counter) " "; } .ol-counter:before { content: counter(ol-counter) " "; } .ul-counter:before { content: counter(ul-counter) " "; } {--!} Number labeled list items. .dl-numbered > dt:before { content: counter(dl-counter) ". "; } {--!} Force page break before the element. .page-break { page-break-before: always; } {--!} Avoid page breaks inside the element. .no-page-break { page-break-inside: avoid; } {--!} Text block alignment classes. .align-left { text-align: left; } .align-center { text-align: center; } .align-right { text-align: right; } {--!} Do not wrap line breaks. .line-breaks { white-space:pre; } </style> {--section-numbers=}.+skip <style> /* Section numbers. */ body,h1 { counter-reset: h2-counter; } h2 { counter-reset: h3-counter; } #contents > h2:before { content: counter(h2-counter) ". "; counter-increment: h2-counter; } #contents > h3:before { content: counter(h2-counter) "." counter(h3-counter) ". "; counter-increment: h3-counter; } </style> {--sidebar-toc=}.+skip <style> body { padding-left: 21em; } #toc { position: fixed; top: 0; left: 0; bottom: 0; width: 18em; border-right: 1px solid #cccccc; overflow-y: auto; overflow-x: hidden; box-shadow: 0 0 3px rgba(0, 0, 0, 0.35); } </style> {--dropdown-toc=}.+skip <style> .toc-visible { display: block !important; } #toc-button { position: fixed; top: 22px; left: 15px; z-index: 1; cursor: pointer; color: silver; font-size:3.2em; } #toc { display: none; position: fixed; top: 55px; left: 15px; right: 10%; z-index: 1; max-width: 30em; max-height: 80%; overflow-y: auto; background-color: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.35); } #contents { margin-left: 40px; } </style> // Common to --sidebar-toc and --dropdown-toc. .+skip {--sidebar-toc!}.-skip {--dropdown-toc!}.-skip <style> @media print { .no-print, .no-print * { display: none !important; } body { padding-left: 1em; } } #toc { padding-left: 1em; } #toc .h1 { font-size: 110%; font-weight: bold; margin-top: 0.5em; margin-bottom: 0.4em; } #toc .h2 { margin-top: 0.4em; } #toc .h3 { margin-left: 1.5em; font-size: 90%; } #toc div:nth-child(even) { background-color: #f8f8f8; } </style> {--theme!.*\bgraystone\b.*}.+skip <style> body { font-size: 13pt; } h1, h2, h3, h4, h5, h6 { color: #888; } h1, h2 { text-transform: uppercase; } a, a:hover { color: #888; text-decoration: underline; } @media print { a { text-decoration: none; } } </style> </head> <body> // Include dropdown TOC button unless a custom TOC is specified. {--dropdown-toc=}.+skip {--custom-toc!}.+skip <div id="toc-button" onclick="toggleToc()" class="no-print">&#8801;</div> // Include for sidebar and dropdown TOC unless a custom TOC is specified. .+skip {--sidebar-toc!}.-skip {--dropdown-toc!}.-skip {--custom-toc!}.+skip <div id="toc" class="no-print"> <div id="auto-toc"></div> </div> <div id="contents">''', 'flex-header.rmu': r'''/* Used by rimuc `--layout flex` option. */ /* Default values for styling themes and content options. */ {--section-numbers?} = '' {--lang?} = '' {--title?} = '&nbsp;' {--theme?} = '' {--no-toc?} = '' {--custom-toc?} = '' {--header-links?} = '' {--small-screen?} = '(max-width: 800px)' {--meta?} = '<meta charset="UTF-8"> {--!} Make old IE versions use the latest rendering engine. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">' // Additional <head> child elements. {--head?} = '' {--highlightjs?} = '' {--highlightjs-css} = '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">' {--highlightjs-scripts} = '<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> <script> hljs.configure({languages: []}); hljs.initHighlightingOnLoad(); </script>' {--mathjax?} = '' {--mathjax-scripts} = '<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script>' // List item CSS counters. {--dl-counter} = '<span class="dl-counter"></span>' {--ol-counter} = '<span class="ol-counter"></span>' {--ul-counter} = '<span class="ul-counter"></span>' /* Legend theme. */ {--theme!.*\blegend\b.*}.+skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#34495e' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#428bca' {--border-radius?} = '0' {--max-text-width?} = '50rem' .. /* Vintage theme. */ {--theme!.*\bvintage\b.*}.+skip // Default to this theme if none of the built-in themes is specified. {--theme!.*\b(legend|vintage|graystone)\b.*}.-skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#527bbd' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#527bbd' {--border-radius?} = '4px' {--max-text-width?} = '50rem' .. /* Graystone theme. */ {--theme!.*\bgraystone\b.*}.+skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#888' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#888' {--border-radius?} = '0' {--max-text-width?} = '50rem' .. /* HTML header */ <!DOCTYPE HTML> {--lang=}<html> {--lang!}<html lang="{--lang}"> <head> {--meta} <title>{--title}</title> {--highlightjs!}{--highlightjs-css} /* Layout independent styles */ <style> :root { font-size: 16px; line-height: 20px; color: {--text-color}; background-color: {--primary-background}; font-family: {--sans-font}; } * { margin: 0; padding: 0; white-space: inherit; box-sizing: border-box; } h1, h2, h3, h4, h5, h6 { margin: 10px 0; color: {--primary-color}; } h1 { font-size: 2.2rem; line-height: 40px;} h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; } h4 { font-size: 1.1rem; } h5 { font-size: 1.0rem; } h6 { font-size: 0.9rem; } h2, h3, h4, h5, h6 { line-height: normal; margin-top: 1.0rem; margin-bottom: 0.2rem; } h2 { margin-top: 1.5rem; border-bottom: 1px solid {--border-color}; } img { max-width: 100%; } table { border-collapse: collapse; width: 100%; } td, th { text-align: left; vertical-align: top; } {--!} tbody necessary because: https://stackoverflow.com/questions/7490364/why-do-browsers-still-inject-tbody-in-html5 table.bordered > tbody > tr > th, table.bordered > tbody > tr > td { border: 1px solid {--border-color}; } a, a:hover { color: {--primary-color}; } a { text-decoration: none; } a:hover { text-decoration: underline; } p, pre, li, dt, dd, blockquote p { line-height: 1.45; margin-top: 0.5rem; margin-bottom: 0.5rem; } ul, ol { padding: 0; margin: 0 0 10px 25px; } dt { margin-bottom: 0; font-style: italic; } dd { margin-left: 1.0rem; margin-top: 0; } blockquote { padding: 0 0 0 15px; border: none; border-left: 5px solid #eeeeee; font-family: {--serif-font}; width: 80%; margin: 1.5em 0; color: #383838; } .cite { color: #777; padding: 5px 0; } .cite::before { content: "\2014 \2009"; } code { font-family: {--mono-font}; {--!} Monspace fonts are relatively oversized. font-size: {--mono-size}; background-color: {--code-background}; } {--highlightjs!} .hljs { background-color: {--code-background}; } pre { font-family: {--mono-font}; line-height: normal; white-space: pre-wrap; background-color: {--code-background}; border: 1px solid {--border-color}; border-radius: {--border-radius}; padding: 6px; } .light-background { background-color: {--code-background}; border: none; white-space: pre-wrap; } *:not(pre) > code { white-space: nowrap; } .dl-horizontal > dd { margin-top: 1.0rem; } pre > code { background-color: inherit; {--!} highlight.js tweak. padding: 0; } pre span { {--!} highlight.js tweak. opacity: 1 !important; } {--!} Rimu classes. {--!} Apply verse class to Normal Paragraphs and Division blocks. .verse { margin: 1.5em 20px; } div.verse p, p.verse { font-family: {--serif-font}; white-space: pre; margin-top: 0.75rem; margin-bottom: 0.75rem; } {--!} Apply sidebar class to Normal Paragraphs and Division blocks. .sidebar { border: 1px solid {--border-color}; border-radius: {--border-radius}; background: {--sidebar-background}; padding: 10px; margin: 1.5em 0; } div.sidebar *:first-child { margin-top: 0.2rem; } {--!} Force page break before the element. .page-break { page-break-before: always; } {--!} Avoid page breaks inside the element. .no-page-break { page-break-inside: avoid; } {--!} Text block alignment classes. .align-left { text-align: left; } .align-center { text-align: center; } .align-right { text-align: right; } {--!} Preserve line breaks. .preserve-breaks { white-space: pre; } {--!} DEPRECATED: Use `preserve-breaks` instead. .line-breaks { white-space: pre; } {--!} Horizontal labeled list. .dl-horizontal:before, .dl-horizontal:after { display: table; content: ""; line-height: 0; } .dl-horizontal:after { clear: both; } .dl-horizontal > dt { float: left; clear: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; margin-top: 1.0rem; width: 25%; } .dl-horizontal > dd { margin-left: 25%; padding-left: 1.0rem; } {--!} List item counters. dl { counter-reset: dl-counter; } dl > dt { counter-increment: dl-counter; } ol { counter-reset: ol-counter; } ol > li { counter-increment: ol-counter; } ul { counter-reset: ul-counter; } ul > li { counter-increment: ul-counter; } {--!} Prefix list counter to counter class element content. .dl-counter:before { content: counter(dl-counter) " "; } .ol-counter:before { content: counter(ol-counter) " "; } .ul-counter:before { content: counter(ul-counter) " "; } {--!} Number labeled list items. .dl-numbered > dt:before { content: counter(dl-counter) ". "; } {--!} Printing. @media print { .no-print, .no-print * { display: none !important; } a:hover { text-decoration: none !important; } } </style> {--section-numbers=}.+skip <style> /* Section numbers. */ body,h1 { counter-reset: h2-counter; } h2 { counter-reset: h3-counter; } #article > h2:before { content: counter(h2-counter) ". "; counter-increment: h2-counter; } #article > h3:before { content: counter(h2-counter) "." counter(h3-counter) ". "; counter-increment: h3-counter; } </style> {--no-toc!}.+skip <style> #toc .h1 { font-size: 110%; font-weight: bold; margin-top: 0.5rem; margin-bottom: 0.4rem; } #toc .h2 { margin-top: 0.4rem; } #toc .h3 { margin-left: 1.5rem; font-size: 90%; } #toc div[class^="h"]:nth-child(even) { background-color: #f8f8f8; } #auto-toc { width: 100%; } </style> {--header-links=}.+skip <style> .header-link { text-decoration: none; color: lightgray; visibility: hidden; } .header-link:hover { text-decoration: none; color: gray; } .header-link::before { content: " \00b6"; } h2:hover > .header-link, h3:hover > .header-link { visibility: visible; } @media print { .header-link { display: none !important; } } </style> /* Layout styles */ <style> #article > * { max-width: {--max-text-width}; } #article, #toc { padding-left: 1rem; padding-right: 1rem; } {--!} Small screen. @media screen and {--small-screen} { #article, #toc { padding-left: 10px; padding-right: 10px; } } </style> // TOC specific styles. // Flexbox layout inspired by https://codepen.io/VinSpee/pen/zxBJVO {--no-toc!}.+skip <style> html, body { height: 100%; min-height: 100%; overflow: hidden; } body { display: flex; } #nav { flex: auto; order: 1; flex-grow: 0; background: {--primary-color}; } #toc { display: none; flex: auto; order: 2; overflow-y: scroll; height: 100%; width: 100%; } #toc h2 { font-size: 125%; margin-top:1.0rem; } #toc-button { cursor: pointer; color: white; font-size: 48px; font-family: Arial; display: inline-block; } #article { flex: auto; order: 3; overflow-y: scroll; width: 100%; } #close-icon { display: none; } .show-toc #toc { display: block !important; } .show-toc #article { display: none !important; } .show-toc #menu-icon { display: none !important; } .show-toc #close-icon { display: inline !important; } @media print { html, body { height: auto; min-height: 0; } #article, #toc { overflow-y: visible; } } </style> {--no-toc!}.+skip <style> {--!} Side-bar for large screen and small screen landscape mode. body { flex-direction: row; } #nav { height: 100%; width: 40px; } #toc-button { padding-left: 4px; padding-top: 15px; } {--!} Top-bar for small screen portrait mode. @media screen and {--small-screen} and (orientation: portrait) { body { flex-direction: column; } #nav { height: 40px; width: 100%; } #toc-button { padding-left: 10px; padding-top: 10px; } } </style> // Format (non-layout) related styles. <style> @media screen and {--small-screen} { body { font-size: 20px; } } </style> /* Theme related styles */ {--theme!.*\bgraystone\b.*}.+skip <style> h1, h2 { text-transform: uppercase; } </style> {--head} </head> <body> // Include TOC menu bar if a TOC is specified. {--no-toc!}.+skip <div id="nav" class="no-print"> <span id="toc-button"> <span id="menu-icon">&#8801;</span> <span id="close-icon">&times;</span> </span> </div> // Include TOC unless a custom TOC is specified. .+skip {--no-toc=}.-skip {--custom-toc!}.+skip <div id="toc"> <div id="auto-toc"></div> </div> <div id="article">''', 'sequel-header.rmu': r'''/* Used by rimuc `--layout sequel` option. */ /* Default values for styling themes and content options. */ {--section-numbers?} = '' {--lang?} = '' {--title?} = '&nbsp;' {--theme?} = '' {--no-toc?} = '' {--custom-toc?} = '' {--header-links?} = '' {--!} The min-width: 1px clause stops page load transitions in IE11 and Edge (https://stackoverflow.com/a/25850649). {--small-screen?} = '(min-width: 1px) and (max-width: 800px)' {--meta?} = '<meta charset="UTF-8"> {--!} Make old IE versions use the latest rendering engine. <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">' // Additional <head> element children. {--head?} = '' {--highlightjs?} = '' {--highlightjs-css} = '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">' {--highlightjs-scripts} = '<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> <script> hljs.configure({languages: []}); hljs.initHighlightingOnLoad(); </script>' {--mathjax?} = '' {--mathjax-scripts} = '<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"></script>' // List item CSS counters. {--dl-counter} = '<span class="dl-counter"></span>' {--ol-counter} = '<span class="ol-counter"></span>' {--ul-counter} = '<span class="ul-counter"></span>' // Sequel layout specific. {--toc-width?} = '300px' {--nav-width?} = '40px' {--content-margin?} = '340px' {--transition-duration?} = '0.2s' /* Legend theme. */ {--theme!.*\blegend\b.*}.+skip // Default to this theme if none of the built-in themes is specified. {--theme!.*\b(legend|vintage|graystone)\b.*}.-skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#34495e' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#428bca' {--border-radius?} = '0' {--max-text-width?} = '55rem' .. /* Vintage theme. */ {--theme!.*\bvintage\b.*}.+skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#527bbd' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#527bbd' {--border-radius?} = '4px' {--max-text-width?} = '55rem' .. /* Graystone theme. */ {--theme!.*\bgraystone\b.*}.+skip .. {--sans-font?} = 'Helvetica, Arial, sans-serif' {--serif-font?} = 'Georgia, Times, serif' {--mono-font?} = 'Consolas, "Andale Mono", Monaco, monospace' {--mono-size?} = '90%' {--text-color?} = '#333333' {--border-color?} = '#dddddd' {--primary-color?} = '#888' {--primary-background?} = 'white' {--code-background?} = '#f8f8f8' {--sidebar-background?} = '#ffffee' {--link-color?} = '#888' {--border-radius?} = '0' {--max-text-width?} = '55rem' .. /* HTML header */ <!DOCTYPE HTML> {--lang=}<html> {--lang!}<html lang="{--lang}"> <head> {--meta} <title>{--title}</title> {--highlightjs!}{--highlightjs-css} /* Layout independent styles */ <style> :root { font-size: 16px; line-height: 20px; color: {--text-color}; background-color: {--primary-background}; font-family: {--sans-font}; } * { margin: 0; padding: 0; white-space: inherit; box-sizing: border-box; } h1, h2, h3, h4, h5, h6 { margin: 10px 0; color: {--primary-color}; } h1 { font-size: 2.2rem; line-height: 40px;} h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; } h4 { font-size: 1.1rem; } h5 { font-size: 1.0rem; } h6 { font-size: 0.9rem; } h2, h3, h4, h5, h6 { line-height: normal; margin-top: 1.0rem; margin-bottom: 0.2rem; } h2 { margin-top: 1.5rem; border-bottom: 1px solid {--border-color}; } img { max-width: 100%; } table { border-collapse: collapse; table-layout: fixed; width: 100%; } td, th { text-align: left; vertical-align: top; } {--!} tbody necessary because: https://stackoverflow.com/questions/7490364/why-do-browsers-still-inject-tbody-in-html5 table.bordered > tbody > tr > th, table.bordered > tbody > tr > td { border: 1px solid {--border-color}; } a, a:hover { color: {--link-color}; } a { text-decoration: none; } a:hover { text-decoration: underline; } p, pre, li, dt, dd, blockquote p { line-height: 1.45; margin-top: 0.5rem; margin-bottom: 0.5rem; } ul, ol { padding: 0; margin: 0 0 10px 25px; } dt { margin-bottom: 0; font-style: italic; } dd { margin-left: 1.0rem; margin-top: 0; } blockquote { padding: 0 0 0 15px; border: none; border-left: 5px solid #eeeeee; font-family: {--serif-font}; width: 80%; margin: 1.5em 0; color: #383838; } .cite { color: #777; padding: 5px 0; } .cite::before { content: "\2014 \2009"; } code { font-family: {--mono-font}; {--!} Monspace fonts are relatively oversized. font-size: {--mono-size}; background-color: {--code-background}; } {--highlightjs!} .hljs { background-color: {--code-background}; } pre { font-family: {--mono-font}; line-height: normal; white-space: pre-wrap; background-color: {--code-background}; border: 1px solid {--border-color}; border-radius: {--border-radius}; padding: 6px; } .light-background { background-color: {--code-background}; border: none; white-space: pre-wrap; } {--!} Do not break hyphenated words or white space inside code quotes. *:not(pre) > code { white-space: nowrap; } .dl-horizontal > dd { margin-top: 1.0rem; } pre > code { background-color: inherit; {--!} highlight.js tweak. padding: 0; } pre span { {--!} highlight.js tweak. opacity: 1 !important; } {--!} Rimu classes. {--!} Apply verse class to Normal Paragraphs and Division blocks. .verse { margin: 1.5em 20px; } div.verse p, p.verse { font-family: {--serif-font}; white-space: pre-wrap; margin-top: 0.75rem; margin-bottom: 0.75rem; } {--!} Apply sidebar class to Normal Paragraphs and Division blocks. .sidebar { border: 1px solid {--border-color}; border-radius: {--border-radius}; background: {--sidebar-background}; padding: 10px; margin: 1.5em 0; } div.sidebar *:first-child { margin-top: 0.2rem; } {--!} Force page break before the element. .page-break { page-break-before: always; } {--!} Avoid page breaks inside the element. .no-page-break { page-break-inside: avoid; } {--!} Text block alignment classes. .align-left { text-align: left; } .align-center { text-align: center; } .align-right { text-align: right; } {--!} Preserve line breaks. .preserve-breaks { white-space: pre; } {--!} DEPRECATED: Use `preserve-breaks` instead. .line-breaks { white-space: pre-wrap; } {--!} Horizontal labeled list. .dl-horizontal:before, .dl-horizontal:after { display: table; content: ""; line-height: 0; } .dl-horizontal:after { clear: both; } .dl-horizontal > dt { float: left; clear: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; margin-top: 1.0rem; width: 25%; } .dl-horizontal > dd { margin-left: 25%; padding-left: 1.0rem; } {--!} List item counters. dl { counter-reset: dl-counter; } dl > dt { counter-increment: dl-counter; } ol { counter-reset: ol-counter; } ol > li { counter-increment: ol-counter; } ul { counter-reset: ul-counter; } ul > li { counter-increment: ul-counter; } {--!} Prefix list counter to counter class element content. .dl-counter:before { content: counter(dl-counter) " "; } .ol-counter:before { content: counter(ol-counter) " "; } .ul-counter:before { content: counter(ul-counter) " "; } {--!} Number labeled list items. .dl-numbered > dt:before { content: counter(dl-counter) ". "; } {--!} Printing. @media print { .no-print, .no-print * { display: none !important; } a:hover { text-decoration: none !important; } } </style> {--section-numbers=}.+skip <style> /* Section numbers. */ body,h1 { counter-reset: h2-counter; } h2 { counter-reset: h3-counter; } #article > h2:before { content: counter(h2-counter) ". "; counter-increment: h2-counter; } #article > h3:before { content: counter(h2-counter) "." counter(h3-counter) ". "; counter-increment: h3-counter; } </style> // TOC styling. {--no-toc!}.+skip <style> #toc h2 { font-size: 125%; padding-left: 1rem; margin-top:1.0rem; margin-left: 0; } #toc .h1 { font-size: 110%; font-weight: bold; padding-left: 1rem; margin-top: 0.5rem; margin-bottom: 0.4rem; } #toc .h2 { padding-left: 1rem; margin-top: 0.4rem; } #toc .h3 { padding-left: 2.5rem; font-size: 90%; } #toc div[class^="h"]:nth-child(even) { background-color: #f8f8f8; } #auto-toc { width: 100%; } #toc a, #toc a:hover { color: {--primary-color}; } </style> {--header-links=}.+skip <style> .header-link { text-decoration: none; color: lightgray; visibility: hidden; } .header-link:hover { text-decoration: none; color: gray; } .header-link::before { content: " \00b6"; } h2:hover > .header-link, h3:hover > .header-link { visibility: visible; } @media print { .header-link { display: none !important; } } </style> /* Layout styles */ <style> #main { z-index: 1; min-height: 100%; max-width: {--max-text-width}; margin-left: 0; padding-left: 40px; padding-right: 40px; } #article { padding-top: 1px; } </style> {--no-toc!}.+skip <style> #main { margin-left: {--content-margin}; } #nav { z-index: 3; position: fixed; left: 0; height: 100%; width: {--nav-width}; background-color: {--primary-color}; color: white; } #sidebar { z-index: 2; position: fixed; top: 0; left: 0; bottom: 0; margin-left: {--nav-width}; width: {--toc-width}; overflow: auto; border-right: 1px solid #ccc; background: #eee; } body.hide-toc #sidebar { width: 0; } body.hide-toc #main { margin-left: {--nav-width}; } #toc-button { cursor: pointer; color: white; font-size: 48px; line-height: 40px; font-family: Arial, sans-serif; display: inline-block; padding-left: 5px; } {--!} Apply TOC slide in/out transition when not in small screen mode. @media not screen and {--small-screen} { #sidebar { opacity: 1; transition: opacity {--transition-duration} ease; } body.hide-toc #sidebar { width: 0; opacity: 0; } #main { transition: margin-left {--transition-duration} ease; } body.hide-toc #main { transition: margin-left {--transition-duration} ease; } } @media screen and {--small-screen} { body:not(.hide-toc) { {--!} Hide body Y scroll bar when #main content is hidden. overflow: hidden; } body:not(.hide-toc) #sidebar { width: 100%; } #main { margin-left: {--nav-width}; } body:not(.hide-toc) #main { visibility: hidden; } #toc { margin-right: 40px; } } </style> <style> @media screen and {--small-screen} { body { font-size: 20px; } #main { padding-left: 10px; padding-right: 10px; } * { overflow-wrap: break-word; } } </style> <style> @media print { #main { margin-left: 0; } } </style> /* Theme related styles */ {--theme!.*\bgraystone\b.*}.+skip <style> h1, h2 { text-transform: uppercase; } </style> {--head} </head> <body> {--no-toc!}.+skip <div id="nav" class="no-print"> <span id="toc-button">&#8801;</span> </div> {--no-toc!}.+skip <div id="sidebar" class="no-print"> // Include TOC unless no TOC or custom TOC is specified. {--no-toc!}.+skip {--custom-toc!}.+skip <div id="toc" class="no-print"> <div id="auto-toc"></div> </div> {--no-toc!}.+skip </div> <div id="main"> <div id="article">''', 'plain-header.rmu': r'''/* Used by rimuc `--layout plain` option. */ {--lang?} = '' {--title?} = 'Title' {--meta?} = '<meta charset="UTF-8">' // Additional <head> element children. {--head?} = '' <!DOCTYPE html> {--lang=}<html> {--lang!}<html lang="{--lang}"> <head> {--meta} <title>{--title}</title> {--head} </head> <body>''', 'flex-footer.rmu': r'''/* Used by rimuc.js --styled option. */ // Close article div. </div> {--highlightjs=}.+skip {--highlightjs-scripts} {--mathjax!}{--mathjax-scripts} .+skip {--no-toc=}.-skip {--header-links!}.-skip <script> window.onload = function() { {--no-toc=} document.getElementsByTagName('body')[0].appendChild(document.getElementById('toc')); // Ensure custom TOC is child of body. var headings = [].slice.call(document.body.querySelectorAll('#article > h1, #article > h2, #article > h3')); headings.forEach(function(heading) { {--header-links!} setHeaderLink(heading); {--no-toc=} appendTocEntry(heading); }); } </script> {--header-links=}.+skip <script> function setHeaderLink(heading) { var id = heading.getAttribute('id'); if (id) { var link = document.createElement('a'); link.classList.add('header-link'); link.setAttribute('href', '#' + id); heading.appendChild(link); } } </script> {--no-toc!}.+skip <script> function appendTocEntry(heading) { var id = heading.getAttribute('id'); if (heading.classList.contains('no-auto-toc')) { return; } var container = document.getElementById('auto-toc'); if (container === null) { return; } var tocLink = document.createElement('a'); tocLink.setAttribute('href', '#' + id); tocLink.textContent = heading.textContent; var tocEntry = document.createElement('div'); tocEntry.setAttribute('class', heading.tagName.toLowerCase()); tocEntry.appendChild(tocLink); container.appendChild(tocEntry); } // matches() polyfill for old browsers. if (!Element.prototype.matches) { var p = Element.prototype; if (p.webkitMatchesSelector) // Chrome <34, SF<7.1, iOS<8 p.matches = p.webkitMatchesSelector; if (p.msMatchesSelector) // IE9/10/11 & Edge p.matches = p.msMatchesSelector; if (p.mozMatchesSelector) // FF<34 p.matches = p.mozMatchesSelector; } document.onclick = function(event) { if (event.target.matches('#toc-button *, #toc a')) { // Toggle TOC if TOC button or TOC link is clicked. document.getElementsByTagName('body')[0].classList.toggle('show-toc'); } } </script> </body> </html>''', }
22.970915
152
0.606418
7,294
60,023
4.937757
0.090622
0.011328
0.013327
0.004665
0.767714
0.732091
0.707824
0.691165
0.679948
0.66662
0
0.027589
0.208937
60,023
2,612
153
22.979709
0.73093
0.00095
0
0.704231
1
0.013426
0.995931
0.131129
0
0
0
0
0
1
0
true
0.001221
0.00895
0
0.009764
0.009764
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
7
048c5222cb8c4366ff88bcd2213e7ce7d8ae54c9
107
py
Python
orchestrate_ai/mirex_dataset/trainer.py
amrittb/orchestrate-a
c22e9a8b12f4636569d378b4dece58a4ef1a24cd
[ "MIT" ]
18
2017-02-21T03:06:25.000Z
2021-11-23T16:32:57.000Z
orchestrate_ai/mirex_dataset/trainer.py
justmeshishir/orchestrate-ai
c22e9a8b12f4636569d378b4dece58a4ef1a24cd
[ "MIT" ]
6
2020-01-28T21:42:26.000Z
2022-02-09T23:27:11.000Z
orchestrate_ai/mirex_dataset/trainer.py
justmeshishir/orchestrate-ai
c22e9a8b12f4636569d378b4dece58a4ef1a24cd
[ "MIT" ]
7
2017-02-22T12:31:16.000Z
2021-04-10T20:07:36.000Z
import computation_graph def train_songs(force_reload=False): computation_graph.train_songs(force_reload)
26.75
44
0.878505
15
107
5.866667
0.6
0.363636
0.340909
0.477273
0
0
0
0
0
0
0
0
0.056075
107
4
44
26.75
0.871287
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
8
b6d23093b3bbe56c852429bb22eb9a0ffb961d89
109
py
Python
comch/simplicial/__init__.py
smimic/comch
cbc3249a2599787f2cb514ac61677778a9046063
[ "MIT" ]
4
2020-12-31T21:58:58.000Z
2021-02-27T03:46:46.000Z
comch/simplicial/__init__.py
smimic/comch
cbc3249a2599787f2cb514ac61677778a9046063
[ "MIT" ]
null
null
null
comch/simplicial/__init__.py
smimic/comch
cbc3249a2599787f2cb514ac61677778a9046063
[ "MIT" ]
2
2020-12-31T21:59:09.000Z
2021-01-07T22:22:58.000Z
from .simplicial import Simplex from .simplicial import SimplicialElement from .simplicial import Simplicial
27.25
41
0.862385
12
109
7.833333
0.416667
0.446809
0.638298
0
0
0
0
0
0
0
0
0
0.110092
109
3
42
36.333333
0.969072
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
b6f27fde78e05178f3439023092f8332d1c132ac
8,415
py
Python
daisychain/channel_gmail/tests/test_views.py
daisychainme/daisychain
245d0041f1efd2d6cc110f60aebf2e2dee98bcdb
[ "MIT" ]
5
2016-09-27T10:44:59.000Z
2022-03-29T08:16:44.000Z
daisychain/channel_gmail/tests/test_views.py
daisychainme/daisychain
245d0041f1efd2d6cc110f60aebf2e2dee98bcdb
[ "MIT" ]
null
null
null
daisychain/channel_gmail/tests/test_views.py
daisychainme/daisychain
245d0041f1efd2d6cc110f60aebf2e2dee98bcdb
[ "MIT" ]
null
null
null
from django.db.models.sql.datastructures import BaseTable from django.test import TestCase from django.contrib.auth.models import User from mock import Mock, patch from django.test.client import Client from django.core.urlresolvers import reverse from channel_gmail.channel import GmailChannel from channel_gmail.models import GmailAccount SEND_MAIL = 100 class BaseTestCase(TestCase): def create_user(self): user = User.objects.create_user("John", "john@gmail.com", "secret") user.save() return user def setUp(self): self.user = self.create_user() self.user.save() self.client = Client() self.channel = GmailChannel() class TestConnectView(BaseTestCase): def test_view_without_login(self): response = self.client.get(reverse('gmail:connect')) self.assertRedirects(response, '/accounts/login/?next=/gmail/connect/') def test_view_with_logged_in_user(self): self.client.force_login(self.user) response = self.client.get(reverse('gmail:connect')) self.assertEqual(response.status_code, 302) class TestCallbackView(BaseTestCase): class MockResponse: def __init__(self, data, status_code, ok): self.data = data self.status_code = status_code self.ok = ok def test_callback_without_code(self): self.client.force_login(self.user) response = self.client.get(reverse('gmail:callback')) self.assertEqual(response.status_code, 400) def test_callback_with_user_not_authenticated(self): response = self.client.get(reverse('gmail:callback')) self.assertEqual(response.status_code, 400) @patch('requests.get') @patch('oauth2client.client.OAuth2WebServerFlow.step2_exchange') def test_callback_with_user_and_code(self, mock_step2_exchange, mock_get): self.client.force_login(self.user) flow = 'gANjb2F1dGgyY2xpZW50LmNsaWVudApPQXV0aDJXZWJTZXJ2ZXJGbG93CnEAKYFxAX1xAihYCAAAAGF1dGhfdXJpcQNYLAAAAGh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi92Mi9hdXRocQRYCgAAAHJldm9rZV91cmlxBVgrAAAAaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tL28vb2F1dGgyL3Jldm9rZXEGWA4AAAB0b2tlbl9pbmZvX3VyaXEHWC4AAABodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9vYXV0aDIvdjMvdG9rZW5pbmZvcQhYCgAAAHVzZXJfYWdlbnRxCU5YBgAAAHBhcmFtc3EKfXELKFgNAAAAcmVzcG9uc2VfdHlwZXEMWAQAAABjb2RlcQ1YCwAAAGFjY2Vzc190eXBlcQ5YBwAAAG9mZmxpbmVxD3VYDAAAAHJlZGlyZWN0X3VyaXEQWC4AAABodHRwOi8vYmUxODJlZDUubmdyb2suaW8vZ21haWwvb2F1dGgtY2FsbGJhY2svcRFYDQAAAGNsaWVudF9zZWNyZXRxElgYAAAAMktiQkVlVy1iZ3ExUUNFOXNqRVY5STVPcRNYCgAAAGxvZ2luX2hpbnRxFE5YCQAAAGNsaWVudF9pZHEVWEcAAAA0MDAzODUyNjc2NC1tZzJibHA4NTc2bWY2dHE3YzdsNjVhbzJ0Mmdhbmdray5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbXEWWAoAAABkZXZpY2VfdXJpcRdYMAAAAGh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi9kZXZpY2UvY29kZXEYWAUAAABzY29wZXEZWCoAAABodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2dtYWlsLnNlbmRxGlgUAAAAYXV0aG9yaXphdGlvbl9oZWFkZXJxG05YCQAAAHRva2VuX3VyaXEcWCoAAABodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9vYXV0aDIvdjQvdG9rZW5xHXViLg==' mock_step2_exchange.return_value = 'gANjb2F1dGgyY2xpZW50LmNsaWVudApPQXV0aDJDcmVkZW50aWFscwpxACmBcQF9cQIoWA0AAABjbGllbnRfc2VjcmV0cQNYGAAAADJLYkJFZVctYmdxMVFDRTlzakVWOUk1T3EEWAwAAAB0b2tlbl9leHBpcnlxBWNkYXRldGltZQpkYXRldGltZQpxBkMKB+AJDw0oHguLTnEHhXEIUnEJWAgAAABpZF90b2tlbnEKTlgKAAAAdXNlcl9hZ2VudHELTlgMAAAAYWNjZXNzX3Rva2VucQxYSAAAAHlhMjkuQ2pCZkE5M2piQ0wzQVJPWm9icjRCTFM1OS1XNHhzQzZOSHJCZ2Eya0I3UmN0c0lVM0FXSHhjSHpyV2FGWkhRSEpJOHENWA4AAAB0b2tlbl9yZXNwb25zZXEOfXEPKFgKAAAAZXhwaXJlc19pbnEQTQ8OWAwAAABhY2Nlc3NfdG9rZW5xEWgNWAoAAAB0b2tlbl90eXBlcRJYBgAAAEJlYXJlcnETdVgHAAAAaW52YWxpZHEUiVgJAAAAY2xpZW50X2lkcRVYRwAAADQwMDM4NTI2NzY0LW1nMmJscDg1NzZtZjZ0cTdjN2w2NWFvMnQyZ2FuZ2trLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tcRZYDgAAAHRva2VuX2luZm9fdXJpcRdYLgAAAGh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92My90b2tlbmluZm9xGFgKAAAAcmV2b2tlX3VyaXEZWCsAAABodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20vby9vYXV0aDIvcmV2b2tlcRpYDQAAAHJlZnJlc2hfdG9rZW5xG05YBgAAAHNjb3Blc3EcY2J1aWx0aW5zCnNldApxHV1xHlgqAAAAaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9nbWFpbC5zZW5kcR9hhXEgUnEhWAkAAAB0b2tlbl91cmlxIlgqAAAAaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3Y0L3Rva2VucSN1Yi4=' gmailuser = GmailAccount(user=self.user, flow=flow) gmailuser.save() code = 'secret_code' data = {'code': code} get_resp = self.MockResponse(data, 200, True) mock_get.return_value = get_resp session = self.client.session session['state'] = 'test_state' session['gmail_next_url'] = '/' session.save() response = self.client.get(reverse('gmail:callback'), {'code': code}) gmail_account = GmailAccount.objects.get(user=self.user) self.assertNotEqual(gmail_account, None) @patch('requests.get') @patch('oauth2client.client.OAuth2WebServerFlow.step2_exchange') def test_callback_no_user_but_code(self, mock_step2_exchange, mock_get): self.client.force_login(self.user) flow = 'gANjb2F1dGgyY2xpZW50LmNsaWVudApPQXV0aDJXZWJTZXJ2ZXJGbG93CnEAKYFxAX1xAihYCAAAAGF1dGhfdXJpcQNYLAAAAGh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi92Mi9hdXRocQRYCgAAAHJldm9rZV91cmlxBVgrAAAAaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tL28vb2F1dGgyL3Jldm9rZXEGWA4AAAB0b2tlbl9pbmZvX3VyaXEHWC4AAABodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9vYXV0aDIvdjMvdG9rZW5pbmZvcQhYCgAAAHVzZXJfYWdlbnRxCU5YBgAAAHBhcmFtc3EKfXELKFgNAAAAcmVzcG9uc2VfdHlwZXEMWAQAAABjb2RlcQ1YCwAAAGFjY2Vzc190eXBlcQ5YBwAAAG9mZmxpbmVxD3VYDAAAAHJlZGlyZWN0X3VyaXEQWC4AAABodHRwOi8vYmUxODJlZDUubmdyb2suaW8vZ21haWwvb2F1dGgtY2FsbGJhY2svcRFYDQAAAGNsaWVudF9zZWNyZXRxElgYAAAAMktiQkVlVy1iZ3ExUUNFOXNqRVY5STVPcRNYCgAAAGxvZ2luX2hpbnRxFE5YCQAAAGNsaWVudF9pZHEVWEcAAAA0MDAzODUyNjc2NC1tZzJibHA4NTc2bWY2dHE3YzdsNjVhbzJ0Mmdhbmdray5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbXEWWAoAAABkZXZpY2VfdXJpcRdYMAAAAGh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi9kZXZpY2UvY29kZXEYWAUAAABzY29wZXEZWCoAAABodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2dtYWlsLnNlbmRxGlgUAAAAYXV0aG9yaXphdGlvbl9oZWFkZXJxG05YCQAAAHRva2VuX3VyaXEcWCoAAABodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9vYXV0aDIvdjQvdG9rZW5xHXViLg==' mock_step2_exchange.return_value = 'gANjb2F1dGgyY2xpZW50LmNsaWVudApPQXV0aDJDcmVkZW50aWFscwpxACmBcQF9cQIoWA0AAABjbGllbnRfc2VjcmV0cQNYGAAAADJLYkJFZVctYmdxMVFDRTlzakVWOUk1T3EEWAwAAAB0b2tlbl9leHBpcnlxBWNkYXRldGltZQpkYXRldGltZQpxBkMKB+AJDw0oHguLTnEHhXEIUnEJWAgAAABpZF90b2tlbnEKTlgKAAAAdXNlcl9hZ2VudHELTlgMAAAAYWNjZXNzX3Rva2VucQxYSAAAAHlhMjkuQ2pCZkE5M2piQ0wzQVJPWm9icjRCTFM1OS1XNHhzQzZOSHJCZ2Eya0I3UmN0c0lVM0FXSHhjSHpyV2FGWkhRSEpJOHENWA4AAAB0b2tlbl9yZXNwb25zZXEOfXEPKFgKAAAAZXhwaXJlc19pbnEQTQ8OWAwAAABhY2Nlc3NfdG9rZW5xEWgNWAoAAAB0b2tlbl90eXBlcRJYBgAAAEJlYXJlcnETdVgHAAAAaW52YWxpZHEUiVgJAAAAY2xpZW50X2lkcRVYRwAAADQwMDM4NTI2NzY0LW1nMmJscDg1NzZtZjZ0cTdjN2w2NWFvMnQyZ2FuZ2trLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tcRZYDgAAAHRva2VuX2luZm9fdXJpcRdYLgAAAGh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92My90b2tlbmluZm9xGFgKAAAAcmV2b2tlX3VyaXEZWCsAAABodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20vby9vYXV0aDIvcmV2b2tlcRpYDQAAAHJlZnJlc2hfdG9rZW5xG05YBgAAAHNjb3Blc3EcY2J1aWx0aW5zCnNldApxHV1xHlgqAAAAaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9nbWFpbC5zZW5kcR9hhXEgUnEhWAkAAAB0b2tlbl91cmlxIlgqAAAAaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3Y0L3Rva2VucSN1Yi4=' code = 'secret_code' json_data = {'code': code} get_resp = self.MockResponse(json_data, 200, True) mock_get.return_value = get_resp session = self.client.session session['state'] = 'test_state' session['gmail_next_url'] = '/' session.save() response = self.client.get(reverse('gmail:callback'), {'code': code}) gmail_account = GmailAccount.objects.get(user=self.user) self.assertNotEqual(gmail_account, None) class TestDisconnectView(BaseTestCase): def test_disconnect_nonexixting_user(self): self.client.force_login(self.user) response = self.client.get(reverse('gmail:disconnect')) self.assertEqual(response.status_code, 302) def test_disconnect_created_user(self): self.client.force_login(self.user) GmailAccount(user=self.user).save() response = self.client.get(reverse('gmail:disconnect')) with self.assertRaises(GmailAccount.DoesNotExist): GmailAccount.objects.get(user=self.user)
67.32
1,137
0.835294
468
8,415
14.824786
0.202991
0.024503
0.020755
0.024214
0.849668
0.8452
0.830499
0.811041
0.797924
0.797924
0
0.086066
0.112181
8,415
124
1,138
67.862903
0.842591
0
0
0.483516
0
0
0.569238
0.538334
0
1
0
0
0.087912
1
0.120879
false
0
0.087912
0
0.274725
0
0
0
1
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
10
8e0e69a05d38ab286aa1e3ce409897862307e066
7,939
py
Python
fonts/font10.py
robert-hh/SSD1963-TFT-Library-for-PyBoard
db9786cdd95f9dab5334a9de28bed4e26436815c
[ "MIT" ]
16
2016-02-23T12:20:36.000Z
2021-02-02T06:41:49.000Z
fonts/font10.py
robert-hh/SSD1963-TFT-Library-for-PyBoard-and-RP2040
db9786cdd95f9dab5334a9de28bed4e26436815c
[ "MIT" ]
2
2016-11-26T07:46:58.000Z
2017-12-10T08:44:38.000Z
fonts/font10.py
robert-hh/SSD1963-TFT-Library-for-PyBoard
db9786cdd95f9dab5334a9de28bed4e26436815c
[ "MIT" ]
9
2016-06-04T08:22:55.000Z
2020-04-19T14:40:36.000Z
# Code generated by cfonts_to_trans_py.py import TFTfont _font10 = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x04\x92\x49\x24\x82\x00\x00'\ b'\x02\x52\x94\x80\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x04\x82\x42\x41\x27\xfc\x48\x48\x24\x7f\xc9\x09\x04\x80\x00\x00\x00\x00\x00'\ b'\x08\x1e\x2b\x49\x48\x48\x38\x0e\x09\x49\x49\x2a\x1c\x08\x08\x00\x00'\ b'\x00\x00\xe0\x84\x44\x11\x10\x44\x81\x12\x04\x53\x8e\x51\x02\x44\x11\x10\x44\x42\x11\x08\x38\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x03\x81\x10\x44\x11\x02\x81\xc0\x90\x42\x50\xa4\x10\x86\x1e\x40\x00\x00\x00\x00\x00'\ b'\x15\x40\x00\x00\x00'\ b'\x01\x22\x24\x44\x44\x44\x22\x21\x00'\ b'\x01\x04\x21\x04\x21\x08\x42\x11\x08\x44\x00'\ b'\x00\x47\xc4\x28\xa0\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x08\x08\x08\x7f\x08\x08\x08\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x02\x48\x00'\ b'\x00\x00\x00\x00\x00\xf8\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x02\x00\x00'\ b'\x00\x44\x21\x10\x84\x42\x11\x08\x00\x00\x00'\ b'\x00\x1c\x22\x41\x41\x41\x41\x41\x41\x41\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\x10\xc5\x24\x10\x41\x04\x10\x41\x04\x00\x00\x00'\ b'\x00\x1e\x22\x41\x01\x01\x02\x02\x04\x08\x10\x20\x7f\x00\x00\x00\x00'\ b'\x00\x1c\x22\x42\x02\x04\x1c\x02\x01\x01\x41\x62\x1c\x00\x00\x00\x00'\ b'\x00\x04\x0c\x14\x14\x24\x24\x44\x84\xff\x04\x04\x04\x00\x00\x00\x00'\ b'\x00\x3f\x20\x20\x40\x7c\x42\x01\x01\x01\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\x1c\x23\x41\x40\x5c\x62\x41\x41\x41\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\x7f\x02\x02\x04\x04\x08\x08\x08\x08\x10\x10\x10\x00\x00\x00\x00'\ b'\x00\x1c\x22\x41\x41\x22\x1c\x22\x41\x41\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\x1c\x22\x41\x41\x41\x41\x23\x1d\x01\x41\x22\x3c\x00\x00\x00\x00'\ b'\x00\x02\x00\x00\x02\x00\x00'\ b'\x00\x02\x00\x00\x02\x48\x00'\ b'\x00\x00\x00\x20\x60\xc1\x81\x00\x60\x0c\x01\x80\x20\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x03\xfc\x00\x00\x00\x3f\xc0\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x10\x06\x00\xc0\x18\x02\x06\x0c\x18\x10\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x1c\x22\x41\x41\x01\x02\x04\x08\x08\x08\x00\x08\x00\x00\x00\x00'\ b'\x00\x00\x01\xfc\x03\x01\x82\x00\x22\x1c\x91\x11\xc4\x90\x42\x90\x21\x48\x10\xa4\x10\x52\x08\x48\x8c\x42\x3b\xc1\x00\x04\x40\x04\x18\x0c\x03\xf8\x00'\ b'\x00\x00\x80\x28\x05\x01\x10\x22\x04\x41\x04\x3f\x88\x09\x01\x40\x18\x02\x00\x00\x00\x00\x00\x00'\ b'\x00\x1f\xc4\x09\x01\x40\x50\x27\xf9\x02\x40\x50\x14\x05\x02\x7f\x00\x00\x00\x00\x00\x00'\ b'\x00\x01\xf0\x41\x10\x14\x00\x80\x10\x02\x00\x40\x08\x00\x80\x88\x20\xf8\x00\x00\x00\x00\x00\x00'\ b'\x00\x0f\xe1\x02\x20\x24\x02\x80\x50\x0a\x01\x40\x28\x05\x01\x20\x47\xf0\x00\x00\x00\x00\x00\x00'\ b'\x00\x1f\xf4\x01\x00\x40\x10\x07\xf9\x00\x40\x10\x04\x01\x00\x7f\xc0\x00\x00\x00\x00\x00'\ b'\x00\x3f\xd0\x08\x04\x02\x01\xfc\x80\x40\x20\x10\x08\x04\x00\x00\x00\x00\x00\x00'\ b'\x00\x01\xe0\x42\x10\x24\x00\x80\x10\x02\x1f\x40\x28\x04\x81\x08\x40\xf0\x00\x00\x00\x00\x00\x00'\ b'\x00\x10\x14\x05\x01\x40\x50\x17\xfd\x01\x40\x50\x14\x05\x01\x40\x40\x00\x00\x00\x00\x00'\ b'\x04\x92\x49\x24\x92\x00\x00'\ b'\x00\x01\x01\x01\x01\x01\x01\x01\x01\x41\x41\x22\x3c\x00\x00\x00\x00'\ b'\x00\x10\x14\x09\x04\x42\x11\x04\xc1\x48\x61\x10\x44\x09\x02\x40\x40\x00\x00\x00\x00\x00'\ b'\x00\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x7f\x00\x00\x00\x00'\ b'\x00\x04\x01\x60\x36\x03\x50\x55\x05\x48\x94\x89\x49\x14\x51\x45\x14\x21\x42\x10\x00\x00\x00\x00\x00\x00'\ b'\x00\x10\x16\x05\x41\x50\x52\x14\x45\x11\x42\x50\x54\x15\x03\x40\x40\x00\x00\x00\x00\x00'\ b'\x00\x01\xe0\x42\x10\x24\x02\x80\x50\x0a\x01\x40\x28\x04\x81\x08\x40\xf0\x00\x00\x00\x00\x00\x00'\ b'\x00\x1f\xc4\x09\x01\x40\x50\x14\x09\xfc\x40\x10\x04\x01\x00\x40\x00\x00\x00\x00\x00\x00'\ b'\x00\x01\xe0\x42\x10\x24\x02\x80\x50\x0a\x01\x40\x28\x04\x8d\x88\x60\xf6\x00\x00\x00\x00\x00\x00'\ b'\x00\x1f\xc4\x09\x01\x40\x50\x14\x09\xfc\x42\x10\x44\x11\x02\x40\x40\x00\x00\x00\x00\x00'\ b'\x00\x07\xc2\x09\x01\x40\x08\x01\xc0\x0e\x00\x50\x14\x04\x82\x1f\x00\x00\x00\x00\x00\x00'\ b'\x00\x7f\xc2\x01\x00\x80\x40\x20\x10\x08\x04\x02\x01\x00\x80\x00\x00\x00\x00\x00'\ b'\x00\x10\x14\x05\x01\x40\x50\x14\x05\x01\x40\x50\x14\x04\x82\x1f\x00\x00\x00\x00\x00\x00'\ b'\x00\x10\x14\x04\x82\x20\x88\x21\x10\x44\x11\x02\x80\xa0\x10\x04\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x40\x40\x50\x50\x48\x28\x24\x14\x11\x11\x10\x88\x88\x44\x44\x14\x14\x0a\x0a\x05\x05\x01\x01\x00\x80\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x08\x08\x82\x08\x81\x10\x14\x01\x00\x50\x11\x02\x20\x82\x20\x28\x02\x00\x00\x00\x00\x00\x00'\ b'\x00\x10\x12\x08\x82\x11\x02\x80\xa0\x10\x04\x01\x00\x40\x10\x04\x00\x00\x00\x00\x00\x00'\ b'\x00\x3f\xc0\x40\x40\x20\x20\x20\x10\x10\x10\x08\x08\x0f\xf8\x00\x00\x00\x00\x00'\ b'\x07\x44\x44\x44\x44\x44\x44\x47\x00'\ b'\x04\x10\x84\x10\x84\x10\x84\x10\x80\x00\x00'\ b'\x07\x11\x11\x11\x11\x11\x11\x17\x00'\ b'\x00\x20\xa1\x44\x48\x91\x41\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x00\x00'\ b'\x08\x80\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1e\x21\x41\x07\x39\x41\x41\x43\x3d\x00\x00\x00\x00'\ b'\x00\x40\x40\x40\x5c\x62\x41\x41\x41\x41\x41\x62\x5c\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x22\x41\x40\x40\x40\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\x01\x01\x01\x1d\x23\x41\x41\x41\x41\x41\x23\x1d\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x22\x41\x41\x7f\x40\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\xc8\x47\x90\x84\x21\x08\x42\x00\x00\x00'\ b'\x00\x00\x00\x00\x1d\x23\x41\x41\x41\x41\x41\x23\x1d\x01\x42\x3c\x00'\ b'\x00\x40\x40\x40\x5e\x61\x41\x41\x41\x41\x41\x41\x41\x00\x00\x00\x00'\ b'\x10\x55\x55\x40\x00'\ b'\x10\x55\x55\x56\x00'\ b'\x00\x40\x40\x40\x41\x42\x44\x48\x58\x64\x42\x42\x41\x00\x00\x00\x00'\ b'\x15\x55\x55\x40\x00'\ b'\x00\x00\x00\x00\x00\x00\x5c\xe6\x31\x42\x14\x21\x42\x14\x21\x42\x14\x21\x42\x10\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x5e\x61\x41\x41\x41\x41\x41\x41\x41\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x1c\x22\x41\x41\x41\x41\x41\x22\x1c\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x5c\x62\x41\x41\x41\x41\x41\x62\x5c\x40\x40\x40\x00'\ b'\x00\x00\x00\x00\x1d\x23\x41\x41\x41\x41\x41\x23\x1d\x01\x01\x01\x00'\ b'\x00\x00\x00\x5d\x84\x10\x41\x04\x10\x40\x00\x00\x00'\ b'\x00\x00\x00\x03\xc8\x50\x20\x3c\x04\x0a\x13\xc0\x00\x00\x00'\ b'\x04\x44\xf4\x44\x44\x44\x70\x00\x00'\ b'\x00\x00\x00\x00\x41\x41\x41\x41\x41\x41\x41\x43\x3d\x00\x00\x00\x00'\ b'\x00\x00\x00\x08\x30\x51\x22\x44\x50\xa0\x81\x00\x00\x00\x00'\ b'\x00\x00\x00\x00\x00\x08\x43\x08\x52\x92\x52\x51\x4a\x29\x45\x10\x42\x08\x00\x00\x00\x00\x00\x00'\ b'\x00\x00\x00\x08\x28\x8a\x14\x10\x50\xa2\x28\x20\x00\x00\x00'\ b'\x00\x00\x00\x00\x41\x41\x41\x22\x22\x26\x14\x14\x08\x08\x10\x60\x00'\ b'\x00\x00\x00\x0f\xe0\x82\x04\x10\x40\x82\x0f\xe0\x00\x00\x00'\ b'\x00\x31\x04\x10\x41\x04\x60\x41\x04\x10\x41\x03\x00'\ b'\x04\x92\x49\x24\x92\x49\x20'\ b'\x06\x08\x42\x10\x84\x19\x08\x42\x10\x98\x00'\ b'\x00\x00\x00\x00\x00\x00\x01\xe3\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x7b\x6d\xb6\xf0\x00\x00' _font10_index = b'\x00\x00\x14\x00\x1b\x00\x26\x00\x3a\x00\x4b\x00\x69\x00\x7f\x00'\ b'\x84\x00\x8d\x00\x98\x00\xa5\x00\xb6\x00\xbd\x00\xc8\x00\xcf\x00'\ b'\xda\x00\xeb\x00\xf8\x00\x09\x01\x1a\x01\x2b\x01\x3c\x01\x4d\x01'\ b'\x5e\x01\x6f\x01\x80\x01\x87\x01\x8e\x01\xa2\x01\xb6\x01\xca\x01'\ b'\xdb\x01\x00\x02\x18\x02\x2e\x02\x46\x02\x5e\x02\x74\x02\x88\x02'\ b'\xa0\x02\xb6\x02\xbd\x02\xce\x02\xe4\x02\xf5\x02\x0f\x03\x25\x03'\ b'\x3d\x03\x53\x03\x6b\x03\x81\x03\x97\x03\xab\x03\xc1\x03\xd7\x03'\ b'\xfc\x03\x14\x04\x2a\x04\x3e\x04\x47\x04\x52\x04\x5b\x04\x6a\x04'\ b'\x7e\x04\x85\x04\x96\x04\xa7\x04\xb8\x04\xc9\x04\xda\x04\xe5\x04'\ b'\xf6\x04\x07\x05\x0c\x05\x11\x05\x22\x05\x27\x05\x41\x05\x52\x05'\ b'\x63\x05\x74\x05\x85\x05\x92\x05\xa1\x05\xaa\x05\xbb\x05\xca\x05'\ b'\xe2\x05\xf1\x05\x02\x06\x11\x06\x1e\x06\x25\x06\x30\x06\x44\x06'\ b'\x4b\x06' font10 = TFTfont.TFTFont(_font10, _font10_index, 17, 17, 96) fonts = {"font10":font10, }
66.714286
152
0.712306
1,939
7,939
2.91181
0.089737
0.434644
0.471838
0.42508
0.564825
0.521431
0.498583
0.436061
0.401523
0.344846
0
0.434264
0.017005
7,939
118
153
67.279661
0.289211
0.004912
0
0
1
0.80531
0.915031
0.903128
0
1
0
0
0
1
0
false
0
0.00885
0
0.00885
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
1
1
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
10
edc2e8d2c47e25bb454353d225259c362e8c4f40
1,061
py
Python
tests/test_provider_hashicorp_fakewebservices.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
tests/test_provider_hashicorp_fakewebservices.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
tests/test_provider_hashicorp_fakewebservices.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# tests/test_provider_hashicorp_fakewebservices.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:16:12 UTC) def test_provider_import(): import terrascript.provider.hashicorp.fakewebservices def test_resource_import(): from terrascript.resource.hashicorp.fakewebservices import fakewebservices_database from terrascript.resource.hashicorp.fakewebservices import ( fakewebservices_load_balancer, ) from terrascript.resource.hashicorp.fakewebservices import fakewebservices_server from terrascript.resource.hashicorp.fakewebservices import fakewebservices_vpc # 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.hashicorp.fakewebservices # # t = terrascript.provider.hashicorp.fakewebservices.fakewebservices() # s = str(t) # # assert 'https://github.com/hashicorp/terraform-provider-fakewebservices' in s # assert '0.2.1' in s
32.151515
87
0.782281
120
1,061
6.791667
0.508333
0.235583
0.157055
0.157055
0.453988
0.333742
0.333742
0
0
0
0
0.016465
0.141376
1,061
32
88
33.15625
0.878156
0.511781
0
0
1
0
0
0
0
0
0
0.03125
0
1
0.222222
true
0
0.777778
0
1
0
0
0
0
null
1
0
0
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
6103c5bd5ef47ab1ba713b0b7fc8745724b88888
19,007
py
Python
PA_multiagent_game/PA_multiagent_env.py
salesforce/RIRL
6f137955bfbe2054be18bb2b15d0e6aedb972b06
[ "BSD-3-Clause" ]
null
null
null
PA_multiagent_game/PA_multiagent_env.py
salesforce/RIRL
6f137955bfbe2054be18bb2b15d0e6aedb972b06
[ "BSD-3-Clause" ]
null
null
null
PA_multiagent_game/PA_multiagent_env.py
salesforce/RIRL
6f137955bfbe2054be18bb2b15d0e6aedb972b06
[ "BSD-3-Clause" ]
null
null
null
# # Copyright (c) 2022, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause # import torch import numpy as np class PAMultiagentEnv(object): def __init__(self, agent_type_dist = [0.5, 0.5], agent_base_skill = [0.5, 1], agent_hrs_cost_mult = 0.2, principal_profit_mult = 1.5, horizon = 2, batch_size = 32, n_agents = 2, agent_arch_type = 'SQA', *args, **kwargs ): self.agent_type_dist = agent_type_dist self.agent_base_skill = agent_base_skill self.agent_hrs_cost_mult = agent_hrs_cost_mult self.principal_profit_mult = principal_profit_mult self.horizon = horizon self.agent_arch_type = agent_arch_type self.n_agents = int(n_agents) assert self.n_agents > 0 self.batch_size = int(batch_size) assert self.batch_size > 0 # These are overwritten in self.reset() self.current_base_skill = np.zeros((self.batch_size, self.n_agents)) self.agent_type = np.zeros((self.batch_size, self.n_agents), dtype=int) self.last_wage = np.zeros((self.batch_size, self.n_agents)) self.last_hour = np.zeros((self.batch_size, self.n_agents)) self.last_output_cumulative = np.zeros(self.batch_size) self.last_output_individual = np.zeros((self.batch_size, self.n_agents)) self.t = np.zeros(self.batch_size, dtype=np.int) self.wage = np.zeros((self.batch_size, self.n_agents)) # self.reset() def get_agent_state(self): #returns agent state stacked together of size(batch_size * n_agents, 3) agent_states = np.array([np.concatenate(self.agent_type.T), np.concatenate(self.wage.T), np.tile(self.t, self.n_agents)]).T agent_states = torch.as_tensor(agent_states, dtype=torch.float32) assert agent_states.shape[0] == self.batch_size * self.n_agents if self.agent_arch_type == 'SQA': return agent_states else: return { 'state': agent_states } def get_principal_state(self): # Output formatted for multi-channel RI policy return { 'last_individual_outputs': torch.as_tensor(self.last_output_individual, dtype=torch.float32), 'last_wage_hours_output_time': torch.as_tensor( np.hstack([ self.last_wage, self.last_hour, self.last_output_cumulative.reshape(-1, 1), self.t.reshape(-1, 1) ]), dtype=torch.float32 ) } def reset(self, agent_type = None, horizon = None): if agent_type is None: self.agent_type = np.random.choice( a=list(range(len(self.agent_type_dist))), size=(self.batch_size, self.n_agents), p=self.agent_type_dist ) else: agent_type = np.array(agent_type).astype(np.int) nb, na = agent_type.shape assert nb == self.batch_size assert na == self.n_agents assert np.max(agent_type) < len(self.agent_type_dist) assert np.min(agent_type) >= 0 self.agent_type = agent_type self.current_base_skill = np.array( [self.agent_base_skill[t] for t in self.agent_type] ) self.last_wage = np.zeros((self.batch_size, self.n_agents)) self.last_hour = np.zeros((self.batch_size, self.n_agents)) self.last_output_cumulative = np.zeros(self.batch_size) self.last_output_individual = np.zeros((self.batch_size, self.n_agents)) self.t = np.zeros(self.batch_size, dtype=np.int) self.wage = np.zeros((self.batch_size, self.n_agents)) return self.get_principal_state() def principal_step(self, principal_action): assert len(principal_action) == self.batch_size # Principal actions update the wage self.wage = np.array(principal_action, dtype=np.int) if self.n_agents == 1: self.wage = self.wage.reshape(-1, 1) # Agent is next to act. Output its state. return self.get_agent_state() # def agent_utility(self, hrs_action, agent_i): # pay_util = hrs_action * self.wage[:, agent_i] # labor_cost = (hrs_action ** 2) * (self.agent_hrs_cost_mult) # return pay_util - labor_cost def agent_utility(self, hrs_action): pay_util = hrs_action * np.concatenate(self.wage.T) labor_cost = (hrs_action ** 2) * (self.agent_hrs_cost_mult) return pay_util - labor_cost def principal_utility(self, output_cumulative, hrs_action): revenue = output_cumulative * self.principal_profit_mult cost = (self.wage * hrs_action).sum(1) return revenue - cost def agent_step(self, agent_actions): hrs_action = agent_actions.reshape(self.n_agents, self.batch_size).T # # Look up the (hours, effort) action indicated by these actions # hour_effort_array = np.array([self.idx_to_action[a] for a in agent_action]) # hrs_action = hour_effort_array[:, 0] # effort_action = hour_effort_array[:, 1] #total skill is base skill + effort increase # total_skill = self.current_base_skill + effort_action #output is total_effort * hrs #individual_outputs output = self.current_base_skill * hrs_action output_cumulative = output.sum(1) # We can now calculate reward for this pair of (principal, agent) actions #get reward for each agent r_as = [] # for agent_i in range(self.n_agents): # r_as.append(self.agent_utility(hrs_action[:, agent_i], agent_i)) #stack rewards # r_a = np.concatenate(r_as) r_a = self.agent_utility(agent_actions) r_a_shape = r_a.shape assert len(r_a_shape) == 1 assert r_a_shape[0] == self.batch_size * self.n_agents r_p = self.principal_utility(output_cumulative, hrs_action) # Update our state trackers self.last_wage = np.array(self.wage) self.last_hour = hrs_action self.last_output_individual = output self.last_output_cumulative = output_cumulative self.t += 1 done = self.t >= self.horizon if np.any(done): assert np.all(done) done = True else: done = False # Output rewards tuple, principal state, and done flag #r_as is a 2d array of rewards [agent1 rewards, agent2 rewards,... agentn rewards], while r_a is one long array of length batch_size * n_agents. r_a = np.concatenate(r_as) and r_as = r_a.reshape(n_agents, batch_size).T return (r_as, r_p, r_a), self.get_principal_state(), done class PAMultiagentSignalingEnv(PAMultiagentEnv): def __init__(self, *args, agent_effort_cost_mult=[1, 0.5], n_agent_hour_actions=8, n_agent_effort_actions=3, agent_effort_increment = 1, **kwargs): self.agent_effort_cost_mult = np.array(agent_effort_cost_mult) super().__init__(*args, **kwargs) assert len(self.agent_effort_cost_mult) == len(self.agent_type_dist) self.current_effort_cost_mult = np.zeros(self.batch_size) self.n_agent_hour_actions = int(n_agent_hour_actions) assert self.n_agent_hour_actions >= 2 self.n_agent_effort_actions = int(n_agent_effort_actions) assert self.n_agent_effort_actions >= 1 self.last_effort = np.zeros_like(self.last_hour) self.agent_effort_increment = agent_effort_increment # Assign each agent (hrs, effort) action to a unique integer self.idx_to_action = {} idx = 0 for hr in range(self.n_agent_hour_actions): for e in range(self.n_agent_effort_actions): self.idx_to_action[idx] = (hr, e) idx += 1 # self.reset() def reset(self, agent_type=None, horizon = None): if agent_type is None: self.agent_type = np.random.choice( a=list(range(len(self.agent_type_dist))), size=(self.batch_size, self.n_agents), p=self.agent_type_dist ) else: agent_type = np.array(agent_type).astype(np.int) nb, na = agent_type.shape assert nb == self.batch_size assert na == self.n_agents assert np.max(agent_type) < len(self.agent_type_dist) assert np.min(agent_type) >= 0 self.agent_type = agent_type self.current_base_skill = np.array( [self.agent_base_skill[t] for t in self.agent_type] ) self.current_base_skill = np.array( [self.agent_base_skill[t] for t in self.agent_type] ) self.current_effort_cost_mult = np.array( [self.agent_effort_cost_mult[t] for t in self.agent_type] ) self.last_wage = np.zeros((self.batch_size, self.n_agents)) self.last_hour = np.zeros((self.batch_size, self.n_agents)) self.last_effort = np.zeros((self.batch_size, self.n_agents)) self.last_output_cumulative = np.zeros(self.batch_size) self.last_output_individual = np.zeros((self.batch_size, self.n_agents)) self.t = np.zeros(self.batch_size, dtype=np.int) self.wage = np.zeros((self.batch_size, self.n_agents)) return self.get_principal_state() def agent_step(self, agent_actions): # hrs_action = agent_actions.reshape(self.n_agents, self.batch_size).T # Look up the (hours, effort) action indicated by these actions he_array = np.array([self.idx_to_action[a] for a in agent_actions]) hrs_action = he_array[:, 0].reshape(self.n_agents, self.batch_size).T effort_action = he_array[:, 1].reshape(self.n_agents, self.batch_size).T # total skill is base skill + effort increase # total_skill = self.current_base_skill + effort_action total_skill = self.current_base_skill + (effort_action * self.agent_effort_increment) # output is total_effort * hrs # individual_outputs output = total_skill * hrs_action output_cumulative = output.sum(1) # We can now calculate reward for this pair of (principal, agent) actions # get reward for each agent r_as = [] for agent_i in range(self.n_agents): r_as.append( self.agent_utility( hrs_action[:, agent_i], effort_action[:, agent_i], agent_i ) ) # stack rewards r_a = np.concatenate(r_as) r_a_shape = r_a.shape assert len(r_a_shape) == 1 assert r_a_shape[0] == self.batch_size * self.n_agents r_p = self.principal_utility(output_cumulative, hrs_action) # Update our state trackers self.last_wage = np.array(self.wage) self.last_hour = hrs_action self.last_effort = effort_action self.last_output_individual = output self.last_output_cumulative = output_cumulative self.t += 1 done = self.t >= self.horizon if np.any(done): assert np.all(done) done = True else: done = False # Output rewards tuple, principal state, and done flag # r_as is a 2d array of rewards [agent1 rewards, agent2 rewards,... agentn rewards], while r_a is one long array of length batch_size * n_agents. r_a = np.concatenate(r_as) and r_as = r_a.reshape(n_agents, batch_size).T return (r_as, r_p, r_a), self.get_principal_state(), done def agent_utility(self, hrs_action, effort_action, agent_i): pay_util = hrs_action * self.wage[:, agent_i] effort_cost_scale = (self.current_effort_cost_mult[:, agent_i] * effort_action) + 1 labor_cost = (hrs_action ** 2) * (self.agent_hrs_cost_mult * effort_cost_scale) return pay_util - labor_cost def get_principal_state(self): # Output formatted for multi-channel RI policy return { 'last_effort': torch.as_tensor(self.last_effort, dtype=torch.float32), 'last_individual_outputs': torch.as_tensor(self.last_output_individual, dtype=torch.float32), 'last_wage_hours_output_time': torch.as_tensor( np.hstack([ self.last_wage, self.last_hour, self.last_output_cumulative.reshape(-1, 1), self.t.reshape(-1, 1) ]), dtype=torch.float32 ) } class PAMultiagentSignalingEnvVaryH(PAMultiagentSignalingEnv): def __init__(self, *args, horizons = list(range(2, 11)), **kwargs): self.horizons = horizons super().__init__(*args, **kwargs) def reset(self, agent_type=None, horizon = None): if agent_type is None: self.agent_type = np.random.choice( a=list(range(len(self.agent_type_dist))), size=(self.batch_size, self.n_agents), p=self.agent_type_dist ) else: agent_type = np.array(agent_type).astype(np.int) nb, na = agent_type.shape assert nb == self.batch_size assert na == self.n_agents assert np.max(agent_type) < len(self.agent_type_dist) assert np.min(agent_type) >= 0 self.agent_type = agent_type if horizon is None: self.horizon = np.random.choice(self.horizons) else: self.horizon = horizon self.current_base_skill = np.array( [self.agent_base_skill[t] for t in self.agent_type] ) self.current_base_skill = np.array( [self.agent_base_skill[t] for t in self.agent_type] ) self.current_effort_cost_mult = np.array( [self.agent_effort_cost_mult[t] for t in self.agent_type] ) self.last_wage = np.zeros((self.batch_size, self.n_agents)) self.last_hour = np.zeros((self.batch_size, self.n_agents)) self.last_effort = np.zeros((self.batch_size, self.n_agents)) self.last_output_cumulative = np.zeros(self.batch_size) self.last_output_individual = np.zeros((self.batch_size, self.n_agents)) self.t = np.zeros(self.batch_size, dtype=np.int) self.wage = np.zeros((self.batch_size, self.n_agents)) return self.get_principal_state() def agent_step(self, agent_actions): # hrs_action = agent_actions.reshape(self.n_agents, self.batch_size).T # Look up the (hours, effort) action indicated by these actions he_array = np.array([self.idx_to_action[a] for a in agent_actions]) hrs_action = he_array[:, 0].reshape(self.n_agents, self.batch_size).T effort_action = he_array[:, 1].reshape(self.n_agents, self.batch_size).T # total skill is base skill + effort increase # total_skill = self.current_base_skill + effort_action total_skill = self.current_base_skill + (effort_action * self.agent_effort_increment) # output is total_effort * hrs # individual_outputs output = total_skill * hrs_action output_cumulative = output.sum(1) # We can now calculate reward for this pair of (principal, agent) actions # get reward for each agent r_as = [] for agent_i in range(self.n_agents): r_as.append( self.agent_utility( hrs_action[:, agent_i], effort_action[:, agent_i], agent_i ) ) # stack rewards r_a = np.concatenate(r_as) r_a_shape = r_a.shape assert len(r_a_shape) == 1 assert r_a_shape[0] == self.batch_size * self.n_agents r_p = self.principal_utility(output_cumulative, hrs_action) # Update our state trackers self.last_wage = np.array(self.wage) self.last_hour = hrs_action self.last_effort = effort_action self.last_output_individual = output self.last_output_cumulative = output_cumulative self.t += 1 done = self.t >= self.horizon if np.any(done): assert np.all(done) done = True else: done = False # Output rewards tuple, principal state, and done flag # r_as is a 2d array of rewards [agent1 rewards, agent2 rewards,... agentn rewards], while r_a is one long array of length batch_size * n_agents. r_a = np.concatenate(r_as) and r_as = r_a.reshape(n_agents, batch_size).T return (r_as, r_p, r_a), self.get_principal_state(), done def agent_utility(self, hrs_action, effort_action, agent_i): pay_util = hrs_action * self.wage[:, agent_i] effort_cost_scale = (self.current_effort_cost_mult[:, agent_i] * effort_action) + 1 labor_cost = (hrs_action ** 2) * (self.agent_hrs_cost_mult * effort_cost_scale) return pay_util - labor_cost def get_principal_state(self): # Output formatted for multi-channel RI policy return { 'last_effort': torch.as_tensor(self.last_effort, dtype=torch.float32), 'last_individual_outputs': torch.as_tensor(self.last_output_individual, dtype=torch.float32), 'last_wage_hours_output_time': torch.as_tensor( np.hstack([ self.last_wage, self.last_hour, self.last_output_cumulative.reshape(-1, 1), self.t.reshape(-1, 1), self.horizon * np.ones((self.batch_size, 1)) ]), dtype=torch.float32 ) } def get_agent_state(self): #returns agent state stacked together of size(batch_size * n_agents, 3) agent_states = np.array([np.concatenate(self.agent_type.T), np.concatenate(self.wage.T), np.tile(self.t, self.n_agents), self.horizon * np.ones(self.batch_size * self.n_agents)]).T agent_states = torch.as_tensor(agent_states, dtype=torch.float32) assert agent_states.shape[0] == self.batch_size * self.n_agents if self.agent_arch_type == 'SQA': return agent_states else: return { 'state': agent_states }
39.351967
227
0.610775
2,551
19,007
4.267738
0.073697
0.051254
0.062092
0.053091
0.842473
0.807844
0.801231
0.793423
0.786443
0.783228
0
0.008422
0.294102
19,007
483
228
39.351967
0.803011
0.170464
0
0.72973
0
0
0.012163
0.009552
0
0
0
0
0.087087
1
0.057057
false
0
0.006006
0.009009
0.126126
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
6109089fe8e3258fd3b00a9f05334518e529ed16
79
py
Python
QGrain/statistic/__init__.py
yuriok/QGrain
39a136d4e89716a26a88d68ffa00d36ef6036279
[ "MIT" ]
4
2021-09-04T11:00:07.000Z
2022-01-06T12:50:09.000Z
QGrain/statistic/__init__.py
yuriok/QGrain
39a136d4e89716a26a88d68ffa00d36ef6036279
[ "MIT" ]
null
null
null
QGrain/statistic/__init__.py
yuriok/QGrain
39a136d4e89716a26a88d68ffa00d36ef6036279
[ "MIT" ]
2
2021-08-23T02:39:07.000Z
2021-12-30T03:04:07.000Z
from QGrain.statistic._base import * from QGrain.statistic._GRADISTAT import *
26.333333
41
0.822785
10
79
6.3
0.6
0.31746
0.603175
0
0
0
0
0
0
0
0
0
0.101266
79
2
42
39.5
0.887324
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
b64cf168405cdda6efa664d117b2287f9d224336
3,595
py
Python
forImport/marginBoi.py
SU1199/ZerodhaMargins
2c81a91f913b507f5f687258e6117c5dc915873b
[ "MIT" ]
1
2021-03-16T22:23:46.000Z
2021-03-16T22:23:46.000Z
forImport/marginBoi.py
SU1199/ZerodhaMargins
2c81a91f913b507f5f687258e6117c5dc915873b
[ "MIT" ]
null
null
null
forImport/marginBoi.py
SU1199/ZerodhaMargins
2c81a91f913b507f5f687258e6117c5dc915873b
[ "MIT" ]
null
null
null
import requests from bs4 import BeautifulSoup def equityFutures(ticker): j =0 page = requests.get("https://zerodha.com/margin-calculator/Futures/") soup = BeautifulSoup(page.content, 'html.parser') table = soup.find("table", {"class": "data futures"}) table_rows = table.find_all('tr') head = 'Contract\tExpiry\tLot Size\tPrice\tNRML Margin\tNRML Margin Rate \tMWPS\n\n' data = '' for tr in table_rows: if j>=1: td = tr.find_all('td') row = [i.text for i in td] completeRow = '' if ticker.lower() == row[1].lower().replace('\n', '').replace('\t', ''): for index, cell in enumerate(row, start=0): if index <= 7 and index >=1 : completeRow = completeRow + cell.replace('\n', '').replace('\t', '') + '\t\t' data = data + completeRow + '\n' j = j+1 return head + data def currencyFutures(ticker): j =0 page = requests.get("https://zerodha.com/margin-calculator/Currency/") soup = BeautifulSoup(page.content, 'html.parser') table = soup.find_all("table", {"class": "data cds"})[1] table_rows = table.find_all('tr') head = 'Contract\tExpiry\tLot Size\tPrice\tNRML Margin\n\n' data = '' for tr in table_rows: if j>=1: td = tr.find_all('td') row = [i.text for i in td] completeRow = '' if ticker.lower() == row[1].lower().replace('\n', '').replace('\t', ''): for index, cell in enumerate(row, start=0): if index <= 5 and index >=1 : completeRow = completeRow + cell.replace('\n', '').replace('\t', '') + '\t\t' data = data + completeRow + '\n' j = j+1 return head + data def equity(ticker): ticker = ticker+ ':EQ' j =0 page = requests.get("https://zerodha.com/margin-calculator/Equity/") soup = BeautifulSoup(page.content, 'html.parser') table = soup.find_all("table", {"class": "data equity"})[1] table_rows = table.find_all('tr') head = 'Scrip\tCNC Multiplier\tMIS Multiplier\n' data = '' for tr in table_rows: if j>=1: td = tr.find_all('td') row = [i.text for i in td] completeRow = '' if ticker.lower() == row[1].lower().replace('\n', '').replace('\t', ''): for index, cell in enumerate(row, start=0): if index <= 3 and index >=1 : completeRow = completeRow + cell.replace('\n', '').replace('\t', '') + '\t\t' data = data + completeRow + '\n' j = j+1 return head + data def commodity(ticker): j =0 page = requests.get("https://zerodha.com/margin-calculator/Commodity/") soup = BeautifulSoup(page.content, 'html.parser') table = soup.find_all("table", {"class": "data commodity"})[1] table_rows = table.find_all('tr') head = 'Commodity\tLot Size\tPrice\tNRML Margin\tMIS Margin\n\n' data = '' for tr in table_rows: if j>=1: td = tr.find_all('td') row = [i.text for i in td] completeRow = '' if ticker.lower() == row[1].lower().replace('\n', '').replace('\t', ''): for index, cell in enumerate(row, start=0): if index <= 5 and index >=1 : completeRow = completeRow + cell.replace('\n', '').replace('\t', '') + '\t\t' data = data + completeRow + '\n' j = j+1 return head + data
40.852273
101
0.526008
449
3,595
4.169265
0.155902
0.041132
0.064103
0.068376
0.870192
0.856838
0.856838
0.856838
0.826389
0.799145
0
0.012815
0.305424
3,595
87
102
41.321839
0.736884
0
0
0.746988
0
0.012048
0.169402
0.011683
0
0
0
0
0
1
0.048193
false
0
0.024096
0
0.120482
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
b64f2367ab1f6267acc848f7839f6dc27b387825
170
py
Python
SQLGenerator/__init__.py
drop-out/SQL-Generator
9072eeaeba1c82f48e9d65b821d0b8b371d8e0f0
[ "MIT" ]
null
null
null
SQLGenerator/__init__.py
drop-out/SQL-Generator
9072eeaeba1c82f48e9d65b821d0b8b371d8e0f0
[ "MIT" ]
null
null
null
SQLGenerator/__init__.py
drop-out/SQL-Generator
9072eeaeba1c82f48e9d65b821d0b8b371d8e0f0
[ "MIT" ]
null
null
null
from SQLGenerator.Table import Table from SQLGenerator.Table import tab_remover,comments_remover,column_parser from SQLGenerator.Table import hashdraw_condition_generator
56.666667
73
0.905882
22
170
6.772727
0.545455
0.322148
0.422819
0.543624
0
0
0
0
0
0
0
0
0.064706
170
3
74
56.666667
0.937107
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
b6697dfeaa855c8f8ea07e4003516d8e9fbdce23
17,663
py
Python
tests/strategy_sma_0_test.py
hoondental/smtm
f7648da652c5437ee27efef6fbf2480045130c16
[ "MIT" ]
null
null
null
tests/strategy_sma_0_test.py
hoondental/smtm
f7648da652c5437ee27efef6fbf2480045130c16
[ "MIT" ]
null
null
null
tests/strategy_sma_0_test.py
hoondental/smtm
f7648da652c5437ee27efef6fbf2480045130c16
[ "MIT" ]
1
2022-03-25T03:06:54.000Z
2022-03-25T03:06:54.000Z
import unittest from smtm import StrategySma0 from unittest.mock import * class StrategySma0Tests(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_initialize_update_initial_balance(self): sma = StrategySma0() self.assertEqual(sma.is_intialized, False) sma.initialize(50000, 50) self.assertEqual(sma.budget, 50000) self.assertEqual(sma.balance, 50000) self.assertEqual(sma.min_price, 50) self.assertEqual(sma.is_intialized, True) sma.initialize(100, 10) self.assertEqual(sma.budget, 50000) self.assertEqual(sma.balance, 50000) self.assertEqual(sma.min_price, 50) def test_update_trading_info_append_info_to_data(self): sma = StrategySma0() sma.initialize(100, 10) dummy_info = { "closing_price": 500, } sma.update_trading_info(dummy_info) self.assertEqual(sma.data.pop(), dummy_info) def test_update_trading_info_append_closing_price(self): sma = StrategySma0() sma.initialize(100, 10) dummy_info = { "closing_price": 500, } sma.update_trading_info(dummy_info) self.assertEqual(sma.closing_price_list.pop(), 500) @patch("numpy.isnan") @patch("pandas.Series") def test_update_trading_info_update_process_when_long_gt_short(self, mock_series, mock_np): sma = StrategySma0() for i in range(sma.LONG): sma.closing_price_list.append(500) class DummyMean: pass dummy_mean_short = DummyMean() dummy_mean_mid = DummyMean() dummy_mean_long = DummyMean() dummy_mean_short.values = [5] dummy_mean_mid.values = [7] dummy_mean_long.values = [10] rolling_return_mock = MagicMock() rolling_return_mock.mean.side_effect = [ dummy_mean_short, dummy_mean_mid, dummy_mean_long, dummy_mean_short, dummy_mean_mid, dummy_mean_long, ] series_return = MagicMock() series_return.rolling.return_value = rolling_return_mock mock_series.return_value = series_return dummy_info = { "date_time": "mango", "closing_price": 500, } mock_np.return_value = False sma.initialize(100, 10) sma.current_process = "buy" sma.asset_amount = 12 sma.update_trading_info(dummy_info) self.assertEqual(sma.current_process, "sell") self.assertEqual(sma.process_unit[0], 0) self.assertEqual(sma.process_unit[1], 12 / sma.STEP) self.assertEqual(sma.cross_info[0], {"price": 0, "index": 0}) self.assertEqual(sma.cross_info[1], {"price": 500, "index": 60}) # current_process가 "sell" 일때는 업데이트 되지 않아야함 sma.current_process = "sell" sma.asset_amount = 9 sma.update_trading_info(dummy_info) self.assertEqual(sma.current_process, "sell") self.assertEqual(sma.process_unit[0], 0) self.assertEqual(sma.process_unit[1], 12) # 12 / STEP @patch("numpy.isnan") @patch("pandas.Series") def test_update_trading_info_update_process_when_long_lt_short(self, mock_series, mock_np): sma = StrategySma0() for i in range(sma.LONG): sma.closing_price_list.append(500) class DummyMean: pass dummy_mean_short = DummyMean() dummy_mean_mid = DummyMean() dummy_mean_long = DummyMean() dummy_mean_short.values = [10] dummy_mean_mid.values = [7] dummy_mean_long.values = [5] rolling_return_mock = MagicMock() rolling_return_mock.mean.side_effect = [ dummy_mean_short, dummy_mean_mid, dummy_mean_long, dummy_mean_short, dummy_mean_mid, dummy_mean_long, ] series_return = MagicMock() series_return.rolling.return_value = rolling_return_mock mock_series.return_value = series_return dummy_info = { "date_time": "mango", "closing_price": 500, } mock_np.return_value = False sma.initialize(100, 10) sma.current_process = "sell" sma.balance = 90000 expected_price = 90000 / sma.STEP sma.update_trading_info(dummy_info) self.assertEqual(sma.current_process, "buy") self.assertEqual(sma.process_unit[0], expected_price) self.assertEqual(sma.process_unit[1], 0) self.assertEqual(sma.cross_info[0], {"price": 0, "index": 0}) self.assertEqual(sma.cross_info[1], {"price": 500, "index": 60}) # current_process가 "buy" 일때는 업데이트 되지 않아야함 sma.current_process = "buy" sma.balance = 90000 sma.update_trading_info(dummy_info) self.assertEqual(sma.current_process, "buy") self.assertEqual(sma.process_unit[0], 90000) # 90000 / STEP self.assertEqual(sma.process_unit[1], 0) @patch("numpy.isnan") @patch("pandas.Series") def test_update_trading_info_update_process_and_cross_info_when_long_lt_short( self, mock_series, mock_np ): sma = StrategySma0() for i in range(sma.LONG + sma.STD_K): sma.closing_price_list.append(500) class DummyMean: pass dummy_mean_short = DummyMean() dummy_mean_mid = DummyMean() dummy_mean_long = DummyMean() dummy_mean_short.values = [10] dummy_mean_mid.values = [7] dummy_mean_long.values = [] for i in range(sma.STD_K): dummy_mean_long.values.append(i) dummy_mean_long.values.append(5) rolling_return_mock = MagicMock() rolling_return_mock.mean.side_effect = [ dummy_mean_short, dummy_mean_mid, dummy_mean_long, dummy_mean_short, dummy_mean_mid, dummy_mean_long, ] series_return = MagicMock() series_return.rolling.return_value = rolling_return_mock mock_series.return_value = series_return dummy_info = { "closing_price": 500, } mock_np.return_value = False sma.initialize(100, 10) sma.current_process = "sell" sma.balance = 90000 sma.update_trading_info(dummy_info) self.assertEqual(sma.current_process, "buy") self.assertEqual(sma.process_unit[0], 90000 / sma.STEP) self.assertEqual(sma.process_unit[1], 0) self.assertEqual(sma.cross_info[0], {"price": 0, "index": 85}) self.assertEqual(sma.cross_info[1], {"price": 500, "index": 85}) def test_update_trading_info_ignore_info_when_not_yet_initialzed(self): sma = StrategySma0() sma.update_trading_info("mango") self.assertEqual(len(sma.data), 0) def test_update_result_append_result(self): sma = StrategySma0() sma.initialize(100, 10) dummy_result = { "type": "orange", "request": {"id": "banana"}, "price": "777000", "amount": "0.0001234", "msg": "melon", "balance": 500, "state": "done", } sma.update_result(dummy_result) self.assertEqual(sma.result[-1]["type"], "orange") self.assertEqual(sma.result[-1]["request"]["id"], "banana") self.assertEqual(sma.result[-1]["price"], "777000") self.assertEqual(sma.result[-1]["amount"], "0.0001234") self.assertEqual(sma.result[-1]["msg"], "melon") self.assertEqual(sma.result[-1]["balance"], 500) def test_update_result_remove_from_waiting_requests(self): sma = StrategySma0() sma.initialize(100, 10) sma.waiting_requests["banana"] = "banana_request" dummy_result = { "type": "orange", "request": {"id": "banana"}, "price": "777000", "amount": "0.0001234", "msg": "melon", "balance": 500, "state": "done", } sma.update_result(dummy_result) self.assertEqual(sma.result[-1]["type"], "orange") self.assertEqual(sma.result[-1]["request"]["id"], "banana") self.assertEqual(sma.result[-1]["price"], "777000") self.assertEqual(sma.result[-1]["amount"], "0.0001234") self.assertEqual(sma.result[-1]["msg"], "melon") self.assertEqual(sma.result[-1]["balance"], 500) self.assertFalse("banana" in sma.waiting_requests) def test_update_result_insert_into_waiting_requests(self): sma = StrategySma0() sma.initialize(100, 10) sma.waiting_requests["banana"] = "banana_request" dummy_result = { "type": "orange", "request": {"id": "banana"}, "price": "777000", "amount": "0.0001234", "msg": "melon", "balance": 500, "state": "requested", } sma.update_result(dummy_result) self.assertEqual(len(sma.result), 0) self.assertTrue("banana" in sma.waiting_requests) def test_update_result_update_balance_and_asset_amount(self): sma = StrategySma0() sma.initialize(100000, 10) self.assertEqual(sma.balance, 100000) sma.asset_amount = 50 dummy_result = { "type": "buy", "request": {"id": "orange"}, "price": 1000, "amount": 5, "msg": "success", "balance": 100, "state": "done", } sma.update_result(dummy_result) self.assertEqual(sma.balance, 94998) self.assertEqual(sma.asset_amount, 55) self.assertEqual(sma.result[-1]["type"], "buy") self.assertEqual(sma.result[-1]["request"]["id"], "orange") self.assertEqual(sma.result[-1]["price"], 1000) self.assertEqual(sma.result[-1]["amount"], 5) self.assertEqual(sma.result[-1]["msg"], "success") self.assertEqual(sma.result[-1]["balance"], 100) dummy_result = { "type": "sell", "request": {"id": "apple"}, "price": 1000, "amount": 53, "msg": "success", "balance": 1000, "state": "done", } sma.update_result(dummy_result) self.assertEqual(sma.balance, 147972) self.assertEqual(sma.asset_amount, 2) self.assertEqual(sma.result[-1]["type"], "sell") self.assertEqual(sma.result[-1]["request"]["id"], "apple") self.assertEqual(sma.result[-1]["price"], 1000) self.assertEqual(sma.result[-1]["amount"], 53) self.assertEqual(sma.result[-1]["msg"], "success") self.assertEqual(sma.result[-1]["balance"], 1000) def test_update_result_ignore_result_when_not_yet_initialized(self): sma = StrategySma0() sma.update_result("orange") self.assertEqual(len(sma.result), 0) def test_get_request_return_None_when_not_yet_initialized(self): sma = StrategySma0() requests = sma.get_request() self.assertEqual(requests, None) def test_get_request_return_None_when_data_is_empty(self): sma = StrategySma0() sma.initialize(100, 10) requests = sma.get_request() self.assertEqual(requests, None) def test_get_request_return_None_when_data_is_invaild(self): sma = StrategySma0() sma.initialize(100, 10) dummy_info = {} sma.update_trading_info(dummy_info) requests = sma.get_request() self.assertEqual(requests, None) def test_get_request_return_None_when_cross_info_is_invaild(self): sma = StrategySma0() sma.initialize(100, 10) dummy_info = {"closing_price": 2000} sma.closing_price_list.append(dummy_info) sma.cross_info[0] = {"price": 0, "index": 1} requests = sma.get_request() self.assertEqual(requests, None) def test_get_request_return_correct_request_at_buy_process(self): sma = StrategySma0() sma.initialize(10000, 100) dummy_info = {"closing_price": 20000000} sma.update_trading_info(dummy_info) sma.cross_info[0] = {"price": 500, "index": 1} sma.cross_info[1] = {"price": 500, "index": 2} sma.current_process = "buy" sma.process_unit = (4000, 0) requests = sma.get_request() self.assertEqual(requests[0]["price"], 20000000) self.assertEqual(requests[0]["amount"], 0.0001) self.assertEqual(requests[0]["type"], "buy") dummy_info = {"closing_price": 10000000} sma.update_trading_info(dummy_info) requests = sma.get_request() self.assertEqual(requests[0]["price"], 10000000) self.assertEqual(requests[0]["amount"], 0.0003) self.assertEqual(requests[0]["type"], "buy") dummy_info = {"closing_price": 100} sma.update_trading_info(dummy_info) sma.balance = 2000 requests = sma.get_request() self.assertEqual(requests[0]["price"], 100) self.assertEqual(requests[0]["amount"], 19.9899) self.assertEqual(requests[0]["type"], "buy") def test_get_request_return_correct_request_at_sell_process(self): sma = StrategySma0() sma.initialize(10000, 100) dummy_info = {"closing_price": 20000000} sma.update_trading_info(dummy_info) sma.cross_info[0] = {"price": 500, "index": 1} sma.cross_info[1] = {"price": 500, "index": 2} sma.current_process = "sell" sma.asset_amount = 60 sma.process_unit = (0, 20) requests = sma.get_request() self.assertEqual(requests[0]["price"], 20000000) self.assertEqual(requests[0]["amount"], 20) self.assertEqual(requests[0]["type"], "sell") dummy_info = {"closing_price": 10000000} sma.update_trading_info(dummy_info) sma.asset_amount = 10 requests = sma.get_request() self.assertEqual(requests[0]["price"], 10000000) self.assertEqual(requests[0]["amount"], 10) self.assertEqual(requests[0]["type"], "sell") def test_get_request_return_request_with_cancel_requests(self): sma = StrategySma0() sma.initialize(10000, 100) sma.cross_info[0] = {"price": 500, "index": 1} sma.cross_info[1] = {"price": 500, "index": 2} sma.waiting_requests["mango_id"] = {"request": {"id": "mango_id"}} sma.waiting_requests["orange_id"] = {"request": {"id": "orange_id"}} sma.is_simulation = True dummy_info = {} dummy_info["date_time"] = "2020-02-25T15:41:09" dummy_info["closing_price"] = 20000000 sma.update_trading_info(dummy_info) sma.current_process = "sell" sma.asset_amount = 60 sma.process_unit = (0, 20) requests = sma.get_request() self.assertEqual(requests[0]["id"], "mango_id") self.assertEqual(requests[0]["type"], "cancel") self.assertEqual(requests[1]["id"], "orange_id") self.assertEqual(requests[1]["type"], "cancel") self.assertEqual(requests[2]["price"], 20000000) self.assertEqual(requests[2]["amount"], 20) self.assertEqual(requests[2]["type"], "sell") self.assertEqual(requests[2]["date_time"], "2020-02-25T15:41:09") def test_get_request_return_turn_over_when_last_data_is_None(self): sma = StrategySma0() sma.initialize(10000, 100) sma.cross_info[0] = {"price": 500, "index": 1} sma.cross_info[1] = {"price": 500, "index": 2} dummy_info = {} dummy_info["closing_price"] = 20000000 sma.update_trading_info(dummy_info) sma.current_process = "buy" sma.process_unit = (4000, 0) requests = sma.get_request() self.assertEqual(requests[0]["price"], 20000000) self.assertEqual(requests[0]["amount"], 0.0001) self.assertEqual(requests[0]["type"], "buy") sma.update_trading_info(None) requests = sma.get_request() self.assertEqual(requests[0]["price"], 0) self.assertEqual(requests[0]["amount"], 0) def test_get_request_return_turn_over_when_target_budget_lt_min_price_at_simulation(self): sma = StrategySma0() sma.initialize(1000, 500) sma.is_simulation = True dummy_info = {} dummy_info["date_time"] = "2020-02-25T15:41:09" dummy_info["closing_price"] = 20000000 sma.update_trading_info(dummy_info) sma.current_process = "buy" sma.process_unit = (300, 0) requests = sma.get_request() self.assertEqual(requests[0]["price"], 0) self.assertEqual(requests[0]["amount"], 0) self.assertEqual(requests[0]["type"], "buy") def test_get_request_return_turn_over_when_asset_amount_empty_at_simulation(self): sma = StrategySma0() sma.initialize(900, 10) sma.cross_info[0] = {"price": 500, "index": 1} sma.cross_info[1] = {"price": 500, "index": 2} sma.is_simulation = True dummy_info = {} dummy_info["date_time"] = "2020-02-25T15:41:09" dummy_info["closing_price"] = 20000 sma.update_trading_info(dummy_info) sma.current_process = "sell" sma.asset_amount = 0 sma.process_unit = (0, 10) requests = sma.get_request() self.assertEqual(requests[0]["price"], 0) self.assertEqual(requests[0]["amount"], 0) self.assertEqual(requests[0]["type"], "sell")
36.418557
95
0.607654
2,081
17,663
4.902931
0.078808
0.148486
0.105851
0.065863
0.878173
0.82613
0.802411
0.752622
0.733804
0.71234
0
0.060648
0.260658
17,663
484
96
36.493802
0.720652
0.005831
0
0.708531
0
0
0.088066
0
0
0
0
0
0.244076
1
0.056872
false
0.011848
0.007109
0
0.07346
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
b6aad79c1705674fd0cd541fdc7a333335fcad3e
3,439
py
Python
Assignments/Assignment_04/task_1/mixturereduction/solution/mixturereduction.py
chrstrom/TTK4250
f453c3a59597d3fe6cff7d35b790689919798b94
[ "Unlicense" ]
null
null
null
Assignments/Assignment_04/task_1/mixturereduction/solution/mixturereduction.py
chrstrom/TTK4250
f453c3a59597d3fe6cff7d35b790689919798b94
[ "Unlicense" ]
null
null
null
Assignments/Assignment_04/task_1/mixturereduction/solution/mixturereduction.py
chrstrom/TTK4250
f453c3a59597d3fe6cff7d35b790689919798b94
[ "Unlicense" ]
null
null
null
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x09\x00\x61\x0d\x0d\x0a\x08\x2d\xa0\x01\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\x12\x03\x00\x00\x00\x00\x00\x10\xb8\x78\x70\x47\x68\xab\x28\x94\x1a\xcc\x89\x92\x00\xa5\x67\x9b\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x05\x32\x5e\xb8\x43\xb9\xd5\xc7\xe7\x1d\x39\x70\x6f\xf0\x52\x5c\x11\xeb\x5c\x99\xf4\x07\x74\xed\x01\xfa\x26\xcf\x26\xb6\xbb\x51\x0e\x26\x64\xc7\x8f\x0d\x9a\x17\x5b\x09\x6a\x77\x01\x7c\x5a\x67\x4c\xf4\xf1\xe5\xac\xd0\x1d\x4a\x74\x7f\xcf\x07\xd9\x1d\x81\x05\x71\xf2\x3f\xc8\x48\x98\xb9\x57\x01\x0c\x94\xd8\xfa\xaa\xc9\x25\x89\x5b\x2c\x55\x11\x6f\x7c\x0c\x30\x46\xb8\x14\xdc\x06\x1b\xdc\x4d\xf3\x9c\x9b\xd6\x98\x3f\xce\xca\xba\xb8\xc1\x0e\x86\xc9\xd2\x84\x16\x73\xfd\x62\x2b\x78\xaf\xf1\x98\xc6\x81\xf5\x6f\x29\x35\xcb\x94\xd2\xa6\x52\x10\x2e\x86\x41\x62\xb8\x00\x31\xdb\xd8\xcc\x93\x29\xff\x65\xc3\x12\xc4\x15\x34\x0e\x16\xab\x54\x12\x1c\x52\xe2\x88\xfe\x5b\x28\x0c\x2f\x74\x16\x1b\x18\xfa\x4c\x62\xd2\x85\xd2\xd9\x73\x8b\x02\x46\xcf\xdb\x5f\x81\x48\xbb\xec\xb2\x0a\xd2\xa0\x25\x65\x22\x4d\x17\x29\x8b\x2d\x84\x4b\x80\x3b\x1c\x10\xc8\x69\x29\x90\x58\xf9\x35\x25\xf0\xe2\x6a\x86\x17\x34\x3e\x07\x21\xfa\x3f\x0c\xba\x63\x20\x72\x91\x5f\x90\x0f\x83\xc7\xc3\x52\xca\xb9\xee\xbb\xfa\x98\x80\x15\x5a\xea\x4f\x08\xbf\x74\x54\xac\x3f\x5b\x39\xa2\xfd\xcb\x1f\x29\xfb\xbb\xf0\x6c\x5c\xf5\x67\x41\x8d\x23\x26\xb1\x31\xdd\x21\x56\x25\x8d\xb5\xce\xdd\xcd\x25\xd2\xb2\x9a\x8c\x23\x95\xdd\x9c\x5b\x7b\xac\x5b\x38\xb8\xaf\x5f\x55\x65\xc0\x8e\x2b\xa5\xf3\x62\xe9\xe1\x14\x32\xe1\x0a\xf0\x84\x6d\x4f\x78\xb0\xfa\x28\x30\x90\x67\x82\x4b\x2b\x0f\xed\xb1\x4e\xcb\x33\xe0\xa3\x11\x61\xb9\xcc\xbf\x84\x91\x1a\xac\x31\xb0\x01\x83\xd5\xef\x49\x16\xfb\xc2\x10\x77\xfd\x00\xd5\x57\x5f\xd7\x61\xe0\x0c\x1c\xdd\x5f\x7d\x69\x3f\x33\x32\xdc\x86\x67\xf2\x2d\x7d\xf8\x62\x59\x7b\x4e\xab\x53\x52\x74\x72\x7e\xe8\x89\x66\xc2\x73\xcb\x78\x3c\xd0\x2f\x40\xbf\x4e\xf9\x43\xc8\x37\x9d\x92\xe4\x67\xf4\x6f\x08\xe3\x4b\x56\x42\xcb\xe1\xee\x0c\x37\xae\x56\x14\x82\x81\xaa\x52\x26\x29\x04\x89\xca\xc3\xdf\x4d\xd4\x6a\x79\xe9\x7a\x97\x52\x20\xe8\xa2\xba\x15\xfb\x27\x05\x3e\xf4\xc7\x9e\xdc\x9a\xfe\x7b\xed\xe4\xa3\x91\xe9\x19\xad\xc3\xf0\x32\xbe\x7c\x26\x11\x37\xe6\xc0\x99\xb8\x3b\xd9\x1a\x9b\x5d\x71\x33\xc6\x38\x13\xe1\x49\x6c\x62\xd0\x07\xe4\x77\x6e\x96\xaa\x9b\x4e\xbf\xc5\x7b\x31\x89\xed\xf5\xd0\x43\x68\x91\xa7\xfc\x51\x55\xe0\xbf\x8e\x53\xa9\x43\x66\x55\xd9\x3b\xdb\x36\x60\x3d\xf8\xeb\x54\xc7\xee\x41\xb2\x0b\x56\x22\x2f\xea\x2e\x02\x79\xc1\xe6\x2b\xfb\x85\x64\x68\x06\xa3\x0a\xe7\x85\xc0\x47\x4a\x07\xe7\x5e\xef\x4c\x5a\xa9\x88\x00\xaa\xab\x71\x1f\xdb\xbd\x87\x27\xae\x90\xe7\xda\x0f\x58\x84\x3f\xe5\x28\x16\x2e\xf1\x30\xff\x03\x33\x20\x22\x7f\x3b\x06\xe4\x77\x60\x7f\xdc\x73\xc7\x18\xfc\x8b\x83\xe8\x75\xc6\x41\x57\x36\x28\x39\xfc\x42\xeb\x76\x6c\x27\x14\x28\x70\x68\xdd\x2c\x10\x5b\x71\x65\x8b\x2f\xb3\x71\x2d\xa5\x3b\xb4\xf3\x53\xb9\xb6\x69\x5d\xf7\x5c\xd6\x63\x11\xc8\xe7\xb8\x0f\x4c\x3f\x30\x74\x3f\xd8\x62\xa8\x67\x53\x41\xc4\xa4\x98\xd3\x41\xa7\x03\xf3\x99\x27\x47\x27\x2f\xab\xfb\xf9\xd8\x12\x6d\xec\x82\x0a\x3b\x56\x88\x59\x9b\x30\x60\x3a\x7b\x28\x23\x5d\x8e\xf5\x7a\x19\xbc\xa2\xcb\x7f\xe2\x9d\xd6\x87\x96\x59\x08\x3a\x74\x53\xf5\x46\x13\xa5\x91\xf3\x1e\x81\x5f\xcc\xa5\x94\x07\xd1\x25\xa6\x2f\x60\x90\xe4\x36\xd9\x70\x64\xb4\x03\x47\x4b\xc3\xde\x99\xa6\x1a\xcb\x7b\x23\x85\xb3\x1a\x00\xfc\x5e\xd3\xf7\xc3\xbe\x55\xec\xd6\x40\xb9\xb2\xb8\xfd\x5a\xa1\x26\xd9\xe0\xe3', 2)
3,439
3,439
0.749927
855
3,439
3.002339
0.294737
0.04441
0.045579
0.037398
0.015193
0.009349
0.009349
0
0
0
0
0.325378
0.000872
3,439
1
3,439
3,439
0.421711
0
0
0
0
1
0.988372
0.988372
0
1
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
1
1
1
null
1
0
0
0
0
0
1
0
0
0
0
0
0
10
fcc090279eeff6564654cdce709d36e30427b387
1,167
py
Python
tests/fixtures/pause_bot_fixtures.py
lidofinance/depositor-bot
3bf6f63fd4f81f6a67838c2d6c63e2384ce50a49
[ "Apache-2.0" ]
4
2021-09-12T22:17:22.000Z
2022-01-26T07:33:17.000Z
tests/fixtures/pause_bot_fixtures.py
lidofinance/depositor-bot
3bf6f63fd4f81f6a67838c2d6c63e2384ce50a49
[ "Apache-2.0" ]
7
2021-09-25T09:34:01.000Z
2022-03-14T15:55:28.000Z
tests/fixtures/pause_bot_fixtures.py
lidofinance/depositor-bot
3bf6f63fd4f81f6a67838c2d6c63e2384ce50a49
[ "Apache-2.0" ]
3
2021-09-12T22:17:25.000Z
2022-03-03T11:26:00.000Z
from tests.fixtures.common_fixtures import COMMON_FIXTURES PAUSE_BOT_FIXTURES = { 'eth_call': ( (({'to': '0xDb149235B6F40dC08810AA69869783Be101790e7', 'data': '0xc7062e98'}, 'latest'), {'jsonrpc': '2.0', 'id': 11, 'result': '0x00000000000000000000000000000000000000000000000000000000000019f6'}), (({'to': '0xDb149235B6F40dC08810AA69869783Be101790e7', 'data': '0xb187bd26'}, '0xf7b1887b32ad3b9346f907947e2dffb5012de2b7cb7b6b84b950356237944d0c'), {'jsonrpc': '2.0', 'id': 16, 'result': '0x0000000000000000000000000000000000000000000000000000000000000000'}), ), **COMMON_FIXTURES, } PAUSED_PROTOCOL_FIXTURES = { 'eth_call': ( (({'to': '0xDb149235B6F40dC08810AA69869783Be101790e7', 'data': '0xc7062e98'}, 'latest'), {'jsonrpc': '2.0', 'id': 15, 'result': '0x00000000000000000000000000000000000000000000000000000000000019f6'}), (({'to': '0xDb149235B6F40dC08810AA69869783Be101790e7', 'data': '0xb187bd26'}, '0xf7b1887b32ad3b9346f907947e2dffb5012de2b7cb7b6b84b950356237944d0c'), {'jsonrpc': '2.0', 'id': 14, 'result': '0x0000000000000000000000000000000000000000000000000000000000000001'}), ), **COMMON_FIXTURES, }
58.35
267
0.734362
70
1,167
12.1
0.428571
0.066116
0.226682
0.051948
0.701299
0.701299
0.701299
0.701299
0.701299
0.701299
0
0.485139
0.106255
1,167
19
268
61.421053
0.326942
0
0
0.4
0
0
0.623822
0.48329
0
0
0.517566
0
0
1
0
false
0
0.066667
0
0.066667
0
0
0
1
null
0
1
0
0
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
0
0
0
1
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
12
fcd6f9c2f8d8c1c28934ef1e72b6f5e5d7ffc8dd
2,509
py
Python
star_1.py
onesk/aoc2017
43594116e3ac94fb37655bcda9cd462a8d70dd04
[ "MIT" ]
null
null
null
star_1.py
onesk/aoc2017
43594116e3ac94fb37655bcda9cd462a8d70dd04
[ "MIT" ]
null
null
null
star_1.py
onesk/aoc2017
43594116e3ac94fb37655bcda9cd462a8d70dd04
[ "MIT" ]
1
2018-03-02T08:50:38.000Z
2018-03-02T08:50:38.000Z
data = """ 181445682966897848665963472661939865313976877194312684993521259486517527961396717561854825453963181134379574918373213732184697746668399631642622373684425326112585283946462323363991753895647177797691214784149215198715986947573668987188746878678399624533792551651335979847131975965677957755571358934665327487287312467771187981424785514785421781781976477326712674311994735947987383516699897916595433228294198759715959469578766739518475118771755787196238772345762941477359483456641194685333528329581113788599843621326313592354167846466415943566183192946217689936174884493199368681514958669615226362538622898367728662941275658917124167353496334664239539753835439929664552886538885727235662548783529353611441231681613535447417941911479391558481443933134283852879511395429489152435996669232681215627723723565872291296878528334773391626672491878762288953597499218397146685679387438634857358552943964839321464529237533868734473777756775687759355878519113426969197211824325893376812556798483325994128743242544899625215765851923959798197562831313891371735973761384464685316273343541852758525318144681364492173465174512856618292785483181956548813344752352933634979165667651165776587656468598791994573513652324764687515345959621493346623821965554755615219855842969932269414839446887613738174567989512857785566352285988991946436148652839391593178736624957214917527759574235133666461988355855613377789115472297915429318142824465141688559333787512328799783539285826471818279818457674417354335454395644435889386297695625378256613558911695145397779576526397241795181294322797687168326696497256684943829666672341162656479563522892141714998477865114944671225898297338685958644728534192317628618817551492975251364233974374724968483637518876583946828819994321129556511537619253381981544394112184655586964655164192552352534626295996968762388827294873362719636616182786976922445125551927969267591395292198155775434997827738862786341543524544822321112131815475829945625787561369956264826651461575948462782869972654343749617939132353399334744265286151177931594514857563664329299713436914721119746932159456287267887878779218815883191236858656959258484139254446341 """ # data = "1212" # data = "1221" # data = "123425" # data = "123123" # data = "12131415" digits = map(int, data.strip()) res, res2 = 0, 0 for i in xrange(len(digits)): dc, dn, dnn = digits[i], digits[(i+1) % len(digits)], digits[(i+len(digits)/2) % len(digits)] if dc == dn: res += dc if dc == dnn: res2 += dc print res, res2
114.045455
2,136
0.929454
57
2,509
40.912281
0.45614
0.015437
0
0
0
0
0
0
0
0
0
0.900456
0.039059
2,509
21
2,137
119.47619
0.066777
0.03069
0
0
0
0
0.881286
0.880462
0
1
0
0
0
0
null
null
0
0
null
null
0.083333
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
1
1
null
1
0
0
0
1
0
0
0
0
0
0
0
0
9
fced3499a75cd16b91b75f72559533810d7e314b
176
py
Python
implementation/shortest_path/__init__.py
e-liyai/Graphs_in_Python
7b7ec2e38be8761ada4f58b65d6d50c8f2ff133b
[ "MIT" ]
null
null
null
implementation/shortest_path/__init__.py
e-liyai/Graphs_in_Python
7b7ec2e38be8761ada4f58b65d6d50c8f2ff133b
[ "MIT" ]
null
null
null
implementation/shortest_path/__init__.py
e-liyai/Graphs_in_Python
7b7ec2e38be8761ada4f58b65d6d50c8f2ff133b
[ "MIT" ]
null
null
null
from implementation.shortest_path.shortest_path import * from implementation.shortest_path.dikstras import * from implementation.shortest_path.dikstras_priority_queue import *
44
66
0.880682
21
176
7.095238
0.380952
0.322148
0.52349
0.604027
0.590604
0.590604
0
0
0
0
0
0
0.068182
176
3
67
58.666667
0.908537
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
1e144369f4a8bf7f878f01e2c3bfdcb587c1b9bd
125
py
Python
usgscam/__init__.py
scsides/usgscsm
4a69e01015faddd7d0bdeb15097cc02a9cae09be
[ "Unlicense" ]
null
null
null
usgscam/__init__.py
scsides/usgscsm
4a69e01015faddd7d0bdeb15097cc02a9cae09be
[ "Unlicense" ]
null
null
null
usgscam/__init__.py
scsides/usgscsm
4a69e01015faddd7d0bdeb15097cc02a9cae09be
[ "Unlicense" ]
null
null
null
import usgscam.genericframe import usgscam.orex import usgscam.genericls #from usgscam import mdis #from usgscam import orex
20.833333
27
0.848
17
125
6.235294
0.411765
0.367925
0.320755
0
0
0
0
0
0
0
0
0
0.112
125
5
28
25
0.954955
0.384
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
1e543f39b324ea047260b098d834a5b8b1b5caf5
3,932
py
Python
day8.py
sarahann6/advent_of_code_2017
1c9e7f752962384bbd92bc3a80bca26800959f66
[ "MIT" ]
null
null
null
day8.py
sarahann6/advent_of_code_2017
1c9e7f752962384bbd92bc3a80bca26800959f66
[ "MIT" ]
null
null
null
day8.py
sarahann6/advent_of_code_2017
1c9e7f752962384bbd92bc3a80bca26800959f66
[ "MIT" ]
null
null
null
""" Advent of Code 2017 Python Wanted to use eval for solving this. Things get weird -- probably because I got started and then did not touch what code I had for a while. Got what I was trying to do working. """ with open("day8_input.txt", "r") as f: instructions = [instruction.split() for instruction in f.read().splitlines()] def part1(): # >>> eval(asdf[-3]+asdf[-2]+asdf[-1]) values = {} # instructions = [['wui', 'inc', '-120', 'if', 'i', '>', '-2038']] for instruction in instructions: # print(instruction) # print(values) if str(instruction[-3]) in values: if str(instruction[0]) not in values: values.update({instruction[0]: 0}) # value operator value # if eval(str(values[str(instruction[-3])]) + instruction[-2] + instruction[-1]): if eval(str(values[str(instruction[-3])]) + instruction[-2] + instruction[-1]): # do thing if instruction[1] == "inc": values[instruction[0]] += int(instruction[2]) if instruction[1] == "dec": values[instruction[0]] -= int(instruction[2]) # have to initialize else: values.update({instruction[-3]: 0}) # print("NEW!", values) # handle first if str(instruction[0]) not in values: values.update({instruction[0]: 0}) if eval(str(values[str(instruction[-3])]) + instruction[-2] + instruction[-1]): # do thing if instruction[1] == "inc": values[instruction[0]] += int(instruction[2]) if instruction[1] == "dec": values[instruction[0]] -= int(instruction[2]) return max(values.values()) def part2(): # >>> eval(asdf[-3]+asdf[-2]+asdf[-1]) values = {} largest = 0 # instructions = [['wui', 'inc', '-120', 'if', 'i', '>', '-2038']] for instruction in instructions: # print(instruction) # print(values) if str(instruction[-3]) in values: if str(instruction[0]) not in values: values.update({instruction[0]: 0}) # value operator value # if eval(str(values[str(instruction[-3])]) + instruction[-2] + instruction[-1]): if eval(str(values[str(instruction[-3])]) + instruction[-2] + instruction[-1]): # do thing if instruction[1] == "inc": values[instruction[0]] += int(instruction[2]) if values[instruction[0]] > largest: largest = values[instruction[0]] if instruction[1] == "dec": values[instruction[0]] -= int(instruction[2]) if values[instruction[0]] > largest: largest = values[instruction[0]] # have to initialize else: values.update({instruction[-3]: 0}) # print("NEW!", values) # handle first if str(instruction[0]) not in values: values.update({instruction[0]: 0}) if eval(str(values[str(instruction[-3])]) + instruction[-2] + instruction[-1]): # do thing if instruction[1] == "inc": values[instruction[0]] += int(instruction[2]) if values[instruction[0]] > largest: largest = values[instruction[0]] if instruction[1] == "dec": values[instruction[0]] -= int(instruction[2]) if values[instruction[0]] > largest: largest = values[instruction[0]] return largest print("Part One...", part1()) print("Part Two...", part2())
38.930693
139
0.495422
407
3,932
4.783784
0.199017
0.14792
0.14792
0.086287
0.828968
0.828968
0.828968
0.828968
0.803287
0.803287
0
0.038674
0.355544
3,932
100
140
39.32
0.729676
0.234741
0
0.821429
0
0
0.02047
0
0
0
0
0
0
1
0.035714
false
0
0
0
0.071429
0.035714
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
1e7bc135afbe7cd1610356c4af7eeb32f79fab57
13,192
py
Python
Client_Code/png_163.py
KUAKE2002/Email_Client
a773bbfd1cdc791f9280102f2d610a810a431e21
[ "MIT" ]
2
2021-12-10T03:05:00.000Z
2021-12-12T08:56:23.000Z
Client_Code/png_163.py
KUAKE2002/Email_Client
a773bbfd1cdc791f9280102f2d610a810a431e21
[ "MIT" ]
null
null
null
Client_Code/png_163.py
KUAKE2002/Email_Client
a773bbfd1cdc791f9280102f2d610a810a431e21
[ "MIT" ]
null
null
null
png_163 = "iVBORw0KGgoAAAANSUhEUgAAAVgAAABQCAYAAABcSG2ZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplY2RlNTM4Yi1iNTUyLTA3NGUtOTNlZi0xODc4YzUyMWFiYWMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTQwMTZBQ0I3MDQyMTFFNzkzNjdEMzlDODQ3ODdGOTUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTQwMTZBQ0E3MDQyMTFFNzkzNjdEMzlDODQ3ODdGOTUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5NzdhZjU4Ni01ZWUzLTExNGEtODNkNi1hNmYzMDExOGIxOWYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6ZWNkZTUzOGItYjU1Mi0wNzRlLTkzZWYtMTg3OGM1MjFhYmFjIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YkC/rQAAIrlJREFUeNrsXQncl1MWvl+U0KZCxlamZB1EYoaJrJOQMSQxMaIRkn0ny5iJqGEYMUhDqUFCqJGpsSvKrqZIpFLatGj95nnmO+9857u97/9d/8v3dc/vd3//5X3v9r73Pvecc885t6y8vNw4cuTIkaPsqZZ7BI4cOXLkANaRI0eOHMA6cuTIkSMHsI4cOXLkANaRI0eOHMA6cuTIkSMHsI4cOXKUT9o0H4WWlZVlXubk2rtujY8LkPbYb820U92rc+TIUZaUD5+ATUu90wDWPfBxCdIZSHWRJlSDNjfAx25ILZGaI22P1BSJi8SWSJshbS6fWyDVkay9sHgMzUN7muBjT6TWSM2kLQ3VLcuR5iDNQvoU6UO0Y7Wbco4c1VCABSgchY9LkY4tcTAlu74fUgekg5DaIu2UsLg6GbVpE3wchvRrpCMEWOPQSpTxJj5HIg0D2C50U8WRo2oOsJjUBJjTBVj3LnFQbY/UFakz0jYlxDlfSE5YuOaktLkAM9NdKJdc9e0A2uk1fUK0bduWz43vd1kGc2srpK8mTpy4OkV7TsPH8yhjeRGexa/wsR3Sl0hfIH2NdqzH/zviexekd5A4Jubx/4zq7IOPRUjfIC1FmoSyq60//6YlAgwUWX8v4LBtCQMrxfvfIl2cgCvMN+D3RLoNqUnGxVONcTbSGainPz5vAdD+mPFE3kbe/1JJ6zPuQz1JUzFZR4bcex3S+RnWvaOARZLncgAlCII9vj+Pz3FIY9CHbwo0tCiN3SzfpyAdIN8J9neq+wjEL2dUZxeRBElXoK8THQebHBgIUlyxugvXVKrAWle4wmvzAGBp20adKjnMw/NcVW2ka5A6oc4uANnPMiy7jprI+aR7RO2Ri7JWhyxNkbe3WiC6Cmf3jwIOL932IcC6dfyCz4UAfO//6fj9coZ1rlLf/+pUBMlAoYOoATqKOFayhLbSYqG/cCKl1jaqUV5E2qGA1bLOt1F3J4DsaxmVuaRAbV8c4Z61WVYI8EkEsAAw6vXPUH/1QlmZAg7qOAEfjXIsAlpN1wL3d/bDkID/txBm5DW0e0rCZ7c8R9sb4+N+pCBpiiaoDeT7cJQ1rEYDrOhXTxVg3a/UVx60d3t5gSfkuSoOkKlIM5A+i9E+Dv5XTYVFQKGJA/dFtOFQgOyUDEDoB8URGXkOWVkxUEqqK9/j6vJuRtv6xgStRsJppgE+tneIYj4WILXD/+1yqEA2lfcyCm3+c8SqjkM6L+K9F0myqXmIVHCKqBeyppWiTohCD9ZYDhaTkCsN9YPUr/6kOrD1aDM568dNxSZFlkTQeIscoKnYIPgAaSZAan3M9lEtMLpI4Kon9UgCPdq/LOOyOwIkZmbEpXFy71NdREq0l6D6CNJe6m++5+4Rsn8r4zYqbVmALi3KR6EYHyutRTmI1iD9u8YBLCYebUCpXz2rQC8yizZzcN9qKjY6shxgT8kqPwFgtCJlGyn6DCsRlQW5F+pOLysQ+JBD40be3UEALKL1lIx2nvugvLNi5qmVon9lIjV1lb84VubnyMINyGbq93no9/cxqrzbVOg5g0TxbkiXy/ebkJ7TQ1E+p/lwkrcgHS/f1wX0lYsGGYsVaPOPEZ8PpQNKwj9aqhfmv0b97qDqfwf3LivWBNk0T0D1rIjWJa1f9VFh/A3pzIyKHI90H0U2gOqaDJtKSeCwEnp0PfHsaML1fdYFY0LtzjGECfKp/LW/iKkX4BolgEG49pi6vz4+3icnh+98/pOUeiAJNTRVHTLyuXhw/A0ShsQD18Ny7aIjDwHyEvn5FG4dHZMLfD+kTXqczdK6VMU9rrR1rLgWZaPwRk/lEMSJ4v+gRZJWLYPV71Vow0CV72B1bVwxJ0e+ONgTTTUiAVeuzsdkUBz1otcBcN7OQzubCHdQSkTphHq2BzIssz0mCcGGziZjTaWzyQGKS/wZuROxEx0uHOuecp2qKNpTzzXBmyBRiJtvi2PmqRVXukAf2N7hSIcosfaEEHBtYyqtDJaJtJgE2PvKos0FcqV1eWvNlYqNqk2tRQ2jSTva1A6o+ocU72VxiBTQQf31Sk0E2OoErvR6GpEBuH6HdDGA9ck8NvfqmBzVPKR3TYX761LhipiftsbUSx6Y0Rg4KmOApVh8hEhAx2DSHASseVsBLIkqAkpKrQVE+V3vei8ULumIFO0YmO9NLtxPbztuwjSxFum9cS2Xsw053U3kO3X5p1icIJkG7uTPRB8GhzSjiQk3P9wxYOGoa3LruJtGANivTaV5XEtTqVL8QN2j/89lmbGXqpOqj3ccwBaXHs6A46YS/TSA65w8LgQExp4Rb3/DVOjM/pVrA002IMnpUefcLEXz9sq4u1wQ7lHib1/hYtvL77Ui/nsbP9cIwGrrlMdo5hNxIySIGiF/85h5GkQE1h2lj34mTsfEXPB/IcmPJljitE311HcyB2MsSdRrH8fTLHXtUQWON/qUS3CnbXuQ95+WLG70FgFR7bQXFca+6nmNV+8/16awXlDHo4w1xQSXYgAsld4TZSDuUWTutY+JtjubizgouxcgOAo3PupHuI8T4Va0J3STR2IM/AXPYbBwoN0Sti0f3nd9pT3bCBfbQ9UzWsTaY+W/A3H9WCViG5FK0tLFkhIT2rUpJrmfbe2RSNrsarlwrsdn/BzDxqXWUY/V3C7arhfO5ywdrAewCyNwyIUk7XAzrtiNKRTAUrfzknAZL2BiL+LGSDEBFvVzNeyfshh61ZyB/qwrQJOjLAT90ZbYOlqaWeF5nCmT7eQEbaubdWe5S4xJfI1IGKR71eXB3BnG9evx/SH5r5/ipL9OIRpm7VG4lfGxBED7H0X7OR9eFunhJKRfKoAdFKB2oUrhBvlOve2fAkDmbvkeZrWiVQNnok3t1e+fq++3BGxe7YT/B+fAl8aSeqLPH+RzgqAdXpCjjQJgqSfhxtEzHESYxCtjrqz5BFdyz39XOqwk9K5wrusK0F5OwINCbnvdVOhoExE5XtRzkYiFccdFvjyxhgiYNFcgvkA4WBLtRbnRQ13lz/TCl8JMazMB6MUiiu5kqtpDf2iiOSxwjFEX2MgEmFqhjYsACjT2p6XEfHz/pbo8188DCvd01G0JuCeOWqNJAPdn0/E5FpDuEbDgowJM7TZKRTO/QHUWBWBpojUWk3aVKU26y6SzIyWgnOKzaOSLOoZcX5EF2FOHDJClfWNcxWVeomxRtAZYkDPVLqKjPL2aRHaiJDTMR7JIWifVRn0EqBjE5GmtMsD1ezLu44KYWbRb9HcR7g/brae+m3sHi3zmcAv5Tt3rSB/1ibfgPeFTbgtT6QX5aVbRtkJI61/HlUIUrrwALCbq8yUKrOQGySX0SFnM5ejjrAI2+8iQ67RD/SKjumYnANh8Rjwil8pNlO0CxD46cdyuwGCOSBdpRE1aL9Cl+w5T6TjAmA8fWrahUai2cIm0Fx2VwfPYxnpXYVQ/woKi+86d+j+q58nNqFNx3zvWfR7AzvbKkOfWCekTpHMVwIZxklQzeBta9VQd+6p76kXo687qeyvkr1dMJ4N8qwhKEVw5WQakLIY79A8XuOmDRNw8yufaV6ZS35YFJYkWNiqPffdOYPCos+ZYhct9RSb0/15zGm5JxGs+76N9pIiOKfoxJOZzamYBjEctLWDyA/y9EvSbwM3gMvTK81zaqcbrYoNrDrAuRzmLRaIpi7EA32z8o6lNjtmNy4Q52F/SkwxoUyDu2QGsqTBJapMiP0WO86Ps0GcsEdDUZgIWCLb9KlNh2O8N4OuyUlXIuWftYmajq2Q+j/G51FQ1Vqe9502YNJ8LMDSV9+rRUTSBwvWvYwJMM6mLeui6eejH1Jj39zThZnlRbI/r+fSVeuZjhUvdxVTYQ7c1G7r5Ukr7He7/XY7yW8hmnYcn1MlSheOdzsGNraGFmCd45yvQFu4hvC+c/nGiyhhQLMDZaABWuNdrUxYzAmBWNMU56ubA6YK+0G71ClNh95llGLabTPxja26LG6wmBujt5AMyZaIy8ECVvvJbWiJ5HxMhPgJFSBFpT5FP3Xd6gdF1ep1S03i2pvyPenwubFyUeql8/UyljSeDiHumZTMidLlWIeY4gGiVbK6dG5K3pcUx+xE3lWw78vdMhZMLJQu6M4dZMgxTah2a3/1Uvl+i7tH/5wLZ2egbF8nh8tet+P04NxEdwOaXqA/aPWUZAwFuxwgXvKe88B1Ez1VXJtYKmZxfyOrNmKlvZbnhJ0e3MAZArazADWXRzvaCmNnoYPF4Ht/ZbYqbHKAmXFdMGv5eYCo3W+YKmP3vdAdcvxWTKszNlSZpD5kN3TlpQ9vLC5yCsrpai/PVuNZfrt2v/n8R/1+tAFxzflGcULSXHi1w7I0l7tZ7KoEnTLgbaP0c9RKEDpE5QVUArX12VIvIi8KJaqyg1U3QOOYhn94pH5fjOYyP8Z7HKkeDzh6QWvEFOkcBWCFuct4gqhIuvjyhoigu5hsTwF6YMj+B7HWT27RrM5kk2wl36dmULgWAcTPmPuFCswLarMC1h4nv6krw6ZYvdQkmFCf6mQo8CXAM4uGZq1HvvEQBMDl6BgHpIJOK3OOfQridx1DPPAEzgiw3jWgp8LS0oUzqvU1lu1+BKxfa8yzuVdO2FkccRo3U99mW0T+5bW23faKI+FSFkEN7IaY4TS6WnDd1lfR6WyD2rB7AdtMLFN2V8fFPSdTJvqpjJUhMg5tKYaKLLni4qdRF/7pYAFvLbAQEANnFVA0AkfRZJbWbpRhFbuY9tOUlpN1L5LlsizRMuLg4faNozBMN8nU2FBcqHSS5n4S0e0z9d4jo2EiThKPT5lm9JUJV2GR8WTh3AvbuClz3EA5Rg+sD3kItu+3D1HN7AXn/rQCnqaVy+DZCv6lGoNUEvaQ+9+HmvQ3Il6RsOgIwVOD0hEBEV9K7IpqKtTIV+tyTZOGqV+LTfpL6vleUseA42OTUzZRO6ERuLhwBYOOKenu+9JchwEpvpZ7CcTSKmZ1G4yfmI1qYIppHeV5+BPFB8p1uyb2kDdr3vo9wLdxs8WxmKUV0jQg0Dwko7oBEfSwjdGmLjbWiFrhL7iOo0lFlV7m+2lTVF5K0OdXKKOZCQTa2qI9qqd7qr1sEXOtI26blkASyMlU6UH0n9/qvEp/zOnwm39cWpgjOTRsFByurbikRxVEG9n5BgrgUClgbI1FHyGOYByQAVxKDgbyd56bqY3oYCMSzklgiXKyO90m32TcEoCiGc4OFm1DUIYbGJQUAHYL0ANI0EbcftsD1f44XClzrSBv0mLoM120uUjsEJOb0Jbbp04pBeFgii3m0PMQM6R45eystabfZe6vBnP+Jj9TlVAR5ABUq7kv1DDB6Co3NJ8gyHCM35pCok+KGB43I0wRnIYc3CeXtm8fnQntRqgQ+sdQC24uY7NlHUkd4lZWXOtPWAJ3jkKI4vHwu46OV9T/BmnrcAzx3VAAVdZ6vmqpBcZ7E9b8EiNQefZfkIcjmGh0rPCsJWrDEjftKddQolDUO6fch92p743oWyLdRaozn+SysYDA6iljc8dWU9sdig1xX1dvIS2HStpx28X+u3VQN0vMldc5ORZAfOqzE20fRazRP2s0qIpeoAChWciPkeJP9UeO0oHgT9ZyFNo/IwzMhiHBCbKu5M3z/RgD0Wtlg2hr/fWeJ2WPjVCSbO+TwPhBgIBdLz7BHcG21TNitZcJeZqrayHIhCPLD/0VSDhb1bScShj6K5T+m4qyyuOK+593EPQhauOTazPxUuP4tvH6iLYzBq3XblICoI+embRtcHyscLRfvoSKOxz0W6U5JNsU5z+tI2aSjlNPMwraRxZrcGwPAHloN2sjJyONlzk1bEECPZlMnm/wYy2siiA/jKQsA2czPrweQzDE5TJv8jjsRzmWdp1IQK4CtI9Q1D/cSKFt4wEpjfAmscpoAnd4kIejfJEDcRo5uoUcdbS0JyruZqrahkWynhYPj4tLTen809Tsp4Lyt+kF6VgHq7dRfo0Oew5WSjwB6BD7/gM/fKEmXOnAC6guKoz1a0rcibQxDOQW3FUedz4ilwxXWJVqJ9HMAm18OsTpQD4DVaIDVsynLOaQA4KpVTIwnOx/tfqoEniHFRMYL2FzAzj4UMBf3RwsABkbpIyZiHYz/Tjl3py9U7qOTcD+53jMCyl0rwBQEqj8VaYNH2jNORpkF5LQeuNUnpux69Q4o/lMvW269m4OtPKNVvXVERcX9gPrCvdOxg6cT7CtcrPHh1teKWqaTLCLeaQbUeTK85DUo+3Phemn+9l6EoCva0SCIojgajLYAdposTN8Va0DWaICV42B2y7BIckacWJ8Jp7KVDLCsjoUmWI0pYJSurEB2CNr9Gdr9SZICMCG38uGOk3AxPOyQE+wRUzXwh0ef5cjOXf+Hc4wX6h7J0T3ms6nEXf3TffJQXOVJrzMC+k3LgDtkIbCJm3Xn5ziXa7apDKN4YARG4hXtPuxx6UqsDyJPZTJIAeVESTeJOdtZpsJm2VvM+AxvkDSTkgDy2s9eMwE0F3swZIycrgA2aHOWi+rHkgi2wzfGEw0KSS0CBm9cGiuT9jk/8AO4tJCV8/cmnTnY9iIi/rGaPWcC4uN4Dm3xfNYmyL9VyO849HcBLfssKOpYx+QA568kHis3sfTmDfWS1A8+HnAyAfNOFQ7yIAG+N02FrSpPev0hR53c4Web6EXlmaUtEPUDAS1X+Mm+psJWuHGEZ0ILh94+9Y9A/Yyjax9TP9NUnIrMdo3xdNEBfeDzuRLlUDdOg37qqj2LA+br4QOunrTxfzVHROnEo4ay8eVRbdWWvUtpYtR0gG2eMj93cBmacEqum3CdZk+9xFtrpIl4LlMA9UY5dxXgCJqsiWJlEo8w0jrhkuYKJ5k4gLdE16IYT907N5cortJhYHAQQKq8DHrdSQDyLUoUMVw+KT4vFVOxOO2dKhGxXhEx/M5coKzyPS12v01DOP7V5OxzXCdIt5H+vi8i/dwkz91UuBiPEBULzdqex/9BpwqUC5A3iAiwBO+lMlb4fGhZQe50lSlhp4ey8vLsPR3LysKZOIBIX5PMtW4CwOewiCqCM4SjSUodUddLMdUSh8pkSeM5cjLqfSahWmRmgHhcCKI42bLYiwM3t9IEW85xjpajGO+A0qN44IXdWytliMm6UeoJo3xgYU3nYJumzP9h3AwAl9dk8bg9Rb2/EfEsCQ0WcOdqv1K4wZWS1gq3Qy6RgTlognOgCT67Pi7R5vg4U0SzGOGmylPmd+CazTv4MeK961PW9WOpPoeaDrCNUuT9AWA5O2FeikfnmOjRf2w6PGmj0ea+MTleOjnQFIm63yw2BLsUG2AdOSoVqumeXGk2nL5PAXIUke9MUXczAF/zQjwgtHUJEn39ubHT26R3KTzaTStHjjYOgE3DoS9OWfdwEcmTUqtCPigemIhEjxyeaPB1iqK2KtTi4MiRA9jiUhobuB/SVAywIkCniThUlI0qObGhvYkWIDqI9nRTy5Gjmg+wS1LkbZBB/eNS5C2a6YmYnXVNUURjN7UcOar5ADsvRd4s3E0/LnL9aUCWBxkmDeTSyE0tR45qPsDOTpE3Cw7ykxR5S8H0JGnczzVuajlyVPMBdmqKvNtNrr1rWvvQ71Pk/aEEnh89mpJs9i1xU8uRoxoOsBBz56ZQE/DZ7JSy/jQg+W0JPD8agH+YIOt8N7UcOdo4whUyDNrxCfPSVGpGyvrpUZVkw+yLEnl+SUK9fVRTBk+/fv3oVadPJB581VVXDVbXebS0Pt2hB65PT1gXA6NTLaOPO+mE8pblyEOvPcZB4EkTDNzSSKSOuSKBPIH8b6j7W8t8YLwAOpYwXuyWMk65uclgN39Fni8dPDqAjUL/TAGwjAr0csr6k4DrigyAvVg0D5zvvBo0fni2Vnv1e7x1fV/reiLdPYCPAVfoHr1z1DmKPC3xwYAvtlnctpL2EWniDXWN4Qnb+BTXWBKP8b4YZV8IkH3IQaRTEYTRiyny/jJNxYz2nzDrpIRh//JBzWLe/5KbVrHB9bcCgjvHyLO1cJsaXKlWGi3vwDumxg4V6Nk3cxOVUccYFJsxjvV4I1f8IOo42L0dx8HmJADVDAAdB1C7BNkPpq8+3UkTVr97wnxjS+HZoe91LPE3Cj1Tw4YQD06cqX5/niGwchP1bksFEZWYb0f1m0G/bwXXuVaVf4DZ0GGE/aGKYzTuXWmpDjju9L7DeaYijKEjB7A56dGEAEuAoW7rbwnrbZsw39MhwEed2WECfoyMxaDi1Hs+g8VgTobPrUNMkZcutmMSAM2+FpAPxeRfLQDRSSb9KuHYnsK1ciUi8/jsn8q7or79UVxfFVAPI4n9QsRgBkmvK+XyQMFnA3SnfLbarjcT+2S0hacIvJJESkJe9lc7goxE2zcI/Yn/Jvn8N8ivTPw/FeUyfsa9aRkElMM+MSbFLqYybiuf8QtaH6zu5/PlwZM/l/HMGCJUM70t72VxhDEzjO9dVC3Hy5hZLSqdf+DaesnHNjG2bEt5tzyZ4RFcz4tZ5MYCsENMxXEfSUT2PgC0R2RHPS6dkiDPO6jr8wBg5eTmRLrA+AcpHoB7eOzJLRkB7bUx7++fMBZsZ1M1NvA7mAg8IeJs6z6eGPEE0hm4znOhGBJSq7l4/9m4djgmzAprQhKQHjKVR2DbdAfu+QPy3WD9T6AYoH7fjDQl7YNFPetQ38sKYNfLGL0hQnZGLNPHvNyR0TyxT4ONFfgH/dlHmJEDAm65Gvecg74/ovJcIP32O7qehz8OxD19kWdgyJiZiPt6C9dtjxkCahdcv4Rj1BozZyH9DtfIsCzLGniKCbBlhaqIx7wAePhgkxzFQh1Xd+GC44jXXF2T6LDuCShvc1mNc529VFsGVDfcz+OVH0i4MLC+i0y8E3mnC4BlQUNzqCa6YTKQ2zgn4PqBsjBc7zPWtxQg4w7598KZtpKxyHQ9yv4Mk3logYbmn6S9PKiSISPfiwiwOmIZTQHfRbtbCGfOfvCE2/cI4jHAkePrfOvv12LkZ90TrAWsXFQqy+U5E0S/U3musBaH1SKleNJTHckzgO1Df3LN38dzjJlTkX+5z4LtEdt+I9KVWb/gYm5yNUyYL+kZW39GmpUw790AnJ1jgFOZrJRxiZ5fwwOuXW+in5BL7pbHgDP4988SgCu5vYExs52T4WGNnCg0MbpU+m2bihFcFwpAXeTDUZ7mU+Zbwq00xkRtidQOqbWojrRK4cJCTQBRdXCDa398jxO3Qr/TWcLV06yPJ7nSvZl7Dt8AVLoHqScoYks6FKmXPEPNec42ET35kL+WAJwG18kEVfRrDySqyhqLRDdZ8uxmqgalJ/fYFvf+iknaslRdvw159gwZM3zHl8kCa1uyEFy5l8IjvHvLYqapaz7ecTE52F0S5tsmBRfLCZvkeGlyOmOQvwPKieIAQPH1iAT1XMmwgT6At4lwpnGJOq33kZ9i2wCUPTUEWOuJCHxpzHruQNn/znBsUFo4R+lap5mqcRE4eQ72bDVxfaiAsCc2t/ABs+nCZdv/U7Qkl7WP4oALRqj/BxPDaw9t5eK5lSVh+QEPrT8G4/56qOM+nwV4co5q+C67IV9UhxHqT3ezONGTtS2t6ED13LvIwp97cc+H6v6PxMb4RsUMXpRjHgyTNntjhszKKHWdC3I7T8+O6zxKar5qww41BmAxkfmC2ycFZp7iKhGf4oLs08jL1b5bgnpbC1hRjzPcT/QWMf62BABFGoIyg0zKWpnkEao2EV1WT7TvTRHj3hWQothEUG2OdKSp2DCKG6jlGRNfVxtGH3oTRcie6G9bk3chJswyJRXV8gEm9rOXgEEL4VqnCadf5Xnh3gYoc6kpTfIbB5QcbjUV1g69ROXg0Z3oz3D0Z0GMOhaJeB+VjrV+vxrBUeFI6/don3tGK4A1IUzLu9aYsaXVj/QmJjfORG3QMJ8vqyAAKyIzN5h4LDWP1T3XpAsH+KxwZR+Lvml+DLfUXiIWtkxQ77aiH7wT9b8k+qXvpS/kgE40yTbS+OIvznF964xexc9N5ZHKWRBNfrr6cd2lRJhIXEDG+UhNBNpjfMCklO3DN/H570YARn/pK+1av1Rjhos+N4S0JcwqUZl5qrpWMi68fRGO4/1oxRGRi7U56A9C3gfr2dX6+z8+t9rejC2pjvAsAqoD5QVgAT5Ulv9RvcCsiTqoe6w614vOhnqWNzHpTw/gYpfiXppxvJGCK+RC0SOjvrDNJ0iA7iCaU4JjhxtavUrIISLXZB5hget1ooYg+NySUKIpFvlFKntOcWbL0WduFHUJAkCxf+1jPSfOqbHCRJB2ElXX5RHaZFu0LAy53w8T/KxP/MohM7O4urysfK3Um8lDbFjgvlC85WbUT0JUBeQ8O5qqSvRiEOs/Gu35LOS+GSb5Bl3WRLGqO9p8XqmDqxA3S7Q98msAmNuR5iB9IdLU8moEsH6gMzvkd6i0KPrPP1h/HxOxTbbd8RYRxlAULKoXoA6pNrQxuMoGgew7otOZV8SJcrS0I6yt5SaZiVnWNB5pf7RnSDV61bbpzhQfbm56dekMOVSz4ZlpdljNOtbvRRGLn2b9jirh2XNo55A+kAuf7yMVmpD/FgY5kWxUKoJqBLKTJtfeta2IkAcVsGpO8pNQ/8wYeeiBw+O8Ty3Co+KEvgZpqIB9dWYimvrc0yQfFYvH1d7qr1kAiPczKJqblNpNluoPXe5e1v1RT9aw881VfWloqh4nvwJ98Vy6aR6lAyodwyhf9MbLURctFU5Wvw8zG0Zhs73cqp3b7kbLwSqQJXjQoP66Aogfa0QMOzgmuHpcLPXKAwv4eMjRUJ/eEvU/UQ3B1fioVo7F5N9ZAQdtLnfIU90EnZEq9c6o3Cet31eILSr7Q1fg9taYGyPXtkeip1tTn8WAz8F2t31VfW9h9eVBdY0mUnqjkyEQbxf9t66jLZK3MNju5xeLpYd3L21qL7PuGVzdBt9GzcEq8KIu8XZws9z4oB3o2Rk/m3XCJd8cZosa0k6WcwnaOUKA+vA8PA5uINA6gO6ME6opqNqcEvvkmZ/RhvQTTGCqZuh63K4a9ommcYwz4DkG0LFiH/TpK+EENbDdT32zfN9N3mu52BbPECartdnQdph2xXdFVFvMRHn3WQsIwfE4/E+D/gbSVgIvXVkfQp6XcY1AfZLcT26fNske8HITWR9dP16A3QGs6Fc+KGK/picEMA7E8wBg9B46y1R42aQ5gnqGrO6DGdUrwwWBolIHtJPiJ3eLT/QR76IS3U4Z8OJ14VgIqjXmTC3ZVaeB+mNKYiN31EGJnTTxO7oa9Wk9+sT3zmPhvehXu5sNg7Mw1sHV6renUy0TUG0dUAU3gX+DeubGaBatDeqbqu6ou5mqDggk7YVGTzPqi49T9/t5QDLoy6lxXH9rNMBSnDQV7nvVlaPl6k0f6TsAYlS0HyEr8K6yqjaRweRN2KXCJXFXmvZ81JG9HhS0JcN2fiR6q+vRTnJobWXScNLR462eesc0X+MGATckuJBQNUJvl5lJ4xVkSHxOo6yFSdMC67rfxuBoExDIBRPzcQAS38uFMsE3lzoYtYwbdl0t9dAaqy2jrLZqet1UNRtakiNvmP51jXW/3Rbdpy8kuArNrTrL2GS/FsmCSWlshGUzSksBcpptZIyQm+eOP+/5Rrhielv9Q4c9VP0aZXG4uj1sJ4Om/FW41EOkji0kL+fEc1rMFy+2TshzrHCsOprWAnnPQ336EWXM2O39OM6YyYrKysuruwToyJEjR6VJtdwjcOTIkSMHsI4cOXLkANaRI0eOHDmAdeTIkSMHsI4cOXLkANaRI0eOHDmAdeTIkaN80n8FGABve6ZFJyHjRgAAAABJRU5ErkJggg=="
13,192
13,192
0.972483
348
13,192
36.862069
0.997126
0
0
0
0
0
0
0
0
0
0
0.1558
0.000152
13,192
1
13,192
13,192
0.816755
0
0
0
0
1
0.999015
0.999015
0
1
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
8
1eced58dd7f02b1aa533ace8ffcfe6d922349316
20,678
py
Python
google/cloud/recommender_v1/proto/recommender_service_pb2_grpc.py
danoscarmike/python-recommender
8538b29f6938d2967ef71845ddf43e2c286a6147
[ "Apache-2.0" ]
null
null
null
google/cloud/recommender_v1/proto/recommender_service_pb2_grpc.py
danoscarmike/python-recommender
8538b29f6938d2967ef71845ddf43e2c286a6147
[ "Apache-2.0" ]
null
null
null
google/cloud/recommender_v1/proto/recommender_service_pb2_grpc.py
danoscarmike/python-recommender
8538b29f6938d2967ef71845ddf43e2c286a6147
[ "Apache-2.0" ]
null
null
null
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.cloud.recommender_v1.proto import ( insight_pb2 as google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2, ) from google.cloud.recommender_v1.proto import ( recommendation_pb2 as google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2, ) from google.cloud.recommender_v1.proto import ( recommender_service_pb2 as google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2, ) class RecommenderStub(object): """Provides insights and recommendations for cloud customers for various categories like performance optimization, cost savings, reliability, feature discovery, etc. Insights and recommendations are generated automatically based on analysis of user resources, configuration and monitoring metrics. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.ListInsights = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/ListInsights", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListInsightsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListInsightsResponse.FromString, ) self.GetInsight = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/GetInsight", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.GetInsightRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2.Insight.FromString, ) self.MarkInsightAccepted = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/MarkInsightAccepted", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkInsightAcceptedRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2.Insight.FromString, ) self.ListRecommendations = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/ListRecommendations", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListRecommendationsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListRecommendationsResponse.FromString, ) self.GetRecommendation = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/GetRecommendation", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.GetRecommendationRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, ) self.MarkRecommendationClaimed = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/MarkRecommendationClaimed", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationClaimedRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, ) self.MarkRecommendationSucceeded = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/MarkRecommendationSucceeded", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationSucceededRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, ) self.MarkRecommendationFailed = channel.unary_unary( "/google.cloud.recommender.v1.Recommender/MarkRecommendationFailed", request_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationFailedRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, ) class RecommenderServicer(object): """Provides insights and recommendations for cloud customers for various categories like performance optimization, cost savings, reliability, feature discovery, etc. Insights and recommendations are generated automatically based on analysis of user resources, configuration and monitoring metrics. """ def ListInsights(self, request, context): """Lists insights for a Cloud project. Requires the recommender.*.list IAM permission for the specified insight type. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetInsight(self, request, context): """Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def MarkInsightAccepted(self, request, context): """Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListRecommendations(self, request, context): """Lists recommendations for a Cloud project. Requires the recommender.*.list IAM permission for the specified recommender. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetRecommendation(self, request, context): """Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def MarkRecommendationClaimed(self, request, context): """Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED, SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def MarkRecommendationSucceeded(self, request, context): """Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def MarkRecommendationFailed(self, request, context): """Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def add_RecommenderServicer_to_server(servicer, server): rpc_method_handlers = { "ListInsights": grpc.unary_unary_rpc_method_handler( servicer.ListInsights, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListInsightsRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListInsightsResponse.SerializeToString, ), "GetInsight": grpc.unary_unary_rpc_method_handler( servicer.GetInsight, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.GetInsightRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2.Insight.SerializeToString, ), "MarkInsightAccepted": grpc.unary_unary_rpc_method_handler( servicer.MarkInsightAccepted, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkInsightAcceptedRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2.Insight.SerializeToString, ), "ListRecommendations": grpc.unary_unary_rpc_method_handler( servicer.ListRecommendations, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListRecommendationsRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListRecommendationsResponse.SerializeToString, ), "GetRecommendation": grpc.unary_unary_rpc_method_handler( servicer.GetRecommendation, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.GetRecommendationRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.SerializeToString, ), "MarkRecommendationClaimed": grpc.unary_unary_rpc_method_handler( servicer.MarkRecommendationClaimed, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationClaimedRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.SerializeToString, ), "MarkRecommendationSucceeded": grpc.unary_unary_rpc_method_handler( servicer.MarkRecommendationSucceeded, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationSucceededRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.SerializeToString, ), "MarkRecommendationFailed": grpc.unary_unary_rpc_method_handler( servicer.MarkRecommendationFailed, request_deserializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationFailedRequest.FromString, response_serializer=google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( "google.cloud.recommender.v1.Recommender", rpc_method_handlers ) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class Recommender(object): """Provides insights and recommendations for cloud customers for various categories like performance optimization, cost savings, reliability, feature discovery, etc. Insights and recommendations are generated automatically based on analysis of user resources, configuration and monitoring metrics. """ @staticmethod def ListInsights( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/ListInsights", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListInsightsRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListInsightsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def GetInsight( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/GetInsight", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.GetInsightRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2.Insight.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def MarkInsightAccepted( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/MarkInsightAccepted", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkInsightAcceptedRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_insight__pb2.Insight.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def ListRecommendations( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/ListRecommendations", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListRecommendationsRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.ListRecommendationsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def GetRecommendation( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/GetRecommendation", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.GetRecommendationRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def MarkRecommendationClaimed( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/MarkRecommendationClaimed", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationClaimedRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def MarkRecommendationSucceeded( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/MarkRecommendationSucceeded", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationSucceededRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, ) @staticmethod def MarkRecommendationFailed( request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None, ): return grpc.experimental.unary_unary( request, target, "/google.cloud.recommender.v1.Recommender/MarkRecommendationFailed", google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommender__service__pb2.MarkRecommendationFailedRequest.SerializeToString, google_dot_cloud_dot_recommender__v1_dot_proto_dot_recommendation__pb2.Recommendation.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, )
44.854664
161
0.719122
2,019
20,678
6.939079
0.087667
0.081941
0.050964
0.061884
0.878087
0.873733
0.844325
0.819843
0.774518
0.770949
0
0.00781
0.225941
20,678
460
162
44.952174
0.867487
0.164426
0
0.708683
1
0
0.090514
0.06405
0
0
0
0
0
1
0.05042
false
0
0.011204
0.022409
0.092437
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
a208a8289324b3a7dae2ad7abdefa5bd4b2b51aa
41,689
py
Python
backend/api/tests/test_credit_trade_operations.py
KMenke/tfrs
8a0aca2967e0557c9935d81a199d71446b96f6a3
[ "Apache-2.0" ]
null
null
null
backend/api/tests/test_credit_trade_operations.py
KMenke/tfrs
8a0aca2967e0557c9935d81a199d71446b96f6a3
[ "Apache-2.0" ]
1
2019-06-13T21:51:58.000Z
2019-06-13T22:00:20.000Z
backend/api/tests/test_credit_trade_operations.py
pwei1018/tfrs
8648a6c8ab7fc851ffe62ab562015fdbd3d53da3
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # pylint: disable=no-member,invalid-name """ REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 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 datetime import json from rest_framework import status from api.exceptions import PositiveIntegerException from api.models.CreditTrade import CreditTrade from api.models.OrganizationBalance import OrganizationBalance from api.models.SigningAuthorityAssertion import SigningAuthorityAssertion from api.services.CreditTradeService import CreditTradeService from api.tests.base_test_case import BaseTestCase from api.tests.data_creation_utilities import DataCreationUtilities class TestCreditTradeOperations(BaseTestCase): """ This will test all credit trade related things such as: status changes and checking permissions when those status changes happen """ extra_fixtures = ['test/test_credit_trades.json'] def test_initiator_should_see_appropriate_credit_trades(self): """ As a fuel supplier, I should see all credit trades where: I'm the initiator, regardless of status I'm the respondent, if the status is "submitted" or greater """ # setup some test data DataCreationUtilities.create_possible_credit_trades( self.users['fs_user_1'].organization, self.users['fs_user_2'].organization ) response = self.clients['fs_user_1'].get('/api/credit_trades') self.assertEqual(response.status_code, status.HTTP_200_OK) fs_credit_trades = response.json() for credit_trade in fs_credit_trades: correct_view = False if credit_trade['initiator']['id'] == \ self.users['fs_user_1'].organization.id: correct_view = True elif (credit_trade['respondent']['id'] == self.users['fs_user_1'].organization.id and credit_trade['status']['id'] >= self.statuses['submitted'].id): correct_view = True self.assertTrue(correct_view) def test_government_user_should_see_appropriate_credit_trades(self): """ As a government user, I should see all credit trades where: I'm the initiator, regardless of status Government will never be the respondent All other credit trades that have the status "Accepted" or greater """ response = self.clients['gov_analyst'].get('/api/credit_trades') self.assertEqual(response.status_code, status.HTTP_200_OK) gov_credit_trades = response.json() for credit_trade in gov_credit_trades: correct_view = False if credit_trade['initiator']['id'] == \ self.users['gov_analyst'].organization.id: correct_view = True elif (credit_trade['status']['id'] >= self.statuses['accepted'].id and credit_trade['status'] != self.statuses['cancelled']): correct_view = True self.assertTrue(correct_view) def test_government_user_add_credit_transfer(self): """ As a government user, I should be able to add an recorded credit transfer """ payload = { 'fairMarketValuePerCredit': '1.00', 'initiator': 2, 'numberOfCredits': 1, 'respondent': 3, 'status': self.statuses['recorded'].id, 'tradeEffectiveDate': datetime.datetime.today().strftime( '%Y-%m-%d' ), 'type': self.credit_trade_types['sell'].id, 'zeroReason': None } response = self.clients['gov_director'].post( '/api/credit_trades', content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_201_CREATED) def test_government_user_add_recorded_zero_credit_transfer(self): """ As a government user, I should be able to add an recorded credit transfer with 0 fair market value: If the type is 'Sell', Fair Market Value needs to be greater than 0 or zero dollar reason must be provided This tests if we try to submit a 0 dollar credit transaction with no reason """ payload = { 'fairMarketValuePerCredit': '0.00', 'initiator': 2, 'numberOfCredits': 1, 'respondent': 3, 'status': self.statuses['recorded'].id, 'tradeEffectiveDate': datetime.datetime.today().strftime( '%Y-%m-%d' ), 'type': self.credit_trade_types['sell'].id, 'zeroReason': None } response = self.clients['gov_analyst'].post( '/api/credit_trades', content_type='application/json', data=json.dumps(payload)) # 400 since zero reason was set to None self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_government_user_add_recorded_valid_zero_credit_transfer(self): """ As a government user, I should be able to add an recorded credit transfer with 0 fair market value: If the type is 'Sell', Fair Market Value needs to be greater than 0 or zero dollar reason must be provided """ payload = { 'fairMarketValuePerCredit': '0.00', 'initiator': 2, 'numberOfCredits': 1, 'respondent': 3, 'status': self.statuses['recorded'].id, 'tradeEffectiveDate': datetime.datetime.today().strftime( '%Y-%m-%d' ), 'type': self.credit_trade_types['sell'].id, 'zeroReason': self.zero_reason['other'].id } response = self.clients['gov_director'].post( '/api/credit_trades', content_type='application/json', data=json.dumps(payload)) # 201 since a zero reason was provided self.assertEqual(response.status_code, status.HTTP_201_CREATED) def test_validate_credit(self): """ As a government user, I should be able to validate recorded credit transfers: It should raise an exception if it sees any fuel suppliers with insufficient funds """ CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.users['fs_user_2'].organization, respondent=self.users['fs_user_3'].organization, type=self.credit_trade_types['sell'], number_of_credits=1000000000, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) credit_trades = CreditTrade.objects.filter( status_id=self.statuses['recorded'].id) with self.assertRaises(PositiveIntegerException): CreditTradeService.validate_credits(credit_trades) def test_validate_credit_complex(self): """ As a government user, I should be able to validate recorded credit transfers: It should raise an exception if it sees any fuel suppliers with insufficient funds This is a slightly more complex test where we have multi credit trades with new organizations that bounces the number of credits up and down """ initial_balance = OrganizationBalance.objects.get( organization_id=self.organizations['from'].id, expiration_date=None).validated_credits # Transfer initial balance from Test 1 to Test 2 CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=initial_balance, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # Transfer 1 from Test 1 to Test 2 CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=1, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) credit_trades = CreditTrade.objects.filter( status_id=self.statuses['recorded'].id) # this should now raise an exception since we tried transferring # 1200 credits when only 1000 are available with self.assertRaises(PositiveIntegerException): CreditTradeService.validate_credits(credit_trades) def test_validate_credit_success(self): """ As a government user, I should be able to validate approved credit transfers: It should raise an exception if it sees any fuel suppliers with insufficient funds This test is similar to the one above, but should succeed as we're going to allocate the right amount of credits this time """ credit_trades = [] # Award Test 1 with 1000 credits (new organizations start # with 0 credits) # (Please note in most cases we should use a different type # but to reduce the number of things to keep track, lets just # transfer from organization: 1 (BC Government)) credit_trades.append( CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.users['gov_analyst'].organization, respondent=self.organizations['from'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) ) # Transfer 500 from Test 1 to Test 2 credit_trades.append( CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=500, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) ) # Transfer 300 from Test 1 to Test 2 credit_trades.append( CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=300, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) ) # no exceptions should be raised CreditTradeService.validate_credits(credit_trades) def test_batch_process(self): """ As a government user, I should be able to process all the recorded credit transfers This test is similar to the one above, but a functional test to check if the commit actually works """ initial_balance = OrganizationBalance.objects.get( organization_id=self.organizations['from'].id, expiration_date=None).validated_credits CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.users['gov_director'].organization, respondent=self.organizations['from'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=500, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=400, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) response = self.clients['gov_director'].put('/api/credit_trades/batch_process') self.assertEqual(response.status_code, status.HTTP_200_OK) organization_balance = OrganizationBalance.objects.get( organization_id=self.organizations['from'].id, expiration_date=None) self.assertEqual(organization_balance.validated_credits-initial_balance, 100) def test_delete(self): """ As a government user, I should be able to delete credit transfers (Not a hard delete, just sets the status to Cancelled) """ credit_trade = CreditTrade.objects.create( status=self.statuses['recorded'], initiator=self.users['gov_analyst'].organization, respondent=self.organizations['from'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=0, zero_reason=self.zero_reason['other'], trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) response = self.clients['gov_analyst'].put( '/api/credit_trades/{}/delete'.format(credit_trade.id) ) self.assertEqual(response.status_code, status.HTTP_200_OK) credit_trade = CreditTrade.objects.get(id=credit_trade.id) self.assertEqual(credit_trade.status_id, self.statuses['cancelled'].id) # Trying to access this page should now result in a 404 as it's now # been cancelled response = self.clients['gov_analyst'].get( '/api/credit_trades/{}'.format(credit_trade.id) ) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) def test_get_organization_credit_trades_gov(self): """ As a government user I shouldn't see drafts unless I'm the initiator I shouldn't see cancelled transfers as they're considered (deleted) """ # the function shouldn't see this as it's only a draft and the # initiator is not government draft_credit_trade = CreditTrade.objects.create( status=self.statuses['draft'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # the function should see this as it's a draft from the government draft_credit_trade_from_gov = CreditTrade.objects.create( status=self.statuses['draft'], initiator=self.users['gov_analyst'].organization, respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # the function should see this as it's approved approved_credit_trade = CreditTrade.objects.create( status=self.statuses['approved'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) credit_trades = CreditTradeService.get_organization_credit_trades( self.users['gov_analyst'].organization ) self.assertNotIn(draft_credit_trade, credit_trades) self.assertIn(draft_credit_trade_from_gov, credit_trades) self.assertIn(approved_credit_trade, credit_trades) def test_get_organization_credit_trades_fuel_supplier(self): """ As a fuel supplier I shouldn't see drafts unless I'm the initiator I shouldn't see cancelled transfers as they're considered (deleted) I shouldn't see submitted transfers unless I'm involved somehow """ # the function shouldn't see this as it's only a draft and the # initiator is not fuel_supplier # (even though the fuel supplier is the respondent) draft_credit_trade = CreditTrade.objects.create( status=self.statuses['draft'], initiator=self.organizations['to'], respondent=self.organizations['from'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # the function should see this as it's a draft from the fuel supplier draft_from_fuel_supplier = CreditTrade.objects.create( status=self.statuses['draft'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # the function shouldn't see this as it's a submitted transaction # not involving the fuel supplier submitted_credit_trade = CreditTrade.objects.create( status=self.statuses['submitted'], initiator=self.organizations['to'], respondent=self.users['fs_user_3'].organization, type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # the function should see this as it's a submitted transaction # involving the fuel supplier credit_trade_as_respondent = CreditTrade.objects.create( status=self.statuses['submitted'], initiator=self.organizations['to'], respondent=self.organizations['from'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) # the function should see this as it's approved approved_credit_trade = CreditTrade.objects.create( status=self.statuses['approved'], initiator=self.organizations['from'], respondent=self.organizations['to'], type=self.credit_trade_types['sell'], number_of_credits=1000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) credit_trades = CreditTradeService.get_organization_credit_trades( self.organizations['from'] ) self.assertNotIn(draft_credit_trade, credit_trades) self.assertIn(draft_from_fuel_supplier, credit_trades) self.assertNotIn(submitted_credit_trade, credit_trades) self.assertIn(credit_trade_as_respondent, credit_trades) self.assertIn(approved_credit_trade, credit_trades) def test_sell_with_insufficient_credits(self): """ This will test submitting a draft with insufficient credit It should return a Validation Error and tell you that your organization has insufficient credits """ payload = { 'fairMarketValuePerCredit': '1.00', 'initiator': self.users['fs_user_1'].organization_id, 'numberOfCredits': 200000, 'respondent': 3, 'status': self.statuses['draft'].id, 'tradeEffectiveDate': datetime.datetime.today().strftime( '%Y-%m-%d' ), 'type': self.credit_trade_types['sell'].id, 'zeroReason': None } response = self.clients['fs_user_1'].post( '/api/credit_trades', content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertIn('insufficientCredits', json.loads(response.content.decode('utf-8'))) def test_sell_update_with_insufficient_credits(self): """ This will test proposing a draft that doesn't have sufficient credits This is an edge case. You normally shouldn't be able to create a record with more number of credits than your organization has. But it can happen if a previous transaction gets in first and you now have less credits than it was. """ credit_trade = CreditTrade.objects.create( status=self.statuses['draft'], initiator=self.users['fs_user_1'].organization, respondent=self.users['fs_user_2'].organization, type=self.credit_trade_types['sell'], number_of_credits=200000, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime('%Y-%m-%d') ) payload = { 'initiator': credit_trade.initiator_id, 'is_rescinded': credit_trade.is_rescinded, 'fair_market_value_per_credit': credit_trade.fair_market_value_per_credit, 'number_of_credits': credit_trade.number_of_credits, 'respondent': credit_trade.respondent_id, 'status': self.statuses['submitted'].id, 'trade_effective_date': credit_trade.trade_effective_date, 'type': credit_trade.type_id } response = self.clients['fs_user_1'].put( '/api/credit_trades/{}'.format( credit_trade.id ), content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertIn('insufficientCredits', json.loads(response.content.decode('utf-8'))) def test_buy_from_org_with_insufficient_credits(self): """ This will test two things: 1. Propose a Buy from someone with insufficient credits. This should work. As the user proposing to buy from shouldn't be given any information or hint on how much the respondent has. 2. Accepting the proposal should show a validation error. """ payload = { 'fairMarketValuePerCredit': '1.00', 'initiator': self.users['fs_user_1'].organization_id, 'numberOfCredits': 200000, 'respondent': self.users['fs_user_2'].organization_id, 'status': self.statuses['submitted'].id, 'tradeEffectiveDate': datetime.datetime.today().strftime( '%Y-%m-%d' ), 'type': self.credit_trade_types['buy'].id, 'zeroReason': None } response = self.clients['fs_user_1'].post( '/api/credit_trades', content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_201_CREATED) credit_trade = json.loads(response.content.decode('utf-8')) payload = { 'initiator': credit_trade['initiator'], 'is_rescinded': credit_trade['isRescinded'], 'fair_market_value_per_credit': credit_trade['fairMarketValuePerCredit'], 'number_of_credits': credit_trade['numberOfCredits'], 'respondent': credit_trade['respondent'], 'status': self.statuses['accepted'].id, 'trade_effective_date': credit_trade['tradeEffectiveDate'], 'type': credit_trade['type'] } response = self.clients['fs_user_2'].put( '/api/credit_trades/{}'.format( credit_trade['id'] ), content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertIn('insufficientCredits', json.loads(response.content.decode('utf-8'))) def test_signing_history(self): """ This will test if the signatures and reviewed attributes for the credit trades are present depending on the status of the trade """ # Request for Fuel Supplier 1 to propose a trade payload = { 'fairMarketValuePerCredit': '1.00', 'initiator': self.users['fs_user_1'].organization_id, 'numberOfCredits': 1, 'respondent': self.users['fs_user_2'].organization_id, 'status': self.statuses['submitted'].id, 'tradeEffectiveDate': datetime.datetime.today().strftime( '%Y-%m-%d' ), 'type': self.credit_trade_types['sell'].id, 'zeroReason': None } response = self.clients['fs_user_1'].post( '/api/credit_trades', content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_201_CREATED) credit_trade = json.loads(response.content.decode('utf-8')) # Request for Fuel Supplier 1 to sign the proposal payload = [] assertions = SigningAuthorityAssertion.objects.all() for assertion in assertions: payload.append({ 'creditTrade': credit_trade['id'], 'hasAccepted': True, 'signingAuthorityAssertion': assertion.id }) response = self.clients['fs_user_1'].post( '/api/signing_authority_confirmations', content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_201_CREATED) # Check and see if the signature is present response = self.clients['fs_user_1'].get( '/api/credit_trades/{}'.format( credit_trade['id'] ), content_type='application/json') credit_trade = json.loads(response.content.decode('utf-8')) # We should see the signature from the user proposing self.assertEqual(credit_trade['signatures'][0]['user']['id'], self.users['fs_user_1'].id) # Fuel Supplier 2 accepts the proposal payload = { 'initiator': credit_trade['initiator']['id'], 'is_rescinded': credit_trade['isRescinded'], 'fair_market_value_per_credit': credit_trade['fairMarketValuePerCredit'], 'number_of_credits': credit_trade['numberOfCredits'], 'respondent': credit_trade['respondent']['id'], 'status': self.statuses['accepted'].id, 'trade_effective_date': credit_trade['tradeEffectiveDate'], 'type': credit_trade['type']['id'] } response = self.clients['fs_user_2'].put( '/api/credit_trades/{}'.format( credit_trade['id'] ), content_type='application/json', data=json.dumps(payload)) # Request for Fuel Supplier 2 to sign the proposal payload = [] assertions = SigningAuthorityAssertion.objects.all() for assertion in assertions: payload.append({ 'creditTrade': credit_trade['id'], 'hasAccepted': True, 'signingAuthorityAssertion': assertion.id }) response = self.clients['fs_user_2'].post( '/api/signing_authority_confirmations', content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_201_CREATED) # Check if the signatures are present response = self.clients['fs_user_1'].get( '/api/credit_trades/{}'.format( credit_trade['id'] ), content_type='application/json') credit_trade = json.loads(response.content.decode('utf-8')) # We should see the signature from the user proposing self.assertEqual(credit_trade['signatures'][0]['user']['id'], self.users['fs_user_1'].id) # and the user that accepted self.assertEqual(credit_trade['signatures'][1]['user']['id'], self.users['fs_user_2'].id) # Gov User recommends a decision for the proposal payload = { 'initiator': credit_trade['initiator']['id'], 'is_rescinded': credit_trade['isRescinded'], 'fair_market_value_per_credit': credit_trade['fairMarketValuePerCredit'], 'number_of_credits': credit_trade['numberOfCredits'], 'respondent': credit_trade['respondent']['id'], 'status': self.statuses['recommended'].id, 'trade_effective_date': credit_trade['tradeEffectiveDate'], 'type': credit_trade['type']['id'] } response = self.clients['gov_analyst'].put( '/api/credit_trades/{}'.format( credit_trade['id'] ), content_type='application/json', data=json.dumps(payload)) self.assertEqual(response.status_code, status.HTTP_200_OK) # Check and see if the signature is present response = self.clients['gov_analyst'].get( '/api/credit_trades/{}'.format( credit_trade['id'] ), content_type='application/json') credit_trade = json.loads(response.content.decode('utf-8')) # We should see the signature from the user proposing self.assertEqual(credit_trade['signatures'][0]['user']['id'], self.users['fs_user_1'].id) # and the user that accepted self.assertEqual(credit_trade['signatures'][1]['user']['id'], self.users['fs_user_2'].id) # first entry should be submitted self.assertEqual(credit_trade['history'][0]['status']['id'], self.statuses['submitted'].id) # second entry should be submitted self.assertEqual(credit_trade['history'][1]['status']['id'], self.statuses['accepted'].id) # third entry should be recommended self.assertEqual(credit_trade['history'][2]['status']['id'], self.statuses['recommended'].id) def test_government_cannot_see_refused_trades(self): """Verify that government users cannot see trades in status 'Refused'""" ct = CreditTrade( status=self.statuses['refused'], type=self.credit_trade_types['buy'], initiator=self.users['fs_user_1'].organization, respondent=self.users['fs_user_2'].organization, fair_market_value_per_credit=1, number_of_credits=10 ) ct.save() self.assertNotEqual(ct.id, 0) with self.subTest("Initiator can see refused trade"): response = self.clients['fs_user_1'].get('/api/credit_trades/{}'.format(ct.id)) self.assertTrue(status.is_success(response.status_code)) with self.subTest("Respondent can see refused trade"): response = self.clients['fs_user_2'].get('/api/credit_trades/{}'.format(ct.id)) self.assertTrue(status.is_success(response.status_code)) with self.subTest("Third-party cannot see refused trade"): response = self.clients['fs_user_3'].get('/api/credit_trades/{}'.format(ct.id)) self.assertFalse(status.is_success(response.status_code)) with self.subTest("Government analyst cannot see refused trade"): response = self.clients['gov_analyst'].get('/api/credit_trades/{}'.format(ct.id)) self.assertFalse(status.is_success(response.status_code)) response = self.clients['gov_analyst'].get('/api/credit_trades') self.assertTrue(status.is_success(response.status_code)) data = json.loads(response.content.decode('utf-8')) self.assertFalse(any(trade['id'] == ct.id for trade in data)) with self.subTest("Government director cannot see refused trade"): response = self.clients['gov_director'].get('/api/credit_trades/{}'.format(ct.id)) self.assertFalse(status.is_success(response.status_code)) response = self.clients['gov_director'].get('/api/credit_trades') self.assertTrue(status.is_success(response.status_code)) data = json.loads(response.content.decode('utf-8')) self.assertFalse(any(trade['id'] == ct.id for trade in data)) def test_fuel_supplier_should_see_reviewed_transfers_as_accepted(self): """ As a fuel supplier, I should see recommended and not recommended as accepted """ # setup some test data recommended_credit_trade = CreditTrade.objects.create( status=self.statuses['recommended'], initiator=self.users['fs_user_1'].organization, respondent=self.users['fs_user_2'].organization, type=self.credit_trade_types['sell'], number_of_credits=1, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) response = self.clients['fs_user_1'].get('/api/credit_trades') self.assertEqual(response.status_code, status.HTTP_200_OK) credit_trades = response.json() correct_view = True for credit_trade in credit_trades: if credit_trade['id'] == \ recommended_credit_trade.id: if credit_trade['status']['id'] == \ self.statuses['recommended'].id: correct_view = False self.assertTrue(correct_view) response = self.clients['fs_user_1'].get( '/api/credit_trades/{}'.format(recommended_credit_trade.id) ) credit_trade = json.loads(response.content.decode('utf-8')) self.assertEqual( credit_trade['status']['id'], self.statuses['accepted'].id ) def test_gov_user_should_see_reviewed_transfers_properly(self): """ As a government user, I should see recommended and not recommended properly (and not as accepted like a fuel supplier) """ # setup some test data recommended_credit_trade = CreditTrade.objects.create( status=self.statuses['recommended'], initiator=self.users['fs_user_1'].organization, respondent=self.users['fs_user_2'].organization, type=self.credit_trade_types['sell'], number_of_credits=1, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) response = self.clients['gov_analyst'].get('/api/credit_trades') self.assertEqual(response.status_code, status.HTTP_200_OK) credit_trades = response.json() correct_view = True for credit_trade in credit_trades: if credit_trade['id'] == \ recommended_credit_trade.id: if credit_trade['status']['id'] == \ self.statuses['accepted'].id: correct_view = False self.assertTrue(correct_view) response = self.clients['gov_analyst'].get( '/api/credit_trades/{}'.format(recommended_credit_trade.id) ) credit_trade = json.loads(response.content.decode('utf-8')) self.assertEqual( credit_trade['status']['id'], self.statuses['recommended'].id ) def test_fuel_supplier_shouldnt_see_recommended_pvr(self): """ As a fuel supplier, I shouldnt see recommended PVRs """ # setup some test data recommended_credit_trade = CreditTrade.objects.create( status=self.statuses['recommended'], initiator=self.users['gov_analyst'].organization, respondent=self.users['fs_user_1'].organization, type=self.credit_trade_types['part3award'], number_of_credits=1, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) response = self.clients['fs_user_1'].get('/api/credit_trades') self.assertEqual(response.status_code, status.HTTP_200_OK) credit_trades = response.json() correct_view = True for credit_trade in credit_trades: if credit_trade['id'] == \ recommended_credit_trade.id: correct_view = False self.assertTrue(correct_view) response = self.clients['fs_user_1'].get( '/api/credit_trades/{}'.format(recommended_credit_trade.id) ) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) def test_gov_user_should_see_recommended_pvr(self): """ As a government user, I should see recommended PVRs without problems """ # setup some test data recommended_credit_trade = CreditTrade.objects.create( status=self.statuses['recommended'], initiator=self.users['gov_analyst'].organization, respondent=self.users['fs_user_1'].organization, type=self.credit_trade_types['part3award'], number_of_credits=1, fair_market_value_per_credit=1, zero_reason=None, trade_effective_date=datetime.datetime.today().strftime( '%Y-%m-%d' ) ) response = self.clients['gov_analyst'].get('/api/credit_trades') self.assertEqual(response.status_code, status.HTTP_200_OK) credit_trades = response.json() correct_view = False for credit_trade in credit_trades: if credit_trade['id'] == \ recommended_credit_trade.id: correct_view = True self.assertTrue(correct_view) response = self.clients['gov_analyst'].get( '/api/credit_trades/{}'.format(recommended_credit_trade.id) ) self.assertEqual(response.status_code, status.HTTP_200_OK)
39.403592
94
0.608458
4,580
41,689
5.334935
0.088865
0.061226
0.027216
0.023328
0.818409
0.805967
0.781575
0.771057
0.742081
0.721904
0
0.011368
0.288901
41,689
1,057
95
39.44087
0.812852
0.159515
0
0.735823
0
0
0.133802
0.026302
0
0
0
0
0.096819
1
0.029046
false
0
0.013831
0
0.045643
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
a216f8df1f0d7ff66f388c938290a271fd629a9f
72
py
Python
example_doc/__init__.py
ianozsvald/ipython_example_doc
2d9486ae4986796150bde3366454bf7ba4fc9ebf
[ "MIT" ]
null
null
null
example_doc/__init__.py
ianozsvald/ipython_example_doc
2d9486ae4986796150bde3366454bf7ba4fc9ebf
[ "MIT" ]
null
null
null
example_doc/__init__.py
ianozsvald/ipython_example_doc
2d9486ae4986796150bde3366454bf7ba4fc9ebf
[ "MIT" ]
null
null
null
"""from example_doc import eg""" from example_doc.example_doc import eg
24
38
0.791667
12
72
4.5
0.416667
0.555556
0.518519
0.666667
0
0
0
0
0
0
0
0
0.111111
72
2
39
36
0.84375
0.361111
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
7801b31d01b2c9fc8eddc3485abf5aa0523d5562
10,520
py
Python
tests/components/plugwise/test_config_flow.py
pcaston/core
e74d946cef7a9d4e232ae9e0ba150d18018cfe33
[ "Apache-2.0" ]
1
2021-07-08T20:09:55.000Z
2021-07-08T20:09:55.000Z
tests/components/plugwise/test_config_flow.py
pcaston/core
e74d946cef7a9d4e232ae9e0ba150d18018cfe33
[ "Apache-2.0" ]
47
2021-02-21T23:43:07.000Z
2022-03-31T06:07:10.000Z
tests/components/plugwise/test_config_flow.py
OpenPeerPower/core
f673dfac9f2d0c48fa30af37b0a99df9dd6640ee
[ "Apache-2.0" ]
null
null
null
"""Test the Plugwise config flow.""" from unittest.mock import MagicMock, patch from plugwise.exceptions import ( ConnectionFailedError, InvalidAuthentication, PlugwiseException, ) import pytest from openpeerpower import config_entries, data_entry_flow, setup from openpeerpower.components.plugwise.const import ( DEFAULT_PORT, DEFAULT_SCAN_INTERVAL, DOMAIN, ) from openpeerpower.config_entries import SOURCE_USER, SOURCE_ZEROCONF from openpeerpower.const import ( CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_SCAN_INTERVAL, CONF_USERNAME, ) from tests.common import MockConfigEntry TEST_HOST = "1.1.1.1" TEST_HOSTNAME = "smileabcdef" TEST_PASSWORD = "test_password" TEST_PORT = 81 TEST_USERNAME = "smile" TEST_USERNAME2 = "stretch" TEST_DISCOVERY = { "host": TEST_HOST, "port": DEFAULT_PORT, "hostname": f"{TEST_HOSTNAME}.local.", "server": f"{TEST_HOSTNAME}.local.", "properties": { "product": "smile", "version": "1.2.3", "hostname": f"{TEST_HOSTNAME}.local.", }, } @pytest.fixture(name="mock_smile") def mock_smile(): """Create a Mock Smile for testing exceptions.""" with patch( "openpeerpower.components.plugwise.config_flow.Smile", ) as smile_mock: smile_mock.PlugwiseError = PlugwiseException smile_mock.InvalidAuthentication = InvalidAuthentication smile_mock.ConnectionFailedError = ConnectionFailedError smile_mock.return_value.connect.return_value = True yield smile_mock.return_value async def test_form(opp): """Test we get the form.""" await setup.async_setup_component(opp, "persistent_notification", {}) result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["errors"] == {} with patch( "openpeerpower.components.plugwise.config_flow.Smile.connect", return_value=True, ), patch( "openpeerpower.components.plugwise.async_setup_entry", return_value=True, ) as mock_setup_entry: result2 = await opp.config_entries.flow.async_configure( result["flow_id"], {CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD}, ) await opp.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["data"] == { CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD, CONF_PORT: DEFAULT_PORT, CONF_USERNAME: TEST_USERNAME, } assert len(mock_setup_entry.mock_calls) == 1 async def test_zeroconf_form(opp): """Test we get the form.""" await setup.async_setup_component(opp, "persistent_notification", {}) result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_ZEROCONF}, data=TEST_DISCOVERY, ) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["errors"] == {} with patch( "openpeerpower.components.plugwise.config_flow.Smile.connect", return_value=True, ), patch( "openpeerpower.components.plugwise.async_setup_entry", return_value=True, ) as mock_setup_entry: result2 = await opp.config_entries.flow.async_configure( result["flow_id"], {CONF_PASSWORD: TEST_PASSWORD}, ) await opp.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["data"] == { CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD, CONF_PORT: DEFAULT_PORT, CONF_USERNAME: TEST_USERNAME, } assert len(mock_setup_entry.mock_calls) == 1 async def test_form_username(opp): """Test we get the username data back.""" result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} ) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["errors"] == {} with patch( "openpeerpower.components.plugwise.config_flow.Smile.connect", return_value=True, ), patch( "openpeerpower.components.plugwise.async_setup_entry", return_value=True, ) as mock_setup_entry: result2 = await opp.config_entries.flow.async_configure( result["flow_id"], { CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD, CONF_USERNAME: TEST_USERNAME2, }, ) await opp.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["data"] == { CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD, CONF_PORT: DEFAULT_PORT, CONF_USERNAME: TEST_USERNAME2, } assert len(mock_setup_entry.mock_calls) == 1 result3 = await opp.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_ZEROCONF}, data=TEST_DISCOVERY, ) assert result3["type"] == data_entry_flow.RESULT_TYPE_FORM assert result3["errors"] == {} with patch( "openpeerpower.components.plugwise.config_flow.Smile.connect", return_value=True, ), patch( "openpeerpower.components.plugwise.async_setup_entry", return_value=True, ) as mock_setup_entry: result4 = await opp.config_entries.flow.async_configure( result3["flow_id"], {CONF_PASSWORD: TEST_PASSWORD}, ) await opp.async_block_till_done() assert result4["type"] == "abort" assert result4["reason"] == "already_configured" async def test_form_invalid_auth(opp, mock_smile): """Test we handle invalid auth.""" result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) mock_smile.connect.side_effect = InvalidAuthentication mock_smile.gateway_id = "0a636a4fc1704ab4a24e4f7e37fb187a" result2 = await opp.config_entries.flow.async_configure( result["flow_id"], {CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD}, ) assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM assert result2["errors"] == {"base": "invalid_auth"} async def test_form_cannot_connect(opp, mock_smile): """Test we handle cannot connect error.""" result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) mock_smile.connect.side_effect = ConnectionFailedError mock_smile.gateway_id = "0a636a4fc1704ab4a24e4f7e37fb187a" result2 = await opp.config_entries.flow.async_configure( result["flow_id"], {CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD}, ) assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM assert result2["errors"] == {"base": "cannot_connect"} async def test_form_cannot_connect_port(opp, mock_smile): """Test we handle cannot connect to port error.""" result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) mock_smile.connect.side_effect = ConnectionFailedError mock_smile.gateway_id = "0a636a4fc1704ab4a24e4f7e37fb187a" result2 = await opp.config_entries.flow.async_configure( result["flow_id"], {CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD, CONF_PORT: TEST_PORT}, ) assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM assert result2["errors"] == {"base": "cannot_connect"} async def test_form_other_problem(opp, mock_smile): """Test we handle cannot connect error.""" result = await opp.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) mock_smile.connect.side_effect = TimeoutError mock_smile.gateway_id = "0a636a4fc1704ab4a24e4f7e37fb187a" result2 = await opp.config_entries.flow.async_configure( result["flow_id"], {CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD}, ) assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM assert result2["errors"] == {"base": "unknown"} async def test_options_flow_power(opp, mock_smile) -> None: """Test config flow options DSMR environments.""" entry = MockConfigEntry( domain=DOMAIN, title=CONF_NAME, data={CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD}, options={CONF_SCAN_INTERVAL: DEFAULT_SCAN_INTERVAL}, ) opp.data[DOMAIN] = {entry.entry_id: {"api": MagicMock(smile_type="power")}} entry.add_to_opp(opp) with patch( "openpeerpower.components.plugwise.async_setup_entry", return_value=True ): assert await opp.config_entries.async_setup(entry.entry_id) await opp.async_block_till_done() result = await opp.config_entries.options.async_init(entry.entry_id) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["step_id"] == "init" result = await opp.config_entries.options.async_configure( result["flow_id"], user_input={CONF_SCAN_INTERVAL: 10} ) assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["data"] == { CONF_SCAN_INTERVAL: 10, } async def test_options_flow_thermo(opp, mock_smile) -> None: """Test config flow options for thermostatic environments.""" entry = MockConfigEntry( domain=DOMAIN, title=CONF_NAME, data={CONF_HOST: TEST_HOST, CONF_PASSWORD: TEST_PASSWORD}, options={CONF_SCAN_INTERVAL: DEFAULT_SCAN_INTERVAL}, ) opp.data[DOMAIN] = {entry.entry_id: {"api": MagicMock(smile_type="thermostat")}} entry.add_to_opp(opp) with patch( "openpeerpower.components.plugwise.async_setup_entry", return_value=True ): assert await opp.config_entries.async_setup(entry.entry_id) await opp.async_block_till_done() result = await opp.config_entries.options.async_init(entry.entry_id) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["step_id"] == "init" result = await opp.config_entries.options.async_configure( result["flow_id"], user_input={CONF_SCAN_INTERVAL: 60} ) assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["data"] == { CONF_SCAN_INTERVAL: 60, }
31.975684
84
0.682129
1,239
10,520
5.477805
0.104116
0.053632
0.045381
0.068071
0.8061
0.78945
0.779726
0.77398
0.739207
0.739207
0
0.015301
0.211027
10,520
328
85
32.073171
0.80241
0.007034
0
0.604743
0
0
0.132677
0.082787
0
0
0
0
0.146245
1
0.003953
false
0.059289
0.031621
0
0.035573
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
78594f597bb6d72ee7c109be90db9d8c5ddce9a7
9,758
py
Python
migrations/versions/2b8459f1e2d6_initial_schema.py
vault-the/changes
37e23c3141b75e4785cf398d015e3dbca41bdd56
[ "Apache-2.0" ]
443
2015-01-03T16:28:39.000Z
2021-04-26T16:39:46.000Z
migrations/versions/2b8459f1e2d6_initial_schema.py
vault-the/changes
37e23c3141b75e4785cf398d015e3dbca41bdd56
[ "Apache-2.0" ]
12
2015-07-30T19:07:16.000Z
2016-11-07T23:11:21.000Z
migrations/versions/2b8459f1e2d6_initial_schema.py
vault-the/changes
37e23c3141b75e4785cf398d015e3dbca41bdd56
[ "Apache-2.0" ]
47
2015-01-09T10:04:00.000Z
2020-11-18T17:58:19.000Z
"""Initial schema Revision ID: 2b8459f1e2d6 Revises: None Create Date: 2013-10-22 14:31:32.654367 """ # revision identifiers, used by Alembic. revision = '2b8459f1e2d6' down_revision = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('repository', sa.Column('id', sa.GUID(), nullable=False), sa.Column('url', sa.String(length=200), nullable=False), sa.Column('date_created', sa.DateTime(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('url') ) op.create_table('node', sa.Column('id', sa.GUID(), nullable=False), sa.Column('label', sa.String(length=128), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_table('author', sa.Column('id', sa.GUID(), nullable=False), sa.Column('name', sa.String(length=128), nullable=False), sa.Column('email', sa.String(length=128), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('email'), sa.UniqueConstraint('name') ) op.create_table('remoteentity', sa.Column('id', sa.GUID(), nullable=False), sa.Column('type', sa.String(), nullable=False), sa.Column('provider', sa.String(length=128), nullable=False), sa.Column('remote_id', sa.String(length=128), nullable=False), sa.Column('internal_id', sa.GUID(), nullable=False), sa.Column('data', sa.JSONEncodedDict(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('provider','remote_id','type', name='remote_identifier') ) op.create_table('project', sa.Column('id', sa.GUID(), nullable=False), sa.Column('slug', sa.String(length=64), nullable=False), sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('name', sa.String(length=64), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.Column('avg_build_time', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('slug') ) op.create_table('revision', sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('sha', sa.String(length=40), nullable=False), sa.Column('author_id', sa.GUID(), nullable=True), sa.Column('message', sa.Text(), nullable=True), sa.Column('parents', postgresql.ARRAY(sa.String(length=40)), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['author_id'], ['author.id'], ), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('repository_id', 'sha') ) op.create_table('change', sa.Column('id', sa.GUID(), nullable=False), sa.Column('hash', sa.String(length=40), nullable=False), sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('project_id', sa.GUID(), nullable=False), sa.Column('author_id', sa.GUID(), nullable=True), sa.Column('label', sa.String(length=128), nullable=False), sa.Column('message', sa.Text(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.Column('date_modified', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['author_id'], ['author.id'], ), sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('hash') ) op.create_table('patch', sa.Column('id', sa.GUID(), nullable=False), sa.Column('change_id', sa.GUID(), nullable=True), sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('project_id', sa.GUID(), nullable=False), sa.Column('parent_revision_sha', sa.String(length=40), nullable=False), sa.Column('label', sa.String(length=64), nullable=False), sa.Column('url', sa.String(length=200), nullable=True), sa.Column('diff', sa.Text(), nullable=True), sa.Column('message', sa.Text(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['change_id'], ['change.id'], ), sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('build', sa.Column('id', sa.GUID(), nullable=False), sa.Column('change_id', sa.GUID(), nullable=True), sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('project_id', sa.GUID(), nullable=False), sa.Column('parent_revision_sha', sa.String(length=40), nullable=True), sa.Column('patch_id', sa.GUID(), nullable=True), sa.Column('author_id', sa.GUID(), nullable=True), sa.Column('label', sa.String(length=128), nullable=False), sa.Column('status', sa.Enum(), nullable=False), sa.Column('result', sa.Enum(), nullable=False), sa.Column('message', sa.Text(), nullable=True), sa.Column('duration', sa.Integer(), nullable=True), sa.Column('date_started', sa.DateTime(), nullable=True), sa.Column('date_finished', sa.DateTime(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.Column('date_modified', sa.DateTime(), nullable=True), sa.Column('data', sa.JSONEncodedDict(), nullable=True), sa.ForeignKeyConstraint(['author_id'], ['author.id'], ), sa.ForeignKeyConstraint(['change_id'], ['change.id'], ), sa.ForeignKeyConstraint(['patch_id'], ['patch.id'], ), sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('filecoverage', sa.Column('id', sa.GUID(), nullable=False), sa.Column('build_id', sa.GUID(), nullable=False), sa.Column('filename', sa.String(length=256), nullable=False), sa.Column('project_id', sa.Integer(), nullable=False), sa.Column('data', sa.Text(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['build_id'], ['build.id'], ), sa.PrimaryKeyConstraint('id', 'filename') ) op.create_table('test', sa.Column('id', sa.GUID(), nullable=False), sa.Column('build_id', sa.GUID(), nullable=False), sa.Column('project_id', sa.GUID(), nullable=False), sa.Column('group_sha', sa.String(length=40), nullable=False), sa.Column('label_sha', sa.String(length=40), nullable=False), sa.Column('group', sa.Text(), nullable=False), sa.Column('name', sa.Text(), nullable=False), sa.Column('package', sa.Text(), nullable=True), sa.Column('result', sa.Enum(), nullable=True), sa.Column('duration', sa.Integer(), nullable=True), sa.Column('message', sa.Text(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['build_id'], ['build.id'], ), sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('build_id','group_sha','label_sha', name='_test_key') ) op.create_table('phase', sa.Column('id', sa.GUID(), nullable=False), sa.Column('build_id', sa.GUID(), nullable=False), sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('project_id', sa.GUID(), nullable=False), sa.Column('label', sa.String(length=128), nullable=False), sa.Column('status', sa.Enum(), nullable=False), sa.Column('result', sa.Enum(), nullable=False), sa.Column('date_started', sa.DateTime(), nullable=True), sa.Column('date_finished', sa.DateTime(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['build_id'], ['build.id'], ), sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('step', sa.Column('id', sa.GUID(), nullable=False), sa.Column('build_id', sa.GUID(), nullable=False), sa.Column('phase_id', sa.GUID(), nullable=False), sa.Column('repository_id', sa.GUID(), nullable=False), sa.Column('project_id', sa.GUID(), nullable=False), sa.Column('label', sa.String(length=128), nullable=False), sa.Column('status', sa.Enum(), nullable=False), sa.Column('result', sa.Enum(), nullable=False), sa.Column('node_id', sa.GUID(), nullable=True), sa.Column('date_started', sa.DateTime(), nullable=True), sa.Column('date_finished', sa.DateTime(), nullable=True), sa.Column('date_created', sa.DateTime(), nullable=True), sa.ForeignKeyConstraint(['build_id'], ['build.id'], ), sa.ForeignKeyConstraint(['node_id'], ['node.id'], ), sa.ForeignKeyConstraint(['phase_id'], ['phase.id'], ), sa.ForeignKeyConstraint(['project_id'], ['project.id'], ), sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], ), sa.PrimaryKeyConstraint('id') ) ### end Alembic commands ### def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.drop_table('step') op.drop_table('phase') op.drop_table('test') op.drop_table('filecoverage') op.drop_table('build') op.drop_table('patch') op.drop_table('change') op.drop_table('revision') op.drop_table('project') op.drop_table('remoteentity') op.drop_table('author') op.drop_table('node') op.drop_table('repository') ### end Alembic commands ###
45.598131
80
0.662431
1,232
9,758
5.151786
0.083604
0.132346
0.134709
0.188593
0.826847
0.82086
0.7925
0.779738
0.721128
0.682055
0
0.01088
0.133429
9,758
213
81
45.812207
0.739711
0.029104
0
0.545918
0
0
0.177418
0
0
0
0
0
0
1
0.010204
false
0
0.015306
0
0.02551
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
157dcb4915003757a02f8c6d2ddb363904d488fd
21,766
py
Python
scripts/_old/loc_data_types.py
ver228/cell_localization
9739afc7a54f730056945c0a6380896747235099
[ "MIT" ]
1
2021-08-10T08:24:23.000Z
2021-08-10T08:24:23.000Z
scripts/_old/loc_data_types.py
ver228/cell_localization
9739afc7a54f730056945c0a6380896747235099
[ "MIT" ]
null
null
null
scripts/_old/loc_data_types.py
ver228/cell_localization
9739afc7a54f730056945c0a6380896747235099
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 17 17:05:49 2018œ @author: avelinojaver """ from pathlib import Path data_types_dflts = { 'woundhealing-v2-nuclei': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v2/nuclei', log_prefix = 'woundhealing-v2', flow_args = dict( prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-v2-mix': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v2/mix', log_prefix = 'woundhealing-v2', flow_args = dict( prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-v2-mix+nuclei': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v2/mix+nuclei', log_prefix = 'woundhealing-v2', flow_args = dict( prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadam': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 1.5, int_aug_offset = (-0.15, 0.15), int_aug_expansion = (0.85, 1.2) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadamv2': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.25, loc_gauss_sigma = 1.5, zoom_range = (0.97, 1.03), ignore_borders = True, min_radius = 2., int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.7, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadamI': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.25, loc_gauss_sigma = -1, zoom_range = (0.97, 1.03), ignore_borders = True, min_radius = 2., int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.7, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadamv3': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.25, loc_gauss_sigma = 1.5, zoom_range = (0.97, 1.03), ignore_borders = False, min_radius = 2., int_aug_offset = (-0.01, 0.01), int_aug_expansion = (0.95, 1.05) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadam-stacked': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), stack_shape = (4,4), prob_unseeded_patch = 0.25, loc_gauss_sigma = -1, zoom_range = (0.97, 1.03), ignore_borders = False, min_radius = 2., int_aug_offset = (-0.01, 0.01), int_aug_expansion = (0.95, 1.05) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadam-stacked3': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), stack_shape = (3,3), prob_unseeded_patch = 0.25, loc_gauss_sigma = -1, zoom_range = (0.97, 1.03), ignore_borders = False, min_radius = 2., int_aug_offset = (-0.01, 0.01), int_aug_expansion = (0.95, 1.05) ), n_ch_in = 1, n_ch_out = 1 ), 'eggsadamrefined': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs_adam_refined', log_prefix = 'eggs', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.25, loc_gauss_sigma = 1.5, zoom_range = (0.97, 1.03) ), n_ch_in = 1, n_ch_out = 1 ), 'bladder-tiles-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/20x', log_prefix = 'bladder/20x', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-40x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/40x', log_prefix = 'bladder/40x', flow_args = dict( scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi96-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/20x', log_prefix = 'bladder/20x', flow_args = dict( roi_size = 96, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi64-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/20x', log_prefix = 'bladder/20x', flow_args = dict( roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi48-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/20x', log_prefix = 'bladder/20x', flow_args = dict( roi_size = 48, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi32-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/20x', log_prefix = 'bladder/20x', flow_args = dict( roi_size = 32, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi128-40x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/40x', log_prefix = 'bladder/40x', flow_args = dict( roi_size = 128, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi64-40x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/40x', log_prefix = 'bladder/40x', flow_args = dict( roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-roi48-40x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/40x', log_prefix = 'bladder/40x', flow_args = dict( roi_size = 48, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 2.5 ), n_ch_in = 3, n_ch_out = 2 ), 'bladder-tiles-no-border-40x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/40x', log_prefix = 'bladder', flow_args = dict( roi_size = 96, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 5 ), n_ch_in = 3, n_ch_out = 2 ) , 'bladder-tiles-no-border-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/full_tiles/20x', log_prefix = 'bladder', flow_args = dict( roi_size = 96, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 5 ), n_ch_in = 3, n_ch_out = 2 ) } data_types_old = { 'woundhealing-no-membrane-roi48': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v1/no_membrane', log_prefix = 'woundhealing', flow_args = dict( roi_size = 48, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-no-membrane-roi96': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v1/no_membrane', log_prefix = 'woundhealing', flow_args = dict( roi_size = 96, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-only-membrane-roi48': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v1/only_membrane', log_prefix = 'woundhealing', flow_args = dict( roi_size = 48, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-only-membrane-roi96': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v1/only_membrane', log_prefix = 'woundhealing', flow_args = dict( roi_size = 96, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-all': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v1/all', log_prefix = 'woundhealing', flow_args = dict( prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-all-roi48': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/annotated/v1/all', log_prefix = 'woundhealing', flow_args = dict( roi_size = 48, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'woundhealing-demixed-roi48': dict( root_data_dir = Path.home() / 'workspace/localization/data/woundhealing/demixed_predictions', log_prefix = 'woundhealing', flow_args = dict( roi_size = 48, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.25, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 96, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2 ), n_ch_in = 1, n_ch_out = 1 ), 'heba-int': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba-tv0': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data-v0', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2 ), n_ch_in = 1, n_ch_out = 1 ), 'heba-tuncorrected': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data-uncorrected', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2 ), n_ch_in = 1, n_ch_out = 1 ), 'heba-v0-int': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba-v0': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2 ), n_ch_in = 1, n_ch_out = 1 ), 'heba-v0-int-patchnorm': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, loc_gauss_sigma = 2, patchnorm = True, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba-v0-patchnorm': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, loc_gauss_sigma = 2, patchnorm = True ), n_ch_in = 1, n_ch_out = 1 ), 'heba-uncorrected': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2 ), n_ch_in = 1, n_ch_out = 1 ), 'heba-uncorrected-int': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 64, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba-uncorrected-int-roi32': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 32, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba-uncorrected-int-roi96': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 32, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'heba-uncorrected-int-roi128': dict( root_data_dir = Path.home() / 'workspace/localization/data/heba/data', flow_args = dict( roi_size = 128, prob_unseeded_patch = 0.2, scale_int = (0, 4095), loc_gauss_sigma = 2, int_aug_offset = (-0.2, 0.2), int_aug_expansion = (0.5, 1.3) ), n_ch_in = 1, n_ch_out = 1 ), 'eggs': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs', flow_args = dict( roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 1.5 ), n_ch_in = 1, n_ch_out = 1 ), 'eggs-int': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs', flow_args = dict( roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 1.5, int_aug_offset = (-0.15, 0.15), int_aug_expansion = (0.85, 1.2) ), n_ch_in = 1, n_ch_out = 1 ), 'eggs-only': dict( root_data_dir = Path.home() / 'workspace/localization/data/worm_eggs', flow_args = dict( roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.0, loc_gauss_sigma = 1.5, int_aug_offset = (-0.15, 0.15), int_aug_expansion = (0.85, 1.2) ), n_ch_in = 1, n_ch_out = 1 ), 'eggs-int-old': dict( root_data_dir = Path.home() / 'workspace/localization/data/old_worm_eggs', flow_args = dict( roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.5, loc_gauss_sigma = 1.5, int_aug_offset = (-0.15, 0.15), int_aug_expansion = (0.85, 1.2) ), n_ch_in = 1, n_ch_out = 1 ), 'bladder-20x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/rois/20x', log_prefix = 'bladder', roi_size = 64, scale_int = (0, 255), prob_unseeded_patch = 0.0, loc_gauss_sigma = 2.5, n_ch_in = 3, n_ch_out = 2 ), 'bladder-40x': dict( root_data_dir = Path.home() / 'workspace/localization/data/histology_bladder/bladder_cancer_tils/rois/40x', log_prefix = 'bladder', roi_size = 128, scale_int = (0, 255), prob_unseeded_patch = 0.0, loc_gauss_sigma = 5, n_ch_in = 3, n_ch_out = 2 ), }
33.028832
121
0.479555
2,568
21,766
3.74338
0.049065
0.029335
0.058671
0.073338
0.966504
0.963175
0.962655
0.962655
0.962655
0.953604
0
0.07385
0.408986
21,766
659
122
33.028832
0.67343
0.004732
0
0.880992
0
0
0.172431
0.144678
0
0
0
0
0
1
0
false
0
0.001653
0
0.001653
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
15936366047e020343c395d3969773940a24f1d6
19,335
py
Python
opie/tests/test_hostmanager.py
indigo-dc/opie
104d3fd7c26877380a618c0e313990bed5e88d56
[ "Apache-2.0" ]
10
2016-06-08T07:51:03.000Z
2021-06-01T20:35:59.000Z
opie/tests/test_hostmanager.py
indigo-dc/opie
104d3fd7c26877380a618c0e313990bed5e88d56
[ "Apache-2.0" ]
3
2016-05-27T12:58:21.000Z
2016-10-18T08:31:28.000Z
opie/tests/test_hostmanager.py
indigo-dc/opie
104d3fd7c26877380a618c0e313990bed5e88d56
[ "Apache-2.0" ]
null
null
null
# Copyright 2016 Spanish National Research Council - CSIC # # 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 opie.scheduler import host_manager import mock from nova.compute import task_states from nova.compute import vm_states import nova.objects from nova.objects import base as obj_base from nova.scheduler import host_manager as nova_host_manager from nova import test as nova_test from nova.tests import fixtures from nova.tests.unit import fake_instance from nova.tests.unit import matchers from nova.tests.unit.scheduler import fakes from nova.tests.unit.scheduler import test_host_manager \ as nova_test_host_manager from nova.tests import uuidsentinel as uuids class OpieHostManagerTestCase(nova_test_host_manager.HostManagerTestCase): """Test case for opie HostManager class.""" @mock.patch.object(host_manager.HostManager, '_init_instance_info') @mock.patch.object(host_manager.HostManager, '_init_aggregates') def setUp(self, mock_init_agg, mock_init_inst): super(OpieHostManagerTestCase, self).setUp() self.host_manager = host_manager.HostManager() self.fake_hosts = [nova_host_manager.HostState('fake_host%s' % x, 'fake-node') for x in range(1, 5)] self.fake_hosts += [nova_host_manager.HostState('fake_multihost', 'fake-node%s' % x) for x in range(1, 5)] self.useFixture(fixtures.SpawnIsSynchronousFixture()) @mock.patch('opie.scheduler.host_manager.LOG') @mock.patch('nova.objects.ServiceList.get_by_binary') @mock.patch('nova.objects.ComputeNodeList.get_all') @mock.patch.object(nova.objects.InstanceList, 'get_by_host') def test_get_all_host_partial_states(self, mock_get_by_host, mock_get_all, mock_get_by_binary, mock_log): mock_get_by_host.return_value = nova.objects.InstanceList() mock_get_all.return_value = fakes.COMPUTE_NODES mock_get_by_binary.return_value = fakes.SERVICES context = 'fake_context' self.host_manager.get_all_host_partial_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 4) calls = [ mock.call( "No compute service record found for host %(host)s", {'host': 'fake'} ) ] self.assertEqual(calls, mock_log.warning.call_args_list) # Check that .service is set properly for i in range(4): compute_node = fakes.COMPUTE_NODES[i] host = compute_node.host node = compute_node.hypervisor_hostname state_key = (host, node) self.assertEqual(host_states_map[state_key].service, obj_base.obj_to_primitive(fakes.get_service_by_host(host))) self.assertEqual(host_states_map[('host1', 'node1')].free_ram_mb, 512) # 511GB self.assertEqual(host_states_map[('host1', 'node1')].free_disk_mb, 524288) self.assertEqual(host_states_map[('host2', 'node2')].free_ram_mb, 1024) # 1023GB self.assertEqual(host_states_map[('host2', 'node2')].free_disk_mb, 1048576) self.assertEqual(host_states_map[('host3', 'node3')].free_ram_mb, 3072) # 3071GB self.assertEqual(host_states_map[('host3', 'node3')].free_disk_mb, 3145728) self.assertThat( nova.objects.NUMATopology.obj_from_db_obj( host_states_map[('host3', 'node3')].numa_topology )._to_dict(), matchers.DictMatches(fakes.NUMA_TOPOLOGY._to_dict())) self.assertEqual(host_states_map[('host4', 'node4')].free_ram_mb, 8192) # 8191GB self.assertEqual(host_states_map[('host4', 'node4')].free_disk_mb, 8388608) @mock.patch('opie.scheduler.host_manager.LOG') @mock.patch('nova.objects.ServiceList.get_by_binary') @mock.patch('nova.objects.ComputeNodeList.get_all') @mock.patch('nova.objects.InstanceList.get_by_host') def test_get_all_host_states(self, mock_get_by_host, mock_get_all, mock_get_by_binary, mock_log): mock_get_by_host.return_value = nova.objects.InstanceList() mock_get_all.return_value = fakes.COMPUTE_NODES mock_get_by_binary.return_value = fakes.SERVICES context = 'fake_context' self.host_manager.get_all_host_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 4) calls = [ # mock.call( # "Host %(hostname)s has more disk space than database " # "expected (%(physical)s GB > %(database)s GB)", # {'physical': 3333, 'database': 3072, 'hostname': 'node3'} # ), mock.call( "No compute service record found for host %(host)s", {'host': 'fake'} ) ] self.assertEqual(calls, mock_log.warning.call_args_list) # Check that .service is set properly for i in range(4): compute_node = fakes.COMPUTE_NODES[i] host = compute_node.host node = compute_node.hypervisor_hostname state_key = (host, node) self.assertEqual(host_states_map[state_key].service, obj_base.obj_to_primitive(fakes.get_service_by_host(host))) self.assertEqual(host_states_map[('host1', 'node1')].free_ram_mb, 512) # 511GB self.assertEqual(host_states_map[('host1', 'node1')].free_disk_mb, 524288) self.assertEqual(host_states_map[('host2', 'node2')].free_ram_mb, 1024) # 1023GB self.assertEqual(host_states_map[('host2', 'node2')].free_disk_mb, 1048576) self.assertEqual(host_states_map[('host3', 'node3')].free_ram_mb, 3072) # 3071GB self.assertEqual(host_states_map[('host3', 'node3')].free_disk_mb, 3145728) self.assertThat( nova.objects.NUMATopology.obj_from_db_obj( host_states_map[('host3', 'node3')].numa_topology )._to_dict(), matchers.DictMatches(fakes.NUMA_TOPOLOGY._to_dict())) self.assertEqual(host_states_map[('host4', 'node4')].free_ram_mb, 8192) # 8191GB self.assertEqual(host_states_map[('host4', 'node4')].free_disk_mb, 8388608) class OpieHostManagerChangedNodesTestCase(nova_test_host_manager. HostManagerChangedNodesTestCase): """Test case for opie HostManager class.""" @mock.patch.object(host_manager.HostManager, '_init_instance_info') @mock.patch.object(host_manager.HostManager, '_init_aggregates') def setUp(self, mock_init_agg, mock_init_inst): super(OpieHostManagerChangedNodesTestCase, self).setUp() self.host_manager = host_manager.HostManager() self.fake_hosts = [ nova_host_manager.HostState('host1', 'node1'), nova_host_manager.HostState('host2', 'node2'), nova_host_manager.HostState('host3', 'node3'), nova_host_manager.HostState('host4', 'node4') ] @mock.patch('nova.objects.ServiceList.get_by_binary') @mock.patch('nova.objects.ComputeNodeList.get_all') @mock.patch('nova.objects.InstanceList.get_by_host') def test_get_all_host_partial_states(self, mock_get_by_host, mock_get_all, mock_get_by_binary): mock_get_by_host.return_value = nova.objects.InstanceList() mock_get_all.return_value = fakes.COMPUTE_NODES mock_get_by_binary.return_value = fakes.SERVICES context = 'fake_context' self.host_manager.get_all_host_partial_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 4) @mock.patch('nova.objects.ServiceList.get_by_binary') @mock.patch('nova.objects.ComputeNodeList.get_all') @mock.patch('nova.objects.InstanceList.get_by_host') def test_get_all_host_states_after_delete_one(self, mock_get_by_host, mock_get_all, mock_get_by_binary): getter = (lambda n: n.hypervisor_hostname if 'hypervisor_hostname' in n else None) running_nodes = [n for n in fakes.COMPUTE_NODES if getter(n) != 'node4'] mock_get_by_host.return_value = nova.objects.InstanceList() mock_get_all.side_effect = [fakes.COMPUTE_NODES, running_nodes] mock_get_by_binary.side_effect = [fakes.SERVICES, fakes.SERVICES] context = 'fake_context' # first call: all nodes self.host_manager.get_all_host_partial_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 4) # second call: just running nodes self.host_manager.get_all_host_partial_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 3) @mock.patch('nova.objects.ServiceList.get_by_binary') @mock.patch('nova.objects.ComputeNodeList.get_all') @mock.patch('nova.objects.InstanceList.get_by_host') def test_get_all_host_partial_states_after_delete_all(self, mock_get_by_host, mock_get_all, mock_get_by_binary): mock_get_by_host.return_value = nova.objects.InstanceList() mock_get_all.side_effect = [fakes.COMPUTE_NODES, []] mock_get_by_binary.side_effect = [fakes.SERVICES, fakes.SERVICES] context = 'fake_context' # first call: all nodes self.host_manager.get_all_host_partial_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 4) # second call: no nodes self.host_manager.get_all_host_partial_states(context) host_states_map = self.host_manager.host_state_map self.assertEqual(len(host_states_map), 0) class OpieHostStateTestCase(nova_test.NoDBTestCase): """Test case for Opie HostStatePartial class.""" # update_from_compute_node() and consume_from_request() are tested # in HostManagerTestCase.test_get_all_host_states() @mock.patch('nova.utils.synchronized', side_effect=lambda a: lambda f: lambda *args: f(*args)) @mock.patch('nova.virt.hardware.get_host_numa_usage_from_instance') @mock.patch('nova.objects.Instance') @mock.patch('nova.virt.hardware.numa_fit_instance_to_host') @mock.patch('nova.virt.hardware.host_topology_and_format_from_host') def test_stat_consumption_from_instance(self, host_topo_mock, numa_fit_mock, instance_init_mock, numa_usage_mock, sync_mock): fake_numa_topology = nova.objects.InstanceNUMATopology( cells=[nova.objects.InstanceNUMACell()]) fake_host_numa_topology = mock.Mock() fake_instance = nova.objects.Instance(numa_topology=fake_numa_topology) host_topo_mock.return_value = (fake_host_numa_topology, True) numa_usage_mock.return_value = fake_host_numa_topology numa_fit_mock.return_value = fake_numa_topology instance_init_mock.return_value = fake_instance spec_obj = nova.objects.RequestSpec( instance_uuid=uuids.instance, flavor=nova.objects.Flavor(root_gb=0, ephemeral_gb=0, memory_mb=0, vcpus=0), numa_topology=fake_numa_topology, pci_requests=nova.objects.InstancePCIRequests(requests=[])) host = host_manager.HostStatePartial("fakehost", "fakenode") self.assertIsNone(host.updated) host.consume_from_request(spec_obj) numa_fit_mock.assert_called_once_with(fake_host_numa_topology, fake_numa_topology, limits=None, pci_requests=None, pci_stats=None) numa_usage_mock.assert_called_once_with(host, fake_instance) sync_mock.assert_called_once_with(("fakehost", "fakenode")) self.assertEqual(fake_host_numa_topology, host.numa_topology) self.assertIsNotNone(host.updated) second_numa_topology = nova.objects.InstanceNUMATopology( cells=[nova.objects.InstanceNUMACell()]) spec_obj = nova.objects.RequestSpec( instance_uuid=uuids.instance, flavor=nova.objects.Flavor(root_gb=0, ephemeral_gb=0, memory_mb=0, vcpus=0), numa_topology=second_numa_topology, pci_requests=nova.objects.InstancePCIRequests(requests=[])) second_host_numa_topology = mock.Mock() numa_usage_mock.return_value = second_host_numa_topology numa_fit_mock.return_value = second_numa_topology host.consume_from_request(spec_obj) self.assertEqual(2, host.num_instances) self.assertEqual(2, host.num_io_ops) self.assertEqual(2, numa_usage_mock.call_count) self.assertEqual(((host, fake_instance),), numa_usage_mock.call_args) self.assertEqual(second_host_numa_topology, host.numa_topology) self.assertIsNotNone(host.updated) @mock.patch('nova.utils.synchronized', side_effect=lambda a: lambda f: lambda *args: f(*args)) @mock.patch('nova.virt.hardware.get_host_numa_usage_from_instance') @mock.patch('nova.objects.Instance') @mock.patch('nova.virt.hardware.numa_fit_instance_to_host') @mock.patch('nova.virt.hardware.host_topology_and_format_from_host') def test_stat_unconsumption_from_instance(self, host_topo_mock, numa_fit_mock, instance_init_mock, numa_usage_mock, sync_mock): fake_numa_topology = nova.objects.InstanceNUMATopology( cells=[nova.objects.InstanceNUMACell()]) fake_host_numa_topology = mock.Mock() fake_instance = nova.objects.Instance(numa_topology=fake_numa_topology) host_topo_mock.return_value = (fake_host_numa_topology, True) numa_usage_mock.return_value = fake_host_numa_topology numa_fit_mock.return_value = fake_numa_topology instance_init_mock.return_value = fake_instance spec_obj = nova.objects.RequestSpec( instance_uuid=uuids.instance, flavor=nova.objects.Flavor(root_gb=0, ephemeral_gb=0, memory_mb=0, vcpus=0), numa_topology=fake_numa_topology, pci_requests=nova.objects.InstancePCIRequests(requests=[])) host = host_manager.HostStatePartial("fakehost", "fakenode") self.assertIsNone(host.updated) host.consume_from_request(spec_obj) self.assertIsNotNone(host.updated) self.assertEqual(1, host.num_instances) second_numa_topology = nova.objects.InstanceNUMATopology( cells=[nova.objects.InstanceNUMACell()]) spec_obj = nova.objects.RequestSpec( instance_uuid=uuids.instance, flavor=nova.objects.Flavor(root_gb=1, ephemeral_gb=1, memory_mb=3, vcpus=4), numa_topology=second_numa_topology, pci_requests=nova.objects.InstancePCIRequests(requests=[])) second_host_numa_topology = mock.Mock() numa_usage_mock.return_value = second_host_numa_topology numa_fit_mock.return_value = second_numa_topology host.consume_from_request(spec_obj) self.assertEqual(2, host.num_instances) self.assertEqual(2, host.num_io_ops) host._unconsume_from_request(spec_obj) self.assertEqual(1, host.num_instances) self.assertEqual(2, host.num_io_ops) self.assertEqual(0, host.free_disk_mb) self.assertEqual(0, host.free_ram_mb) self.assertEqual(0, host.vcpus_used) self.assertIsNotNone(host.updated) def test_stat_unconsumption_from_instance_list(self): instances = {} inst = fake_instance.fake_instance_obj( "fake context", root_gb=0, ephemeral_gb=0, memory_mb=0, vcpus=0, project_id='12345', vm_state=vm_states.BUILDING, task_state=task_states.SCHEDULING, os_type='Linux', uuid='fake-uuid-normal' ) # Set this attribute here instead of doing a mock with the DB object inst.system_metadata = {} instances[inst.uuid] = inst inst = fake_instance.fake_instance_obj( "fake context", root_gb=1, ephemeral_gb=1, memory_mb=3, vcpus=4, project_id='12345', vm_state=vm_states.ACTIVE, task_state=task_states.RESIZE_PREP, os_type='Linux', uuid='fake-uuid-preemptible' ) inst.system_metadata = {"preemptible": True} instances[inst.uuid] = inst host = host_manager.HostStatePartial("fakehost", "fakenode") self.assertIsNone(host.updated) # Instances consume resources in the scheduling loop for instance in instances.values(): host.consume_from_request(instance) host.instances = instances self.assertEqual(1, host.num_instances) self.assertEqual(0, host.num_io_ops) self.assertEqual(0, host.free_disk_mb) self.assertEqual(0, host.free_ram_mb) self.assertEqual(0, host.vcpus_used) self.assertIsNotNone(host.updated) self.assertIn('fake-uuid-normal', host.normal_instances) self.assertIn('fake-uuid-normal', host.instances) self.assertIn('fake-uuid-preemptible', host.preemptible_instances) self.assertIn('fake-uuid-preemptible', host.instances) # Setting the instances a second time should leave the resources as # they were host.instances = instances self.assertEqual(1, host.num_instances)
46.702899
79
0.644272
2,295
19,335
5.102832
0.128105
0.045086
0.037742
0.038425
0.800444
0.783281
0.760311
0.744941
0.738451
0.729229
0
0.016856
0.263615
19,335
413
80
46.815981
0.805661
0.076183
0
0.735385
0
0
0.097703
0.05778
0
0
0
0
0.196923
1
0.030769
false
0
0.043077
0
0.083077
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
ec88b2b79d9905a34125e62513b88fbedc0bd25f
13,313
py
Python
test.py
Asqiir/relaxdays-hackathon-submission-lager
afa7dc1d4eec6063a98224d4c733b9b3dd80c0d2
[ "MIT" ]
null
null
null
test.py
Asqiir/relaxdays-hackathon-submission-lager
afa7dc1d4eec6063a98224d4c733b9b3dd80c0d2
[ "MIT" ]
null
null
null
test.py
Asqiir/relaxdays-hackathon-submission-lager
afa7dc1d4eec6063a98224d4c733b9b3dd80c0d2
[ "MIT" ]
null
null
null
import requests import json from collections import Counter import time o1 = {'name':'a-1;2;3;4','articleID':3,'bestand':17} o2 = {'name':'f-1;1;1;1','articleID':17,'bestand':17} o3 = {'name':'d-1;1;1;1','articleID':5,'bestand':17} o4 = {'name':'b-1;1;1;1','articleID':1,'bestand':17} o5 = {'name':'e-1;1;1;1','articleID':1,'bestand':17} o1v1 = {'standort':'a','lagerabschnitt':1,'reihe':2,'platz':3,'hoehe':4,'articleID':3,'bestand':17} o2v1 = {'standort':'f','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':17,'bestand':17} o3v1 = {'standort':'d','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':5,'bestand':17} o4v1 = {'standort':'b','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':1,'bestand':17} o5v1 = {'standort':'e','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':1,'bestand':17} o1v2 = {'standort':'a','lagerabschnitt':1,'reihe':2,'platz':3,'hoehe':4,'articleID':3,'bestand':17,'kapazitaet':17} o2v2 = {'standort':'f','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':17,'bestand':17,'kapazitaet':17} o3v2 = {'standort':'d','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':5,'bestand':17,'kapazitaet':17} o4v2 = {'standort':'b','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':1,'bestand':17,'kapazitaet':17} o5v2 = {'standort':'e','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':1,'bestand':17,'kapazitaet':17} o1b = {'name':'a-1;2;3;4','articleID':3,'bestand':18} o4b = {'name':'b-1;1;1;1','articleID':0,'bestand':0} o1bv1 = {'standort':'a','lagerabschnitt':1,'reihe':2,'platz':3,'hoehe':4,'articleID':3,'bestand':17} o4bv1 = {'standort':'b','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':0,'bestand':0} o1bv2 = {'standort':'a','lagerabschnitt':1,'reihe':2,'platz':3,'hoehe':4,'articleID':3,'bestand':17,'kapazitaet':18} o4bv2 = {'standort':'b','lagerabschnitt':1,'reihe':1,'platz':1,'hoehe':1,'articleID':0,'bestand':0,'kapazitaet':0} def dict_to_list(d): return [d['name'],d['articleID'],d['bestand']] def compare_lists(list1, list2): #return Counter(list1) == Counter(list2) #return sorted([dict_to_list(entry) for entry in list1])==sorted([dict_to_list(entry) for entry in list2]) return sorted(list1, key=lambda k:k['name'])==sorted(list2, key=lambda k:k['name']) def compare_lists2(list1, list2): x1 = sorted(list1, key=lambda k:(k['standort'],k['lagerabschnitt'],k['reihe'],k['platz'],k['hoehe'],k['articleID'],k['bestand'])) x2 = sorted(list2, key=lambda k:(k['standort'],k['lagerabschnitt'],k['reihe'],k['platz'],k['hoehe'],k['articleID'],k['bestand'])) return all([all([x1[index][key]==x2[index][key] for key in (list(x1[index].keys()) + list(x2[index].keys()))] for index in range(0,min(len(x1),len(x2))))]) # return x1==x2 #=====V0=================== with open('data.json','w') as file: file.write('[]') requests.post("http://0.0.0.0:8080/storagePlace", data=json.dumps(o1)) requests.post("http://0.0.0.0:8080/storagePlace", data=json.dumps(o2)) requests.post("http://0.0.0.0:8080/storagePlace", data=json.dumps(o3)) requests.post("http://0.0.0.0:8080/storagePlace", data=json.dumps(o4)) requests.post("http://0.0.0.0:8080/storagePlace", data=json.dumps(o5)) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1v2,o2v2,o3v2,o4v2,o5v2]): print(data) print('wrong data POST') r1 = requests.get("http://0.0.0.0:8080/storagePlace", params={'x':'a-1;2;3;4'}) r2 = requests.get("http://0.0.0.0:8080/storagePlace", params={'x':'f-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if r1.json() != o1 or r2.json() != o2: print(r1.json()) print(r2.json()) print('wrong data GET') r3 = requests.get("http://0.0.0.0:8080/storagePlaces", params={'n':2}) r4 = requests.get("http://0.0.0.0:8080/storagePlaces", params={'n':1,'x':'b-1;1;1;1'}) r5 = requests.get("http://0.0.0.0:8080/storagePlaces", params={'n':2,'x':'c-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if r3.json() != [o1,o4] : print(r3.json()) print('wrong data GET PAGINATION') if r4.json() != [o3] : print(r3.json()) print('wrong data GET PAGINATION') if r5.json() != [o3,o5] : print(r3.json()) print('wrong data GET PAGINATION') requests.put("http://0.0.0.0:8080/storagePlace", data=json.dumps(o1b)) requests.put("http://0.0.0.0:8080/storagePlace", data=json.dumps(o4b)) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o2v2,o3v2,o4bv2,o5v2]): print(data) print('wrong data PUT') requests.delete("http://0.0.0.0:8080/storagePlace", params={'x':'f-1;1;1;1'}) requests.delete("http://0.0.0.0:8080/storagePlace", params={'x':'b-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o3v2,o5v2]): print(data) print('wrong data DELETE') #========V1============== time.sleep(0.1) requests.get("http://0.0.0.0:8080/reset") with open('data.json','w') as file: file.write('[]') requests.post("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o1v1)) requests.post("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o2v1)) requests.post("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o3v1)) requests.post("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o4v1)) requests.post("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o5v1)) time.sleep(0.1) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1v2,o2v2,o3v2,o4v2,o5v2]): print(data) print('wrong data POST') r1 = requests.get("http://0.0.0.0:8080/v1/storagePlace", params={'x':'a-1;2;3;4'}) r2 = requests.get("http://0.0.0.0:8080/v1/storagePlace", params={'x':'f-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if r1.json() != o1v1 or r2.json() != o2v1: print(r1.json()) print(r2.json()) print('wrong data GET') r3 = requests.get("http://0.0.0.0:8080/v1/storagePlaces", params={'n':2}) r4 = requests.get("http://0.0.0.0:8080/v1/storagePlaces", params={'n':1,'x':'b-1;1;1;1'}) r5 = requests.get("http://0.0.0.0:8080/v1/storagePlaces", params={'n':2,'x':'c-1;1;1;1'}) if r3.json() != [o1v1,o4v1] : print(r3.json()) print('wrong data GET PAGINATION') if r4.json() != [o3v1] : print(r3.json()) print('wrong data GET PAGINATION') if r5.json() != [o3v1,o5v1] : print(r3.json()) print('wrong data GET PAGINATION') requests.put("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o1bv1)) requests.put("http://0.0.0.0:8080/v1/storagePlace", data=json.dumps(o4bv1)) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o2v2,o3v2,o4bv2,o5v2]): print(data) print('wrong data PUT') requests.delete("http://0.0.0.0:8080/v1/storagePlace", params={'x':'f-1;1;1;1'}) requests.delete("http://0.0.0.0:8080/v1/storagePlace", params={'x':'b-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o3v2,o5v2]): print(data) print('wrong data DELETE') #============V2================================ time.sleep(0.1) requests.get("http://0.0.0.0:8080/reset") time.sleep(0.3) with open('data.json','w') as file: file.write('[]') requests.post("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o1v2)) requests.post("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o2v2)) requests.post("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o3v2)) requests.post("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o4v2)) requests.post("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o5v2)) time.sleep(0.1) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1v2,o2v2,o3v2,o4v2,o5v2]): print(data) print('wrong data POST') r1 = requests.get("http://0.0.0.0:8080/v2/storagePlace", params={'x':'a-1;2;3;4'}) r2 = requests.get("http://0.0.0.0:8080/v2/storagePlace", params={'x':'f-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if r1.json() != o1v2 or r2.json() != o2v2: print(r1.json()) print(r2.json()) print('wrong data GET') r3 = requests.get("http://0.0.0.0:8080/v2/storagePlaces", params={'n':2}) r4 = requests.get("http://0.0.0.0:8080/v2/storagePlaces", params={'n':1,'x':'b-1;1;1;1'}) r5 = requests.get("http://0.0.0.0:8080/v2/storagePlaces", params={'n':2,'x':'c-1;1;1;1'}) if r3.json() != [o1v2,o4v2] : print(r3.json()) print('wrong data GET PAGINATION') if r4.json() != [o3v2] : print(r3.json()) print('wrong data GET PAGINATION') if r5.json() != [o3v2,o5v2] : print(r3.json()) print('wrong data GET PAGINATION') requests.put("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o1bv2)) requests.put("http://0.0.0.0:8080/v2/storagePlace", data=json.dumps(o4bv2)) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o2v2,o3v2,o4bv2,o5v2]): print(data) print('wrong data PUT') requests.delete("http://0.0.0.0:8080/v2/storagePlace", params={'x':'f-1;1;1;1'}) requests.delete("http://0.0.0.0:8080/v2/storagePlace", params={'x':'b-1;1;1;1'}) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o3v2,o5v2]): print(data) print('wrong data DELETE') r = requests.get('http://0.0.0.0:8080/v2/storagePlacesForArticleID', params={'x':3}) if not r.json()==[o1bv2]: print(r.json()) print('wrong ARTICLE GET') #============V3================================ time.sleep(0.1) requests.get("http://0.0.0.0:8080/reset") time.sleep(0.1) with open('data.json','w') as file: file.write('[]') requests.post("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o1v2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) requests.post("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o2v2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) requests.post("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o3v2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) requests.post("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o4v2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) requests.post("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o5v2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) time.sleep(0.1) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1v2,o2v2,o3v2,o4v2,o5v2]): print(data) print('wrong data POST') r1 = requests.get("http://0.0.0.0:8080/v3/storagePlace", params={'x':'a-1;2;3;4'}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) r2 = requests.get("http://0.0.0.0:8080/v3/storagePlace", params={'x':'f-1;1;1;1'}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) with open('data.json','r') as file: data = json.loads(file.read()) if r1.json() != o1v2 or r2.json() != o2v2: print(r1.json()) print(r2.json()) print('wrong data GET') r3 = requests.get("http://0.0.0.0:8080/v3/storagePlaces", params={'n':2}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) r4 = requests.get("http://0.0.0.0:8080/v3/storagePlaces", params={'n':1,'x':'b-1;1;1;1'}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) r5 = requests.get("http://0.0.0.0:8080/v3/storagePlaces", params={'n':2,'x':'c-1;1;1;1'}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) with open('data.json','r') as file: data = json.loads(file.read()) if r3.json() != [o1v2,o4v2] : print(r3.json()) print('wrong data GET PAGINATION') if r4.json() != [o3v2] : print(r3.json()) print('wrong data GET PAGINATION') if r5.json() != [o3v2,o5v2] : print(r3.json()) print('wrong data GET PAGINATION') requests.put("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o1bv2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) requests.put("http://0.0.0.0:8080/v3/storagePlace", data=json.dumps(o4bv2), auth=requests.auth.HTTPBasicAuth('user', 'pass')) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o2v2,o3v2,o4bv2,o5v2]): print(data) print('wrong data PUT') requests.delete("http://0.0.0.0:8080/v3/storagePlace", params={'x':'f-1;1;1;1'}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) requests.delete("http://0.0.0.0:8080/v3/storagePlace", params={'x':'b-1;1;1;1'}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) with open('data.json','r') as file: data = json.loads(file.read()) if not compare_lists2(data,[o1bv2,o3v2,o5v2]): print(data) print('wrong data DELETE') r = requests.get('http://0.0.0.0:8080/v3/storagePlacesForArticleID', params={'x':3}, auth=requests.auth.HTTPBasicAuth('user', 'pass')) if not r.json()==[o1bv2]: print(r.json()) print('wrong ARTICLE GET') r = requests.get('http://0.0.0.0:8080/storagePlacesAtLocation', params={'n':1,'l':'a','x':1}) if not r.json()==[o1bv2]: print(r.json()) print('wrong GET FOR LOCATION 1') r = requests.get('http://0.0.0.0:8080/storagePlacesAtLocation', params={'n':1,'l':'x','x':1}) if not r.json()==[]: print(r.json()) print('wrong GET FOR LOCATION 2') r = requests.get('http://0.0.0.0:8080/storagePlacesAtLocation', params={'n':1,'l':'a'}) if not r.json()==[o1bv2]: print(r.json()) print('wrong GET FOR LOCATION 3')
34.669271
160
0.648764
2,274
13,313
3.789358
0.054529
0.044563
0.044563
0.05199
0.926308
0.91157
0.885111
0.878148
0.860973
0.853777
0
0.097983
0.083903
13,313
384
161
34.669271
0.60856
0.02276
0
0.575397
0
0
0.357736
0
0
0
0
0
0
1
0.011905
false
0.059524
0.015873
0.007937
0.039683
0.277778
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
eccafc37e14ea78d684156bc0a1061f5cf705a9a
3,522
py
Python
split_client_side/client/client.py
Jeff-Meadows/split_client_side
de97caabb8e9d07596d958846acb0a5e06063bc5
[ "Apache-2.0" ]
null
null
null
split_client_side/client/client.py
Jeff-Meadows/split_client_side
de97caabb8e9d07596d958846acb0a5e06063bc5
[ "Apache-2.0" ]
null
null
null
split_client_side/client/client.py
Jeff-Meadows/split_client_side
de97caabb8e9d07596d958846acb0a5e06063bc5
[ "Apache-2.0" ]
null
null
null
from splitio.client.client import Client class ClientSideClient(Client): def __init__(self, *args, **kwargs): traffic_key = kwargs.pop('traffic_key') super().__init__(*args, **kwargs) self._traffic_key = traffic_key def get_treatment_with_config(self, feature, attributes=None): """ Get the treatment and config for a feature, with optional dictionary of attributes. This method never raises an exception. If there's a problem, the appropriate log message will be generated and the method will return the CONTROL treatment. :param feature: The name of the feature for which to get the treatment :type feature: str :param attributes: An optional dictionary of attributes :type attributes: dict :return: The treatment for the key and feature :rtype: tuple(str, str) """ # pylint:disable=arguments-differ return super().get_treatment_with_config(self._traffic_key, feature, attributes) def get_treatment(self, feature, attributes=None): """ Get the treatment for a feature, with an optional dictionary of attributes. This method never raises an exception. If there's a problem, the appropriate log message will be generated and the method will return the CONTROL treatment. :param feature: The name of the feature for which to get the treatment :type feature: str :param attributes: An optional dictionary of attributes :type attributes: dict :return: The treatment for the key and feature :rtype: str """ # pylint:disable=arguments-differ return super().get_treatment(self._traffic_key, feature, attributes) def get_treatments_with_config(self, features, attributes=None): """ Evaluate multiple features and return a dict with feature -> (treatment, config). Get the treatments for a list of features, with an optional dictionary of attributes. This method never raises an exception. If there's a problem, the appropriate log message will be generated and the method will return the CONTROL treatment. :param features: Array of the names of the features for which to get the treatment :type feature: list :param attributes: An optional dictionary of attributes :type attributes: dict :return: Dictionary with the result of all the features provided :rtype: dict """ # pylint:disable=arguments-differ return super().get_treatments_with_config(self._traffic_key, features, attributes) def get_treatments(self, features, attributes=None): """ Evaluate multiple features and return a dictionary with all the feature/treatments. Get the treatments for a list of features, with an optional dictionary of attributes. This method never raises an exception. If there's a problem, the appropriate log message will be generated and the method will return the CONTROL treatment. :param features: Array of the names of the features for which to get the treatment :type feature: list :param attributes: An optional dictionary of attributes :type attributes: dict :return: Dictionary with the result of all the features provided :rtype: dict """ # pylint:disable=arguments-differ return super().get_treatments(self._traffic_key, features, attributes)
45.74026
96
0.689949
451
3,522
5.305987
0.155211
0.033431
0.066862
0.100293
0.87756
0.824906
0.824906
0.760552
0.760552
0.71542
0
0
0.25071
3,522
76
97
46.342105
0.906783
0.638274
0
0
0
0
0.012141
0
0
0
0
0
0
1
0.357143
false
0
0.071429
0
0.785714
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
0
0
0
7
ece899be35e3fe1546a48fcb4270cf121e82120c
1,300
py
Python
gestionResultadosProtocolo/admin.py
AnuTor/UniNeuroLab
5825f440d4663650f038083f3da05229cc5ada4f
[ "Apache-2.0" ]
null
null
null
gestionResultadosProtocolo/admin.py
AnuTor/UniNeuroLab
5825f440d4663650f038083f3da05229cc5ada4f
[ "Apache-2.0" ]
null
null
null
gestionResultadosProtocolo/admin.py
AnuTor/UniNeuroLab
5825f440d4663650f038083f3da05229cc5ada4f
[ "Apache-2.0" ]
null
null
null
# GESTION RESULTADOS PROTOCOLOS from django.contrib import admin from gestionResultadosProtocolo.models import resultadosProtocolo # Register your models here. class resultadosProtocoloAdmin(admin.ModelAdmin): list_display=("protocoloEstudio", "clave_Protocolo", "tipoInvestigacion", "aceptadoDiseño_Metodológico", "fechaAceptacionDM", "aceptadoConsetimiento_Informado", "fechaAceptacionCI","fechaInicioInvestigacion", "investigadorResponsable1", "MP_IR1", "investigadorResponsable2", "MP_IR2", "investigadorResponsable3", "MP_IR3") search_fields=("protocoloEstudio", "clave_Protocolo", "tipoInvestigacion", "aceptadoDiseño_Metodológico", "fechaAceptacionDM", "aceptadoConsetimiento_Informado", "fechaAceptacionCI","fechaInicioInvestigacion", "investigadorResponsable1", "MP_IR1", "investigadorResponsable2", "MP_IR2", "investigadorResponsable3", "MP_IR3") list_filter=("protocoloEstudio", "clave_Protocolo", "tipoInvestigacion", "aceptadoDiseño_Metodológico", "fechaAceptacionDM", "aceptadoConsetimiento_Informado", "fechaAceptacionCI","fechaInicioInvestigacion", "investigadorResponsable1", "MP_IR1", "investigadorResponsable2", "MP_IR2", "investigadorResponsable3", "MP_IR3") date_hierarchy=("fechaInicioInvestigacion") admin.site.register(resultadosProtocolo, resultadosProtocoloAdmin)
86.666667
324
0.829231
95
1,300
11.115789
0.452632
0.059659
0.085227
0.133523
0.704545
0.704545
0.704545
0.704545
0.704545
0.704545
0
0.014646
0.054615
1,300
14
325
92.857143
0.844589
0.043077
0
0
0
0
0.63336
0.39162
0
0
0
0
0
1
0
false
0
0.25
0
0.875
0
0
0
1
null
0
0
0
0
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
1
0
0
8
ece9397744a4947b59f10f352a8f112295d65a48
21,195
py
Python
nova/tests/unit/objects/test_aggregate.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/objects/test_aggregate.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
null
null
null
nova/tests/unit/objects/test_aggregate.py
bopopescu/nova-token
ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2
[ "Apache-2.0" ]
2
2017-07-20T17:31:34.000Z
2020-07-24T02:42:19.000Z
begin_unit comment|'# Copyright 2013 IBM Corp.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n' comment|'# a copy of the License at' nl|'\n' comment|'#' nl|'\n' comment|'# http://www.apache.org/licenses/LICENSE-2.0' nl|'\n' comment|'#' nl|'\n' comment|'# Unless required by applicable law or agreed to in writing, software' nl|'\n' comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT' nl|'\n' comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the' nl|'\n' comment|'# License for the specific language governing permissions and limitations' nl|'\n' comment|'# under the License.' nl|'\n' nl|'\n' name|'import' name|'mock' newline|'\n' name|'from' name|'oslo_utils' name|'import' name|'timeutils' newline|'\n' nl|'\n' name|'from' name|'nova' name|'import' name|'db' newline|'\n' name|'from' name|'nova' name|'import' name|'exception' newline|'\n' name|'from' name|'nova' op|'.' name|'objects' name|'import' name|'aggregate' newline|'\n' name|'from' name|'nova' op|'.' name|'tests' op|'.' name|'unit' name|'import' name|'fake_notifier' newline|'\n' name|'from' name|'nova' op|'.' name|'tests' op|'.' name|'unit' op|'.' name|'objects' name|'import' name|'test_objects' newline|'\n' name|'from' name|'nova' op|'.' name|'tests' name|'import' name|'uuidsentinel' newline|'\n' nl|'\n' nl|'\n' DECL|variable|NOW name|'NOW' op|'=' name|'timeutils' op|'.' name|'utcnow' op|'(' op|')' op|'.' name|'replace' op|'(' name|'microsecond' op|'=' number|'0' op|')' newline|'\n' DECL|variable|fake_aggregate name|'fake_aggregate' op|'=' op|'{' nl|'\n' string|"'created_at'" op|':' name|'NOW' op|',' nl|'\n' string|"'updated_at'" op|':' name|'None' op|',' nl|'\n' string|"'deleted_at'" op|':' name|'None' op|',' nl|'\n' string|"'deleted'" op|':' name|'False' op|',' nl|'\n' string|"'id'" op|':' number|'123' op|',' nl|'\n' string|"'uuid'" op|':' name|'uuidsentinel' op|'.' name|'fake_aggregate' op|',' nl|'\n' string|"'name'" op|':' string|"'fake-aggregate'" op|',' nl|'\n' string|"'hosts'" op|':' op|'[' string|"'foo'" op|',' string|"'bar'" op|']' op|',' nl|'\n' string|"'metadetails'" op|':' op|'{' string|"'this'" op|':' string|"'that'" op|'}' op|',' nl|'\n' op|'}' newline|'\n' nl|'\n' DECL|variable|SUBS name|'SUBS' op|'=' op|'{' string|"'metadata'" op|':' string|"'metadetails'" op|'}' newline|'\n' nl|'\n' nl|'\n' DECL|class|_TestAggregateObject name|'class' name|'_TestAggregateObject' op|'(' name|'object' op|')' op|':' newline|'\n' DECL|member|test_get_by_id indent|' ' name|'def' name|'test_get_by_id' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_get'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_get' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|')' op|'.' name|'AndReturn' op|'(' name|'fake_aggregate' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'.' name|'get_by_id' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'agg' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|"'nova.objects.Aggregate.save'" op|')' newline|'\n' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|"'nova.db.aggregate_get'" op|')' newline|'\n' DECL|member|test_load_allocates_uuid name|'def' name|'test_load_allocates_uuid' op|'(' name|'self' op|',' name|'mock_get' op|',' name|'mock_save' op|')' op|':' newline|'\n' indent|' ' name|'fake_agg' op|'=' name|'dict' op|'(' name|'fake_aggregate' op|')' newline|'\n' name|'del' name|'fake_agg' op|'[' string|"'uuid'" op|']' newline|'\n' name|'mock_get' op|'.' name|'return_value' op|'=' name|'fake_agg' newline|'\n' name|'uuid' op|'=' name|'uuidsentinel' op|'.' name|'aggregate' newline|'\n' name|'with' name|'mock' op|'.' name|'patch' op|'(' string|"'oslo_utils.uuidutils.generate_uuid'" op|')' name|'as' name|'mock_g' op|':' newline|'\n' indent|' ' name|'mock_g' op|'.' name|'return_value' op|'=' name|'uuid' newline|'\n' name|'obj' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'.' name|'get_by_id' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|')' newline|'\n' name|'mock_g' op|'.' name|'assert_called_once_with' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'uuid' op|',' name|'obj' op|'.' name|'uuid' op|')' newline|'\n' name|'mock_save' op|'.' name|'assert_called_once_with' op|'(' op|')' newline|'\n' nl|'\n' DECL|member|test_create dedent|'' dedent|'' name|'def' name|'test_create' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_create'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_create' op|'(' name|'self' op|'.' name|'context' op|',' op|'{' string|"'name'" op|':' string|"'foo'" op|',' nl|'\n' string|"'uuid'" op|':' name|'uuidsentinel' op|'.' name|'fake_agg' op|'}' op|',' nl|'\n' name|'metadata' op|'=' op|'{' string|"'one'" op|':' string|"'two'" op|'}' op|')' op|'.' name|'AndReturn' op|'(' name|'fake_aggregate' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' name|'context' op|'=' name|'self' op|'.' name|'context' op|')' newline|'\n' name|'agg' op|'.' name|'name' op|'=' string|"'foo'" newline|'\n' name|'agg' op|'.' name|'metadata' op|'=' op|'{' string|"'one'" op|':' string|"'two'" op|'}' newline|'\n' name|'agg' op|'.' name|'uuid' op|'=' name|'uuidsentinel' op|'.' name|'fake_agg' newline|'\n' name|'agg' op|'.' name|'create' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'agg' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' DECL|member|test_recreate_fails dedent|'' name|'def' name|'test_recreate_fails' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_create'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_create' op|'(' name|'self' op|'.' name|'context' op|',' op|'{' string|"'name'" op|':' string|"'foo'" op|',' nl|'\n' string|"'uuid'" op|':' name|'uuidsentinel' op|'.' name|'fake_agg' op|'}' op|',' nl|'\n' name|'metadata' op|'=' op|'{' string|"'one'" op|':' string|"'two'" op|'}' op|')' op|'.' name|'AndReturn' op|'(' name|'fake_aggregate' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' name|'context' op|'=' name|'self' op|'.' name|'context' op|')' newline|'\n' name|'agg' op|'.' name|'name' op|'=' string|"'foo'" newline|'\n' name|'agg' op|'.' name|'metadata' op|'=' op|'{' string|"'one'" op|':' string|"'two'" op|'}' newline|'\n' name|'agg' op|'.' name|'uuid' op|'=' name|'uuidsentinel' op|'.' name|'fake_agg' newline|'\n' name|'agg' op|'.' name|'create' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'assertRaises' op|'(' name|'exception' op|'.' name|'ObjectActionError' op|',' name|'agg' op|'.' name|'create' op|')' newline|'\n' nl|'\n' DECL|member|test_save dedent|'' name|'def' name|'test_save' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_update'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_update' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|',' op|'{' string|"'name'" op|':' string|"'baz'" op|'}' op|')' op|'.' name|'AndReturn' op|'(' nl|'\n' name|'fake_aggregate' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' name|'context' op|'=' name|'self' op|'.' name|'context' op|')' newline|'\n' name|'agg' op|'.' name|'id' op|'=' number|'123' newline|'\n' name|'agg' op|'.' name|'name' op|'=' string|"'baz'" newline|'\n' name|'agg' op|'.' name|'save' op|'(' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'agg' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' DECL|member|test_save_and_create_no_hosts dedent|'' name|'def' name|'test_save_and_create_no_hosts' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' name|'context' op|'=' name|'self' op|'.' name|'context' op|')' newline|'\n' name|'agg' op|'.' name|'id' op|'=' number|'123' newline|'\n' name|'agg' op|'.' name|'hosts' op|'=' op|'[' string|"'foo'" op|',' string|"'bar'" op|']' newline|'\n' name|'self' op|'.' name|'assertRaises' op|'(' name|'exception' op|'.' name|'ObjectActionError' op|',' nl|'\n' name|'agg' op|'.' name|'create' op|')' newline|'\n' name|'self' op|'.' name|'assertRaises' op|'(' name|'exception' op|'.' name|'ObjectActionError' op|',' nl|'\n' name|'agg' op|'.' name|'save' op|')' newline|'\n' nl|'\n' DECL|member|test_update_metadata dedent|'' name|'def' name|'test_update_metadata' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_metadata_delete'" op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_metadata_add'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_metadata_delete' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|',' string|"'todelete'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_metadata_add' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|',' op|'{' string|"'toadd'" op|':' string|"'myval'" op|'}' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'fake_notifier' op|'.' name|'NOTIFICATIONS' op|'=' op|'[' op|']' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' op|')' newline|'\n' name|'agg' op|'.' name|'_context' op|'=' name|'self' op|'.' name|'context' newline|'\n' name|'agg' op|'.' name|'id' op|'=' number|'123' newline|'\n' name|'agg' op|'.' name|'metadata' op|'=' op|'{' string|"'foo'" op|':' string|"'bar'" op|'}' newline|'\n' name|'agg' op|'.' name|'obj_reset_changes' op|'(' op|')' newline|'\n' name|'agg' op|'.' name|'update_metadata' op|'(' op|'{' string|"'todelete'" op|':' name|'None' op|',' string|"'toadd'" op|':' string|"'myval'" op|'}' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'2' op|',' name|'len' op|'(' name|'fake_notifier' op|'.' name|'NOTIFICATIONS' op|')' op|')' newline|'\n' name|'msg' op|'=' name|'fake_notifier' op|'.' name|'NOTIFICATIONS' op|'[' number|'0' op|']' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'aggregate.updatemetadata.start'" op|',' name|'msg' op|'.' name|'event_type' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' op|'{' string|"'todelete'" op|':' name|'None' op|',' string|"'toadd'" op|':' string|"'myval'" op|'}' op|',' nl|'\n' name|'msg' op|'.' name|'payload' op|'[' string|"'meta_data'" op|']' op|')' newline|'\n' name|'msg' op|'=' name|'fake_notifier' op|'.' name|'NOTIFICATIONS' op|'[' number|'1' op|']' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'aggregate.updatemetadata.end'" op|',' name|'msg' op|'.' name|'event_type' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' op|'{' string|"'todelete'" op|':' name|'None' op|',' string|"'toadd'" op|':' string|"'myval'" op|'}' op|',' nl|'\n' name|'msg' op|'.' name|'payload' op|'[' string|"'meta_data'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' op|'{' string|"'foo'" op|':' string|"'bar'" op|',' string|"'toadd'" op|':' string|"'myval'" op|'}' op|',' name|'agg' op|'.' name|'metadata' op|')' newline|'\n' nl|'\n' DECL|member|test_destroy dedent|'' name|'def' name|'test_destroy' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_delete'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_delete' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' name|'context' op|'=' name|'self' op|'.' name|'context' op|')' newline|'\n' name|'agg' op|'.' name|'id' op|'=' number|'123' newline|'\n' name|'agg' op|'.' name|'destroy' op|'(' op|')' newline|'\n' nl|'\n' DECL|member|test_add_host dedent|'' name|'def' name|'test_add_host' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_host_add'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_host_add' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|',' string|"'bar'" nl|'\n' op|')' op|'.' name|'AndReturn' op|'(' op|'{' string|"'host'" op|':' string|"'bar'" op|'}' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' op|')' newline|'\n' name|'agg' op|'.' name|'id' op|'=' number|'123' newline|'\n' name|'agg' op|'.' name|'hosts' op|'=' op|'[' string|"'foo'" op|']' newline|'\n' name|'agg' op|'.' name|'_context' op|'=' name|'self' op|'.' name|'context' newline|'\n' name|'agg' op|'.' name|'add_host' op|'(' string|"'bar'" op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'agg' op|'.' name|'hosts' op|',' op|'[' string|"'foo'" op|',' string|"'bar'" op|']' op|')' newline|'\n' nl|'\n' DECL|member|test_delete_host dedent|'' name|'def' name|'test_delete_host' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_host_delete'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_host_delete' op|'(' name|'self' op|'.' name|'context' op|',' number|'123' op|',' string|"'foo'" op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' op|')' newline|'\n' name|'agg' op|'.' name|'id' op|'=' number|'123' newline|'\n' name|'agg' op|'.' name|'hosts' op|'=' op|'[' string|"'foo'" op|',' string|"'bar'" op|']' newline|'\n' name|'agg' op|'.' name|'_context' op|'=' name|'self' op|'.' name|'context' newline|'\n' name|'agg' op|'.' name|'delete_host' op|'(' string|"'foo'" op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' name|'agg' op|'.' name|'hosts' op|',' op|'[' string|"'bar'" op|']' op|')' newline|'\n' nl|'\n' DECL|member|test_availability_zone dedent|'' name|'def' name|'test_availability_zone' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'agg' op|'=' name|'aggregate' op|'.' name|'Aggregate' op|'(' op|')' newline|'\n' name|'agg' op|'.' name|'metadata' op|'=' op|'{' string|"'availability_zone'" op|':' string|"'foo'" op|'}' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' string|"'foo'" op|',' name|'agg' op|'.' name|'availability_zone' op|')' newline|'\n' nl|'\n' DECL|member|test_get_all dedent|'' name|'def' name|'test_get_all' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_get_all'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_get_all' op|'(' name|'self' op|'.' name|'context' op|')' op|'.' name|'AndReturn' op|'(' op|'[' name|'fake_aggregate' op|']' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'aggs' op|'=' name|'aggregate' op|'.' name|'AggregateList' op|'.' name|'get_all' op|'(' name|'self' op|'.' name|'context' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'1' op|',' name|'len' op|'(' name|'aggs' op|')' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'aggs' op|'[' number|'0' op|']' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' DECL|member|test_by_host dedent|'' name|'def' name|'test_by_host' op|'(' name|'self' op|')' op|':' newline|'\n' indent|' ' name|'self' op|'.' name|'mox' op|'.' name|'StubOutWithMock' op|'(' name|'db' op|',' string|"'aggregate_get_by_host'" op|')' newline|'\n' name|'db' op|'.' name|'aggregate_get_by_host' op|'(' name|'self' op|'.' name|'context' op|',' string|"'fake-host'" op|',' name|'key' op|'=' name|'None' op|',' nl|'\n' op|')' op|'.' name|'AndReturn' op|'(' op|'[' name|'fake_aggregate' op|']' op|')' newline|'\n' name|'self' op|'.' name|'mox' op|'.' name|'ReplayAll' op|'(' op|')' newline|'\n' name|'aggs' op|'=' name|'aggregate' op|'.' name|'AggregateList' op|'.' name|'get_by_host' op|'(' name|'self' op|'.' name|'context' op|',' string|"'fake-host'" op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'1' op|',' name|'len' op|'(' name|'aggs' op|')' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'aggs' op|'[' number|'0' op|']' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|"'nova.db.aggregate_get_by_metadata_key'" op|')' newline|'\n' DECL|member|test_get_by_metadata_key name|'def' name|'test_get_by_metadata_key' op|'(' name|'self' op|',' name|'get_by_metadata_key' op|')' op|':' newline|'\n' indent|' ' name|'get_by_metadata_key' op|'.' name|'return_value' op|'=' op|'[' name|'fake_aggregate' op|']' newline|'\n' name|'aggs' op|'=' name|'aggregate' op|'.' name|'AggregateList' op|'.' name|'get_by_metadata_key' op|'(' nl|'\n' name|'self' op|'.' name|'context' op|',' string|"'this'" op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'1' op|',' name|'len' op|'(' name|'aggs' op|')' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'aggs' op|'[' number|'0' op|']' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|"'nova.db.aggregate_get_by_metadata_key'" op|')' newline|'\n' DECL|member|test_get_by_metadata_key_and_hosts_no_match name|'def' name|'test_get_by_metadata_key_and_hosts_no_match' op|'(' name|'self' op|',' name|'get_by_metadata_key' op|')' op|':' newline|'\n' indent|' ' name|'get_by_metadata_key' op|'.' name|'return_value' op|'=' op|'[' name|'fake_aggregate' op|']' newline|'\n' name|'aggs' op|'=' name|'aggregate' op|'.' name|'AggregateList' op|'.' name|'get_by_metadata_key' op|'(' nl|'\n' name|'self' op|'.' name|'context' op|',' string|"'this'" op|',' name|'hosts' op|'=' op|'[' string|"'baz'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'0' op|',' name|'len' op|'(' name|'aggs' op|')' op|')' newline|'\n' nl|'\n' dedent|'' op|'@' name|'mock' op|'.' name|'patch' op|'(' string|"'nova.db.aggregate_get_by_metadata_key'" op|')' newline|'\n' DECL|member|test_get_by_metadata_key_and_hosts_match name|'def' name|'test_get_by_metadata_key_and_hosts_match' op|'(' name|'self' op|',' name|'get_by_metadata_key' op|')' op|':' newline|'\n' indent|' ' name|'get_by_metadata_key' op|'.' name|'return_value' op|'=' op|'[' name|'fake_aggregate' op|']' newline|'\n' name|'aggs' op|'=' name|'aggregate' op|'.' name|'AggregateList' op|'.' name|'get_by_metadata_key' op|'(' nl|'\n' name|'self' op|'.' name|'context' op|',' string|"'this'" op|',' name|'hosts' op|'=' op|'[' string|"'foo'" op|',' string|"'bar'" op|']' op|')' newline|'\n' name|'self' op|'.' name|'assertEqual' op|'(' number|'1' op|',' name|'len' op|'(' name|'aggs' op|')' op|')' newline|'\n' name|'self' op|'.' name|'compare_obj' op|'(' name|'aggs' op|'[' number|'0' op|']' op|',' name|'fake_aggregate' op|',' name|'subs' op|'=' name|'SUBS' op|')' newline|'\n' nl|'\n' nl|'\n' dedent|'' dedent|'' name|'class' name|'TestAggregateObject' op|'(' name|'test_objects' op|'.' name|'_LocalTest' op|',' nl|'\n' DECL|class|TestAggregateObject name|'_TestAggregateObject' op|')' op|':' newline|'\n' indent|' ' name|'pass' newline|'\n' nl|'\n' nl|'\n' dedent|'' name|'class' name|'TestRemoteAggregateObject' op|'(' name|'test_objects' op|'.' name|'_RemoteTest' op|',' nl|'\n' DECL|class|TestRemoteAggregateObject name|'_TestAggregateObject' op|')' op|':' newline|'\n' indent|' ' name|'pass' newline|'\n' dedent|'' endmarker|'' end_unit
11.934122
88
0.59514
3,118
21,195
3.960552
0.059333
0.185602
0.102033
0.092963
0.876103
0.84517
0.784436
0.770832
0.731314
0.689449
0
0.003603
0.096438
21,195
1,775
89
11.940845
0.64122
0
0
0.938592
0
0
0.343949
0.03331
0
0
0
0
0.011268
0
null
null
0.001127
0.004507
null
null
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
01a83cfcac84e03d8265e09faebeff8a727d7540
1,362
py
Python
mc10/conftest.py
jamieleecho/mc10-tools
72a92168dea19dc341fbc3b5c04246dcaf18c64c
[ "MIT" ]
3
2021-02-06T18:18:47.000Z
2021-03-15T13:14:41.000Z
mc10/conftest.py
jamieleecho/mc10-tools
72a92168dea19dc341fbc3b5c04246dcaf18c64c
[ "MIT" ]
2
2021-02-01T02:39:00.000Z
2021-02-14T11:50:48.000Z
mc10/conftest.py
jamieleecho/mc10-tools
72a92168dea19dc341fbc3b5c04246dcaf18c64c
[ "MIT" ]
null
null
null
import os import pytest @pytest.fixture def filename_block(): return bytes([0x3c, 0x00, 0x0f, 0x42, 0x4c, 0x4f, 0x52, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x46, 0x43, 0x46, 0x9b]) @pytest.fixture def filename_block_bad_checksum(): return bytes([0x3c, 0x00, 0x0f, 0x42, 0x4c, 0x4f, 0x52, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x46, 0x43, 0x46, 0x9c]) @pytest.fixture def filename_block_no_checksum(): return bytes([0x3c, 0x00, 0x0f, 0x42, 0x4c, 0x4f, 0x52, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x46, 0x43, 0x46]) @pytest.fixture def filename_block_bad_block_header(): return bytes([0xc3, 0x00, 0x0f, 0x42, 0x4c, 0x4f, 0x52, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x46, 0x43, 0x46, 0x9c]) @pytest.fixture def filename_block_data(): return bytes([0x42, 0x4c, 0x4f, 0x52, 0x4b, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x01, 0x23, 0x45, 0x67]) @pytest.fixture def filename_block_data_no_filename(): return bytes([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x01, 0x23, 0x45, 0x67]) def resource_path(): return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'resources')
28.978723
72
0.605727
177
1,362
4.536723
0.225989
0.288917
0.343711
0.33873
0.808219
0.772105
0.646326
0.62142
0.596513
0.596513
0
0.290161
0.268722
1,362
46
73
29.608696
0.516064
0
0
0.5
0
0
0.006608
0
0
0
0.30837
0
0
1
0.21875
true
0
0.0625
0.21875
0.5
0
0
0
0
null
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
0
0
0
9
01b8aa4ffa334bac6dd14878da88fe7fbb3f5058
6,825
py
Python
experiments.py
rinkwitz/Thesis_Semantic_Image_Segmentation_on_Satellite_Imagery_using_UNets
75d3a4a536f6ef81fe0efd4f5fbba32b627a7472
[ "MIT" ]
1
2021-05-13T01:41:38.000Z
2021-05-13T01:41:38.000Z
experiments.py
rinkwitz/Thesis_Semantic_Image_Segmentation_on_Satellite_Imagery_using_UNets
75d3a4a536f6ef81fe0efd4f5fbba32b627a7472
[ "MIT" ]
null
null
null
experiments.py
rinkwitz/Thesis_Semantic_Image_Segmentation_on_Satellite_Imagery_using_UNets
75d3a4a536f6ef81fe0efd4f5fbba32b627a7472
[ "MIT" ]
1
2021-03-13T16:55:06.000Z
2021-03-13T16:55:06.000Z
import torch from pathlib import Path exp_0 = dict(write_access=True, model_name='unet', pretrained_on=None, continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=200, in_channels=3, num_categories=2, filter_sizes=(32, 64, 128, 256, 512), deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=3e-3, max_lr=1e-2), save_model_every_epoch=True) exp_1 = dict(write_access=True, model_name='attention_unet', pretrained_on=None, continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=200, in_channels=3, num_categories=2, filter_sizes=(32, 64, 128, 256, 512), deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=3e-3, max_lr=1e-2), save_model_every_epoch=True) exp_2 = dict(write_access=True, model_name='cbam_unet', pretrained_on=None, continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=200, in_channels=3, num_categories=2, filter_sizes=(32, 64, 128, 256, 512), deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=3e-3, max_lr=1e-2), save_model_every_epoch=True) exp_3 = dict(write_access=True, model_name='residualattention_unet', pretrained_on=None, continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=200, in_channels=3, num_categories=2, filter_sizes=(32, 64, 128, 256, 512), deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=2e-3, max_lr=6e-3), save_model_every_epoch=True) exp_4 = dict(write_access=True, model_name='scag_unet', pretrained_on=None, continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=200, in_channels=3, num_categories=2, filter_sizes=(32, 64, 128, 256, 512), deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=3e-3, max_lr=1e-2), save_model_every_epoch=True) exp_5 = dict(write_access=True, model_name='densenet121_unet', pretrained_on='Imagenet', continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=60, in_channels=3, num_categories=2, deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=1e-2, max_lr=3e-2), save_model_every_epoch=True) exp_6 = dict(write_access=True, model_name='mobilenetv2_unet', pretrained_on='Imagenet', continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=60, in_channels=3, num_categories=2, deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=2e-2, max_lr=6e-2), save_model_every_epoch=True) exp_7 = dict(write_access=True, model_name='resnet34_unet', pretrained_on='Imagenet', continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=60, in_channels=3, num_categories=2, deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=1e-2, max_lr=3e-2), save_model_every_epoch=True) exp_8 = dict(write_access=True, model_name='vgg11_unet', pretrained_on='Imagenet', continue_training=False, continue_model_path=None, continue_from_epoch=0, initialize_weights=True, freeze_encoder=False, num_epochs=60, in_channels=3, num_categories=2, deep_supervision=True, dataloader_path=Path('tmp/Dataloader_SN1_Buildings.pkl'), device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'), learning_rate_dict=dict(static_lr=3e-4, use_cyclic_learning_rate=True, base_lr=3e-3, max_lr=1e-2), save_model_every_epoch=True)
42.391304
111
0.601758
823
6,825
4.646416
0.102066
0.056485
0.035303
0.044718
0.966004
0.966004
0.893305
0.886245
0.886245
0.886245
0
0.041139
0.305495
6,825
160
112
42.65625
0.765612
0
0
0.854305
0
0
0.072674
0.045421
0
0
0
0
0
1
0
false
0
0.013245
0
0.013245
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
01c36cc7b742f40f78b5f10fe27d33bbb4967e08
135
py
Python
hagia/utils/__init__.py
0xSTAR/hagia
213d1cf286f7b1d02dfeb441def6ec77a3377615
[ "Zlib" ]
3
2022-02-06T03:52:55.000Z
2022-02-07T03:54:28.000Z
hagia/utils/__init__.py
0xSTAR/hagia
213d1cf286f7b1d02dfeb441def6ec77a3377615
[ "Zlib" ]
null
null
null
hagia/utils/__init__.py
0xSTAR/hagia
213d1cf286f7b1d02dfeb441def6ec77a3377615
[ "Zlib" ]
2
2022-02-06T03:53:34.000Z
2022-02-08T00:44:01.000Z
from hagia.utils.hmath import * from hagia.utils.htables import * from hagia.utils.hstrings import * from hagia.utils.hthread import *
27
34
0.792593
20
135
5.35
0.4
0.336449
0.523364
0.560748
0
0
0
0
0
0
0
0
0.118519
135
4
35
33.75
0.89916
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
01f193ad007e2d22a155f45c72269ad662fcd4a2
1,452
py
Python
gh_decode_k32imp.py
nrwall/eset_crackme_ghirdra
3a10a8e08863aceb106a8eca84bed8b21e7f6e71
[ "Apache-2.0" ]
null
null
null
gh_decode_k32imp.py
nrwall/eset_crackme_ghirdra
3a10a8e08863aceb106a8eca84bed8b21e7f6e71
[ "Apache-2.0" ]
null
null
null
gh_decode_k32imp.py
nrwall/eset_crackme_ghirdra
3a10a8e08863aceb106a8eca84bed8b21e7f6e71
[ "Apache-2.0" ]
null
null
null
#@narwhal #@category ESET_Crackme #@keybinding #@menupath #@toolbar #Markup for Wrapper listing = currentProgram.getListing() loc = 0x401c79 # get all code references made to the function refs = getReferencesTo(toAddr(loc)) for r in refs: callee = r.getFromAddress() inst = getInstructionAt(callee) if "CALL" in inst.toString(): while "PUSH" not in inst.toString(): inst = getInstructionBefore(inst) hash = inst.toString().lstrip("PUSH ") with open("C:\Users\user\Desktop\hashed_exports.txt") as elist: for line in elist: if hash in line: codeUnit = listing.getCodeUnitAt(inst.getAddress()) codeUnit.setComment(codeUnit.EOL_COMMENT,line.rstrip('\n')) #Markup without Wrapper loc = 0x401c03 # get all code references made to the function refs = getReferencesTo(toAddr(loc)) for r in refs: callee = r.getFromAddress() inst = getInstructionAt(callee) if ("CALL" in inst.toString()) & (inst.address.toString() != "00401c95"): while "PUSH" not in inst.toString(): inst = getInstructionBefore(inst) hash = inst.toString().lstrip("PUSH ") with open("C:\Users\user\Desktop\hashed_exports.txt") as elist: for line in elist: if hash in line: codeUnit = listing.getCodeUnitAt(inst.getAddress()) codeUnit.setComment(codeUnit.EOL_COMMENT,line.rstrip('\n'))
36.3
76
0.64876
170
1,452
5.511765
0.382353
0.076841
0.059765
0.057631
0.821772
0.821772
0.821772
0.821772
0.821772
0.821772
0
0.017102
0.234848
1,452
40
77
36.3
0.826283
0.131543
0
0.827586
0
0
0.097199
0.065898
0
0
0.01318
0
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
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
01f848305bf8318a1600eb6b4c85783a4ae95520
41,299
py
Python
lockstep/firewall/ufw.py
JasonYao/lockstep
2f2cd9c21758837a5ab4b16efef2fa3398df56df
[ "Apache-2.0" ]
null
null
null
lockstep/firewall/ufw.py
JasonYao/lockstep
2f2cd9c21758837a5ab4b16efef2fa3398df56df
[ "Apache-2.0" ]
1
2022-01-16T10:04:53.000Z
2022-01-16T10:04:53.000Z
lockstep/firewall/ufw.py
JasonYao/lockstep
2f2cd9c21758837a5ab4b16efef2fa3398df56df
[ "Apache-2.0" ]
null
null
null
from lockstep.core import FirewallTarget from lockstep.core import FirewallChange def get_all_entries() -> dict[str, FirewallTarget]: """ Returns a list of all lockstep-managed firewall entries, in a dictionary mapping where: - The key is the namespace of the firewall group - The value is the scraping target information Later on, add in the ability to speed this up by providing a mechanism for caching the entries """ # TODO implement # return {"GitHub Actions IP Ranges": FirewallTarget(namespace="GitHub Actions IP Ranges", affected_targets=['13.105.49.22/31', '40.125.64.0/18', '20.84.128.0/17', '40.90.131.192/27', '52.112.106.0/9999', '52.148.128.0/18', '20.60.14.0/24', '13.67.153.0/28', '20.120.0.0/17', '104.210.0.0/20', '13.105.74.32/28', '52.239.168.0/22', '20.83.128.0/18', '199.7.166.16/28', '2a01:111:f403:c92d::/64', '52.108.186.0/24', '23.100.32.0/20', '20.135.188.0/22', '40.76.0.0/16', '53.103.139.0/24', '2603:1062:2:80::/57', '40.83.25.0/24', '157.55.48.0/24', '13.104.208.64/27', '52.225.128.0/21', '40.84.128.0/17', '40.123.145.72/29', '40.90.21.128/25', '52.114.132.0/22', '40.87.183.0/28', '52.185.56.128/27', '131.253.24.192/26', '40.90.143.0/27', '2603:1030:a09::/56', '20.44.16.0/21', '199.30.29.0/24', '52.225.136.0/27', '40.123.145.24/29', '2a01:111:f403:d100::/64', '40.87.171.166/31', '138.91.96.0/19', '20.150.107.0/24', '20.190.157.0/24', '40.87.171.240/29', '2603:1030:20e::/48', '52.115.60.0/23', '65.54.19.128/27', '40.87.177.120/31', '13.105.97.0/27', '199.30.27.0/25', '2603:1030:401:254::/63', '13.105.36.64/27', '13.105.23.64/26', '40.123.144.128/28', '168.61.64.0/20', '168.61.128.192/26', '2603:1030:401:124::/62', '20.47.108.0/23', '52.185.120.0/21', '52.120.64.0/19', '20.190.153.0/24', '40.87.176.160/29', '65.55.44.8/29', '40.87.171.8/29', '20.202.120.0/22', '199.7.166.8/29', '40.91.14.0/24', '65.55.146.0/24', '13.105.17.128/26', '23.102.202.0/24', '65.55.44.112/28', '191.238.144.0/20', '2603:1030:9:80::/59', '2603:1030:400::/48', '20.47.31.0/24', '20.83.0.0/18', '20.209.18.0/23', '40.86.128.0/19', '13.105.49.96/31', '52.152.128.0/17', '40.87.169.44/30', '2a01:111:f403:d804::/62', '20.40.24.0/21', '13.104.152.128/25', '20.150.70.0/24', '40.90.130.96/28', '157.55.204.34/31', '40.87.183.56/29', '2603:1030:9:140::/59', '20.106.0.0/18', '20.157.145.0/24', '40.87.169.56/31', '168.61.130.64/26', '40.90.129.224/27', '2603:1030:9:1c0::/60', '65.55.44.64/27', '13.105.14.128/26', '52.103.8.0/24', '40.90.148.128/27', '52.191.128.0/18', '40.87.178.0/24', '20.44.8.0/21', '104.210.176.0/20', '52.115.93.0/24', '52.137.128.0/17', '40.123.0.0/17', '2a01:111:f403:c111::/64', '40.93.196.0/23', '13.105.49.152/31', '52.101.50.0/24', '40.84.0.0/17', '52.108.166.0/23', '13.105.49.82/31', '52.239.157.128/26', '2603:1030:a00::/46', '23.102.208.0/20', '65.55.107.64/27', '40.90.140.160/27', '40.79.205.96/27', '40.87.180.240/29', '2603:1030:804:b0::/62', '20.157.17.0/24', '2603:1030:804:b6::/63', '52.108.208.0/21', '2603:1030:804:e0::/59', '2a01:111:f403:d108::/62', '52.121.36.0/22', '157.55.154.128/25', '40.65.64.0/18', '52.114.172.0/22', '13.105.49.100/31', '137.116.112.0/20', '23.99.64.0/19', '40.87.171.168/29', '40.87.181.176/29', '40.77.171.0/24', '40.77.230.0/24', '157.55.50.0/25', '52.156.128.0/19', '13.67.156.0/22', '20.60.88.0/22', '2603:1036:3000:140::/59', '40.79.16.0/20', '2a01:111:f403:d908::/62', '52.120.96.0/19', '13.105.18.160/27', '40.122.32.0/19', '40.87.177.212/30', '2603:1030:401:14::/63', '40.87.176.128/27', '104.44.91.32/27', '40.87.171.176/28', '23.102.128.0/18', '20.157.142.0/23', '40.87.169.48/29', '2603:1030:40c::/48', '40.119.0.0/18', '2603:1030:9:1a0::/59', '52.246.0.0/17', '52.114.186.0/23', '13.105.66.192/26', '23.100.120.0/21', '40.77.234.192/27', '40.79.49.0/24', '20.186.0.0/17', '2a01:111:f403:c91e::/63', '2603:1030:401:18::/61', '13.105.17.64/26', '13.105.49.68/31', '52.249.0.0/18', '2603:1030:401:a7::/64', '40.77.178.0/23', '2603:1030:406::/47', '2603:1030:401:90::/63', '40.90.136.16/28', '20.60.132.0/23', '65.52.111.0/24', '2a01:111:f403:d104::/62', '2603:1030:a07::/48', '40.77.250.0/24', '2a01:111:f403:c804::/62', '52.239.177.64/26', '70.37.8.0/22', '13.105.49.2/31', '2603:1030:20c::/47', '2603:1030:a06::/48', '52.111.245.0/24', '40.90.144.0/27', '2603:1030:a08::/48', '104.47.208.0/23', '53.103.140.0/24', '157.56.21.160/27', '40.87.180.128/26', '199.30.24.0/23', '23.101.144.0/20', '2a01:111:f403:c004::/62', '52.165.96.0/21', '52.112.105.0/24', '52.171.0.0/16', '104.44.88.0/27', '2603:1037:1:140::/59', '52.238.0.0/18', '52.239.207.64/26', '13.105.49.48/31', '131.253.13.96/30', '40.87.168.212/30', '52.245.24.0/22', '52.239.192.160/27', '65.55.51.0/24', '2603:1030:401:120::/64', '2603:1030:401:17c::/62', '40.123.145.68/30', '157.55.55.100/30', '40.87.181.32/27', '20.49.120.0/21', '40.78.219.0/24', '40.87.177.160/27', '2603:1030:401:1c8::/63', '20.64.0.0/17', '52.143.207.0/24', '40.87.170.240/29', '13.105.49.94/31', '2603:1036:3000:e0::/59', '40.77.224.96/27', '20.150.30.0/24', '2603:1030:401:1e0::/60', '52.253.64.0/20', '2603:1030:9:12f::/64', '2603:1030:401:2a8::/63', '20.136.2.0/24', '52.143.197.0/24', '52.111.246.0/24', '52.101.62.0/23', '52.165.48.0/28', '40.90.145.160/27', '52.115.192.0/19', '40.77.161.64/26', '13.105.49.106/31', '20.47.120.0/23', '20.135.74.0/23', '52.184.128.0/19', '52.108.78.0/24', '20.157.40.0/24', '168.62.64.0/19', '20.135.16.0/23', '23.102.204.0/22', '2a01:111:f403:e004::/62', '40.123.152.0/22', '40.87.171.224/28', '157.55.176.0/20', '2603:1030:9:18::/61', '40.87.182.64/26', '40.77.186.0/23', '40.90.128.224/28', '20.69.64.0/18', '157.56.176.0/21', '52.228.128.0/17', '20.42.160.0/23', '40.87.181.152/31', '2603:1037:1:c0::/59', '40.83.128.0/17', '40.87.169.104/29', '20.157.132.0/24', '40.87.176.240/28', '65.54.55.224/27', '52.112.95.0/24', '52.103.134.0/24', '52.115.88.0/22', '13.90.0.0/16', '20.209.26.0/23', '2603:1030:9:b7::/64', '20.22.0.0/16', '2603:1036:2409::/48', '13.105.49.44/31', '20.157.62.0/23', '40.77.130.128/26', '40.90.130.192/28', '13.104.208.192/26', '52.185.48.0/21', '20.96.0.0/16', '40.87.176.224/29', '13.92.0.0/16', '2603:1036:2404::/48', '52.111.239.0/24', '40.87.182.32/28', '40.87.168.192/28', '20.135.222.0/23', '13.105.18.192/26', '40.77.130.0/25', '40.90.155.0/26', '20.157.48.0/23', '40.91.12.160/27', '40.77.202.0/24', '23.99.128.0/17', '52.185.64.0/19', '40.77.182.16/28', '20.60.2.0/23', '2603:1030:809::/48', '20.49.0.0/18', '13.68.128.0/17', '13.105.49.116/31', '52.115.84.0/22', '2603:1030:503::/48', '40.87.180.96/27', '52.225.0.0/17', '20.157.32.0/24', '40.77.175.192/27', '2603:1039:205::/48', '40.87.169.136/31', '104.209.0.0/18', '52.141.192.0/19', '20.157.61.0/24', '20.150.128.0/17', '20.150.82.0/24', '2603:1030:401:128::/61', '20.127.0.0/16', '13.93.128.0/17', '2603:1030:401:160::/61', '104.44.94.48/28', '20.157.59.0/24', '131.253.13.128/27', '40.93.2.0/24', '208.78.110.56/29', '20.202.34.0/24', '20.88.128.0/18', '40.91.13.128/27', '131.253.36.224/27', '2603:1030:401:10::/62', '2603:1030:40a:2::/64', '13.105.49.164/31', '40.77.255.128/26', '2603:1036:2407::/48', '52.239.180.0/22', '40.75.64.0/18', '20.38.98.0/24', '2603:1030:401:20::/59', '40.83.16.0/21', '40.77.129.0/24', '13.105.49.56/31', '20.85.0.0/17', '2603:1030:401:8f::/64', '2603:1037:1:120::/59', '13.67.155.0/24', '40.77.249.0/24', '40.126.3.0/24', '40.91.13.96/28', '40.126.27.0/24', '40.123.144.64/29', '20.60.148.0/23', '52.239.203.0/24', '40.79.206.160/27', '52.245.44.0/24', '65.55.44.96/28', '52.185.0.0/19', '40.77.137.0/25', '52.102.129.0/24', '13.105.49.16/31', '13.105.49.180/31', '52.239.198.192/26', '20.88.96.0/19', '13.105.19.128/25', '40.69.128.0/18', '20.38.32.0/20', '104.44.88.160/27', '2603:1030:9:b8::/63', '52.101.48.0/23', '52.101.60.0/24', '40.126.62.128/25', '52.123.1.0/24', '40.87.180.28/30', '40.77.248.0/25', '168.61.129.208/28', '40.123.145.6/31', '65.55.32.224/28', '20.95.24.0/21', '2603:1030:804:d4::/62', '40.87.169.0/27', '2603:1030:401:1cc::/62', '20.190.190.128/25', '52.253.184.0/24', '40.77.251.0/24', '191.236.64.0/18', '2a01:111:f403:d10c::/62', '13.105.49.166/31', '13.105.66.64/26', '40.77.164.0/24', '52.112.76.0/22', '40.87.177.216/29', '40.91.0.0/22', '20.60.244.0/23', '104.214.0.0/17', '20.135.8.0/22', '40.87.181.164/30', '2603:1030:500::/47', '52.151.128.0/17', '40.90.22.128/25', '40.87.168.8/29', '157.56.3.128/25', '40.90.25.0/26', '40.90.141.0/27', '52.115.62.0/23', '2603:1030:804:b4::/64', '40.87.177.124/30', '2603:1030:9:1e4::/63', '52.191.0.0/17', '52.254.112.0/21', '40.77.167.0/24', '131.253.40.0/28', '52.226.0.0/16', '70.37.64.0/18', '2603:1030:401:14c::/62', '40.90.148.176/28', '40.82.36.0/22', '20.42.168.0/21', '52.108.0.0/21', '131.253.40.128/27', '2603:1030:40d:8000::/49', '20.59.64.0/18', '40.123.145.56/30', '52.239.184.192/27', '52.239.254.0/23', '13.105.20.192/26', '40.79.32.0/20', '13.105.49.4/31', '40.90.153.96/27', '131.253.13.48/28', '104.210.128.0/19', '2603:1030:9:1e0::/62', '40.90.27.64/26', '40.91.12.208/28', '157.55.80.0/21', '52.115.68.0/22', '65.55.217.0/24', '2603:1030:401:1f0::/61', '20.202.21.0/24', '168.61.32.0/20', '40.90.152.160/27', '13.105.96.64/27', '13.105.49.168/31', '191.236.0.0/18', '20.60.52.0/23', '20.62.0.0/17', '52.180.185.0/24', '40.90.148.0/26', '168.61.129.224/27', '40.90.16.128/27', '2a01:111:f403:c90c::/62', '20.202.31.0/24', '2a01:111:f403:c923::/64', '13.105.101.48/28', '13.67.153.64/26', '52.143.64.0/18', '13.105.28.0/28', '2603:1030:401:87::/64', '52.189.128.0/18', '104.44.92.224/27', '40.71.0.0/16', '52.102.136.0/24', '2603:1030:40a:1::/64', '20.150.93.0/24', '20.202.28.0/23', '40.83.28.0/22', '40.82.4.0/22', '13.105.49.174/31', '13.105.49.26/31', '40.87.180.202/31', '65.55.250.0/24', '52.245.69.64/27', '20.41.0.0/18', '20.135.18.0/23', '2603:1030:9:170::/60', '40.87.181.16/28', '52.115.56.0/22', '2603:1030:9:4::/62', '2a01:111:f403:c000::/64', '13.105.49.32/31', '20.47.110.0/24', '40.87.169.128/29', '2603:1030:401:40::/60', '65.55.213.128/26', '40.126.5.0/24', '52.239.177.32/27', '52.165.64.0/19', '199.19.85.64/29', '157.55.55.136/29', '40.90.133.112/28', '20.39.32.0/19', '40.77.184.0/25', '13.105.36.128/26', '40.90.144.64/26', '52.115.52.0/23', '23.100.240.0/20', '40.87.171.128/27', '20.60.152.0/23', '40.78.221.0/24', '104.208.0.0/19', '52.239.220.0/23', '20.38.208.0/22', '2603:1030:e01:2::/64', '52.114.184.0/23', '40.122.128.0/17', '40.90.22.0/25', '20.135.216.0/22', '2603:1030:401:2::/63', '131.253.34.224/27', '40.87.180.204/30', '40.87.171.96/27', '2603:1030:804:53::/64', '2a01:111:f403:f908::/62', '199.19.85.48/28', '2603:1030:d::/48', '20.80.128.0/18', '20.115.128.0/17', '40.90.136.32/27', '52.108.16.0/21', '104.44.128.0/18', '20.143.2.0/24', '52.103.131.0/24', '40.122.16.0/20', '2603:1030:401:2ac::/62', '40.90.138.208/28', '2603:1030:804:67::/64', '20.118.128.0/18', '40.77.132.0/24', '104.45.128.0/18', '157.55.204.2/31', '20.49.104.0/21', '52.123.2.0/24', '2603:1030:401:60::/59', '2603:1030:401:88::/62', '13.105.27.0/25', '52.184.168.96/27', '40.74.192.0/18', '52.180.0.0/17', '52.114.144.0/22', '2603:1030:804:68::/61', '40.87.170.152/29', '52.239.199.0/24', '52.103.136.0/24', '168.61.129.0/25', '20.60.68.0/22', '52.245.46.160/27', '20.60.240.0/23', '13.82.0.0/16', '52.151.0.0/18', '13.105.49.30/31', '168.61.160.0/19', '40.123.145.160/30', '40.126.0.0/24', '52.239.234.0/23', '20.135.200.0/22', '40.117.64.0/18', '104.44.94.0/28', '52.115.80.0/22', '65.52.108.0/23', '52.253.154.0/23', '40.87.168.72/29', '104.44.94.80/28', '40.91.13.64/27', '40.90.23.128/25', '40.87.170.232/29', '65.55.107.96/27', '2a01:111:f403:c92c::/64', '52.149.0.0/18', '40.77.182.0/28', '52.101.41.0/24', '52.109.12.0/22', '40.87.170.194/31', '40.123.145.188/31', '2603:1030:c04::/48', '20.60.64.0/22', '23.101.128.0/20', '40.87.170.160/28', '52.239.192.192/26', '2603:1030:804:a4::/64', '168.62.192.0/19', '52.239.158.0/23', '40.77.175.96/27', '20.150.78.0/24', '20.190.155.0/24', '52.150.0.0/17', '20.109.192.0/18', '20.118.64.0/18', '13.87.128.0/17', '191.238.70.0/23', '2603:1030:9:100::/64', '52.185.56.96/28', '157.55.103.32/27', '52.239.172.0/22', '52.103.13.0/24', '20.102.0.0/17', '40.77.182.192/26', '104.44.88.96/27', '40.87.183.42/31', '52.239.193.0/24', '52.114.180.0/22', '52.232.160.0/19', '2603:1030:40e::/56', '52.123.0.0/24', '52.254.64.0/19', '104.44.95.160/27', '23.101.32.0/21', '13.67.144.0/21', '2603:1030:9:b4::/63', '52.239.246.0/23', '40.83.32.0/19', '131.253.41.0/24', '134.170.222.0/24', '13.105.23.0/26', '40.79.206.64/27', '40.79.8.96/28', '137.135.0.0/18', '2a01:111:f403:c930::/63', '2603:1030:401:8::/61', '40.90.128.128/28', '13.105.49.70/31', '65.55.35.192/27', '2a01:111:f403:d004::/62', '13.105.49.66/31', '2603:1030:401:c0::/58', '40.90.146.0/28', '40.87.170.248/30', '13.104.158.64/26', '52.245.46.0/27', '2603:1030:9:bd::/64', '13.105.49.84/31', '20.60.38.0/23', '52.125.132.0/22', '40.64.64.0/18', '2603:1030:401:150::/62', '40.77.199.128/26', '52.158.192.0/19', '52.125.136.0/24', '137.135.64.0/18', '52.101.43.0/24', '137.116.176.0/21', '204.152.18.0/31', '65.55.219.32/27', '157.55.55.240/28', '104.47.200.0/21', '40.87.182.128/25', '13.105.37.0/26', '20.150.91.0/24', '40.77.185.128/25', '131.253.14.224/28', '2603:1030:9:11f::/64', '2a01:111:f403:c900::/64', '40.90.156.192/26', '40.123.144.224/28', '20.150.43.128/25', '40.79.207.80/28', '52.102.137.0/24', '40.78.217.0/24', '20.150.20.128/25', '2603:1030:804:60::/62', '20.185.0.0/16', '40.79.205.64/28', '40.77.237.64/26', '23.101.192.0/20', '40.83.24.0/26', '2603:1030:9:20::/59', '20.150.38.0/23', '137.116.96.0/22', '40.90.27.128/26', '52.143.193.0/24', '52.102.132.0/24', '40.90.139.192/27', '104.44.94.160/27', '52.101.16.0/22', '157.56.3.0/25', '20.60.160.0/23', '52.111.227.0/24', '2603:1030:9:104::/62', '52.180.184.32/28', '52.238.192.0/18', '20.44.64.0/18', '2a01:111:f403:d800::/64', '52.167.0.0/16', '138.91.128.0/17', '40.79.64.0/20', '40.123.144.192/27', '157.55.55.144/29', '13.105.75.32/28', '23.98.45.0/24', '52.102.139.0/24', '52.102.140.0/24', '20.47.69.0/24', '2603:1030:401:220::/62', '52.232.151.0/24', '40.90.149.96/27', '40.87.181.8/29', '40.93.12.0/24', '20.157.106.0/24', '40.87.183.24/30', '65.55.105.0/26', '52.239.156.0/24', '13.67.152.0/24', '52.103.10.0/24', '157.55.192.0/21', '13.105.49.108/31', '52.138.80.0/21', '52.147.160.0/19', '40.79.92.0/24', '40.78.208.48/28', '2603:1030:401:16c::/64', '52.239.200.0/23', '40.87.170.184/30', '52.101.20.0/22', '104.46.0.0/21', '70.37.48.0/20', '40.77.197.0/24', '52.103.4.0/24', '2a01:111:f100:2000::/52', '52.239.236.0/23', '52.101.61.0/24', '40.87.183.248/29', '2603:1030:c07::/48', '13.105.98.192/28', '191.234.32.0/19', '40.123.145.48/29', '53.103.137.0/24', '40.90.24.128/25', '20.157.147.0/24', '40.87.171.2/31', '52.103.138.0/24', '2603:1037:1:1c0::/59', '65.55.105.96/27', '52.115.76.0/22', '20.60.232.0/23', '168.61.144.0/20', '157.55.106.0/26', '2603:1030:805::/48', '20.135.4.0/23', '20.157.104.0/24', '52.136.29.0/24', '52.101.9.0/24', '65.52.110.0/24', '40.80.192.0/19', '40.87.180.248/30', '52.245.46.48/28', '40.79.0.0/21', '52.101.44.0/23', '53.103.138.0/24', '52.190.128.0/17', '40.80.144.0/21', '52.185.96.0/20', '52.251.0.0/17', '20.60.128.0/23', '52.184.168.0/28', '40.90.19.128/25', '157.55.13.64/26', '13.105.49.170/31', '20.106.128.0/17', '168.63.88.0/23', '20.60.34.0/23', '20.60.20.0/24', '40.87.170.196/30', '40.90.140.96/27', '2603:1030:804:c8::/62', '2603:1030:401:a4::/63', '168.61.208.0/20', '13.105.49.154/31', '40.77.245.0/24', '40.75.128.0/17', '208.83.5.224/29', '40.90.131.224/27', '40.87.171.192/27', '40.87.171.248/31', '157.56.2.128/25', '52.154.64.0/18', '13.105.49.50/31', '20.184.64.0/18', '20.150.34.0/23', '2a01:111:f100:3000::/52', '52.101.4.0/22', '52.245.104.0/22', '20.98.64.0/18', '20.157.130.0/24', '40.123.144.144/29', '52.101.11.0/24', '20.60.146.0/23', '13.67.128.0/20', '2603:1030:402::/47', '20.190.133.0/24', '2603:1036:2500::/64', '40.87.180.0/30', '52.239.252.0/24', '52.176.192.0/19', '157.55.108.0/23', '40.87.180.32/29', '40.78.128.0/18', '131.253.14.208/28', '13.105.96.96/28', '13.77.64.0/18', '20.109.0.0/17', '23.96.0.0/17', '40.126.24.0/24', '20.47.16.0/23', '40.123.145.128/27', '20.81.0.0/17', '40.87.169.32/29', '52.234.0.0/17', '40.90.139.224/27', '40.90.156.128/26', '20.60.1.0/24', '20.65.128.0/17', '157.55.7.128/26', '40.87.176.216/29', '2603:1030:9:a0::/60', '52.108.79.0/24', '2603:1037:1:e0::/59', '52.245.8.0/22', '40.112.48.0/20', '2603:1036:2400::/48', '13.105.49.102/31', '40.70.128.0/17', '2603:1036:120d::/48', '40.90.138.160/27', '40.90.30.160/27', '40.87.181.162/31', '2a01:111:f403:c904::/62', '2603:1030:401:144::/63', '2603:1030:804:a8::/61', '40.79.8.0/27', '52.254.128.0/17', '52.255.128.0/17', '104.44.92.96/27', '40.90.134.192/26', '13.105.49.156/31', '20.157.50.0/23', '40.77.177.0/24', '20.80.192.0/18', '2603:1030:401:274::/63', '52.239.192.96/27', '40.82.44.0/22', '2603:1036:2500:18::/63', '52.230.128.0/17', '40.90.135.0/26', '40.123.144.112/28', '104.208.128.0/17', '52.245.69.192/26', '131.253.40.64/28', '13.105.60.32/28', '2603:1030:804:40::/60', '65.55.33.192/28', '2603:1030:9:1e6::/64', '131.253.12.208/28', '40.123.145.96/27', '2603:1030:804:b8::/61', '52.185.56.64/27', '20.38.96.0/23', '13.105.17.0/26', '40.87.176.0/25', '2603:1030:c06::/48', '40.87.177.144/29', '20.85.128.0/17', '20.120.128.0/17', '52.158.224.0/19', '2603:1030:401:98::/61', '104.44.91.160/27', '65.55.106.240/28', '40.79.56.0/21', '20.157.6.0/23', '40.90.135.128/25', '2a01:111:f100:5000::/52', '104.45.224.0/19', '13.105.49.172/31', '52.115.64.0/22', '2603:1030:401:8c::/63', '52.233.64.0/18', '52.109.8.0/22', '20.83.64.0/18', '13.104.222.0/24', '20.114.128.0/17', '20.150.72.0/24', '40.93.8.0/24', '2603:1030:401:226::/63', '13.105.49.126/31', '40.114.0.0/17', '2a01:111:f403:c91c::/63', '40.87.168.216/29', '52.102.135.0/24', '40.93.10.0/24', '40.78.224.0/21', '20.157.105.0/24', '13.66.0.0/17', '52.182.128.0/17', '52.239.210.0/23', '2603:1030:9:128::/62', '2a01:111:f403:d000::/64', '52.115.140.0/22', '20.65.0.0/17', '131.253.14.4/30', '2603:1030:401:25b::/64', '2603:1030:9:17::/64', '40.87.177.224/27', '13.105.49.6/31', '2603:1030:9:40::/58', '13.105.53.0/25', '20.36.128.0/17', '208.83.5.64/28', '52.112.117.0/24', '191.237.128.0/18', '131.253.15.16/28', '20.190.152.0/24', '40.90.144.128/26', '52.239.152.0/22', '52.185.56.160/28', '13.104.219.128/25', '40.90.20.0/25', '40.87.181.4/30', '2603:1036:3000:1c0::/59', '2603:1030:9:14::/63', '104.44.89.0/27', '13.105.74.48/28', '157.55.2.128/26', '40.93.4.0/24', '40.87.168.16/28', '52.165.49.0/24', '157.55.12.64/26', '20.60.162.0/23', '65.55.32.192/27', '20.38.100.0/23', '13.105.74.0/27', '40.77.240.0/25', '20.60.60.0/22', '2a01:111:f403:d904::/62', '23.101.80.0/21', '40.79.152.0/21', '40.87.183.192/27', '52.121.32.0/22', '2a01:111:f100:4002::/64', '13.73.32.0/19', '40.87.180.64/30', '40.87.179.96/28', '20.51.128.0/17', '20.98.192.0/18', '40.79.206.192/27', '40.93.14.0/24', '13.105.49.62/31', '40.87.181.168/29', '40.77.199.0/25', '23.98.128.0/17', '52.254.96.0/20', '2603:1036:2500:10::/64', '13.105.49.20/31', '20.95.0.0/21', '20.189.128.0/18', '20.201.224.0/23', '40.77.236.80/28', '131.253.14.128/27', '13.105.49.86/31', '40.90.142.240/28', '20.60.236.0/23', '40.126.26.0/24', '13.105.49.118/31', '40.89.224.0/19', '2603:1030:401:13a::/63', '52.253.148.0/23', '20.81.128.0/17', '20.72.128.0/18', '65.55.106.192/28', '52.101.52.0/22', '20.69.192.0/18', '40.87.182.56/30', '2603:1030:9:118::/62', '20.190.192.0/18', '13.105.49.90/31', '40.77.130.192/26', '52.115.72.0/22', '65.55.252.0/24', '2603:1030:401:154::/63', '52.103.5.0/24', '52.109.0.0/22', '20.38.160.0/20', '2603:1030:9:1d0::/62', '20.150.63.0/24', '13.105.98.160/27', '65.55.213.64/26', '52.136.64.0/18', '20.38.122.0/23', '52.249.128.0/17', '52.101.56.0/22', '40.87.169.60/30', '40.90.136.160/28', '40.87.168.224/27', '13.67.160.0/19', '65.55.107.48/28', '52.143.192.0/24', '20.47.60.0/23', '40.77.233.0/24', '52.184.168.128/28', '40.91.4.0/22', '104.44.92.64/27', '2603:1030:9:180::/61', '20.40.192.0/18', '40.126.25.0/24', '23.102.96.0/19', '157.55.11.128/25', '40.79.95.0/28', '52.103.14.0/24', '157.55.55.160/28', '157.56.2.0/25', '168.61.48.0/21', '13.105.27.192/27', '104.44.95.0/28', '40.83.26.0/23', '40.87.171.80/28', '168.62.128.0/19', '40.64.128.0/21', '52.102.138.0/24', '52.108.165.0/24', '40.90.142.128/27', '157.56.80.0/25', '193.149.64.0/21', '40.90.158.64/26', '52.101.42.0/24', '40.87.168.0/30', '20.114.64.0/18', '137.116.64.0/19', '2603:1030:804:100::/57', '2a01:111:f403:f900::/62', '52.103.3.0/24', '2603:1030:401:228::/61', '52.112.112.0/24', '52.141.64.0/18', '199.30.28.64/26', '13.66.128.0/17', '40.90.155.128/26', '2603:1030:9:2::/63', '52.159.128.0/17', '52.157.0.0/18', '2a01:111:f403:e000::/64', '13.105.101.32/28', '52.109.4.0/22', '2a01:111:f403:f804::/62', '40.87.181.184/31', '23.100.80.0/21', '131.253.14.8/31', '20.47.2.0/24', '40.126.29.0/24', '20.150.87.0/24', '2603:1036:2403::/48', '52.239.222.0/23', '52.152.0.0/17', '2a01:111:f403:f800::/62', '20.135.0.0/22', '13.86.0.0/17', '40.87.160.0/22', '13.104.208.128/27', '2a01:111:f403:c920::/63', '13.105.49.110/31', '52.239.184.0/25', '2a01:111:f403:c91a::/63', '20.60.48.0/22', '2603:1030:213::/48', '52.121.0.0/21', '52.143.211.0/24', '104.210.192.0/19', '40.90.148.96/27', '2603:1030::/45', '51.143.0.0/17', '20.47.24.0/23', '20.135.194.0/23', '20.150.32.0/23', '20.47.76.0/23', '40.91.12.64/26', '20.157.167.0/24', '40.87.168.210/31', '40.90.145.32/27', '104.45.208.0/20', '157.55.10.192/26', '40.87.180.76/30', '20.95.255.0/29', '40.90.143.192/26', '40.77.241.0/24', '2603:1030:401:a8::/61', '52.250.128.0/18', '13.105.49.40/31', '52.250.0.0/17', '2603:1030:9:b3::/64', '13.68.0.0/17', '40.77.136.48/28', '13.105.75.64/27', '40.87.179.64/27', '13.104.208.96/27', '40.121.0.0/16', '20.186.192.0/18', '20.38.104.0/23', '40.123.145.8/30', '20.157.134.0/24', '2603:1036:2405::/48', '13.105.49.8/31', '40.77.244.0/25', '20.94.0.0/17', '13.105.66.128/28', '40.90.145.64/27', '138.91.64.0/19', '2a01:111:f403:c800::/64', '20.190.131.0/24', '168.61.129.128/26', '2603:1030:9:10::/62', '40.87.180.80/28', '40.87.180.192/30', '40.79.9.0/24', '2603:1030:401:159::/64', '52.245.108.0/22', '65.55.32.128/28', '52.108.139.0/24', '52.112.115.0/24', '40.77.182.64/27', '2603:1030:804:80::/59', '52.179.0.0/17', '40.77.228.0/24', '20.190.128.0/24', '40.83.24.64/27', '13.105.98.48/28', '70.37.0.0/21', '40.87.176.232/31', '40.87.183.232/30', '40.87.171.160/31', '20.202.39.0/24', '20.201.223.0/24', '20.38.0.0/20', '157.56.19.224/27', '52.179.128.0/17', '40.78.214.0/24', '157.55.204.33/32', '2a01:111:f403:c918::/64', '52.245.69.32/27', '2603:1030:9:1db::/64', '131.253.13.88/30', '199.19.85.224/29', '52.165.56.0/21', '40.93.0.0/23', '65.55.207.0/24', '40.126.23.0/24', '2603:1030:9:8::/61', '52.247.0.0/17', '13.105.49.158/31', '204.152.18.8/29', '13.104.220.128/25', '157.55.153.224/28', '52.165.32.0/20', '40.90.129.128/26', '40.87.183.236/31', '52.239.176.128/25', '20.150.77.0/24', '52.103.9.0/24', '52.123.3.0/24', '20.136.0.128/25', '13.105.49.64/31', '2603:1030:401:27c::/62', '13.105.19.0/25', '52.102.131.0/24', '157.56.21.192/27', '65.55.219.64/26', '40.83.24.128/25', '40.80.160.0/24', '52.103.128.0/24', '20.69.128.0/18', '20.202.124.0/24', '20.45.120.0/21', '40.119.88.0/22', '52.102.128.0/24', '40.79.207.128/25', '40.77.163.0/24', '2603:1030:401:250::/62', '13.105.49.178/31', '52.115.160.0/19', '40.87.0.0/17', '40.118.128.0/17', '52.165.0.0/19', '52.185.56.0/26', '23.101.176.0/20', '40.86.160.0/19', '40.93.194.0/23', '40.79.91.0/28', '20.202.24.0/24', '40.91.12.16/28', '40.87.170.144/31', '13.105.66.32/27', '13.105.24.0/24', '20.143.4.0/24', '52.248.0.0/17', '40.79.80.0/21', '2603:1030:401:80::/62', '20.119.0.0/17', '13.89.0.0/16', '52.96.11.0/24', '20.184.128.0/17', '20.60.224.0/23', '20.157.54.0/24', '52.245.69.160/27', '2603:1030:40f::/48', '168.61.130.128/25', '157.56.160.0/21', '52.143.224.0/19', '20.109.128.0/18', '20.136.1.0/24', '40.123.145.184/30', '52.248.128.0/17', '52.101.64.0/24', '40.87.171.72/29', '191.238.0.0/18', '104.44.95.240/28', '137.117.64.0/18', '20.190.151.0/24', '52.147.192.0/18', '20.60.0.0/24', '52.239.177.128/25', '13.105.66.160/27', '40.123.144.0/26', '40.87.183.244/30', '20.98.128.0/18', '52.245.46.64/28', '20.150.58.0/24', '199.30.16.0/24', '20.106.64.0/18', '20.135.220.0/23', '13.105.49.176/31', '40.87.171.16/28', '40.77.136.64/28', '13.105.49.162/31', '52.103.132.0/24', '40.96.63.0/24', '13.105.25.0/24', '2602:fd5e:1:2::/64', '40.90.140.192/27', '52.247.192.0/18', '13.105.49.72/31', '13.105.49.92/31', '2603:1036:3000:100::/59', '52.235.64.0/18', '52.225.136.64/28', '2603:1030:401:58::/64', '2603:1030:401:a0::/62', '52.136.30.0/24', '2603:1030:806::/48', '2603:1037:1::/59', '2603:1030:401:15a::/63', '2603:1036:3000::/59', '20.112.0.0/17', '104.209.128.0/17', '40.90.139.32/27', '40.91.64.0/18', '2603:1030:401:143::/64', '20.201.231.0/24', '207.46.13.0/24', '2603:1030:401:5a::/63', '40.87.168.128/26', '13.105.49.112/31', '23.103.64.64/27', '131.253.13.80/29', '20.42.176.0/20', '40.77.200.0/25', '52.101.51.0/24', '52.241.0.0/16', '52.253.179.0/24', '40.87.180.48/28', '40.77.170.0/24', '20.97.0.0/17', '40.87.177.16/28', '20.135.232.0/23', '40.79.8.32/28', '40.90.23.0/25', '40.77.184.128/25', '52.253.180.0/24', '20.99.128.0/17', '2603:1030:807::/48', '2603:1030:80b::/48', '20.202.26.0/23', '40.87.181.64/26', '65.55.44.128/27', '13.105.49.34/31', '2603:1030:408::/48', '52.245.46.192/26', '52.245.46.128/28', '52.183.192.0/18', '20.202.32.0/23', '2603:1030:804:a0::/62', '52.101.12.0/22', '52.239.150.0/23', '40.123.144.240/29', '20.60.18.0/24', '20.59.0.0/18', '52.112.109.0/24', '2603:1030:401:100::/59', '52.253.182.0/23', '40.90.28.64/26', '20.36.0.0/19', '52.103.1.0/24', '2a01:111:f403:c928::/62', '20.150.50.0/23', '157.55.37.0/24', '104.44.95.128/27', '40.77.166.160/27', '13.105.53.192/26', '52.120.0.0/19', '13.91.0.0/16', '2602:fd5e:1::/63', '13.104.223.0/25', '40.123.145.176/29', '52.108.93.0/24', '199.30.22.0/24', '20.114.0.0/18', '40.90.158.128/25', '52.103.11.0/24', '20.124.0.0/16', '104.211.0.0/18', '40.87.181.144/29', '52.108.105.0/24', '13.67.153.128/25', '40.70.80.0/21', '13.104.220.0/25', '40.77.138.128/25', '40.91.13.240/28', '13.88.128.0/18', '20.157.39.0/24', '2603:1030:10::/47', '2603:1030:401:268::/61', '52.153.192.0/18', '40.77.138.0/25', '40.87.168.80/28', '2603:1030:401:2ab::/64', '13.67.153.32/27', '52.232.146.0/24', '52.176.0.0/17', '40.90.16.192/26', '20.190.132.0/24', '40.87.181.128/28', '2603:1036:903::/64', '2603:1030:804:54::/64', '20.150.29.0/24', '13.88.0.0/17', '2a01:111:f403:c922::/64', '40.82.16.0/22', '52.239.207.128/27', '20.38.99.0/24', '52.141.240.0/20', '40.87.169.160/27', '137.117.32.0/19', '2a01:111:f403:c924::/62', '191.239.0.0/18', '40.122.64.0/18', '52.239.192.64/28', '20.125.0.0/18', '20.95.16.0/21', '40.87.168.48/28', '52.239.206.0/24', '2603:1030:d00::/47', '20.97.128.0/17', '2a01:111:f403:c919::/64', '52.113.129.0/24', '52.245.45.192/26', '2603:1030:401:94::/62', '157.55.39.0/24', '52.115.144.0/20', '2a01:111:f403:c908::/62', '20.202.23.0/24', '13.105.98.96/27', '20.47.78.0/23', '131.253.12.228/30', '2603:1030:c00::/48', '157.55.51.224/28', '13.104.213.0/25', '23.100.16.0/20', '40.87.169.112/28', '52.245.69.96/28', '13.105.49.182/31', '40.90.131.32/27', '131.253.24.0/28', '52.114.148.0/22', '168.61.0.0/19', '40.90.154.64/26', '13.105.49.12/31', '20.157.164.0/24', '13.104.129.64/26', '104.46.96.0/19', '13.104.211.0/25', '104.208.32.0/20', '2603:1030:9:114::/64', '23.98.47.0/24', '40.87.168.96/27', '65.54.55.160/27', '20.57.128.0/18', '40.77.136.0/28', '52.109.20.0/22', '2603:1030:802::/47', '40.79.93.0/28', '40.87.183.36/30', '52.101.0.0/22', '40.80.152.0/21', '193.149.72.0/21', '65.55.211.32/27', '52.253.160.0/24', '13.105.49.24/31', '40.77.234.224/27', '20.110.0.0/16', '52.112.104.0/24', '40.87.169.192/26', '40.126.6.0/24', '52.115.48.0/22', '2603:1030:401:84::/64', '65.55.209.128/26', '40.77.199.192/26', '40.90.25.192/26', '2603:1030:9:120::/61', '40.96.50.0/24', '52.112.114.0/24', '52.239.207.32/28', '20.209.4.0/23', '40.77.128.128/25', '131.253.14.192/29', '20.84.0.0/17', '40.87.182.4/30', '70.37.16.0/20', '52.245.68.0/24', '52.156.64.0/18', '104.215.64.0/18', '13.105.49.76/31', '40.70.64.0/20', '52.108.102.0/23', '13.105.67.128/25', '20.202.22.0/24', '2603:1030:a0a::/48', '52.180.128.0/19', '40.78.216.0/24', '40.90.148.192/27', '40.87.182.8/29', '40.87.179.0/26', '168.61.132.0/26', '40.90.18.128/26', '2603:1030:800::/48', '52.103.130.0/24', '40.77.224.128/25', '157.55.55.232/29', '40.78.0.0/17', '52.184.170.0/24', '13.104.215.0/25', '52.225.136.32/28', '40.123.144.248/30', '13.105.49.42/31', '52.108.104.0/24', '20.62.128.0/17', '40.87.177.112/29', '20.55.0.0/17', '104.43.128.0/17', '2a01:111:f403:c110::/64', '40.90.132.48/28', '40.93.192.0/24', '40.124.0.0/16', '20.190.130.0/24', '2603:1062:2::/57', '104.44.91.0/27', '104.41.128.0/19', '20.47.100.0/24', '52.250.192.0/18', '20.80.64.0/18', '20.150.102.0/24', '52.239.157.192/27', '209.240.212.0/23', '40.90.146.32/27', '40.123.145.22/31', '52.176.224.0/24', '13.104.192.0/21', '20.118.0.0/18', '2603:1036:d20::/64', '131.253.14.16/28', '52.108.216.0/22', '40.77.172.0/24', '131.253.38.0/27', '20.157.57.0/24', '13.104.217.0/25', '157.55.38.0/24', '40.79.48.0/27', '131.253.38.128/26', '2603:1030:804:d2::/63', '20.75.0.0/17', '52.232.157.0/24', '20.51.8.0/21', '20.191.64.0/18', '137.117.0.0/19', '52.112.24.0/21', '40.67.160.0/19', '40.90.137.224/27', '40.126.4.0/24', '2603:1030:804:d8::/61', '65.52.32.0/21', '40.77.139.128/25', '20.83.192.0/18', '40.112.128.0/17', '2603:1030:401:280::/59', '20.60.220.0/23', '13.105.49.58/31', '13.65.0.0/16', '52.101.28.0/22', '65.55.60.188/30', '40.90.132.192/26', '40.79.240.0/20', '131.253.13.24/29', '52.252.0.0/17', '52.184.160.0/21', '2603:1030:804:a6::/63', '20.60.194.0/23', '20.88.192.0/18', '13.104.145.0/26', '157.55.204.1/32', '13.105.49.88/31', '40.77.254.128/25', '65.55.105.160/27', '13.104.144.64/27', '40.87.168.32/29', '40.117.32.0/19', '131.253.12.224/30', '40.90.151.144/28', '23.101.112.0/20', '40.87.183.64/26', '52.160.0.0/16', '52.239.157.0/25', '2603:1030:401:240::/60', '104.44.89.128/27', '40.77.162.0/24', '52.112.116.0/24', '40.87.183.44/30', '20.51.64.0/18', '2603:1030:c05::/48', '2603:1030:401:2b0::/62', '20.119.128.0/17', '2603:1030:9:c0::/58', '40.81.0.0/20', '52.123.5.0/24', '65.52.112.0/20', '191.238.224.0/19', '20.57.0.0/17', '40.87.169.96/31', '53.103.136.0/24', '20.60.168.0/23', '52.101.32.0/22', '2a01:111:f403:f90c::/62', '40.87.180.16/30', '40.77.0.0/17', '199.30.27.160/27', '40.77.175.64/27', '104.44.91.96/27', '2603:1030:504::/47', '13.77.128.0/18', '52.115.54.0/24', '52.255.0.0/19', '40.77.180.0/23', '20.150.88.0/24', '2a01:111:f403:f904::/62', '20.157.19.0/24', '52.165.104.0/25', '40.90.26.128/25', '199.30.31.192/26', '40.77.160.0/27', '2603:1030:9:1dc::/62', '13.105.101.64/26', '52.239.198.0/25', '40.79.90.0/24', '157.55.200.0/22', '52.111.230.0/24', '20.122.0.0/16', '52.102.158.0/24', '20.46.224.0/19', '52.232.149.0/24', '2603:1030:804:70::/60', '20.150.90.0/24', '40.87.169.140/30', '52.239.214.0/23', '52.125.128.0/22', '52.108.185.0/24', '52.125.137.0/24', '13.105.36.32/28', '2603:1030:212::/56', '40.87.177.32/27', '40.82.24.0/22', '20.186.128.0/18', '2603:1030:c02::/47', '2603:1030:804:180::/59', '2603:1030:9:18c::/62', '2603:1030:401:180::/58', '40.79.48.32/28', '52.184.169.0/24', '40.87.177.64/27', '52.173.0.0/16', '204.152.18.32/27', '23.99.0.0/18', '70.37.160.0/21', '20.202.30.0/24', '40.90.146.64/26', '40.113.192.0/18', '2603:1030:401:263::/64', '191.237.0.0/17', '2603:1030:401:2b4::/63', '2603:1030:804:5b::/64', '191.238.160.0/19', '40.87.182.48/29', '20.121.0.0/16', '2603:1030:401:256::/64', '157.55.55.228/30', '13.105.49.52/31', '2a01:111:f403:d90c::/62', '40.123.144.252/31', '52.176.160.0/21', '40.87.183.160/27', '65.55.144.0/23', '40.90.192.0/19', '2603:1030:401:b0::/60', '52.185.32.0/20', '104.45.192.0/20', '20.60.80.0/23', '52.108.248.0/21', '2603:1030:9:16f::/64', '40.87.232.0/21', '199.30.18.0/23', '52.191.192.0/18', '52.114.128.0/22', '65.55.33.176/28', '104.44.94.16/28', '20.115.0.0/17', '204.152.19.0/24', '2603:1030:804:5c::/62', '52.103.6.0/24', '2603:1036:2500:24::/64', '13.105.49.74/31', '40.90.136.224/27', '13.105.36.0/27', '52.142.0.0/18', '13.86.128.0/17', '104.44.89.192/27', '20.64.128.0/17', '2603:1030:9:160::/61', '40.90.148.64/27', '20.57.192.0/19', '40.77.240.128/25', '168.62.0.0/19', '20.188.64.0/19', '52.242.64.0/18', '13.105.49.38/31', '40.85.160.0/19', '52.180.184.0/27', '104.46.192.0/20', '40.82.248.0/21', '199.30.28.128/25', '20.150.95.0/24', '2a01:111:f403:c914::/62', '40.87.170.176/29', '40.88.0.0/16', '40.77.137.128/26', '52.253.0.0/18', '40.87.180.42/31', '40.93.193.0/24', '52.102.134.0/24', '13.104.214.128/25', '2a01:111:f403:c100::/64', '40.77.169.0/24', '13.83.0.0/16', '2603:1036:2500:14::/64', '52.113.16.0/20', '20.95.32.0/21', '13.105.17.192/26', '40.77.131.0/25', '40.87.170.228/30', '20.190.154.0/24', '40.87.176.174/31', '20.75.128.0/17', '2603:1030:804:cc::/63', '65.55.44.16/28', '2603:1030:401:15c::/62', '20.135.6.0/23', '191.236.192.0/18', '13.64.0.0/16', '40.90.30.192/26', '13.105.75.0/27', '2603:1036:2500:38::/64', '52.245.52.0/22', '65.55.110.0/24', '52.242.128.0/17', '13.105.49.80/31', '40.91.12.128/28', '52.123.4.0/24', '168.61.128.0/25', '52.232.159.0/24', '104.210.32.0/19', '2603:1030:9:11c::/63', '40.77.166.192/26', '2603:1030:804::/58', '40.126.2.0/24', '52.120.32.0/19', '131.253.13.72/29', '65.55.219.128/25', '52.158.160.0/20', '40.83.0.0/20', '20.37.128.0/18', '2603:1030:401:1d0::/60', '13.105.49.78/31', '65.55.120.0/24', '168.61.131.128/25', '20.42.0.0/17', '52.184.168.80/28', '13.105.14.0/25', '52.224.0.0/16', '2603:1030:401:1f8::/64', '20.60.178.0/23', '131.253.12.160/28', '20.47.116.0/24', '52.232.152.0/24', '52.189.0.0/17', '52.245.45.0/25', '40.77.168.0/24', '13.105.60.0/27', '40.79.204.160/27', '40.91.16.0/22', '2603:1030:401:25e::/64', '52.103.139.0/24', '40.87.171.36/30', '40.87.180.4/31', '40.85.144.0/20', '40.90.224.0/19', '52.115.55.0/24', '40.77.247.0/24', '20.66.0.0/17', '20.143.0.0/24', '20.47.58.0/23', '52.168.0.0/16', '20.157.163.0/24', '52.153.64.0/18', '40.90.130.64/28', '2a01:111:f403:c92e::/63', '2a01:111:f403:e00c::/62', '13.105.36.192/26', '20.157.34.0/23', '13.105.49.60/31', '40.87.177.156/30', '52.185.112.96/27', '20.47.62.0/23', '65.55.107.0/28', '40.65.0.0/18', '40.87.180.208/28', '52.185.112.0/26', '52.239.195.0/24', '52.170.0.0/16', '40.74.160.0/19', '2603:1030:401:20c::/62', '2603:1030:401:1c0::/61', '13.105.49.10/31', '40.87.180.224/28', '40.77.225.0/24', '2603:1030:804:c0::/61', '40.78.220.0/24', '40.87.170.0/25', '40.93.5.0/24', '52.113.208.0/20', '40.77.198.128/25', '40.87.180.44/30', '20.202.36.0/23', '52.183.0.0/17', '40.87.183.224/29', '52.101.8.0/24', '13.105.28.128/25', '2603:1030:401:27a::/63', '40.87.183.34/31', '52.101.10.0/24', '13.105.49.18/31', '104.44.88.32/27', '168.61.128.160/27', '2603:1030:9:190::/60', '65.55.209.0/25', '2a01:111:f403:f000::/64', '40.90.136.0/28', '52.103.129.0/24', '52.108.72.0/24', '52.239.148.128/25', '20.189.0.0/18', '13.105.98.224/27', '2603:1030:9:111::/64', '20.150.79.0/24', '20.209.0.0/23', '2603:1030:9:1d4::/63', '20.49.88.0/21', '40.87.180.74/31', '20.190.134.0/24', '52.246.192.0/18', '13.72.64.0/18', '2603:1030:401:14a::/63', '104.40.0.0/17', '52.111.229.0/24', '40.77.198.0/26', '2a01:111:f403:c10c::/62', '199.19.85.24/29', '20.47.1.0/24', '52.239.0.0/17', '23.102.192.0/21', '2603:1030:9:112::/63', '20.60.6.0/23', '65.55.44.32/27', '40.87.170.214/31', '40.79.206.128/27', '137.116.0.0/18', '52.149.128.0/17', '2603:1030:9:130::/60', '23.100.64.0/21', '40.93.13.0/24', '40.123.145.168/29', '23.102.203.0/24', '131.253.13.16/29', '40.77.131.128/26', '20.125.64.0/18', '131.253.15.192/28', '40.126.202.0/24', '52.185.192.0/18', '20.60.140.0/23', '2603:1036:240c::/48', '52.239.185.32/27', '20.118.192.0/18', '13.105.49.104/31', '40.123.145.166/31', '20.135.192.0/23', '207.254.3.32/28', '40.87.177.192/29', '40.123.144.160/27', '20.190.0.0/18', '2603:1030:401:230::/60', '40.87.182.24/29', '2603:1030:401:264::/62', '13.104.144.128/27', '13.105.74.64/27', '2603:1030:401:17::/64', '168.62.160.0/19', '20.60.56.0/22', '2603:1030:210::/47', '52.154.0.0/18', '52.239.160.0/22', '52.190.0.0/17', '104.42.0.0/16', '52.176.176.0/20', '168.62.32.0/19', '40.79.94.0/24', '40.86.0.0/17', '20.202.20.0/24', '20.60.228.0/23', '40.65.192.0/18', '13.105.49.36/31', '53.103.135.0/24', '52.102.159.0/24', '20.157.36.0/23', '20.157.166.0/24', '52.112.108.0/24', '52.229.0.0/18', '104.44.93.160/27', '20.47.0.0/24', '20.202.38.0/24', '40.90.17.96/27', '40.93.9.0/24', '40.91.12.48/28', '20.72.192.0/18', '168.61.128.128/28', '52.239.228.0/23', '52.245.46.112/28', '20.60.134.0/23', '13.104.147.0/25', '191.239.224.0/20', '2603:1030:401:16a::/63', '20.157.43.0/24', '52.103.12.0/24', '40.123.145.80/28', '20.72.64.0/18', '20.49.96.0/21', '20.60.230.0/23', '20.136.0.0/25', '204.152.18.64/26', '52.136.0.0/22', '13.84.0.0/15', '2603:1030:9:168::/62', '40.87.183.54/31', '52.176.128.0/19', '40.90.140.224/27', '51.141.160.0/19', '2603:1030:9:108::/62', '52.138.96.0/19', '2603:1030:401:2b6::/64', '13.104.144.192/27', '52.239.192.0/26', '20.94.128.0/18', '2603:1030:401:50::/61', '2603:1036:3000:120::/59', '40.90.16.0/27', '40.123.144.104/29', '52.184.176.0/20', '40.87.170.128/28', '20.47.22.0/23', '52.225.192.0/18', '2a01:111:f403:e008::/62', '52.184.192.0/18', '199.19.85.32/28', '20.55.192.0/18', '40.77.232.128/25', '40.123.132.0/22', '40.87.168.70/31', '52.114.176.0/22', '70.37.32.0/20', '13.67.192.0/18', '20.94.192.0/18', '52.101.36.0/22', '52.239.207.192/26', '40.87.168.64/30', '52.112.113.0/24', '199.30.20.0/24', '13.105.49.160/31', '2603:1030:401:139::/64', '20.47.113.0/24', '20.43.192.0/18', '52.103.0.0/24', '2603:1030:9:10c::/64', '168.61.131.0/26', '40.87.170.216/30', '40.70.0.0/18', '13.105.49.46/31', '131.253.14.96/27', '40.123.145.12/31', '20.135.224.0/22', '52.239.178.0/23', '52.255.64.0/18', '20.42.128.0/19', '20.150.89.0/24', '20.112.192.0/18', '52.165.128.0/17', '40.87.164.0/22', '40.93.3.0/24', '40.87.183.144/28', '20.135.204.0/23', '40.93.7.0/24', '13.105.49.28/31', '40.87.169.64/27', '40.87.169.102/31', '40.87.177.200/30', '52.102.130.0/24', '2603:1030:a::/47', '40.82.60.0/22', '199.19.85.80/28', '52.103.2.0/24', '52.153.0.0/18', '2603:1030:9:be::/63', '40.87.183.16/29', '52.245.70.0/23', '40.78.208.32/30', '20.202.25.0/24', '52.155.32.0/19', '40.75.0.0/19', '40.123.144.156/30', '52.188.0.0/16', '20.47.29.0/24', '2603:1030:401:130::/62', '20.150.94.0/24', '20.60.30.0/23', '20.187.0.0/18', '52.114.136.0/21', '13.105.98.128/27', '13.105.49.14/31', '52.146.0.0/17', '52.109.24.0/22', '13.73.240.0/20', '65.55.210.0/24', '2a01:111:f403:d900::/64', '40.87.177.128/28', '52.175.192.0/18', '20.135.228.0/22', '2603:1030:401:4::/62', '52.120.152.0/22', '52.177.0.0/16', '199.30.27.144/28', '40.93.11.0/24', '2603:1037:1:100::/59', '40.90.153.0/26', '13.105.74.128/26', '40.87.182.62/31', '40.90.132.128/26', '40.90.157.128/26', '2603:1036:3000:c0::/59', '40.91.12.240/28', '13.104.147.128/25', '40.87.176.184/30', '2603:1030:a04::/48', '52.115.92.0/24', '52.254.0.0/18', '52.103.137.0/24', '40.117.128.0/17', '131.253.35.128/26', '52.103.140.0/24', '52.232.192.0/18', '40.77.175.240/28', '52.137.64.0/18', '40.123.160.0/22', '52.245.45.128/28', '65.55.106.64/27', '40.77.182.32/27', '52.245.69.144/28', '2603:1030:80a::/56', '40.87.176.192/28', '40.125.32.0/19', '20.150.36.0/24', '52.114.152.0/21', '40.79.8.64/27', '40.90.137.96/27', '52.108.197.0/24', '2603:1030:9:1d6::/64', '13.105.101.176/28', '2603:1030:401:210::/60', '52.239.208.0/23', '137.116.184.0/21', '2603:1030:401:5c::/62', '2603:1036:2500:1c::/64', '52.245.12.0/22', '20.60.180.0/23', '65.55.106.0/26', '131.253.15.8/29', '40.123.145.32/28', '40.90.28.128/26', '40.91.160.0/19', '13.105.49.98/31', '13.105.49.114/31', '52.108.106.0/23', '13.105.49.54/31', '52.245.45.160/27', '40.87.180.14/31', '13.105.49.0/31', '23.103.64.32/27', '2603:1030:401:2a0::/61', '52.240.0.0/17', '52.225.137.0/24', '157.55.55.104/29', '40.87.180.20/31', '40.82.96.0/22', '40.87.177.96/28', '2603:1030:401:25c::/63', '52.120.224.0/20', '13.105.60.64/27', '2603:1030:401:134::/63', '40.87.171.4/30', '40.90.147.0/27', '104.44.89.64/27', '20.150.68.0/24', '52.186.0.0/16', '52.101.46.0/23', '52.113.206.0/24', '2603:1030:401:270::/62', '40.90.133.96/28', '40.90.130.160/27', '40.77.242.0/23', '40.96.61.0/24', '20.135.196.0/22', '13.104.158.16/28', '40.67.128.0/19', '40.90.18.64/26', '20.45.0.0/18', '40.77.236.128/27', '134.170.220.0/23', '52.239.184.160/28', '65.55.105.224/27', '40.90.150.32/27', '65.55.106.128/26', '52.154.128.0/17', '20.202.35.0/24', '40.87.177.152/31', '65.55.108.0/24', '40.87.171.40/31', '52.234.128.0/17', '40.78.240.0/20', '52.113.160.0/19'])} return {} def remove_namespace(change: FirewallChange) -> None: """ Removes a given lockstep-managed namespace and any underlying firewall rules inside of that namespace """ pass def remove_entry(change: FirewallChange) -> None: # TODO implement pass def add_entry(change: FirewallChange) -> None: # TODO implement pass
1,147.194444
40,451
0.579045
10,417
41,299
2.295095
0.049054
0.041032
0.039568
0.014723
0.196587
0.040321
0.003848
0
0
0
0
0.587682
0.05528
41,299
35
40,452
1,179.971429
0.025092
0.989782
0
0.3
0
0
0
0
0
0
0
0.057143
0
1
0.4
false
0.3
0.2
0
0.7
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
1
0
0
0
0
0
0
null
0
0
1
0
0
1
0
1
0
0
1
0
0
9
01f85a3d500641574736c3fb58c6f21be9771840
139,300
py
Python
xml_code/gpx10.py
atlefren/mineturer2
e9798f587947e4ef9d54065e5bea4a4af3caf482
[ "MIT" ]
8
2016-06-06T02:36:31.000Z
2020-08-26T07:53:06.000Z
xml_code/gpx10.py
atlefren/mineturer2
e9798f587947e4ef9d54065e5bea4a4af3caf482
[ "MIT" ]
null
null
null
xml_code/gpx10.py
atlefren/mineturer2
e9798f587947e4ef9d54065e5bea4a4af3caf482
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Tue Jun 3 22:47:21 2014 by generateDS.py version 2.12d. # # Command line options: # ('-o', 'gpx10.py') # ('-s', 'gpssubs10.py') # # Command line arguments: # schemas/gpx.1.0.xsd # # Command line: # venv/bin/generateDS.py -o "gpx10.py" -s "gpssubs10.py" schemas/gpx.1.0.xsd # # Current working directory (os.getcwd()): # mineturer2 # import sys import getopt import re as re_ import base64 import datetime as datetime_ etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) XMLParser_import_library = None try: # lxml from lxml import etree as etree_ XMLParser_import_library = XMLParser_import_lxml if Verbose_import_: print("running with lxml.etree") except ImportError: try: # cElementTree from Python 2.5+ import xml.etree.cElementTree as etree_ XMLParser_import_library = XMLParser_import_elementtree if Verbose_import_: print("running with cElementTree on Python 2.5+") except ImportError: try: # ElementTree from Python 2.5+ import xml.etree.ElementTree as etree_ XMLParser_import_library = XMLParser_import_elementtree if Verbose_import_: print("running with ElementTree on Python 2.5+") except ImportError: try: # normal cElementTree install import cElementTree as etree_ XMLParser_import_library = XMLParser_import_elementtree if Verbose_import_: print("running with cElementTree") except ImportError: try: # normal ElementTree install import elementtree.ElementTree as etree_ XMLParser_import_library = XMLParser_import_elementtree if Verbose_import_: print("running with ElementTree") except ImportError: raise ImportError( "Failed to import ElementTree from any known place") def parsexml_(*args, **kwargs): if (XMLParser_import_library == XMLParser_import_lxml and 'parser' not in kwargs): # Use the lxml ElementTree compatible parser so that, e.g., # we ignore comments. kwargs['parser'] = etree_.ETCompatXMLParser() doc = etree_.parse(*args, **kwargs) return doc # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class # in a module named generatedssuper.py. try: from generatedssuper import GeneratedsSuper except ImportError, exp: class GeneratedsSuper(object): tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$') class _FixedOffsetTZ(datetime_.tzinfo): def __init__(self, offset, name): self.__offset = datetime_.timedelta(minutes=offset) self.__name = name def utcoffset(self, dt): return self.__offset def tzname(self, dt): return self.__name def dst(self, dt): return None def gds_format_string(self, input_data, input_name=''): return input_data def gds_validate_string(self, input_data, node, input_name=''): if not input_data: return '' else: return input_data def gds_format_base64(self, input_data, input_name=''): return base64.b64encode(input_data) def gds_validate_base64(self, input_data, node, input_name=''): return input_data def gds_format_integer(self, input_data, input_name=''): return '%d' % input_data def gds_validate_integer(self, input_data, node, input_name=''): return input_data def gds_format_integer_list(self, input_data, input_name=''): return '%s' % input_data def gds_validate_integer_list(self, input_data, node, input_name=''): values = input_data.split() for value in values: try: float(value) except (TypeError, ValueError): raise_parse_error(node, 'Requires sequence of integers') return input_data def gds_format_float(self, input_data, input_name=''): return ('%.15f' % input_data).rstrip('0') def gds_validate_float(self, input_data, node, input_name=''): return input_data def gds_format_float_list(self, input_data, input_name=''): return '%s' % input_data def gds_validate_float_list(self, input_data, node, input_name=''): values = input_data.split() for value in values: try: float(value) except (TypeError, ValueError): raise_parse_error(node, 'Requires sequence of floats') return input_data def gds_format_double(self, input_data, input_name=''): return '%e' % input_data def gds_validate_double(self, input_data, node, input_name=''): return input_data def gds_format_double_list(self, input_data, input_name=''): return '%s' % input_data def gds_validate_double_list(self, input_data, node, input_name=''): values = input_data.split() for value in values: try: float(value) except (TypeError, ValueError): raise_parse_error(node, 'Requires sequence of doubles') return input_data def gds_format_boolean(self, input_data, input_name=''): return ('%s' % input_data).lower() def gds_validate_boolean(self, input_data, node, input_name=''): return input_data def gds_format_boolean_list(self, input_data, input_name=''): return '%s' % input_data def gds_validate_boolean_list(self, input_data, node, input_name=''): values = input_data.split() for value in values: if value not in ('true', '1', 'false', '0', ): raise_parse_error( node, 'Requires sequence of booleans ' '("true", "1", "false", "0")') return input_data def gds_validate_datetime(self, input_data, node, input_name=''): return input_data def gds_format_datetime(self, input_data, input_name=''): if input_data.microsecond == 0: _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % ( input_data.year, input_data.month, input_data.day, input_data.hour, input_data.minute, input_data.second, ) else: _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % ( input_data.year, input_data.month, input_data.day, input_data.hour, input_data.minute, input_data.second, ('%f' % (float(input_data.microsecond) / 1000000))[2:], ) if input_data.tzinfo is not None: tzoff = input_data.tzinfo.utcoffset(input_data) if tzoff is not None: total_seconds = tzoff.seconds + (86400 * tzoff.days) if total_seconds == 0: _svalue += 'Z' else: if total_seconds < 0: _svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes) return _svalue @classmethod def gds_parse_datetime(cls, input_data): tz = None if input_data[-1] == 'Z': tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') input_data = input_data[:-1] else: results = GeneratedsSuper.tzoff_pattern.search(input_data) if results is not None: tzoff_parts = results.group(2).split(':') tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) if results.group(1) == '-': tzoff *= -1 tz = GeneratedsSuper._FixedOffsetTZ( tzoff, results.group(0)) input_data = input_data[:-6] if len(input_data.split('.')) > 1: dt = datetime_.datetime.strptime( input_data, '%Y-%m-%dT%H:%M:%S.%f') else: dt = datetime_.datetime.strptime( input_data, '%Y-%m-%dT%H:%M:%S') dt = dt.replace(tzinfo=tz) return dt def gds_validate_date(self, input_data, node, input_name=''): return input_data def gds_format_date(self, input_data, input_name=''): _svalue = '%04d-%02d-%02d' % ( input_data.year, input_data.month, input_data.day, ) try: if input_data.tzinfo is not None: tzoff = input_data.tzinfo.utcoffset(input_data) if tzoff is not None: total_seconds = tzoff.seconds + (86400 * tzoff.days) if total_seconds == 0: _svalue += 'Z' else: if total_seconds < 0: _svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes) except AttributeError: pass return _svalue @classmethod def gds_parse_date(cls, input_data): tz = None if input_data[-1] == 'Z': tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') input_data = input_data[:-1] else: results = GeneratedsSuper.tzoff_pattern.search(input_data) if results is not None: tzoff_parts = results.group(2).split(':') tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) if results.group(1) == '-': tzoff *= -1 tz = GeneratedsSuper._FixedOffsetTZ( tzoff, results.group(0)) input_data = input_data[:-6] dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d') dt = dt.replace(tzinfo=tz) return dt.date() def gds_validate_time(self, input_data, node, input_name=''): return input_data def gds_format_time(self, input_data, input_name=''): if input_data.microsecond == 0: _svalue = '%02d:%02d:%02d' % ( input_data.hour, input_data.minute, input_data.second, ) else: _svalue = '%02d:%02d:%02d.%s' % ( input_data.hour, input_data.minute, input_data.second, ('%f' % (float(input_data.microsecond) / 1000000))[2:], ) if input_data.tzinfo is not None: tzoff = input_data.tzinfo.utcoffset(input_data) if tzoff is not None: total_seconds = tzoff.seconds + (86400 * tzoff.days) if total_seconds == 0: _svalue += 'Z' else: if total_seconds < 0: _svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes) return _svalue @classmethod def gds_parse_time(cls, input_data): tz = None if input_data[-1] == 'Z': tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') input_data = input_data[:-1] else: results = GeneratedsSuper.tzoff_pattern.search(input_data) if results is not None: tzoff_parts = results.group(2).split(':') tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) if results.group(1) == '-': tzoff *= -1 tz = GeneratedsSuper._FixedOffsetTZ( tzoff, results.group(0)) input_data = input_data[:-6] if len(input_data.split('.')) > 1: dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f') else: dt = datetime_.datetime.strptime(input_data, '%H:%M:%S') dt = dt.replace(tzinfo=tz) return dt.time() def gds_str_lower(self, instring): return instring.lower() def get_path_(self, node): path_list = [] self.get_path_list_(node, path_list) path_list.reverse() path = '/'.join(path_list) return path Tag_strip_pattern_ = re_.compile(r'\{.*\}') def get_path_list_(self, node, path_list): if node is None: return tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) if tag: path_list.append(tag) self.get_path_list_(node.getparent(), path_list) def get_class_obj_(self, node, default_class=None): class_obj1 = default_class if 'xsi' in node.nsmap: classname = node.get('{%s}type' % node.nsmap['xsi']) if classname is not None: names = classname.split(':') if len(names) == 2: classname = names[1] class_obj2 = globals().get(classname) if class_obj2 is not None: class_obj1 = class_obj2 return class_obj1 def gds_build_any(self, node, type_name=None): return None @classmethod def gds_reverse_node_mapping(cls, mapping): return dict(((v, k) for k, v in mapping.iteritems())) # # If you have installed IPython you can uncomment and use the following. # IPython is available from http://ipython.scipy.org/. # ## from IPython.Shell import IPShellEmbed ## args = '' ## ipshell = IPShellEmbed(args, ## banner = 'Dropping into IPython', ## exit_msg = 'Leaving Interpreter, back to program.') # Then use the following line where and when you want to drop into the # IPython shell: # ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit') # # Globals # ExternalEncoding = 'ascii' Tag_pattern_ = re_.compile(r'({.*})?(.*)') String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') # # Support/utility functions. # def showIndent(outfile, level, pretty_print=True): if pretty_print: for idx in range(level): outfile.write(' ') def quote_xml(inStr): if not inStr: return '' s1 = (isinstance(inStr, basestring) and inStr or '%s' % inStr) s1 = s1.replace('&', '&amp;') s1 = s1.replace('<', '&lt;') s1 = s1.replace('>', '&gt;') return s1 def quote_attrib(inStr): s1 = (isinstance(inStr, basestring) and inStr or '%s' % inStr) s1 = s1.replace('&', '&amp;') s1 = s1.replace('<', '&lt;') s1 = s1.replace('>', '&gt;') if '"' in s1: if "'" in s1: s1 = '"%s"' % s1.replace('"', "&quot;") else: s1 = "'%s'" % s1 else: s1 = '"%s"' % s1 return s1 def quote_python(inStr): s1 = inStr if s1.find("'") == -1: if s1.find('\n') == -1: return "'%s'" % s1 else: return "'''%s'''" % s1 else: if s1.find('"') != -1: s1 = s1.replace('"', '\\"') if s1.find('\n') == -1: return '"%s"' % s1 else: return '"""%s"""' % s1 def get_all_text_(node): if node.text is not None: text = node.text else: text = '' for child in node: if child.tail is not None: text += child.tail return text def find_attr_value_(attr_name, node): attrs = node.attrib attr_parts = attr_name.split(':') value = None if len(attr_parts) == 1: value = attrs.get(attr_name) elif len(attr_parts) == 2: prefix, name = attr_parts namespace = node.nsmap.get(prefix) if namespace is not None: value = attrs.get('{%s}%s' % (namespace, name, )) return value class GDSParseError(Exception): pass def raise_parse_error(node, msg): if XMLParser_import_library == XMLParser_import_lxml: msg = '%s (element %s/line %d)' % ( msg, node.tag, node.sourceline, ) else: msg = '%s (element %s)' % (msg, node.tag, ) raise GDSParseError(msg) class MixedContainer: # Constants for category: CategoryNone = 0 CategoryText = 1 CategorySimple = 2 CategoryComplex = 3 # Constants for content_type: TypeNone = 0 TypeText = 1 TypeString = 2 TypeInteger = 3 TypeFloat = 4 TypeDecimal = 5 TypeDouble = 6 TypeBoolean = 7 TypeBase64 = 8 def __init__(self, category, content_type, name, value): self.category = category self.content_type = content_type self.name = name self.value = value def getCategory(self): return self.category def getContenttype(self, content_type): return self.content_type def getValue(self): return self.value def getName(self): return self.name def export(self, outfile, level, name, namespace, pretty_print=True): if self.category == MixedContainer.CategoryText: # Prevent exporting empty content as empty lines. if self.value.strip(): outfile.write(self.value) elif self.category == MixedContainer.CategorySimple: self.exportSimple(outfile, level, name) else: # category == MixedContainer.CategoryComplex self.value.export(outfile, level, namespace, name, pretty_print) def exportSimple(self, outfile, level, name): if self.content_type == MixedContainer.TypeString: outfile.write('<%s>%s</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeInteger or \ self.content_type == MixedContainer.TypeBoolean: outfile.write('<%s>%d</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeFloat or \ self.content_type == MixedContainer.TypeDecimal: outfile.write('<%s>%f</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeDouble: outfile.write('<%s>%g</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeBase64: outfile.write('<%s>%s</%s>' % ( self.name, base64.b64encode(self.value), self.name)) def to_etree(self, element): if self.category == MixedContainer.CategoryText: # Prevent exporting empty content as empty lines. if self.value.strip(): if len(element) > 0: if element[-1].tail is None: element[-1].tail = self.value else: element[-1].tail += self.value else: if element.text is None: element.text = self.value else: element.text += self.value elif self.category == MixedContainer.CategorySimple: subelement = etree_.SubElement(element, '%s' % self.name) subelement.text = self.to_etree_simple() else: # category == MixedContainer.CategoryComplex self.value.to_etree(element) def to_etree_simple(self): if self.content_type == MixedContainer.TypeString: text = self.value elif (self.content_type == MixedContainer.TypeInteger or self.content_type == MixedContainer.TypeBoolean): text = '%d' % self.value elif (self.content_type == MixedContainer.TypeFloat or self.content_type == MixedContainer.TypeDecimal): text = '%f' % self.value elif self.content_type == MixedContainer.TypeDouble: text = '%g' % self.value elif self.content_type == MixedContainer.TypeBase64: text = '%s' % base64.b64encode(self.value) return text def exportLiteral(self, outfile, level, name): if self.category == MixedContainer.CategoryText: showIndent(outfile, level) outfile.write( 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % ( self.category, self.content_type, self.name, self.value)) elif self.category == MixedContainer.CategorySimple: showIndent(outfile, level) outfile.write( 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % ( self.category, self.content_type, self.name, self.value)) else: # category == MixedContainer.CategoryComplex showIndent(outfile, level) outfile.write( 'model_.MixedContainer(%d, %d, "%s",\n' % ( self.category, self.content_type, self.name,)) self.value.exportLiteral(outfile, level + 1) showIndent(outfile, level) outfile.write(')\n') class MemberSpec_(object): def __init__(self, name='', data_type='', container=0): self.name = name self.data_type = data_type self.container = container def set_name(self, name): self.name = name def get_name(self): return self.name def set_data_type(self, data_type): self.data_type = data_type def get_data_type_chain(self): return self.data_type def get_data_type(self): if isinstance(self.data_type, list): if len(self.data_type) > 0: return self.data_type[-1] else: return 'xs:string' else: return self.data_type def set_container(self, container): self.container = container def get_container(self): return self.container def _cast(typ, value): if typ is None or value is None: return value return typ(value) # # Data representation classes. # class gpx(GeneratedsSuper): subclass = None superclass = None def __init__(self, version=None, creator=None, name=None, desc=None, author=None, email=None, url=None, urlname=None, time=None, keywords=None, bounds=None, wpt=None, rte=None, trk=None, anytypeobjs_=None): self.original_tagname_ = None self.version = _cast(None, version) self.creator = _cast(None, creator) self.name = name self.desc = desc self.author = author self.email = email self.url = url self.urlname = urlname if isinstance(time, basestring): initvalue_ = datetime_.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S') else: initvalue_ = time self.time = initvalue_ self.keywords = keywords self.bounds = bounds if wpt is None: self.wpt = [] else: self.wpt = wpt if rte is None: self.rte = [] else: self.rte = rte if trk is None: self.trk = [] else: self.trk = trk if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ def factory(*args_, **kwargs_): if gpx.subclass: return gpx.subclass(*args_, **kwargs_) else: return gpx(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_desc(self): return self.desc def set_desc(self, desc): self.desc = desc def get_author(self): return self.author def set_author(self, author): self.author = author def get_email(self): return self.email def set_email(self, email): self.email = email def get_url(self): return self.url def set_url(self, url): self.url = url def get_urlname(self): return self.urlname def set_urlname(self, urlname): self.urlname = urlname def get_time(self): return self.time def set_time(self, time): self.time = time def get_keywords(self): return self.keywords def set_keywords(self, keywords): self.keywords = keywords def get_bounds(self): return self.bounds def set_bounds(self, bounds): self.bounds = bounds def get_wpt(self): return self.wpt def set_wpt(self, wpt): self.wpt = wpt def add_wpt(self, value): self.wpt.append(value) def insert_wpt(self, index, value): self.wpt[index] = value def get_rte(self): return self.rte def set_rte(self, rte): self.rte = rte def add_rte(self, value): self.rte.append(value) def insert_rte(self, index, value): self.rte[index] = value def get_trk(self): return self.trk def set_trk(self, trk): self.trk = trk def add_trk(self, value): self.trk.append(value) def insert_trk(self, index, value): self.trk[index] = value def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def get_version(self): return self.version def set_version(self, version): self.version = version def get_creator(self): return self.creator def set_creator(self, creator): self.creator = creator def validate_emailType(self, value): # Validate type emailType, a restriction on xsd:string. pass def hasContent_(self): if ( self.name is not None or self.desc is not None or self.author is not None or self.email is not None or self.url is not None or self.urlname is not None or self.time is not None or self.keywords is not None or self.bounds is not None or self.wpt or self.rte or self.trk or self.anytypeobjs_ ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='gpx', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='gpx') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='gpx', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='gpx'): if self.version is not None and 'version' not in already_processed: already_processed.add('version') outfile.write(' version=%s' % (self.gds_format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), )) if self.creator is not None and 'creator' not in already_processed: already_processed.add('creator') outfile.write(' creator=%s' % (self.gds_format_string(quote_attrib(self.creator).encode(ExternalEncoding), input_name='creator'), )) def exportChildren(self, outfile, level, namespace_='gpx:', name_='gpx', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) if self.desc is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdesc>%s</%sdesc>%s' % (namespace_, self.gds_format_string(quote_xml(self.desc).encode(ExternalEncoding), input_name='desc'), namespace_, eol_)) if self.author is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sauthor>%s</%sauthor>%s' % (namespace_, self.gds_format_string(quote_xml(self.author).encode(ExternalEncoding), input_name='author'), namespace_, eol_)) if self.email is not None: showIndent(outfile, level, pretty_print) outfile.write('<%semail>%s</%semail>%s' % (namespace_, self.gds_format_string(quote_xml(self.email).encode(ExternalEncoding), input_name='email'), namespace_, eol_)) if self.url is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surl>%s</%surl>%s' % (namespace_, self.gds_format_string(quote_xml(self.url).encode(ExternalEncoding), input_name='url'), namespace_, eol_)) if self.urlname is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surlname>%s</%surlname>%s' % (namespace_, self.gds_format_string(quote_xml(self.urlname).encode(ExternalEncoding), input_name='urlname'), namespace_, eol_)) if self.time is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stime>%s</%stime>%s' % (namespace_, self.gds_format_datetime(self.time, input_name='time'), namespace_, eol_)) if self.keywords is not None: showIndent(outfile, level, pretty_print) outfile.write('<%skeywords>%s</%skeywords>%s' % (namespace_, self.gds_format_string(quote_xml(self.keywords).encode(ExternalEncoding), input_name='keywords'), namespace_, eol_)) if self.bounds is not None: self.bounds.export(outfile, level, namespace_, name_='bounds', pretty_print=pretty_print) for wpt_ in self.wpt: wpt_.export(outfile, level, namespace_, name_='wpt', pretty_print=pretty_print) for rte_ in self.rte: rte_.export(outfile, level, namespace_, name_='rte', pretty_print=pretty_print) for trk_ in self.trk: trk_.export(outfile, level, namespace_, name_='trk', pretty_print=pretty_print) for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='gpx'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): if self.version is not None and 'version' not in already_processed: already_processed.add('version') showIndent(outfile, level) outfile.write('version="%s",\n' % (self.version,)) if self.creator is not None and 'creator' not in already_processed: already_processed.add('creator') showIndent(outfile, level) outfile.write('creator="%s",\n' % (self.creator,)) def exportLiteralChildren(self, outfile, level, name_): if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) if self.desc is not None: showIndent(outfile, level) outfile.write('desc=%s,\n' % quote_python(self.desc).encode(ExternalEncoding)) if self.author is not None: showIndent(outfile, level) outfile.write('author=%s,\n' % quote_python(self.author).encode(ExternalEncoding)) if self.email is not None: showIndent(outfile, level) outfile.write('email=%s,\n' % quote_python(self.email).encode(ExternalEncoding)) if self.url is not None: showIndent(outfile, level) outfile.write('url=%s,\n' % quote_python(self.url).encode(ExternalEncoding)) if self.urlname is not None: showIndent(outfile, level) outfile.write('urlname=%s,\n' % quote_python(self.urlname).encode(ExternalEncoding)) if self.time is not None: showIndent(outfile, level) outfile.write('time=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.time, input_name='time')) if self.keywords is not None: showIndent(outfile, level) outfile.write('keywords=%s,\n' % quote_python(self.keywords).encode(ExternalEncoding)) if self.bounds is not None: showIndent(outfile, level) outfile.write('bounds=model_.boundsType(\n') self.bounds.exportLiteral(outfile, level, name_='bounds') showIndent(outfile, level) outfile.write('),\n') showIndent(outfile, level) outfile.write('wpt=[\n') level += 1 for wpt_ in self.wpt: showIndent(outfile, level) outfile.write('model_.wptType(\n') wpt_.exportLiteral(outfile, level, name_='wptType') showIndent(outfile, level) outfile.write('),\n') level -= 1 showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('rte=[\n') level += 1 for rte_ in self.rte: showIndent(outfile, level) outfile.write('model_.rteType(\n') rte_.exportLiteral(outfile, level, name_='rteType') showIndent(outfile, level) outfile.write('),\n') level -= 1 showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('trk=[\n') level += 1 for trk_ in self.trk: showIndent(outfile, level) outfile.write('model_.trkType(\n') trk_.exportLiteral(outfile, level, name_='trkType') showIndent(outfile, level) outfile.write('),\n') level -= 1 showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('anytypeobjs_=[\n') level += 1 for anytypeobjs_ in self.anytypeobjs_: anytypeobjs_.exportLiteral(outfile, level) level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('version', node) if value is not None and 'version' not in already_processed: already_processed.add('version') self.version = value value = find_attr_value_('creator', node) if value is not None and 'creator' not in already_processed: already_processed.add('creator') self.creator = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'name': name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ elif nodeName_ == 'desc': desc_ = child_.text desc_ = self.gds_validate_string(desc_, node, 'desc') self.desc = desc_ elif nodeName_ == 'author': author_ = child_.text author_ = self.gds_validate_string(author_, node, 'author') self.author = author_ elif nodeName_ == 'email': email_ = child_.text email_ = self.gds_validate_string(email_, node, 'email') self.email = email_ self.validate_emailType(self.email) # validate type emailType elif nodeName_ == 'url': url_ = child_.text url_ = self.gds_validate_string(url_, node, 'url') self.url = url_ elif nodeName_ == 'urlname': urlname_ = child_.text urlname_ = self.gds_validate_string(urlname_, node, 'urlname') self.urlname = urlname_ elif nodeName_ == 'time': sval_ = child_.text dval_ = self.gds_parse_datetime(sval_) self.time = dval_ elif nodeName_ == 'keywords': keywords_ = child_.text keywords_ = self.gds_validate_string(keywords_, node, 'keywords') self.keywords = keywords_ elif nodeName_ == 'bounds': obj_ = boundsType.factory() obj_.build(child_) self.bounds = obj_ obj_.original_tagname_ = 'bounds' elif nodeName_ == 'wpt': obj_ = wptType.factory() obj_.build(child_) self.wpt.append(obj_) obj_.original_tagname_ = 'wpt' elif nodeName_ == 'rte': obj_ = rteType.factory() obj_.build(child_) self.rte.append(obj_) obj_.original_tagname_ = 'rte' elif nodeName_ == 'trk': obj_ = trkType.factory() obj_.build(child_) self.trk.append(obj_) obj_.original_tagname_ = 'trk' else: obj_ = self.gds_build_any(child_, 'gpx') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class gpx class boundsType(GeneratedsSuper): subclass = None superclass = None def __init__(self, minlat=None, maxlon=None, minlon=None, maxlat=None): self.original_tagname_ = None self.minlat = _cast(None, minlat) self.maxlon = _cast(None, maxlon) self.minlon = _cast(None, minlon) self.maxlat = _cast(None, maxlat) def factory(*args_, **kwargs_): if boundsType.subclass: return boundsType.subclass(*args_, **kwargs_) else: return boundsType(*args_, **kwargs_) factory = staticmethod(factory) def get_minlat(self): return self.minlat def set_minlat(self, minlat): self.minlat = minlat def get_maxlon(self): return self.maxlon def set_maxlon(self, maxlon): self.maxlon = maxlon def get_minlon(self): return self.minlon def set_minlon(self, minlon): self.minlon = minlon def get_maxlat(self): return self.maxlat def set_maxlat(self, maxlat): self.maxlat = maxlat def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='boundsType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='boundsType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='boundsType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='boundsType'): if self.minlat is not None and 'minlat' not in already_processed: already_processed.add('minlat') outfile.write(' minlat=%s' % (quote_attrib(self.minlat), )) if self.maxlon is not None and 'maxlon' not in already_processed: already_processed.add('maxlon') outfile.write(' maxlon=%s' % (quote_attrib(self.maxlon), )) if self.minlon is not None and 'minlon' not in already_processed: already_processed.add('minlon') outfile.write(' minlon=%s' % (quote_attrib(self.minlon), )) if self.maxlat is not None and 'maxlat' not in already_processed: already_processed.add('maxlat') outfile.write(' maxlat=%s' % (quote_attrib(self.maxlat), )) def exportChildren(self, outfile, level, namespace_='gpx:', name_='boundsType', fromsubclass_=False, pretty_print=True): pass def exportLiteral(self, outfile, level, name_='boundsType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): if self.minlat is not None and 'minlat' not in already_processed: already_processed.add('minlat') showIndent(outfile, level) outfile.write('minlat=%s,\n' % (self.minlat,)) if self.maxlon is not None and 'maxlon' not in already_processed: already_processed.add('maxlon') showIndent(outfile, level) outfile.write('maxlon=%s,\n' % (self.maxlon,)) if self.minlon is not None and 'minlon' not in already_processed: already_processed.add('minlon') showIndent(outfile, level) outfile.write('minlon=%s,\n' % (self.minlon,)) if self.maxlat is not None and 'maxlat' not in already_processed: already_processed.add('maxlat') showIndent(outfile, level) outfile.write('maxlat=%s,\n' % (self.maxlat,)) def exportLiteralChildren(self, outfile, level, name_): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('minlat', node) if value is not None and 'minlat' not in already_processed: already_processed.add('minlat') self.minlat = value value = find_attr_value_('maxlon', node) if value is not None and 'maxlon' not in already_processed: already_processed.add('maxlon') self.maxlon = value value = find_attr_value_('minlon', node) if value is not None and 'minlon' not in already_processed: already_processed.add('minlon') self.minlon = value value = find_attr_value_('maxlat', node) if value is not None and 'maxlat' not in already_processed: already_processed.add('maxlat') self.maxlat = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class boundsType class wptType(GeneratedsSuper): subclass = None superclass = None def __init__(self, lat=None, lon=None, ele=None, time=None, magvar=None, geoidheight=None, name=None, cmt=None, desc=None, src=None, url=None, urlname=None, sym=None, type_=None, fix=None, sat=None, hdop=None, vdop=None, pdop=None, ageofdgpsdata=None, dgpsid=None, anytypeobjs_=None): self.original_tagname_ = None self.lat = _cast(None, lat) self.lon = _cast(None, lon) self.ele = ele if isinstance(time, basestring): initvalue_ = datetime_.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S') else: initvalue_ = time self.time = initvalue_ self.magvar = magvar self.geoidheight = geoidheight self.name = name self.cmt = cmt self.desc = desc self.src = src self.url = url self.urlname = urlname self.sym = sym self.type_ = type_ self.fix = fix self.sat = sat self.hdop = hdop self.vdop = vdop self.pdop = pdop self.ageofdgpsdata = ageofdgpsdata self.dgpsid = dgpsid if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ def factory(*args_, **kwargs_): if wptType.subclass: return wptType.subclass(*args_, **kwargs_) else: return wptType(*args_, **kwargs_) factory = staticmethod(factory) def get_ele(self): return self.ele def set_ele(self, ele): self.ele = ele def get_time(self): return self.time def set_time(self, time): self.time = time def get_magvar(self): return self.magvar def set_magvar(self, magvar): self.magvar = magvar def get_geoidheight(self): return self.geoidheight def set_geoidheight(self, geoidheight): self.geoidheight = geoidheight def get_name(self): return self.name def set_name(self, name): self.name = name def get_cmt(self): return self.cmt def set_cmt(self, cmt): self.cmt = cmt def get_desc(self): return self.desc def set_desc(self, desc): self.desc = desc def get_src(self): return self.src def set_src(self, src): self.src = src def get_url(self): return self.url def set_url(self, url): self.url = url def get_urlname(self): return self.urlname def set_urlname(self, urlname): self.urlname = urlname def get_sym(self): return self.sym def set_sym(self, sym): self.sym = sym def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_fix(self): return self.fix def set_fix(self, fix): self.fix = fix def get_sat(self): return self.sat def set_sat(self, sat): self.sat = sat def get_hdop(self): return self.hdop def set_hdop(self, hdop): self.hdop = hdop def get_vdop(self): return self.vdop def set_vdop(self, vdop): self.vdop = vdop def get_pdop(self): return self.pdop def set_pdop(self, pdop): self.pdop = pdop def get_ageofdgpsdata(self): return self.ageofdgpsdata def set_ageofdgpsdata(self, ageofdgpsdata): self.ageofdgpsdata = ageofdgpsdata def get_dgpsid(self): return self.dgpsid def set_dgpsid(self, dgpsid): self.dgpsid = dgpsid def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def get_lat(self): return self.lat def set_lat(self, lat): self.lat = lat def get_lon(self): return self.lon def set_lon(self, lon): self.lon = lon def validate_degreesType(self, value): # Validate type degreesType, a restriction on xsd:decimal. pass def validate_fixType(self, value): # Validate type fixType, a restriction on xsd:string. pass def validate_dgpsStationType(self, value): # Validate type dgpsStationType, a restriction on xsd:integer. pass def hasContent_(self): if ( self.ele is not None or self.time is not None or self.magvar is not None or self.geoidheight is not None or self.name is not None or self.cmt is not None or self.desc is not None or self.src is not None or self.url is not None or self.urlname is not None or self.sym is not None or self.type_ is not None or self.fix is not None or self.sat is not None or self.hdop is not None or self.vdop is not None or self.pdop is not None or self.ageofdgpsdata is not None or self.dgpsid is not None or self.anytypeobjs_ ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='wptType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='wptType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='wptType', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='wptType'): if self.lat is not None and 'lat' not in already_processed: already_processed.add('lat') outfile.write(' lat=%s' % (quote_attrib(self.lat), )) if self.lon is not None and 'lon' not in already_processed: already_processed.add('lon') outfile.write(' lon=%s' % (quote_attrib(self.lon), )) def exportChildren(self, outfile, level, namespace_='gpx:', name_='wptType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.ele is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sele>%s</%sele>%s' % (namespace_, self.gds_format_float(self.ele, input_name='ele'), namespace_, eol_)) if self.time is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stime>%s</%stime>%s' % (namespace_, self.gds_format_datetime(self.time, input_name='time'), namespace_, eol_)) if self.magvar is not None: showIndent(outfile, level, pretty_print) outfile.write('<%smagvar>%s</%smagvar>%s' % (namespace_, self.gds_format_float(self.magvar, input_name='magvar'), namespace_, eol_)) if self.geoidheight is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sgeoidheight>%s</%sgeoidheight>%s' % (namespace_, self.gds_format_float(self.geoidheight, input_name='geoidheight'), namespace_, eol_)) if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) if self.cmt is not None: showIndent(outfile, level, pretty_print) outfile.write('<%scmt>%s</%scmt>%s' % (namespace_, self.gds_format_string(quote_xml(self.cmt).encode(ExternalEncoding), input_name='cmt'), namespace_, eol_)) if self.desc is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdesc>%s</%sdesc>%s' % (namespace_, self.gds_format_string(quote_xml(self.desc).encode(ExternalEncoding), input_name='desc'), namespace_, eol_)) if self.src is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssrc>%s</%ssrc>%s' % (namespace_, self.gds_format_string(quote_xml(self.src).encode(ExternalEncoding), input_name='src'), namespace_, eol_)) if self.url is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surl>%s</%surl>%s' % (namespace_, self.gds_format_string(quote_xml(self.url).encode(ExternalEncoding), input_name='url'), namespace_, eol_)) if self.urlname is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surlname>%s</%surlname>%s' % (namespace_, self.gds_format_string(quote_xml(self.urlname).encode(ExternalEncoding), input_name='urlname'), namespace_, eol_)) if self.sym is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssym>%s</%ssym>%s' % (namespace_, self.gds_format_string(quote_xml(self.sym).encode(ExternalEncoding), input_name='sym'), namespace_, eol_)) if self.type_ is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stype>%s</%stype>%s' % (namespace_, self.gds_format_string(quote_xml(self.type_).encode(ExternalEncoding), input_name='type'), namespace_, eol_)) if self.fix is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sfix>%s</%sfix>%s' % (namespace_, self.gds_format_string(quote_xml(self.fix).encode(ExternalEncoding), input_name='fix'), namespace_, eol_)) if self.sat is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssat>%s</%ssat>%s' % (namespace_, self.gds_format_integer(self.sat, input_name='sat'), namespace_, eol_)) if self.hdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%shdop>%s</%shdop>%s' % (namespace_, self.gds_format_float(self.hdop, input_name='hdop'), namespace_, eol_)) if self.vdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%svdop>%s</%svdop>%s' % (namespace_, self.gds_format_float(self.vdop, input_name='vdop'), namespace_, eol_)) if self.pdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%spdop>%s</%spdop>%s' % (namespace_, self.gds_format_float(self.pdop, input_name='pdop'), namespace_, eol_)) if self.ageofdgpsdata is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sageofdgpsdata>%s</%sageofdgpsdata>%s' % (namespace_, self.gds_format_float(self.ageofdgpsdata, input_name='ageofdgpsdata'), namespace_, eol_)) if self.dgpsid is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdgpsid>%s</%sdgpsid>%s' % (namespace_, self.gds_format_integer(self.dgpsid, input_name='dgpsid'), namespace_, eol_)) for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='wptType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): if self.lat is not None and 'lat' not in already_processed: already_processed.add('lat') showIndent(outfile, level) outfile.write('lat=%s,\n' % (self.lat,)) if self.lon is not None and 'lon' not in already_processed: already_processed.add('lon') showIndent(outfile, level) outfile.write('lon=%s,\n' % (self.lon,)) def exportLiteralChildren(self, outfile, level, name_): if self.ele is not None: showIndent(outfile, level) outfile.write('ele=%f,\n' % self.ele) if self.time is not None: showIndent(outfile, level) outfile.write('time=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.time, input_name='time')) if self.magvar is not None: showIndent(outfile, level) outfile.write('magvar=%f,\n' % self.magvar) if self.geoidheight is not None: showIndent(outfile, level) outfile.write('geoidheight=%f,\n' % self.geoidheight) if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) if self.cmt is not None: showIndent(outfile, level) outfile.write('cmt=%s,\n' % quote_python(self.cmt).encode(ExternalEncoding)) if self.desc is not None: showIndent(outfile, level) outfile.write('desc=%s,\n' % quote_python(self.desc).encode(ExternalEncoding)) if self.src is not None: showIndent(outfile, level) outfile.write('src=%s,\n' % quote_python(self.src).encode(ExternalEncoding)) if self.url is not None: showIndent(outfile, level) outfile.write('url=%s,\n' % quote_python(self.url).encode(ExternalEncoding)) if self.urlname is not None: showIndent(outfile, level) outfile.write('urlname=%s,\n' % quote_python(self.urlname).encode(ExternalEncoding)) if self.sym is not None: showIndent(outfile, level) outfile.write('sym=%s,\n' % quote_python(self.sym).encode(ExternalEncoding)) if self.type_ is not None: showIndent(outfile, level) outfile.write('type_=%s,\n' % quote_python(self.type_).encode(ExternalEncoding)) if self.fix is not None: showIndent(outfile, level) outfile.write('fix=%s,\n' % quote_python(self.fix).encode(ExternalEncoding)) if self.sat is not None: showIndent(outfile, level) outfile.write('sat=%d,\n' % self.sat) if self.hdop is not None: showIndent(outfile, level) outfile.write('hdop=%f,\n' % self.hdop) if self.vdop is not None: showIndent(outfile, level) outfile.write('vdop=%f,\n' % self.vdop) if self.pdop is not None: showIndent(outfile, level) outfile.write('pdop=%f,\n' % self.pdop) if self.ageofdgpsdata is not None: showIndent(outfile, level) outfile.write('ageofdgpsdata=%f,\n' % self.ageofdgpsdata) if self.dgpsid is not None: showIndent(outfile, level) outfile.write('dgpsid=%d,\n' % self.dgpsid) showIndent(outfile, level) outfile.write('anytypeobjs_=[\n') level += 1 for anytypeobjs_ in self.anytypeobjs_: anytypeobjs_.exportLiteral(outfile, level) level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('lat', node) if value is not None and 'lat' not in already_processed: already_processed.add('lat') self.lat = value value = find_attr_value_('lon', node) if value is not None and 'lon' not in already_processed: already_processed.add('lon') self.lon = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'ele': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'ele') self.ele = fval_ elif nodeName_ == 'time': sval_ = child_.text dval_ = self.gds_parse_datetime(sval_) self.time = dval_ elif nodeName_ == 'magvar': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'magvar') self.magvar = fval_ self.validate_degreesType(self.magvar) # validate type degreesType elif nodeName_ == 'geoidheight': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'geoidheight') self.geoidheight = fval_ elif nodeName_ == 'name': name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ elif nodeName_ == 'cmt': cmt_ = child_.text cmt_ = self.gds_validate_string(cmt_, node, 'cmt') self.cmt = cmt_ elif nodeName_ == 'desc': desc_ = child_.text desc_ = self.gds_validate_string(desc_, node, 'desc') self.desc = desc_ elif nodeName_ == 'src': src_ = child_.text src_ = self.gds_validate_string(src_, node, 'src') self.src = src_ elif nodeName_ == 'url': url_ = child_.text url_ = self.gds_validate_string(url_, node, 'url') self.url = url_ elif nodeName_ == 'urlname': urlname_ = child_.text urlname_ = self.gds_validate_string(urlname_, node, 'urlname') self.urlname = urlname_ elif nodeName_ == 'sym': sym_ = child_.text sym_ = self.gds_validate_string(sym_, node, 'sym') self.sym = sym_ elif nodeName_ == 'type': type_ = child_.text type_ = self.gds_validate_string(type_, node, 'type') self.type_ = type_ elif nodeName_ == 'fix': fix_ = child_.text fix_ = self.gds_validate_string(fix_, node, 'fix') self.fix = fix_ self.validate_fixType(self.fix) # validate type fixType elif nodeName_ == 'sat': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'sat') self.sat = ival_ elif nodeName_ == 'hdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'hdop') self.hdop = fval_ elif nodeName_ == 'vdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'vdop') self.vdop = fval_ elif nodeName_ == 'pdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'pdop') self.pdop = fval_ elif nodeName_ == 'ageofdgpsdata': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'ageofdgpsdata') self.ageofdgpsdata = fval_ elif nodeName_ == 'dgpsid': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) ival_ = self.gds_validate_integer(ival_, node, 'dgpsid') self.dgpsid = ival_ self.validate_dgpsStationType(self.dgpsid) # validate type dgpsStationType else: obj_ = self.gds_build_any(child_, 'wptType') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class wptType class rteType(GeneratedsSuper): subclass = None superclass = None def __init__(self, name=None, cmt=None, desc=None, src=None, url=None, urlname=None, number=None, anytypeobjs_=None, rtept=None): self.original_tagname_ = None self.name = name self.cmt = cmt self.desc = desc self.src = src self.url = url self.urlname = urlname self.number = number if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ if rtept is None: self.rtept = [] else: self.rtept = rtept def factory(*args_, **kwargs_): if rteType.subclass: return rteType.subclass(*args_, **kwargs_) else: return rteType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_cmt(self): return self.cmt def set_cmt(self, cmt): self.cmt = cmt def get_desc(self): return self.desc def set_desc(self, desc): self.desc = desc def get_src(self): return self.src def set_src(self, src): self.src = src def get_url(self): return self.url def set_url(self, url): self.url = url def get_urlname(self): return self.urlname def set_urlname(self, urlname): self.urlname = urlname def get_number(self): return self.number def set_number(self, number): self.number = number def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def get_rtept(self): return self.rtept def set_rtept(self, rtept): self.rtept = rtept def add_rtept(self, value): self.rtept.append(value) def insert_rtept(self, index, value): self.rtept[index] = value def hasContent_(self): if ( self.name is not None or self.cmt is not None or self.desc is not None or self.src is not None or self.url is not None or self.urlname is not None or self.number is not None or self.anytypeobjs_ or self.rtept ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='rteType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='rteType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='rteType', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='rteType'): pass def exportChildren(self, outfile, level, namespace_='gpx:', name_='rteType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) if self.cmt is not None: showIndent(outfile, level, pretty_print) outfile.write('<%scmt>%s</%scmt>%s' % (namespace_, self.gds_format_string(quote_xml(self.cmt).encode(ExternalEncoding), input_name='cmt'), namespace_, eol_)) if self.desc is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdesc>%s</%sdesc>%s' % (namespace_, self.gds_format_string(quote_xml(self.desc).encode(ExternalEncoding), input_name='desc'), namespace_, eol_)) if self.src is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssrc>%s</%ssrc>%s' % (namespace_, self.gds_format_string(quote_xml(self.src).encode(ExternalEncoding), input_name='src'), namespace_, eol_)) if self.url is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surl>%s</%surl>%s' % (namespace_, self.gds_format_string(quote_xml(self.url).encode(ExternalEncoding), input_name='url'), namespace_, eol_)) if self.urlname is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surlname>%s</%surlname>%s' % (namespace_, self.gds_format_string(quote_xml(self.urlname).encode(ExternalEncoding), input_name='urlname'), namespace_, eol_)) if self.number is not None: showIndent(outfile, level, pretty_print) outfile.write('<%snumber>%s</%snumber>%s' % (namespace_, self.gds_format_integer(self.number, input_name='number'), namespace_, eol_)) for rtept_ in self.rtept: rtept_.export(outfile, level, namespace_, name_='rtept', pretty_print=pretty_print) for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='rteType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): pass def exportLiteralChildren(self, outfile, level, name_): if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) if self.cmt is not None: showIndent(outfile, level) outfile.write('cmt=%s,\n' % quote_python(self.cmt).encode(ExternalEncoding)) if self.desc is not None: showIndent(outfile, level) outfile.write('desc=%s,\n' % quote_python(self.desc).encode(ExternalEncoding)) if self.src is not None: showIndent(outfile, level) outfile.write('src=%s,\n' % quote_python(self.src).encode(ExternalEncoding)) if self.url is not None: showIndent(outfile, level) outfile.write('url=%s,\n' % quote_python(self.url).encode(ExternalEncoding)) if self.urlname is not None: showIndent(outfile, level) outfile.write('urlname=%s,\n' % quote_python(self.urlname).encode(ExternalEncoding)) if self.number is not None: showIndent(outfile, level) outfile.write('number=%d,\n' % self.number) showIndent(outfile, level) outfile.write('anytypeobjs_=[\n') level += 1 for anytypeobjs_ in self.anytypeobjs_: anytypeobjs_.exportLiteral(outfile, level) level -= 1 showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('rtept=[\n') level += 1 for rtept_ in self.rtept: showIndent(outfile, level) outfile.write('model_.rteptType(\n') rtept_.exportLiteral(outfile, level, name_='rteptType') showIndent(outfile, level) outfile.write('),\n') level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'name': name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ elif nodeName_ == 'cmt': cmt_ = child_.text cmt_ = self.gds_validate_string(cmt_, node, 'cmt') self.cmt = cmt_ elif nodeName_ == 'desc': desc_ = child_.text desc_ = self.gds_validate_string(desc_, node, 'desc') self.desc = desc_ elif nodeName_ == 'src': src_ = child_.text src_ = self.gds_validate_string(src_, node, 'src') self.src = src_ elif nodeName_ == 'url': url_ = child_.text url_ = self.gds_validate_string(url_, node, 'url') self.url = url_ elif nodeName_ == 'urlname': urlname_ = child_.text urlname_ = self.gds_validate_string(urlname_, node, 'urlname') self.urlname = urlname_ elif nodeName_ == 'number': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'number') self.number = ival_ elif nodeName_ == 'rtept': obj_ = rteptType.factory() obj_.build(child_) self.rtept.append(obj_) obj_.original_tagname_ = 'rtept' else: obj_ = self.gds_build_any(child_, 'rteType') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class rteType class rteptType(GeneratedsSuper): subclass = None superclass = None def __init__(self, lat=None, lon=None, ele=None, time=None, magvar=None, geoidheight=None, name=None, cmt=None, desc=None, src=None, url=None, urlname=None, sym=None, type_=None, fix=None, sat=None, hdop=None, vdop=None, pdop=None, ageofdgpsdata=None, dgpsid=None, anytypeobjs_=None): self.original_tagname_ = None self.lat = _cast(None, lat) self.lon = _cast(None, lon) self.ele = ele if isinstance(time, basestring): initvalue_ = datetime_.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S') else: initvalue_ = time self.time = initvalue_ self.magvar = magvar self.geoidheight = geoidheight self.name = name self.cmt = cmt self.desc = desc self.src = src self.url = url self.urlname = urlname self.sym = sym self.type_ = type_ self.fix = fix self.sat = sat self.hdop = hdop self.vdop = vdop self.pdop = pdop self.ageofdgpsdata = ageofdgpsdata self.dgpsid = dgpsid if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ def factory(*args_, **kwargs_): if rteptType.subclass: return rteptType.subclass(*args_, **kwargs_) else: return rteptType(*args_, **kwargs_) factory = staticmethod(factory) def get_ele(self): return self.ele def set_ele(self, ele): self.ele = ele def get_time(self): return self.time def set_time(self, time): self.time = time def get_magvar(self): return self.magvar def set_magvar(self, magvar): self.magvar = magvar def get_geoidheight(self): return self.geoidheight def set_geoidheight(self, geoidheight): self.geoidheight = geoidheight def get_name(self): return self.name def set_name(self, name): self.name = name def get_cmt(self): return self.cmt def set_cmt(self, cmt): self.cmt = cmt def get_desc(self): return self.desc def set_desc(self, desc): self.desc = desc def get_src(self): return self.src def set_src(self, src): self.src = src def get_url(self): return self.url def set_url(self, url): self.url = url def get_urlname(self): return self.urlname def set_urlname(self, urlname): self.urlname = urlname def get_sym(self): return self.sym def set_sym(self, sym): self.sym = sym def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_fix(self): return self.fix def set_fix(self, fix): self.fix = fix def get_sat(self): return self.sat def set_sat(self, sat): self.sat = sat def get_hdop(self): return self.hdop def set_hdop(self, hdop): self.hdop = hdop def get_vdop(self): return self.vdop def set_vdop(self, vdop): self.vdop = vdop def get_pdop(self): return self.pdop def set_pdop(self, pdop): self.pdop = pdop def get_ageofdgpsdata(self): return self.ageofdgpsdata def set_ageofdgpsdata(self, ageofdgpsdata): self.ageofdgpsdata = ageofdgpsdata def get_dgpsid(self): return self.dgpsid def set_dgpsid(self, dgpsid): self.dgpsid = dgpsid def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def get_lat(self): return self.lat def set_lat(self, lat): self.lat = lat def get_lon(self): return self.lon def set_lon(self, lon): self.lon = lon def validate_degreesType(self, value): # Validate type degreesType, a restriction on xsd:decimal. pass def validate_fixType(self, value): # Validate type fixType, a restriction on xsd:string. pass def validate_dgpsStationType(self, value): # Validate type dgpsStationType, a restriction on xsd:integer. pass def hasContent_(self): if ( self.ele is not None or self.time is not None or self.magvar is not None or self.geoidheight is not None or self.name is not None or self.cmt is not None or self.desc is not None or self.src is not None or self.url is not None or self.urlname is not None or self.sym is not None or self.type_ is not None or self.fix is not None or self.sat is not None or self.hdop is not None or self.vdop is not None or self.pdop is not None or self.ageofdgpsdata is not None or self.dgpsid is not None or self.anytypeobjs_ ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='rteptType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='rteptType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='rteptType', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='rteptType'): if self.lat is not None and 'lat' not in already_processed: already_processed.add('lat') outfile.write(' lat=%s' % (quote_attrib(self.lat), )) if self.lon is not None and 'lon' not in already_processed: already_processed.add('lon') outfile.write(' lon=%s' % (quote_attrib(self.lon), )) def exportChildren(self, outfile, level, namespace_='gpx:', name_='rteptType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.ele is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sele>%s</%sele>%s' % (namespace_, self.gds_format_float(self.ele, input_name='ele'), namespace_, eol_)) if self.time is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stime>%s</%stime>%s' % (namespace_, self.gds_format_datetime(self.time, input_name='time'), namespace_, eol_)) if self.magvar is not None: showIndent(outfile, level, pretty_print) outfile.write('<%smagvar>%s</%smagvar>%s' % (namespace_, self.gds_format_float(self.magvar, input_name='magvar'), namespace_, eol_)) if self.geoidheight is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sgeoidheight>%s</%sgeoidheight>%s' % (namespace_, self.gds_format_float(self.geoidheight, input_name='geoidheight'), namespace_, eol_)) if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) if self.cmt is not None: showIndent(outfile, level, pretty_print) outfile.write('<%scmt>%s</%scmt>%s' % (namespace_, self.gds_format_string(quote_xml(self.cmt).encode(ExternalEncoding), input_name='cmt'), namespace_, eol_)) if self.desc is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdesc>%s</%sdesc>%s' % (namespace_, self.gds_format_string(quote_xml(self.desc).encode(ExternalEncoding), input_name='desc'), namespace_, eol_)) if self.src is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssrc>%s</%ssrc>%s' % (namespace_, self.gds_format_string(quote_xml(self.src).encode(ExternalEncoding), input_name='src'), namespace_, eol_)) if self.url is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surl>%s</%surl>%s' % (namespace_, self.gds_format_string(quote_xml(self.url).encode(ExternalEncoding), input_name='url'), namespace_, eol_)) if self.urlname is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surlname>%s</%surlname>%s' % (namespace_, self.gds_format_string(quote_xml(self.urlname).encode(ExternalEncoding), input_name='urlname'), namespace_, eol_)) if self.sym is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssym>%s</%ssym>%s' % (namespace_, self.gds_format_string(quote_xml(self.sym).encode(ExternalEncoding), input_name='sym'), namespace_, eol_)) if self.type_ is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stype>%s</%stype>%s' % (namespace_, self.gds_format_string(quote_xml(self.type_).encode(ExternalEncoding), input_name='type'), namespace_, eol_)) if self.fix is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sfix>%s</%sfix>%s' % (namespace_, self.gds_format_string(quote_xml(self.fix).encode(ExternalEncoding), input_name='fix'), namespace_, eol_)) if self.sat is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssat>%s</%ssat>%s' % (namespace_, self.gds_format_integer(self.sat, input_name='sat'), namespace_, eol_)) if self.hdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%shdop>%s</%shdop>%s' % (namespace_, self.gds_format_float(self.hdop, input_name='hdop'), namespace_, eol_)) if self.vdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%svdop>%s</%svdop>%s' % (namespace_, self.gds_format_float(self.vdop, input_name='vdop'), namespace_, eol_)) if self.pdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%spdop>%s</%spdop>%s' % (namespace_, self.gds_format_float(self.pdop, input_name='pdop'), namespace_, eol_)) if self.ageofdgpsdata is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sageofdgpsdata>%s</%sageofdgpsdata>%s' % (namespace_, self.gds_format_float(self.ageofdgpsdata, input_name='ageofdgpsdata'), namespace_, eol_)) if self.dgpsid is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdgpsid>%s</%sdgpsid>%s' % (namespace_, self.gds_format_integer(self.dgpsid, input_name='dgpsid'), namespace_, eol_)) for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='rteptType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): if self.lat is not None and 'lat' not in already_processed: already_processed.add('lat') showIndent(outfile, level) outfile.write('lat=%s,\n' % (self.lat,)) if self.lon is not None and 'lon' not in already_processed: already_processed.add('lon') showIndent(outfile, level) outfile.write('lon=%s,\n' % (self.lon,)) def exportLiteralChildren(self, outfile, level, name_): if self.ele is not None: showIndent(outfile, level) outfile.write('ele=%f,\n' % self.ele) if self.time is not None: showIndent(outfile, level) outfile.write('time=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.time, input_name='time')) if self.magvar is not None: showIndent(outfile, level) outfile.write('magvar=%f,\n' % self.magvar) if self.geoidheight is not None: showIndent(outfile, level) outfile.write('geoidheight=%f,\n' % self.geoidheight) if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) if self.cmt is not None: showIndent(outfile, level) outfile.write('cmt=%s,\n' % quote_python(self.cmt).encode(ExternalEncoding)) if self.desc is not None: showIndent(outfile, level) outfile.write('desc=%s,\n' % quote_python(self.desc).encode(ExternalEncoding)) if self.src is not None: showIndent(outfile, level) outfile.write('src=%s,\n' % quote_python(self.src).encode(ExternalEncoding)) if self.url is not None: showIndent(outfile, level) outfile.write('url=%s,\n' % quote_python(self.url).encode(ExternalEncoding)) if self.urlname is not None: showIndent(outfile, level) outfile.write('urlname=%s,\n' % quote_python(self.urlname).encode(ExternalEncoding)) if self.sym is not None: showIndent(outfile, level) outfile.write('sym=%s,\n' % quote_python(self.sym).encode(ExternalEncoding)) if self.type_ is not None: showIndent(outfile, level) outfile.write('type_=%s,\n' % quote_python(self.type_).encode(ExternalEncoding)) if self.fix is not None: showIndent(outfile, level) outfile.write('fix=%s,\n' % quote_python(self.fix).encode(ExternalEncoding)) if self.sat is not None: showIndent(outfile, level) outfile.write('sat=%d,\n' % self.sat) if self.hdop is not None: showIndent(outfile, level) outfile.write('hdop=%f,\n' % self.hdop) if self.vdop is not None: showIndent(outfile, level) outfile.write('vdop=%f,\n' % self.vdop) if self.pdop is not None: showIndent(outfile, level) outfile.write('pdop=%f,\n' % self.pdop) if self.ageofdgpsdata is not None: showIndent(outfile, level) outfile.write('ageofdgpsdata=%f,\n' % self.ageofdgpsdata) if self.dgpsid is not None: showIndent(outfile, level) outfile.write('dgpsid=%d,\n' % self.dgpsid) showIndent(outfile, level) outfile.write('anytypeobjs_=[\n') level += 1 for anytypeobjs_ in self.anytypeobjs_: anytypeobjs_.exportLiteral(outfile, level) level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('lat', node) if value is not None and 'lat' not in already_processed: already_processed.add('lat') self.lat = value value = find_attr_value_('lon', node) if value is not None and 'lon' not in already_processed: already_processed.add('lon') self.lon = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'ele': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'ele') self.ele = fval_ elif nodeName_ == 'time': sval_ = child_.text dval_ = self.gds_parse_datetime(sval_) self.time = dval_ elif nodeName_ == 'magvar': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'magvar') self.magvar = fval_ self.validate_degreesType(self.magvar) # validate type degreesType elif nodeName_ == 'geoidheight': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'geoidheight') self.geoidheight = fval_ elif nodeName_ == 'name': name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ elif nodeName_ == 'cmt': cmt_ = child_.text cmt_ = self.gds_validate_string(cmt_, node, 'cmt') self.cmt = cmt_ elif nodeName_ == 'desc': desc_ = child_.text desc_ = self.gds_validate_string(desc_, node, 'desc') self.desc = desc_ elif nodeName_ == 'src': src_ = child_.text src_ = self.gds_validate_string(src_, node, 'src') self.src = src_ elif nodeName_ == 'url': url_ = child_.text url_ = self.gds_validate_string(url_, node, 'url') self.url = url_ elif nodeName_ == 'urlname': urlname_ = child_.text urlname_ = self.gds_validate_string(urlname_, node, 'urlname') self.urlname = urlname_ elif nodeName_ == 'sym': sym_ = child_.text sym_ = self.gds_validate_string(sym_, node, 'sym') self.sym = sym_ elif nodeName_ == 'type': type_ = child_.text type_ = self.gds_validate_string(type_, node, 'type') self.type_ = type_ elif nodeName_ == 'fix': fix_ = child_.text fix_ = self.gds_validate_string(fix_, node, 'fix') self.fix = fix_ self.validate_fixType(self.fix) # validate type fixType elif nodeName_ == 'sat': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'sat') self.sat = ival_ elif nodeName_ == 'hdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'hdop') self.hdop = fval_ elif nodeName_ == 'vdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'vdop') self.vdop = fval_ elif nodeName_ == 'pdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'pdop') self.pdop = fval_ elif nodeName_ == 'ageofdgpsdata': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'ageofdgpsdata') self.ageofdgpsdata = fval_ elif nodeName_ == 'dgpsid': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) ival_ = self.gds_validate_integer(ival_, node, 'dgpsid') self.dgpsid = ival_ self.validate_dgpsStationType(self.dgpsid) # validate type dgpsStationType else: obj_ = self.gds_build_any(child_, 'rteptType') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class rteptType class trkType(GeneratedsSuper): subclass = None superclass = None def __init__(self, name=None, cmt=None, desc=None, src=None, url=None, urlname=None, number=None, anytypeobjs_=None, trkseg=None): self.original_tagname_ = None self.name = name self.cmt = cmt self.desc = desc self.src = src self.url = url self.urlname = urlname self.number = number if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ if trkseg is None: self.trkseg = [] else: self.trkseg = trkseg def factory(*args_, **kwargs_): if trkType.subclass: return trkType.subclass(*args_, **kwargs_) else: return trkType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_cmt(self): return self.cmt def set_cmt(self, cmt): self.cmt = cmt def get_desc(self): return self.desc def set_desc(self, desc): self.desc = desc def get_src(self): return self.src def set_src(self, src): self.src = src def get_url(self): return self.url def set_url(self, url): self.url = url def get_urlname(self): return self.urlname def set_urlname(self, urlname): self.urlname = urlname def get_number(self): return self.number def set_number(self, number): self.number = number def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def get_trkseg(self): return self.trkseg def set_trkseg(self, trkseg): self.trkseg = trkseg def add_trkseg(self, value): self.trkseg.append(value) def insert_trkseg(self, index, value): self.trkseg[index] = value def hasContent_(self): if ( self.name is not None or self.cmt is not None or self.desc is not None or self.src is not None or self.url is not None or self.urlname is not None or self.number is not None or self.anytypeobjs_ or self.trkseg ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='trkType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='trkType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='trkType', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='trkType'): pass def exportChildren(self, outfile, level, namespace_='gpx:', name_='trkType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) if self.cmt is not None: showIndent(outfile, level, pretty_print) outfile.write('<%scmt>%s</%scmt>%s' % (namespace_, self.gds_format_string(quote_xml(self.cmt).encode(ExternalEncoding), input_name='cmt'), namespace_, eol_)) if self.desc is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdesc>%s</%sdesc>%s' % (namespace_, self.gds_format_string(quote_xml(self.desc).encode(ExternalEncoding), input_name='desc'), namespace_, eol_)) if self.src is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssrc>%s</%ssrc>%s' % (namespace_, self.gds_format_string(quote_xml(self.src).encode(ExternalEncoding), input_name='src'), namespace_, eol_)) if self.url is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surl>%s</%surl>%s' % (namespace_, self.gds_format_string(quote_xml(self.url).encode(ExternalEncoding), input_name='url'), namespace_, eol_)) if self.urlname is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surlname>%s</%surlname>%s' % (namespace_, self.gds_format_string(quote_xml(self.urlname).encode(ExternalEncoding), input_name='urlname'), namespace_, eol_)) if self.number is not None: showIndent(outfile, level, pretty_print) outfile.write('<%snumber>%s</%snumber>%s' % (namespace_, self.gds_format_integer(self.number, input_name='number'), namespace_, eol_)) for trkseg_ in self.trkseg: trkseg_.export(outfile, level, namespace_, name_='trkseg', pretty_print=pretty_print) for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='trkType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): pass def exportLiteralChildren(self, outfile, level, name_): if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) if self.cmt is not None: showIndent(outfile, level) outfile.write('cmt=%s,\n' % quote_python(self.cmt).encode(ExternalEncoding)) if self.desc is not None: showIndent(outfile, level) outfile.write('desc=%s,\n' % quote_python(self.desc).encode(ExternalEncoding)) if self.src is not None: showIndent(outfile, level) outfile.write('src=%s,\n' % quote_python(self.src).encode(ExternalEncoding)) if self.url is not None: showIndent(outfile, level) outfile.write('url=%s,\n' % quote_python(self.url).encode(ExternalEncoding)) if self.urlname is not None: showIndent(outfile, level) outfile.write('urlname=%s,\n' % quote_python(self.urlname).encode(ExternalEncoding)) if self.number is not None: showIndent(outfile, level) outfile.write('number=%d,\n' % self.number) showIndent(outfile, level) outfile.write('anytypeobjs_=[\n') level += 1 for anytypeobjs_ in self.anytypeobjs_: anytypeobjs_.exportLiteral(outfile, level) level -= 1 showIndent(outfile, level) outfile.write('],\n') showIndent(outfile, level) outfile.write('trkseg=[\n') level += 1 for trkseg_ in self.trkseg: showIndent(outfile, level) outfile.write('model_.trksegType(\n') trkseg_.exportLiteral(outfile, level, name_='trksegType') showIndent(outfile, level) outfile.write('),\n') level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'name': name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ elif nodeName_ == 'cmt': cmt_ = child_.text cmt_ = self.gds_validate_string(cmt_, node, 'cmt') self.cmt = cmt_ elif nodeName_ == 'desc': desc_ = child_.text desc_ = self.gds_validate_string(desc_, node, 'desc') self.desc = desc_ elif nodeName_ == 'src': src_ = child_.text src_ = self.gds_validate_string(src_, node, 'src') self.src = src_ elif nodeName_ == 'url': url_ = child_.text url_ = self.gds_validate_string(url_, node, 'url') self.url = url_ elif nodeName_ == 'urlname': urlname_ = child_.text urlname_ = self.gds_validate_string(urlname_, node, 'urlname') self.urlname = urlname_ elif nodeName_ == 'number': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'number') self.number = ival_ elif nodeName_ == 'trkseg': obj_ = trksegType.factory() obj_.build(child_) self.trkseg.append(obj_) obj_.original_tagname_ = 'trkseg' else: obj_ = self.gds_build_any(child_, 'trkType') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class trkType class trksegType(GeneratedsSuper): subclass = None superclass = None def __init__(self, trkpt=None): self.original_tagname_ = None if trkpt is None: self.trkpt = [] else: self.trkpt = trkpt def factory(*args_, **kwargs_): if trksegType.subclass: return trksegType.subclass(*args_, **kwargs_) else: return trksegType(*args_, **kwargs_) factory = staticmethod(factory) def get_trkpt(self): return self.trkpt def set_trkpt(self, trkpt): self.trkpt = trkpt def add_trkpt(self, value): self.trkpt.append(value) def insert_trkpt(self, index, value): self.trkpt[index] = value def hasContent_(self): if ( self.trkpt ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='trksegType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='trksegType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='trksegType', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='trksegType'): pass def exportChildren(self, outfile, level, namespace_='gpx:', name_='trksegType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for trkpt_ in self.trkpt: trkpt_.export(outfile, level, namespace_, name_='trkpt', pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='trksegType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): pass def exportLiteralChildren(self, outfile, level, name_): showIndent(outfile, level) outfile.write('trkpt=[\n') level += 1 for trkpt_ in self.trkpt: showIndent(outfile, level) outfile.write('model_.trkptType(\n') trkpt_.exportLiteral(outfile, level, name_='trkptType') showIndent(outfile, level) outfile.write('),\n') level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'trkpt': obj_ = trkptType.factory() obj_.build(child_) self.trkpt.append(obj_) obj_.original_tagname_ = 'trkpt' # end class trksegType class trkptType(GeneratedsSuper): subclass = None superclass = None def __init__(self, lat=None, lon=None, ele=None, time=None, course=None, speed=None, magvar=None, geoidheight=None, name=None, cmt=None, desc=None, src=None, url=None, urlname=None, sym=None, type_=None, fix=None, sat=None, hdop=None, vdop=None, pdop=None, ageofdgpsdata=None, dgpsid=None, anytypeobjs_=None): self.original_tagname_ = None self.lat = _cast(None, lat) self.lon = _cast(None, lon) self.ele = ele if isinstance(time, basestring): initvalue_ = datetime_.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S') else: initvalue_ = time self.time = initvalue_ self.course = course self.speed = speed self.magvar = magvar self.geoidheight = geoidheight self.name = name self.cmt = cmt self.desc = desc self.src = src self.url = url self.urlname = urlname self.sym = sym self.type_ = type_ self.fix = fix self.sat = sat self.hdop = hdop self.vdop = vdop self.pdop = pdop self.ageofdgpsdata = ageofdgpsdata self.dgpsid = dgpsid if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ def factory(*args_, **kwargs_): if trkptType.subclass: return trkptType.subclass(*args_, **kwargs_) else: return trkptType(*args_, **kwargs_) factory = staticmethod(factory) def get_ele(self): return self.ele def set_ele(self, ele): self.ele = ele def get_time(self): return self.time def set_time(self, time): self.time = time def get_course(self): return self.course def set_course(self, course): self.course = course def get_speed(self): return self.speed def set_speed(self, speed): self.speed = speed def get_magvar(self): return self.magvar def set_magvar(self, magvar): self.magvar = magvar def get_geoidheight(self): return self.geoidheight def set_geoidheight(self, geoidheight): self.geoidheight = geoidheight def get_name(self): return self.name def set_name(self, name): self.name = name def get_cmt(self): return self.cmt def set_cmt(self, cmt): self.cmt = cmt def get_desc(self): return self.desc def set_desc(self, desc): self.desc = desc def get_src(self): return self.src def set_src(self, src): self.src = src def get_url(self): return self.url def set_url(self, url): self.url = url def get_urlname(self): return self.urlname def set_urlname(self, urlname): self.urlname = urlname def get_sym(self): return self.sym def set_sym(self, sym): self.sym = sym def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_fix(self): return self.fix def set_fix(self, fix): self.fix = fix def get_sat(self): return self.sat def set_sat(self, sat): self.sat = sat def get_hdop(self): return self.hdop def set_hdop(self, hdop): self.hdop = hdop def get_vdop(self): return self.vdop def set_vdop(self, vdop): self.vdop = vdop def get_pdop(self): return self.pdop def set_pdop(self, pdop): self.pdop = pdop def get_ageofdgpsdata(self): return self.ageofdgpsdata def set_ageofdgpsdata(self, ageofdgpsdata): self.ageofdgpsdata = ageofdgpsdata def get_dgpsid(self): return self.dgpsid def set_dgpsid(self, dgpsid): self.dgpsid = dgpsid def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def get_lat(self): return self.lat def set_lat(self, lat): self.lat = lat def get_lon(self): return self.lon def set_lon(self, lon): self.lon = lon def validate_degreesType(self, value): # Validate type degreesType, a restriction on xsd:decimal. pass def validate_fixType(self, value): # Validate type fixType, a restriction on xsd:string. pass def validate_dgpsStationType(self, value): # Validate type dgpsStationType, a restriction on xsd:integer. pass def hasContent_(self): if ( self.ele is not None or self.time is not None or self.course is not None or self.speed is not None or self.magvar is not None or self.geoidheight is not None or self.name is not None or self.cmt is not None or self.desc is not None or self.src is not None or self.url is not None or self.urlname is not None or self.sym is not None or self.type_ is not None or self.fix is not None or self.sat is not None or self.hdop is not None or self.vdop is not None or self.pdop is not None or self.ageofdgpsdata is not None or self.dgpsid is not None or self.anytypeobjs_ ): return True else: return False def export(self, outfile, level, namespace_='gpx:', name_='trkptType', namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='trkptType') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='gpx:', name_='trkptType', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='gpx:', name_='trkptType'): if self.lat is not None and 'lat' not in already_processed: already_processed.add('lat') outfile.write(' lat=%s' % (quote_attrib(self.lat), )) if self.lon is not None and 'lon' not in already_processed: already_processed.add('lon') outfile.write(' lon=%s' % (quote_attrib(self.lon), )) def exportChildren(self, outfile, level, namespace_='gpx:', name_='trkptType', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.ele is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sele>%s</%sele>%s' % (namespace_, self.gds_format_float(self.ele, input_name='ele'), namespace_, eol_)) if self.time is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stime>%s</%stime>%s' % (namespace_, self.gds_format_datetime(self.time, input_name='time'), namespace_, eol_)) if self.course is not None: showIndent(outfile, level, pretty_print) outfile.write('<%scourse>%s</%scourse>%s' % (namespace_, self.gds_format_float(self.course, input_name='course'), namespace_, eol_)) if self.speed is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sspeed>%s</%sspeed>%s' % (namespace_, self.gds_format_float(self.speed, input_name='speed'), namespace_, eol_)) if self.magvar is not None: showIndent(outfile, level, pretty_print) outfile.write('<%smagvar>%s</%smagvar>%s' % (namespace_, self.gds_format_float(self.magvar, input_name='magvar'), namespace_, eol_)) if self.geoidheight is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sgeoidheight>%s</%sgeoidheight>%s' % (namespace_, self.gds_format_float(self.geoidheight, input_name='geoidheight'), namespace_, eol_)) if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) if self.cmt is not None: showIndent(outfile, level, pretty_print) outfile.write('<%scmt>%s</%scmt>%s' % (namespace_, self.gds_format_string(quote_xml(self.cmt).encode(ExternalEncoding), input_name='cmt'), namespace_, eol_)) if self.desc is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdesc>%s</%sdesc>%s' % (namespace_, self.gds_format_string(quote_xml(self.desc).encode(ExternalEncoding), input_name='desc'), namespace_, eol_)) if self.src is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssrc>%s</%ssrc>%s' % (namespace_, self.gds_format_string(quote_xml(self.src).encode(ExternalEncoding), input_name='src'), namespace_, eol_)) if self.url is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surl>%s</%surl>%s' % (namespace_, self.gds_format_string(quote_xml(self.url).encode(ExternalEncoding), input_name='url'), namespace_, eol_)) if self.urlname is not None: showIndent(outfile, level, pretty_print) outfile.write('<%surlname>%s</%surlname>%s' % (namespace_, self.gds_format_string(quote_xml(self.urlname).encode(ExternalEncoding), input_name='urlname'), namespace_, eol_)) if self.sym is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssym>%s</%ssym>%s' % (namespace_, self.gds_format_string(quote_xml(self.sym).encode(ExternalEncoding), input_name='sym'), namespace_, eol_)) if self.type_ is not None: showIndent(outfile, level, pretty_print) outfile.write('<%stype>%s</%stype>%s' % (namespace_, self.gds_format_string(quote_xml(self.type_).encode(ExternalEncoding), input_name='type'), namespace_, eol_)) if self.fix is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sfix>%s</%sfix>%s' % (namespace_, self.gds_format_string(quote_xml(self.fix).encode(ExternalEncoding), input_name='fix'), namespace_, eol_)) if self.sat is not None: showIndent(outfile, level, pretty_print) outfile.write('<%ssat>%s</%ssat>%s' % (namespace_, self.gds_format_integer(self.sat, input_name='sat'), namespace_, eol_)) if self.hdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%shdop>%s</%shdop>%s' % (namespace_, self.gds_format_float(self.hdop, input_name='hdop'), namespace_, eol_)) if self.vdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%svdop>%s</%svdop>%s' % (namespace_, self.gds_format_float(self.vdop, input_name='vdop'), namespace_, eol_)) if self.pdop is not None: showIndent(outfile, level, pretty_print) outfile.write('<%spdop>%s</%spdop>%s' % (namespace_, self.gds_format_float(self.pdop, input_name='pdop'), namespace_, eol_)) if self.ageofdgpsdata is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sageofdgpsdata>%s</%sageofdgpsdata>%s' % (namespace_, self.gds_format_float(self.ageofdgpsdata, input_name='ageofdgpsdata'), namespace_, eol_)) if self.dgpsid is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdgpsid>%s</%sdgpsid>%s' % (namespace_, self.gds_format_integer(self.dgpsid, input_name='dgpsid'), namespace_, eol_)) for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='trkptType'): level += 1 already_processed = set() self.exportLiteralAttributes(outfile, level, already_processed, name_) if self.hasContent_(): self.exportLiteralChildren(outfile, level, name_) def exportLiteralAttributes(self, outfile, level, already_processed, name_): if self.lat is not None and 'lat' not in already_processed: already_processed.add('lat') showIndent(outfile, level) outfile.write('lat=%s,\n' % (self.lat,)) if self.lon is not None and 'lon' not in already_processed: already_processed.add('lon') showIndent(outfile, level) outfile.write('lon=%s,\n' % (self.lon,)) def exportLiteralChildren(self, outfile, level, name_): if self.ele is not None: showIndent(outfile, level) outfile.write('ele=%f,\n' % self.ele) if self.time is not None: showIndent(outfile, level) outfile.write('time=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.time, input_name='time')) if self.course is not None: showIndent(outfile, level) outfile.write('course=%f,\n' % self.course) if self.speed is not None: showIndent(outfile, level) outfile.write('speed=%f,\n' % self.speed) if self.magvar is not None: showIndent(outfile, level) outfile.write('magvar=%f,\n' % self.magvar) if self.geoidheight is not None: showIndent(outfile, level) outfile.write('geoidheight=%f,\n' % self.geoidheight) if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) if self.cmt is not None: showIndent(outfile, level) outfile.write('cmt=%s,\n' % quote_python(self.cmt).encode(ExternalEncoding)) if self.desc is not None: showIndent(outfile, level) outfile.write('desc=%s,\n' % quote_python(self.desc).encode(ExternalEncoding)) if self.src is not None: showIndent(outfile, level) outfile.write('src=%s,\n' % quote_python(self.src).encode(ExternalEncoding)) if self.url is not None: showIndent(outfile, level) outfile.write('url=%s,\n' % quote_python(self.url).encode(ExternalEncoding)) if self.urlname is not None: showIndent(outfile, level) outfile.write('urlname=%s,\n' % quote_python(self.urlname).encode(ExternalEncoding)) if self.sym is not None: showIndent(outfile, level) outfile.write('sym=%s,\n' % quote_python(self.sym).encode(ExternalEncoding)) if self.type_ is not None: showIndent(outfile, level) outfile.write('type_=%s,\n' % quote_python(self.type_).encode(ExternalEncoding)) if self.fix is not None: showIndent(outfile, level) outfile.write('fix=%s,\n' % quote_python(self.fix).encode(ExternalEncoding)) if self.sat is not None: showIndent(outfile, level) outfile.write('sat=%d,\n' % self.sat) if self.hdop is not None: showIndent(outfile, level) outfile.write('hdop=%f,\n' % self.hdop) if self.vdop is not None: showIndent(outfile, level) outfile.write('vdop=%f,\n' % self.vdop) if self.pdop is not None: showIndent(outfile, level) outfile.write('pdop=%f,\n' % self.pdop) if self.ageofdgpsdata is not None: showIndent(outfile, level) outfile.write('ageofdgpsdata=%f,\n' % self.ageofdgpsdata) if self.dgpsid is not None: showIndent(outfile, level) outfile.write('dgpsid=%d,\n' % self.dgpsid) showIndent(outfile, level) outfile.write('anytypeobjs_=[\n') level += 1 for anytypeobjs_ in self.anytypeobjs_: anytypeobjs_.exportLiteral(outfile, level) level -= 1 showIndent(outfile, level) outfile.write('],\n') def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('lat', node) if value is not None and 'lat' not in already_processed: already_processed.add('lat') self.lat = value value = find_attr_value_('lon', node) if value is not None and 'lon' not in already_processed: already_processed.add('lon') self.lon = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'ele': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'ele') self.ele = fval_ elif nodeName_ == 'time': sval_ = child_.text dval_ = self.gds_parse_datetime(sval_) self.time = dval_ elif nodeName_ == 'course': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'course') self.course = fval_ self.validate_degreesType(self.course) # validate type degreesType elif nodeName_ == 'speed': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'speed') self.speed = fval_ elif nodeName_ == 'magvar': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'magvar') self.magvar = fval_ self.validate_degreesType(self.magvar) # validate type degreesType elif nodeName_ == 'geoidheight': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'geoidheight') self.geoidheight = fval_ elif nodeName_ == 'name': name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ elif nodeName_ == 'cmt': cmt_ = child_.text cmt_ = self.gds_validate_string(cmt_, node, 'cmt') self.cmt = cmt_ elif nodeName_ == 'desc': desc_ = child_.text desc_ = self.gds_validate_string(desc_, node, 'desc') self.desc = desc_ elif nodeName_ == 'src': src_ = child_.text src_ = self.gds_validate_string(src_, node, 'src') self.src = src_ elif nodeName_ == 'url': url_ = child_.text url_ = self.gds_validate_string(url_, node, 'url') self.url = url_ elif nodeName_ == 'urlname': urlname_ = child_.text urlname_ = self.gds_validate_string(urlname_, node, 'urlname') self.urlname = urlname_ elif nodeName_ == 'sym': sym_ = child_.text sym_ = self.gds_validate_string(sym_, node, 'sym') self.sym = sym_ elif nodeName_ == 'type': type_ = child_.text type_ = self.gds_validate_string(type_, node, 'type') self.type_ = type_ elif nodeName_ == 'fix': fix_ = child_.text fix_ = self.gds_validate_string(fix_, node, 'fix') self.fix = fix_ self.validate_fixType(self.fix) # validate type fixType elif nodeName_ == 'sat': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'sat') self.sat = ival_ elif nodeName_ == 'hdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'hdop') self.hdop = fval_ elif nodeName_ == 'vdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'vdop') self.vdop = fval_ elif nodeName_ == 'pdop': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'pdop') self.pdop = fval_ elif nodeName_ == 'ageofdgpsdata': sval_ = child_.text try: fval_ = float(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires float or double: %s' % exp) fval_ = self.gds_validate_float(fval_, node, 'ageofdgpsdata') self.ageofdgpsdata = fval_ elif nodeName_ == 'dgpsid': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError), exp: raise_parse_error(child_, 'requires integer: %s' % exp) ival_ = self.gds_validate_integer(ival_, node, 'dgpsid') self.dgpsid = ival_ self.validate_dgpsStationType(self.dgpsid) # validate type dgpsStationType else: obj_ = self.gds_build_any(child_, 'trkptType') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class trkptType GDSClassesMapping = { 'rte': rteType, 'trk': trkType, 'wpt': wptType, 'bounds': boundsType, 'trkpt': trkptType, 'rtept': rteptType, 'trkseg': trksegType, } USAGE_TEXT = """ Usage: python <Parser>.py [ -s ] <in_xml_file> """ def usage(): print USAGE_TEXT sys.exit(1) def get_root_tag(node): tag = Tag_pattern_.match(node.tag).groups()[-1] rootClass = GDSClassesMapping.get(tag) if rootClass is None: rootClass = globals().get(tag) return tag, rootClass def parse(inFileName, silence=False): doc = parsexml_(inFileName) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'gpx' rootClass = gpx rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"', pretty_print=True) return rootObj def parseEtree(inFileName, silence=False): doc = parsexml_(inFileName) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'gpx' rootClass = gpx rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None mapping = {} rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping) reverse_mapping = rootObj.gds_reverse_node_mapping(mapping) if not silence: content = etree_.tostring( rootElement, pretty_print=True, xml_declaration=True, encoding="utf-8") sys.stdout.write(content) sys.stdout.write('\n') return rootObj, rootElement, mapping, reverse_mapping def parseString(inString, silence=False): from StringIO import StringIO doc = parsexml_(StringIO(inString)) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'gpx' rootClass = gpx rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='xmlns:gpx="http://www.topografix.com/GPX/1/0"') return rootObj def parseLiteral(inFileName, silence=False): doc = parsexml_(inFileName) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'gpx' rootClass = gpx rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('#from gpx10 import *\n\n') sys.stdout.write('import gpx10 as model_\n\n') sys.stdout.write('rootObj = model_.rootClass(\n') rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) sys.stdout.write(')\n') return rootObj def main(): args = sys.argv[1:] if len(args) == 1: parse(args[0]) else: usage() if __name__ == '__main__': #import pdb; pdb.set_trace() main() __all__ = [ "boundsType", "gpx", "rteType", "rteptType", "trkType", "trkptType", "trksegType", "wptType" ]
45.31555
313
0.598299
16,213
139,300
4.929131
0.030038
0.051654
0.034912
0.038753
0.865596
0.838581
0.822626
0.806947
0.800053
0.791969
0
0.004112
0.287789
139,300
3,073
314
45.330296
0.801403
0.019978
0
0.785739
1
0.000343
0.064375
0.012572
0
0
0
0
0
0
null
null
0.008228
0.013027
null
null
0.054851
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
1
0
0
0
0
0
0
0
0
9
bf2b999f31e1654813749d9c3a7e5f1c2f0810e6
1,399
py
Python
optimizer.py
resistzzz/ToyNN_new
9811f91393f98b0f16b49ce9299ca4c96c92cdf1
[ "MIT" ]
null
null
null
optimizer.py
resistzzz/ToyNN_new
9811f91393f98b0f16b49ce9299ca4c96c92cdf1
[ "MIT" ]
null
null
null
optimizer.py
resistzzz/ToyNN_new
9811f91393f98b0f16b49ce9299ca4c96c92cdf1
[ "MIT" ]
null
null
null
""" """ import numpy as np class SGD: def __init__(self, lr): self.learning_rate = lr def set_lr(self, lr): self.learning_rate = lr def _optimize_func(self, data, grad): delta = -grad * self.learning_rate return delta def optimize(self, params): for _, param in params.items(): delta = self._optimize_func(param.get_data(), param.get_grad()) param.update(delta) class Momentum: learning_rate = 1e-2 def __init__(self, lr): self.learning_rate = lr def set_lr(self, lr): self.learning_rate = lr def _optimize_func(self, data, grad): delta = 0.0 * self.learning_rate # TODO: Momentum Optimize return delta def optimize(self, params): for param in params: delta = self._optimize_func(param.get_data(), param.get_grad()) param.update(delta) class AdaDelta: learning_rate = 1e-2 def __init__(self, lr): self.learning_rate = lr def set_lr(self, lr): self.learning_rate = lr def _optimize_func(self, data, grad): delta = 0.0 * self.learning_rate # TODO: AdaDelta Optimize return delta def optimize(self, params): for param in params: delta = self._optimize_func(param.get_data(), param.get_grad()) param.update(delta)
20.275362
75
0.598284
180
1,399
4.4
0.177778
0.166667
0.181818
0.136364
0.89899
0.89899
0.89899
0.89899
0.89899
0.89899
0
0.00818
0.300929
1,399
69
76
20.275362
0.801636
0.033595
0
0.846154
0
0
0
0
0
0
0
0.014493
0
1
0.307692
false
0
0.025641
0
0.538462
0
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
1
0
0
1
0
0
0
0
1
0
0
11
1767c9a6366635f889bb83482681cfbe30e87bef
16,508
py
Python
App/services/RequestStrategy.py
pkamleshkumar12/cli-http-client
e72c6c299b79d16c176537074dda5674f97fb651
[ "Apache-2.0" ]
null
null
null
App/services/RequestStrategy.py
pkamleshkumar12/cli-http-client
e72c6c299b79d16c176537074dda5674f97fb651
[ "Apache-2.0" ]
null
null
null
App/services/RequestStrategy.py
pkamleshkumar12/cli-http-client
e72c6c299b79d16c176537074dda5674f97fb651
[ "Apache-2.0" ]
null
null
null
from __future__ import annotations from abc import ABC, abstractmethod from App import Configuration import json import requests import os from datetime import datetime from App.services import IOService import logging import sys from App.services.AuthHandler import AuthHandler class Context: def __init__(self, strategy: RequestStrategy, config: Configuration) -> None: self.config = config self._strategy = strategy self.logger = self.setup_custom_logger() @property def strategy(self) -> RequestStrategy: return self._strategy @strategy.setter def strategy(self, strategy: RequestStrategy) -> None: self._strategy = strategy def do_get_request(self) -> None: result = self._strategy.send_get_request(self.config, self.logger) print(result) def do_post_request(self) -> None: result = self._strategy.send_post_request(self.config, self.logger) print(result) def do_delete_request(self) -> None: result = self._strategy.send_delete_request(self.config, self.logger) print(result) def setup_custom_logger(self): try: formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') handler = logging.FileHandler(self.set_log_file_path(), mode='w') handler.setFormatter(formatter) screen_handler = logging.StreamHandler(stream=sys.stdout) screen_handler.setFormatter(formatter) logger = logging.getLogger(None) logger.setLevel(logging.DEBUG) logger.addHandler(handler) logger.addHandler(screen_handler) return logger except Exception as e: print("Exception occurred while configuring logs") print("Hint: try creating 'logs' directory in the root directory") SystemExit(e) sys.exit() def set_log_file_path(self): if self.config.exportLogsTo: return os.path.join('logs', self.config.exportLogsTo) else: now = datetime.now() return os.path.join('logs', self.config.interfaceName + "_" + now.strftime("%H%M%S") + ".log") class RequestStrategy(ABC): @abstractmethod def send_get_request(self, configuration: Configuration, logger): pass @abstractmethod def send_post_request(self, configuration: Configuration, logger): pass @abstractmethod def send_delete_request(self, configuration: Configuration, logger): pass class RequestStrategyBySOAP(RequestStrategy): def __init__(self): self.config = None self.headers = None self.env = None self.path = None self.pathVariable = None self.queryParameters = None def send_get_request(self, configuration, logger) -> str: logger.info(configuration) return "SOAP Get Request Executed" def send_post_request(self, configuration, logger) -> str: try: self.config = configuration self.env = self.load_env_variables() self.path = self.load_path() self.headers = self.load_headers() self.pathVariable = self.load_path_variable() self.queryParameters = self.load_query_parameter() except Exception as e: print("Exception occurred while loading configurations at send_post_request") SystemExit(e) sys.exit() logger.info(self.config) print("configuration: ", configuration) print("headers: ", self.headers) AuthHandler(self.config, self.headers) url = self.post_request_url() try: payload = IOService.load_xml(self.get_request_file_path()) print('payload -> ', payload) print('url ->', url) r = requests.post(url, data=payload, headers=self.headers) print(r.text) return "SOAP Post Request Executed" except requests.exceptions.HTTPError as err: raise SystemExit(err) except Exception as e: SystemExit(e) sys.exit() def send_delete_request(self, configuration: Configuration, logger): return "SOAP Delete Request Executed" def post_request_url(self): try: host = ''.join( [ str(self.env.get('protocol')), "://", str(self.env.get('host')), ]) if self.env.get('port'): host += ":" + self.env.get('port') path = str(self.path.get('baseUrl')) if self.pathVariable.get('path'): path += "/" + str(self.pathVariable.get('path')) url = '/'.join([host, path]) return url except AttributeError as ae: print("Exception occurred! please check if systemName, interfaceName, env is given properly") SystemExit(ae) sys.exit() except FileNotFoundError as fe: SystemExit(fe) sys.exit() except Exception as e: print("Exception occurred!") SystemExit(e) sys.exit() def get_request_file_path(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'RequestBody.xml') return os.path.sep.join(t) def load_env_variables(self): try: t = ('data', self.config.systemName, 'config.json' ) envFilePath = os.path.sep.join(t) json_env = IOService.load_json(envFilePath) return json_env.get('env').get(self.config.environment) except AttributeError as ae: print("Exception occurred! please pass appropriate arguments filepath:", envFilePath) SystemExit(ae) sys.exit() except FileNotFoundError as fe: print("Exception occurred! File Not found at :", envFilePath) SystemExit(fe) sys.exit() except Exception as e: print("Exception occurred!") SystemExit(e) sys.exit() def load_path(self): t = ('data', self.config.systemName, self.config.interfaceName, 'path.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def load_path_variable(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'PathVariable.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def load_headers(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'Header.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def load_query_parameter(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'RequestQuery.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) class RequestStrategyByREST(RequestStrategy): def __init__(self): self.config = None self.headers = None self.env = None self.path = None self.pathVariable = None self.queryParameters = None def send_get_request(self, configuration: Configuration, logger) -> str: try: self.config = configuration self.env = self.load_env_variables() self.path = self.load_path() self.headers = self.load_headers() self.pathVariable = self.load_path_variable() self.queryParameters = self.load_query_parameter() logger.info(self.config) print("configuration: ", configuration) print("headers: ", self.headers) except Exception as e: print("Exception occurred while loading configurations at send_get_request") SystemExit(e) sys.exit() try: AuthHandler(self.config, self.headers) url = self.get_request_url() print("url: ", url) r = requests.get(url, headers=self.headers) print("response: ", r.text) logger.info(r.json()) return "REST Get Request Executed!!" except requests.exceptions.HTTPError as err: raise SystemExit(err) except Exception as e: SystemExit(e) sys.exit() def send_post_request(self, configuration, logger) -> str: try: self.config = configuration self.env = self.load_env_variables() self.path = self.load_path() self.headers = self.load_headers() self.pathVariable = self.load_path_variable() self.queryParameters = self.load_query_parameter() logger.info(self.config) print("configuration: ", configuration) print("headers: ", self.headers) except Exception as e: print("Exception occurred while loading configurations at send_post_request") SystemExit(e) sys.exit() try: AuthHandler(self.config, self.headers) payload = IOService.load_json(self.get_request_file_path()) url = self.post_request_url() print('payload -> ', payload) print('url ->', url) r = requests.post(url, data=json.dumps(payload), headers=self.headers) print(r.text) logger.info(r.json()) return "REST Post Request Executed!!" except requests.exceptions.HTTPError as err: raise SystemExit(err) except Exception as e: SystemExit(e) sys.exit() def send_delete_request(self, configuration: Configuration, logger) -> str: try: self.config = configuration self.env = self.load_env_variables() self.path = self.load_path() self.headers = self.load_headers() self.pathVariable = self.load_path_variable() logger.info(self.config) print("configuration: ", configuration) print("headers: ", self.headers) except Exception as e: print("Exception occurred while loading configurations at send_delete_request") SystemExit(e) sys.exit() try: AuthHandler(self.config, self.headers) payload = IOService.load_json(self.get_request_file_path()) url = self.post_request_url() print('payload -> ', payload) print('url ->', url) r = requests.post(url, data=json.dumps(payload), headers=self.headers) print(r.text) logger.info(r.json()) return "REST delete Request Executed!!" except requests.exceptions.HTTPError as err: raise SystemExit(err) except Exception as e: SystemExit(e) sys.exit() def load_env_variables(self): try: t = ('data', self.config.systemName, 'config.json' ) envFilePath = os.path.sep.join(t) json_env = IOService.load_json(envFilePath) return json_env.get('env').get(self.config.environment) except AttributeError as ae: print("Exception occurred! please pass appropriate arguments filepath:", envFilePath) SystemExit(ae) sys.exit() except FileNotFoundError as fe: print("Exception occurred! File Not found at :", envFilePath) SystemExit(fe) sys.exit() except Exception as e: print("Exception occurred!") SystemExit(e) sys.exit() def load_path(self): t = ('data', self.config.systemName, self.config.interfaceName, 'path.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def load_path_variable(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'PathVariable.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def load_headers(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'Header.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def load_query_parameter(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'RequestQuery.json' ) filePath = os.path.sep.join(t) return IOService.load_json(filePath) def get_request_url(self): try: host = ''.join( [ str(self.env.get('protocol')), "://", str(self.env.get('host')), ]) if self.env.get('port'): host += ":" + self.env.get('port') path = str(self.path.get('baseUrl')) if self.pathVariable.get('path'): path += "/" + str(self.pathVariable.get('path')) url = '/'.join([host, path]) if self.get_query_parameter() is not None: url += "?" + self.get_query_parameter() return url except AttributeError as ae: print("Exception occurred! please check if systemName, interfaceName, env is given properly") SystemExit(ae) sys.exit() except Exception as e: print("Exception occurred at get_request_url()") SystemExit(e) sys.exit() def post_request_url(self): try: host = ''.join( [ str(self.env.get('protocol')), "://", str(self.env.get('host')), ]) if self.env.get('port'): host += ":" + self.env.get('port') path = str(self.path.get('baseUrl')) if self.pathVariable.get('path'): path += "/" + str(self.pathVariable.get('path')) url = '/'.join([host, path]) return url except AttributeError as ae: print("Exception occurred! please check if systemName, interfaceName, env is given properly") SystemExit(ae) sys.exit() except Exception as e: print("Exception occurred at post_request_url()") SystemExit(e) sys.exit() def get_query_parameter(self): queryString = None if len(self.queryParameters) != 0: queryString = "" for key in self.queryParameters: queryString += key + "=" + self.queryParameters[key] + "&" if len(self.queryParameters) > 0: queryString = queryString[:-1] return queryString def get_request_file_path(self): t = ('data', self.config.systemName, self.config.interfaceName, self.config.versionNumber, self.config.useCase, 'RequestBody.json') return os.path.sep.join(t)
33.148594
106
0.54937
1,642
16,508
5.415956
0.096833
0.068593
0.042056
0.028337
0.826605
0.816935
0.803104
0.768132
0.746092
0.721129
0
0.000373
0.350133
16,508
497
107
33.215292
0.828579
0
0
0.770492
0
0
0.103344
0
0
0
0
0
0
1
0.081967
false
0.01171
0.025761
0.004684
0.177986
0.093677
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
17a624a4ce33b3dcacc760f793e94c1395dd2ca6
1,789
py
Python
modules/memory/solver.py
Ao-Re/keep-typing-and-nobody-explodes
deff70c384b3271315acd49bcbfd62c05ed9a7ce
[ "MIT" ]
null
null
null
modules/memory/solver.py
Ao-Re/keep-typing-and-nobody-explodes
deff70c384b3271315acd49bcbfd62c05ed9a7ce
[ "MIT" ]
null
null
null
modules/memory/solver.py
Ao-Re/keep-typing-and-nobody-explodes
deff70c384b3271315acd49bcbfd62c05ed9a7ce
[ "MIT" ]
2
2020-10-04T17:04:31.000Z
2020-10-20T16:59:50.000Z
def solve_memory(stage, display): if (stage == 1): if (display == 1 or display == 2): return 'Press the button in the second position' if (display == 3): return 'Press the button in the third position' if (display == 4): return 'Press the button in the fourth position' elif (stage == 2): if (display == 1): return 'Press the button labeled [4]' if (display == 2 or display == 4): return 'Press the button in the same position as stage 1' if (display == 3): return 'Press the button in the first position' elif (stage == 3): if (display == 1): return 'Press the button with the same label as stage 2' if (display == 2): return 'Press the button with the same label as stage 1' if (display == 3): return 'Press the button in the third position' if (display == 4): return 'Press the button labeled [4]' elif (stage == 4): if (display == 1): return 'Press the button in the same position as stage 1' if (display == 2): return 'Press the button in the first position' if (display == 3 or display == 4): return 'Press the button in the same position as stage 2' else: if (display == 1): return 'Press the button with the same label as stage 1' if (display == 2): return 'Press the button with the same label as stage 2' if (display == 3): return 'Press the button with the same label as stage 4' if (display == 4): return 'Press the button with the same label as stage 3'
40.659091
70
0.533259
237
1,789
4.021097
0.118143
0.160546
0.249738
0.356768
0.862539
0.862539
0.84575
0.792235
0.719832
0.719832
0
0.031588
0.38066
1,789
44
71
40.659091
0.82852
0
0
0.65
0
0
0.407556
0
0
0
0
0
0
1
0.025
false
0
0
0
0.45
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
bd66558c2098cb9f55acb2ec435a99862bf811aa
88,741
py
Python
pymbs/processing/loops/hexapod_with_axes_offset.py
brutzl/pymbs
fb7c91435f56b5c4d460f82f081d5d1960fea886
[ "MIT" ]
null
null
null
pymbs/processing/loops/hexapod_with_axes_offset.py
brutzl/pymbs
fb7c91435f56b5c4d460f82f081d5d1960fea886
[ "MIT" ]
null
null
null
pymbs/processing/loops/hexapod_with_axes_offset.py
brutzl/pymbs
fb7c91435f56b5c4d460f82f081d5d1960fea886
[ "MIT" ]
null
null
null
from pymbs.processing.loops.loop import Loop, eps from pymbs.common.functions import sqrt, transpose from pymbs.processing import Joint, Frame from numpy import pi, cross from pymbs.symbolics import Matrix, eye, cos, sin, atan, atan2, acos, zeros, asin, jacobian,inv theta_1 = 'HP_%s_theta1' theta_2 = 'HP_%s_theta2' theta_4 = 'HP_%s_theta4' d_4 = 'HP_%s_d4' theta_7 = 'HP_%s_theta7' class Hexapod_m_AV(Loop): ''' Explicit Beschreibung einer Parallelkinematik mit Achsversatz ''' ''' Sketch: -F--=Arbeitsplattform=---6--E Anlenkpunkt (wird aufgeschnitten) | 6 DOF 5 | D \ ----------- 4 Zylinderstange | \ | Loop ^ C Translations- und Rotationsgelenk | | \ \ ---------------| \3\ Zylindergehäuse \\\ B | 2 | ----=Basisplattform=--------1-------A Anlenkpunkt |||||| Grundkörper Befestigung des HP ( Verschiebung / Verdrehung gegenüber Grundkörper) ''' def __init__(self, name, cs_E_Arbeitsplattform, cs_E_Gelenk): ''' Constructor @param setup: Four Bar Linkage has two setups: -1, 1 ''' # Assertions assert ( isinstance(cs_E_Arbeitsplattform, Frame) ) assert ( isinstance(cs_E_Gelenk, Frame) ) # Check parents if (cs_E_Arbeitsplattform.parentBody.joint is None): raise ValueError('Loop "%s": Coordinate System "%s" is directly connected to the world!'%(name,csCa.name)) if (cs_E_Gelenk.parentBody.joint is None): raise ValueError('Loop "%s": Coordinate System "%s" is directly connected to the world!'%(name,csCb.name)) # E = Auftrenngelenk der kinematischen Schleife csE5 = cs_E_Gelenk csE6 = cs_E_Arbeitsplattform jD = csE5.parentBody.joint jC1 = jD.coordSys.parentBody.joint jC2 = jC1.coordSys.parentBody.joint jB = jC2.coordSys.parentBody.joint jA = jB.coordSys.parentBody.joint # Freiheitsgrade der Arbeitsplattform jF1 = csE6.parentBody.joint jF2 = jF1.coordSys.parentBody.joint jF3 = jF2.coordSys.parentBody.joint jF4 = jF3.coordSys.parentBody.joint jF5 = jF4.coordSys.parentBody.joint jF6 = jF5.coordSys.parentBody.joint ''' # Do the Joints have the same axis of Rotation and lie in the same plane jB = jA.coordSys.p+csB2.p if (jA.Phi == Matrix([1,0,0])): delta = jB[0] - jC.coordSys.p[0]; if ( abs(delta) < eps ): self.sign = 1 self.pick = Matrix([[0,1,0], [0,0,1]]) else: raise ValueError('Loop "%s": Endings of prismatic joints must have the same values for x. There is a difference of %f'%(name,delta)) elif (jA.Phi == Matrix([0,1,0])): delta = jB[1] - jC.coordSys.p[1] if ( abs(delta) < eps ): self.sign = -1 self.pick = Matrix([[1,0,0], [0,0,1]]) else: raise ValueError('Loop "%s": Endings of prismatic joints must have the same values for y. There is a difference of %f'%(name,delta)) elif (jA.Phi == Matrix([0,0,1])): delta = jB[2] - jC.coordSys.p[2] if (abs(delta) < eps): self.sign = 1 self.pick = Matrix([[1,0,0], [0,1,0]]) else: raise ValueError('Loop "%s": Endings of prismatic joints must have the same values for z. There is a difference of %f'%(name,delta)) else: raise ValueError('Loop "%s": Axis of Rotation must be either x,y or z!'%name) assert( jA.Phi == jC.Phi ) assert( jA.Psi.norm() == 0 ) assert( jC.Psi.norm() == 0 ) assert( jCB.Phi.norm() == 0 ) assert( jCB.Psi.norm() == 1 ) assert( not (jCB.Psi == jC.Phi )) # Are All Coordinate Systems Aligned like Their parentBody? assert( jA.coordSys.R == eye(3) ) assert( jC.coordSys.R == eye(3) ) # Check that bodies between joints are the same assert( jA.coordSys.parentBody == jC.coordSys.parentBody ) assert( jA.body == csB2.parentBody ) assert( jC.body == jCB.coordSys.parentBody ) assert( jCB.body == csB3a.parentBody ) assert( jCB.coordSys.p.norm() == 0 ) assert( csB3a.p.norm() == 0) ''' # Super Constructor Loop.__init__(self, name) print(self.name) # Save Parameters self.jA = jA self.jB = jB self.jC1 = jC1 self.jC2 = jC2 self.jD = jD self.jF1 = jF1 self.jF2 = jF2 self.jF3 = jF3 self.jF4 = jF4 self.jF5 = jF5 self.jF6 = jF6 self.csE5 = csE5 self.csE6 = csE6 # Independent Coordinates self.u = [jF6.q,jF5.q,jF4.q,jF3.q,jF2.q,jF1.q] self.ud = [jF6.qd,jF5.qd,jF4.qd,jF3.qd,jF2.qd,jF1.qd] self.udd = [jF6.qdd,jF5.qdd,jF4.qdd,jF3.qdd,jF2.qdd,jF1.qdd] # Dependent Coordinates self.v = [jA.q,jB.q,jC1.q,jC2.q,jD.q] self.vd = [jA.qd,jB.qd,jC1.qd,jC2.qd,jD.qd] self.vdd = [jA.qdd,jB.qdd,jC1.qdd,jC2.qdd,jD.qdd] def calc(self, graph): print("berechne",self.name) ''' Returns precalculated v(u), Bvu and b_prime, s.t. q = [u,v]', where u: independent coordinates v: dependent coordinates Starting from the Constraint Equation: Phi(q) = 0, One Obtains by Differentiation: (d(Phi)/du)*u_dot + (d(Phi)/dv)*v_dot = 0 Ju*u_dot + Jv*v_dot = 0 Thus, v_dot = -(inv(Jv)*Ju)*u_dot = Bvu*u_dot, with Jv = d(Phi)/dv and Ju = d(Phi)/du Differentiating once more, yields Ju*u_ddot + Jv*v_ddot + [Ju_dot, Jv_dot]*[u_dot,v_dot]' = 0 Ju*u_ddot + Jv*v_ddot + J_dot*q_dot = 0 Using this relations, one may obtain an expression for v_ddot v_ddot = -(inv(Jv)*Ju)*u_ddot - inv(Jv)*J_dot*q_dot = Bvu*u_ddot + b_prime, with b_prime = -inv(Jv)*J_dot*q_dot Finally one can transform the Equation of Motion M*q_ddot + h = f + W'*mu M*(J*u_ddot + b) + h = f + W'*mu with J = [1, Bvu']' and b = [0,b_prime']' (J'*M*J)*u_ddot + J'*M*b + J'*h = J'*f, since J'*W' = 0 M_star*u_ddot + h_star = f_star M_star = (J'*M*J) h_star = J'*M*b + J'*h f_star = J'*f ''' assert( graph is not None ) # Generalised Coordinates q1 = self.jF6.q # u[0] # distance x q1d = self.jF6.qd q2 = self.jF5.q # u[1] # distance y q2d = self.jF5.qd q3 = self.jF4.q # u[2] # distance z q3d = self.jF4.qd q4 = self.jF3.q # u[3] # angle between x-axes q4d = self.jF3.qd q5 = self.jF2.q # u[4] # angle between y-axes q5d = self.jF2.qd q6 = self.jF1.q # u[5] # angle between z-axes q6d = self.jF1.qd v0 = self.jA.q # v[0] # angle 1 v0d = self.jA.qd v1 = self.jB.q # v[1] # angle 2 v1d = self.jB.qd v2 = self.jC1.q # v[2] # angle 3 v2d = self.jC1.qd v3 = self.jC2.q # v[3] # distance 3 v3d = self.jC2.qd v4 = self.jD.q # v[4] # angle 4 v4d = self.jD.qd ''' print self.jA.name #print self.jA1.coordSys.p print self.jB.name #print self.jA2.coordSys.p print self.jC1.name #print self.jB.coordSys.p print self.jC2.name print self.jD.name print self.jF1.name #print self.jD1.coordSys.p print self.jF2.name #print self.jD2.coordSys.p print self.jF3.name #print self.jD3.coordSys.p print self.jF4.name #print self.jD4.coordSys.p print self.jF5.name #print self.jD5.coordSys.p print self.jF6.name #print self.jD6.coordSys.p ''' # Verschiebung der Arbeitsplattform im Raum r_0_BP_0_AP=Matrix([q1,q2,q3]) # x,y,z # Rotationsmatrizen T_x=Matrix([ [ 1, 0 , 0], [ 0, cos(q4),-sin(q4)], [ 0, sin(q4), cos(q4)] ]) T_y=Matrix([ [ cos(q5), 0, sin(q5)], [ 0, 1, 0], [-sin(q5), 0, cos(q5)] ]) T_z=Matrix([ [ cos(q6),-sin(q6), 0], [ sin(q6), cos(q6), 0], [ 0, 0, 1] ]) R = T_x*T_y*T_z # Anlenkpunkte auf der Basis- und Arbeitsplattform BP_x=self.jA.coordSys.p[0] BP_y=self.jA.coordSys.p[1] BP_z=self.jA.coordSys.p[2] AP_x=self.csE6.p[0] AP_y=self.csE6.p[1] AP_z=self.csE6.p[2] print('BP_x = %s'%self.jA.coordSys.p[0]) print('BP_y = %s'%self.jA.coordSys.p[1]) print('BP_z = %s'%self.jA.coordSys.p[2]) print('AP_x = %s'%self.csE6.p[0]) print('AP_y = %s'%self.csE6.p[1]) print('AP_z = %s'%self.csE6.p[2]) r_0_BP_P_BP=Matrix([BP_x,BP_y,BP_z]) r_0_AP_P_AP= R*Matrix([AP_x,AP_y,AP_z]) l=r_0_BP_0_AP+r_0_AP_P_AP-r_0_BP_P_BP # Variablen des Gleichungssystems theta1=graph.addVariable(theta_1%self.name,initialValue=1.5) theta2=graph.addVariable(theta_2%self.name,initialValue=0) theta4=graph.addVariable(theta_4%self.name,initialValue=0) d4=graph.addVariable(d_4%self.name,initialValue=0.8) theta7=graph.addVariable(theta_7%self.name,initialValue=0) l_AV=self.csE5.p[2]-self.jD.coordSys.p[2] #l_AV=sqrt(delta_p[0]**2+delta_p[1]**2+delta_p[2]**2) #l_AV=0.075 #theta0 = atan2(self.jA.coordSys.R[2,1],self.jA.coordSys.R[2,2]) phi_x = atan(self.jA.coordSys.R[2,1]/self.jA.coordSys.R[2,2]) phi_y = atan(-self.jA.coordSys.R[2,0]*sin(phi_x)/self.jA.coordSys.R[2,1]) phi_z = atan(self.jA.coordSys.R[1,0]/self.jA.coordSys.R[0,0]) print('T_init=%s'%self.jA.coordSys.R) print('phi_x=%s'%phi_x) print('phi_y=%s'%phi_y) print('phi_z=%s'%phi_z) # Beschreibung der kinematischen Schleife mit Hilfe der Vorwärtskinematik T_vor =Matrix([ [ sin(theta4)*(sin(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) - cos(phi_y)*cos(theta2)*sin(phi_z)) - cos(theta4)*(sin(phi_y)*sin(theta1) - cos(phi_y)*cos(phi_z)*cos(theta1)), sin(theta7)*(cos(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) + cos(phi_y)*sin(phi_z)*sin(theta2)) + cos(theta7)*(cos(theta4)*(sin(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) - cos(phi_y)*cos(theta2)*sin(phi_z)) + sin(theta4)*(sin(phi_y)*sin(theta1) - cos(phi_y)*cos(phi_z)*cos(theta1))), cos(theta7)*(cos(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) + cos(phi_y)*sin(phi_z)*sin(theta2)) - sin(theta7)*(cos(theta4)*(sin(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) - cos(phi_y)*cos(theta2)*sin(phi_z)) + sin(theta4)*(sin(phi_y)*sin(theta1) - cos(phi_y)*cos(phi_z)*cos(theta1))), d4*(cos(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) + cos(phi_y)*sin(phi_z)*sin(theta2)) + l_AV*cos(theta1)*sin(phi_y) + l_AV*cos(theta7)*(cos(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) + cos(phi_y)*sin(phi_z)*sin(theta2)) - l_AV*sin(theta7)*(cos(theta4)*(sin(theta2)*(cos(theta1)*sin(phi_y) + cos(phi_y)*cos(phi_z)*sin(theta1)) - cos(phi_y)*cos(theta2)*sin(phi_z)) + sin(theta4)*(sin(phi_y)*sin(theta1) - cos(phi_y)*cos(phi_z)*cos(theta1))) + l_AV*cos(phi_y)*cos(phi_z)*sin(theta1)], [ cos(theta4)*(cos(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) + cos(phi_y)*sin(phi_x)*sin(theta1)) + sin(theta4)*(sin(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) + cos(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z))), sin(theta7)*(cos(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) - sin(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z))) - cos(theta7)*(sin(theta4)*(cos(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) + cos(phi_y)*sin(phi_x)*sin(theta1)) - cos(theta4)*(sin(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) + cos(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z)))), sin(theta7)*(sin(theta4)*(cos(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) + cos(phi_y)*sin(phi_x)*sin(theta1)) - cos(theta4)*(sin(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) + cos(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z)))) + cos(theta7)*(cos(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) - sin(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z))), d4*(cos(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) - sin(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z))) + l_AV*sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) + l_AV*sin(theta7)*(sin(theta4)*(cos(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) + cos(phi_y)*sin(phi_x)*sin(theta1)) - cos(theta4)*(sin(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) + cos(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z)))) + l_AV*cos(theta7)*(cos(theta2)*(sin(theta1)*(cos(phi_x)*sin(phi_z) + cos(phi_z)*sin(phi_x)*sin(phi_y)) - cos(phi_y)*cos(theta1)*sin(phi_x)) - sin(theta2)*(cos(phi_x)*cos(phi_z) - sin(phi_x)*sin(phi_y)*sin(phi_z))) - l_AV*cos(phi_y)*cos(theta1)*sin(phi_x)], [ cos(theta4)*(cos(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) - cos(phi_x)*cos(phi_y)*sin(theta1)) + sin(theta4)*(sin(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) + cos(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z))), sin(theta7)*(cos(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) - sin(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z))) - cos(theta7)*(sin(theta4)*(cos(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) - cos(phi_x)*cos(phi_y)*sin(theta1)) - cos(theta4)*(sin(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) + cos(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z)))), sin(theta7)*(sin(theta4)*(cos(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) - cos(phi_x)*cos(phi_y)*sin(theta1)) - cos(theta4)*(sin(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) + cos(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z)))) + cos(theta7)*(cos(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) - sin(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z))), d4*(cos(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) - sin(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z))) + l_AV*sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + l_AV*sin(theta7)*(sin(theta4)*(cos(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) - cos(phi_x)*cos(phi_y)*sin(theta1)) - cos(theta4)*(sin(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) + cos(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z)))) + l_AV*cos(theta7)*(cos(theta2)*(sin(theta1)*(sin(phi_x)*sin(phi_z) - cos(phi_x)*cos(phi_z)*sin(phi_y)) + cos(phi_x)*cos(phi_y)*cos(theta1)) - sin(theta2)*(cos(phi_z)*sin(phi_x) + cos(phi_x)*sin(phi_y)*sin(phi_z))) + l_AV*cos(phi_x)*cos(phi_y)*cos(theta1)], [ 0, 0, 0, 1] ]) # Ausrichtung des Referenzvektors auf der Arbeitsplattform csE6.R ist die zusätzliche Drehung des Referenzvektors x_AP = (R*transpose(self.csE6.R))[:,0] y_AP = (R*transpose(self.csE6.R))[:,1] z_AP = (R*transpose(self.csE6.R))[:,2] n=Matrix([T_vor[0,0],T_vor[1,0],T_vor[2,0]]) s=Matrix([T_vor[0,1],T_vor[1,1],T_vor[2,1]]) a=Matrix([T_vor[0,2],T_vor[1,2],T_vor[2,2]]) # implizite Beschreibung des Gelenkes zur AP G_1=transpose(s)*y_AP G_2=transpose(s)*z_AP # Gleichungen für das Gleichungssystem G_1=G_1[0] G_2=G_2[0] G_3=T_vor[0,3]-l[0] G_4=T_vor[1,3]-l[1] G_5=T_vor[2,3]-l[2] links = [theta1,theta2,theta4,d4,theta7] #Liste der aufzulösenden Variablen vorher mit add Variable an Graph gegeben rechts = [G_1, G_2, G_3, G_4, G_5] #Liste der zu lösenden Gleichungen graph.addEquation(links, rechts,implicit=True) # Kopie aus Verzeichnis Gq = Matrix([ [ 0, 0, 0, (cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) + (cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)), cos(q4)*cos(q5)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - sin(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) + cos(q5)*sin(q4)*sin(q6)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)), (cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) - (cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + cos(q5)*cos(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))], [ 0, 0, 0, cos(q4)*cos(q5)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) - cos(q5)*sin(q4)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)), - cos(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) - cos(q4)*sin(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - sin(q4)*sin(q5)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)), 0], [ -1, 0, 0, 0, AP_x*cos(q6)*sin(q5) - AP_z*cos(q5) - AP_y*sin(q5)*sin(q6), cos(q5)*(AP_y*cos(q6) + AP_x*sin(q6))], [ 0, -1, 0, AP_x*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + AP_y*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + AP_z*cos(q4)*cos(q5), -sin(q4)*(AP_z*sin(q5) + AP_x*cos(q5)*cos(q6) - AP_y*cos(q5)*sin(q6)), AP_y*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5)) - AP_x*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))], [ 0, 0, -1, AP_z*cos(q5)*sin(q4) - AP_y*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - AP_x*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5)), cos(q4)*(AP_z*sin(q5) + AP_x*cos(q5)*cos(q6) - AP_y*cos(q5)*sin(q6)), AP_y*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) - AP_x*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))] ]) Gw = Matrix([ [ (cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - cos(q5)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)), cos(q5)*sin(q6)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0)) - (cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1)) - (cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)), cos(v4)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(v1)*cos(v4)*sin(v2)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) + cos(q5)*cos(v4)*sin(q6)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)), 0, - (cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4)) - (sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - cos(q5)*sin(q6)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))], [ sin(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) + cos(q4)*cos(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)), cos(q5)*sin(q4)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1)) - cos(q4)*cos(q5)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) - sin(q5)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0)), cos(q4)*cos(q5)*cos(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(v4)*sin(q5)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q5)*cos(v1)*cos(v4)*sin(q4)*sin(v2), 0, sin(q5)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0)) - cos(q4)*cos(q5)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q5)*sin(q4)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4))], [ cos(v0)*l_AV - sin(v4)*((sin(v0)*sin(v2))*l_AV + (cos(v0)*cos(v2)*sin(v1))*l_AV) + v3*cos(v0)*cos(v1) + (cos(v0)*cos(v1)*cos(v4))*l_AV, -(sin(v0)*(cos(v4)*sin(v1) + 10*v3*sin(v1) + cos(v1)*cos(v2)*sin(v4)))*l_AV, (sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)))*l_AV, cos(v1)*sin(v0), cos(v4)*((cos(v0)*sin(v2))*l_AV - (cos(v2)*sin(v0)*sin(v1))*l_AV) - (cos(v1)*sin(v0)*sin(v4))*l_AV], [ 0, (cos(v2)*sin(v1)*sin(v4))*l_AV - v3*cos(v1) - (cos(v1)*cos(v4))*l_AV, (cos(v1)*sin(v2)*sin(v4))*l_AV, -sin(v1), (sin(v1)*sin(v4))*l_AV - (cos(v1)*cos(v2)*cos(v4))*l_AV], [ - sin(v0)*l_AV - sin(v4)*((cos(v0)*sin(v2))*l_AV - (cos(v2)*sin(v0)*sin(v1))*l_AV) - v3*cos(v1)*sin(v0) - (cos(v1)*cos(v4)*sin(v0))*l_AV, -(cos(v0)*(cos(v4)*sin(v1) + 10*v3*sin(v1) + cos(v1)*cos(v2)*sin(v4)))*l_AV, -(sin(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)))*l_AV, cos(v0)*cos(v1), - cos(v4)*((sin(v0)*sin(v2))*l_AV + (cos(v0)*cos(v2)*sin(v1))*l_AV) - (cos(v0)*cos(v1)*sin(v4))*l_AV] ]) G_dot = Matrix([ [ 0, 0, 0, q4d*((cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) - (cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))) - q6d*((sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) + (cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))) + v4d*((cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4)) - (sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))) - v1d*((cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - (cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) - q5d*(cos(q5)*sin(q4)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q4)*cos(q5)*sin(q6)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) + v2d*(cos(v4)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(v1)*cos(v4)*sin(v2)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))) + v0d*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)), v4d*(sin(q5)*sin(q6)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0)) - cos(q4)*cos(q5)*sin(q6)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q5)*sin(q4)*sin(q6)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4))) - q5d*(cos(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) + cos(q4)*sin(q5)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) + sin(q4)*sin(q5)*sin(q6)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) - v1d*(sin(q5)*sin(q6)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0)) + cos(q4)*cos(q5)*sin(q6)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) - cos(q5)*sin(q4)*sin(q6)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) + v0d*(sin(q5)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) + cos(q4)*cos(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))) + v2d*(cos(q4)*cos(q5)*cos(v4)*sin(q6)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(v4)*sin(q5)*sin(q6)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q5)*cos(v1)*cos(v4)*sin(q4)*sin(q6)*sin(v2)) - q4d*(cos(q5)*sin(q4)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q4)*cos(q5)*sin(q6)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) + q6d*(cos(q4)*cos(q5)*cos(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q6)*sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) + cos(q5)*cos(q6)*sin(q4)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))), v2d*(cos(q5)*cos(q6)*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) - cos(v4)*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(v1)*cos(v4)*sin(v2)*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))) - v0d*((cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + cos(q5)*cos(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))) - q4d*((sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) + (cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))) + v4d*((cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4)) + (sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) - cos(q5)*cos(q6)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))) - q6d*((cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - (cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) + cos(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))) + q5d*(cos(q4)*cos(q5)*cos(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q6)*sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) + cos(q5)*cos(q6)*sin(q4)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) + v1d*((cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + (cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1)) + cos(q5)*cos(q6)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0))), q5d*(sin(q5)*sin(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) + cos(q4)*cos(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))) - v0d*((cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + cos(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))) - v4d*((sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - cos(q5)*sin(q6)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))) - q6d*((cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + cos(q5)*cos(q6)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))) + v1d*((sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + cos(q5)*sin(q6)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))) + v2d*(cos(v4)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) - cos(q5)*cos(v4)*sin(q6)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2))) + q4d*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)), v2d*(cos(v4)*sin(v1)*sin(v2)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - cos(v0)*cos(v1)*cos(v4)*sin(v2)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + cos(q5)*cos(v1)*cos(v4)*sin(q6)*sin(v0)*sin(v2)) - q4d*((cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - (cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) - q5d*(sin(q5)*sin(q6)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0)) + cos(q4)*cos(q5)*sin(q6)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) - cos(q5)*sin(q4)*sin(q6)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) + v0d*((sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + cos(q5)*sin(q6)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))) + q6d*((cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + (cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1)) + cos(q5)*cos(q6)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0))) + v1d*((cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) - (cos(v0)*cos(v1)*sin(v4) + cos(v0)*cos(v2)*cos(v4)*sin(v1))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + cos(q5)*sin(q6)*(cos(v1)*sin(v0)*sin(v4) + cos(v2)*cos(v4)*sin(v0)*sin(v1))) - v4d*((cos(v0)*cos(v4)*sin(v1) + cos(v0)*cos(v1)*cos(v2)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + (cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(cos(v1)*cos(v4) - cos(v2)*sin(v1)*sin(v4)) - cos(q5)*sin(q6)*(cos(v4)*sin(v0)*sin(v1) + cos(v1)*cos(v2)*sin(v0)*sin(v4))), q6d*(cos(q5)*cos(q6)*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) - cos(v4)*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(v1)*cos(v4)*sin(v2)*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))) - v2d*(cos(v4)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v1)*cos(v2)*cos(v4)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) + cos(q5)*cos(v4)*sin(q6)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1))) - v4d*(sin(v4)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(v1)*sin(v2)*sin(v4)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) + cos(q5)*sin(q6)*sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2))) + v1d*(cos(v4)*sin(v1)*sin(v2)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - cos(v0)*cos(v1)*cos(v4)*sin(v2)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + cos(q5)*cos(v1)*cos(v4)*sin(q6)*sin(v0)*sin(v2)) + q5d*(cos(q4)*cos(q5)*cos(v4)*sin(q6)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(v4)*sin(q5)*sin(q6)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q5)*cos(v1)*cos(v4)*sin(q4)*sin(q6)*sin(v2)) + q4d*(cos(v4)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(v1)*cos(v4)*sin(v2)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))) + v0d*(cos(v4)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) - cos(q5)*cos(v4)*sin(q6)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2))), 0, q5d*(sin(q5)*sin(q6)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0)) - cos(q4)*cos(q5)*sin(q6)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q5)*sin(q4)*sin(q6)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4))) - v0d*((sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - cos(q5)*sin(q6)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))) + q4d*((cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4)) - (sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))) - v2d*(sin(v4)*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(v1)*sin(v2)*sin(v4)*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) + cos(q5)*sin(q6)*sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2))) + q6d*((cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4)) + (sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4))*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) - cos(q5)*cos(q6)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))) - v4d*((cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - (cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)) + cos(q5)*sin(q6)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))) - v1d*((cos(v0)*cos(v4)*sin(v1) + cos(v0)*cos(v1)*cos(v2)*sin(v4))*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + (cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))*(cos(v1)*cos(v4) - cos(v2)*sin(v1)*sin(v4)) - cos(q5)*sin(q6)*(cos(v4)*sin(v0)*sin(v1) + cos(v1)*cos(v2)*sin(v0)*sin(v4)))], [ 0, 0, 0, v1d*(cos(q5)*sin(q4)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) + cos(q4)*cos(q5)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) + q5d*(sin(q4)*sin(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q4)*sin(q5)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) - v2d*(cos(q5)*cos(v4)*sin(q4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(q4)*cos(q5)*cos(v1)*cos(v4)*sin(v2)) - q4d*(cos(q4)*cos(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) + cos(q5)*sin(q4)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) + v4d*(cos(q5)*sin(q4)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q4)*cos(q5)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4))) - v0d*cos(q5)*sin(q4)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)), q4d*(sin(q4)*sin(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q4)*sin(q5)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) - v2d*(cos(q5)*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q4)*cos(v4)*sin(q5)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(v1)*cos(v4)*sin(q4)*sin(q5)*sin(v2)) - q5d*(cos(q4)*cos(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) + cos(q5)*sin(q4)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) + v4d*(cos(q5)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0)) + cos(q4)*sin(q5)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) - sin(q4)*sin(q5)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4))) - v1d*(cos(q5)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0)) - cos(q4)*sin(q5)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) + sin(q4)*sin(q5)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) + v0d*(cos(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q4)*sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))), 0, v2d*(cos(v4)*sin(q5)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(q4)*cos(q5)*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2))) - v1d*(sin(q5)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) - cos(q4)*cos(q5)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0))) + q5d*(cos(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - cos(q4)*sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4))) + v0d*(sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) - cos(q4)*cos(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4))) - v4d*(sin(q5)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q4)*cos(q5)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))) - q4d*cos(q5)*sin(q4)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)), q4d*(cos(q5)*sin(q4)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) + cos(q4)*cos(q5)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))) - v0d*(sin(q5)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) - cos(q4)*cos(q5)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0))) - v2d*(cos(q5)*cos(v4)*sin(q4)*sin(v1)*sin(v2) + cos(v1)*cos(v4)*sin(q5)*sin(v0)*sin(v2) + cos(q4)*cos(q5)*cos(v0)*cos(v1)*cos(v4)*sin(v2)) - v1d*(sin(q5)*(cos(v1)*sin(v0)*sin(v4) + cos(v2)*cos(v4)*sin(v0)*sin(v1)) + cos(q4)*cos(q5)*(cos(v0)*cos(v1)*sin(v4) + cos(v0)*cos(v2)*cos(v4)*sin(v1)) + cos(q5)*sin(q4)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) - v4d*(sin(q5)*(cos(v4)*sin(v0)*sin(v1) + cos(v1)*cos(v2)*sin(v0)*sin(v4)) + cos(q4)*cos(q5)*(cos(v0)*cos(v4)*sin(v1) + cos(v0)*cos(v1)*cos(v2)*sin(v4)) - cos(q5)*sin(q4)*(cos(v1)*cos(v4) - cos(v2)*sin(v1)*sin(v4))) - q5d*(cos(q5)*(sin(v0)*sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4)*sin(v0)) - cos(q4)*sin(q5)*(cos(v0)*sin(v1)*sin(v4) - cos(v0)*cos(v1)*cos(v2)*cos(v4)) + sin(q4)*sin(q5)*(cos(v1)*sin(v4) + cos(v2)*cos(v4)*sin(v1))), v0d*(cos(v4)*sin(q5)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(q4)*cos(q5)*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2))) - v4d*(cos(q4)*cos(q5)*sin(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - sin(q5)*sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q5)*cos(v1)*sin(q4)*sin(v2)*sin(v4)) - v1d*(cos(q5)*cos(v4)*sin(q4)*sin(v1)*sin(v2) + cos(v1)*cos(v4)*sin(q5)*sin(v0)*sin(v2) + cos(q4)*cos(q5)*cos(v0)*cos(v1)*cos(v4)*sin(v2)) - q5d*(cos(q5)*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q4)*cos(v4)*sin(q5)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) + cos(v1)*cos(v4)*sin(q4)*sin(q5)*sin(v2)) - q4d*(cos(q5)*cos(v4)*sin(q4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - cos(q4)*cos(q5)*cos(v1)*cos(v4)*sin(v2)) + v2d*(cos(v4)*sin(q5)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(q4)*cos(q5)*cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(q5)*cos(v1)*cos(v2)*cos(v4)*sin(q4)), 0, q5d*(cos(q5)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0)) + cos(q4)*sin(q5)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) - sin(q4)*sin(q5)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4))) - v4d*(cos(q4)*cos(q5)*(cos(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) + cos(v0)*cos(v1)*sin(v4)) - sin(q5)*(cos(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) - cos(v1)*sin(v0)*sin(v4)) + cos(q5)*sin(q4)*(sin(v1)*sin(v4) - cos(v1)*cos(v2)*cos(v4))) - v2d*(cos(q4)*cos(q5)*sin(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)) - sin(q5)*sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)) + cos(q5)*cos(v1)*sin(q4)*sin(v2)*sin(v4)) - v1d*(sin(q5)*(cos(v4)*sin(v0)*sin(v1) + cos(v1)*cos(v2)*sin(v0)*sin(v4)) + cos(q4)*cos(q5)*(cos(v0)*cos(v4)*sin(v1) + cos(v0)*cos(v1)*cos(v2)*sin(v4)) - cos(q5)*sin(q4)*(cos(v1)*cos(v4) - cos(v2)*sin(v1)*sin(v4))) - v0d*(sin(q5)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q4)*cos(q5)*(sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)) + cos(v1)*cos(v4)*sin(v0))) + q4d*(cos(q5)*sin(q4)*(sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)) - cos(v0)*cos(v1)*cos(v4)) + cos(q4)*cos(q5)*(cos(v4)*sin(v1) + cos(v1)*cos(v2)*sin(v4)))], [ 0, 0, 0, 0, q5d*(AP_z*sin(q5) + AP_x*cos(q5)*cos(q6) - AP_y*cos(q5)*sin(q6)) - q6d*(AP_y*cos(q6)*sin(q5) + AP_x*sin(q5)*sin(q6)), q6d*(AP_x*cos(q5)*cos(q6) - AP_y*cos(q5)*sin(q6)) - q5d*(AP_y*cos(q6)*sin(q5) + AP_x*sin(q5)*sin(q6)), v3d*cos(v0)*cos(v1) - v0d*(sin(v0)*l_AV + sin(v4)*((cos(v0)*sin(v2))*l_AV - (cos(v2)*sin(v0)*sin(v1))*l_AV) + v3*cos(v1)*sin(v0) + (cos(v1)*cos(v4)*sin(v0))*l_AV) - v4d*(cos(v4)*((sin(v0)*sin(v2))*l_AV + (cos(v0)*cos(v2)*sin(v1))*l_AV) + (cos(v0)*cos(v1)*sin(v4))*l_AV) - (v2d*sin(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)))*l_AV - v1d*(v3*cos(v0)*sin(v1) + (cos(v0)*cos(v4)*sin(v1))*l_AV + (cos(v0)*cos(v1)*cos(v2)*sin(v4))*l_AV), v4d*((sin(v0)*sin(v1)*sin(v4))*l_AV - (cos(v1)*cos(v2)*cos(v4)*sin(v0))*l_AV) - v0d*(v3*cos(v0)*sin(v1) + (cos(v0)*cos(v4)*sin(v1))*l_AV + (cos(v0)*cos(v1)*cos(v2)*sin(v4))*l_AV) - v1d*(v3*cos(v1)*sin(v0) + (cos(v1)*cos(v4)*sin(v0))*l_AV - (cos(v2)*sin(v0)*sin(v1)*sin(v4))*l_AV) - v3d*sin(v0)*sin(v1) + (v2d*cos(v1)*sin(v0)*sin(v2)*sin(v4))*l_AV, (v4d*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)))*l_AV - (v0d*sin(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)))*l_AV - (v2d*sin(v4)*(cos(v0)*sin(v2) - cos(v2)*sin(v0)*sin(v1)))*l_AV + (v1d*cos(v1)*sin(v0)*sin(v2)*sin(v4))*l_AV, v0d*cos(v0)*cos(v1) - v1d*sin(v0)*sin(v1), v1d*((sin(v0)*sin(v1)*sin(v4))*l_AV - (cos(v1)*cos(v2)*cos(v4)*sin(v0))*l_AV) - v4d*(sin(v4)*((cos(v0)*sin(v2))*l_AV - (cos(v2)*sin(v0)*sin(v1))*l_AV) + (cos(v1)*cos(v4)*sin(v0))*l_AV) - v0d*(cos(v4)*((sin(v0)*sin(v2))*l_AV + (cos(v0)*cos(v2)*sin(v1))*l_AV) + (cos(v0)*cos(v1)*sin(v4))*l_AV) + (v2d*cos(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)))*l_AV], [ 0, 0, 0, q6d*(AP_x*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - AP_y*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5))) + q4d*(AP_x*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5)) + AP_y*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - AP_z*cos(q5)*sin(q4)) - q5d*(AP_z*cos(q4)*sin(q5) + AP_x*cos(q4)*cos(q5)*cos(q6) - AP_y*cos(q4)*cos(q5)*sin(q6)), q6d*(AP_y*cos(q5)*cos(q6)*sin(q4) + AP_x*cos(q5)*sin(q4)*sin(q6)) - q5d*(AP_z*cos(q5)*sin(q4) - AP_x*cos(q6)*sin(q4)*sin(q5) + AP_y*sin(q4)*sin(q5)*sin(q6)) - q4d*(AP_z*cos(q4)*sin(q5) + AP_x*cos(q4)*cos(q5)*cos(q6) - AP_y*cos(q4)*cos(q5)*sin(q6)), q4d*(AP_x*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) - AP_y*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5))) + q6d*(AP_x*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5)) + AP_y*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6))) + q5d*(AP_y*cos(q5)*cos(q6)*sin(q4) + AP_x*cos(q5)*sin(q4)*sin(q6)), 0, v1d*((cos(v4)*sin(v1))*l_AV + v3*sin(v1) + (cos(v1)*cos(v2)*sin(v4))*l_AV) + v4d*((cos(v1)*sin(v4))*l_AV + (cos(v2)*cos(v4)*sin(v1))*l_AV) - v3d*cos(v1) - (v2d*sin(v1)*sin(v2)*sin(v4))*l_AV, (v2d*cos(v1)*cos(v2)*sin(v4))*l_AV + (v4d*cos(v1)*cos(v4)*sin(v2))*l_AV - (v1d*sin(v1)*sin(v2)*sin(v4))*l_AV, -v1d*cos(v1), v1d*((cos(v1)*sin(v4))*l_AV + (cos(v2)*cos(v4)*sin(v1))*l_AV) + v4d*((cos(v4)*sin(v1))*l_AV + (cos(v1)*cos(v2)*sin(v4))*l_AV) + (v2d*cos(v1)*cos(v4)*sin(v2))*l_AV], [ 0, 0, 0, q4d*(AP_x*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + AP_y*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6)) + AP_z*cos(q4)*cos(q5)) - q6d*(AP_x*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - AP_y*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))) - q5d*(AP_z*sin(q4)*sin(q5) + AP_x*cos(q5)*cos(q6)*sin(q4) - AP_y*cos(q5)*sin(q4)*sin(q6)), q5d*(AP_z*cos(q4)*cos(q5) - AP_x*cos(q4)*cos(q6)*sin(q5) + AP_y*cos(q4)*sin(q5)*sin(q6)) - q6d*(AP_y*cos(q4)*cos(q5)*cos(q6) + AP_x*cos(q4)*cos(q5)*sin(q6)) - q4d*(AP_z*sin(q4)*sin(q5) + AP_x*cos(q5)*cos(q6)*sin(q4) - AP_y*cos(q5)*sin(q4)*sin(q6)), q6d*(AP_x*(sin(q4)*sin(q6) - cos(q4)*cos(q6)*sin(q5)) + AP_y*(cos(q6)*sin(q4) + cos(q4)*sin(q5)*sin(q6))) - q4d*(AP_x*(cos(q4)*cos(q6) - sin(q4)*sin(q5)*sin(q6)) - AP_y*(cos(q4)*sin(q6) + cos(q6)*sin(q4)*sin(q5))) - q5d*(AP_y*cos(q4)*cos(q5)*cos(q6) + AP_x*cos(q4)*cos(q5)*sin(q6)), v1d*((cos(v4)*sin(v0)*sin(v1))*l_AV + v3*sin(v0)*sin(v1) + (cos(v1)*cos(v2)*sin(v0)*sin(v4))*l_AV) - v0d*(cos(v0)*l_AV - sin(v4)*((sin(v0)*sin(v2))*l_AV + (cos(v0)*cos(v2)*sin(v1))*l_AV) + v3*cos(v0)*cos(v1) + (cos(v0)*cos(v1)*cos(v4))*l_AV) - v4d*(cos(v4)*((cos(v0)*sin(v2))*l_AV - (cos(v2)*sin(v0)*sin(v1))*l_AV) - (cos(v1)*sin(v0)*sin(v4))*l_AV) - (v2d*sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)))*l_AV - v3d*cos(v1)*sin(v0), v4d*((cos(v0)*sin(v1)*sin(v4))*l_AV - (cos(v0)*cos(v1)*cos(v2)*cos(v4))*l_AV) - v1d*(v3*cos(v0)*cos(v1) + (cos(v0)*cos(v1)*cos(v4))*l_AV - (cos(v0)*cos(v2)*sin(v1)*sin(v4))*l_AV) + v0d*((cos(v4)*sin(v0)*sin(v1))*l_AV + v3*sin(v0)*sin(v1) + (cos(v1)*cos(v2)*sin(v0)*sin(v4))*l_AV) - v3d*cos(v0)*sin(v1) + (v2d*cos(v0)*cos(v1)*sin(v2)*sin(v4))*l_AV, (v2d*sin(v4)*(sin(v0)*sin(v2) + cos(v0)*cos(v2)*sin(v1)))*l_AV - (v0d*sin(v4)*(cos(v0)*cos(v2) + sin(v0)*sin(v1)*sin(v2)))*l_AV - (v4d*cos(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)))*l_AV + (v1d*cos(v0)*cos(v1)*sin(v2)*sin(v4))*l_AV, - v0d*cos(v1)*sin(v0) - v1d*cos(v0)*sin(v1), v1d*((cos(v0)*sin(v1)*sin(v4))*l_AV - (cos(v0)*cos(v1)*cos(v2)*cos(v4))*l_AV) - v0d*(cos(v4)*((cos(v0)*sin(v2))*l_AV - (cos(v2)*sin(v0)*sin(v1))*l_AV) - (cos(v1)*sin(v0)*sin(v4))*l_AV) + v4d*(sin(v4)*((sin(v0)*sin(v2))*l_AV + (cos(v0)*cos(v2)*sin(v1))*l_AV) - (cos(v0)*cos(v1)*cos(v4))*l_AV) - (v2d*cos(v4)*(cos(v2)*sin(v0) - cos(v0)*sin(v1)*sin(v2)))*l_AV] ]) Gwinv= inv(Gw) p_dot=Matrix([q1d,q2d,q3d,q4d,q5d,q6d,v0d,v1d,v2d,v3d,v4d]) # TODO: v0 = theta1 v1 = theta2 v2 = theta4 v3 = d4 v4 = theta7 Bvu = -Gwinv*Gq Bvu.simplify() b_prime=-Gwinv*G_dot*p_dot b_prime.simplify() return ([v0,v1,v2,v3,v4],Bvu,b_prime)
204.944573
11,491
0.297033
9,473
88,741
2.709912
0.035258
0.054926
0.059211
0.038175
0.794827
0.778349
0.765183
0.759651
0.746757
0.742199
0
0.092113
0.547233
88,741
432
11,492
205.418981
0.546803
0.014052
0
0.023392
0
0
0.003507
0
0
0
0
0.002315
0.017544
1
0.011696
false
0
0.02924
0
0.052632
0.070175
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
1
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
da00af13b819279c3f94f7a78ae07826c2cd5f0d
29,407
py
Python
azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py
v-Ajnava/azure-sdk-for-python
a1f6f80eb5869c5b710e8bfb66146546697e2a6f
[ "MIT" ]
4
2016-06-17T23:25:29.000Z
2022-03-30T22:37:45.000Z
azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py
v-Ajnava/azure-sdk-for-python
a1f6f80eb5869c5b710e8bfb66146546697e2a6f
[ "MIT" ]
2
2016-09-30T21:40:24.000Z
2017-11-10T18:16:18.000Z
azure-mgmt-batchai/azure/mgmt/batchai/operations/clusters_operations.py
v-Ajnava/azure-sdk-for-python
a1f6f80eb5869c5b710e8bfb66146546697e2a6f
[ "MIT" ]
3
2016-05-03T20:49:46.000Z
2017-10-05T21:05:27.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller from .. import models class ClustersOperations(object): """ClustersOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. :ivar api_version: Specifies the version of API used for this request. Constant value: "2017-09-01-preview". """ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.api_version = "2017-09-01-preview" self.config = config def create( self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): """Adds a cluster. A cluster is a collection of compute nodes. Multiple jobs can be run on the same cluster. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param cluster_name: The name of the cluster within the specified resource group. Cluster names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. :type cluster_name: str :param parameters: The parameters to provide for cluster creation. :type parameters: :class:`ClusterCreateParameters <azure.mgmt.batchai.models.ClusterCreateParameters>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :return: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` instance that returns :class:`Cluster <azure.mgmt.batchai.models.Cluster>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :rtype: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters/{clusterName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(parameters, 'ClusterCreateParameters') # Construct and send request def long_running_send(): request = self._client.put(url, query_parameters) return self._client.send( request, header_parameters, body_content, **operation_config) def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) return self._client.send( request, header_parameters, **operation_config) def get_long_running_output(response): if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized if raw: response = long_running_send() return get_long_running_output(response) long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) def update( self, resource_group_name, cluster_name, tags=None, scale_settings=None, custom_headers=None, raw=False, **operation_config): """Update the properties of a given cluster. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param cluster_name: The name of the cluster within the specified resource group. Cluster names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. :type cluster_name: str :param tags: The user specified tags associated with the Cluster. :type tags: dict :param scale_settings: Desired scale for the cluster :type scale_settings: :class:`ScaleSettings <azure.mgmt.batchai.models.ScaleSettings>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: :class:`Cluster <azure.mgmt.batchai.models.Cluster>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :rtype: :class:`Cluster <azure.mgmt.batchai.models.Cluster>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ parameters = models.ClusterUpdateParameters(tags=tags, scale_settings=scale_settings) # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters/{clusterName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(parameters, 'ClusterUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( request, header_parameters, body_content, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def delete( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): """Deletes a Cluster. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param cluster_name: The name of the cluster within the specified resource group. Cluster names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. :type cluster_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :return: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` instance that returns None or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :rtype: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters/{clusterName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request def long_running_send(): request = self._client.delete(url, query_parameters) return self._client.send(request, header_parameters, **operation_config) def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) return self._client.send( request, header_parameters, **operation_config) def get_long_running_output(response): if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response if raw: response = long_running_send() return get_long_running_output(response) long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) def get( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): """Gets information about the specified Cluster. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param cluster_name: The name of the cluster within the specified resource group. Cluster names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. :type cluster_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: :class:`Cluster <azure.mgmt.batchai.models.Cluster>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :rtype: :class:`Cluster <azure.mgmt.batchai.models.Cluster>` or :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters/{clusterName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('Cluster', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def list_remote_login_information( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): """Get the IP address, port of all the compute nodes in the cluster. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param cluster_name: The name of the cluster within the specified resource group. Cluster names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. :type cluster_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: An iterator like instance of :class:`RemoteLoginInformation <azure.mgmt.batchai.models.RemoteLoginInformation>` :rtype: :class:`RemoteLoginInformationPaged <azure.mgmt.batchai.models.RemoteLoginInformationPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters/{clusterName}/listRemoteLoginInformation' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.RemoteLoginInformationPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.RemoteLoginInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def list( self, clusters_list_options=None, custom_headers=None, raw=False, **operation_config): """Gets information about the Clusters associated with the subscription. :param clusters_list_options: Additional parameters for the operation :type clusters_list_options: :class:`ClustersListOptions <azure.mgmt.batchai.models.ClustersListOptions>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: An iterator like instance of :class:`Cluster <azure.mgmt.batchai.models.Cluster>` :rtype: :class:`ClusterPaged <azure.mgmt.batchai.models.ClusterPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ filter = None if clusters_list_options is not None: filter = clusters_list_options.filter select = None if clusters_list_options is not None: select = clusters_list_options.select max_results = None if clusters_list_options is not None: max_results = clusters_list_options.max_results def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/providers/Microsoft.BatchAI/clusters' path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if max_results is not None: query_parameters['maxresults'] = self._serialize.query("max_results", max_results, 'int', maximum=1000, minimum=1) else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def list_by_resource_group( self, resource_group_name, clusters_list_by_resource_group_options=None, custom_headers=None, raw=False, **operation_config): """Gets information about the Clusters associated within the specified resource group. :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param clusters_list_by_resource_group_options: Additional parameters for the operation :type clusters_list_by_resource_group_options: :class:`ClustersListByResourceGroupOptions <azure.mgmt.batchai.models.ClustersListByResourceGroupOptions>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :return: An iterator like instance of :class:`Cluster <azure.mgmt.batchai.models.Cluster>` :rtype: :class:`ClusterPaged <azure.mgmt.batchai.models.ClusterPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ filter = None if clusters_list_by_resource_group_options is not None: filter = clusters_list_by_resource_group_options.filter select = None if clusters_list_by_resource_group_options is not None: select = clusters_list_by_resource_group_options.select max_results = None if clusters_list_by_resource_group_options is not None: max_results = clusters_list_by_resource_group_options.max_results def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/clusters' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') if max_results is not None: query_parameters['maxresults'] = self._serialize.query("max_results", max_results, 'int', maximum=1000, minimum=1) else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized
47.81626
168
0.657394
3,145
29,407
5.935135
0.078219
0.036216
0.027322
0.027001
0.893068
0.889746
0.877746
0.858834
0.846941
0.840726
0
0.004977
0.248444
29,407
614
169
47.894137
0.8396
0.293944
0
0.832278
0
0
0.14961
0.072857
0
0
0
0
0
1
0.053797
false
0
0.015823
0
0.148734
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
da1451e996a4ac64ab2d6432f4a9ffd4acdb1313
3,982
py
Python
pkgs/clean-pkg/src/genie/libs/clean/stages/apic/tests/test_node_registration.py
patrickboertje/genielibs
61c37aacf3dd0f499944555e4ff940f92f53dacb
[ "Apache-2.0" ]
1
2022-01-16T10:00:24.000Z
2022-01-16T10:00:24.000Z
pkgs/clean-pkg/src/genie/libs/clean/stages/apic/tests/test_node_registration.py
patrickboertje/genielibs
61c37aacf3dd0f499944555e4ff940f92f53dacb
[ "Apache-2.0" ]
null
null
null
pkgs/clean-pkg/src/genie/libs/clean/stages/apic/tests/test_node_registration.py
patrickboertje/genielibs
61c37aacf3dd0f499944555e4ff940f92f53dacb
[ "Apache-2.0" ]
null
null
null
import logging import unittest from unittest.mock import Mock, MagicMock from genie.libs.clean.stages.apic.stages import NodeRegistration from genie.libs.clean.stages.tests.utils import CommonStageTests, create_test_device from pyats.aetest.steps import Steps from pyats.results import Passed, Failed from pyats.aetest.signals import TerminateStepSignal from unicon.eal.dialogs import Statement, Dialog # Disable logging. It may be useful to comment this out when developing tests. logging.disable(logging.CRITICAL) class RegisterNodes(unittest.TestCase): def setUp(self): # Instantiate class object self.cls = NodeRegistration() # Instantiate device object. This also sets up commonly needed # attributes and Mock objects associated with the device. self.device = create_test_device('PE1', os='apic') def test_pass(self): # Make sure we have a unique Steps() object for result verification steps = Steps() # And we want the execute_register_nodes method to be mocked. # This simulates the pass case. self.device.api.execute_register_nodes = Mock() # Call the method to be tested (clean step inside class) self.cls.register_nodes( steps=steps, device=self.device, nodes=['Spine1', 'Spine2'] ) # Check that the result is expected self.assertEqual(Passed, steps.details[0].result) def test_fail_to_register_nodes(self): # Make sure we have a unique Steps() object for result verification steps = Steps() # And we want the execute_register_nodes method to raise an exception when called. # This simulates the fail case. self.device.api.execute_register_nodes = Mock(return_value=None) # We expect this step to fail so make sure it raises the signal with self.assertRaises(TerminateStepSignal): self.cls.register_nodes( steps=steps, device=self.device, nodes=['Spine1', 'Spine2'] ) # Check the overall result is as expected self.assertEqual(Failed, steps.details[0].result) class VerifyNodes(unittest.TestCase): def setUp(self): # Instantiate class object self.cls = NodeRegistration() # Instantiate device object. This also sets up commonly needed # attributes and Mock objects associated with the device. self.device = MagicMock('PE1', os='apic') def test_pass(self): # Make sure we have a unique Steps() object for result verification steps = Steps() self.device.testbed = MagicMock() self.device.testbed.devices = {'Spine1': MagicMock(), 'Spine2': MagicMock()} self.device.api = MagicMock() self.device.api.verify_aci_registered_nodes_in_state.return_value=True # Call the method to be tested (clean step inside class) self.cls.verify_nodes( steps=steps, device=self.device, nodes=['Spine1', 'Spine2'] ) # Check that the result is expected self.assertEqual(Passed, steps.details[0].result) def test_fail_to_verify_nodes(self): # Make sure we have a unique Steps() object for result verification steps = Steps() self.device.testbed = MagicMock() self.device.testbed.devices = {'Spine1': MagicMock(), 'Spine2': MagicMock()} self.device.api = MagicMock() # And we want the execute method to raise an exception when called. # This simulates the fail case. self.device.api.verify_aci_registered_nodes_in_state.return_value = {} # We expect this step to fail so make sure it raises the signal with self.assertRaises(TerminateStepSignal): self.cls.verify_nodes( steps=steps, device=self.device, nodes=['Spine1', 'Spine2'] ) # Check the overall result is as expected self.assertEqual(Failed, steps.details[0].result)
36.53211
90
0.67554
501
3,982
5.291417
0.241517
0.060355
0.036213
0.021124
0.809129
0.783855
0.783855
0.783855
0.759336
0.759336
0
0.005964
0.242089
3,982
108
91
36.87037
0.872432
0.327223
0
0.555556
0
0
0.032428
0
0
0
0
0
0.111111
1
0.111111
false
0.092593
0.166667
0
0.314815
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
16f9288392756946d1e80a405a832c1335124b96
147
py
Python
__main__.py
durato/python-hashtagger
926915bb6f9dbebcf95b458d426674174af53038
[ "MIT" ]
null
null
null
__main__.py
durato/python-hashtagger
926915bb6f9dbebcf95b458d426674174af53038
[ "MIT" ]
null
null
null
__main__.py
durato/python-hashtagger
926915bb6f9dbebcf95b458d426674174af53038
[ "MIT" ]
null
null
null
from src import hashtag with open("input.txt", "r") as f: # print(hashtag.hashtags(f, 30)) print(hashtag.hashtags(f, 30, "<i>#", "</i>"))
24.5
50
0.598639
23
147
3.826087
0.652174
0.272727
0.454545
0.477273
0.522727
0
0
0
0
0
0
0.032787
0.170068
147
5
51
29.4
0.688525
0.204082
0
0
0
0
0.156522
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
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
e5627ace1ff14a9583043d20dabb761e0f84fc24
2,245
py
Python
tests/tests_generate_html.py
xandermann/html-classes-obfuscator
7a7da3e293aa0d526c70c0ca36784103fb1ebf2f
[ "MIT" ]
1
2022-02-21T21:15:46.000Z
2022-02-21T21:15:46.000Z
tests/tests_generate_html.py
xandermann/html-classes-obfuscator
7a7da3e293aa0d526c70c0ca36784103fb1ebf2f
[ "MIT" ]
5
2022-02-26T09:00:50.000Z
2022-03-09T08:42:28.000Z
tests/tests_generate_html.py
xandermann/html-classes-obfuscator
7a7da3e293aa0d526c70c0ca36784103fb1ebf2f
[ "MIT" ]
1
2022-02-26T10:31:36.000Z
2022-02-26T10:31:36.000Z
"""Tests""" import unittest from html_classes_obfuscator import html_classes_obfuscator class TestsGenerateHTML(unittest.TestCase): """Tests Args: unittest (unittest.TestCase): Unittest library """ def test_generate_html_simple_quotes(self) -> None: """Test simple quotes case""" new_html = html_classes_obfuscator.generate_html('<div class="hello">hello</div>', ["hello"], ["test_1"]) expected_new_html = "<div class=test_1>hello</div>" self.assertEqual(new_html, expected_new_html) def test_generate_html_double_quotes(self) -> None: """Test double quotes case""" new_html = html_classes_obfuscator.generate_html("<div class='hello'>hello</div>", ["hello"], ["test_1"]) expected_new_html = "<div class=test_1>hello</div>" self.assertEqual(new_html, expected_new_html) def test_generate_html_multiples_attributes(self) -> None: """Test when there is multiples html classes""" new_html = html_classes_obfuscator.generate_html("<div class='hello world'>hello</div>", ["hello world"], ["test_1 test_2"]) expected_new_html = '<div class="test_1 test_2">hello</div>' self.assertEqual(new_html, expected_new_html) def test_generate_html_no_quotes(self) -> None: """Test double quotes case""" new_html = html_classes_obfuscator.generate_html("<div class=hello>hello</div>", ["hello"], ["test_1"]) expected_new_html = "<div class=test_1>hello</div>" self.assertEqual(new_html, expected_new_html) def test_generate_html_no_quotes_inside_div(self) -> None: """Test no quotes case""" new_html = html_classes_obfuscator.generate_html("<div class=hello>hello</div>", ["hello"], ["test_1"]) expected_new_html = "<div class=test_1>hello</div>" self.assertEqual(new_html, expected_new_html) def test_generate_html_with_attributes(self) -> None: """Test when there is other attributes""" new_html = html_classes_obfuscator.generate_html("<div class=hello title=hello>hello</div>", ["hello"], ["test_1"]) expected_new_html = "<div class=test_1 title=hello>hello</div>" self.assertEqual(new_html, expected_new_html)
44.9
132
0.687751
297
2,245
4.868687
0.131313
0.116183
0.099585
0.078838
0.767635
0.767635
0.767635
0.702628
0.702628
0.671508
0
0.007563
0.175501
2,245
49
133
45.816327
0.773636
0.106459
0
0.444444
1
0
0.23873
0.121926
0
0
0
0
0.222222
1
0.222222
false
0
0.074074
0
0.333333
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
7
e5ce25a2b555960f9a4e623d3a26e0c9c40021be
94
py
Python
ch09/ex03_Indexing.py
eroicaleo/LearningPython
297d46eddce6e43ce0c160d2660dff5f5d616800
[ "MIT" ]
1
2020-10-12T13:33:29.000Z
2020-10-12T13:33:29.000Z
ch09/ex03_Indexing.py
eroicaleo/LearningPython
297d46eddce6e43ce0c160d2660dff5f5d616800
[ "MIT" ]
null
null
null
ch09/ex03_Indexing.py
eroicaleo/LearningPython
297d46eddce6e43ce0c160d2660dff5f5d616800
[ "MIT" ]
1
2016-11-09T07:28:45.000Z
2016-11-09T07:28:45.000Z
#!/usr/local/bin/python3.3 L = [1, 2, 3, 4] print(L) L[2] = [] print(L) L[2:3] = [] print(L)
10.444444
26
0.5
21
94
2.238095
0.47619
0.382979
0.297872
0.340426
0
0
0
0
0
0
0
0.116883
0.180851
94
8
27
11.75
0.493506
0.265957
0
0.5
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
7
e5d39fdf55212c263284600c52f99a20815a2d92
2,151
py
Python
tests/test_range.py
felixnext/python-time-helper
15f69f60d71a864af2c1bb19ed94db3b32869afa
[ "MIT" ]
null
null
null
tests/test_range.py
felixnext/python-time-helper
15f69f60d71a864af2c1bb19ed94db3b32869afa
[ "MIT" ]
null
null
null
tests/test_range.py
felixnext/python-time-helper
15f69f60d71a864af2c1bb19ed94db3b32869afa
[ "MIT" ]
null
null
null
from datetime import datetime, timedelta from time_helper import time_to_interval def test_time_to_interval(): '''Tests if the conversion is correct''' dt = datetime(2020, 9, 23, 12, 00) iv = time_to_interval(dt, 0) assert iv == 0 iv = time_to_interval(dt, 0, zero_center=False, normalize=True) assert iv == .5 iv = time_to_interval(dt, 12) assert iv == 0 iv = time_to_interval(dt, 12, zero_center=False, normalize=True) assert iv == .5 iv = time_to_interval(dt, 12, zero_center=False, normalize=False) assert iv == 24 * 60 # test time after the day dt = datetime(2020, 9, 24, 6, 00) base = dt - timedelta(hours=12) assert base.day == 23 iv = time_to_interval(dt, 12, baseline=base, zero_center=False, normalize=True) assert iv == 42 / 48 iv = time_to_interval(dt, 12, baseline=base, zero_center=False, normalize=False) assert iv == 42 * 60 iv = time_to_interval(dt, 12, baseline=base, zero_center=True, normalize=True) assert iv == 18 / 48 # test time before the day dt = datetime(2020, 9, 22, 22, 00) base = dt + timedelta(hours=12) assert base.day == 23 iv = time_to_interval(dt, 12, baseline=base, zero_center=False, normalize=True) assert iv == 10 / 48 iv = time_to_interval(dt, 12, baseline=base, zero_center=False, normalize=False) assert iv == 10 * 60 iv = time_to_interval(dt, 12, baseline=base, zero_center=True, normalize=True) assert iv == -14 / 48 # test async offset dt = datetime(2020, 9, 24, 6, 00) base = dt - timedelta(hours=12) assert base.day == 23 iv = time_to_interval(dt, (6, 12), baseline=base, zero_center=False, normalize=True) assert iv == 36 / 42 iv = time_to_interval(dt, (12, 6), baseline=base, zero_center=False, normalize=False) assert iv == 42 * 60 iv = time_to_interval(dt, (6, 12), baseline=base, zero_center=False, normalize=False) assert iv == 36 * 60 iv = time_to_interval(dt, (6, 12), baseline=base, zero_center=True, normalize=True) assert iv == 15 / 42 def test_create_interval(): # TODO: implement pass
29.465753
89
0.655974
333
2,151
4.084084
0.162162
0.075
0.175
0.176471
0.813971
0.813971
0.764706
0.755147
0.728676
0.728676
0
0.080288
0.224082
2,151
73
90
29.465753
0.734572
0.054858
0
0.422222
0
0
0
0
0
0
0
0.013699
0.4
1
0.044444
false
0.022222
0.044444
0
0.088889
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
1
0
0
0
0
0
0
0
0
0
0
8
e5f88d0119cc80a2657be0a1002a9c49091af605
29,064
py
Python
von_agent/proto/validate.py
hidde-jan/von_agent
e011bf74718616c7ee30c54261d969300fe94f31
[ "Apache-2.0" ]
null
null
null
von_agent/proto/validate.py
hidde-jan/von_agent
e011bf74718616c7ee30c54261d969300fe94f31
[ "Apache-2.0" ]
null
null
null
von_agent/proto/validate.py
hidde-jan/von_agent
e011bf74718616c7ee30c54261d969300fe94f31
[ "Apache-2.0" ]
null
null
null
""" Copyright 2017-2018 Government of Canada - Public Services and Procurement Canada - buyandsell.gc.ca 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 json import jsonschema PROTO_MSG_JSON_SCHEMA = { 'agent-nym-lookup': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'agent-nym': { 'type': 'object', 'properties': { 'did': { 'type': 'string', } }, 'required': ['did'] } }, 'required': ['agent-nym'] } }, 'required': ['type', 'data'] }, 'agent-nym-send': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'agent-nym': { 'type': 'object', 'properties': { 'did': { 'type': 'string', }, 'verkey': { 'type': 'string', } }, 'required': ['did', 'verkey'] } }, 'required': ['agent-nym'] } }, 'required': ['type', 'data'] }, 'agent-endpoint-lookup': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'agent-endpoint': { 'type': 'object', 'properties': { 'did': { 'type': 'string', } }, 'required': ['did'] } }, 'required': ['agent-endpoint'] } }, 'required': ['type', 'data'] }, 'agent-endpoint-send': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' } } } }, 'required': ['type', 'data'] }, 'schema-lookup': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, }, 'required': ['schema'] } }, 'required': ['type', 'data'] }, 'schema-send': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'attr-names': { 'type': 'array', 'items': { 'type': 'string' }, 'minItems': 0 } }, 'required': ['schema', 'attr-names'] } }, 'required': ['type', 'data'] }, 'claim-def-send': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, }, 'required': ['schema'] } }, 'required': ['type', 'data'] }, 'master-secret-set': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'label': { 'type': 'string' }, }, 'required': ['label'] } }, 'required': ['type', 'data'] }, 'claim-hello': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'issuer-did': { 'type': 'string' } }, 'required': ['schema', 'issuer-did'] } }, 'required': ['type', 'data'] }, 'claim-create': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'claim-req': { 'type': 'object' }, 'claim-attrs': { 'type': 'object' } }, 'required': ['claim-req', 'claim-attrs'] } }, 'required': ['type', 'data'] }, 'claim-store': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'claim': { 'type': 'object' }, }, 'required': ['claim'] } }, 'required': ['type', 'data'] }, 'claim-request': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'schemata': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'minItems': 0 }, 'claim-filter': { 'type': 'object', 'properties': { 'attr-match': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'match': { 'type': 'object' } }, 'required': ['schema', 'match'] }, 'minItems': 0 }, 'pred-match': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'match': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'attr': { 'type': 'string' }, 'pred-type': { 'type': 'string' }, 'value': { 'type': 'integer' } }, 'required': ['attr', 'pred-type', 'value'] }, 'minItems': 1 } }, 'required': ['schema', 'match'] }, 'minItems': 0 } }, 'required': ['attr-match', 'pred-match'] }, 'requested-attrs': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'names': { 'type': 'array', 'items': { 'type': 'string' }, 'minItems': 0 }, }, 'required': ['schema', 'names'] }, 'minItems': 0, } }, 'required': ['schemata', 'claim-filter', 'requested-attrs'] } }, 'required': ['type', 'data'] }, 'claims-reset': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object' } }, 'required': ['type', 'data'] }, 'proof-request': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'schemata': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'minItems': 0 }, 'claim-filter': { 'type': 'object', 'properties': { 'attr-match': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'match': { 'type': 'object' } }, 'required': ['schema', 'match'] }, 'minItems': 0 }, 'pred-match': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'match': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'attr': { 'type': 'string' }, 'pred-type': { 'type': 'string' }, 'value': { 'type': 'integer' } }, 'required': ['attr', 'pred-type', 'value'] }, 'minItems': 1 } }, 'required': ['schema', 'match'] }, 'minItems': 0 } }, 'required': ['attr-match', 'pred-match'] }, 'requested-attrs': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'names': { 'type': 'array', 'items': { 'type': 'string' }, 'minItems': 0 }, }, 'required': ['schema', 'names'] }, 'minItems': 0, } }, 'required': ['schemata', 'claim-filter', 'requested-attrs'] } }, 'required': ['type', 'data'] }, 'proof-request-by-referent': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'schemata': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'minItems': 0 }, 'referents': { 'type': 'array', 'items': { 'type': 'string' }, 'minItems': 1 }, 'requested-attrs': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'schema': { 'type': 'object', 'properties': { 'origin-did': { 'type': 'string', }, 'name': { 'type': 'string', }, 'version': { 'type': 'string', }, }, 'required': ['origin-did', 'name', 'version'] }, 'names': { 'type': 'array', 'items': { 'type': 'string' }, 'minItems': 0 }, }, 'required': ['schema', 'names'] }, 'minItems': 0, } }, 'required': ['schemata', 'referents', 'requested-attrs'] } }, 'required': ['type', 'data'] }, 'verification-request': { '$schema': 'http://json-schema.org/draft-04/schema', 'type': 'object', 'properties': { 'type': { 'type': 'string' }, 'data': { 'type': 'object', 'properties': { 'proxy-did': { 'type': 'string' }, 'proof-req': { 'type': 'object' }, 'proof': { 'type': 'object' }, }, 'required': ['proof-req', 'proof'] } }, 'required': ['type', 'data'] } } def validate(form: dict) -> None: """ Validate input form; raise ValueError on non-compliance or silently pass. :param form: input form decoded from json """ if 'type' not in form: raise ValueError("Bad form: missing 'type' key") if form['type'] not in PROTO_MSG_JSON_SCHEMA: raise ValueError("Bad form: type '{}' unsupported".format(form['type'])) try: jsonschema.validate(form, PROTO_MSG_JSON_SCHEMA[form['type']]) except jsonschema.ValidationError as e: raise ValueError('JSON validation error: {}'.format(e.message)) except jsonschema.SchemaError as e: raise ValueError('JSON schema error: {}'.format(e.message))
37.942559
100
0.219309
1,201
29,064
5.29975
0.125729
0.127258
0.185389
0.110291
0.767164
0.74454
0.739513
0.729929
0.723017
0.723017
0
0.006242
0.663742
29,064
765
101
37.992157
0.645042
0.025392
0
0.617931
0
0
0.201739
0.001626
0
0
0
0
0
1
0.001379
false
0
0.002759
0
0.004138
0
0
0
0
null
0
1
0
0
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
0062a1fc5abc64880aa619981aacebf8b5a61197
1,980
py
Python
src/graphql/language/character_classes.py
fugal-dy/graphql-core
a2dc9147d61212758b93b028b9f377e36095cf35
[ "MIT" ]
249
2018-08-01T21:43:45.000Z
2020-03-11T18:31:10.000Z
src/graphql/language/character_classes.py
fugal-dy/graphql-core
a2dc9147d61212758b93b028b9f377e36095cf35
[ "MIT" ]
76
2018-08-03T11:48:27.000Z
2020-03-04T17:32:26.000Z
src/graphql/language/character_classes.py
fugal-dy/graphql-core
a2dc9147d61212758b93b028b9f377e36095cf35
[ "MIT" ]
48
2018-08-15T17:48:11.000Z
2020-03-12T12:50:51.000Z
__all__ = ["is_digit", "is_letter", "is_name_start", "is_name_continue"] try: "string".isascii() except AttributeError: # Python < 3.7 def is_digit(char: str) -> bool: """Check whether char is a digit For internal use by the lexer only. """ return "0" <= char <= "9" def is_letter(char: str) -> bool: """Check whether char is a plain ASCII letter For internal use by the lexer only. """ return "a" <= char <= "z" or "A" <= char <= "Z" def is_name_start(char: str) -> bool: """Check whether char is allowed at the beginning of a GraphQL name For internal use by the lexer only. """ return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_" def is_name_continue(char: str) -> bool: """Check whether char is allowed in the continuation of a GraphQL name For internal use by the lexer only. """ return ( "a" <= char <= "z" or "A" <= char <= "Z" or "0" <= char <= "9" or char == "_" ) else: def is_digit(char: str) -> bool: """Check whether char is a digit For internal use by the lexer only. """ return char.isascii() and char.isdigit() def is_letter(char: str) -> bool: """Check whether char is a plain ASCII letter For internal use by the lexer only. """ return char.isascii() and char.isalpha() def is_name_start(char: str) -> bool: """Check whether char is allowed at the beginning of a GraphQL name For internal use by the lexer only. """ return char.isascii() and (char.isalpha() or char == "_") def is_name_continue(char: str) -> bool: """Check whether char is allowed in the continuation of a GraphQL name For internal use by the lexer only. """ return char.isascii() and (char.isalnum() or char == "_")
28.695652
78
0.55404
268
1,980
3.996269
0.179104
0.037348
0.082166
0.119514
0.879552
0.879552
0.879552
0.879552
0.879552
0.879552
0
0.004491
0.325253
1,980
68
79
29.117647
0.797156
0.364141
0
0.307692
0
0
0.066543
0
0
0
0
0
0
1
0.307692
false
0
0
0
0.615385
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
00b7c6a2f111652c7d50c3509663a85fa1d7d665
80
py
Python
tests/input_scripts/long_list.py
shiba6v/shape_commentator
e57c4d7e0781fa02fdc49dbc5c88236df5948cf1
[ "MIT" ]
65
2018-12-06T15:34:50.000Z
2021-09-10T12:38:43.000Z
tests/input_scripts/long_list.py
shiba6v/shape_commentator
e57c4d7e0781fa02fdc49dbc5c88236df5948cf1
[ "MIT" ]
5
2018-12-14T06:32:54.000Z
2019-08-04T09:36:45.000Z
tests/input_scripts/long_list.py
shiba6v/shape_commentator
e57c4d7e0781fa02fdc49dbc5c88236df5948cf1
[ "MIT" ]
1
2019-01-02T00:05:38.000Z
2019-01-02T00:05:38.000Z
li = [1,2,3,4,5,6,7,8,9,10,11] li_and_tu = [(1,2),(3,[4,5]),[6,7],[8,(9,10),11]]
40
49
0.4625
26
80
1.346154
0.538462
0.114286
0.171429
0.228571
0.742857
0.742857
0.742857
0.742857
0.742857
0.742857
0
0.346667
0.0625
80
2
49
40
0.12
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
1
null
0
0
1
0
1
1
1
1
1
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
11
00e8f3667aa9887ca1ba76ab676d179684e2b934
84
py
Python
ppf/pricer/__init__.py
iamaris/ppf
60f798eaea69e7dec2b8c422ceb684219b1645d0
[ "MIT" ]
2
2019-10-26T17:18:41.000Z
2020-06-05T11:26:10.000Z
ppf/pricer/__init__.py
iamaris/ppf
60f798eaea69e7dec2b8c422ceb684219b1645d0
[ "MIT" ]
null
null
null
ppf/pricer/__init__.py
iamaris/ppf
60f798eaea69e7dec2b8c422ceb684219b1645d0
[ "MIT" ]
5
2019-01-24T16:44:07.000Z
2020-09-14T06:56:55.000Z
from lattice_pricer import * from monte_carlo_pricer import * from payoffs import *
21
32
0.821429
12
84
5.5
0.583333
0.363636
0.484848
0
0
0
0
0
0
0
0
0
0.142857
84
3
33
28
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
daf86f2adc988072e1ecb5a2245fa3a3f4c4f238
186
py
Python
tests/generators.py
Abstract-X/aiogram-scenario
5bc03a4ae84d80ac558e98e16ef9e51485467d96
[ "MIT" ]
19
2020-06-19T12:56:28.000Z
2022-01-02T17:14:09.000Z
tests/generators.py
Abstract-X/aiogram-scenario
5bc03a4ae84d80ac558e98e16ef9e51485467d96
[ "MIT" ]
17
2020-06-22T10:39:57.000Z
2022-03-13T14:22:46.000Z
tests/generators.py
Abstract-X/aiogram-scenario
5bc03a4ae84d80ac558e98e16ef9e51485467d96
[ "MIT" ]
3
2020-06-19T12:56:49.000Z
2022-03-13T14:04:21.000Z
import random import secrets def generate_chat_id() -> int: return random.randint(1, 100_000_000) def generate_machine_arg_name() -> str: return "a" + secrets.token_hex(5)
14.307692
41
0.715054
28
186
4.464286
0.75
0.176
0
0
0
0
0
0
0
0
0
0.071895
0.177419
186
12
42
15.5
0.745098
0
0
0
1
0
0.005376
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
1
0
1
1
1
0
0
7
97569873823c0a2d8a82f688134bad76555bd311
27,080
py
Python
tensorflow/core/protobuf/master_service_pb2_grpc.py
alexeygrigorev/tensorflow-protobuf
9863a9281eb6caa9be73128c03906d990639208c
[ "Apache-2.0" ]
7
2020-12-28T02:53:05.000Z
2022-03-23T05:45:03.000Z
tensorflow/core/protobuf/master_service_pb2_grpc.py
alexeygrigorev/tensorflow-protobuf
9863a9281eb6caa9be73128c03906d990639208c
[ "Apache-2.0" ]
1
2021-01-27T16:06:16.000Z
2021-01-27T19:43:38.000Z
tensorflow/core/protobuf/master_service_pb2_grpc.py
alexeygrigorev/tensorflow-protobuf
9863a9281eb6caa9be73128c03906d990639208c
[ "Apache-2.0" ]
1
2021-02-11T11:46:01.000Z
2021-02-11T11:46:01.000Z
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from tensorflow.core.protobuf import master_pb2 as tensorflow_dot_core_dot_protobuf_dot_master__pb2 class MasterServiceStub(object): """////////////////////////////////////////////////////////////////////////////// MasterService defines a TensorFlow service with which a client can interact to execute a distributed TensorFlow computation. A master service keeps track of multiple "master sessions". Each session encapsulates a computation graph and its associated state, and typically corresponds to a single "client session" (e.g. a `tensorflow::Session` instance). A session is responsible for the following: * assigning each node to a device (locally or remotely) using a placement algorithm. This may make decisions based on collected statistics from the workers in the system (e.g., memory usage, bandwidth consumption, etc.) * inserting intermediate nodes and edges to support cross-device and cross-process data flows and resource management. * issuing commands to workers to execute the subgraphs associated with those workers. Typically, a client carries out an iterative computation (e.g. training) by invoking RPCs against the master in a client-side loop. The client first creates a client session that connects to a particular master (using gRPC for example). The master creates a corresponding master session that is hosted on the master and caches state between the client's invocations. After the session is established, the master returns an opaque handle to the client that can be used to associate the client and master sessions. The client may send an initial graph to the master in the CreateSession call, and add nodes to the graph using ExtendSession. The most frequent operation a master is "RunStep", which implements the `Session::Run()` API. It supports feeding in arguments, executing a dataflow computation, and fetching arguments. Finally, when the client no longer needs the session, it should close the session by invoking CloseSession, which allows the master to reclaim resources associated with the session. The master may implement a garbage collection scheme that closes sessions that have been inactive for some time. For example, the following pseudo-code illustrates how a client interacts with a master: stub = NewStub("/job:mnist/replica:0/task:0") {handle} = stub->CreateSession({graph_def}) do { stub->RunStep({handle, {feeds}, {fetches}}) // The client can evaluate a predicate locally, based on the // result of `fetches`, to determine whether to terminate. For // example, it might fetch the loss and evaluate whether it is less // than some threshold. } while (!should_stop({fetches})); stub->CloseSession({handle}) ////////////////////////////////////////////////////////////////////////////// """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CreateSession = channel.unary_unary( '/tensorflow.grpc.MasterService/CreateSession', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CreateSessionRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CreateSessionResponse.FromString, ) self.ExtendSession = channel.unary_unary( '/tensorflow.grpc.MasterService/ExtendSession', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ExtendSessionRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ExtendSessionResponse.FromString, ) self.PartialRunSetup = channel.unary_unary( '/tensorflow.grpc.MasterService/PartialRunSetup', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.PartialRunSetupRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.PartialRunSetupResponse.FromString, ) self.RunStep = channel.unary_unary( '/tensorflow.grpc.MasterService/RunStep', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunStepRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunStepResponse.FromString, ) self.CloseSession = channel.unary_unary( '/tensorflow.grpc.MasterService/CloseSession', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CloseSessionRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CloseSessionResponse.FromString, ) self.ListDevices = channel.unary_unary( '/tensorflow.grpc.MasterService/ListDevices', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ListDevicesRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ListDevicesResponse.FromString, ) self.Reset = channel.unary_unary( '/tensorflow.grpc.MasterService/Reset', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ResetRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ResetResponse.FromString, ) self.MakeCallable = channel.unary_unary( '/tensorflow.grpc.MasterService/MakeCallable', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.MakeCallableRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.MakeCallableResponse.FromString, ) self.RunCallable = channel.unary_unary( '/tensorflow.grpc.MasterService/RunCallable', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunCallableRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunCallableResponse.FromString, ) self.ReleaseCallable = channel.unary_unary( '/tensorflow.grpc.MasterService/ReleaseCallable', request_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ReleaseCallableRequest.SerializeToString, response_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ReleaseCallableResponse.FromString, ) class MasterServiceServicer(object): """////////////////////////////////////////////////////////////////////////////// MasterService defines a TensorFlow service with which a client can interact to execute a distributed TensorFlow computation. A master service keeps track of multiple "master sessions". Each session encapsulates a computation graph and its associated state, and typically corresponds to a single "client session" (e.g. a `tensorflow::Session` instance). A session is responsible for the following: * assigning each node to a device (locally or remotely) using a placement algorithm. This may make decisions based on collected statistics from the workers in the system (e.g., memory usage, bandwidth consumption, etc.) * inserting intermediate nodes and edges to support cross-device and cross-process data flows and resource management. * issuing commands to workers to execute the subgraphs associated with those workers. Typically, a client carries out an iterative computation (e.g. training) by invoking RPCs against the master in a client-side loop. The client first creates a client session that connects to a particular master (using gRPC for example). The master creates a corresponding master session that is hosted on the master and caches state between the client's invocations. After the session is established, the master returns an opaque handle to the client that can be used to associate the client and master sessions. The client may send an initial graph to the master in the CreateSession call, and add nodes to the graph using ExtendSession. The most frequent operation a master is "RunStep", which implements the `Session::Run()` API. It supports feeding in arguments, executing a dataflow computation, and fetching arguments. Finally, when the client no longer needs the session, it should close the session by invoking CloseSession, which allows the master to reclaim resources associated with the session. The master may implement a garbage collection scheme that closes sessions that have been inactive for some time. For example, the following pseudo-code illustrates how a client interacts with a master: stub = NewStub("/job:mnist/replica:0/task:0") {handle} = stub->CreateSession({graph_def}) do { stub->RunStep({handle, {feeds}, {fetches}}) // The client can evaluate a predicate locally, based on the // result of `fetches`, to determine whether to terminate. For // example, it might fetch the loss and evaluate whether it is less // than some threshold. } while (!should_stop({fetches})); stub->CloseSession({handle}) ////////////////////////////////////////////////////////////////////////////// """ def CreateSession(self, request, context): """Creates a session. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExtendSession(self, request, context): """Extends a session. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PartialRunSetup(self, request, context): """Prepares future partial run calls. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RunStep(self, request, context): """Drives the graph computation. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CloseSession(self, request, context): """Closes a session. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ListDevices(self, request, context): """List the devices usable by the master. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Reset(self, request, context): """Close and abandon all existing sessions. Ongoing computations will no longer affect fresh ones via the resources in containers listed in the ResetRequest. See ResetRequest for more details. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MakeCallable(self, request, context): """Registers a callable for execution with RunCallable. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RunCallable(self, request, context): """Executes a callable registered with MakeCallable. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ReleaseCallable(self, request, context): """Frees resources associated with a callable registered with MakeCallable. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_MasterServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'CreateSession': grpc.unary_unary_rpc_method_handler( servicer.CreateSession, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CreateSessionRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CreateSessionResponse.SerializeToString, ), 'ExtendSession': grpc.unary_unary_rpc_method_handler( servicer.ExtendSession, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ExtendSessionRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ExtendSessionResponse.SerializeToString, ), 'PartialRunSetup': grpc.unary_unary_rpc_method_handler( servicer.PartialRunSetup, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.PartialRunSetupRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.PartialRunSetupResponse.SerializeToString, ), 'RunStep': grpc.unary_unary_rpc_method_handler( servicer.RunStep, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunStepRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunStepResponse.SerializeToString, ), 'CloseSession': grpc.unary_unary_rpc_method_handler( servicer.CloseSession, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CloseSessionRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.CloseSessionResponse.SerializeToString, ), 'ListDevices': grpc.unary_unary_rpc_method_handler( servicer.ListDevices, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ListDevicesRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ListDevicesResponse.SerializeToString, ), 'Reset': grpc.unary_unary_rpc_method_handler( servicer.Reset, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ResetRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ResetResponse.SerializeToString, ), 'MakeCallable': grpc.unary_unary_rpc_method_handler( servicer.MakeCallable, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.MakeCallableRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.MakeCallableResponse.SerializeToString, ), 'RunCallable': grpc.unary_unary_rpc_method_handler( servicer.RunCallable, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunCallableRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunCallableResponse.SerializeToString, ), 'ReleaseCallable': grpc.unary_unary_rpc_method_handler( servicer.ReleaseCallable, request_deserializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ReleaseCallableRequest.FromString, response_serializer=tensorflow_dot_core_dot_protobuf_dot_master__pb2.ReleaseCallableResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'tensorflow.grpc.MasterService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class MasterService(object): """////////////////////////////////////////////////////////////////////////////// MasterService defines a TensorFlow service with which a client can interact to execute a distributed TensorFlow computation. A master service keeps track of multiple "master sessions". Each session encapsulates a computation graph and its associated state, and typically corresponds to a single "client session" (e.g. a `tensorflow::Session` instance). A session is responsible for the following: * assigning each node to a device (locally or remotely) using a placement algorithm. This may make decisions based on collected statistics from the workers in the system (e.g., memory usage, bandwidth consumption, etc.) * inserting intermediate nodes and edges to support cross-device and cross-process data flows and resource management. * issuing commands to workers to execute the subgraphs associated with those workers. Typically, a client carries out an iterative computation (e.g. training) by invoking RPCs against the master in a client-side loop. The client first creates a client session that connects to a particular master (using gRPC for example). The master creates a corresponding master session that is hosted on the master and caches state between the client's invocations. After the session is established, the master returns an opaque handle to the client that can be used to associate the client and master sessions. The client may send an initial graph to the master in the CreateSession call, and add nodes to the graph using ExtendSession. The most frequent operation a master is "RunStep", which implements the `Session::Run()` API. It supports feeding in arguments, executing a dataflow computation, and fetching arguments. Finally, when the client no longer needs the session, it should close the session by invoking CloseSession, which allows the master to reclaim resources associated with the session. The master may implement a garbage collection scheme that closes sessions that have been inactive for some time. For example, the following pseudo-code illustrates how a client interacts with a master: stub = NewStub("/job:mnist/replica:0/task:0") {handle} = stub->CreateSession({graph_def}) do { stub->RunStep({handle, {feeds}, {fetches}}) // The client can evaluate a predicate locally, based on the // result of `fetches`, to determine whether to terminate. For // example, it might fetch the loss and evaluate whether it is less // than some threshold. } while (!should_stop({fetches})); stub->CloseSession({handle}) ////////////////////////////////////////////////////////////////////////////// """ @staticmethod def CreateSession(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/CreateSession', tensorflow_dot_core_dot_protobuf_dot_master__pb2.CreateSessionRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.CreateSessionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExtendSession(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/ExtendSession', tensorflow_dot_core_dot_protobuf_dot_master__pb2.ExtendSessionRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.ExtendSessionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PartialRunSetup(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/PartialRunSetup', tensorflow_dot_core_dot_protobuf_dot_master__pb2.PartialRunSetupRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.PartialRunSetupResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RunStep(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/RunStep', tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunStepRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunStepResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CloseSession(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/CloseSession', tensorflow_dot_core_dot_protobuf_dot_master__pb2.CloseSessionRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.CloseSessionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ListDevices(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/ListDevices', tensorflow_dot_core_dot_protobuf_dot_master__pb2.ListDevicesRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.ListDevicesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Reset(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/Reset', tensorflow_dot_core_dot_protobuf_dot_master__pb2.ResetRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.ResetResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MakeCallable(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/MakeCallable', tensorflow_dot_core_dot_protobuf_dot_master__pb2.MakeCallableRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.MakeCallableResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RunCallable(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/RunCallable', tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunCallableRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.RunCallableResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ReleaseCallable(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/tensorflow.grpc.MasterService/ReleaseCallable', tensorflow_dot_core_dot_protobuf_dot_master__pb2.ReleaseCallableRequest.SerializeToString, tensorflow_dot_core_dot_protobuf_dot_master__pb2.ReleaseCallableResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
48.185053
131
0.693205
2,839
27,080
6.36069
0.105671
0.0309
0.057426
0.06756
0.885979
0.885979
0.861613
0.840569
0.838354
0.817422
0
0.003259
0.229468
27,080
561
132
48.270945
0.862168
0.321344
0
0.512821
1
0
0.082121
0.049635
0
0
0
0
0
1
0.070513
false
0
0.00641
0.032051
0.11859
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
97661f3da6fe872a012910a817847b6be947cf57
34,661
py
Python
unit_test/app_test.py
AnonymousXF/ctf-platform
2566464670293f0adca4aba5979467f9e3f6be79
[ "Fair" ]
1
2019-04-02T04:17:34.000Z
2019-04-02T04:17:34.000Z
unit_test/app_test.py
AnonymousXF/ctf-platform
2566464670293f0adca4aba5979467f9e3f6be79
[ "Fair" ]
null
null
null
unit_test/app_test.py
AnonymousXF/ctf-platform
2566464670293f0adca4aba5979467f9e3f6be79
[ "Fair" ]
null
null
null
# -*- coding: utf-8 -*- import unittest import os,sys import peewee import re import redis import time import random from datetime import datetime sys.path.append("../") import utils import config from app import app from database import * class BasicTestCase(unittest.TestCase): def setUp(self): app.config['TESTING'] = True self.app = app.test_client() tables = [User, Team, TeamMember, UserAccess, Challenge, Vmachine, ChallengeSolve, ChallengeFailure, NewsItem, TroubleTicket, TicketComment, Notification, ScoreAdjustment, AdminUser] [i.create_table() for i in tables] def tearDown(self): tables = [User, Team, TeamMember, UserAccess, Challenge, Vmachine, ChallengeSolve, ChallengeFailure, NewsItem, TroubleTicket, TicketComment, Notification, ScoreAdjustment, AdminUser] [i.drop_table() for i in tables] def test_index(self): #/scoreboard/ response = self.app.get('/', content_type = 'html/text',follow_redirects=True) self.assertIn('队伍积分', response.data) def test_databse(self): tester = os.path.exists("dev.db") self.assertTrue(tester) class FlaskrTestCase(unittest.TestCase): def setUp(self): app.config['TESTING'] = True self.app = app.test_client() tables = [User, Team, TeamMember, UserAccess, Challenge, ChallengeSolve, ChallengeFailure, NewsItem, TroubleTicket, TicketComment, Notification, ScoreAdjustment, AdminUser] [i.create_table() for i in tables] def tearDown(self): tables = [User, Team, TeamMember, UserAccess, Challenge, ChallengeSolve, ChallengeFailure, NewsItem, TroubleTicket, TicketComment, Notification, ScoreAdjustment, AdminUser] [i.drop_table() for i in tables] def login(self, user_name, user_pwd): #Get csrf_token html = self.app.get('/login/', follow_redirects = True).data csrf_token = re.findall(r'<input name="_csrf_token" type="hidden" value="(.*)" />', html)[0] #Post data data = dict(user_name = user_name, user_pwd = user_pwd, _csrf_token = csrf_token) return self.app.post('/login/',data = data,follow_redirects = True), csrf_token def logout(self): return self.app.get('/logout/',follow_redirects = True) def register(self, user_name, user_email, user_pwd, pwd_confirmed): #Get csrf_token html = self.app.get('/register/',follow_redirects = True).data csrf_token = re.findall(r'<input name="_csrf_token" type="hidden" value="(.*)" />', html)[0] #Post data data = dict(user_name = user_name, user_email = user_email, user_pwd = user_pwd, pwd_confirmed = pwd_confirmed, _csrf_token = csrf_token) return self.app.post('/register/',data = data, follow_redirects = True), csrf_token def test_login_and_logout(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY) #Test Correct login-----/login/ rv, csrf_token = self.login(USER_NAME,USER_PASSWORD) self.assertIn(b'Login successful.', rv.data) #Test logout -----/logout/ rv = self.logout() self.assertIn(b'You have successfully logged out.',rv.data) #Test Wrong login-----/login/ rv, csrf_token = self.login('',USER_PASSWORD) self.assertIn(b'Not exist!', rv.data) rv, csrf_token = self.login(USER_NAME,'') self.assertIn(b'Wrong pwd!', rv.data) rv, csrf_token = self.login(USER_NAME,'123456') self.assertIn(b'Wrong pwd!', rv.data) def test_register(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD = 'user', '464059291@qq.com', '123456ASD' LONG_NAME = 'a' * 100 WRONG_PWD = '123456' WRONG_EMAIL = ['', 'qwerasdf', 'qweradsf.', 'qwerqwasdf@', 'qweradf@hustctf.org'] #Test register-----/register/ if config.registration == True: ##Correct Register information rv, csrf_token = self.register(USER_NAME, USER_EMAIL, USER_PASSWORD, USER_PASSWORD) self.assertIn(b'register successfully.', rv.data) ##Wrong Register information ###exist user_name rv = self.register(USER_NAME, '1' + USER_EMAIL, USER_PASSWORD, USER_PASSWORD) self.assertIn(b'The name has been used!', rv[0].data) ###too long user_name rv = self.register(LONG_NAME, '1' + USER_EMAIL, USER_PASSWORD, USER_PASSWORD) self.assertIn(b'wrong name format.', rv[0].data) ###NULL user_name rv = self.register('', '1' + USER_EMAIL, USER_PASSWORD, USER_PASSWORD) self.assertIn(b'wrong name format.', rv[0].data) ###exist email rv = self.register('_' + USER_NAME, USER_EMAIL, USER_PASSWORD, USER_PASSWORD) self.assertIn(b'The email has been used!', rv[0].data) ###wrong email format rv = self.register('_' + USER_NAME, WRONG_EMAIL[0], USER_PASSWORD, USER_PASSWORD) self.assertIn(b'wrong email format.', rv[0].data) rv = self.register('_' + USER_NAME, WRONG_EMAIL[1], USER_PASSWORD, USER_PASSWORD) self.assertIn(b'wrong email format.', rv[0].data) rv = self.register('_' + USER_NAME, WRONG_EMAIL[2], USER_PASSWORD, USER_PASSWORD) self.assertIn(b'wrong email format.', rv[0].data) rv = self.register('_' + USER_NAME, WRONG_EMAIL[3], USER_PASSWORD, USER_PASSWORD) self.assertIn(b'wrong email format.', rv[0].data) rv = self.register('_' + USER_NAME, WRONG_EMAIL[4], USER_PASSWORD, USER_PASSWORD) self.assertIn(b'You are lying', rv[0].data) ###two different input password rv = self.register('_'+USER_NAME, '1' + USER_EMAIL, USER_PASSWORD, USER_PASSWORD + '_') self.assertIn(b'Entered passwords differs', rv[0].data) ###wrong format password rv = self.register('_'+USER_NAME, '1' + USER_EMAIL, WRONG_PWD, WRONG_PWD) self.assertIn(b'wrong pwd format.', rv[0].data) else: rv = self.app.get('/register/', follow_redirects = True) self.assertEqual(rv.data, b'抱歉,现在暂时无法注册。有问题请联系hustctf@163.com') def test_confirm_email(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) CORRECT_DATA = dict(confirmation_key = EMAIL_CONFIRMATION_KEY, _csrf_token = csrf_token) WRONG_DATA = dict(confirmation_key = EMAIL_CONFIRMATION_KEY + 'xxx', _csrf_token = csrf_token) #Test confirm_email-----/confirm_email/ ##wrong confirmation_key rv = self.app.post('/confirm_email/',data = WRONG_DATA, follow_redirects = True) self.assertIn(b'wrong.', rv.data) ##correct confirmation_key rv = self.app.post('/confirm_email/',data = CORRECT_DATA, follow_redirects = True) self.assertIn(b'confirmed!', rv.data) def test_user(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) User.create(username = 'test', password = pwhash, email = '3203155256@qq.com', email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) ##correct case nothing_changed = dict(user_name = USER_NAME, user_email = USER_EMAIL, _csrf_token = csrf_token) correct_name_change = dict(user_name = USER_NAME + '_', user_email = USER_EMAIL, _csrf_token = csrf_token) correct_email_change = dict(user_name = USER_NAME, user_email = 'jjxf251@163.com', _csrf_token = csrf_token) ##wrong name case exist_name_change = dict(user_name = 'test', user_email = USER_EMAIL, _csrf_token = csrf_token) long_name_change = dict(user_name = 'a' * 100, user_email = USER_EMAIL, _csrf_token = csrf_token) null_name_change = dict(user_name = '', user_email = USER_EMAIL, _csrf_token = csrf_token) ##wrong email case exist_email_change = dict(user_name = USER_NAME, user_email = '3203155256@qq.com', _csrf_token = csrf_token) wrong_email_format_change = [dict(user_name = USER_NAME, user_email = '', _csrf_token = csrf_token), dict(user_name = USER_NAME, user_email = 'qwerasdf', _csrf_token = csrf_token), dict(user_name = USER_NAME, user_email = 'qwerasdf.', _csrf_token = csrf_token), dict(user_name = USER_NAME, user_email = 'qwerasdf@', _csrf_token = csrf_token), dict(user_name = USER_NAME, user_email = 'qwerasdf@hustctf.org', _csrf_token = csrf_token) ] #Test user -----/user/ ##GET method rv = self.app.get('/user/', content_type = 'html/text',follow_redirects = True) self.assertIn('{},欢迎你!'.format(USER_NAME), rv.data) ##POST method ###nothing change rv = self.app.post('/user/', data = nothing_changed, follow_redirects = True) self.assertIn(b'nothing changed!',rv.data) ###exist name change rv = self.app.post('/user/', data = exist_name_change, follow_redirects = True) self.assertIn(b'The name has been used!',rv.data) time.sleep(config.interval) ###long name change rv = self.app.post('/user/', data = long_name_change, follow_redirects = True) self.assertIn(b'wrong name format.',rv.data) time.sleep(config.interval) ###null name change rv = self.app.post('/user/', data = null_name_change, follow_redirects = True) self.assertIn(b'wrong name format.',rv.data) time.sleep(config.interval) ###null email change rv = self.app.post('/user/', data = wrong_email_format_change[0], follow_redirects = True) self.assertIn(b'wrong email format.',rv.data) time.sleep(config.interval) ###wrong email format change rv = self.app.post('/user/', data = wrong_email_format_change[1], follow_redirects = True) self.assertIn(b'wrong email format.',rv.data) time.sleep(config.interval) rv = self.app.post('/user/', data = wrong_email_format_change[2], follow_redirects = True) self.assertIn(b'wrong email format.',rv.data) time.sleep(config.interval) rv = self.app.post('/user/', data = wrong_email_format_change[3], follow_redirects = True) self.assertIn(b'wrong email format.',rv.data) time.sleep(config.interval) rv = self.app.post('/user/', data = wrong_email_format_change[4], follow_redirects = True) self.assertIn(b'You are lying',rv.data) time.sleep(config.interval) ###exist email change rv = self.app.post('/user/', data = exist_email_change, follow_redirects = True) self.assertIn(b'The email has been used!',rv.data) time.sleep(config.interval) ###correct name change rv = self.app.post('/user/', data = correct_name_change, follow_redirects = True) self.assertIn(b'save change.',rv.data) time.sleep(config.interval) ###correct email change rv = self.app.post('/user/', data = correct_email_change, follow_redirects = True) self.assertIn(b'please confirme email',rv.data) def test_team_register(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) null_team_name = dict(team_name = '', affiliation = 'test affiliation', team_eligibility = True, _csrf_token = csrf_token) long_team_name = dict(team_name = 'a' * 100, affiliation = 'test affiliation', team_eligibility = True, _csrf_token = csrf_token) no_affiliation = dict(team_name = 'test', affiliation = '', team_eligibility = True, _csrf_token = csrf_token) exist_team_name = dict (team_name = 'test', affiliation = '', team_eligibility = True, _csrf_token = csrf_token) #Test team_register -----/team_register/ ##GET method ###not confirmed rv = self.app.get('/team_register/', content_type = 'html/text', follow_redirects = True) self.assertIn('Please confirm your email.', rv.data) ###confirmed testUser.email_confirmed = True testUser.save() rv = self.app.get('/team_register/', content_type = 'html/text', follow_redirects = True) self.assertIn('{},欢迎你!'.format(USER_NAME), rv.data) ##POST method ###null team_name rv = self.app.post('/team_register/',data = null_team_name, follow_redirects = True) self.assertIn(b'wrong team name format!', rv.data) ###long team_name rv = self.app.post('/team_register/',data = long_team_name, follow_redirects = True) self.assertIn(b'wrong team name format!', rv.data) ###no affiliation rv = self.app.post('/team_register/',data = no_affiliation, follow_redirects = True) self.assertIn(b'The request has send to admin.', rv.data) ###exist team_name rv = self.app.post('/team_register/',data = exist_team_name, follow_redirects = True) self.assertIn(b'The team name has been used.', rv.data) def test_team_modify(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True Team.create(name = TEAM_NAME + '1', affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser) team = dict(team_name = TEAM_NAME, affiliation = TEAM_AFFILIATION, team_eligibility = TEAM_ELIGIBLE, _csrf_token = csrf_token) self.app.post('/team_register/',data = team, follow_redirects = True) nothing_change = dict(team_name = TEAM_NAME, affiliation = TEAM_AFFILIATION, team_eligibility = TEAM_ELIGIBLE, _csrf_token = csrf_token) exist_team_name = dict(team_name = TEAM_NAME + '1', affiliation = TEAM_AFFILIATION, team_eligibility = TEAM_ELIGIBLE, _csrf_token = csrf_token) null_team_name = dict(team_name = '', affiliation = TEAM_AFFILIATION, team_eligibility = TEAM_ELIGIBLE, _csrf_token = csrf_token) long_team_name = dict(team_name = 'a' * 100, affiliation = TEAM_AFFILIATION, team_eligibility = TEAM_ELIGIBLE, _csrf_token = csrf_token) correct_change = dict(team_name = '_' + TEAM_NAME, affiliation = TEAM_AFFILIATION, team_eligibility = TEAM_ELIGIBLE, _csrf_token = csrf_token) #Test team_modify -----/team_modify/ ##nothing change rv = self.app.post('/team_modify/', data = nothing_change, follow_redirects = True) self.assertIn(b'nothing changed!', rv.data) ##exist team_name rv = self.app.post('/team_modify/', data = exist_team_name, follow_redirects = True) self.assertIn(b'The team name has been used.', rv.data) ##null team_name rv = self.app.post('/team_modify/', data = null_team_name, follow_redirects = True) self.assertIn(b'wrong team name format!', rv.data) ##long team_name rv = self.app.post('/team_modify/', data = long_team_name, follow_redirects = True) self.assertIn(b'wrong team name format!', rv.data) ##correct change rv = self.app.post('/team_modify/', data = correct_change, follow_redirects = True) self.assertIn(b'change successfully.', rv.data) def test_team_join(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser1 = User.create(username = USER_NAME + '1', password = pwhash, email = '1' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser2 = User.create(username = USER_NAME + '2', password = pwhash, email = '2' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser1) TeamMember.create(team = team, member = testUser1, member_confirmed = True) rv, csrf_token = self.login(USER_NAME + '2', USER_PASSWORD) not_exist_team = dict(team_name = 'not_exist', _csrf_token = csrf_token) test_team = dict(team_name = TEAM_NAME, _csrf_token = csrf_token) #Test team_join -----/team_join/ ##not exist team rv = self.app.post('/team_join/',data = not_exist_team, follow_redirects = True) self.assertIn(b'team name do not exist!', rv.data) ##team has not been agreed rv = self.app.post('/team_join/',data = test_team, follow_redirects = True) self.assertIn(b'The team has not be agreed by admin.Please wait,or join another team!', rv.data) ##team has been agreed team.team_confirmed = True team.save() rv = self.app.post('/team_join/',data = test_team, follow_redirects = True) self.assertIn(b'The request has sent to leader!', rv.data) def test_user_add(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser1 = User.create(username = USER_NAME + '1', password = pwhash, email = '1' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser2 = User.create(username = USER_NAME + '2', password = pwhash, email = '2' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser3 = User.create(username = USER_NAME + '3', password = pwhash, email = '3' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser4 = User.create(username = USER_NAME + '4', password = pwhash, email = '4' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser5 = User.create(username = USER_NAME + '5', password = pwhash, email = '5' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser6 = User.create(username = USER_NAME + '6', password = pwhash, email = '6' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) testUser7 = User.create(username = USER_NAME + '7', password = pwhash, email = '7' + USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser1) TeamMember.create(team = team, member = testUser1, member_confirmed = True) TeamMember.create(team = team, member = testUser2) rv, csrf_token = self.login(USER_NAME + '1', USER_PASSWORD) #Test user_add -----/user_add/ ##only can choose one checkbox rv = self.app.post('/user_add/', data = dict(a2 = 'checked', a2a = 'checked', _csrf_token = csrf_token), follow_redirects = True) self.assertIn(b'You can only choose one!', rv.data) ##reject request rv = self.app.post('/user_add/', data = dict(a2a = 'checked', _csrf_token = csrf_token), follow_redirects = True) self.assertIn(b'reject', rv.data) ##accept request TeamMember.create(team = team, member = testUser2) rv = self.app.post('/user_add/', data = dict(a2 = 'checked', _csrf_token = csrf_token), follow_redirects = True) self.assertIn(b'agree', rv.data) ##the number of members no more than 5 TeamMember.create(team = team, member = testUser3, member_confirmed =True) TeamMember.create(team = team, member = testUser4, member_confirmed =True) TeamMember.create(team = team, member = testUser5, member_confirmed =True) TeamMember.create(team = team, member = testUser6, member_confirmed =True) TeamMember.create(team = team, member = testUser7) rv = self.app.post('/user_add/',data = dict(a7='checked', _csrf_token = csrf_token), follow_redirects=True) self.assertIn(b'The count of member must be less of 5',rv.data) def test_challenge(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) #Test challenge -----/challenge/ ##without join a team rv = self.app.get('/challenges/', content_type = 'html/text', follow_redirects = True) self.assertIn(b'Please join a team!',rv.data) #join a team TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser) TeamMember.create(team = team, member = testUser, member_confirmed = True) self.logout() self.login(USER_NAME, USER_PASSWORD) rv = self.app.get('/challenges/', content_type = 'html/text', follow_redirects = True) self.assertIn(b'收起题目',rv.data) def test_challenge_submit(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser) TeamMember.create(team = team, member = testUser, member_confirmed = True) CHAL_NAME, CHAL_CATEGORY, CHAL_DESCRIBE, CHAL_POINTS, CHAL_FLAG, CHAL_AUTHOR = 'test', 'test', 'test', 100, 'flag', 'test' chal = Challenge.create(name = CHAL_NAME, category = CHAL_CATEGORY, description = CHAL_DESCRIBE, points = CHAL_POINTS, flag = CHAL_FLAG, author = CHAL_AUTHOR) r = redis.StrictRedis() r.hset("solves", chal.id, chal.solves.count()) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) wrong_flag = dict(flag = CHAL_FLAG + '_', _csrf_token = csrf_token) correct_flag = dict(flag = CHAL_FLAG, _csrf_token = csrf_token) #Test challenge_submit -----/submit/<int:challenge>/ ##disabled challenge chal.enabled = False chal.save() rv = self.app.post('/submit/{}/'.format(chal.id), data = wrong_flag, follow_redirects = True) self.assertIn(b'You cannot submit a flag for a disabled problem.', rv.data) time.sleep(config.flag_rl * 2) ##wrong flag chal.enabled = True chal.save() rv = self.app.post('/submit/{}/'.format(chal.id), data = wrong_flag, follow_redirects = True) self.assertIn(b'Incorrect flag.', rv.data) time.sleep(config.flag_rl * 2) ##correct flag rv = self.app.post('/submit/{}/'.format(chal.id), data = correct_flag, follow_redirects = True) self.assertIn(b'Success!', rv.data) time.sleep(config.flag_rl * 2) ##submit again when the flag accept rv = self.app.post('/submit/{}/'.format(chal.id), data = correct_flag, follow_redirects = True) self.assertIn(b'already solved that problem!', rv.data) ##challenge_show_solves -----/challenges/<int:challenge>/solves/ rv = self.app.get('/challenges/{}/solves/'.format(chal.id), content_type = 'html/text', follow_redirects = True) self.assertIn(b'答出了', rv.data) def test_ticket(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True #Test tickets ##no login rv = self.app.get('/tickets/1/', follow_redirects = True) self.assertIn(b'Need login first.', rv.data) ##no team rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) rv = self.app.get('/tickets/1/', follow_redirects = True) self.assertIn(b'Please join a team!', rv.data) ## /tickets/ team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser) TeamMember.create(team = team, member = testUser, member_confirmed = True) self.logout() self.login(USER_NAME, USER_PASSWORD) rv = self.app.get('/tickets/', follow_redirects = True) self.assertIn(b'你现在没有开启的tickets.', rv.data) def test_ticket_new(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser) TeamMember.create(team = team, member = testUser, member_confirmed = True) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) TICKET_SUMMARY, TICKET_DESCRIBE = 'ticket_summary', 'ticket_description' test_ticket = dict(summary = TICKET_SUMMARY, description = TICKET_DESCRIBE, _csrf_token = csrf_token) #Test ticket_new -----/tickets/new/ ##GET method rv = self.app.get('/tickets/new/', follow_redirects = True) self.assertIn(b'新建一个 Trouble Ticket', rv.data) ##POST method time.sleep(10) rv = self.app.post('/tickets/new/', data = test_ticket, follow_redirects = True) self.assertIn(b'Ticket #1 opened.', rv.data) rv = self.app.post('/tickets/new/', data = test_ticket, follow_redirects = True) self.assertIn(b'doing that too fast.', rv.data) ##view ticket -----/tickets/<int:ticket> ###exist ticket rv = self.app.get('/tickets/1/',follow_redirects = True) self.assertIn(b'Ticket #1: {}'.format(TICKET_SUMMARY), rv.data) ###not exist ticket rv = self.app.get('/tickets/100/',follow_redirects=True) self.assertIn(b'Could not find ticket', rv.data) def test_ticket_comment(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser) TeamMember.create(team = team, member = testUser, member_confirmed = True) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) TICKET_SUMMARY, TICKET_DESCRIBE = 'ticket_summary', 'ticket_description' test_ticket = dict(summary = TICKET_SUMMARY, description = TICKET_DESCRIBE, _csrf_token = csrf_token) self.app.post('/tickets/new/', data = test_ticket, follow_redirects = True) null_comment = dict(comment = '', _csrf_token = csrf_token) add_comment = dict(comment = 'comment test', _csrf_token = csrf_token) close_ticket = dict(comment = '', _csrf_token = csrf_token, resolved = True) reopen_ticket = dict(comment = '', _csrf_token = csrf_token) #Test ticket_comment -----/tickets/<int:ticket>/comment/ ##not exist ticket time.sleep(10) rv = self.app.post('/tickets/100/comment/',data = dict(_csrf_token = csrf_token), follow_redirects = True) self.assertIn(b'Could not find ticket', rv.data) time.sleep(10) ##null comment rv = self.app.post('/tickets/1/comment/',data = null_comment, follow_redirects = True) self.assertIn(b'Ticket #1: {}'.format(TICKET_SUMMARY), rv.data) self.assertNotIn(b'Comment added.', rv.data) self.assertNotIn(b'Ticket closed.', rv.data) self.assertNotIn(b'Ticket re-opened.', rv.data) time.sleep(10) ##add comment rv = self.app.post('/tickets/1/comment/', data = add_comment, follow_redirects = True) self.assertIn(b'Comment added.', rv.data) time.sleep(10) ##close ticket rv = self.app.post('/tickets/1/comment/', data = close_ticket, follow_redirects = True) self.assertIn(b'Ticket closed.', rv.data) time.sleep(10) ##reopen ticket rv = self.app.post('/tickets/1/comment/', data = reopen_ticket, follow_redirects = True) self.assertIn(b'Ticket re-opened.', rv.data) def test_forget_pwd(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) #Test forget_pwd -----/forget_pwd/ ##GET method rv = self.app.get('/forget_pwd/', follow_redirects = True) csrf_token = re.findall(r'<input name="_csrf_token" type="hidden" value="(.*)" />', rv.data)[0] self.assertIn(b'忘记密码', rv.data) ##POST method ###not exist not_exist = dict(user_name = USER_NAME, _csrf_token = csrf_token) rv = self.app.post('/forget_pwd/', data = not_exist, follow_redirects = True) self.assertIn(b'Not exist!', rv.data) ###not email confirmed testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY) not_confirmed = dict(user_name = USER_NAME, _csrf_token = csrf_token) rv = self.app.post('/forget_pwd/', data = not_confirmed, follow_redirects = True) self.assertIn(b'Your email has not confirmed,you can input the confirmed code in your email', rv.data) ###email confirmed testUser.email_confirmed = True testUser.save() confirmed = dict(user_name = USER_NAME, _csrf_token = csrf_token) rv = self.app.post('/forget_pwd/', data = confirmed, follow_redirects = True) self.assertIn(b'The confirmed code has been send to your email', rv.data) def test_confirm_code(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) rv = self.app.get('/forget_pwd/', follow_redirects = True) csrf_token = re.findall(r'<input name="_csrf_token" type="hidden" value="(.*)" />', rv.data)[0] #Test ##not exist not_exist = dict(user_name1 = 'not_exist', confirm_code = '1234567890', _csrf_token = csrf_token) rv = self.app.post('/confirm_code/', data = not_exist, follow_redirects = True) self.assertIn(b'Not exist',rv.data) ##wrong data wrong_data = dict(user_name1 = USER_NAME, confirm_code = '123456789', _csrf_token = csrf_token) rv = self.app.post('/confirm_code/', data = wrong_data, follow_redirects = True) self.assertIn(b'wrong',rv.data) ##correct data correct_data = dict(user_name1 = USER_NAME, confirm_code = EMAIL_CONFIRMATION_KEY, _csrf_token = csrf_token) rv = self.app.post('/confirm_code/', data = correct_data, follow_redirects = True) self.assertIn(b'correct',rv.data) def test_reset_pwd(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) #Test reset_pwd -----/reset_pwd/ ##diffrent input different_input = dict(user_pwd = 'ASD123456', pwd_confirmed = '123456ASD', _csrf_token = csrf_token) rv = self.app.post('/reset_pwd/', data = different_input, follow_redirects = True) self.assertIn(b'Entered passwords differs', rv.data) ##wrong format password wrong_data = dict(user_pwd = '123456', pwd_confirmed = '123456', _csrf_token = csrf_token) rv = self.app.post('/reset_pwd/', data = wrong_data, follow_redirects = True) self.assertIn(b'wrong pwd format.', rv.data) ##correct format password correct_data = dict(user_pwd = 'ASD123456', pwd_confirmed = 'ASD123456', _csrf_token = csrf_token) rv = self.app.post('/reset_pwd/', data = correct_data, follow_redirects = True) self.assertIn(b'Success', rv.data) def test_dynamic_display(self): #Test Case USER_NAME, USER_EMAIL, USER_PASSWORD, EMAIL_CONFIRMATION_KEY = 'user', '464059291@qq.com', '123456ASD', utils.misc.generate_confirmation_key() pwhash = utils.admin.create_password(USER_PASSWORD) testUser = User.create(username = USER_NAME, password = pwhash, email = USER_EMAIL, email_confirmation_key = EMAIL_CONFIRMATION_KEY, email_confirmed = True) TEAM_NAME, TEAM_AFFILIATION, TEAM_ELIGIBLE = 'testTeam', 'testAffiliation', True team = Team.create(name = TEAM_NAME, affiliation = TEAM_AFFILIATION, eligible = TEAM_ELIGIBLE, team_leader = testUser, team_confirmed = True) TeamMember.create(team = team, member = testUser, member_confirmed = True) chal = Challenge.create(name="Challenge Test", category="Test", description="Test", points=100, flag="Test", author="Test") r = redis.StrictRedis() r.hset("solves", chal.id, chal.solves.count()) rv, csrf_token = self.login(USER_NAME, USER_PASSWORD) #Test dynamic_display -----/dynamic_display/ ##GET --- no nitice rv = self.app.get('/dynamic_display/', follow_redirects = True) self.assertIn(b'暂无任何通知', rv.data) ##GET --- new a notice NewsItem.create(title="TestTitle", content="TestContent", time=datetime.now()) rv = self.app.get('/dynamic_display/', follow_redirects = True) self.assertIn(b'TestTitle', rv.data) ##Get --- challenge solve dynamics flag = dict(flag="Test", _csrf_token=csrf_token) self.app.post('/submit/{}/'.format(chal.id), data = flag, follow_redirects = True) rv = self.app.get('/dynamic_display/', follow_redirects = True) self.assertIn("Success", rv.data) if __name__ == '__main__': unittest.main()
53.654799
184
0.733014
4,797
34,661
5.057119
0.061705
0.048972
0.042335
0.063523
0.841791
0.809967
0.784781
0.732841
0.677357
0.632714
0
0.016098
0.134359
34,661
646
185
53.654799
0.792428
0.062491
0
0.448661
0
0
0.126933
0.002355
0
0
0
0
0.198661
0
null
null
0.194196
0.026786
null
null
0
0
0
0
null
0
0
0
1
1
1
1
0
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
7
9792a2f8a7c56d792b8e6681407f4edf042067ea
3,512
py
Python
platoon/migrations/versions/2cedcf202ceb_add_cascades.py
siq/platoon
d41bbc8c8209c75e2920d9c4d90886ec7be26398
[ "Linux-OpenIB" ]
null
null
null
platoon/migrations/versions/2cedcf202ceb_add_cascades.py
siq/platoon
d41bbc8c8209c75e2920d9c4d90886ec7be26398
[ "Linux-OpenIB" ]
null
null
null
platoon/migrations/versions/2cedcf202ceb_add_cascades.py
siq/platoon
d41bbc8c8209c75e2920d9c4d90886ec7be26398
[ "Linux-OpenIB" ]
null
null
null
"""add_cascades Revision: 2cedcf202ceb Revises: a37cb401b52 Created: 2012-08-21 20:45:09.304167 """ revision = '2cedcf202ceb' down_revision = 'a37cb401b52' from alembic import op from spire.schema.fields import * from sqlalchemy import Column, ForeignKey, ForeignKeyConstraint, PrimaryKeyConstraint, CheckConstraint from sqlalchemy.dialects import postgresql def upgrade(): op.drop_constraint('execution_task_id_fkey', 'execution') op.create_foreign_key('execution_task_id_fkey', 'execution', 'scheduled_task', ['task_id'], ['task_id'], ondelete='CASCADE') op.drop_constraint('http_request_action_action_id_fkey', 'http_request_action') op.create_foreign_key('http_request_action_action_id_fkey', 'http_request_action', 'action', ['action_id'], ['id'], ondelete='CASCADE') op.drop_constraint('task_action_id_fkey', 'task') op.create_foreign_key('task_action_id_fkey', 'task', 'action', ['action_id'], ['id'], ondelete='CASCADE') op.drop_constraint('task_completed_action_id_fkey', 'task') op.create_foreign_key('task_completed_action_id_fkey', 'task', 'action', ['completed_action_id'], ['id'], ondelete='CASCADE') op.drop_constraint('task_failed_action_id_fkey', 'task') op.create_foreign_key('task_failed_action_id_fkey', 'task', 'action', ['failed_action_id'], ['id'], ondelete='CASCADE') op.drop_constraint('scheduled_task_parent_id_fkey', 'scheduled_task') op.create_foreign_key('scheduled_task_parent_id_fkey', 'scheduled_task', 'recurring_task', ['parent_id'], ['task_id'], ondelete='CASCADE') op.drop_constraint('scheduled_task_task_id_fkey', 'scheduled_task') op.create_foreign_key('scheduled_task_task_id_fkey', 'scheduled_task', 'task', ['task_id'], ['id'], ondelete='CASCADE') op.drop_constraint('recurring_task_task_id_fkey', 'recurring_task') op.create_foreign_key('recurring_task_task_id_fkey', 'recurring_task', 'task', ['task_id'], ['id'], ondelete='CASCADE') def downgrade(): op.drop_constraint('execution_task_id_fkey', 'execution') op.create_foreign_key('execution_task_id_fkey', 'execution', 'scheduled_task', ['task_id'], ['task_id']) op.drop_constraint('http_request_action_action_id_fkey', 'http_request_action') op.create_foreign_key('http_request_action_action_id_fkey', 'http_request_action', 'action', ['action_id'], ['id']) op.drop_constraint('task_action_id_fkey', 'task') op.create_foreign_key('task_action_id_fkey', 'task', 'action', ['action_id'], ['id']) op.drop_constraint('task_completed_action_id_fkey', 'task') op.create_foreign_key('task_completed_action_id_fkey', 'task', 'action', ['completed_action_id'], ['id']) op.drop_constraint('task_failed_action_id_fkey', 'task') op.create_foreign_key('task_failed_action_id_fkey', 'task', 'action', ['failed_action_id'], ['id']) op.drop_constraint('scheduled_task_parent_id_fkey', 'scheduled_task') op.create_foreign_key('scheduled_task_parent_id_fkey', 'scheduled_task', 'recurring_task', ['parent_id'], ['task_id']) op.drop_constraint('scheduled_task_task_id_fkey', 'scheduled_task') op.create_foreign_key('scheduled_task_task_id_fkey', 'scheduled_task', 'task', ['task_id'], ['id']) op.drop_constraint('recurring_task_task_id_fkey', 'recurring_task') op.create_foreign_key('recurring_task_task_id_fkey', 'recurring_task', 'task', ['task_id'], ['id'])
43.358025
102
0.725513
457
3,512
5.089716
0.113786
0.082545
0.11006
0.123818
0.864144
0.864144
0.864144
0.851247
0.8319
0.825451
0
0.013645
0.123576
3,512
80
103
43.9
0.74204
0.026481
0
0.714286
0
0
0.468054
0.227433
0
0
0
0
0
1
0.035714
false
0
0.071429
0
0.107143
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
c14d8d3196be504f4f5a9d4607e27ed9a167b328
24,368
py
Python
sdk/python/pulumi_aws_native/cloudwatch/_inputs.py
pulumi/pulumi-aws-native
1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3
[ "Apache-2.0" ]
29
2021-09-30T19:32:07.000Z
2022-03-22T21:06:08.000Z
sdk/python/pulumi_aws_native/cloudwatch/_inputs.py
pulumi/pulumi-aws-native
1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3
[ "Apache-2.0" ]
232
2021-09-30T19:26:26.000Z
2022-03-31T23:22:06.000Z
sdk/python/pulumi_aws_native/cloudwatch/_inputs.py
pulumi/pulumi-aws-native
1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3
[ "Apache-2.0" ]
4
2021-11-10T19:42:01.000Z
2022-02-05T10:15:49.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities __all__ = [ 'AlarmDimensionArgs', 'AlarmMetricDataQueryArgs', 'AlarmMetricStatArgs', 'AlarmMetricArgs', 'AnomalyDetectorConfigurationArgs', 'AnomalyDetectorDimensionArgs', 'AnomalyDetectorMetricDataQueryArgs', 'AnomalyDetectorMetricMathAnomalyDetectorArgs', 'AnomalyDetectorMetricStatArgs', 'AnomalyDetectorMetricArgs', 'AnomalyDetectorRangeArgs', 'AnomalyDetectorSingleMetricAnomalyDetectorArgs', 'InsightRuleTagsArgs', 'MetricStreamFilterArgs', 'MetricStreamStatisticsConfigurationArgs', 'MetricStreamStatisticsMetricArgs', 'MetricStreamTagArgs', ] @pulumi.input_type class AlarmDimensionArgs: def __init__(__self__, *, name: pulumi.Input[str], value: pulumi.Input[str]): pulumi.set(__self__, "name", name) pulumi.set(__self__, "value", value) @property @pulumi.getter def name(self) -> pulumi.Input[str]: return pulumi.get(self, "name") @name.setter def name(self, value: pulumi.Input[str]): pulumi.set(self, "name", value) @property @pulumi.getter def value(self) -> pulumi.Input[str]: return pulumi.get(self, "value") @value.setter def value(self, value: pulumi.Input[str]): pulumi.set(self, "value", value) @pulumi.input_type class AlarmMetricDataQueryArgs: def __init__(__self__, *, id: pulumi.Input[str], account_id: Optional[pulumi.Input[str]] = None, expression: Optional[pulumi.Input[str]] = None, label: Optional[pulumi.Input[str]] = None, metric_stat: Optional[pulumi.Input['AlarmMetricStatArgs']] = None, period: Optional[pulumi.Input[int]] = None, return_data: Optional[pulumi.Input[bool]] = None): pulumi.set(__self__, "id", id) if account_id is not None: pulumi.set(__self__, "account_id", account_id) if expression is not None: pulumi.set(__self__, "expression", expression) if label is not None: pulumi.set(__self__, "label", label) if metric_stat is not None: pulumi.set(__self__, "metric_stat", metric_stat) if period is not None: pulumi.set(__self__, "period", period) if return_data is not None: pulumi.set(__self__, "return_data", return_data) @property @pulumi.getter def id(self) -> pulumi.Input[str]: return pulumi.get(self, "id") @id.setter def id(self, value: pulumi.Input[str]): pulumi.set(self, "id", value) @property @pulumi.getter(name="accountId") def account_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "account_id") @account_id.setter def account_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "account_id", value) @property @pulumi.getter def expression(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "expression") @expression.setter def expression(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "expression", value) @property @pulumi.getter def label(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "label") @label.setter def label(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "label", value) @property @pulumi.getter(name="metricStat") def metric_stat(self) -> Optional[pulumi.Input['AlarmMetricStatArgs']]: return pulumi.get(self, "metric_stat") @metric_stat.setter def metric_stat(self, value: Optional[pulumi.Input['AlarmMetricStatArgs']]): pulumi.set(self, "metric_stat", value) @property @pulumi.getter def period(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "period") @period.setter def period(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "period", value) @property @pulumi.getter(name="returnData") def return_data(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "return_data") @return_data.setter def return_data(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "return_data", value) @pulumi.input_type class AlarmMetricStatArgs: def __init__(__self__, *, metric: pulumi.Input['AlarmMetricArgs'], period: pulumi.Input[int], stat: pulumi.Input[str], unit: Optional[pulumi.Input[str]] = None): pulumi.set(__self__, "metric", metric) pulumi.set(__self__, "period", period) pulumi.set(__self__, "stat", stat) if unit is not None: pulumi.set(__self__, "unit", unit) @property @pulumi.getter def metric(self) -> pulumi.Input['AlarmMetricArgs']: return pulumi.get(self, "metric") @metric.setter def metric(self, value: pulumi.Input['AlarmMetricArgs']): pulumi.set(self, "metric", value) @property @pulumi.getter def period(self) -> pulumi.Input[int]: return pulumi.get(self, "period") @period.setter def period(self, value: pulumi.Input[int]): pulumi.set(self, "period", value) @property @pulumi.getter def stat(self) -> pulumi.Input[str]: return pulumi.get(self, "stat") @stat.setter def stat(self, value: pulumi.Input[str]): pulumi.set(self, "stat", value) @property @pulumi.getter def unit(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "unit") @unit.setter def unit(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "unit", value) @pulumi.input_type class AlarmMetricArgs: def __init__(__self__, *, dimensions: Optional[pulumi.Input[Sequence[pulumi.Input['AlarmDimensionArgs']]]] = None, metric_name: Optional[pulumi.Input[str]] = None, namespace: Optional[pulumi.Input[str]] = None): if dimensions is not None: pulumi.set(__self__, "dimensions", dimensions) if metric_name is not None: pulumi.set(__self__, "metric_name", metric_name) if namespace is not None: pulumi.set(__self__, "namespace", namespace) @property @pulumi.getter def dimensions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AlarmDimensionArgs']]]]: return pulumi.get(self, "dimensions") @dimensions.setter def dimensions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AlarmDimensionArgs']]]]): pulumi.set(self, "dimensions", value) @property @pulumi.getter(name="metricName") def metric_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "metric_name") @metric_name.setter def metric_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "metric_name", value) @property @pulumi.getter def namespace(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "namespace") @namespace.setter def namespace(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "namespace", value) @pulumi.input_type class AnomalyDetectorConfigurationArgs: def __init__(__self__, *, excluded_time_ranges: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorRangeArgs']]]] = None, metric_time_zone: Optional[pulumi.Input[str]] = None): if excluded_time_ranges is not None: pulumi.set(__self__, "excluded_time_ranges", excluded_time_ranges) if metric_time_zone is not None: pulumi.set(__self__, "metric_time_zone", metric_time_zone) @property @pulumi.getter(name="excludedTimeRanges") def excluded_time_ranges(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorRangeArgs']]]]: return pulumi.get(self, "excluded_time_ranges") @excluded_time_ranges.setter def excluded_time_ranges(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorRangeArgs']]]]): pulumi.set(self, "excluded_time_ranges", value) @property @pulumi.getter(name="metricTimeZone") def metric_time_zone(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "metric_time_zone") @metric_time_zone.setter def metric_time_zone(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "metric_time_zone", value) @pulumi.input_type class AnomalyDetectorDimensionArgs: def __init__(__self__, *, name: pulumi.Input[str], value: pulumi.Input[str]): pulumi.set(__self__, "name", name) pulumi.set(__self__, "value", value) @property @pulumi.getter def name(self) -> pulumi.Input[str]: return pulumi.get(self, "name") @name.setter def name(self, value: pulumi.Input[str]): pulumi.set(self, "name", value) @property @pulumi.getter def value(self) -> pulumi.Input[str]: return pulumi.get(self, "value") @value.setter def value(self, value: pulumi.Input[str]): pulumi.set(self, "value", value) @pulumi.input_type class AnomalyDetectorMetricDataQueryArgs: def __init__(__self__, *, id: pulumi.Input[str], account_id: Optional[pulumi.Input[str]] = None, expression: Optional[pulumi.Input[str]] = None, label: Optional[pulumi.Input[str]] = None, metric_stat: Optional[pulumi.Input['AnomalyDetectorMetricStatArgs']] = None, period: Optional[pulumi.Input[int]] = None, return_data: Optional[pulumi.Input[bool]] = None): pulumi.set(__self__, "id", id) if account_id is not None: pulumi.set(__self__, "account_id", account_id) if expression is not None: pulumi.set(__self__, "expression", expression) if label is not None: pulumi.set(__self__, "label", label) if metric_stat is not None: pulumi.set(__self__, "metric_stat", metric_stat) if period is not None: pulumi.set(__self__, "period", period) if return_data is not None: pulumi.set(__self__, "return_data", return_data) @property @pulumi.getter def id(self) -> pulumi.Input[str]: return pulumi.get(self, "id") @id.setter def id(self, value: pulumi.Input[str]): pulumi.set(self, "id", value) @property @pulumi.getter(name="accountId") def account_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "account_id") @account_id.setter def account_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "account_id", value) @property @pulumi.getter def expression(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "expression") @expression.setter def expression(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "expression", value) @property @pulumi.getter def label(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "label") @label.setter def label(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "label", value) @property @pulumi.getter(name="metricStat") def metric_stat(self) -> Optional[pulumi.Input['AnomalyDetectorMetricStatArgs']]: return pulumi.get(self, "metric_stat") @metric_stat.setter def metric_stat(self, value: Optional[pulumi.Input['AnomalyDetectorMetricStatArgs']]): pulumi.set(self, "metric_stat", value) @property @pulumi.getter def period(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "period") @period.setter def period(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "period", value) @property @pulumi.getter(name="returnData") def return_data(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "return_data") @return_data.setter def return_data(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "return_data", value) @pulumi.input_type class AnomalyDetectorMetricMathAnomalyDetectorArgs: def __init__(__self__, *, metric_data_queries: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorMetricDataQueryArgs']]]] = None): if metric_data_queries is not None: pulumi.set(__self__, "metric_data_queries", metric_data_queries) @property @pulumi.getter(name="metricDataQueries") def metric_data_queries(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorMetricDataQueryArgs']]]]: return pulumi.get(self, "metric_data_queries") @metric_data_queries.setter def metric_data_queries(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorMetricDataQueryArgs']]]]): pulumi.set(self, "metric_data_queries", value) @pulumi.input_type class AnomalyDetectorMetricStatArgs: def __init__(__self__, *, metric: pulumi.Input['AnomalyDetectorMetricArgs'], period: pulumi.Input[int], stat: pulumi.Input[str], unit: Optional[pulumi.Input[str]] = None): pulumi.set(__self__, "metric", metric) pulumi.set(__self__, "period", period) pulumi.set(__self__, "stat", stat) if unit is not None: pulumi.set(__self__, "unit", unit) @property @pulumi.getter def metric(self) -> pulumi.Input['AnomalyDetectorMetricArgs']: return pulumi.get(self, "metric") @metric.setter def metric(self, value: pulumi.Input['AnomalyDetectorMetricArgs']): pulumi.set(self, "metric", value) @property @pulumi.getter def period(self) -> pulumi.Input[int]: return pulumi.get(self, "period") @period.setter def period(self, value: pulumi.Input[int]): pulumi.set(self, "period", value) @property @pulumi.getter def stat(self) -> pulumi.Input[str]: return pulumi.get(self, "stat") @stat.setter def stat(self, value: pulumi.Input[str]): pulumi.set(self, "stat", value) @property @pulumi.getter def unit(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "unit") @unit.setter def unit(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "unit", value) @pulumi.input_type class AnomalyDetectorMetricArgs: def __init__(__self__, *, metric_name: pulumi.Input[str], namespace: pulumi.Input[str], dimensions: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorDimensionArgs']]]] = None): pulumi.set(__self__, "metric_name", metric_name) pulumi.set(__self__, "namespace", namespace) if dimensions is not None: pulumi.set(__self__, "dimensions", dimensions) @property @pulumi.getter(name="metricName") def metric_name(self) -> pulumi.Input[str]: return pulumi.get(self, "metric_name") @metric_name.setter def metric_name(self, value: pulumi.Input[str]): pulumi.set(self, "metric_name", value) @property @pulumi.getter def namespace(self) -> pulumi.Input[str]: return pulumi.get(self, "namespace") @namespace.setter def namespace(self, value: pulumi.Input[str]): pulumi.set(self, "namespace", value) @property @pulumi.getter def dimensions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorDimensionArgs']]]]: return pulumi.get(self, "dimensions") @dimensions.setter def dimensions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorDimensionArgs']]]]): pulumi.set(self, "dimensions", value) @pulumi.input_type class AnomalyDetectorRangeArgs: def __init__(__self__, *, end_time: pulumi.Input[str], start_time: pulumi.Input[str]): pulumi.set(__self__, "end_time", end_time) pulumi.set(__self__, "start_time", start_time) @property @pulumi.getter(name="endTime") def end_time(self) -> pulumi.Input[str]: return pulumi.get(self, "end_time") @end_time.setter def end_time(self, value: pulumi.Input[str]): pulumi.set(self, "end_time", value) @property @pulumi.getter(name="startTime") def start_time(self) -> pulumi.Input[str]: return pulumi.get(self, "start_time") @start_time.setter def start_time(self, value: pulumi.Input[str]): pulumi.set(self, "start_time", value) @pulumi.input_type class AnomalyDetectorSingleMetricAnomalyDetectorArgs: def __init__(__self__, *, dimensions: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorDimensionArgs']]]] = None, metric_name: Optional[pulumi.Input[str]] = None, namespace: Optional[pulumi.Input[str]] = None, stat: Optional[pulumi.Input[str]] = None): if dimensions is not None: pulumi.set(__self__, "dimensions", dimensions) if metric_name is not None: pulumi.set(__self__, "metric_name", metric_name) if namespace is not None: pulumi.set(__self__, "namespace", namespace) if stat is not None: pulumi.set(__self__, "stat", stat) @property @pulumi.getter def dimensions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorDimensionArgs']]]]: return pulumi.get(self, "dimensions") @dimensions.setter def dimensions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['AnomalyDetectorDimensionArgs']]]]): pulumi.set(self, "dimensions", value) @property @pulumi.getter(name="metricName") def metric_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "metric_name") @metric_name.setter def metric_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "metric_name", value) @property @pulumi.getter def namespace(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "namespace") @namespace.setter def namespace(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "namespace", value) @property @pulumi.getter def stat(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "stat") @stat.setter def stat(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "stat", value) @pulumi.input_type class InsightRuleTagsArgs: def __init__(__self__): pass @pulumi.input_type class MetricStreamFilterArgs: def __init__(__self__, *, namespace: pulumi.Input[str]): """ This structure defines the metrics that will be streamed. :param pulumi.Input[str] namespace: Only metrics with Namespace matching this value will be streamed. """ pulumi.set(__self__, "namespace", namespace) @property @pulumi.getter def namespace(self) -> pulumi.Input[str]: """ Only metrics with Namespace matching this value will be streamed. """ return pulumi.get(self, "namespace") @namespace.setter def namespace(self, value: pulumi.Input[str]): pulumi.set(self, "namespace", value) @pulumi.input_type class MetricStreamStatisticsConfigurationArgs: def __init__(__self__, *, additional_statistics: pulumi.Input[Sequence[pulumi.Input[str]]], include_metrics: pulumi.Input[Sequence[pulumi.Input['MetricStreamStatisticsMetricArgs']]]): """ This structure specifies a list of additional statistics to stream, and the metrics to stream those additional statistics for. All metrics that match the combination of metric name and namespace will be streamed with the extended statistics, no matter their dimensions. :param pulumi.Input[Sequence[pulumi.Input[str]]] additional_statistics: The additional statistics to stream for the metrics listed in IncludeMetrics. :param pulumi.Input[Sequence[pulumi.Input['MetricStreamStatisticsMetricArgs']]] include_metrics: An array that defines the metrics that are to have additional statistics streamed. """ pulumi.set(__self__, "additional_statistics", additional_statistics) pulumi.set(__self__, "include_metrics", include_metrics) @property @pulumi.getter(name="additionalStatistics") def additional_statistics(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: """ The additional statistics to stream for the metrics listed in IncludeMetrics. """ return pulumi.get(self, "additional_statistics") @additional_statistics.setter def additional_statistics(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): pulumi.set(self, "additional_statistics", value) @property @pulumi.getter(name="includeMetrics") def include_metrics(self) -> pulumi.Input[Sequence[pulumi.Input['MetricStreamStatisticsMetricArgs']]]: """ An array that defines the metrics that are to have additional statistics streamed. """ return pulumi.get(self, "include_metrics") @include_metrics.setter def include_metrics(self, value: pulumi.Input[Sequence[pulumi.Input['MetricStreamStatisticsMetricArgs']]]): pulumi.set(self, "include_metrics", value) @pulumi.input_type class MetricStreamStatisticsMetricArgs: def __init__(__self__, *, metric_name: pulumi.Input[str], namespace: pulumi.Input[str]): """ A structure that specifies the metric name and namespace for one metric that is going to have additional statistics included in the stream. :param pulumi.Input[str] metric_name: The name of the metric. :param pulumi.Input[str] namespace: The namespace of the metric. """ pulumi.set(__self__, "metric_name", metric_name) pulumi.set(__self__, "namespace", namespace) @property @pulumi.getter(name="metricName") def metric_name(self) -> pulumi.Input[str]: """ The name of the metric. """ return pulumi.get(self, "metric_name") @metric_name.setter def metric_name(self, value: pulumi.Input[str]): pulumi.set(self, "metric_name", value) @property @pulumi.getter def namespace(self) -> pulumi.Input[str]: """ The namespace of the metric. """ return pulumi.get(self, "namespace") @namespace.setter def namespace(self, value: pulumi.Input[str]): pulumi.set(self, "namespace", value) @pulumi.input_type class MetricStreamTagArgs: def __init__(__self__, *, key: pulumi.Input[str], value: Optional[pulumi.Input[str]] = None): """ Metadata that you can assign to a Metric Stream, consisting of a key-value pair. :param pulumi.Input[str] key: A unique identifier for the tag. :param pulumi.Input[str] value: An optional string, which you can use to describe or define the tag. """ pulumi.set(__self__, "key", key) if value is not None: pulumi.set(__self__, "value", value) @property @pulumi.getter def key(self) -> pulumi.Input[str]: """ A unique identifier for the tag. """ return pulumi.get(self, "key") @key.setter def key(self, value: pulumi.Input[str]): pulumi.set(self, "key", value) @property @pulumi.getter def value(self) -> Optional[pulumi.Input[str]]: """ An optional string, which you can use to describe or define the tag. """ return pulumi.get(self, "value") @value.setter def value(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "value", value)
34.272855
277
0.650115
2,741
24,368
5.587377
0.057278
0.137186
0.093242
0.059549
0.818283
0.763043
0.723604
0.671303
0.658897
0.62762
0
0.000053
0.225911
24,368
710
278
34.321127
0.811854
0.074524
0
0.743446
1
0
0.118986
0.046857
0
0
0
0
0
1
0.21161
false
0.001873
0.009363
0.076779
0.342697
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
7
c178bd8c2e07ada0f53a2b7fbe1dc0973debe706
26,180
py
Python
clients/client/python/ory_client/api/v0alpha0_api.py
sproutfi/sdk
5340b37d7b3e8f3c1b8f4c0c16ede05488498620
[ "Apache-2.0" ]
null
null
null
clients/client/python/ory_client/api/v0alpha0_api.py
sproutfi/sdk
5340b37d7b3e8f3c1b8f4c0c16ede05488498620
[ "Apache-2.0" ]
null
null
null
clients/client/python/ory_client/api/v0alpha0_api.py
sproutfi/sdk
5340b37d7b3e8f3c1b8f4c0c16ede05488498620
[ "Apache-2.0" ]
null
null
null
""" Ory APIs Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501 The version of the OpenAPI document: v0.0.1-alpha.71 Contact: support@ory.sh Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from ory_client.api_client import ApiClient, Endpoint as _Endpoint from ory_client.model_utils import ( # noqa: F401 check_allowed_values, check_validations, date, datetime, file_type, none_type, validate_and_convert_types ) from ory_client.model.generic_error import GenericError from ory_client.model.project import Project from ory_client.model.project_revision import ProjectRevision from ory_client.model.projects import Projects from ory_client.model.successful_project_config_update import SuccessfulProjectConfigUpdate from ory_client.model.update_project_config_config import UpdateProjectConfigConfig class V0alpha0Api(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client self.create_project_endpoint = _Endpoint( settings={ 'response_type': (Project,), 'auth': [ 'oryAccessToken' ], 'endpoint_path': '/backoffice/public/projects', 'operation_id': 'create_project', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'project_revision', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'project_revision': (ProjectRevision,), }, 'attribute_map': { }, 'location_map': { 'project_revision': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.get_project_endpoint = _Endpoint( settings={ 'response_type': (Project,), 'auth': [ 'oryAccessToken' ], 'endpoint_path': '/backoffice/public/projects/{project_id}', 'operation_id': 'get_project', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'project_id', ], 'required': [ 'project_id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'project_id': (str,), }, 'attribute_map': { 'project_id': 'project_id', }, 'location_map': { 'project_id': 'path', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.list_projects_endpoint = _Endpoint( settings={ 'response_type': (Projects,), 'auth': [ 'oryAccessToken' ], 'endpoint_path': '/backoffice/public/projects', 'operation_id': 'list_projects', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { }, 'attribute_map': { }, 'location_map': { }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.update_project_endpoint = _Endpoint( settings={ 'response_type': (Project,), 'auth': [ 'oryAccessToken' ], 'endpoint_path': '/backoffice/public/projects/{project_id}', 'operation_id': 'update_project', 'http_method': 'PUT', 'servers': None, }, params_map={ 'all': [ 'project_id', 'project_revision', ], 'required': [ 'project_id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'project_id': (str,), 'project_revision': (ProjectRevision,), }, 'attribute_map': { 'project_id': 'project_id', }, 'location_map': { 'project_id': 'path', 'project_revision': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) self.update_project_config_endpoint = _Endpoint( settings={ 'response_type': (SuccessfulProjectConfigUpdate,), 'auth': [ 'oryAccessToken' ], 'endpoint_path': '/backoffice/public/projects/{project_id}/configs', 'operation_id': 'update_project_config', 'http_method': 'PUT', 'servers': None, }, params_map={ 'all': [ 'project_id', 'update_project_config_config', ], 'required': [ 'project_id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'project_id': (str,), 'update_project_config_config': (UpdateProjectConfigConfig,), }, 'attribute_map': { 'project_id': 'project_id', }, 'location_map': { 'project_id': 'path', 'update_project_config_config': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client ) def create_project( self, **kwargs ): """Create a Project # noqa: E501 Creates a new project. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_project(async_req=True) >>> result = thread.get() Keyword Args: project_revision (ProjectRevision): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. async_req (bool): execute request asynchronously Returns: Project If the method is called asynchronously, returns the request thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False ) kwargs['_return_http_data_only'] = kwargs.get( '_return_http_data_only', True ) kwargs['_preload_content'] = kwargs.get( '_preload_content', True ) kwargs['_request_timeout'] = kwargs.get( '_request_timeout', None ) kwargs['_check_input_type'] = kwargs.get( '_check_input_type', True ) kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) kwargs['_spec_property_naming'] = kwargs.get( '_spec_property_naming', False ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.create_project_endpoint.call_with_http_info(**kwargs) def get_project( self, project_id, **kwargs ): """Get a Project # noqa: E501 Get a projects you have access to by its ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_project(project_id, async_req=True) >>> result = thread.get() Args: project_id (str): Project ID The project's ID. Keyword Args: _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. async_req (bool): execute request asynchronously Returns: Project If the method is called asynchronously, returns the request thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False ) kwargs['_return_http_data_only'] = kwargs.get( '_return_http_data_only', True ) kwargs['_preload_content'] = kwargs.get( '_preload_content', True ) kwargs['_request_timeout'] = kwargs.get( '_request_timeout', None ) kwargs['_check_input_type'] = kwargs.get( '_check_input_type', True ) kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) kwargs['_spec_property_naming'] = kwargs.get( '_spec_property_naming', False ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['project_id'] = \ project_id return self.get_project_endpoint.call_with_http_info(**kwargs) def list_projects( self, **kwargs ): """List All Projects # noqa: E501 Lists all projects you have access to. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_projects(async_req=True) >>> result = thread.get() Keyword Args: _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. async_req (bool): execute request asynchronously Returns: Projects If the method is called asynchronously, returns the request thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False ) kwargs['_return_http_data_only'] = kwargs.get( '_return_http_data_only', True ) kwargs['_preload_content'] = kwargs.get( '_preload_content', True ) kwargs['_request_timeout'] = kwargs.get( '_request_timeout', None ) kwargs['_check_input_type'] = kwargs.get( '_check_input_type', True ) kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) kwargs['_spec_property_naming'] = kwargs.get( '_spec_property_naming', False ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.list_projects_endpoint.call_with_http_info(**kwargs) def update_project( self, project_id, **kwargs ): """Update a Project # noqa: E501 Creates a new configuration revision for a project. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_project(project_id, async_req=True) >>> result = thread.get() Args: project_id (str): Project ID The project's ID. Keyword Args: project_revision (ProjectRevision): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. async_req (bool): execute request asynchronously Returns: Project If the method is called asynchronously, returns the request thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False ) kwargs['_return_http_data_only'] = kwargs.get( '_return_http_data_only', True ) kwargs['_preload_content'] = kwargs.get( '_preload_content', True ) kwargs['_request_timeout'] = kwargs.get( '_request_timeout', None ) kwargs['_check_input_type'] = kwargs.get( '_check_input_type', True ) kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) kwargs['_spec_property_naming'] = kwargs.get( '_spec_property_naming', False ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['project_id'] = \ project_id return self.update_project_endpoint.call_with_http_info(**kwargs) def update_project_config( self, project_id, **kwargs ): """Update an Ory Cloud Project Configuration # noqa: E501 This endpoints allows you to update the Ory Cloud Project configuration for individual services (identity, permission, ...). The configuration is fully compatible with the open source projects for the respective services (e.g. Ory Kratos for Identity, Ory Keto for Permissions). This endpoint expects the `version` key to be set in the payload. If it is unset, it will try to import the config as if it is from the most recent version. If you have an older version of a configuration, you should set the version key in the payload! While this endpoint is able to process all configuration items related to features (e.g. password reset), it does not support operational configuration items (e.g. port, tracing, logging) otherwise available in the open source. For configuration items that can not be translated to Ory Cloud, this endpoint will return a list of warnings to help you understand which parts of your config could not be processed. Be aware that updating any service's configuration will completely override your current configuration for that service! # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_project_config(project_id, async_req=True) >>> result = thread.get() Args: project_id (str): Project ID The project's ID. Keyword Args: update_project_config_config (UpdateProjectConfigConfig): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. async_req (bool): execute request asynchronously Returns: SuccessfulProjectConfigUpdate If the method is called asynchronously, returns the request thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False ) kwargs['_return_http_data_only'] = kwargs.get( '_return_http_data_only', True ) kwargs['_preload_content'] = kwargs.get( '_preload_content', True ) kwargs['_request_timeout'] = kwargs.get( '_request_timeout', None ) kwargs['_check_input_type'] = kwargs.get( '_check_input_type', True ) kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) kwargs['_spec_property_naming'] = kwargs.get( '_spec_property_naming', False ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['project_id'] = \ project_id return self.update_project_config_endpoint.call_with_http_info(**kwargs)
38.107715
1,091
0.525974
2,572
26,180
5.131415
0.107309
0.031368
0.0197
0.020458
0.822928
0.789362
0.784816
0.778603
0.762994
0.745492
0
0.003413
0.395569
26,180
686
1,092
38.163265
0.830637
0.418067
0
0.658257
0
0
0.241694
0.060423
0
0
0
0
0
1
0.013761
false
0
0.022936
0
0.050459
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c1e58d0b130a7a63d186c400ecae78b4b97cb3c9
67,643
py
Python
scripts/update_dreqs/update_dreqs_0002.py
jonseddon/primavera-dmt
1239044e37f070b925a3d06db68351f285df780c
[ "BSD-3-Clause" ]
null
null
null
scripts/update_dreqs/update_dreqs_0002.py
jonseddon/primavera-dmt
1239044e37f070b925a3d06db68351f285df780c
[ "BSD-3-Clause" ]
49
2018-11-14T17:00:03.000Z
2021-12-20T11:04:22.000Z
scripts/update_dreqs/update_dreqs_0002.py
jonseddon/primavera-dmt
1239044e37f070b925a3d06db68351f285df780c
[ "BSD-3-Clause" ]
2
2018-07-04T10:58:43.000Z
2018-09-29T14:55:08.000Z
#!/usr/bin/env python2.7 """ update_dreqs_0002.py This script is run to add data requests for data that has been received but the data request spreadsheet indicated would not be generated by this institute. This file moves files that don't have a variable request out of the submission directory and intoa spare directory for CNRM_CERFACS for the CNRM-CM6-1 model for the highresSST-present experiment. """ import argparse import logging.config import os import shutil import sys __version__ = '0.1.0b1' DEFAULT_LOG_LEVEL = logging.WARNING DEFAULT_LOG_FORMAT = '%(levelname)s: %(message)s' logger = logging.getLogger(__name__) def parse_args(): """ Parse command-line arguments """ parser = argparse.ArgumentParser(description='Fix a data submission') parser.add_argument('-l', '--log-level', help='set logging level to one of ' 'debug, info, warn (the default), or error') parser.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__)) args = parser.parse_args() return args def main(args): """ Main entry point """ # This list was constructed at the prompt: # cat ~/lotus/3407487.o | grep 'WARNING: File failed validation. ' \ # 'No variable request found for file' > ~/lotus/no_vr.txt # And then the Python # all_files = list_files('/group_workspaces/jasmin2/primavera4/upload/' # 'CNRM-CERFACS/CNRM-CM6-1/incoming') # partial_paths = [] # with open('no_vr.txt', 'r') as fh: # for line in fh: # fn = line.split(' ')[-1][:-2] # matching = filter(lambda x: fn in x, all_files) # for path in matching: # partial_paths.append('/'.join(path.split('/')[-2:])) # with open('partial_list.txt', 'w') as foh: # foh.write('[\n') # for line in partial_paths: # foh.write("'{}',\n".format(line)) # foh.write(']\n') # # partial_list.txt was then copied and pasted into the variable # files_to_move below base_input_dir = ('/group_workspaces/jasmin2/primavera4/upload/' 'CNRM-CERFACS/CNRM-CM6-1/incoming') dest_dir = ('/group_workspaces/jasmin2/primavera4/upload/' 'CNRM-CERFACS-additional/CNRM-CM6-1/incoming/v20170613') # if using a modern IDE the next variable assignment might want to be # rolled up/hidden as it's longer than ideal files_to_move =[ 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001010000-195012312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195101010000-195112312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195201010000-195212312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195301010000-195312312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195501010000-195512312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195401010000-195412312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195701010000-195712312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195801010000-195812312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195601010000-195612312359.nc', 'v20170517_1950/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195901010000-195912312359.nc', 'v20170517_1950/hus_Emon_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001-201412.nc', 'v20170517_1950/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19500101-19591231.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001010000-195012312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195101010000-195112312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195201010000-195212312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195401010000-195412312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195301010000-195312312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195501010000-195512312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195601010000-195612312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195701010000-195712312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195801010000-195812312359.nc', 'v20170517_1950/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195901010000-195912312359.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19520101-19521231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19530101-19531231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19540101-19541231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19550101-19551231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19560101-19561231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19570101-19571231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19580101-19581231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19590101-19591231.nc', 'v20170517_1950/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001010000-195912312359.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19500101-19501231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19510101-19511231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19520101-19521231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19530101-19531231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19540101-19541231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19550101-19551231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19560101-19561231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19570101-19571231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19580101-19581231.nc', 'v20170517_1950/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19590101-19591231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19500101-19501231.nc', 'v20170517_1950/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19510101-19511231.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001010000-195012312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195101010000-195112312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195201010000-195212312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195301010000-195312312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195401010000-195412312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195501010000-195512312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195601010000-195612312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195701010000-195712312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195801010000-195812312359.nc', 'v20170517_1950/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195901010000-195912312359.nc', 'v20170517_1950/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19500101-19591231.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001010000-195012312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195101010000-195112312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195201010000-195212312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195301010000-195312312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195401010000-195412312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195501010000-195512312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195701010000-195712312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195601010000-195612312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195801010000-195812312359.nc', 'v20170517_1950/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195901010000-195912312359.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19500101-19501231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19510101-19511231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19520101-19521231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19530101-19531231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19540101-19541231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19550101-19551231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19560101-19561231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19580101-19581231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19570101-19571231.nc', 'v20170517_1950/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19590101-19591231.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195001010000-195012312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195101010000-195112312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195201010000-195212312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195301010000-195312312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195401010000-195412312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195501010000-195512312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195601010000-195612312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195701010000-195712312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195901010000-195912312359.nc', 'v20170517_1950/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_195801010000-195812312359.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19500101-19501231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19510101-19511231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19520101-19521231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19540101-19541231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19530101-19531231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19550101-19551231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19560101-19561231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19570101-19571231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19580101-19581231.nc', 'v20170517_1950/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19590101-19591231.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196001010000-196012312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196201010000-196212312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196101010000-196112312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196301010000-196312312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196401010000-196412312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196501010000-196512312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196601010000-196612312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196801010000-196812312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196701010000-196712312359.nc', 'v20170517_1960/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196901010000-196912312359.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19640101-19641231.nc', 'v20170517_1960/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19600101-19691231.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196001010000-196012312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196101010000-196112312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196201010000-196212312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196301010000-196312312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196501010000-196512312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196701010000-196712312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196601010000-196612312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196801010000-196812312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196401010000-196412312359.nc', 'v20170517_1960/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196901010000-196912312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196001010000-196012312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196101010000-196112312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196201010000-196212312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196401010000-196412312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196301010000-196312312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196501010000-196512312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196601010000-196612312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196701010000-196712312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196801010000-196812312359.nc', 'v20170517_1960/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196901010000-196912312359.nc', 'v20170517_1960/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19600101-19691231.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196001010000-196012312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196101010000-196112312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196201010000-196212312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196301010000-196312312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196401010000-196412312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196501010000-196512312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196601010000-196612312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196701010000-196712312359.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196801010000-196812312359.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19600101-19601231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19610101-19611231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19620101-19621231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19630101-19631231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19650101-19651231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19660101-19661231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19670101-19671231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19680101-19681231.nc', 'v20170517_1960/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19690101-19691231.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196001010000-196012312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196101010000-196112312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196201010000-196212312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196301010000-196312312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196401010000-196412312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196601010000-196612312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196501010000-196512312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196701010000-196712312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196801010000-196812312359.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19600101-19601231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19610101-19611231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19620101-19621231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19630101-19631231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19640101-19641231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19650101-19651231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19660101-19661231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19670101-19671231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19680101-19681231.nc', 'v20170517_1960/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19690101-19691231.nc', 'v20170517_1960/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196901010000-196912312359.nc', 'v20170517_1960/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196901010000-196912312359.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19600101-19601231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19610101-19611231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19620101-19621231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19630101-19631231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19640101-19641231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19650101-19651231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19660101-19661231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19670101-19671231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19680101-19681231.nc', 'v20170517_1960/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19690101-19691231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19600101-19601231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19610101-19611231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19630101-19631231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19620101-19621231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19640101-19641231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19650101-19651231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19660101-19661231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19680101-19681231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19670101-19671231.nc', 'v20170517_1960/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19690101-19691231.nc', 'v20170517_1960/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_196001010000-196912312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197001010000-197012312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197101010000-197112312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197201010000-197212312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197301010000-197312312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197501010000-197512312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197401010000-197412312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197601010000-197612312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197701010000-197712312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197801010000-197812312359.nc', 'v20170517_1970/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197901010000-197912312359.nc', 'v20170517_1970/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19700101-19791231.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197001010000-197012312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197101010000-197112312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197201010000-197212312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197301010000-197312312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197401010000-197412312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197501010000-197512312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197601010000-197612312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197701010000-197712312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197801010000-197812312359.nc', 'v20170517_1970/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197901010000-197912312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197001010000-197012312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197101010000-197112312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197201010000-197212312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197301010000-197312312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197401010000-197412312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197501010000-197512312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197601010000-197612312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197701010000-197712312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197801010000-197812312359.nc', 'v20170517_1970/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197901010000-197912312359.nc', 'v20170517_1970/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19700101-19791231.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197001010000-197012312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197101010000-197112312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197201010000-197212312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197301010000-197312312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197401010000-197412312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197601010000-197612312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197501010000-197512312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197701010000-197712312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197801010000-197812312359.nc', 'v20170517_1970/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197901010000-197912312359.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19700101-19701231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19710101-19711231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19730101-19731231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19720101-19721231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19740101-19741231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19750101-19751231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19760101-19761231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19770101-19771231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19780101-19781231.nc', 'v20170517_1970/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19790101-19791231.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197001010000-197012312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197101010000-197112312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197201010000-197212312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197301010000-197312312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197401010000-197412312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197501010000-197512312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197601010000-197612312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197701010000-197712312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197801010000-197812312359.nc', 'v20170517_1970/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197901010000-197912312359.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19700101-19701231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19710101-19711231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19720101-19721231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19730101-19731231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19740101-19741231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19750101-19751231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19760101-19761231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19770101-19771231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19780101-19781231.nc', 'v20170517_1970/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19790101-19791231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19700101-19701231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19720101-19721231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19710101-19711231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19730101-19731231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19740101-19741231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19760101-19761231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19750101-19751231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19770101-19771231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19780101-19781231.nc', 'v20170517_1970/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19790101-19791231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19700101-19701231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19720101-19721231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19710101-19711231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19730101-19731231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19740101-19741231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19750101-19751231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19760101-19761231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19770101-19771231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19780101-19781231.nc', 'v20170517_1970/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19790101-19791231.nc', 'v20170517_1970/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_197001010000-197912312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198001010000-198012312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198101010000-198112312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198201010000-198212312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198301010000-198312312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198401010000-198412312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198601010000-198612312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198501010000-198512312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198801010000-198812312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198701010000-198712312359.nc', 'v20170517_1980/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198901010000-198912312359.nc', 'v20170517_1980/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19800101-19891231.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198001010000-198012312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198101010000-198112312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198201010000-198212312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198301010000-198312312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198401010000-198412312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198601010000-198612312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198501010000-198512312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198701010000-198712312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198801010000-198812312359.nc', 'v20170517_1980/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198901010000-198912312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198001010000-198012312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198101010000-198112312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198301010000-198312312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198201010000-198212312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198401010000-198412312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198501010000-198512312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198701010000-198712312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198601010000-198612312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198801010000-198812312359.nc', 'v20170517_1980/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198901010000-198912312359.nc', 'v20170517_1980/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19800101-19891231.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198101010000-198112312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198001010000-198012312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198201010000-198212312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198301010000-198312312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198401010000-198412312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198501010000-198512312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198601010000-198612312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198701010000-198712312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198801010000-198812312359.nc', 'v20170517_1980/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198901010000-198912312359.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19800101-19801231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19810101-19811231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19820101-19821231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19830101-19831231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19850101-19851231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19840101-19841231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19860101-19861231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19870101-19871231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19880101-19881231.nc', 'v20170517_1980/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19890101-19891231.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198001010000-198012312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198101010000-198112312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198201010000-198212312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198301010000-198312312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198401010000-198412312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198501010000-198512312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198601010000-198612312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198701010000-198712312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198801010000-198812312359.nc', 'v20170517_1980/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198901010000-198912312359.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19800101-19801231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19810101-19811231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19820101-19821231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19830101-19831231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19840101-19841231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19850101-19851231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19870101-19871231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19860101-19861231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19890101-19891231.nc', 'v20170517_1980/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19880101-19881231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19800101-19801231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19810101-19811231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19820101-19821231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19830101-19831231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19840101-19841231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19860101-19861231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19850101-19851231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19880101-19881231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19870101-19871231.nc', 'v20170517_1980/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19890101-19891231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19810101-19811231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19800101-19801231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19820101-19821231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19830101-19831231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19840101-19841231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19850101-19851231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19860101-19861231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19870101-19871231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19880101-19881231.nc', 'v20170517_1980/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19890101-19891231.nc', 'v20170517_1980/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_198001010000-198912312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199201010000-199212312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199101010000-199112312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199001010000-199012312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199401010000-199412312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199301010000-199312312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199501010000-199512312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199701010000-199712312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199601010000-199612312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199801010000-199812312359.nc', 'v20170517_1990/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199901010000-199912312359.nc', 'v20170517_1990/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19900101-19991231.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199001010000-199012312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199101010000-199112312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199201010000-199212312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199301010000-199312312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199401010000-199412312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199501010000-199512312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199601010000-199612312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199701010000-199712312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199801010000-199812312359.nc', 'v20170517_1990/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199901010000-199912312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199101010000-199112312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199001010000-199012312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199201010000-199212312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199301010000-199312312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199401010000-199412312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199501010000-199512312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199601010000-199612312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199701010000-199712312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199801010000-199812312359.nc', 'v20170517_1990/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199901010000-199912312359.nc', 'v20170517_1990/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19900101-19991231.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199001010000-199012312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199101010000-199112312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199201010000-199212312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199301010000-199312312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199401010000-199412312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199601010000-199612312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199501010000-199512312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199701010000-199712312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199801010000-199812312359.nc', 'v20170517_1990/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199901010000-199912312359.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19900101-19901231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19910101-19911231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19920101-19921231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19930101-19931231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19940101-19941231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19950101-19951231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19960101-19961231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19970101-19971231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19980101-19981231.nc', 'v20170517_1990/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19990101-19991231.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199001010000-199012312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199201010000-199212312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199101010000-199112312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199301010000-199312312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199401010000-199412312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199501010000-199512312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199601010000-199612312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199701010000-199712312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199901010000-199912312359.nc', 'v20170517_1990/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199801010000-199812312359.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19900101-19901231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19910101-19911231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19920101-19921231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19930101-19931231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19940101-19941231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19960101-19961231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19950101-19951231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19980101-19981231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19970101-19971231.nc', 'v20170517_1990/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19990101-19991231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19900101-19901231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19910101-19911231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19930101-19931231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19920101-19921231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19940101-19941231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19960101-19961231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19950101-19951231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19970101-19971231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19990101-19991231.nc', 'v20170517_1990/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19980101-19981231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19900101-19901231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19920101-19921231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19940101-19941231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19930101-19931231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19910101-19911231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19960101-19961231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19980101-19981231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19950101-19951231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19970101-19971231.nc', 'v20170517_1990/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_19990101-19991231.nc', 'v20170517_1990/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_199001010000-199912312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200001010000-200012312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200101010000-200112312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200201010000-200212312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200301010000-200312312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200401010000-200412312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200501010000-200512312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200601010000-200612312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200701010000-200712312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200801010000-200812312359.nc', 'v20170517_2000/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200901010000-200912312359.nc', 'v20170517_2000/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20000101-20091231.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200001010000-200012312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200101010000-200112312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200201010000-200212312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200301010000-200312312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200401010000-200412312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200501010000-200512312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200701010000-200712312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200601010000-200612312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200801010000-200812312359.nc', 'v20170517_2000/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200901010000-200912312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200601010000-200612312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200701010000-200712312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200801010000-200812312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200601010000-200612312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200701010000-200712312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200801010000-200812312359.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20060101-20061231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20070101-20071231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20080101-20081231.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200601010000-200612312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200701010000-200712312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200801010000-200812312359.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20060101-20061231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20070101-20071231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20080101-20081231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20060101-20061231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20070101-20071231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20080101-20081231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20060101-20061231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20070101-20071231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20080101-20081231.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200001010000-200012312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200101010000-200112312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200201010000-200212312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200301010000-200312312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200401010000-200412312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200501010000-200512312359.nc', 'v20170517_2000/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200901010000-200912312359.nc', 'v20170517_2000/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20000101-20091231.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200001010000-200012312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200101010000-200112312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200301010000-200312312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200201010000-200212312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200401010000-200412312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200901010000-200912312359.nc', 'v20170517_2000/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200501010000-200512312359.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20000101-20001231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20010101-20011231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20020101-20021231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20030101-20031231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20040101-20041231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20050101-20051231.nc', 'v20170517_2000/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20090101-20091231.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200001010000-200012312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200101010000-200112312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200201010000-200212312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200301010000-200312312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200401010000-200412312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200501010000-200512312359.nc', 'v20170517_2000/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200901010000-200912312359.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20000101-20001231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20010101-20011231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20020101-20021231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20030101-20031231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20040101-20041231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20050101-20051231.nc', 'v20170517_2000/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20090101-20091231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20000101-20001231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20010101-20011231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20020101-20021231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20030101-20031231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20040101-20041231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20050101-20051231.nc', 'v20170517_2000/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20090101-20091231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20010101-20011231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20000101-20001231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20030101-20031231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20020101-20021231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20050101-20051231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20040101-20041231.nc', 'v20170517_2000/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20090101-20091231.nc', 'v20170517_2000/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_200001010000-200912312359.nc', 'v20170517_2010/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201101010000-201112312359.nc', 'v20170517_2010/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201001010000-201012312359.nc', 'v20170517_2010/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201201010000-201212312359.nc', 'v20170517_2010/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201401010000-201412312359.nc', 'v20170517_2010/hus4_6hrPlev_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201301010000-201312312359.nc', 'v20170517_2010/mrso_day_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20100101-20141231.nc', 'v20170517_2010/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201001010000-201012312359.nc', 'v20170517_2010/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201101010000-201112312359.nc', 'v20170517_2010/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201201010000-201212312359.nc', 'v20170517_2010/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201301010000-201312312359.nc', 'v20170517_2010/psl_E3hr_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201401010000-201412312359.nc', 'v20170517_2010/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201001010000-201012312359.nc', 'v20170517_2010/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201201010000-201212312359.nc', 'v20170517_2010/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201101010000-201112312359.nc', 'v20170517_2010/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201301010000-201312312359.nc', 'v20170517_2010/ta_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201401010000-201412312359.nc', 'v20170517_2010/ts_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20100101-20141231.nc', 'v20170517_2010/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201001010000-201012312359.nc', 'v20170517_2010/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201101010000-201112312359.nc', 'v20170517_2010/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201201010000-201212312359.nc', 'v20170517_2010/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201301010000-201312312359.nc', 'v20170517_2010/ua_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201401010000-201412312359.nc', 'v20170517_2010/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20100101-20101231.nc', 'v20170517_2010/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20110101-20111231.nc', 'v20170517_2010/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20120101-20121231.nc', 'v20170517_2010/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20130101-20131231.nc', 'v20170517_2010/ua_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20140101-20141231.nc', 'v20170517_2010/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201001010000-201012312359.nc', 'v20170517_2010/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201101010000-201112312359.nc', 'v20170517_2010/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201201010000-201212312359.nc', 'v20170517_2010/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201301010000-201312312359.nc', 'v20170517_2010/va_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201401010000-201412312359.nc', 'v20170517_2010/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20100101-20101231.nc', 'v20170517_2010/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20110101-20111231.nc', 'v20170517_2010/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20120101-20121231.nc', 'v20170517_2010/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20130101-20131231.nc', 'v20170517_2010/va_Eday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20140101-20141231.nc', 'v20170517_2010/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20100101-20101231.nc', 'v20170517_2010/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20110101-20111231.nc', 'v20170517_2010/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20130101-20131231.nc', 'v20170517_2010/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20120101-20121231.nc', 'v20170517_2010/zg10_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20140101-20141231.nc', 'v20170517_2010/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20100101-20101231.nc', 'v20170517_2010/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20110101-20111231.nc', 'v20170517_2010/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20120101-20121231.nc', 'v20170517_2010/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20130101-20131231.nc', 'v20170517_2010/zg19_Primday_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_20140101-20141231.nc', 'v20170517_2010/zg500_6hrPlevPt_CNRM-CM6-1_highresSST-present_r1i1p1f1_gn_201001010000-201412310000.nc' ] # we are expecting to move 607 files so check that they're all there if len(files_to_move) != 607: logger.error('There are not 607 files listed here.') sys.exit(1) for partial_path in files_to_move: src_path = os.path.join(base_input_dir, partial_path) try: shutil.move(src_path, dest_dir) except Exception: logger.error('Unable to move file {}'.format(src_path)) raise if __name__ == "__main__": cmd_args = parse_args() # determine the log level if cmd_args.log_level: try: log_level = getattr(logging, cmd_args.log_level.upper()) except AttributeError: logger.setLevel(logging.WARNING) logger.error('log-level must be one of: debug, info, warn or error') sys.exit(1) else: log_level = DEFAULT_LOG_LEVEL # configure the logger logging.config.dictConfig({ 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': DEFAULT_LOG_FORMAT, }, }, 'handlers': { 'default': { 'level': log_level, 'class': 'logging.StreamHandler', 'formatter': 'standard' }, }, 'loggers': { '': { 'handlers': ['default'], 'level': log_level, 'propagate': True } } }) # run the code main(cmd_args)
91.533153
112
0.814452
8,998
67,643
5.641587
0.056679
0.084254
0.096291
0.215236
0.957233
0.95542
0.95542
0.954731
0.953647
0.943443
0
0.393642
0.097837
67,643
738
113
91.657182
0.438197
0.02216
0
0.008876
1
0
0.861605
0.855703
0
0
0
0
0
1
0.002959
false
0
0.007396
0
0.011834
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
0
1
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
12
a9acb57ff898bbb52b1c6bb5feaa7acc02684a27
176
py
Python
myriad/testing/util.py
oubiwann/myriad-worlds
bfbbab713e35c5700e37158a892c3a66a8c9f37a
[ "MIT" ]
3
2015-01-29T05:24:32.000Z
2021-05-10T01:47:36.000Z
myriad/testing/util.py
oubiwann/myriad-worlds
bfbbab713e35c5700e37158a892c3a66a8c9f37a
[ "MIT" ]
null
null
null
myriad/testing/util.py
oubiwann/myriad-worlds
bfbbab713e35c5700e37158a892c3a66a8c9f37a
[ "MIT" ]
null
null
null
import os def get_top_directory(): import myriad return os.path.basename(myriad.__path__[0]) def get_test_module(): return get_top_directory().replace("/", ".")
17.6
48
0.698864
24
176
4.708333
0.583333
0.106195
0.265487
0
0
0
0
0
0
0
0
0.006757
0.159091
176
9
49
19.555556
0.756757
0
0
0
0
0
0.011364
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0.166667
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
1
1
0
0
8
a9da098016e3ce4f3e98e05ef944d1b99716e2d2
11,542
py
Python
checkio/Dropbox/Moore Neighbourhood/test_count_neighbours.py
KenMercusLai/checkio
c7702221e1bc0b0b30425859ffa6c09722949d65
[ "MIT" ]
39
2015-02-09T13:24:12.000Z
2019-05-16T17:51:19.000Z
checkio/Dropbox/Moore Neighbourhood/test_count_neighbours.py
KenMercusLai/checkio
c7702221e1bc0b0b30425859ffa6c09722949d65
[ "MIT" ]
1
2019-10-21T16:18:14.000Z
2019-10-21T16:18:14.000Z
checkio/Dropbox/Moore Neighbourhood/test_count_neighbours.py
KenMercusLai/checkio
c7702221e1bc0b0b30425859ffa6c09722949d65
[ "MIT" ]
22
2015-01-30T18:00:05.000Z
2021-05-22T02:57:23.000Z
import unittest from count_neighbours import count_neighbours class Tests(unittest.TestCase): TESTS = { "Basics": [ { "input": ( ( (1, 0, 0, 1, 0), (0, 1, 0, 0, 0), (0, 0, 1, 0, 1), (1, 0, 0, 0, 0), (0, 0, 1, 0, 0), ), 1, 2, ), "answer": 3, }, { "input": ( ( (1, 0, 0, 1, 0), (0, 1, 0, 0, 0), (0, 0, 1, 0, 1), (1, 0, 0, 0, 0), (0, 0, 1, 0, 0), ), 0, 0, ), "answer": 1, }, {"input": (((1, 1, 1), (1, 1, 1), (1, 1, 1)), 0, 2), "answer": 3}, {"input": (((0, 0, 0), (0, 1, 0), (0, 0, 0)), 1, 1), "answer": 0}, ], "Extra": [ {"input": [[[1, 1, 1], [1, 1, 1], [1, 1, 1]], 1, 2], "answer": 5}, { "input": [ [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], ], 5, 5, ], "answer": 7, }, { "input": [ [ [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], ], 5, 4, ], "answer": 2, }, { "input": [ [ [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 1, 0, 1, 0], [1, 1, 1, 0, 1], [0, 1, 0, 1, 0], ], 5, 0, ], "answer": 3, }, { "input": [ [ [1, 1, 1, 0, 1, 1, 1, 0, 0, 1], [1, 0, 0, 1, 1, 1, 1, 1, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 1, 1, 1, 1], [1, 1, 1, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1, 1, 0, 1], [1, 1, 0, 1, 1, 0, 1, 1, 0, 0], ], 5, 6, ], "answer": 6, }, { "input": [ [ [0, 1, 1, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 1, 1, 0, 0, 1, 1, 0], [1, 0, 1, 1, 0, 0, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 1, 0, 1, 1, 1], [0, 0, 1, 0, 1, 1, 1, 0, 1, 1], [0, 1, 0, 1, 0, 0, 1, 0, 1, 1], [0, 1, 1, 0, 0, 0, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1, 0, 0, 1], ], 7, 6, ], "answer": 4, }, { "input": [ [ [1, 0, 0, 0, 1, 0, 0, 1, 1, 0], [0, 1, 0, 1, 0, 1, 1, 0, 0, 1], [1, 1, 1, 1, 0, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 0, 0, 0, 1], [1, 1, 0, 1, 1, 0, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 1, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 0, 0, 0, 1, 0, 1, 1, 1], ], 9, 8, ], "answer": 4, }, { "input": [ [ [1, 1, 0, 1, 0, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0, 1, 0, 1, 1], [0, 1, 0, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 0, 0, 1, 1, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0, 0, 0, 1, 1], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 0, 0, 1, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 0, 1, 1, 1, 1], ], 9, 7, ], "answer": 3, }, { "input": [ [ [0, 1, 1, 1, 1, 0, 0, 0, 1, 0], [1, 0, 0, 0, 1, 1, 0, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 1, 0, 0], [1, 1, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 1, 1, 0, 1, 1], [0, 0, 0, 0, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0], ], 7, 5, ], "answer": 5, }, { "input": [ [ [0, 0, 0, 0, 0, 1, 0, 0, 1, 0], [1, 1, 0, 1, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 1, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 1, 1, 1, 0, 1, 1], [0, 1, 0, 1, 0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 1, 0, 1, 1, 1, 1, 1, 0, 1], [0, 1, 1, 0, 1, 0, 0, 0, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1, 0, 0], ], 7, 2, ], "answer": 6, }, { "input": [ [ [1, 1, 1, 1, 0, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 0, 1, 1, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 1, 0], [1, 1, 1, 1, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 1, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 1, 0, 1, 1, 1, 1], [1, 1, 1, 0, 1, 1, 1, 0, 1, 0], [0, 1, 0, 0, 0, 1, 0, 1, 1, 1], [0, 0, 1, 1, 0, 0, 0, 1, 0, 0], ], 7, 9, ], "answer": 5, }, { "input": [ [ [1, 1, 1, 0, 1, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0, 1, 1, 1, 1], [0, 0, 0, 1, 0, 1, 0, 1, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [0, 1, 1, 0, 0, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 0, 0, 1, 1, 0], [0, 0, 1, 1, 0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 1, 1, 0, 0, 1, 0], ], 2, 9, ], "answer": 3, }, { "input": [ [ [0, 0, 1, 0, 1, 1, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 1, 0, 1, 0, 0], [0, 1, 0, 1, 1, 1, 0, 0, 1, 0], [1, 0, 0, 1, 1, 0, 0, 1, 0, 1], [0, 1, 1, 0, 0, 1, 1, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 1, 0, 0], [1, 1, 0, 1, 1, 1, 0, 1, 1, 1], ], 8, 3, ], "answer": 3, }, { "input": [ [ [0, 0, 0, 1, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 1, 1, 1, 0], [1, 1, 0, 1, 0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 1, 1, 0, 0, 0], [1, 0, 0, 1, 1, 0, 1, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0, 0, 0, 1], [1, 1, 0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 0, 1, 0, 1, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 0, 0, 0, 0], ], 5, 1, ], "answer": 4, }, { "input": [ [ [0, 1, 0, 1, 0, 1, 0, 0, 1, 1], [0, 1, 1, 0, 0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 0, 0, 0], [1, 0, 1, 1, 0, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 1, 0, 0, 1, 0], [0, 1, 1, 1, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 1, 0, 0], ], 0, 7, ], "answer": 3, }, ], } def test_Basics(self): for i in self.TESTS['Basics']: assert count_neighbours(*i['input']) == i['answer'] def test_Extra(self): for i in self.TESTS['Extra']: assert count_neighbours(*i['input']) == i['answer'] if __name__ == "__main__": # pragma: no cover unittest.main()
36.64127
78
0.164616
1,499
11,542
1.258172
0.023349
0.411453
0.38176
0.358431
0.83245
0.820785
0.775186
0.73807
0.73754
0.726935
0
0.354814
0.657165
11,542
314
79
36.757962
0.121809
0.001386
0
0.433225
0
0
0.022648
0
0
0
0
0
0.006515
1
0.006515
false
0
0.006515
0
0.019544
0
0
0
1
null
1
1
1
1
1
1
1
1
1
0
1
1
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
13
e745eb7633bbb24fa55bcacc129c657dad01b2e0
75,932
py
Python
tests/codec/ber/test_encoder.py
pysnmp/pyasn1
d52a38c74df682d0b82d771028c145e8aba23ff4
[ "BSD-2-Clause" ]
null
null
null
tests/codec/ber/test_encoder.py
pysnmp/pyasn1
d52a38c74df682d0b82d771028c145e8aba23ff4
[ "BSD-2-Clause" ]
3
2021-11-16T20:28:20.000Z
2021-11-24T20:27:24.000Z
tests/codec/ber/test_encoder.py
pysnmp/pyasn1
d52a38c74df682d0b82d771028c145e8aba23ff4
[ "BSD-2-Clause" ]
null
null
null
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys try: import unittest2 as unittest except ImportError: import unittest from tests.base import BaseTestCase from pyasn1.type import tag from pyasn1.type import namedtype from pyasn1.type import opentype from pyasn1.type import univ from pyasn1.type import char from pyasn1.codec.ber import encoder from pyasn1.error import PyAsn1Error class LargeTagEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.o = univ.Integer().subtype( value=1, explicitTag=tag.Tag( tag.tagClassApplication, tag.tagFormatSimple, 0xDEADBEAF ), ) def testEncoder(self): assert encoder.encode(self.o) == bytes( (127, 141, 245, 182, 253, 47, 3, 2, 1, 1) ) class IntegerEncoderTestCase(BaseTestCase): def testPosInt(self): assert encoder.encode(univ.Integer(12)) == bytes((2, 1, 12)) def testNegInt(self): assert encoder.encode(univ.Integer(-12)) == bytes((2, 1, 244)) def testZero(self): assert encoder.encode(univ.Integer(0)) == bytes((2, 1, 0)) def testCompactZero(self): encoder.IntegerEncoder.supportCompactZero = True substrate = encoder.encode(univ.Integer(0)) encoder.IntegerEncoder.supportCompactZero = False assert substrate == bytes((2, 0)) def testMinusOne(self): assert encoder.encode(univ.Integer(-1)) == bytes((2, 1, 255)) def testPosLong(self): assert encoder.encode(univ.Integer(0xFFFFFFFFFFFFFFFF)) == bytes( (2, 9, 0, 255, 255, 255, 255, 255, 255, 255, 255) ) def testNegLong(self): assert encoder.encode(univ.Integer(-0xFFFFFFFFFFFFFFFF)) == bytes( (2, 9, 255, 0, 0, 0, 0, 0, 0, 0, 1) ) class IntegerEncoderWithSchemaTestCase(BaseTestCase): def testPosInt(self): assert encoder.encode(12, asn1Spec=univ.Integer()) == bytes((2, 1, 12)) def testNegInt(self): assert encoder.encode(-12, asn1Spec=univ.Integer()) == bytes((2, 1, 244)) def testZero(self): assert encoder.encode(0, asn1Spec=univ.Integer()) == bytes((2, 1, 0)) def testPosLong(self): assert encoder.encode(0xFFFFFFFFFFFFFFFF, asn1Spec=univ.Integer()) == bytes( (2, 9, 0, 255, 255, 255, 255, 255, 255, 255, 255) ) class BooleanEncoderTestCase(BaseTestCase): def testTrue(self): assert encoder.encode(univ.Boolean(1)) == bytes((1, 1, 1)) def testFalse(self): assert encoder.encode(univ.Boolean(0)) == bytes((1, 1, 0)) class BooleanEncoderWithSchemaTestCase(BaseTestCase): def testTrue(self): assert encoder.encode(True, asn1Spec=univ.Boolean()) == bytes((1, 1, 1)) def testFalse(self): assert encoder.encode(False, asn1Spec=univ.Boolean()) == bytes((1, 1, 0)) class BitStringEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.b = univ.BitString((1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1)) def testDefMode(self): assert encoder.encode(self.b) == bytes((3, 3, 1, 169, 138)) def testIndefMode(self): assert encoder.encode(self.b, defMode=False) == bytes((3, 3, 1, 169, 138)) def testDefModeChunked(self): assert encoder.encode(self.b, maxChunkSize=1) == bytes( (35, 8, 3, 2, 0, 169, 3, 2, 1, 138) ) def testIndefModeChunked(self): assert encoder.encode(self.b, defMode=False, maxChunkSize=1) == bytes( (35, 128, 3, 2, 0, 169, 3, 2, 1, 138, 0, 0) ) def testEmptyValue(self): assert encoder.encode(univ.BitString([])) == bytes((3, 1, 0)) class BitStringEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.b = (1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1) self.s = univ.BitString() def testDefMode(self): assert encoder.encode(self.b, asn1Spec=self.s) == bytes((3, 3, 1, 169, 138)) def testIndefMode(self): assert encoder.encode(self.b, asn1Spec=self.s, defMode=False) == bytes( (3, 3, 1, 169, 138) ) def testDefModeChunked(self): assert encoder.encode(self.b, asn1Spec=self.s, maxChunkSize=1) == bytes( (35, 8, 3, 2, 0, 169, 3, 2, 1, 138) ) def testIndefModeChunked(self): assert encoder.encode( self.b, asn1Spec=self.s, defMode=False, maxChunkSize=1 ) == bytes((35, 128, 3, 2, 0, 169, 3, 2, 1, 138, 0, 0)) def testEmptyValue(self): assert encoder.encode([], asn1Spec=self.s) == bytes((3, 1, 0)) class OctetStringEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.o = univ.OctetString("Quick brown fox") def testDefMode(self): assert encoder.encode(self.o) == bytes( ( 4, 15, 81, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, ) ) def testIndefMode(self): assert encoder.encode(self.o, defMode=False) == bytes( ( 4, 15, 81, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, ) ) def testDefModeChunked(self): assert encoder.encode(self.o, maxChunkSize=4) == bytes( ( 36, 23, 4, 4, 81, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 4, 111, 119, 110, 32, 4, 3, 102, 111, 120, ) ) def testIndefModeChunked(self): assert encoder.encode(self.o, defMode=False, maxChunkSize=4) == bytes( ( 36, 128, 4, 4, 81, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 4, 111, 119, 110, 32, 4, 3, 102, 111, 120, 0, 0, ) ) class OctetStringEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.OctetString() self.o = "Quick brown fox" def testDefMode(self): assert encoder.encode(self.o, asn1Spec=self.s) == bytes( ( 4, 15, 81, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, ) ) def testIndefMode(self): assert encoder.encode(self.o, asn1Spec=self.s, defMode=False) == bytes( ( 4, 15, 81, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, ) ) def testDefModeChunked(self): assert encoder.encode(self.o, asn1Spec=self.s, maxChunkSize=4) == bytes( ( 36, 23, 4, 4, 81, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 4, 111, 119, 110, 32, 4, 3, 102, 111, 120, ) ) def testIndefModeChunked(self): assert encoder.encode( self.o, asn1Spec=self.s, defMode=False, maxChunkSize=4 ) == bytes( ( 36, 128, 4, 4, 81, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 4, 111, 119, 110, 32, 4, 3, 102, 111, 120, 0, 0, ) ) class ExpTaggedOctetStringEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.o = univ.OctetString().subtype( value="Quick brown fox", explicitTag=tag.Tag(tag.tagClassApplication, tag.tagFormatSimple, 5), ) def testDefMode(self): assert encoder.encode(self.o) == bytes( ( 101, 17, 4, 15, 81, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, ) ) def testIndefMode(self): assert encoder.encode(self.o, defMode=False) == bytes( ( 101, 128, 4, 15, 81, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 32, 102, 111, 120, 0, 0, ) ) def testDefModeChunked(self): assert encoder.encode(self.o, defMode=True, maxChunkSize=4) == bytes( ( 101, 25, 36, 23, 4, 4, 81, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 4, 111, 119, 110, 32, 4, 3, 102, 111, 120, ) ) def testIndefModeChunked(self): assert encoder.encode(self.o, defMode=False, maxChunkSize=4) == bytes( ( 101, 128, 36, 128, 4, 4, 81, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 4, 111, 119, 110, 32, 4, 3, 102, 111, 120, 0, 0, 0, 0, ) ) class NullEncoderTestCase(BaseTestCase): def testNull(self): assert encoder.encode(univ.Null("")) == bytes((5, 0)) class NullEncoderWithSchemaTestCase(BaseTestCase): def testNull(self): assert encoder.encode(None, univ.Null()) == bytes((5, 0)) class ObjectIdentifierEncoderTestCase(BaseTestCase): def testOne(self): assert encoder.encode( univ.ObjectIdentifier((1, 3, 6, 0, 0xFFFFE)) ) == bytes((6, 6, 43, 6, 0, 191, 255, 126)) def testEdge1(self): assert encoder.encode(univ.ObjectIdentifier((0, 39))) == bytes((6, 1, 39)) def testEdge2(self): assert encoder.encode(univ.ObjectIdentifier((1, 39))) == bytes((6, 1, 79)) def testEdge3(self): # 01111111 assert encoder.encode(univ.ObjectIdentifier((2, 40))) == bytes((6, 1, 120)) def testEdge4(self): # 10010000|10000000|10000000|10000000|01001111 assert encoder.encode(univ.ObjectIdentifier((2, 0xFFFFFFFF))) == bytes( (6, 5, 0x90, 0x80, 0x80, 0x80, 0x4F) ) def testEdge5(self): # 01111111 assert encoder.encode(univ.ObjectIdentifier((2, 47))) == bytes((6, 1, 0x7F)) def testEdge6(self): # 10000001|00000000 assert encoder.encode(univ.ObjectIdentifier((2, 48))) == bytes( (6, 2, 0x81, 0x00) ) def testEdge7(self): # 10000001|00110100|00000003 assert encoder.encode(univ.ObjectIdentifier((2, 100, 3))) == bytes( (6, 3, 0x81, 0x34, 0x03) ) def testEdge8(self): # 10000101|00000000 assert encoder.encode(univ.ObjectIdentifier((2, 560))) == bytes( (6, 2, 133, 0) ) def testEdge9(self): # 10001000|10000100|10000111|0000010 assert encoder.encode(univ.ObjectIdentifier((2, 16843570))) == bytes( (6, 4, 0x88, 0x84, 0x87, 0x02) ) def testEdgeA(self): assert encoder.encode(univ.ObjectIdentifier((2, 5))) == bytes((6, 1, 85)) def testImpossible1(self): try: encoder.encode(univ.ObjectIdentifier((3, 1, 2))) except PyAsn1Error: pass else: assert 0, "impossible leading arc tolerated" def testImpossible2(self): try: encoder.encode(univ.ObjectIdentifier((0,))) except PyAsn1Error: pass else: assert 0, "single arc OID tolerated" def testImpossible3(self): try: encoder.encode(univ.ObjectIdentifier((0, 40))) except PyAsn1Error: pass else: assert 0, "second arc overflow tolerated" def testImpossible4(self): try: encoder.encode(univ.ObjectIdentifier((1, 40))) except PyAsn1Error: pass else: assert 0, "second arc overflow tolerated" def testLarge1(self): assert encoder.encode( univ.ObjectIdentifier((2, 18446744073709551535184467440737095)) ) == bytes( ( 0x06, 0x11, 0x83, 0xC6, 0xDF, 0xD4, 0xCC, 0xB3, 0xFF, 0xFF, 0xFE, 0xF0, 0xB8, 0xD6, 0xB8, 0xCB, 0xE2, 0xB7, 0x17, ) ) def testLarge2(self): assert encoder.encode( univ.ObjectIdentifier((2, 999, 18446744073709551535184467440737095)) ) == bytes( ( 0x06, 0x13, 0x88, 0x37, 0x83, 0xC6, 0xDF, 0xD4, 0xCC, 0xB3, 0xFF, 0xFF, 0xFE, 0xF0, 0xB8, 0xD6, 0xB8, 0xCB, 0xE2, 0xB6, 0x47, ) ) class ObjectIdentifierWithSchemaEncoderTestCase(BaseTestCase): def testOne(self): assert encoder.encode( (1, 3, 6, 0, 0xFFFFE), asn1Spec=univ.ObjectIdentifier() ) == bytes((6, 6, 43, 6, 0, 191, 255, 126)) class RealEncoderTestCase(BaseTestCase): def testChar(self): assert encoder.encode(univ.Real((123, 10, 11))) == bytes( (9, 7, 3, 49, 50, 51, 69, 49, 49) ) def testBin1(self): assert encoder.encode( # default binEncBase = 2 univ.Real((0.5, 2, 0)) # check encbase = 2 and exponent = -1 ) == bytes((9, 3, 128, 255, 1)) def testBin2(self): r = univ.Real((3.25, 2, 0)) r.binEncBase = 8 # change binEncBase only for this instance of Real assert encoder.encode(r) == bytes((9, 3, 148, 255, 13)) # check encbase = 8 def testBin3(self): # change binEncBase in the RealEncoder instance => for all further Real binEncBase, encoder.typeMap[univ.Real.typeId].binEncBase = ( encoder.typeMap[univ.Real.typeId].binEncBase, 16, ) assert encoder.encode( univ.Real((0.00390625, 2, 0)) # check encbase = 16 ) == bytes((9, 3, 160, 254, 1)) encoder.typeMap[univ.Real.typeId].binEncBase = binEncBase def testBin4(self): # choose binEncBase automatically for all further Real (testBin[4-7]) binEncBase, encoder.typeMap[univ.Real.typeId].binEncBase = ( encoder.typeMap[univ.Real.typeId].binEncBase, None, ) assert encoder.encode(univ.Real((1, 2, 0))) == bytes( # check exponent = 0 (9, 3, 128, 0, 1) ) encoder.typeMap[univ.Real.typeId].binEncBase = binEncBase def testBin5(self): assert encoder.encode( univ.Real((3, 2, -1020)) # case of 2 octs for exponent and # negative exponent and abs(exponent) is # all 1's and fills the whole octet(s) ) == bytes((9, 4, 129, 252, 4, 3)) def testBin6(self): assert encoder.encode( univ.Real((1, 2, 262140)) # case of 3 octs for exponent and # check that first 9 bits for exponent # are not all 1's ) == bytes((9, 5, 130, 3, 255, 252, 1)) def testBin7(self): assert encoder.encode( univ.Real((-1, 2, 76354972)) # case of >3 octs for exponent and # mantissa < 0 ) == bytes((9, 7, 195, 4, 4, 141, 21, 156, 1)) def testPlusInf(self): assert encoder.encode(univ.Real("inf")) == bytes((9, 1, 64)) def testMinusInf(self): assert encoder.encode(univ.Real("-inf")) == bytes((9, 1, 65)) def testZero(self): assert encoder.encode(univ.Real(0)) == bytes((9, 0)) class RealEncoderWithSchemaTestCase(BaseTestCase): def testChar(self): assert encoder.encode((123, 10, 11), asn1Spec=univ.Real()) == bytes( (9, 7, 3, 49, 50, 51, 69, 49, 49) ) class UniversalStringEncoderTestCase(BaseTestCase): def testEncoding(self): assert encoder.encode(char.UniversalString("abc")) == bytes( (28, 12, 0, 0, 0, 97, 0, 0, 0, 98, 0, 0, 0, 99) ), "Incorrect encoding" class UniversalStringEncoderWithSchemaTestCase(BaseTestCase): def testEncoding(self): assert encoder.encode("abc", asn1Spec=char.UniversalString()) == bytes( (28, 12, 0, 0, 0, 97, 0, 0, 0, 98, 0, 0, 0, 99) ), "Incorrect encoding" class BMPStringEncoderTestCase(BaseTestCase): def testEncoding(self): assert encoder.encode(char.BMPString("abc")) == bytes( (30, 6, 0, 97, 0, 98, 0, 99) ), "Incorrect encoding" class BMPStringEncoderWithSchemaTestCase(BaseTestCase): def testEncoding(self): assert encoder.encode("abc", asn1Spec=char.BMPString()) == bytes( (30, 6, 0, 97, 0, 98, 0, 99) ), "Incorrect encoding" class UTF8StringEncoderTestCase(BaseTestCase): def testEncoding(self): assert encoder.encode(char.UTF8String("abc")) == bytes( (12, 3, 97, 98, 99) ), "Incorrect encoding" class UTF8StringEncoderWithSchemaTestCase(BaseTestCase): def testEncoding(self): assert encoder.encode("abc", asn1Spec=char.UTF8String()) == bytes( (12, 3, 97, 98, 99) ), "Incorrect encoding" class SequenceOfEncoderTestCase(BaseTestCase): def testEmpty(self): s = univ.SequenceOf() s.clear() assert encoder.encode(s) == bytes((48, 0)) def testDefMode(self): s = univ.SequenceOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s) == bytes( (48, 13, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): s = univ.SequenceOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=False) == bytes( (48, 128, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0) ) def testDefModeChunked(self): s = univ.SequenceOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=True, maxChunkSize=4) == bytes( ( 48, 19, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): s = univ.SequenceOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=False, maxChunkSize=4) == bytes( ( 48, 128, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) class SequenceOfEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.SequenceOf(componentType=univ.OctetString()) self.v = ["quick brown"] def testEmpty(self): assert encoder.encode([], asn1Spec=self.s) == bytes((48, 0)) def testDefMode(self): assert encoder.encode(self.v, asn1Spec=self.s) == bytes( (48, 13, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): assert encoder.encode(self.v, asn1Spec=self.s, defMode=False) == bytes( (48, 128, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0) ) def testDefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=True, maxChunkSize=4 ) == bytes( ( 48, 19, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=False, maxChunkSize=4 ) == bytes( ( 48, 128, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) class SequenceOfEncoderWithComponentsSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.SequenceOf(componentType=univ.OctetString()) def __init(self): self.s.clear() self.s.setComponentByPosition(0, "quick brown") def testDefMode(self): self.__init() assert encoder.encode(self.s) == bytes( (48, 13, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): self.__init() assert encoder.encode(self.s, defMode=False) == bytes( (48, 128, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0) ) def testDefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 48, 19, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 48, 128, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) class SetOfEncoderTestCase(BaseTestCase): def testEmpty(self): s = univ.SetOf() s.clear() assert encoder.encode(s) == bytes((49, 0)) def testDefMode(self): s = univ.SetOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s) == bytes( (49, 13, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): s = univ.SetOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=False) == bytes( (49, 128, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0) ) def testDefModeChunked(self): s = univ.SetOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=True, maxChunkSize=4) == bytes( ( 49, 19, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): s = univ.SetOf() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=False, maxChunkSize=4) == bytes( ( 49, 128, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) class SetOfEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.SetOf(componentType=univ.OctetString()) self.v = ["quick brown"] def testEmpty(self): s = univ.SetOf() assert encoder.encode([], asn1Spec=self.s) == bytes((49, 0)) def testDefMode(self): assert encoder.encode(self.v, asn1Spec=self.s) == bytes( (49, 13, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): assert encoder.encode(self.v, asn1Spec=self.s, defMode=False) == bytes( (49, 128, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0) ) def testDefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=True, maxChunkSize=4 ) == bytes( ( 49, 19, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=False, maxChunkSize=4 ) == bytes( ( 49, 128, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) class SetOfEncoderWithComponentsSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.SetOf(componentType=univ.OctetString()) def __init(self): self.s.clear() self.s.setComponentByPosition(0, "quick brown") def testDefMode(self): self.__init() assert encoder.encode(self.s) == bytes( (49, 13, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): self.__init() assert encoder.encode(self.s, defMode=False) == bytes( (49, 128, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0) ) def testDefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 49, 19, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 49, 128, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) class SequenceEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Sequence() self.s.setComponentByPosition(0, univ.Null("")) self.s.setComponentByPosition(1, univ.OctetString("quick brown")) self.s.setComponentByPosition(2, univ.Integer(1)) def testDefMode(self): assert encoder.encode(self.s) == bytes( ( 48, 18, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, ) ) def testIndefMode(self): assert encoder.encode(self.s, defMode=False) == bytes( ( 48, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, 0, 0, ) ) def testDefModeChunked(self): assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 48, 24, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 2, 1, 1, ) ) def testIndefModeChunked(self): assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 48, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0, ) ) class SequenceEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("place-holder", univ.Null()), namedtype.OptionalNamedType("first-name", univ.OctetString()), namedtype.DefaultedNamedType("age", univ.Integer(33)), ) ) self.v = {"place-holder": None, "first-name": "quick brown", "age": 1} def testEmpty(self): try: assert encoder.encode({}, asn1Spec=self.s) except PyAsn1Error: pass else: assert False, "empty bare sequence tolerated" def testDefMode(self): assert encoder.encode(self.v, asn1Spec=self.s) == bytes( ( 48, 18, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, ) ) def testIndefMode(self): assert encoder.encode(self.v, asn1Spec=self.s, defMode=False) == bytes( ( 48, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, 0, 0, ) ) def testDefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=True, maxChunkSize=4 ) == bytes( ( 48, 24, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 2, 1, 1, ) ) def testIndefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=False, maxChunkSize=4 ) == bytes( ( 48, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0, ) ) class SequenceEncoderWithUntaggedOpenTypesTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) openType = opentype.OpenType("id", {1: univ.Integer(), 2: univ.OctetString()}) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("id", univ.Integer()), namedtype.NamedType("blob", univ.Any(), openType=openType), ) ) def testEncodeOpenTypeChoiceOne(self): self.s.clear() self.s[0] = 1 self.s[1] = univ.Integer(12) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 5, 2, 1, 1, 49, 50) ) def testEncodeOpenTypeChoiceTwo(self): self.s.clear() self.s[0] = 2 self.s[1] = univ.OctetString("quick brown") assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 14, 2, 1, 2, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testEncodeOpenTypeUnknownId(self): self.s.clear() self.s[0] = 2 self.s[1] = univ.ObjectIdentifier("1.3.6") try: encoder.encode(self.s, asn1Spec=self.s) except PyAsn1Error: assert False, "incompatible open type tolerated" def testEncodeOpenTypeIncompatibleType(self): self.s.clear() self.s[0] = 2 self.s[1] = univ.ObjectIdentifier("1.3.6") try: encoder.encode(self.s, asn1Spec=self.s) except PyAsn1Error: assert False, "incompatible open type tolerated" class SequenceEncoderWithImplicitlyTaggedOpenTypesTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) openType = opentype.OpenType("id", {1: univ.Integer(), 2: univ.OctetString()}) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("id", univ.Integer()), namedtype.NamedType( "blob", univ.Any().subtype( implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3) ), openType=openType, ), ) ) def testEncodeOpenTypeChoiceOne(self): self.s.clear() self.s[0] = 1 self.s[1] = univ.Integer(12) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 9, 2, 1, 1, 131, 4, 131, 2, 49, 50) ) class SequenceEncoderWithExplicitlyTaggedOpenTypesTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) openType = opentype.OpenType("id", {1: univ.Integer(), 2: univ.OctetString()}) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("id", univ.Integer()), namedtype.NamedType( "blob", univ.Any().subtype( explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3) ), openType=openType, ), ) ) def testEncodeOpenTypeChoiceOne(self): self.s.clear() self.s[0] = 1 self.s[1] = univ.Integer(12) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 9, 2, 1, 1, 163, 4, 163, 2, 49, 50) ) class SequenceEncoderWithUntaggedSetOfOpenTypesTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) openType = opentype.OpenType("id", {1: univ.Integer(), 2: univ.OctetString()}) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("id", univ.Integer()), namedtype.NamedType( "blob", univ.SetOf(componentType=univ.Any()), openType=openType ), ) ) def testEncodeOpenTypeChoiceOne(self): self.s.clear() self.s[0] = 1 self.s[1].append(univ.Integer(12)) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 7, 2, 1, 1, 49, 2, 49, 50) ) def testEncodeOpenTypeChoiceTwo(self): self.s.clear() self.s[0] = 2 self.s[1].append(univ.OctetString("quick brown")) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( ( 48, 16, 2, 1, 2, 49, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, ) ) def testEncodeOpenTypeUnknownId(self): self.s.clear() self.s[0] = 2 self.s[1].append(univ.ObjectIdentifier("1.3.6")) try: encoder.encode(self.s, asn1Spec=self.s) except PyAsn1Error: assert False, "incompatible open type tolerated" def testEncodeOpenTypeIncompatibleType(self): self.s.clear() self.s[0] = 2 self.s[1].append(univ.ObjectIdentifier("1.3.6")) try: encoder.encode(self.s, asn1Spec=self.s) except PyAsn1Error: assert False, "incompatible open type tolerated" class SequenceEncoderWithImplicitlyTaggedSetOfOpenTypesTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) openType = opentype.OpenType("id", {1: univ.Integer(), 2: univ.OctetString()}) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("id", univ.Integer()), namedtype.NamedType( "blob", univ.SetOf( componentType=univ.Any().subtype( implicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatSimple, 3 ) ) ), openType=openType, ), ) ) def testEncodeOpenTypeChoiceOne(self): self.s.clear() self.s[0] = 1 self.s[1].append(univ.Integer(12)) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 11, 2, 1, 1, 49, 6, 131, 4, 131, 2, 49, 50) ) class SequenceEncoderWithExplicitlyTaggedSetOfOpenTypesTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) openType = opentype.OpenType("id", {1: univ.Integer(), 2: univ.OctetString()}) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("id", univ.Integer()), namedtype.NamedType( "blob", univ.SetOf( componentType=univ.Any().subtype( explicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatSimple, 3 ) ) ), openType=openType, ), ) ) def testEncodeOpenTypeChoiceOne(self): self.s.clear() self.s[0] = 1 self.s[1].append(univ.Integer(12)) assert encoder.encode(self.s, asn1Spec=self.s) == bytes( (48, 11, 2, 1, 1, 49, 6, 163, 4, 163, 2, 49, 50) ) class SequenceEncoderWithComponentsSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("place-holder", univ.Null()), namedtype.OptionalNamedType("first-name", univ.OctetString()), namedtype.DefaultedNamedType("age", univ.Integer(33)), ) ) def __init(self): self.s.clear() self.s.setComponentByPosition(0, "") def __initWithOptional(self): self.s.clear() self.s.setComponentByPosition(0, "") self.s.setComponentByPosition(1, "quick brown") def __initWithDefaulted(self): self.s.clear() self.s.setComponentByPosition(0, "") self.s.setComponentByPosition(2, 1) def __initWithOptionalAndDefaulted(self): self.s.clear() self.s.setComponentByPosition(0, univ.Null("")) self.s.setComponentByPosition(1, univ.OctetString("quick brown")) self.s.setComponentByPosition(2, univ.Integer(1)) def testDefMode(self): self.__init() assert encoder.encode(self.s) == bytes((48, 2, 5, 0)) def testIndefMode(self): self.__init() assert encoder.encode(self.s, defMode=False) == bytes((48, 128, 5, 0, 0, 0)) def testDefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( (48, 2, 5, 0) ) def testIndefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( (48, 128, 5, 0, 0, 0) ) def testWithOptionalDefMode(self): self.__initWithOptional() assert encoder.encode(self.s) == bytes( (48, 15, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testWithOptionalIndefMode(self): self.__initWithOptional() assert encoder.encode(self.s, defMode=False) == bytes( ( 48, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0, ) ) def testWithOptionalDefModeChunked(self): self.__initWithOptional() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 48, 21, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testWithOptionalIndefModeChunked(self): self.__initWithOptional() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 48, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) def testWithDefaultedDefMode(self): self.__initWithDefaulted() assert encoder.encode(self.s) == bytes((48, 5, 5, 0, 2, 1, 1)) def testWithDefaultedIndefMode(self): self.__initWithDefaulted() assert encoder.encode(self.s, defMode=False) == bytes( (48, 128, 5, 0, 2, 1, 1, 0, 0) ) def testWithDefaultedDefModeChunked(self): self.__initWithDefaulted() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( (48, 5, 5, 0, 2, 1, 1) ) def testWithDefaultedIndefModeChunked(self): self.__initWithDefaulted() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( (48, 128, 5, 0, 2, 1, 1, 0, 0) ) def testWithOptionalAndDefaultedDefMode(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s) == bytes( ( 48, 18, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, ) ) def testWithOptionalAndDefaultedIndefMode(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s, defMode=False) == bytes( ( 48, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, 0, 0, ) ) def testWithOptionalAndDefaultedDefModeChunked(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 48, 24, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 2, 1, 1, ) ) def testWithOptionalAndDefaultedIndefModeChunked(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 48, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0, ) ) class ExpTaggedSequenceEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType("number", univ.Integer()), ) ) s = s.subtype( explicitTag=tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 5) ) s[0] = 12 self.s = s def testDefMode(self): assert encoder.encode(self.s) == bytes((101, 5, 48, 3, 2, 1, 12)) def testIndefMode(self): assert encoder.encode(self.s, defMode=False) == bytes( (101, 128, 48, 128, 2, 1, 12, 0, 0, 0, 0) ) class ExpTaggedSequenceComponentEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Sequence( componentType=namedtype.NamedTypes( namedtype.NamedType( "number", univ.Boolean().subtype( explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0) ), ), ) ) self.s[0] = True def testDefMode(self): assert encoder.encode(self.s) == bytes((48, 5, 160, 3, 1, 1, 1)) def testIndefMode(self): assert encoder.encode(self.s, defMode=False) == bytes( (48, 128, 160, 3, 1, 1, 1, 0, 0, 0, 0) ) class SetEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Set() self.s.setComponentByPosition(0, univ.Null("")) self.s.setComponentByPosition(1, univ.OctetString("quick brown")) self.s.setComponentByPosition(2, univ.Integer(1)) def testDefMode(self): assert encoder.encode(self.s) == bytes( ( 49, 18, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, ) ) def testIndefMode(self): assert encoder.encode(self.s, defMode=False) == bytes( ( 49, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, 0, 0, ) ) def testDefModeChunked(self): assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 49, 24, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 2, 1, 1, ) ) def testIndefModeChunked(self): assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 49, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0, ) ) class SetEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Set( componentType=namedtype.NamedTypes( namedtype.NamedType("place-holder", univ.Null()), namedtype.OptionalNamedType("first-name", univ.OctetString()), namedtype.DefaultedNamedType("age", univ.Integer(33)), ) ) self.v = {"place-holder": None, "first-name": "quick brown", "age": 1} def testEmpty(self): try: assert encoder.encode({}, asn1Spec=self.s) except PyAsn1Error: pass else: assert False, "empty bare SET tolerated" def testDefMode(self): assert encoder.encode(self.v, asn1Spec=self.s) == bytes( ( 49, 18, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, ) ) def testIndefMode(self): assert encoder.encode(self.v, asn1Spec=self.s, defMode=False) == bytes( ( 49, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, 0, 0, ) ) def testDefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=True, maxChunkSize=4 ) == bytes( ( 49, 24, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 2, 1, 1, ) ) def testIndefModeChunked(self): assert encoder.encode( self.v, asn1Spec=self.s, defMode=False, maxChunkSize=4 ) == bytes( ( 49, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0, ) ) class SetEncoderWithComponentsSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Set( componentType=namedtype.NamedTypes( namedtype.NamedType("place-holder", univ.Null()), namedtype.OptionalNamedType("first-name", univ.OctetString()), namedtype.DefaultedNamedType("age", univ.Integer(33)), ) ) def __init(self): self.s.clear() self.s.setComponentByPosition(0, "") def __initWithOptional(self): self.s.clear() self.s.setComponentByPosition(0, "") self.s.setComponentByPosition(1, "quick brown") def __initWithDefaulted(self): self.s.clear() self.s.setComponentByPosition(0, "") self.s.setComponentByPosition(2, 1) def __initWithOptionalAndDefaulted(self): self.s.clear() self.s.setComponentByPosition(0, univ.Null("")) self.s.setComponentByPosition(1, univ.OctetString("quick brown")) self.s.setComponentByPosition(2, univ.Integer(1)) def testDefMode(self): self.__init() assert encoder.encode(self.s) == bytes((49, 2, 5, 0)) def testIndefMode(self): self.__init() assert encoder.encode(self.s, defMode=False) == bytes((49, 128, 5, 0, 0, 0)) def testDefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( (49, 2, 5, 0) ) def testIndefModeChunked(self): self.__init() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( (49, 128, 5, 0, 0, 0) ) def testWithOptionalDefMode(self): self.__initWithOptional() assert encoder.encode(self.s) == bytes( (49, 15, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testWithOptionalIndefMode(self): self.__initWithOptional() assert encoder.encode(self.s, defMode=False) == bytes( ( 49, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 0, 0, ) ) def testWithOptionalDefModeChunked(self): self.__initWithOptional() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 49, 21, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testWithOptionalIndefModeChunked(self): self.__initWithOptional() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 49, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 0, 0, ) ) def testWithDefaultedDefMode(self): self.__initWithDefaulted() assert encoder.encode(self.s) == bytes((49, 5, 5, 0, 2, 1, 1)) def testWithDefaultedIndefMode(self): self.__initWithDefaulted() assert encoder.encode(self.s, defMode=False) == bytes( (49, 128, 5, 0, 2, 1, 1, 0, 0) ) def testWithDefaultedDefModeChunked(self): self.__initWithDefaulted() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( (49, 5, 5, 0, 2, 1, 1) ) def testWithDefaultedIndefModeChunked(self): self.__initWithDefaulted() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( (49, 128, 5, 0, 2, 1, 1, 0, 0) ) def testWithOptionalAndDefaultedDefMode(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s) == bytes( ( 49, 18, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, ) ) def testWithOptionalAndDefaultedIndefMode(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s, defMode=False) == bytes( ( 49, 128, 5, 0, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 2, 1, 1, 0, 0, ) ) def testWithOptionalAndDefaultedDefModeChunked(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s, defMode=True, maxChunkSize=4) == bytes( ( 49, 24, 5, 0, 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 2, 1, 1, ) ) def testWithOptionalAndDefaultedIndefModeChunked(self): self.__initWithOptionalAndDefaulted() assert encoder.encode(self.s, defMode=False, maxChunkSize=4) == bytes( ( 49, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0, ) ) class ChoiceEncoderTestCase(BaseTestCase): def testEmpty(self): s = univ.Choice() try: encoder.encode(s) except PyAsn1Error: pass else: assert 0, "encoded unset choice" def testDefModeOptionOne(self): s = univ.Choice() s.setComponentByPosition(0, univ.Null("")) assert encoder.encode(s) == bytes((5, 0)) def testDefModeOptionTwo(self): s = univ.Choice() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s) == bytes( (4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testIndefMode(self): s = univ.Choice() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=False) == bytes( (4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110) ) def testDefModeChunked(self): s = univ.Choice() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=True, maxChunkSize=4) == bytes( ( 36, 17, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, ) ) def testIndefModeChunked(self): s = univ.Choice() s.setComponentByPosition(0, univ.OctetString("quick brown")) assert encoder.encode(s, defMode=False, maxChunkSize=4) == bytes( ( 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, ) ) class ChoiceEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Choice( componentType=namedtype.NamedTypes( namedtype.NamedType("place-holder", univ.Null("")), namedtype.NamedType("number", univ.Integer(0)), namedtype.NamedType("string", univ.OctetString()), ) ) self.v = {"place-holder": None} def testFilled(self): assert encoder.encode(self.v, asn1Spec=self.s) == bytes((5, 0)) class ChoiceEncoderWithComponentsSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Choice( componentType=namedtype.NamedTypes( namedtype.NamedType("place-holder", univ.Null("")), namedtype.NamedType("number", univ.Integer(0)), namedtype.NamedType("string", univ.OctetString()), ) ) def testEmpty(self): try: encoder.encode(self.s) except PyAsn1Error: pass else: assert 0, "encoded unset choice" def testFilled(self): self.s.setComponentByPosition(0, univ.Null("")) assert encoder.encode(self.s) == bytes((5, 0)) def testTagged(self): s = self.s.subtype( explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4) ) s.setComponentByPosition(0, univ.Null("")) assert encoder.encode(s) == bytes((164, 2, 5, 0)) def testUndefLength(self): self.s.setComponentByPosition(2, univ.OctetString("abcdefgh")) assert encoder.encode(self.s, defMode=False, maxChunkSize=3) == bytes( (36, 128, 4, 3, 97, 98, 99, 4, 3, 100, 101, 102, 4, 2, 103, 104, 0, 0) ) def testTaggedUndefLength(self): s = self.s.subtype( explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4) ) s.setComponentByPosition(2, univ.OctetString("abcdefgh")) assert encoder.encode(s, defMode=False, maxChunkSize=3) == bytes( ( 164, 128, 36, 128, 4, 3, 97, 98, 99, 4, 3, 100, 101, 102, 4, 2, 103, 104, 0, 0, 0, 0, ) ) class AnyEncoderTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Any(encoder.encode(univ.OctetString("fox"))) def testUntagged(self): assert encoder.encode(self.s) == bytes((4, 3, 102, 111, 120)) def testTaggedEx(self): s = self.s.subtype( explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4) ) assert encoder.encode(s) == bytes((164, 5, 4, 3, 102, 111, 120)) def testTaggedIm(self): s = self.s.subtype( implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4) ) assert encoder.encode(s) == bytes((132, 5, 4, 3, 102, 111, 120)) class AnyEncoderWithSchemaTestCase(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.s = univ.Any() self.v = encoder.encode(univ.OctetString("fox")) def testUntagged(self): assert encoder.encode(self.v, asn1Spec=self.s) == bytes( (4, 3, 102, 111, 120) ) def testTaggedEx(self): s = self.s.subtype( explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4) ) assert encoder.encode(self.v, asn1Spec=s) == bytes( (164, 5, 4, 3, 102, 111, 120) ) def testTaggedIm(self): s = self.s.subtype( implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4) ) assert encoder.encode(self.v, asn1Spec=s) == bytes( (132, 5, 4, 3, 102, 111, 120) ) suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) if __name__ == "__main__": unittest.TextTestRunner(verbosity=2).run(suite)
25.471989
88
0.396934
6,394
75,932
4.696278
0.067876
0.03963
0.111995
0.079659
0.856401
0.846643
0.819868
0.775077
0.755095
0.73235
0
0.137683
0.504043
75,932
2,980
89
25.480537
0.659683
0.011142
0
0.786121
0
0
0.014909
0
0
0
0.004104
0
0.072052
1
0.085703
false
0.003034
0.004551
0
0.108077
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
99c2f90d99a5ee927b5adda8ec0d45eb2dc837d1
165
py
Python
gui/widgets/py_combo_box/__init__.py
fjl-gj/VideoDownload
479511e8af091028fe7dae657ca8e9eeb6dd4f57
[ "MIT" ]
null
null
null
gui/widgets/py_combo_box/__init__.py
fjl-gj/VideoDownload
479511e8af091028fe7dae657ca8e9eeb6dd4f57
[ "MIT" ]
null
null
null
gui/widgets/py_combo_box/__init__.py
fjl-gj/VideoDownload
479511e8af091028fe7dae657ca8e9eeb6dd4f57
[ "MIT" ]
null
null
null
# PY TITLE BAR # /////////////////////////////////////////////////////////////// from . py_combo_box import PyComboBox from . py_combo_box import set_stylesheet
33
66
0.472727
16
165
4.5625
0.625
0.164384
0.30137
0.383562
0.547945
0
0
0
0
0
0
0
0.121212
165
4
67
41.25
0.503448
0.460606
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
99ed17fd9be4941716b089627ee5d18cb9490898
3,491
py
Python
core/src/zeit/cms/cmscontent.py
louika/vivi
3cc213b873d527127aa6f0dd3c79a542299a8a0e
[ "BSD-3-Clause" ]
null
null
null
core/src/zeit/cms/cmscontent.py
louika/vivi
3cc213b873d527127aa6f0dd3c79a542299a8a0e
[ "BSD-3-Clause" ]
null
null
null
core/src/zeit/cms/cmscontent.py
louika/vivi
3cc213b873d527127aa6f0dd3c79a542299a8a0e
[ "BSD-3-Clause" ]
null
null
null
import grokcore.component as grok import six import six.moves.urllib.parse import zeit.cms.interfaces import zeit.cms.workingcopy.interfaces import zope.component @grok.adapter(six.string_types[0]) @grok.implementer(zeit.cms.interfaces.ICMSContent) def unique_id_to_cms_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) name = '%s://' % (parsed.scheme or '<no-scheme>') return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSContent, name=name) @grok.adapter(six.string_types[0], name='http://') @grok.implementer(zeit.cms.interfaces.ICMSContent) def http_scheme_unique_id_to_cms_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) assert parsed.scheme == 'http' name = 'http://%s/' % parsed.netloc return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSContent, name=name) # Sigh, more copy&paste @grok.adapter(six.string_types[0], name='https://') @grok.implementer(zeit.cms.interfaces.ICMSContent) def https_scheme_unique_id_to_cms_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) assert parsed.scheme == 'https' name = 'https://%s/' % parsed.netloc return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSContent, name=name) @grok.adapter(six.string_types[0], name='<no-scheme>://') @grok.implementer(zeit.cms.interfaces.ICMSContent) def no_scheme_unique_id_to_cms_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) name = '<no-scheme>://%s/' % (parsed.netloc or '<no-netloc>') return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSContent, name=name) # XXX Having to duplicate all these is kludgy. @grok.adapter(six.string_types[0]) @grok.implementer(zeit.cms.interfaces.ICMSWCContent) def unique_id_to_cmswc_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) name = '%s://' % (parsed.scheme or '<no-scheme>') return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSWCContent, name=name) @grok.adapter(six.string_types[0], name='http://') @grok.implementer(zeit.cms.interfaces.ICMSWCContent) def http_scheme_unique_id_to_cmswc_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) assert parsed.scheme == 'http' name = 'http://%s/' % parsed.netloc return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSWCContent, name=name) @grok.adapter(six.string_types[0], name='https://') @grok.implementer(zeit.cms.interfaces.ICMSWCContent) def https_scheme_unique_id_to_cmswc_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) assert parsed.scheme == 'https' name = 'https://%s/' % parsed.netloc return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSWCContent, name=name) @grok.adapter(six.string_types[0], name='<no-scheme>://') @grok.implementer(zeit.cms.interfaces.ICMSWCContent) def no_scheme_unique_id_to_cmswc_content(unique_id): parsed = six.moves.urllib.parse.urlparse(unique_id) name = '<no-scheme>://%s/' % (parsed.netloc or '<no-netloc>') return zope.component.queryAdapter( unique_id, zeit.cms.interfaces.ICMSWCContent, name=name) def resolve_wc_or_repository(unique_id): obj = zeit.cms.interfaces.ICMSWCContent(unique_id, None) if obj is None: obj = zeit.cms.interfaces.ICMSContent(unique_id, None) return obj
37.537634
65
0.739616
479
3,491
5.219207
0.118998
0.112
0.1292
0.0684
0.8672
0.8672
0.8584
0.8104
0.8104
0.8104
0
0.002608
0.121455
3,491
92
66
37.945652
0.81252
0.018906
0
0.732394
0
0
0.060199
0
0
0
0
0
0.056338
1
0.126761
false
0
0.084507
0
0.338028
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