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
fb366eae07a002f783fb8b9dd2a4ab51e39b20cb
102
py
Python
endpoints/main/src/bot.py
Bandoh/Quanbot
53cea9a894fba95ee49dee47ce436ab515996696
[ "MIT" ]
null
null
null
endpoints/main/src/bot.py
Bandoh/Quanbot
53cea9a894fba95ee49dee47ce436ab515996696
[ "MIT" ]
null
null
null
endpoints/main/src/bot.py
Bandoh/Quanbot
53cea9a894fba95ee49dee47ce436ab515996696
[ "MIT" ]
null
null
null
from src.preprocessing import q_bot def getResponse(question): return {'message':q_bot(question)}
25.5
38
0.77451
14
102
5.5
0.785714
0.103896
0
0
0
0
0
0
0
0
0
0
0.117647
102
3
39
34
0.855556
0
0
0
0
0
0.068627
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
1
0
0
6
34b7faa5be6065584719735eca429f9c4e4a9418
202
py
Python
src/masonite/stubs/middlewares/Middleware.py
cercos/masonite
f7f220efa7fae833683e9f07ce13c3795a87d3b8
[ "MIT" ]
1,816
2018-02-14T01:59:51.000Z
2022-03-31T17:09:20.000Z
src/masonite/stubs/middlewares/Middleware.py
cercos/masonite
f7f220efa7fae833683e9f07ce13c3795a87d3b8
[ "MIT" ]
340
2018-02-11T00:27:26.000Z
2022-03-21T12:00:24.000Z
src/masonite/stubs/middlewares/Middleware.py
cercos/masonite
f7f220efa7fae833683e9f07ce13c3795a87d3b8
[ "MIT" ]
144
2018-03-18T00:08:16.000Z
2022-02-26T01:51:58.000Z
from masonite.middleware import Middleware class __class__(Middleware): def before(self, request, response): return request def after(self, request, response): return request
20.2
42
0.707921
22
202
6.318182
0.545455
0.158273
0.273381
0.359712
0.460432
0
0
0
0
0
0
0
0.222772
202
9
43
22.444444
0.88535
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.333333
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
6
34c449bedee4e87b1dfb99a8bfd934a27cfc28cd
31
py
Python
__init__.py
mehmetcc/deprem
64a99cce4a0725df5ef9fd116389fb410a4b5597
[ "MIT" ]
null
null
null
__init__.py
mehmetcc/deprem
64a99cce4a0725df5ef9fd116389fb410a4b5597
[ "MIT" ]
null
null
null
__init__.py
mehmetcc/deprem
64a99cce4a0725df5ef9fd116389fb410a4b5597
[ "MIT" ]
null
null
null
from deprem.api import Kandilli
31
31
0.870968
5
31
5.4
1
0
0
0
0
0
0
0
0
0
0
0
0.096774
31
1
31
31
0.964286
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
1
0
0
6
34e421dd0d13aead1d2464b6c8a5741e0502f2dd
1,242
py
Python
crypto_package/candles/topic_subscribtion.py
TheOnlyCryptoParadise/crypto_package
6ed348712a2477babee16c2cfd87e1fb34584a86
[ "MIT" ]
null
null
null
crypto_package/candles/topic_subscribtion.py
TheOnlyCryptoParadise/crypto_package
6ed348712a2477babee16c2cfd87e1fb34584a86
[ "MIT" ]
1
2021-11-15T21:55:10.000Z
2021-11-15T21:55:10.000Z
crypto_package/candles/topic_subscribtion.py
TheOnlyCryptoParadise/crypto_package
6ed348712a2477babee16c2cfd87e1fb34584a86
[ "MIT" ]
null
null
null
import requests from crypto_package.conf import service_config as conf def subscribe_on_topics(currency_pairs:[str], ticker:str, exchange:str): args = _make_sub_args(currency_pairs, ticker, exchange) try: res = requests.post(conf.CANDLE_DATA_SERVICE + conf.EP_SUBSCRIBE, json=args) except requests.ConnectionError as e: print("CONNECTION ERROR OCCURRED "+str(e)) return False if res.status_code != 200: print("Some exception occurred while connecting to server." + str(res)) return False return True def unsubscribe_on_topics(currency_pairs: [str], ticker: str, exchange: str): args = _make_sub_args(currency_pairs, ticker, exchange) try: res = requests.post(conf.CANDLE_DATA_SERVICE + conf.EP_UNSUBSCRIBE, json=args) except requests.ConnectionError as e: print("CONNECTION ERROR OCCURRED "+str(e)) return False if res.status_code != 200: print("Some exception occurred while connecting to server." + str(res)) return False return True def _make_sub_args(currency_pairs: [str], ticker: str, exchange: str): return {'exchanges': { exchange: { ticker: currency_pairs } } }
28.883721
86
0.678744
156
1,242
5.217949
0.320513
0.095823
0.058968
0.081081
0.821867
0.808354
0.808354
0.764128
0.764128
0.764128
0
0.00627
0.229469
1,242
42
87
29.571429
0.844305
0
0
0.580645
0
0
0.13124
0
0
0
0
0
0
1
0.096774
false
0
0.064516
0.032258
0.387097
0.129032
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
34f1579dbd48ed078185c86a6331c9de6b0c7fd7
91
py
Python
12_module_basic/12_package/mod1.py
hemuke/python
bc99f2b5aee997083ae31f59a2b33db48c8255f3
[ "Apache-2.0" ]
null
null
null
12_module_basic/12_package/mod1.py
hemuke/python
bc99f2b5aee997083ae31f59a2b33db48c8255f3
[ "Apache-2.0" ]
null
null
null
12_module_basic/12_package/mod1.py
hemuke/python
bc99f2b5aee997083ae31f59a2b33db48c8255f3
[ "Apache-2.0" ]
null
null
null
import mod print(dir()) print(dir(mod)) # 调用内置函数dir时模块作为参数,会返回指定模块的所有属性 # 不带mod局部作用域的所有属性
13
31
0.78022
10
91
7.1
0.7
0.225352
0
0
0
0
0
0
0
0
0
0
0.098901
91
6
32
15.166667
0.865854
0.494505
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.666667
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
1
0
6
34f9e344e2559b423220dea758686bb3e96c0358
185
py
Python
BowlingGame/__init__.py
WisWang/code-kata
179188e4e42686807ab3691e0fb68edac08304be
[ "MIT" ]
2
2019-06-17T03:31:13.000Z
2019-06-17T03:31:16.000Z
BowlingGame/__init__.py
WisWang/code-kata
179188e4e42686807ab3691e0fb68edac08304be
[ "MIT" ]
null
null
null
BowlingGame/__init__.py
WisWang/code-kata
179188e4e42686807ab3691e0fb68edac08304be
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2017 - hongzhi.wang <hongzhi.wang@moji.com> ''' Author: hongzhi.wang Create Date: 2019-09-04 Modify Date: 2019-09-04 '''
18.5
60
0.654054
29
185
4.172414
0.724138
0.272727
0.165289
0.198347
0
0
0
0
0
0
0
0.132075
0.140541
185
9
61
20.555556
0.628931
0.913514
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
1
0
1
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
6
9b835c8b0965b6a5aa7d5bd7869df768e9975baa
116
py
Python
ferris/core/messages/__init__.py
palladius/gae-ferris-ricc
e6d9d8d4aadeae10eb258b94b6fe5912c8630b36
[ "MIT" ]
2
2015-03-04T07:05:57.000Z
2015-03-04T07:06:00.000Z
ferris/core/messages/__init__.py
palladius/gae-ferris-ricc
e6d9d8d4aadeae10eb258b94b6fe5912c8630b36
[ "MIT" ]
null
null
null
ferris/core/messages/__init__.py
palladius/gae-ferris-ricc
e6d9d8d4aadeae10eb258b94b6fe5912c8630b36
[ "MIT" ]
null
null
null
from protorpc.messages import * from protorpc.protojson import * from protopigeon import * from .component import *
23.2
32
0.801724
14
116
6.642857
0.5
0.322581
0
0
0
0
0
0
0
0
0
0
0.137931
116
4
33
29
0.93
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
1
0
0
6
32ccbea8503b5668317bc63d440768535572230b
35
py
Python
adminbot/__init__.py
Nukesor/adminbot
103757e478c761e9edb86d8a4176cd508617f81f
[ "MIT" ]
2
2020-09-23T03:32:03.000Z
2021-09-27T02:49:50.000Z
adminbot/__init__.py
Nukesor/adminbot
103757e478c761e9edb86d8a4176cd508617f81f
[ "MIT" ]
null
null
null
adminbot/__init__.py
Nukesor/adminbot
103757e478c761e9edb86d8a4176cd508617f81f
[ "MIT" ]
null
null
null
from adminbot.config import config
17.5
34
0.857143
5
35
6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.114286
35
1
35
35
0.967742
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
1
0
0
6
32f19a7d974e3af92b67395324de3a8b1ca7d9ac
44
py
Python
src/datasets/__init__.py
towardsautonomy/VR3Dense
fd3091b2767d18317f33d62d91465b90ac3d2093
[ "MIT" ]
14
2021-04-14T01:29:25.000Z
2022-03-29T17:16:35.000Z
src/datasets/__init__.py
towardsautonomy/VR3Dense
fd3091b2767d18317f33d62d91465b90ac3d2093
[ "MIT" ]
1
2021-08-12T20:18:59.000Z
2021-08-12T20:18:59.000Z
src/datasets/__init__.py
towardsautonomy/VR3Dense
fd3091b2767d18317f33d62d91465b90ac3d2093
[ "MIT" ]
2
2021-04-14T01:31:10.000Z
2021-04-18T19:27:44.000Z
from .kitti_object import KITTIObjectDataset
44
44
0.909091
5
44
7.8
1
0
0
0
0
0
0
0
0
0
0
0
0.068182
44
1
44
44
0.95122
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
1
0
0
6
fd01e70275df4700c7d38851f20fa33f4d07204f
7,395
py
Python
tests/contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/test_michelson_coding_KT1Rrf.py
juztin/pytezos-1
7e608ff599d934bdcf129e47db43dbdb8fef9027
[ "MIT" ]
1
2021-05-20T16:52:08.000Z
2021-05-20T16:52:08.000Z
tests/contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/test_michelson_coding_KT1Rrf.py
juztin/pytezos-1
7e608ff599d934bdcf129e47db43dbdb8fef9027
[ "MIT" ]
1
2020-12-30T16:44:56.000Z
2020-12-30T16:44:56.000Z
tests/contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/test_michelson_coding_KT1Rrf.py
juztin/pytezos-1
7e608ff599d934bdcf129e47db43dbdb8fef9027
[ "MIT" ]
1
2022-03-20T19:01:00.000Z
2022-03-20T19:01:00.000Z
from unittest import TestCase from tests import get_data from pytezos.michelson.micheline import michelson_to_micheline from pytezos.michelson.formatter import micheline_to_michelson class MichelsonCodingTestKT1Rrf(TestCase): def setUp(self): self.maxDiff = None def test_michelson_parse_code_KT1Rrf(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/code_KT1Rrf.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/code_KT1Rrf.tz')) self.assertEqual(expected, actual) def test_michelson_format_code_KT1Rrf(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/code_KT1Rrf.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/code_KT1Rrf.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_code_KT1Rrf(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/code_KT1Rrf.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual) def test_michelson_parse_storage_KT1Rrf(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/storage_KT1Rrf.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/storage_KT1Rrf.tz')) self.assertEqual(expected, actual) def test_michelson_format_storage_KT1Rrf(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/storage_KT1Rrf.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/storage_KT1Rrf.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_storage_KT1Rrf(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/storage_KT1Rrf.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual) def test_michelson_parse_parameter_opV3vx(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_opV3vx.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_opV3vx.tz')) self.assertEqual(expected, actual) def test_michelson_format_parameter_opV3vx(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_opV3vx.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_opV3vx.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_parameter_opV3vx(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_opV3vx.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual) def test_michelson_parse_parameter_oojLES(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oojLES.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oojLES.tz')) self.assertEqual(expected, actual) def test_michelson_format_parameter_oojLES(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oojLES.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oojLES.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_parameter_oojLES(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oojLES.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual) def test_michelson_parse_parameter_onk3tb(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onk3tb.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onk3tb.tz')) self.assertEqual(expected, actual) def test_michelson_format_parameter_onk3tb(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onk3tb.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onk3tb.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_parameter_onk3tb(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onk3tb.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual) def test_michelson_parse_parameter_oorRMp(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oorRMp.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oorRMp.tz')) self.assertEqual(expected, actual) def test_michelson_format_parameter_oorRMp(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oorRMp.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oorRMp.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_parameter_oorRMp(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_oorRMp.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual) def test_michelson_parse_parameter_onh2C5(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onh2C5.json') actual = michelson_to_micheline(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onh2C5.tz')) self.assertEqual(expected, actual) def test_michelson_format_parameter_onh2C5(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onh2C5.tz') actual = micheline_to_michelson(get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onh2C5.json'), inline=True) self.assertEqual(expected, actual) def test_michelson_inverse_parameter_onh2C5(self): expected = get_data( path='contracts/KT1RrfbcDM5eqho4j4u5EbqbaoEFwBsXA434/parameter_onh2C5.json') actual = michelson_to_micheline(micheline_to_michelson(expected)) self.assertEqual(expected, actual)
46.509434
90
0.734145
692
7,395
7.534682
0.060694
0.048331
0.07384
0.134254
0.953203
0.953203
0.953203
0.953203
0.937476
0.937476
0
0.055017
0.191346
7,395
158
91
46.803797
0.81689
0
0
0.631579
0
0
0.31332
0.31332
0
0
0
0
0.157895
1
0.165414
false
0
0.030075
0
0.203008
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
fd2179c10dab85cf6df4076011923b0dc8383aab
8,093
py
Python
tests/test_07_datatables.py
biotech2021/uniTicket
8c441eac18e67a983e158326b1c4b82f00f1f1ef
[ "Apache-2.0" ]
15
2019-09-06T06:47:08.000Z
2022-01-17T06:39:54.000Z
tests/test_07_datatables.py
biotech2021/uniTicket
8c441eac18e67a983e158326b1c4b82f00f1f1ef
[ "Apache-2.0" ]
69
2019-09-06T12:03:19.000Z
2022-03-26T14:30:53.000Z
tests/test_07_datatables.py
biotech2021/uniTicket
8c441eac18e67a983e158326b1c4b82f00f1f1ef
[ "Apache-2.0" ]
13
2019-09-11T10:54:20.000Z
2021-11-23T09:09:19.000Z
import json import logging from django.urls import reverse from uni_ticket.models import * from uni_ticket.urls import * from uni_ticket.utils import * from . base_ticket_env import BaseTicketEnvironment logger = logging.getLogger('my_logger') class Test_DatatablesFunctions(BaseTicketEnvironment): def setUp(self): super().setUp() self.post_data = json.dumps({"draw":1, "order":[{"column":0,"dir":"asc"}], "start":0, "length":10, "search":{"value":"","regex":False} }) def test_user_json(self): self.structure_1_manager_login() # user_all_tickets_json response = self.client.post(reverse('uni_ticket:user_all_tickets_json'), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # user_opened_ticket_json response = self.client.post(reverse('uni_ticket:user_opened_ticket_json'), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # user_opened_ticket_json response = self.client.post(reverse('uni_ticket:user_closed_ticket_json'), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # user_unassigned_ticket_json response = self.client.post(reverse('uni_ticket:user_unassigned_ticket_json'), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) # data = response_json['data'] # assert data assert response.status_code == 200 def test_operator_json(self): self.structure_1_default_office_operator_login() # operator_all_tickets_json response = self.client.post(reverse('uni_ticket:operator_all_tickets_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # operator_opened_ticket_json response = self.client.post(reverse('uni_ticket:operator_opened_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # operator_opened_ticket_json response = self.client.post(reverse('uni_ticket:operator_my_opened_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # operator_opened_ticket_json response = self.client.post(reverse('uni_ticket:operator_closed_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # operator_unassigned_ticket_json response = self.client.post(reverse('uni_ticket:operator_unassigned_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) # data = response_json['data'] # assert data assert response.status_code == 200 def test_manager_json(self): # manager_all_tickets_json response = self.client.post(reverse('uni_ticket:manager_all_tickets_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) assert response.status_code == 200 # test_manager_unassigned_tickets_json response = self.client.post(reverse('uni_ticket:manager_unassigned_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) data = response_json['data'] assert data # test_manager_opened_tickets_json_fails response = self.client.post(reverse('uni_ticket:manager_opened_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) data = response_json['data'] self.assertFalse(data) # test_manager_opened_tickets_json # Take ticket assignment = TicketAssignment.objects.filter(ticket=self.ticket, taken_date__isnull=True, office__organizational_structure=self.structure_1).first() params = {'priority': 0, 'office': assignment.office} response = self.client.post(reverse('uni_ticket:manager_manage_ticket', kwargs={'structure_slug': self.structure_1.slug, 'ticket_id': self.ticket.code}), params, follow=True) assert response.status_code == 200 response = self.client.post(reverse('uni_ticket:manager_opened_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) data = response_json['data'] assert data # test_manager_closed_tickets_json response = self.client.post(reverse('uni_ticket:manager_closed_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) # data = response_json['data'] # assert data assert response.status_code == 200 # test_manager_my_opened_ticket_json response = self.client.post(reverse('uni_ticket:manager_my_opened_ticket_json', kwargs={'structure_slug': self.structure_1.slug}), {"args": self.post_data}) response_string = response.content.decode("utf-8") response_json = json.loads(response_string) # data = response_json['data'] # assert data assert response.status_code == 200
47.327485
111
0.574323
816
8,093
5.38848
0.105392
0.09552
0.043666
0.080055
0.835342
0.81874
0.807596
0.794178
0.783944
0.779622
0
0.01382
0.32942
8,093
170
112
47.605882
0.796388
0.076239
0
0.628099
0
0
0.132465
0.079452
0
0
0
0
0.132231
1
0.033058
false
0
0.057851
0
0.099174
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
fd38a9d29e7f96b03ef43a0348b41aac885aa35c
7,159
py
Python
tests/test_orders.py
codingedward/book-a-meal-api
36756abc225bf7e8306330f2c3e223dc32af7869
[ "MIT" ]
null
null
null
tests/test_orders.py
codingedward/book-a-meal-api
36756abc225bf7e8306330f2c3e223dc32af7869
[ "MIT" ]
null
null
null
tests/test_orders.py
codingedward/book-a-meal-api
36756abc225bf7e8306330f2c3e223dc32af7869
[ "MIT" ]
2
2018-10-01T17:45:19.000Z
2020-12-07T13:48:25.000Z
import json from app import create_app, db from app.models import User, UserType from .base import BaseTest class TestOrders(BaseTest): def setUp(self): self.app = create_app(config_name='testing') self.client = self.app.test_client() with self.app.app_context(): db.create_all() self.setUpAuth() def data(self): return json.dumps({ 'quantity': 2, 'user_id': self.user['id'], 'menu_item_id': self.create_menu_item()['menu_item']['id'] }) def test_can_create_order(self): res = self.client.post( 'api/v1/orders', data=self.data(), headers=self.user_headers) self.assertEqual(res.status_code, 201) self.assertIn(b'Successfully saved order', res.data) def test_cannot_create_order_without_user_id(self): res = self.client.post( 'api/v1/orders', data=self.data_without(['user_id']), headers=self.user_headers) self.assertEqual(res.status_code, 400) self.assertIn(b'user id field is required', res.data) def test_cannot_create_order_without_quantity(self): res = self.client.post( 'api/v1/orders', data=self.data_without(['quantity']), headers=self.user_headers) self.assertEqual(res.status_code, 400) self.assertIn(b'quantity field is required', res.data) def test_cannot_create_order_without_menu_item_id(self): res = self.client.post( 'api/v1/orders', data=self.data_without(['menu_item_id']), headers=self.user_headers) self.assertEqual(res.status_code, 400) self.assertIn(b'menu item id field is required', res.data) def test_cannot_create_order_with_quantity_than_available(self): res = self.client.post( 'api/v1/orders', data=self.data_with({ 'quantity': 1000 }), headers=self.user_headers) self.assertEqual(res.status_code, 400) self.assertIn(b'meal(s) are available', res.data) def test_can_update_order(self): json_res = self.create_order() res = self.client.put( 'api/v1/orders/{}'.format(json_res['order']['id']), data=json.dumps({ 'quantity': 20, 'menu_item_id': json_res['order']['menu_item_id'], }), headers=self.user_headers) json_res = self.to_dict(res) self.assertEqual(res.status_code, 200) self.assertEqual(json_res['order']['quantity'], 20) self.assertIn(b'successfully updated', res.data) def test_admin_can_update_order(self): json_res = self.create_order() res = self.client.put( 'api/v1/orders/{}'.format(json_res['order']['id']), data=json.dumps({ 'quantity': 20, 'menu_item_id': json_res['order']['menu_item_id'], }), headers=self.admin_headers) json_res = self.to_dict(res) self.assertEqual(res.status_code, 200) self.assertEqual(json_res['order']['quantity'], 20) self.assertIn(b'successfully updated', res.data) def test_cannot_update_another_users_order(self): json_res = self.create_order() user, headers = self.authUser(email='other@mail.com') res = self.client.put( 'api/v1/orders/{}'.format(json_res['order']['id']), data=json.dumps({ 'quantity': 20, 'menu_item_id': json_res['order']['menu_item_id'], }), headers=headers) self.assertEqual(res.status_code, 401) self.assertIn(b'Unauthorized access', res.data) def test_can_get_order(self): json_res = self.create_order() res = self.client.get( 'api/v1/orders/{}'.format(json_res['order']['id']), headers=self.user_headers) self.assertEqual(res.status_code, 200) self.assertIn(b'successfully retrieved', res.data) def test_can_get_many_orders(self): json_res = self.create_order() res = self.client.get( 'api/v1/orders', headers=self.user_headers) self.assertEqual(res.status_code, 200) self.assertIn(b'Successfully retrieved orders', res.data) def test_can_get_many_orders_history(self): json_res = self.create_order() res = self.client.get( 'api/v1/orders?history=1', headers=self.user_headers) self.assertEqual(res.status_code, 200) self.assertIn(b'Successfully retrieved orders', res.data) def test_can_delete_order(self): json_res = self.create_order() res = self.client.delete( 'api/v1/orders/{}'.format(json_res['order']['id']), headers=self.user_headers) self.assertEqual(res.status_code, 200) self.assertIn(b'successfully deleted', res.data) res = self.client.get( 'api/v1/orders/{}'.format(json_res['order']['id']), headers=self.user_headers) self.assertEqual(res.status_code, 404) def test_cannot_delete_another_users_order(self): json_res = self.create_order() user, headers = self.authUser(email='other@mail.com') res = self.client.delete( 'api/v1/orders/{}'.format(json_res['order']['id']), headers=headers) self.assertEqual(res.status_code, 401) self.assertIn(b'Unauthorized access', res.data) def create_order(self): res = self.client.post( 'api/v1/orders', data=self.data(), headers=self.user_headers) self.assertEqual(res.status_code, 201) self.assertIn(b'Successfully saved order', res.data) return self.to_dict(res) def create_menu_item(self): # create a meal res = self.client.post( 'api/v1/meals', data=json.dumps({ 'name': 'ugali', 'cost': 30, }), headers=self.admin_headers) self.assertEqual(res.status_code, 201) self.assertIn(b'Successfully saved meal', res.data) meal_id = self.to_dict(res)['meal']['id'] # now create a menu res = self.client.post( 'api/v1/menus', data=json.dumps({ 'name': 'Lunch' }), headers=self.admin_headers) self.assertEqual(res.status_code, 201) self.assertIn(b'Successfully saved menu', res.data) menu_id = self.to_dict(res)['menu']['id'] # finally create a menu item res = self.client.post( 'api/v1/menu-items', data=json.dumps({ 'quantity': 100, 'menu_id': menu_id, 'meal_id': meal_id }), headers=self.admin_headers) self.assertEqual(res.status_code, 201) self.assertIn(b'Successfully saved menu item', res.data) return self.to_dict(res) def tearDown(self): with self.app.app_context(): db.drop_all()
36.712821
73
0.589468
884
7,159
4.579186
0.114253
0.092391
0.057806
0.106719
0.82164
0.807559
0.777421
0.774457
0.743577
0.743577
0
0.018055
0.280486
7,159
194
74
36.902062
0.767812
0.008102
0
0.647059
0
0
0.143864
0.003241
0
0
0
0
0.217647
1
0.105882
false
0
0.023529
0.005882
0.152941
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
fd516a240abaad139888d35875c617a9edee907e
187
py
Python
graph/edge.py
Kerono4ka/modified-genetic-algorithm-for-calculating-the-chromatic-number-of-a-graph
762c4b16bb6926b30b12754c677218c5e7d9a70e
[ "MIT" ]
null
null
null
graph/edge.py
Kerono4ka/modified-genetic-algorithm-for-calculating-the-chromatic-number-of-a-graph
762c4b16bb6926b30b12754c677218c5e7d9a70e
[ "MIT" ]
null
null
null
graph/edge.py
Kerono4ka/modified-genetic-algorithm-for-calculating-the-chromatic-number-of-a-graph
762c4b16bb6926b30b12754c677218c5e7d9a70e
[ "MIT" ]
null
null
null
class Edge: def __init__(self, start, end): self.start = start self.end = end def __str__(self): return "<" + str(self.start) + " " + str(self.end) + ">"
23.375
64
0.524064
23
187
3.913043
0.391304
0.3
0
0
0
0
0
0
0
0
0
0
0.31016
187
7
65
26.714286
0.697674
0
0
0
0
0
0.016043
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
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
1
1
0
0
6
bd088405a25c206ea8ee5b9c83d778585e57f669
63
py
Python
conduit/data/datamodules/__init__.py
predictive-analytics-lab/pal-bolts
5f1932f351f2e551276b47dfeda7888772d99895
[ "MIT" ]
2
2021-07-15T20:36:25.000Z
2021-08-04T15:53:50.000Z
conduit/data/datamodules/__init__.py
predictive-analytics-lab/conduit
919c1032b940fcb8b07dbe6564e255f135e2698a
[ "MIT" ]
18
2021-09-07T13:50:10.000Z
2021-12-06T19:02:23.000Z
conduit/data/datamodules/__init__.py
predictive-analytics-lab/pal-bolts
5f1932f351f2e551276b47dfeda7888772d99895
[ "MIT" ]
1
2021-08-11T14:35:40.000Z
2021-08-11T14:35:40.000Z
from .audio import * from .base import * from .vision import *
15.75
21
0.714286
9
63
5
0.555556
0.444444
0
0
0
0
0
0
0
0
0
0
0.190476
63
3
22
21
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
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
6
bd0bde640364bbbaae24abec788c052d62fee159
58
py
Python
src/atcoder/agc056/a/sol_0.py
kagemeka/competitive-programming
c70fe481bcd518f507b885fc9234691d8ce63171
[ "MIT" ]
1
2021-07-11T03:20:10.000Z
2021-07-11T03:20:10.000Z
src/atcoder/agc056/a/sol_0.py
kagemeka/competitive-programming
c70fe481bcd518f507b885fc9234691d8ce63171
[ "MIT" ]
39
2021-07-10T05:21:09.000Z
2021-12-15T06:10:12.000Z
src/atcoder/agc056/a/sol_0.py
kagemeka/competitive-programming
c70fe481bcd518f507b885fc9234691d8ce63171
[ "MIT" ]
null
null
null
import typing def main() -> typing.NoReturn: ...
7.25
30
0.568966
6
58
5.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.275862
58
7
31
8.285714
0.785714
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0
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
1
1
0
1
0
1
0
0
6
bd41d04ac54a094a4e575485013a5cc9f84c2cbb
40
py
Python
retrofy/filters/vhs/__init__.py
begalv/retrofy
edf15186cabbfae65014c52b074f863c31e832d7
[ "MIT" ]
null
null
null
retrofy/filters/vhs/__init__.py
begalv/retrofy
edf15186cabbfae65014c52b074f863c31e832d7
[ "MIT" ]
null
null
null
retrofy/filters/vhs/__init__.py
begalv/retrofy
edf15186cabbfae65014c52b074f863c31e832d7
[ "MIT" ]
null
null
null
from retrofy.filters.vhs.vhs import VHS
20
39
0.825
7
40
4.714286
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.1
40
1
40
40
0.916667
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
1
0
0
6
1fbfbd8ca6eb10bd46b718b77d104e67dd5a14c2
238
py
Python
ColungaApp/views.py
JeanContreras12/ColungaRepo
af59e07f31b3d56ebdf02431a2967134985c1624
[ "MIT" ]
1
2021-06-02T02:04:14.000Z
2021-06-02T02:04:14.000Z
ColungaApp/views.py
JeanContreras12/ColungaRepo
af59e07f31b3d56ebdf02431a2967134985c1624
[ "MIT" ]
1
2021-06-03T03:03:59.000Z
2021-06-03T03:03:59.000Z
ColungaApp/views.py
JeanContreras12/ColungaRepo
af59e07f31b3d56ebdf02431a2967134985c1624
[ "MIT" ]
null
null
null
from django.shortcuts import render def index(request): #pasamos un objeto de tipo request como primer argumento return render(request,'ColungaApp/index.html') #def login(request): #return render(request,'ColungaApp/login.html')
34
76
0.773109
32
238
5.75
0.625
0.130435
0.206522
0.315217
0
0
0
0
0
0
0
0
0.12605
238
7
77
34
0.884615
0.504202
0
0
0
0
0.181034
0.181034
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
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
1
0
0
1
1
0
0
0
6
1fd99cd362610f33b22c00f2f9c3b14a5551def7
216
py
Python
za/jupyter/jupyterConfig.py
hth945/pytest
83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc
[ "Apache-2.0" ]
null
null
null
za/jupyter/jupyterConfig.py
hth945/pytest
83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc
[ "Apache-2.0" ]
null
null
null
za/jupyter/jupyterConfig.py
hth945/pytest
83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc
[ "Apache-2.0" ]
null
null
null
c.NotebookApp.ip = '0.0.0.0' c.NotebookApp.port = 80 c.NotebookApp.allow_root = True c.NotebookApp.open_browser = False c.NotebookApp.password = 'sha1:8e4f16cf0aa6:30644b99b9930e0179359266c359461493c2cec5' #填入刚刚复制的字符
43.2
96
0.814815
28
216
6.214286
0.607143
0.344828
0.034483
0
0
0
0
0
0
0
0
0.223881
0.069444
216
5
96
43.2
0.641791
0.041667
0
0
0
0
0.31401
0.280193
0
0
0
0
0
1
0
true
0.2
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
6
1f53f9041456064d3d9cc3e6b65b68acf5dde569
7,634
py
Python
btcturkapi/btcturkapi.py
uguraltinsoy/BtcTurkApi
d42e584ada3936d839eca664c9b57e720726bafb
[ "MIT" ]
null
null
null
btcturkapi/btcturkapi.py
uguraltinsoy/BtcTurkApi
d42e584ada3936d839eca664c9b57e720726bafb
[ "MIT" ]
null
null
null
btcturkapi/btcturkapi.py
uguraltinsoy/BtcTurkApi
d42e584ada3936d839eca664c9b57e720726bafb
[ "MIT" ]
null
null
null
import time, base64, hmac, hashlib, json, requests class BtcTurk(): BASE_URL = "https://api.btcturk.com" GRAPH_BASE_URL = "https://graph-api.btcturk.com" def __init__(self, api_key=None, api_Secret=None): self.api_key = api_key self.api_Secret = api_Secret def _headers(self,protection): if protection: if self.api_key and self.api_Secret: apiSecret = base64.b64decode(self.api_Secret) stamp = str(int(time.time())*1000) data = "{}{}".format(self.api_key, stamp).encode("utf-8") signature = hmac.new(apiSecret, data, hashlib.sha256).digest() signature = base64.b64encode(signature) return {"X-PCK": self.api_key, "X-Stamp": stamp, "X-Signature": signature, "Content-Type" : "application/json"} else: return "You must set your public and private key for this method." return {} def ticker(self,pair_symbol = None): if pair_symbol: method = "/api/v2/ticker?pairSymbol=" + pair_symbol uri = self.BASE_URL + method result = requests.get(url=uri) result = result.json() return json.dumps(result, indent=2) else: method = "/api/v2/ticker" uri = self.BASE_URL + method result = requests.get(url=uri) result = result.json() return json.dumps(result, indent=2) def ticker_currency(self,symbol = None): if symbol: method = "/api/v2/ticker/currency?symbol=" + symbol uri = self.BASE_URL + method result = requests.get(url=uri) result = result.json() return json.dumps(result, indent=2) def get_order_book(self,pair_symbol = None): if pair_symbol: method = "/api/v2/orderbook?pairSymbol=" + pair_symbol uri = self.BASE_URL + method result = requests.get(url=uri) result = result.json() return json.dumps(result, indent=2) else: return "Choose a pair Symbol for this method." def get_all_trades(self,pair_symbol = None,last = None): if pair_symbol: method = "/api/v2/trades?pairSymbol=" + pair_symbol uri = self.BASE_URL + method uri = self.BASE_URL + method result = requests.get(url=uri) result = result.json() return json.dumps(result, indent=2) else: return "Choose a pair Symbol for this method." def get_last_trades(self,pair_symbol = None,last = None): if pair_symbol: method = "/api/v2/trades?pairSymbol=" + pair_symbol uri = self.BASE_URL + method if last: uri = self.BASE_URL + method result = requests.get(url=uri +"&"+ last) result = result.json() return json.dumps(result, indent=2) else: return "Choose a pair Symbol for this method." else: return "Choose a pair Symbol for this method." def get_all_ohcl(self,pair_symbol): if pair_symbol: method = "/v1/ohlcs?pair=" + pair_symbol uri = self.GRAPH_BASE_URL + method result = requests.get(url=uri) result = result.json() return json.dumps(result, indent=2) else: return "Choose a pair Symbol for this method." def get_balances(self): method = "/api/v1/users/balances" uri = self.BASE_URL + method result = requests.get(url=uri, headers=self._headers(True)) result = result.json() return json.dumps(result, indent=2) def get_transactions(self): method = "/api/v1/users/transactions/trade" uri = self.BASE_URL + method result = requests.get(url=uri, headers=self._headers(True)) result = result.json() return json.dumps(result, indent=2) def get_open_order(self,pair_symbol): if pair_symbol: method = "/api/v1/openOrders?pairSymbol=" + pair_symbol uri = self.BASE_URL + method result = requests.get(url=uri, headers=self._headers(True)) result = result.json() return json.dumps(result, indent=2) else: return "Choose a pair Symbol for this method." def cancel_order(self,order_id): if order_id: method = "/api/v1/order?id=" + order_id uri = self.BASE_URL + method result = requests.get(url=uri, headers=self._headers(True)) result = result.json() return json.dumps(result, indent=2) else: return "Choose a pair Symbol for this method." def market_sell(self, pair_symbol, quantity): method = "/api/v1/order" uri = self.BASE_URL + method params={"quantity": quantity ,"price": "0","stopPrice": 0, "newOrderClientId":"BtcTurk API", "orderMethod":"market", "orderType":"sell", "pairSymbol":pair_symbol} result = requests.post(url=uri, headers=self._headers(True), json=params) result = result.json() return json.dumps(result, indent=2) def market_buy(self, pair_symbol, quantity): method = "/api/v1/order" uri = self.BASE_URL + method params={"quantity": quantity ,"price": "0","stopPrice": 0, "newOrderClientId":"BtcTurk API", "orderMethod":"market", "orderType":"buy", "pairSymbol":pair_symbol} result = requests.post(url=uri, headers=self._headers(True), json=params) result = result.json() return json.dumps(result, indent=2) def limit_sell(self, pair_symbol, quantity, price): method = "/api/v1/order" uri = self.BASE_URL + method params={"quantity": quantity ,"price": price,"stopPrice": 0, "newOrderClientId":"BtcTurk API", "orderMethod":"limit", "orderType":"sell", "pairSymbol":pair_symbol} result = requests.post(url=uri, headers=self._headers(True), json=params) result = result.json() return json.dumps(result, indent=2) def limit_buy(self, pair_symbol, quantity, price): method = "/api/v1/order" uri = self.BASE_URL + method params={"quantity": quantity ,"price": price,"stopPrice": 0, "newOrderClientId":"BtcTurk API", "orderMethod":"limit", "orderType":"buy", "pairSymbol":pair_symbol} result = requests.post(url=uri, headers=self._headers(True), json=params) result = result.json() return json.dumps(result, indent=2) def stop_sell(self, pair_symbol, quantity, price, stop_price): method = "/api/v1/order" uri = self.BASE_URL + method params={"quantity": quantity ,"price": price,"stopPrice": stop_price, "newOrderClientId":"BtcTurk API", "orderMethod":"stoplimit", "orderType":"sell", "pairSymbol":pair_symbol} result = requests.post(url=uri, headers=self._headers(True), json=params) result = result.json() return json.dumps(result, indent=2) def stop_buy(self, pair_symbol, quantity, price, stop_price): method = "/api/v1/order" uri = self.BASE_URL + method params={"quantity": quantity ,"price": price,"stopPrice": stop_price, "newOrderClientId":"BtcTurk API", "orderMethod":"stoplimit", "orderType":"buy", "pairSymbol":pair_symbol} result = requests.post(url=uri, headers=self._headers(True), json=params) result = result.json() return json.dumps(result, indent=2)
42.88764
184
0.59759
911
7,634
4.891328
0.11416
0.083034
0.055431
0.056553
0.812837
0.795108
0.791966
0.777603
0.777603
0.777603
0
0.010517
0.277574
7,634
177
185
43.129944
0.797461
0
0
0.644737
0
0
0.171885
0.029084
0
0
0
0
0
1
0.118421
false
0
0.006579
0
0.322368
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
2f31537869153801dc294531ddcd628ec7bd5e5d
98
py
Python
moredata/enricher/elasticsearch_connector/__init__.py
thomassonobe/more-data
b3d4a8e32f385a69749c8139915e3638fcced37b
[ "BSD-3-Clause" ]
null
null
null
moredata/enricher/elasticsearch_connector/__init__.py
thomassonobe/more-data
b3d4a8e32f385a69749c8139915e3638fcced37b
[ "BSD-3-Clause" ]
null
null
null
moredata/enricher/elasticsearch_connector/__init__.py
thomassonobe/more-data
b3d4a8e32f385a69749c8139915e3638fcced37b
[ "BSD-3-Clause" ]
null
null
null
from .elasticsearch_connector import * from .index_handler import * from .policy_handler import *
24.5
38
0.816327
12
98
6.416667
0.583333
0.25974
0
0
0
0
0
0
0
0
0
0
0.122449
98
3
39
32.666667
0.895349
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
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
6
2f3242b3c8304e26b5becda0d1166fe1814414ef
20
py
Python
src/wrappers/__init__.py
j0hnBlk/VTIL-Python
f3599e8d0f12f84b401c151b5b0a516adacc108a
[ "BSD-3-Clause" ]
20
2020-06-29T13:55:25.000Z
2022-02-02T08:48:19.000Z
src/wrappers/__init__.py
j0hnBlk/VTIL-Python
f3599e8d0f12f84b401c151b5b0a516adacc108a
[ "BSD-3-Clause" ]
2
2020-07-14T20:46:27.000Z
2020-07-14T20:58:01.000Z
src/wrappers/__init__.py
j0hnBlk/VTIL-Python
f3599e8d0f12f84b401c151b5b0a516adacc108a
[ "BSD-3-Clause" ]
6
2020-07-04T13:14:45.000Z
2022-01-17T22:48:15.000Z
from .vtil import *
10
19
0.7
3
20
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.2
20
1
20
20
0.875
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
1
0
0
6
85e44a57d3e26b1ca725f33e94bfa866bb5658fc
21
py
Python
pycoop/__init__.py
dio/coop-cut
e44b4bdf62a0c8a0593e7fe6de7e5b368c0f853e
[ "BSD-2-Clause" ]
null
null
null
pycoop/__init__.py
dio/coop-cut
e44b4bdf62a0c8a0593e7fe6de7e5b368c0f853e
[ "BSD-2-Clause" ]
null
null
null
pycoop/__init__.py
dio/coop-cut
e44b4bdf62a0c8a0593e7fe6de7e5b368c0f853e
[ "BSD-2-Clause" ]
null
null
null
from pycoop import *
10.5
20
0.761905
3
21
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.190476
21
1
21
21
0.941176
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
1
0
0
6
c806c58c465d8a6ed122c6d34bb2dcfe7d7df453
42
py
Python
examples/tabnanny_example.py
pynickle/python-cheatsheet-redefined
95da661df47263e0ab5d505c0c80f932cb72152c
[ "WTFPL" ]
11
2021-11-13T09:49:37.000Z
2022-01-13T11:11:29.000Z
examples/tabnanny_example.py
pynickle/python-cheatsheet-redefined
95da661df47263e0ab5d505c0c80f932cb72152c
[ "WTFPL" ]
null
null
null
examples/tabnanny_example.py
pynickle/python-cheatsheet-redefined
95da661df47263e0ab5d505c0c80f932cb72152c
[ "WTFPL" ]
3
2021-11-15T06:13:42.000Z
2021-12-24T07:09:48.000Z
for i in range(10): print(i) print(i)
14
19
0.595238
9
42
2.777778
0.666667
0.48
0
0
0
0
0
0
0
0
0
0.0625
0.238095
42
3
20
14
0.71875
0
0
0.666667
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.666667
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
6
c81f85169d9be11010d8f90125d1aa142356a0df
70
py
Python
starepandas/stareseries.py
SpatioTemporal/STAREPandas
cb33d0cd8c61d960cd7e5070d8b56d1a8805edae
[ "MIT" ]
1
2021-01-03T18:17:01.000Z
2021-01-03T18:17:01.000Z
starepandas/stareseries.py
SpatioTemporal/STAREPandas
cb33d0cd8c61d960cd7e5070d8b56d1a8805edae
[ "MIT" ]
66
2020-09-09T21:15:14.000Z
2022-03-25T21:30:53.000Z
starepandas/stareseries.py
SpatioTemporal/STAREPandas
cb33d0cd8c61d960cd7e5070d8b56d1a8805edae
[ "MIT" ]
2
2020-07-28T14:17:32.000Z
2021-01-21T19:24:23.000Z
import geopandas class STARESeries(geopandas.GeoSeries): pass
8.75
39
0.757143
7
70
7.571429
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.185714
70
7
40
10
0.929825
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
1
0
0
6
c07aacd7074d2339049d4c475e0ce0537054fb52
42
py
Python
mm_response_generation/dataset/__init__.py
seo-95/dstc9-SIMMC
0f967f874e360ea00ac4629b0ac9f3d9c25a833a
[ "MIT" ]
1
2021-03-16T10:59:36.000Z
2021-03-16T10:59:36.000Z
mm_response_generation/dataset/__init__.py
D2KLab/dstc9-SIMMC
09caba2446cf168a6acf91a7cbce051c5bbffeaf
[ "MIT" ]
4
2021-06-08T22:32:48.000Z
2022-03-12T00:49:39.000Z
mm_response_generation/dataset/__init__.py
seo-95/dstc9-SIMMC
0f967f874e360ea00ac4629b0ac9f3d9c25a833a
[ "MIT" ]
1
2021-09-06T14:57:16.000Z
2021-09-06T14:57:16.000Z
from .processed_dataset import FastDataset
42
42
0.904762
5
42
7.4
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
42
1
42
42
0.948718
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
1
0
0
6
23b57d72c4264f1d7930889fb9748247f8fa39fc
1,573
py
Python
participant_profile/migrations/0029_auto_20210903_0921.py
zidandff/primaseru
a14fa7326098af220e0671c3bf3870b4016ab4bf
[ "MIT" ]
null
null
null
participant_profile/migrations/0029_auto_20210903_0921.py
zidandff/primaseru
a14fa7326098af220e0671c3bf3870b4016ab4bf
[ "MIT" ]
null
null
null
participant_profile/migrations/0029_auto_20210903_0921.py
zidandff/primaseru
a14fa7326098af220e0671c3bf3870b4016ab4bf
[ "MIT" ]
2
2021-08-10T09:09:58.000Z
2021-08-10T10:54:51.000Z
# Generated by Django 3.2.5 on 2021-09-03 09:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('participant_profile', '0028_alter_participantprofile_kk_number'), ] operations = [ migrations.AlterField( model_name='fatherstudentprofile', name='job', field=models.CharField(max_length=100, null=True, verbose_name='Pekerjaan'), ), migrations.AlterField( model_name='fatherstudentprofile', name='salary', field=models.PositiveIntegerField(help_text='Diisi dengan angka', null=True, verbose_name='Penghasilan'), ), migrations.AlterField( model_name='motherstudentprofile', name='job', field=models.CharField(max_length=100, null=True, verbose_name='Pekerjaan'), ), migrations.AlterField( model_name='motherstudentprofile', name='salary', field=models.PositiveIntegerField(help_text='Diisi dengan angka', null=True, verbose_name='Penghasilan'), ), migrations.AlterField( model_name='studentguardianprofile', name='job', field=models.CharField(max_length=100, null=True, verbose_name='Pekerjaan'), ), migrations.AlterField( model_name='studentguardianprofile', name='salary', field=models.PositiveIntegerField(help_text='Diisi dengan angka', null=True, verbose_name='Penghasilan'), ), ]
35.75
117
0.624921
145
1,573
6.62069
0.351724
0.125
0.15625
0.18125
0.816667
0.816667
0.657292
0.657292
0.657292
0.657292
0
0.024159
0.263191
1,573
43
118
36.581395
0.804142
0.028608
0
0.810811
1
0
0.211664
0.054391
0
0
0
0
0
1
0
false
0
0.027027
0
0.108108
0
0
0
0
null
0
0
1
1
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
23b9cb1bbe2dc195461ad7cc95ebd3371d8a8c23
119
py
Python
fusionexport/__init__.py
madhulika-accolite/fusionexport-python-client
70e9566288f615a4a38f1676e99ede1900da9163
[ "MIT" ]
1
2018-05-24T09:06:23.000Z
2018-05-24T09:06:23.000Z
fusionexport/__init__.py
madhulika-accolite/fusionexport-python-client
70e9566288f615a4a38f1676e99ede1900da9163
[ "MIT" ]
null
null
null
fusionexport/__init__.py
madhulika-accolite/fusionexport-python-client
70e9566288f615a4a38f1676e99ede1900da9163
[ "MIT" ]
null
null
null
from .export_config import ExportConfig from .export_error import ExportError from .export_manager import ExportManager
39.666667
41
0.882353
15
119
6.8
0.6
0.294118
0
0
0
0
0
0
0
0
0
0
0.092437
119
3
41
39.666667
0.944444
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
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
6
23f9fb26f1f99df016879b1c5cc1960eb6f74bb2
3,536
py
Python
alpha/image_preprocessing/success_percent.py
Naroooma/alpha-research-project
5261cb10ebf9d670f6d66637b47071d85d402dbc
[ "Apache-2.0" ]
null
null
null
alpha/image_preprocessing/success_percent.py
Naroooma/alpha-research-project
5261cb10ebf9d670f6d66637b47071d85d402dbc
[ "Apache-2.0" ]
null
null
null
alpha/image_preprocessing/success_percent.py
Naroooma/alpha-research-project
5261cb10ebf9d670f6d66637b47071d85d402dbc
[ "Apache-2.0" ]
null
null
null
import json import os from pathlib import Path import numpy as np import matplotlib.pyplot as plt total_success = 0 total_img = 0 max_success_dist = 20 dists_1 = [] dists_2 = [] dists_3 = [] dists_4 = [] def image_success(img, dataset, dists): global total_img global total_success global max_success_dist # results JSON with open(Path(os.getcwd()) / "results" / dataset / img) as f: results_list = np.array(json.load(f)) # truth JSON with open(Path(os.getcwd()) / "truth" / dataset / img) as f: truth_list = np.array(json.load(f)) # L2 distance calculation dist = np.linalg.norm(results_list - truth_list) dists.append(dist) if dist <= max_success_dist: total_success += 1 total_img += 1 def skin_image_success(img, dataset, algo, dists): global total_img global total_success global max_success_dist # results JSON with open(Path(os.getcwd()) / "results" / dataset / algo / img) as f: results_list = np.array(json.load(f)) # truth JSON with open(Path(os.getcwd()) / "truth" / dataset / img) as f: truth_list = np.array(json.load(f)) # L2 distance calculation dist = np.linalg.norm(results_list - truth_list) dists.append(dist) if dist <= max_success_dist: total_success += 1 total_img += 1 def dist_histogram_all(dists): bins = int(1200 / 20) plt.xlabel("L2 Distance") plt.ylabel("Number of Images") plt.title("L2 distances of YCrCb_thresh_2") plt.hist(dists, bins=bins, rwidth=0.95,) # plt.legend(['calibration_data', 'calibration_white']) plt.legend(['alpha_data', 'kinect_leap', 'senz3d', 'alpha_white']) plt.show() def dist_histogram_single(dists): bins = int(1200 / 20) plt.xlabel("L2 Distance") plt.ylabel("Number of Images") plt.title("L2 distances of YCrCb_thresh_2") plt.hist(dists, bins=bins, rwidth=0.95,) plt.show() # # iterate over each image in results_folder for results_file in os.listdir(Path(os.getcwd()) / "results" / "alpha_data"): image_success(results_file, "alpha_data", dists_1) print(total_success, total_img) print(str(total_success * 100 / total_img) + '%') total_success = 0 total_img = 0 for results_file in os.listdir(Path(os.getcwd()) / "results" / "senz3d"): image_success(results_file, "senz3d", dists_3) print(total_success, total_img) print(str(total_success * 100 / total_img) + '%') total_success = 0 total_img = 0 for results_file in os.listdir(Path(os.getcwd()) / "results" / "kinect_leap"): image_success(results_file, "kinect_leap", dists_2) print(total_success, total_img) print(str(total_success * 100 / total_img) + '%') total_success = 0 total_img = 0 for results_file in os.listdir(Path(os.getcwd()) / "results" / "alpha_white"): image_success(results_file, "alpha_white", dists_4) print(total_success, total_img) print(str(total_success * 100 / total_img) + '%') dist_histogram_all([dists_1, dists_2, dists_3, dists_4]) # -------- RESULTS FOR SKIN COLOR ------------- # for results_file in os.listdir(Path(os.getcwd()) / "results" / "calibration_white" / "HSV_skin_thresh"): # skin_image_success(results_file, "calibration_white", "HSV_skin_thresh", dists_1) # print(total_success, total_img) # print(str(total_success * 100 / total_img) + '%') # total_success = 0 # total_img = 0 # for results_file in os.listdir(Path(os.getcwd()) / "results" / "calibration_data" / "HSV_skin_thresh"): # skin_image_success(results_file, "calibration_data", "HSV_skin_thresh", dists_2) # print(total_success, total_img) # print(str(total_success * 100 / total_img) + '%') # dist_histogram_all([dists_1, dists_2])
26.992366
106
0.718609
540
3,536
4.455556
0.159259
0.104738
0.049875
0.063175
0.813799
0.772236
0.763092
0.763092
0.74813
0.705736
0
0.025876
0.136595
3,536
131
107
26.992366
0.762201
0.239536
0
0.657895
0
0
0.106447
0
0
0
0
0
0
1
0.052632
false
0
0.065789
0
0.118421
0.105263
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
23fde717663bbed43b78ddc967d56b8b4f0151bc
95
py
Python
classification/distill_loss/__init__.py
WangChen0902/FRSKD-Paddle
d7e8313be6f7785e64a35623074271288d6c57aa
[ "Apache-2.0" ]
null
null
null
classification/distill_loss/__init__.py
WangChen0902/FRSKD-Paddle
d7e8313be6f7785e64a35623074271288d6c57aa
[ "Apache-2.0" ]
null
null
null
classification/distill_loss/__init__.py
WangChen0902/FRSKD-Paddle
d7e8313be6f7785e64a35623074271288d6c57aa
[ "Apache-2.0" ]
null
null
null
from .KD import * from .FitNet import * from .AT import * from .OD import * from .sla import *
15.833333
21
0.684211
15
95
4.333333
0.466667
0.615385
0
0
0
0
0
0
0
0
0
0
0.210526
95
5
22
19
0.866667
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
1
0
0
6
f1d9c9b6a9e0cdba7c384b29d07173cd6aac3663
9,769
py
Python
lib/widgets/wizard.py
moreorem/graphdener
ad8a4b98ad79afb2da820248d656384614721882
[ "BSD-3-Clause" ]
null
null
null
lib/widgets/wizard.py
moreorem/graphdener
ad8a4b98ad79afb2da820248d656384614721882
[ "BSD-3-Clause" ]
null
null
null
lib/widgets/wizard.py
moreorem/graphdener
ad8a4b98ad79afb2da820248d656384614721882
[ "BSD-3-Clause" ]
null
null
null
from PyQt5.QtWidgets import (QPushButton, QLabel, QFileDialog, QComboBox, QWizard, QWizardPage, QLineEdit, QVBoxLayout, QApplication, QHBoxLayout) from ..services.actions import Call from ..func import get_pattern from ..statics import NODECNAMES, EDGECNAMES # TODO: Call new graph after import wizard class ImportWizard(QWizard): def __init__(self, parent=None, isSingleFile=False): super(ImportWizard, self).__init__(parent) if not isSingleFile: self.addPage(Page1(self)) self.addPage(Page2(self)) else: self.addPage(Page2b(self)) self.setWindowTitle("Import Wizard") # Trigger close event when pressing Finish button to redirect variables to backend self.button(QWizard.FinishButton).clicked.connect(self.onFinished) self.button(QWizard.NextButton).clicked.connect(self.page(0).receiveInputs) # Initialize variables to send to backend self.filepath = [None, None] self.nodeColumns = [] self.nodeDelimiters = [] self.edgeColumns = [] self.edgeDelimiters = [] def onFinished(self): print("Finish") # Ask input from edge import page self.page(1).receiveInputs() regexN = get_pattern(self.nodeColumns, self.nodeDelimiters) regexE = get_pattern(self.edgeColumns, self.edgeDelimiters) # Communicate and transmit to backend Call.connect() result = Call.send_paths(self.filepath, regexN, regexE, self.nodeColumns, self.edgeColumns) # TODO: Make use of return state to enable graph controls if result == 'paths imported': return True class Page1(QWizardPage): def __init__(self, parent=None): super(Page1, self).__init__(parent) self.columnSelectors = [] self.delimiterFields = [] nCols = len(NODECNAMES) # Initialize comboboxes and text fields for i in range(nCols): self.columnSelectors.append(QComboBox()) for i in range(nCols + 1): self.delimiterFields.append(QLineEdit()) self.openFileBtn = QPushButton("Import Node List") self.stepLabel = QLabel() self.formatLabel = QLabel() layout = QVBoxLayout() layout.addWidget(self.stepLabel) layout.addWidget(self.openFileBtn) layout.addWidget(self.formatLabel) patternLayout = QHBoxLayout() for i in range(nCols + 1): patternLayout.addWidget(self.delimiterFields[i]) if i < nCols: patternLayout.addWidget(self.columnSelectors[i]) self.setLayout(layout) # Insert the layout of the regexp elements layout.addLayout(patternLayout) # Bind actions self.openFileBtn.clicked.connect(self.openFileNameDialog) def openFileNameDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName( self, "QFileDialog.getOpenFileName()", "", "All Files (*);;Python Files (*.py)", options=options) # if user selected a file store its path to a variable if fileName: self.wizard().filepath[0] = fileName def initializePage(self): self.stepLabel.setText("Nodes information") self.formatLabel.setText("Nodes file format") i = 0 for comboBox in self.columnSelectors: comboBox.addItems(NODECNAMES) comboBox.addItem('-') # Initialize first selection to avoid error comboBox.setCurrentIndex(i) comboBox.activated.connect(self.handleActivated) comboBox.selection = comboBox.currentText() i += 1 # Initialize textboxes with multi-space expression for delimiterField in self.delimiterFields: delimiterField.setText('\\s+') self.delimiterFields[0].setText('^') self.delimiterFields[-1].setText('') def handleActivated(self, index): self.sender().selection = self.sender().itemText(index) def receiveInputs(self): ''' activates on next button and sends the input to wizard ''' self.wizard().nodeDelimiters = [delim.text() for delim in self.delimiterFields] self.wizard().nodeColumns = [comboBox.selection for comboBox in self.columnSelectors] class Page2(QWizardPage): def __init__(self, parent=None): super(Page2, self).__init__(parent) nCols = len(EDGECNAMES) self.setWindowTitle("Edge phase") self.stepLabel = QLabel() self.openFileBtn = QPushButton("Import Edge List") self.columnSelectors = [] self.delimiterFields = [] # Initialize comboboxes and text fields for i in range(nCols): self.columnSelectors.append(QComboBox()) for i in range(nCols + 1): self.delimiterFields.append(QLineEdit()) layout = QVBoxLayout() layout.addWidget(self.stepLabel) layout.addWidget(self.openFileBtn) patternLayout = QHBoxLayout() for i in range(nCols + 1): patternLayout.addWidget(self.delimiterFields[i]) if i < nCols: patternLayout.addWidget(self.columnSelectors[i]) self.setLayout(layout) # Insert the layout of the regexp elements layout.addLayout(patternLayout) # Bind actions self.openFileBtn.clicked.connect(self.openFileNameDialog) def openFileNameDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName( self, "QFileDialog.getOpenFileName()", "", "All Files (*);;Python Files (*.py)", options=options) # if user selected a file store its path to a variable if fileName: self.wizard().filepath[1] = fileName def initializePage(self): self.stepLabel.setText("Edges information") i = 0 for comboBox in self.columnSelectors: comboBox.addItems(EDGECNAMES) comboBox.addItem('-') # Initialize first selection to avoid error comboBox.setCurrentIndex(i) comboBox.activated.connect(self.handleActivated) comboBox.selection = comboBox.currentText() i += 1 # Initialize textboxes with multi-space expression for delimiterField in self.delimiterFields: delimiterField.setText('\\s+') self.delimiterFields[0].setText('^') self.delimiterFields[-1].setText('') def handleActivated(self, index): self.sender().selection = self.sender().itemText(index) def receiveInputs(self): ''' activates on next button and sends the input to wizard ''' self.wizard().edgeDelimiters = [delim.text() for delim in self.delimiterFields] self.wizard().edgeColumns = [comboBox.selection for comboBox in self.columnSelectors] # To be called only on single file Import class Page2b(QWizardPage): def __init__(self, parent=None): super(Page2b, self).__init__(parent) nCols = len(EDGECNAMES) self.setWindowTitle("Edge phase") self.stepLabel = QLabel() self.openFileBtn = QPushButton("Import Edge List") self.columnSelectors = [] self.delimiterFields = [] # Initialize comboboxes and text fields for i in range(nCols): self.columnSelectors.append(QComboBox()) for i in range(nCols + 1): self.delimiterFields.append(QLineEdit()) layout = QVBoxLayout() layout.addWidget(self.stepLabel) layout.addWidget(self.openFileBtn) patternLayout = QHBoxLayout() for i in range(nCols + 1): patternLayout.addWidget(self.delimiterFields[i]) if i < nCols: patternLayout.addWidget(self.columnSelectors[i]) self.setLayout(layout) # Insert the layout of the regexp elements layout.addLayout(patternLayout) # Bind actions self.openFileBtn.clicked.connect(self.openFileNameDialog) def openFileNameDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName( self, "QFileDialog.getOpenFileName()", "", "All Files (*);;Python Files (*.py)", options=options) # if user selected a file store its path to a variable if fileName: self.wizard().filepath[1] = fileName def initializePage(self): self.stepLabel.setText("Edges information") i = 0 for comboBox in self.columnSelectors: comboBox.addItems(EDGECNAMES) comboBox.addItem('-') # Initialize first selection to avoid error comboBox.setCurrentIndex(i) comboBox.activated.connect(self.handleActivated) comboBox.selection = comboBox.currentText() i += 1 # Initialize textboxes with multi-space expression for delimiterField in self.delimiterFields: delimiterField.setText('\\s+') self.delimiterFields[0].setText('^') self.delimiterFields[-1].setText('') def handleActivated(self, index): self.sender().selection = self.sender().itemText(index) def receiveInputs(self): ''' activates on next button and sends the input to wizard ''' self.wizard().edgeDelimiters = [delim.text() for delim in self.delimiterFields] self.wizard().edgeColumns = [comboBox.selection for comboBox in self.columnSelectors]
38.011673
99
0.636708
965
9,769
6.405181
0.180311
0.064553
0.008736
0.016017
0.765248
0.761851
0.761851
0.728038
0.728038
0.712182
0
0.0046
0.265636
9,769
256
100
38.160156
0.856984
0.123042
0
0.747312
0
0
0.044116
0.010208
0
0
0
0.003906
0
1
0.091398
false
0
0.05914
0
0.177419
0.005376
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
f1e95e5e0e269c8daecaf8014736cccc1131df23
153
py
Python
code/backend/app/api/repository/category_repo.py
ndhngoc91/COMP90082_S1_TO_2021
91cc5d039df3b4d271b100a9afec99897a9501a2
[ "MIT" ]
2
2021-08-22T05:10:27.000Z
2021-11-08T12:57:27.000Z
code/backend/app/api/repository/category_repo.py
ndhngoc91/COMP90082_S1_TO_2021
91cc5d039df3b4d271b100a9afec99897a9501a2
[ "MIT" ]
null
null
null
code/backend/app/api/repository/category_repo.py
ndhngoc91/COMP90082_S1_TO_2021
91cc5d039df3b4d271b100a9afec99897a9501a2
[ "MIT" ]
1
2021-08-21T19:51:33.000Z
2021-08-21T19:51:33.000Z
from sqlalchemy.orm import Session from app.api import models, schemas def get_all_categories(db: Session): return db.query(models.Category).all()
21.857143
42
0.777778
23
153
5.086957
0.73913
0
0
0
0
0
0
0
0
0
0
0
0.130719
153
6
43
25.5
0.879699
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
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
1
1
1
0
0
6
7b00a99e732a7cb440f5d037f0752eac539f23b4
48
py
Python
server/src/model/exception/database_integrity_violated.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
4
2021-12-31T10:06:34.000Z
2022-01-16T16:34:50.000Z
server/src/model/exception/database_integrity_violated.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
null
null
null
server/src/model/exception/database_integrity_violated.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
null
null
null
class DatabaseIntegrityViolated(Exception): ...
24
47
0.8125
3
48
13
1
0
0
0
0
0
0
0
0
0
0
0
0.0625
48
1
48
48
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
1
1
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
1
0
0
0
1
0
0
6
9e47afcdbfa3bbb752b548b41992a5c03ef84ac6
41
py
Python
video_razor/__init__.py
5starkarma/video-razor
2a3aa4825ba91ad4bd50ca51aae257b74ac2cf7b
[ "MIT" ]
null
null
null
video_razor/__init__.py
5starkarma/video-razor
2a3aa4825ba91ad4bd50ca51aae257b74ac2cf7b
[ "MIT" ]
null
null
null
video_razor/__init__.py
5starkarma/video-razor
2a3aa4825ba91ad4bd50ca51aae257b74ac2cf7b
[ "MIT" ]
null
null
null
from video_razor.razor import VideoRazor
20.5
40
0.878049
6
41
5.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.097561
41
1
41
41
0.945946
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
1
0
0
6
9e4c9e320e12a01079fae6c62789f65a127575b1
2,599
py
Python
tests/parse_test.py
markusressel/py-range-parse
c4274429b6f3c7ae335da6bf9a04cc6ab0272953
[ "MIT" ]
2
2019-09-13T14:32:09.000Z
2019-09-19T00:17:58.000Z
tests/parse_test.py
markusressel/py-range-parse
c4274429b6f3c7ae335da6bf9a04cc6ab0272953
[ "MIT" ]
3
2020-09-24T14:13:41.000Z
2020-12-16T21:52:10.000Z
tests/parse_test.py
markusressel/py-range-parse
c4274429b6f3c7ae335da6bf9a04cc6ab0272953
[ "MIT" ]
2
2019-10-07T13:07:56.000Z
2020-09-26T09:33:23.000Z
import math import unittest from py_range_parse import parse_range class ParseTest(unittest.TestCase): def test_parse_equal_values(self): parsed_range = parse_range("[-inf..-inf]") self.assertIn(-math.inf, parsed_range) def test_parse_spaces(self): parsed_range = parse_range("[ -8.3 .. +18.3 ]") self.assertIn(-8.3, parsed_range) self.assertIn(18.3, parsed_range) def test_parse_all_values(self): parsed_range = parse_range("[-inf..∞]") self.assertIn(-math.inf, parsed_range) self.assertIn(math.inf, parsed_range) def test_parse_range_negative(self): parsed_range = parse_range("[-5..-2]") self.assertEqual(parsed_range.start, -5) self.assertEqual(parsed_range.end, -2) def test_parse_range_negative_inverted(self): parsed_range = parse_range("[5..-2]") self.assertEqual(parsed_range.start, -2) self.assertEqual(parsed_range.end, 5) def test_float_range_contains(self): parsed_range = parse_range("[1.0..4.3]") self.assertIn(1, parsed_range) self.assertIn(1.0, parsed_range) self.assertIn(2, parsed_range) self.assertIn(2.0, parsed_range) self.assertIn(2.1, parsed_range) self.assertIn(4, parsed_range) self.assertIn(4.3, parsed_range) def test_int_range_contains(self): parsed_range = parse_range("[1..4]") self.assertIn(1, parsed_range) self.assertIn(1.0, parsed_range) self.assertIn(2, parsed_range) self.assertIn(2.0, parsed_range) self.assertNotIn(2.1, parsed_range) self.assertIn(4, parsed_range) self.assertIn(4.0, parsed_range) def test_int_range_exclude(self): parsed_range = parse_range("]1..4[") assert parsed_range is not None def test_int_range_inf(self): parsed_range = parse_range("]-inf..4[") self.assertNotIn(-math.inf, parsed_range) self.assertIn(-10000000, parsed_range) def test_int_range_inf_inverted(self): parsed_range = parse_range("]inf..4[") self.assertNotIn(-math.inf, parsed_range) self.assertNotIn(3, parsed_range) self.assertNotIn(4, parsed_range) self.assertIn(4.000000001, parsed_range) self.assertIn(10000000, parsed_range) def test_int_inclusion_inverted(self): parsed_range = parse_range("]2..1]") self.assertNotIn(0, parsed_range) self.assertIn(1, parsed_range) self.assertNotIn(2, parsed_range) self.assertNotIn(3, parsed_range)
31.695122
55
0.657945
348
2,599
4.646552
0.132184
0.312925
0.204082
0.241806
0.837972
0.71243
0.593692
0.496599
0.448361
0.396413
0
0.041481
0.220854
2,599
81
56
32.08642
0.756543
0
0
0.278689
0
0
0.037707
0
0
0
0
0
0.57377
1
0.180328
false
0
0.04918
0
0.245902
0
0
0
0
null
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
6
9ebd62a0d80b93290b83d1c6c49ff9c9229d845f
96
py
Python
venv/lib/python3.8/site-packages/poetry/console/commands/run.py
GiulianaPola/select_repeats
17a0d053d4f874e42cf654dd142168c2ec8fbd11
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/poetry/console/commands/run.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/poetry/console/commands/run.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/3b/8b/f7/fd3e3e3688b2c321189a73d6fe5e8fa411f42359f7af951e498fae6627
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.416667
0
96
1
96
96
0.479167
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
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
1
0
0
0
1
0
0
0
0
0
0
0
0
6
9ebe0036136d40c699b762481005b0a9d8590a57
3,007
py
Python
maker_s7.py
torch50city/scada-test
2525475b054a82dd66cc8d91b82de5e7b27f653d
[ "BSD-3-Clause" ]
1
2020-11-23T06:50:07.000Z
2020-11-23T06:50:07.000Z
maker_s7.py
torch50city/scada-test
2525475b054a82dd66cc8d91b82de5e7b27f653d
[ "BSD-3-Clause" ]
null
null
null
maker_s7.py
torch50city/scada-test
2525475b054a82dd66cc8d91b82de5e7b27f653d
[ "BSD-3-Clause" ]
null
null
null
from maker import * from protocol.s7_protocol import * from setting import * def make_basic_s7(): tpkt = TPKT() cotp = COTP() s7 = S7() return tpkt, cotp, s7 def make_s7_read_packets(dmac, smac, dip, sip, dport, sport, address, data): s_ethernet, s_ipv4, s_tcp, s_udp = make_basic_protocol(dmac, smac, dip, sip, dport, sport, 0) s_tpkt, s_cotp, s_s7 = make_basic_s7() s_cotp.to_function() s_s7.to_ack_read(b'\x00\x00', b'\x02', address) s_tpkt.set_length(s_cotp.bit_lens, s_s7.bit_lens) s_ipv4.set_total_length(s_tcp.bit_lens, s_tpkt.bit_lens, s_cotp.bit_lens, s_s7.bit_lens) s_tcp.set_connection_status(0, s_tpkt.bit_lens, s_cotp.bit_lens, s_s7.bit_lens) d_ethernet, d_ipv4, d_tcp, d_udp = make_basic_protocol(smac, dmac, sip, dip, sport, dport, 1) d_tpkt, d_cotp, d_s7 = make_basic_s7() d_cotp.to_function() d_s7.to_res_read(b'\x04', data, b'\x00\x20', 4) d_tpkt.set_length(d_cotp.bit_lens, d_s7.bit_lens) d_ipv4.set_total_length(d_tcp.bit_lens, d_tpkt.bit_lens, d_cotp.bit_lens, d_s7.bit_lens) d_tcp.set_connection_status(1, d_tpkt.bit_lens, d_cotp.bit_lens, d_s7.bit_lens) s_pkt = pile_up(s_ethernet, s_ipv4, s_tcp, s_tpkt, s_cotp, s_s7) d_pkt = pile_up(d_ethernet, d_ipv4, d_tcp, d_tpkt, d_cotp, d_s7) return s_pkt, d_pkt def make_s7_write_packets(dmac, smac, dip, sip, dport, sport, address, data): s_ethernet, s_ipv4, s_tcp, s_udp = make_basic_protocol(dmac, smac, dip, sip, dport, sport, 0) s_tpkt, s_cotp, s_s7 = make_basic_s7() s_cotp.to_function() s_s7.to_ack_write(b'\x04', data, 4, address) s_tpkt.set_length(s_cotp.bit_lens, s_s7.bit_lens) s_ipv4.set_total_length(s_tcp.bit_lens, s_tpkt.bit_lens, s_cotp.bit_lens, s_s7.bit_lens) s_tcp.set_connection_status(0, s_tpkt.bit_lens, s_cotp.bit_lens, s_s7.bit_lens) d_ethernet, d_ipv4, d_tcp, d_udp = make_basic_protocol(smac, dmac, sip, dip, sport, dport, 1) d_tpkt, d_cotp, d_s7 = make_basic_s7() d_cotp.to_function() d_s7.to_res_write(1) d_tpkt.set_length(d_cotp.bit_lens, d_s7.bit_lens) d_ipv4.set_total_length(d_tcp.bit_lens, d_tpkt.bit_lens, d_cotp.bit_lens, d_s7.bit_lens) d_tcp.set_connection_status(1, d_tpkt.bit_lens, d_cotp.bit_lens, d_s7.bit_lens) s_pkt = pile_up(s_ethernet, s_ipv4, s_tcp, s_tpkt, s_cotp, s_s7) d_pkt = pile_up(d_ethernet, d_ipv4, d_tcp, d_tpkt, d_cotp, d_s7) return s_pkt, d_pkt if __name__ == '__main__': # spr, dpr = make_s7_read_packets(SMAC, DMAC, SIP, DIP, 102, 4185, b'\x05', b'\x00\x01\x00\x02') spw, dpw = make_s7_write_packets(SMAC, DMAC, SIP, DIP, 102, 4185, b'\x05', b'\x00\x01\x00\x04') pkts = [] for i in range(1, 50): if i == 35: data = int_to_bytes(100, 4) else: data = int_to_bytes(i, 4) spr, dpr = make_s7_read_packets(SMAC, DMAC, SIP, DIP, 102, 4185, b'\x05', data) pkts.append(spr) pkts.append(dpr) pcap_wrapper([spw, dpw] + pkts, 'out/s7_test.pcap')
42.352113
100
0.69837
586
3,007
3.180887
0.133106
0.135193
0.077253
0.038627
0.812232
0.812232
0.812232
0.812232
0.812232
0.812232
0
0.051911
0.173595
3,007
70
101
42.957143
0.698189
0.03126
0
0.535714
0
0
0.026108
0
0
0
0
0
0
1
0.053571
false
0
0.053571
0
0.160714
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
7b54429d1b268b41acc646dd8ae23a8c0f20f3d4
26
py
Python
features/src/autogluon/features/__init__.py
adrienatallah/autogluon
014faf7e98bd0e349d0900f713442536b0f69b1e
[ "Apache-2.0" ]
8
2020-01-05T14:46:10.000Z
2021-04-10T15:56:35.000Z
features/src/autogluon/features/__init__.py
adrienatallah/autogluon
014faf7e98bd0e349d0900f713442536b0f69b1e
[ "Apache-2.0" ]
4
2022-01-10T14:35:34.000Z
2022-02-14T05:31:22.000Z
features/src/autogluon/features/__init__.py
adrienatallah/autogluon
014faf7e98bd0e349d0900f713442536b0f69b1e
[ "Apache-2.0" ]
3
2018-08-09T13:30:29.000Z
2020-01-26T16:19:23.000Z
from .generators 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
1
0
0
6
7b6aa70656f0e7d4cba860c937bfc6ca137f581d
46
py
Python
pyexclient/__init__.py
hashtagcyber/pyexclient
6921fc3f294daa0704e7035ba7b324cfea79d934
[ "BSD-2-Clause" ]
5
2020-10-27T13:32:14.000Z
2022-02-08T23:30:11.000Z
pyexclient/__init__.py
hashtagcyber/pyexclient
6921fc3f294daa0704e7035ba7b324cfea79d934
[ "BSD-2-Clause" ]
7
2021-01-15T16:30:58.000Z
2022-01-24T20:35:31.000Z
pyexclient/__init__.py
hashtagcyber/pyexclient
6921fc3f294daa0704e7035ba7b324cfea79d934
[ "BSD-2-Clause" ]
7
2020-10-27T13:23:27.000Z
2021-06-10T14:56:04.000Z
from .workbench import WorkbenchClient # noqa
23
45
0.826087
5
46
7.6
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
46
1
46
46
0.95
0.086957
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
1
0
0
6
7ba4c6df2fed3e427dcfa825dd1acbd94d5a0b65
40
py
Python
env/lib/python3.8/site-packages/plotly/graph_objs/layout/template/data/_histogram.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
11,750
2015-10-12T07:03:39.000Z
2022-03-31T20:43:15.000Z
env/lib/python3.8/site-packages/plotly/graph_objs/layout/template/data/_histogram.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
2,951
2015-10-12T00:41:25.000Z
2022-03-31T22:19:26.000Z
env/lib/python3.8/site-packages/plotly/graph_objs/layout/template/data/_histogram.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
2,623
2015-10-15T14:40:27.000Z
2022-03-28T16:05:50.000Z
from plotly.graph_objs import Histogram
20
39
0.875
6
40
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.1
40
1
40
40
0.944444
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
1
0
0
6
c89af5e602bb57cac4d5b1707e3a735841d99f1b
29
py
Python
pasa/parse/compound_predicate/__init__.py
sonoisa/pasa
90dbcd72890bfe390d2a58f2a4cdb79d42a9f9f8
[ "MIT" ]
5
2018-07-23T05:45:24.000Z
2021-04-04T14:59:15.000Z
pasa/parse/compound_predicate/__init__.py
sonoisa/pasa
90dbcd72890bfe390d2a58f2a4cdb79d42a9f9f8
[ "MIT" ]
2
2019-01-28T04:33:12.000Z
2019-11-20T14:30:27.000Z
pasa/parse/compound_predicate/__init__.py
sonoisa/pasa
90dbcd72890bfe390d2a58f2a4cdb79d42a9f9f8
[ "MIT" ]
1
2020-02-07T08:09:12.000Z
2020-02-07T08:09:12.000Z
from .synonym import Synonym
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
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
1
0
0
6
c8aa3c13e52234a8da44704afdbb0f3857a88a14
54,071
py
Python
auth/esi_parser/app.py
WizBoom/Apate
b7bc2fe94cca18717e3f87bd33a3485c3e3f1998
[ "MIT" ]
null
null
null
auth/esi_parser/app.py
WizBoom/Apate
b7bc2fe94cca18717e3f87bd33a3485c3e3f1998
[ "MIT" ]
83
2018-02-24T16:02:46.000Z
2018-05-09T22:29:35.000Z
auth/esi_parser/app.py
WizBoom/Apate
b7bc2fe94cca18717e3f87bd33a3485c3e3f1998
[ "MIT" ]
null
null
null
from flask import Blueprint, render_template, redirect, url_for, flash, current_app, request, Markup from flask_login import current_user, login_required from auth.shared import EveAPI, SharedInfo from preston import Preston from auth.decorators import needs_permission # Create and configure app Application = Blueprint('esi_parser', __name__, template_folder='templates/esi', static_folder='static') @Application.route('/', methods=['GET', 'POST']) @login_required @needs_permission('parse_esi', 'ESI Index') def index(): """Landing page of the ESI parser. Args: None Returns: str: redirect to the appropriate url. """ if request.method == 'POST': scopes = request.form['scopeTextArea'] if scopes is '' or scopes.isspace(): scopes = "None" return redirect(url_for('esi_parser.audit_assets', character_id=request.form['characterIDText'], client_id=request.form['clientIDText'], client_secret=request.form['clientSecretText'], refresh_token=request.form['refreshTokenText'], scopes=scopes)) return render_template('esi_parser/index.html') @Application.route('/audit/assets/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_assets(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's assets. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_assets.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/bookmarks/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_bookmarks(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's bookmarks. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_bookmarks.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/character/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_character(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's character. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_character.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/clones/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_clones(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's clones. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_clones.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/contacts/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_contacts(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's contacts. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) characterContacts = get_contacts(character_id, preston, access_token) if characterContacts is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_contacts.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard, character_contacts=characterContacts) @Application.route('/audit/contracts/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_contracts(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's contracts. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_contracts.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/corporation/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_corporation(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's corporation. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_corporation.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/fw/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_fw(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's FW stats. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_fw.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/fittings/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_fittings(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's fittings. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_fittings.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/industry/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_industry(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's industry. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_industry.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/location/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_location(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's location. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_location.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/lp/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_lp(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's LP. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_lp.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/mail/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_mail(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's mail. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) characterMails = get_mails(character_id, preston, access_token) if characterMails is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_mail.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard, character_mails=characterMails) @Application.route('/audit/market/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_market(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's market. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_market.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/opportunities/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_opportunities(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's opportunities. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_opportunities.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/pi/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_pi(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's PI. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_pi.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/skills/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_skills(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's skills. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_skills.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/wallet/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_wallet(character_id, client_id, client_secret, refresh_token, scopes): """Audit a character's wallet. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_wallet.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard) @Application.route('/audit/onepage/<int:character_id>/<client_id>/<client_secret>/<refresh_token>/<scopes>') @login_required @needs_permission('parse_esi', 'ESI Audit') def audit_onepage(character_id, client_id, client_secret, refresh_token, scopes): """Views a member with ID. Args: character_id (int): ID of the character. client_id (str): Client ID of the SSO that was used to retrieve the refresh token. client_secret (str): Client secret of the SSO that was used to retrieve the refresh token. refresh_token (str): Refresh token of the character. scopes (str): Scopes that the refresh token provides access to. Returns: str: redirect to the appropriate url. """ # Make preston instance. preston = Preston( user_agent=EveAPI['user_agent'], client_id=client_id, client_secret=client_secret, scope=scopes, refresh_token=refresh_token ) # Get access token. access_token = preston._get_access_from_refresh()[0] if access_token is None: flash('Refresh token ({}) could not get an access token.'.format(refresh_token), 'danger') current_app.logger.error('{} tried to parse ESI for character with ID {} but the refresh token ({}) was not valid.'.format(current_user.name, character_id, refresh_token)) characterCard = get_character_card(character_id, preston, access_token) if characterCard is None: return redirect(url_for('esi_parser.index')) characterContacts = get_contacts(character_id, preston, access_token) if characterContacts is None: return redirect(url_for('esi_parser.index')) characterMails = get_mails(character_id, preston, access_token) if characterMails is None: return redirect(url_for('esi_parser.index')) return render_template('esi_parser/audit_onepage.html', character_id=character_id, client_id=client_id, client_secret=client_secret, refresh_token=refresh_token, scopes=scopes, character=characterCard, character_contacts=characterContacts, character_mails=characterMails) def get_character_card(character_id, preston, access_token): """Get all the info for the character card. Args: character_id (int): ID of the character. preston (preston): Preston object to make scope-required ESI calls. access_token (str): Access token for the scope-required ESI calls. Returns: json: Character card information. """ # Get character. characterPayload = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/?datasource=tranquility".format(str(character_id))) if characterPayload.status_code != 200: flash('There was an error ({}) when trying to retrieve character with ID {}'.format(str(characterPayload.status_code), str(character_id)), 'danger') return None characterJSON = characterPayload.json() characterJSON['portrait'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/portrait/?datasource=tranquility".format(str(character_id))).json() # Get corporation. corporationPayload = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format(str(characterJSON['corporation_id']))) if corporationPayload.status_code != 200: flash('There was an error ({}) when trying to retrieve corporation with ID {}'.format(str(corporationPayload.status_code), str(characterJSON['corporation_id'])), 'danger') return None characterJSON['corporation'] = corporationPayload.json() characterJSON['corporation']['logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/icons/?datasource=tranquility".format( str(characterJSON['corporation_id']))).json() # Get alliance. if 'alliance_id' in characterJSON: alliancePayload = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/?datasource=tranquility".format(str(characterJSON['alliance_id']))) if alliancePayload.status_code != 200: flash('There was an error ({}) when trying to retrieve alliance with ID {}'.format(str(alliancePayload.status_code), str(characterJSON['alliance_id'])), 'danger') return None characterJSON['alliance'] = alliancePayload.json() characterJSON['alliance']['logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/icons/?datasource=tranquility".format( str(characterJSON['alliance_id']))).json() # Get wallet. walletIsk = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-wallet.read_character_wallet.v1'], "https://esi.tech.ccp.is/latest/characters/{}/wallet/?datasource=tranquility&token={}".format( str(character_id), access_token)) walletIskJSON = None if walletIsk is not None: walletIskJSON = walletIsk.json() if walletIskJSON is not None and type(walletIskJSON) is not float: flash('There was an error ({}) when trying to retrieve wallet for character.'.format(str(walletIsk.status_code)), 'danger') return None else: characterJSON['wallet_isk'] = walletIskJSON # Get skillpoints characterSkills = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-skills.read_skills.v1'], "https://esi.tech.ccp.is/latest/characters/{}/skills/?datasource=tranquility&token={}".format( str(character_id), access_token)) characterSkillsJSON = None if characterSkills is not None: characterSkillsJSON = characterSkills.json() if characterSkillsJSON is not None and 'error' in characterSkillsJSON: flash('There was an error ({}) when trying to retrieve skills.'.format(str(characterSkills.status_code)), 'danger') return None else: characterJSON['skills'] = characterSkillsJSON return characterJSON def get_contacts(character_id, preston, access_token): """Get all the contacts information. Args: character_id (int): ID of the character. preston (preston): Preston object to make scope-required ESI calls. access_token (str): Access token for the scope-required ESI calls. Returns: json: Contacts information. """ # Get raw contact data. characterContacts = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-characters.read_contacts.v1'], "https://esi.tech.ccp.is/latest/characters/{}/contacts/?datasource=tranquility&token={}".format( str(character_id), access_token)) if characterContacts is None: return {'has_scope': False} characterContactsJSON = characterContacts.json() if characterContactsJSON is not None and 'error' in characterContactsJSON: flash('There was an error ({}) when trying to retrieve contacts.'.format(str(characterContacts.status_code)), 'danger') return None characterContactLabels = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-characters.read_contacts.v1'], "https://esi.tech.ccp.is/latest/characters/{}/contacts/labels/?datasource=tranquility&token={}".format( str(character_id), access_token)) characterContactLabelsJSON = characterContactLabels.json() if characterContactLabelsJSON is not None and 'error' in characterContactLabelsJSON: flash('There was an error ({}) when trying to retrieve contact labels.'.format(str(characterContactLabels.status_code)), 'danger') return None # Link characters, corporations, images and labels to contacts. for contact in characterContactsJSON: # Name. if contact['contact_type'] == 'character': # Get character. character = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/?datasource=tranquility".format(str(contact['contact_id']))).json() contact['character'] = character # Get character corp. contact['character']['corporation_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format( str(character['corporation_id']))).json()['name'] # Get character corp logo. contact['character']['corporation_logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/icons/?datasource=tranquility".format( str(character['corporation_id']))).json()['px128x128'] # Get character alliance if applicable. if 'alliance_id' in character: contact['character']['alliance_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/?datasource=tranquility".format( str(character['alliance_id']))).json()['name'] # Get character alliance logo. contact['character']['alliance_logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/icons/?datasource=tranquility".format( str(character['alliance_id']))).json()['px128x128'] # Get corporation history. corpHistory = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/corporationhistory/?datasource=tranquility".format(str(contact['contact_id']))).json() for index, corp in enumerate(corpHistory): # Name. corp['name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format( str(corp['corporation_id']))).json()['name'] # Logo. corp['logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/icons/?datasource=tranquility".format( str(corp['corporation_id']))).json()['px128x128'] # Leave date. if index > 0: corp['end_date'] = corpHistory[index - 1]['start_date'] contact['character']['corporation_history'] = corpHistory # Get contact name / image. contact['contact_name'] = character['name'] contact['contact_image'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/portrait/?datasource=tranquility".format( str(contact['contact_id']))).json()['px128x128'] elif contact['contact_type'] == 'corporation': # Get corporation. corporation = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format(str(contact['contact_id']))).json() contact['corporation'] = corporation # Get corporation alliance. if 'alliance_id' in corporation: contact['corporation']['alliance_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/?datasource=tranquility".format( str(corporation['alliance_id']))).json()['name'] # Get corporation alliance logo. contact['corporation']['alliance_logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/icons/?datasource=tranquility".format( str(corporation['alliance_id']))).json()['px128x128'] # Get alliance history. allianceHistory = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/alliancehistory/?datasource=tranquility".format(str(contact['contact_id']))).json() for index, alliance in enumerate(allianceHistory): allianceJSON = None if 'alliance_id' in alliance: allianceJSON = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/?datasource=tranquility".format( str(alliance['alliance_id']))).json() allianceJSON['alliance_id'] = alliance['alliance_id'] # Name. if allianceJSON: alliance['name'] = allianceJSON['name'] else: alliance['name'] = "No alliance" # Logo. if allianceJSON: alliance['logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/icons/?datasource=tranquility".format( str(alliance['alliance_id']))).json()['px128x128'] # Leave date. if index > 0: alliance['end_date'] = allianceHistory[index - 1]['start_date'] contact['corporation']['alliance_history'] = allianceHistory # Get contact name / image. contact['contact_name'] = corporation['name'] contact['contact_image'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/icons/?datasource=tranquility".format( str(contact['contact_id']))).json()['px128x128'] elif contact['contact_type'] == 'alliance': # Get alliance. alliance = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/?datasource=tranquility".format(str(contact['contact_id']))).json() contact['alliance'] = alliance # Exec corp. if 'executor_corporation_id' in alliance: # Name. contact['alliance']['executor_corporation_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format( str(alliance['executor_corporation_id']))).json()['name'] # Logo. contact['alliance']['executor_corporation_logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/icons/?datasource=tranquility".format( str(alliance['executor_corporation_id']))).json()['px128x128'] # Alliance members. allianceMembers = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/corporations/?datasource=tranquility".format( str(contact['contact_id']))).json() allianceMemberList = [] for member in allianceMembers: # Corporation info. memberJSON = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format( str(member))).json() # ID. memberJSON['corporation_id'] = member # Logo. memberJSON['corporation_logo'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/icons/?datasource=tranquility".format( str(member))).json()['px128x128'] # Get corp. allianceMemberList.append(memberJSON) contact['alliance']['members'] = allianceMemberList contact['contact_name'] = alliance['name'] contact['contact_image'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/icons/?datasource=tranquility".format( str(contact['contact_id']))).json()['px128x128'] elif contact['contact_type'] == 'faction': contact['contact_name'] = "FACTION NAMES NOT IMPLEMENTED" contact['contact_image'] = "#" # Labels. if 'label_id' in contact: for label in characterContactLabelsJSON: if label['label_id'] == contact['label_id']: contact['label_name'] = label['label_name'] # Sort contacts by name. characterContactsJSON = sorted(characterContactsJSON, key=lambda k: k['contact_name']) # Sort contacts by standings. characterContactsJSON = sorted(characterContactsJSON, key=lambda k: k['standing'], reverse=True) return characterContactsJSON def get_mails(character_id, preston, access_token): """Get all the mail information. Args: character_id (int): ID of the character. preston (preston): Preston object to make scope-required ESI calls. access_token (str): Access token for the scope-required ESI calls. Returns: json: Mail information. """ # Get mail endpoint. characterMails = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-mail.read_mail.v1'], "https://esi.tech.ccp.is/latest/characters/{}/mail/?datasource=tranquility&token={}".format( str(character_id), access_token)) if characterMails is None: return {'has_scope': False} characterMailsJSON = characterMails.json() if characterMailsJSON is not None and 'error' in characterMailsJSON: flash('There was an error ({}) when trying to retrieve mails.'.format(str(characterMails.status_code)), 'danger') return None # Get mailing lists. characterMailingLists = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-mail.read_mail.v1'], "https://esi.tech.ccp.is/latest/characters/{}/mail/lists/?datasource=tranquility&token={}".format( str(character_id), access_token)) characterMailingListsJSON = characterMailingLists.json() if characterMailingListsJSON is not None and 'error' in characterMailingListsJSON: flash('There was an error ({}) when trying to retrieve mail labels.'.format(str(characterMailingLists.status_code)), 'danger') return None for mail in characterMailsJSON: mail['mail'] = SharedInfo['util'].make_esi_request_with_scope(preston, ['esi-mail.read_mail.v1'], "https://esi.tech.ccp.is/latest/characters/{}/mail/{}/?datasource=tranquility&token={}".format( str(character_id), str(mail['mail_id']), access_token)).json() # Convert body to be easily showed in html, but first save raw body. mail['mail']['raw_body'] = mail['mail']['body'] mailBody = mail['mail']['body'].replace('<br>', '\n') mailBody = SharedInfo['util'].remove_html_tags(mailBody) mail['mail']['body'] = Markup(mailBody.replace('\n', '<br>')) # Get sender name. mail['mail']['from_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/?datasource=tranquility".format( str(mail['mail']['from']))).json()['name'] # Get recipients. for recipient in mail['mail']['recipients']: recipient['recipient_name'] = recipient['recipient_id'] # Determine type. if recipient['recipient_type'] == 'character': # Get character name. recipient['recipient_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/characters/{}/?datasource=tranquility".format( str(recipient['recipient_id']))).json()['name'] elif recipient['recipient_type'] == 'corporation': # Get corporation name. recipient['recipient_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/corporations/{}/?datasource=tranquility".format( str(recipient['recipient_id']))).json()['name'] elif recipient['recipient_type'] == 'alliance': # Get alliance name. recipient['recipient_name'] = SharedInfo['util'].make_esi_request("https://esi.tech.ccp.is/latest/alliances/{}/?datasource=tranquility".format( str(recipient['recipient_id']))).json()['name'] elif recipient['recipient_type'] == 'mailing_list': # Get mailing list name. for mailingList in characterMailingListsJSON: if mailingList['mailing_list_id'] == recipient['recipient_id']: recipient['recipient_name'] = "{} [ML]".format(mailingList['name']) return characterMailsJSON
46.612931
197
0.673485
6,528
54,071
5.381893
0.037071
0.097686
0.045427
0.043264
0.847949
0.836763
0.832124
0.816213
0.80238
0.77904
0
0.002337
0.216549
54,071
1,159
198
46.653149
0.827015
0.203103
0
0.590615
0
0.011327
0.276595
0.060058
0
0
0
0
0
1
0.037217
false
0
0.008091
0
0.139159
0.003236
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
cda205a644e84b1b1d38148b9e0ad292e237636f
5,140
py
Python
pyccl/haloprofile.py
Jappenn/CCL
a37cad61f060f3928fa5d47b1e2670db3e9bce6f
[ "BSD-3-Clause" ]
91
2017-07-14T02:45:59.000Z
2022-03-28T08:55:54.000Z
pyccl/haloprofile.py
Jappenn/CCL
a37cad61f060f3928fa5d47b1e2670db3e9bce6f
[ "BSD-3-Clause" ]
703
2017-07-07T16:27:17.000Z
2022-03-30T14:40:10.000Z
pyccl/haloprofile.py
Jappenn/CCL
a37cad61f060f3928fa5d47b1e2670db3e9bce6f
[ "BSD-3-Clause" ]
54
2017-07-12T13:08:25.000Z
2022-02-06T13:12:10.000Z
from . import halos as hal from .pyutils import deprecated @deprecated(hal.HaloProfileNFW) def nfw_profile_3d(cosmo, concentration, halo_mass, odelta, a, r): """Calculate the 3D NFW halo profile at a given radius or an array of radii, for a halo with a given mass, mass definition, and concentration, at a given scale factor, with a cosmology dependence. .. note:: Note that this function is deprecated. Please use the functionality in the :mod:`~pyccl.halos.profiles` module. Args: cosmo (:class:`~pyccl.core.Cosmology`): cosmological parameters. concentration (float): halo concentration. halo_mass (float): halo masses; in units of Msun. odelta (float): overdensity with respect to mean matter density. a (float): scale factor. r (float or array_like): radius or radii to calculate profile for, in units of Mpc. Returns: float or array_like: 3D NFW density at r, in units of Msun/Mpc^3. """ mdef = hal.MassDef(odelta, 'matter') c = hal.ConcentrationConstant(c=concentration, mdef=mdef) p = hal.HaloProfileNFW(c, truncated=False) return p.real(cosmo, r, halo_mass, a, mdef) @deprecated(hal.HaloProfileEinasto) def einasto_profile_3d(cosmo, concentration, halo_mass, odelta, a, r): """Calculate the 3D Einasto halo profile at a given radius or an array of radii, for a halo with a given mass, mass definition, and concentration, at a given scale factor, with a cosmology dependence. The alpha parameter is calibrated using the relation with peak height in https://arxiv.org/pdf/1401.1216.pdf eqn5, assuming virial mass. .. note:: Note that this function is deprecated. Please use the functionality in the :mod:`~pyccl.halos.profiles` module. Args: cosmo (:class:`~pyccl.core.Cosmology`): cosmological parameters. concentration (float): halo concentration. halo_mass (float): halo masses; in units of Msun. odelta (float): overdensity with respect to mean matter density. a (float): scale factor. r (float or array_like): radius or radii to calculate profile for, in units of Mpc. Returns: float or array_like: 3D NFW density at r, in units of Msun/Mpc^3. """ mdef = hal.MassDef(odelta, 'matter') c = hal.ConcentrationConstant(c=concentration, mdef=mdef) mdef = hal.MassDef(odelta, 'matter', c_m_relation=c) p = hal.HaloProfileEinasto(c, truncated=False) return p.real(cosmo, r, halo_mass, a, mdef) @deprecated(hal.HaloProfileHernquist) def hernquist_profile_3d(cosmo, concentration, halo_mass, odelta, a, r): """Calculate the 3D Hernquist halo profile at a given radius or an array of radii, for a halo with a given mass, mass definition, and concentration, at a given scale factor, with a cosmology dependence. .. note:: Note that this function is deprecated. Please use the functionality in the :mod:`~pyccl.halos.profiles` module. Args: cosmo (:class:`~pyccl.core.Cosmology`): cosmological parameters. concentration (float): halo concentration. halo_mass (float): halo masses; in units of Msun. odelta (float): overdensity with respect to mean matter density. a (float): scale factor. r (float or array_like): radius or radii to calculate profile for, in units of Mpc. Returns: float or array_like: 3D NFW density at r, in units of Msun/Mpc^3. """ mdef = hal.MassDef(odelta, 'matter') c = hal.ConcentrationConstant(c=concentration, mdef=mdef) p = hal.HaloProfileHernquist(c, truncated=False) return p.real(cosmo, r, halo_mass, a, mdef) @deprecated(hal.HaloProfileNFW) def nfw_profile_2d(cosmo, concentration, halo_mass, odelta, a, r): """Calculate the 2D projected NFW halo profile at a given radius or an array of radii, for a halo with a given mass, mass definition, and concentration, at a given scale factor, with a cosmology dependence. .. note:: Note that this function is deprecated. Please use the functionality in the :mod:`~pyccl.halos.profiles` module. Args: cosmo (:class:`~pyccl.core.Cosmology`): cosmological parameters. concentration (float): halo concentration. halo_mass (float): halo masses; in units of Msun. odelta (float): overdensity with respect to mean matter density. a (float): scale factor. r (float or array_like): radius or radii to calculate profile for, in units of Mpc. Returns: float or array_like: 2D projected NFW density at r, \ in units of Msun/Mpc^2. """ mdef = hal.MassDef(odelta, 'matter') c = hal.ConcentrationConstant(c=concentration, mdef=mdef) p = hal.HaloProfileNFW(c, truncated=False, projected_analytic=True) return p.projected(cosmo, r, halo_mass, a, mdef)
41.451613
80
0.659339
686
5,140
4.895044
0.151604
0.028588
0.032162
0.030971
0.896665
0.896665
0.865098
0.865098
0.865098
0.842764
0
0.006529
0.255058
5,140
123
81
41.788618
0.870462
0.63716
0
0.515152
0
0
0.019011
0
0
0
0
0
0
1
0.121212
false
0
0.060606
0
0.30303
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
cdac57b14cbd84406f1186d85d884bac608bfd2f
16,262
py
Python
optimization/pose_optimize/optimize_loss.py
HeCraneChen/3D-Crowd-Pose-Estimation-Based-on-MVG
0b1fc8aca27520976516012f6594a513cb1fb2f3
[ "MIT" ]
35
2020-07-14T22:42:33.000Z
2022-01-07T06:32:26.000Z
optimization/pose_optimize/optimize_loss.py
HeCraneChen/3D-Crowd-Pose-Estimation-Based-on-MVG
0b1fc8aca27520976516012f6594a513cb1fb2f3
[ "MIT" ]
5
2020-09-14T03:19:27.000Z
2021-05-28T19:45:29.000Z
optimization/pose_optimize/optimize_loss.py
HeCraneChen/3D-Crowd-Pose-Estimation-Based-on-MVG
0b1fc8aca27520976516012f6594a513cb1fb2f3
[ "MIT" ]
6
2020-09-15T02:28:36.000Z
2021-07-16T06:03:36.000Z
import numpy as np import json from os.path import join from tqdm import tqdm from scipy.optimize import least_squares from pose_optimize.multiview_geo import reproject_error DEBUG=False def reproject_error_loss(p3d, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23): ''' Return: kp4_e, kp6_e: error array, both (23,) shape ''' assert p3d.shape == (num_kpt, 3) assert p4.shape == (num_kpt, 2) assert p6.shape == (num_kpt, 2) kp4_recon = np.dot(cam_proj_4[0:3,0:3],p3d.T) + cam_proj_4[0:3,3].reshape([-1,1]) kp6_recon = np.dot(cam_proj_6[0:3,0:3],p3d.T) + cam_proj_6[0:3,3].reshape([-1,1]) kp4_recon = kp4_recon[0:2,:]/kp4_recon[2,:] kp6_recon = kp6_recon[0:2,:]/kp6_recon[2,:] # kp4_e = np.linalg.norm(kp4_recon.T - p4, axis=1) # kp6_e = np.linalg.norm(kp6_recon.T - p6, axis=1) kp4_e = np.sqrt(np.sum(np.square(kp4_recon.T - p4), axis=1)) kp6_e = np.sqrt(np.sum(np.square(kp6_recon.T - p6), axis=1)) return kp4_e, kp6_e def reproject_error_loss_score(p3d, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23): ''' Return: kp4_e, kp6_e: error array, both (23,) shape ''' assert p3d.shape == (num_kpt, 3) assert p4.shape == (num_kpt, 3) assert p6.shape == (num_kpt, 3) kp4_recon = np.dot(cam_proj_4[0:3,0:3],p3d.T) + cam_proj_4[0:3,3].reshape([-1,1]) kp6_recon = np.dot(cam_proj_6[0:3,0:3],p3d.T) + cam_proj_6[0:3,3].reshape([-1,1]) kp4_recon = kp4_recon[0:2,:]/kp4_recon[2,:] kp6_recon = kp6_recon[0:2,:]/kp6_recon[2,:] # kp4_e = np.linalg.norm(kp4_recon.T - p4, axis=1) # kp6_e = np.linalg.norm(kp6_recon.T - p6, axis=1) kp4_e = p4[:,2]*np.sqrt(np.sum(np.square(kp4_recon.T - p4[:,:2]), axis=1)) kp6_e = p6[:,2]*np.sqrt(np.sum(np.square(kp6_recon.T - p6[:,:2]), axis=1)) return kp4_e, kp6_e def optimze_loss_2d(p3d_faltten, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23, lambda_reproj = 1): ''' Only consider reprojection loss ''' l1 = lambda_reproj p3d = p3d_faltten.reshape([-1,3]) kp4_e, kp6_e = reproject_error_loss(p3d, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23) return np.concatenate((l1*kp4_e, l1*kp6_e)) def shape_dis_loss(kpt_3d_array, median_bone, left_list, right_list, num_kpt=23): ''' Shape loss given prior shape information ''' assert kpt_3d_array.shape == (num_kpt, 3) assert len(left_list) == len(right_list) assert len(left_list) == len(median_bone.keys()) num_bone = len(left_list) left_error = [] right_error = [] left_error = np.zeros(num_bone) right_error = np.zeros(num_bone) for i in range(num_bone): bon_vec_left = kpt_3d_array[left_list[i][1],:] - kpt_3d_array[left_list[i][0],:] left_error_i = np.sqrt(np.dot(bon_vec_left, bon_vec_left)) - median_bone[str(i)] left_error[i] = abs(left_error_i) bon_vec_right = kpt_3d_array[right_list[i][1],:] - kpt_3d_array[right_list[i][0],:] right_error_i = np.sqrt(np.dot(bon_vec_right, bon_vec_right)) - median_bone[str(i)] right_error[i] = abs(right_error_i) return left_error, right_error def optimze_loss(p3d_faltten, p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone, num_kpt=23, lambda_reproj = 0.1, lambda_shape=5.0): ''' Full Loss with shape prior ''' l1 = lambda_reproj l2 = lambda_shape p3d = p3d_faltten.reshape([-1,3]) kp4_e, kp6_e = reproject_error_loss_score(p3d, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23) left_error, right_error = shape_dis_loss(p3d, median_bone, left_list, right_list, num_kpt=23) return np.concatenate((l1*kp4_e, l1*kp6_e, l2*left_error, l2*right_error)) def optimze_loss_no_score(p3d_faltten, p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone, num_kpt=23, lambda_reproj = 0.1, lambda_shape=1.0): ''' Full Loss with shape prior ''' l1 = lambda_reproj l2 = lambda_shape p3d = p3d_faltten.reshape([-1,3]) kp4_e, kp6_e = reproject_error_loss(p3d, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23) left_error, right_error = shape_dis_loss(p3d, median_bone, left_list, right_list, num_kpt=23) return np.concatenate((l1*kp4_e, l1*kp6_e, l2*left_error, l2*right_error)) def centerize_keypoint(p1, p2, norm_dst): ''' Centeralize two points ''' assert p1.shape == (3,) assert p2.shape == (3,) p_center = (p1+p2)/2 p_vec = (p1-p2) p_dis = np.sqrt(np.dot(p_vec, p_vec)) p1_shift = p_center + 0.5*p_vec/p_dis p2_shift = p_center - 0.5*p_vec/p_dis return p1_shift, p2_shift def shape_initialize(left_list, right_list, median_bone, kpt_3d_array, num_kpt=23): ''' Initialize human joints 3D position from shape prior ''' assert kpt_3d_array.shape == (num_kpt,3) assert len(left_list) == len(right_list) assert len(left_list) == len(median_bone.keys()) num_bone = len(left_list) left_ratio_list, right_ratio_list = [],[] vec_left_list, vec_right_list = [], [] ratio_outlier = 1.5 ratio_draw_back = 1.1 for i in range(num_bone): bon_vec_left = kpt_3d_array[left_list[i][1],:] - kpt_3d_array[left_list[i][0],:] ratio_left = np.sqrt(np.dot(bon_vec_left, bon_vec_left))/ median_bone[str(i)] left_ratio_list += [ratio_left] vec_left_list += [bon_vec_left] for i in range(num_bone): bon_vec_right = kpt_3d_array[right_list[i][1],:] - kpt_3d_array[right_list[i][0],:] ratio_right = np.sqrt(np.dot(bon_vec_right, bon_vec_right))/median_bone[str(i)] right_ratio_list += [ratio_right] vec_right_list += [bon_vec_right] kp_3d_new = np.zeros(kpt_3d_array.shape) # Adjust Shoulder to hip kp_3d_new[left_list[2][0], :], kp_3d_new[left_list[2][1], :] = centerize_keypoint(kpt_3d_array[left_list[2][0], :], kpt_3d_array[left_list[2][1], :] , median_bone["2"]) kp_3d_new[right_list[2][0], :], kp_3d_new[right_list[2][1], :] = centerize_keypoint(kpt_3d_array[right_list[2][0], :], kpt_3d_array[right_list[2][1], :] , median_bone["2"]) # Adjust shoulder and Hip pair sh_p = left_list[0] hi_p = left_list[1] kp_3d_new[sh_p[0]], kp_3d_new[sh_p[1]] = centerize_keypoint(kp_3d_new[sh_p[0]], kp_3d_new[sh_p[1]], median_bone["0"]) # shoulder kp_3d_new[hi_p[0]], kp_3d_new[hi_p[1]] = centerize_keypoint(kp_3d_new[hi_p[0]], kp_3d_new[hi_p[1]], median_bone["1"]) # hip # left part for i in range(2, num_bone): start_indx, end_indx = tuple(left_list[i]) if left_ratio_list[i] < ratio_outlier: kp_3d_new[end_indx, :] = kp_3d_new[start_indx, :] + vec_left_list[i] else: kp_3d_new[end_indx, :] = kp_3d_new[start_indx, :] + vec_left_list[i]/left_ratio_list[i]*ratio_draw_back for i in range(2, num_bone): start_indx, end_indx = tuple(right_list[i]) if right_ratio_list[i] < ratio_outlier: kp_3d_new[end_indx, :] = kp_3d_new[start_indx, :] + vec_right_list[i] else: kp_3d_new[end_indx, :] = kp_3d_new[start_indx, :] + vec_right_list[i]/right_ratio_list[i]*ratio_draw_back # left_error, right_error = loss_kpt_3d(kp_3d_new, median_bone, left_list, right_list) # print(left_error) # print(right_error) # print("OK") return kp_3d_new def fintune_human_keypoint_2d(P4, P6, path4, path6, path3D, path_finetune=None): with open(path3D,"r") as f: data_3d = json.load(f) with open(path4, "r") as f: data_dict4 = json.load(f) with open(path6, "r") as f: data_dict6 = json.load(f) # frame_id = next(iter(data_3d["3D"].keys())) # person_id = next(iter(data_3d["3D"][frame_id].keys())) # # frame_id = "000005" # # person_id = "000" cam_proj_4 = np.array(data_3d["P4"]) cam_proj_6 = np.array(data_3d["P6"]) data_3d_dict = {} data_3d_dict["P4"] = data_3d["P4"] data_3d_dict["P6"] = data_3d["P6"] data_3d_dict["3D"] = {} data_3d_dict["kp4_e"] = {} data_3d_dict["kp6_e"] = {} frame_list = [k for k in data_dict4.keys()] frame_list.sort() for i, frame_id in enumerate(tqdm(frame_list)): frame_3d_dict = {} kp4_dict = {} kp6_dict = {} person_list = [k for k in data_dict4[frame_id].keys()] person_list.sort() for person_id in person_list: p3d_flatten = np.array(data_3d["3D"][frame_id][person_id]).ravel() p4_homo = np.array(data_dict4[frame_id][person_id]).reshape([-1,3]) p6_homo = np.array(data_dict6[frame_id][person_id]).reshape([-1,3]) p4 = p4_homo[:,:2] p6 = p6_homo[:,:2] if DEBUG: loss_init = optimze_loss_2d(p3d_flatten, p4, p6, cam_proj_4, cam_proj_6) print("Initial error", str(np.sqrt(np.sum(np.square(loss_init)))) ) res = least_squares(optimze_loss_2d, p3d_flatten, verbose=0, x_scale='jac', ftol=1e-4, method='trf',args=(p4, p6, cam_proj_4, cam_proj_6)) if DEBUG: loss_final = res.fun print("Final error", str(np.sqrt(np.sum(np.square(loss_final)))) ) loss_final = optimze_loss_2d(res.x, p4, p6, cam_proj_4, cam_proj_6) print("Final error", str(np.sqrt(np.sum(np.square(loss_final)))) ) p3d_tune = res.x.reshape([-1,3]) kp4_recon, kp6_recon, kp4_e, kp6_e = reproject_error(p3d_tune, p4, p6, cam_proj_4, cam_proj_6) frame_3d_dict[person_id] = p3d_tune.tolist() kp4_dict[person_id] = kp4_e.tolist() kp6_dict[person_id] = kp6_e.tolist() data_3d_dict["3D"][frame_id] = frame_3d_dict data_3d_dict["kp4_e"][frame_id] = kp4_dict data_3d_dict["kp6_e"][frame_id] = kp6_dict if path_finetune is not None: with open(path_finetune, "w") as f: json.dump(data_3d_dict, f) return data_3d_dict def finetune_human_3d(path_finetune_input, path4, path6, shape_prior_path, shape_prior_finetune_output, frame_list=None): ''' path_finetune_input: path4: data_C4.json path6: data_C6.json shape_prior_path: shape_prior_finetune_output: ''' with open(path_finetune_input,"r") as f: data_3d = json.load(f) with open(path4, "r") as f: data_dict4 = json.load(f) with open(path6, "r") as f: data_dict6 = json.load(f) with open(shape_prior_path, 'r') as f: data_prior = json.load(f) left_list = data_prior["left_list"] right_list = data_prior["right_list"] median_bone = data_prior["median_bone"] cam_proj_4 = np.array(data_3d["P4"]) cam_proj_6 = np.array(data_3d["P6"]) data_3d_dict = {} data_3d_dict["P4"] = data_3d["P4"] data_3d_dict["P6"] = data_3d["P6"] data_3d_dict["3D"] = {} data_3d_dict["kp4_e"] = {} data_3d_dict["kp6_e"] = {} if frame_list: for f in frame_list: if f not in data_dict4.keys(): print("KEY ERROR!") assert 0 else: frame_list = [k for k in data_dict4.keys()] frame_list.sort() for i, frame_id in enumerate(tqdm(frame_list)): frame_3d_dict = {} kp4_dict = {} kp6_dict = {} person_list = [k for k in data_dict4[frame_id].keys()] person_list.sort() for person_id in person_list: p3d = np.array(data_3d["3D"][frame_id][person_id]).reshape([-1,3]) p3d_init = shape_initialize(left_list, right_list, median_bone, p3d) p4_homo = np.array(data_dict4[frame_id][person_id]).reshape([-1,3]) p6_homo = np.array(data_dict6[frame_id][person_id]).reshape([-1,3]) p4 = p4_homo p6 = p6_homo p3d_flatten = p3d_init.flatten() # loss_init = optimze_loss(p3d_flatten, p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone) #print(np.linalg.norm(loss_init)) res = least_squares(optimze_loss, p3d_flatten, verbose=0, x_scale='jac', ftol=1e-2, method='trf',args=(p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone)) p3d_tune = res.x.reshape([-1,3]) # loss_res = optimze_loss(res.x, p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone) # print(np.linalg.norm(loss_res)) kp4_recon, kp6_recon, kp4_e, kp6_e = reproject_error(p3d_tune, p4[:,:2], p6[:,:2], cam_proj_4, cam_proj_6) frame_3d_dict[person_id] = p3d_tune.tolist() kp4_dict[person_id] = kp4_e.tolist() kp6_dict[person_id] = kp6_e.tolist() data_3d_dict["3D"][frame_id] = frame_3d_dict data_3d_dict["kp4_e"][frame_id] = kp4_dict data_3d_dict["kp6_e"][frame_id] = kp6_dict with open(shape_prior_finetune_output, "w") as f: json.dump(data_3d_dict, f) def finetune_human_3d_no_score(path_finetune_input, path4, path6, shape_prior_path, shape_prior_finetune_output, frame_list=None): ''' path_finetune_input: path4: data_C4.json path6: data_C6.json shape_prior_path: shape_prior_finetune_output: ''' with open(path_finetune_input,"r") as f: data_3d = json.load(f) with open(path4, "r") as f: data_dict4 = json.load(f) with open(path6, "r") as f: data_dict6 = json.load(f) with open(shape_prior_path, 'r') as f: data_prior = json.load(f) left_list = data_prior["left_list"] right_list = data_prior["right_list"] median_bone = data_prior["median_bone"] cam_proj_4 = np.array(data_3d["P4"]) cam_proj_6 = np.array(data_3d["P6"]) data_3d_dict = {} data_3d_dict["P4"] = data_3d["P4"] data_3d_dict["P6"] = data_3d["P6"] data_3d_dict["3D"] = {} data_3d_dict["kp4_e"] = {} data_3d_dict["kp6_e"] = {} if frame_list: for f in frame_list: if f not in data_dict4.keys(): print("KEY ERROR!") assert 0 else: frame_list = [k for k in data_dict4.keys()] frame_list.sort() for i, frame_id in enumerate(tqdm(frame_list)): if i > 300: import sys sys.exit() frame_3d_dict = {} kp4_dict = {} kp6_dict = {} person_list = [k for k in data_dict4[frame_id].keys()] person_list.sort() for person_id in person_list: try: p3d = np.array(data_3d["3D"][frame_id][person_id]).reshape([-1,3]) p3d_init = shape_initialize(left_list, right_list, median_bone, p3d) p4_homo = np.array(data_dict4[frame_id][person_id]).reshape([-1,3]) p6_homo = np.array(data_dict6[frame_id][person_id]).reshape([-1,3]) p4 = p4_homo[:,:2] p6 = p6_homo[:,:2] p3d_flatten = p3d_init.flatten() # loss_init = optimze_loss(p3d_flatten, p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone) #print(np.linalg.norm(loss_init)) res = least_squares(optimze_loss_no_score, p3d_flatten, verbose=2, x_scale='jac', ftol=1e-2, method='trf',args=(p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone)) p3d_tune = res.x.reshape([-1,3]) # loss_res = optimze_loss(res.x, p4, p6, cam_proj_4, cam_proj_6, left_list, right_list, median_bone) # print(np.linalg.norm(loss_res)) kp4_recon, kp6_recon, kp4_e, kp6_e = reproject_error(p3d_tune, p4[:,:2], p6[:,:2], cam_proj_4, cam_proj_6) frame_3d_dict[person_id] = p3d_tune.tolist() kp4_dict[person_id] = kp4_e.tolist() kp6_dict[person_id] = kp6_e.tolist() except: print("Error") data_3d_dict["3D"][frame_id] = frame_3d_dict data_3d_dict["kp4_e"][frame_id] = kp4_dict data_3d_dict["kp6_e"][frame_id] = kp6_dict with open(shape_prior_finetune_output, "w") as f: json.dump(data_3d_dict, f)
38.444444
196
0.62151
2,655
16,262
3.454237
0.070433
0.041217
0.033802
0.023989
0.850289
0.830553
0.803184
0.793807
0.773743
0.748882
0
0.056399
0.238962
16,262
422
197
38.535545
0.684632
0.099434
0
0.665455
0
0
0.018714
0
0
0
0
0
0.058182
1
0.04
false
0
0.025455
0
0.098182
0.021818
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
cdaecce84144821811c646da3aaae06b79b6b521
144
py
Python
sap/flp/__init__.py
gtreskas/sapcli
ff82ddb998834e1c83dff799134f026df93b3175
[ "Apache-2.0" ]
42
2019-01-16T13:16:09.000Z
2022-03-23T20:13:00.000Z
sap/flp/__init__.py
gtreskas/sapcli
ff82ddb998834e1c83dff799134f026df93b3175
[ "Apache-2.0" ]
59
2019-02-23T07:16:56.000Z
2022-02-28T09:34:47.000Z
sap/flp/__init__.py
gtreskas/sapcli
ff82ddb998834e1c83dff799134f026df93b3175
[ "Apache-2.0" ]
22
2019-03-12T08:15:44.000Z
2022-01-10T03:56:47.000Z
"""Fiori Launchpad wrappers and helpers""" from sap.flp.builder import Builder # noqa: F401 from sap.flp.service import Service # noqa: F401
28.8
49
0.75
21
144
5.142857
0.619048
0.12963
0.185185
0
0
0
0
0
0
0
0
0.04918
0.152778
144
4
50
36
0.836066
0.409722
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
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
6
cdbd4176926de279086c7e3890fdf181a5540ff6
18,989
py
Python
xmpt/migrations/0002_auto_20210324_1318.py
anzrz/djangoapp
85b4f73754af53ddf33ec281a04a70415af02eb6
[ "MIT" ]
null
null
null
xmpt/migrations/0002_auto_20210324_1318.py
anzrz/djangoapp
85b4f73754af53ddf33ec281a04a70415af02eb6
[ "MIT" ]
null
null
null
xmpt/migrations/0002_auto_20210324_1318.py
anzrz/djangoapp
85b4f73754af53ddf33ec281a04a70415af02eb6
[ "MIT" ]
null
null
null
# Generated by Django 3.1.7 on 2021-03-24 17:18 import datetime from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('xmpt', '0001_initial'), ] operations = [ migrations.CreateModel( name='BusinessCategory', fields=[ ('business_category_id', models.IntegerField(primary_key=True, serialize=False)), ('business_category_code', models.CharField(max_length=254)), ('business_category_title', models.CharField(max_length=254)), ('version_year', models.CharField(default='2017', max_length=10)), ], options={ 'verbose_name_plural': 'Business Categories', }, ), migrations.CreateModel( name='Community', fields=[ ('community_guid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('community_code', models.CharField(default='empty', max_length=254)), ('community_name', models.CharField(default='empty', max_length=254)), ('email', models.EmailField(blank=True, max_length=254)), ('phone_number', models.CharField(blank=True, max_length=20)), ('phone_type', models.CharField(blank=True, choices=[('M', 'Mobile'), ('O', 'Office')], max_length=1)), ('street_address_1', models.CharField(default='empty', max_length=254)), ('street_address_2', models.CharField(blank=True, max_length=254)), ('apt_suit', models.CharField(blank=True, max_length=50)), ('postal_code', models.CharField(default='00000', max_length=20)), ('postal_code_9', models.CharField(blank=True, max_length=20)), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('is_community_owner', models.BooleanField(default=False)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('disabled_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('business_category', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.businesscategory')), ], options={ 'verbose_name_plural': 'Communities', }, ), migrations.CreateModel( name='CommunityHierarchy', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('parentCommunityGUID', models.CharField(max_length=36)), ('childCommunityGUID', models.CharField(max_length=36)), ('relationshipType', models.IntegerField(blank=True, choices=[(1, 'Parent_Child'), (2, 'Sibling_Sibling')], default=1)), ('can_share', models.BooleanField(default=True)), ('can_view', models.BooleanField(default=True)), ('can_manage', models.BooleanField(default=False)), ('can_report', models.BooleanField(default=True)), ('can_analyze', models.BooleanField(default=True)), ('can_audit', models.BooleanField(default=True)), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('deleted_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ], options={ 'verbose_name_plural': 'Community Hierarchy', }, ), migrations.CreateModel( name='Country', fields=[ ('country_id', models.IntegerField(primary_key=True, serialize=False)), ('country_alpha2', models.CharField(max_length=2)), ('country_alpha3', models.CharField(max_length=3)), ('country_name', models.CharField(max_length=254)), ], options={ 'verbose_name_plural': 'Countries', }, ), migrations.CreateModel( name='TaxForm', fields=[ ('tax_form_id', models.IntegerField(primary_key=True, serialize=False)), ('tax_form_name', models.CharField(blank=True, max_length=254)), ('jurisdiction_name', models.CharField(blank=True, max_length=254)), ], options={ 'verbose_name': 'Tax Form', 'verbose_name_plural': 'Tax Forms', }, ), migrations.CreateModel( name='TIN', fields=[ ('tax_code_id', models.AutoField(primary_key=True, serialize=False)), ('tin_type', models.CharField(choices=[('EIN', 'EIN'), ('TIN', 'TIN'), ('SSN', 'SSN'), ('STN', 'STID')], max_length=3)), ('tin_code', models.CharField(max_length=254)), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('disabled_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('country_id', models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='xmpt.country')), ], options={ 'verbose_name_plural': 'Tax Identifiers', }, ), migrations.CreateModel( name='USCounty', fields=[ ('county_id', models.IntegerField(primary_key=True, serialize=False)), ('state_alpha2', models.CharField(default='ZZ', max_length=2)), ('state_fips_code', models.CharField(blank=True, max_length=10)), ('county_fips_code', models.CharField(blank=True, max_length=10)), ('county_subdivision_fips_code', models.CharField(blank=True, max_length=10)), ('county_name', models.CharField(max_length=254)), ('jurisdiction_level_code', models.CharField(blank=True, max_length=10)), ('country_alpha2', models.CharField(default='US', max_length=2)), ('country_alpha3', models.CharField(default='USA', max_length=3)), ('country_name', models.CharField(default='United States of America', max_length=254)), ('country_id', models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='xmpt.country')), ], options={ 'verbose_name_plural': 'US Counties', }, ), migrations.CreateModel( name='User', fields=[ ('user_guid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('user_name', models.CharField(default='empty', max_length=254)), ('first_name', models.CharField(blank=True, max_length=254)), ('middle_name', models.CharField(blank=True, max_length=100)), ('last_name', models.CharField(blank=True, max_length=254)), ('email', models.EmailField(blank=True, max_length=254)), ('phone_number', models.CharField(blank=True, max_length=20)), ('phone_type', models.CharField(blank=True, choices=[('M', 'Mobile'), ('O', 'Office')], max_length=1)), ('street_address_1', models.CharField(default='empty', max_length=254)), ('street_address_2', models.CharField(blank=True, max_length=254)), ('apt_suit', models.CharField(blank=True, max_length=50)), ('postal_code', models.CharField(default='00000', max_length=20)), ('postal_code_9', models.CharField(blank=True, max_length=20)), ('signature_name', models.CharField(blank=True, max_length=254)), ('signature_title', models.CharField(blank=True, max_length=254)), ('signature_date', models.DateTimeField(blank=True, default=datetime.datetime.now)), ('drivers_license_number', models.CharField(default='empty', max_length=20)), ('drivers_license_issue_date', models.DateField(default='9999-12-31')), ('drivers_license_exp_date', models.DateField(default='9999-12-31')), ('drivers_license_front', models.FileField(blank=True, upload_to='', verbose_name='Picture DL front')), ('drivers_license_back', models.FileField(blank=True, upload_to='', verbose_name='Picture DL back')), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('is_community_owner', models.BooleanField(default=False)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True)), ('disabled_timestamp', models.DateTimeField(blank=True)), ('business_category', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.businesscategory')), ('country_name', models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='xmpt.country')), ('county_name', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.uscounty')), ], ), migrations.CreateModel( name='USState', fields=[ ('state_id', models.IntegerField(default=0, primary_key=True, serialize=False)), ('state_alpha2', models.CharField(default='ZZ', max_length=2)), ('state_name', models.CharField(default='ZZ', max_length=254)), ('jurisdiction_level_code', models.CharField(blank=True, max_length=10)), ('state_fips_code', models.CharField(blank=True, max_length=10)), ('country_alpha2', models.CharField(default='US', max_length=2)), ('country_alpha3', models.CharField(default='USA', max_length=3)), ('country_name', models.CharField(default='United States of America', max_length=254)), ('country_id', models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='xmpt.country')), ], options={ 'verbose_name': 'US State', 'verbose_name_plural': 'US States', }, ), migrations.CreateModel( name='XmptCertificate', fields=[ ('certificate_guid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('buyer_user_guid', models.CharField(max_length=36)), ('seller_user_guid', models.CharField(max_length=36)), ('certificate_qr_code', models.ImageField(height_field=200, upload_to='', width_field=200)), ('certificate_description', models.TextField()), ('certificate_type', models.CharField(blank=True, max_length=254)), ('is_active', models.BooleanField(default=True)), ('is_valid', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('expired_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('tax_form_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.taxform')), ], ), migrations.CreateModel( name='USTown', fields=[ ('town_id', models.IntegerField(primary_key=True, serialize=False)), ('state_fips_code', models.CharField(blank=True, max_length=10)), ('county_fips_code', models.CharField(blank=True, max_length=10)), ('county_subdivision_fips_code', models.CharField(blank=True, max_length=10)), ('place_fips_code', models.CharField(blank=True, max_length=10)), ('city_fips_code', models.CharField(blank=True, max_length=10)), ('town_name', models.CharField(max_length=254)), ('jurisdiction_level_code', models.CharField(blank=True, max_length=10)), ('state_alpha2', models.CharField(default='ZZ', max_length=2)), ('country_alpha2', models.CharField(default='US', max_length=2)), ('country_alpha3', models.CharField(default='USA', max_length=3)), ('country_name', models.CharField(default='United States of America', max_length=254)), ('country_id', models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='xmpt.country')), ('state_id', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.usstate')), ], options={ 'verbose_name_plural': 'US Towns', }, ), migrations.CreateModel( name='UserTINs', fields=[ ('user_tin_id', models.AutoField(primary_key=True, serialize=False)), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('disabled_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('tin_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.tin')), ('user_guid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.user')), ], options={ 'verbose_name_plural': 'User TINs', }, ), migrations.AddField( model_name='user', name='state_name', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.usstate'), ), migrations.AddField( model_name='user', name='town_name', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.ustown'), ), migrations.AddField( model_name='uscounty', name='state_id', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.usstate'), ), migrations.AddField( model_name='tin', name='state_id', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.usstate'), ), migrations.CreateModel( name='TaxAuthority', fields=[ ('tax_authority_guid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('state_name', models.CharField(max_length=50)), ('community_guid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.community')), ('state_id', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.usstate')), ], options={ 'verbose_name_plural': 'Tax Authorities', }, ), migrations.CreateModel( name='Membership', fields=[ ('membership_id', models.IntegerField(primary_key=True, serialize=False)), ('roleCode', models.SmallIntegerField(choices=[(0, 'Member'), (1, 'Owner'), (2, 'Tax Authority'), (3, 'XMPT')], default=0)), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('disabled_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('community_guid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.community')), ('user_guid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.user')), ], ), migrations.CreateModel( name='CommunityTINs', fields=[ ('community_tin_id', models.AutoField(primary_key=True, serialize=False)), ('is_active', models.BooleanField(default=True)), ('is_enabled', models.BooleanField(default=True)), ('created_timestamp', models.DateTimeField(auto_now=True)), ('deactivated_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('disabled_timestamp', models.DateTimeField(blank=True, default='9999-12-31 00:00')), ('community_guid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.community')), ('tin_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xmpt.tin')), ], options={ 'verbose_name_plural': 'Community TINs', }, ), migrations.AddField( model_name='community', name='country_name', field=models.ForeignKey(default=840, on_delete=django.db.models.deletion.CASCADE, to='xmpt.country'), ), migrations.AddField( model_name='community', name='county_name', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.uscounty'), ), migrations.AddField( model_name='community', name='state_name', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.usstate'), ), migrations.AddField( model_name='community', name='town_name', field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='xmpt.ustown'), ), ]
57.893293
141
0.590447
1,928
18,989
5.626556
0.104772
0.056416
0.033186
0.049779
0.809642
0.770557
0.737555
0.715247
0.66427
0.637537
0
0.030004
0.262836
18,989
327
142
58.070336
0.744964
0.00237
0
0.610592
1
0
0.195914
0.025077
0
0
0
0
0
1
0
false
0
0.012461
0
0.021807
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
cdca145a095ed73bc0bc322b59a62722df946410
38
py
Python
datasets/__init__.py
XiaohangZhan/dist-framework
c13e431fafea39327e8aebe92aa8311c8f0a2169
[ "MIT" ]
16
2019-08-16T16:23:45.000Z
2020-07-27T03:50:49.000Z
datasets/__init__.py
XiaohangZhan/dist-framework
c13e431fafea39327e8aebe92aa8311c8f0a2169
[ "MIT" ]
1
2020-06-12T10:09:55.000Z
2020-06-15T04:57:28.000Z
datasets/__init__.py
XiaohangZhan/dist-framework
c13e431fafea39327e8aebe92aa8311c8f0a2169
[ "MIT" ]
2
2019-08-20T01:41:41.000Z
2020-06-04T02:51:18.000Z
from .classification_dataset import *
19
37
0.842105
4
38
7.75
1
0
0
0
0
0
0
0
0
0
0
0
0.105263
38
1
38
38
0.911765
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
1
0
0
6
a81b3c87f90a842653b6c0aec4efc4c51c2ddd05
124
py
Python
main/control/__init__.py
topless/less-tabs
5b88b355f1134dca1e635bae8d2fe2d9979e2c3c
[ "MIT" ]
1
2018-01-30T12:27:31.000Z
2018-01-30T12:27:31.000Z
main/control/__init__.py
topless/less-tabs
5b88b355f1134dca1e635bae8d2fe2d9979e2c3c
[ "MIT" ]
null
null
null
main/control/__init__.py
topless/less-tabs
5b88b355f1134dca1e635bae8d2fe2d9979e2c3c
[ "MIT" ]
null
null
null
# coding: utf-8 from .user import * from .error import * from .profile import * from .test import * from .welcome import *
15.5
22
0.701613
18
124
4.833333
0.555556
0.45977
0
0
0
0
0
0
0
0
0
0.01
0.193548
124
7
23
17.714286
0.86
0.104839
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
1
0
0
6
b5677979aaf2ffe47402e7177260008c4cf3f31c
142
py
Python
labour_welfare/labour_welfare/doctype/bank_name/test_bank_name.py
rathodjitendra/labour_welfare
682254019e4c500747fd53559d59a2fec9b470e6
[ "MIT" ]
null
null
null
labour_welfare/labour_welfare/doctype/bank_name/test_bank_name.py
rathodjitendra/labour_welfare
682254019e4c500747fd53559d59a2fec9b470e6
[ "MIT" ]
null
null
null
labour_welfare/labour_welfare/doctype/bank_name/test_bank_name.py
rathodjitendra/labour_welfare
682254019e4c500747fd53559d59a2fec9b470e6
[ "MIT" ]
3
2021-06-05T07:50:27.000Z
2021-08-23T06:52:55.000Z
# Copyright (c) 2021, Sumit and Contributors # See license.txt # import frappe import unittest class TestBankName(unittest.TestCase): pass
15.777778
44
0.774648
18
142
6.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0.033058
0.147887
142
8
45
17.75
0.876033
0.507042
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
1
0
0
6
b56bb118351530e48bbdbe79fcab5b896b07ce9f
218
py
Python
solid_backend/content/tests/conftest_files/general_conftest.py
zentrumnawi/solid-backend
0a6ac51608d4c713903856bb9b0cbf0068aa472c
[ "MIT" ]
1
2021-01-24T11:54:01.000Z
2021-01-24T11:54:01.000Z
solid_backend/content/tests/conftest_files/general_conftest.py
zentrumnawi/solid-backend
0a6ac51608d4c713903856bb9b0cbf0068aa472c
[ "MIT" ]
112
2020-04-22T10:07:03.000Z
2022-03-29T15:25:26.000Z
solid_backend/content/tests/conftest_files/general_conftest.py
zentrumnawi/solid-backend
0a6ac51608d4c713903856bb9b0cbf0068aa472c
[ "MIT" ]
null
null
null
import pytest from solid_backend.content.models import BaseProfile, TreeNode @pytest.fixture def base_profile_model_class(): return BaseProfile @pytest.fixture def tree_node_model_class(): return TreeNode
15.571429
62
0.802752
28
218
6
0.642857
0.154762
0.190476
0
0
0
0
0
0
0
0
0
0.137615
218
13
63
16.769231
0.893617
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0.25
true
0
0.25
0.25
0.75
0
1
0
0
null
0
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
1
0
0
1
1
0
0
6
b57400905ad64b14d2bdd54ad81f275e9581f634
8,459
py
Python
webapp/apps/dynamic/tests/test_views.py
OpenSourcePolicyCenter/PolicyBrain
5edffcd5cf8bb6544afc1ed982636abe66e246e1
[ "MIT" ]
13
2017-11-07T15:54:42.000Z
2018-09-27T20:56:28.000Z
webapp/apps/dynamic/tests/test_views.py
OpenSourcePolicyCenter/webapp-public
5edffcd5cf8bb6544afc1ed982636abe66e246e1
[ "MIT" ]
547
2015-08-07T21:32:51.000Z
2017-09-14T21:25:43.000Z
webapp/apps/dynamic/tests/test_views.py
OpenSourcePolicyCenter/webapp-public
5edffcd5cf8bb6544afc1ed982636abe66e246e1
[ "MIT" ]
23
2015-08-07T20:55:39.000Z
2017-08-25T19:20:20.000Z
from django.test import Client import pytest import mock import os # os.environ["NUM_BUDGET_YEARS"] = '2' from ...taxbrain.models import TaxSaveInputs from ...taxbrain.helpers import (expand_1D, expand_2D, expand_list, package_up_vars, format_csv, arrange_totals_by_row, default_taxcalc_data) from ...taxbrain.compute import DropqCompute, MockCompute, ElasticMockCompute, MockFailedCompute import taxcalc from taxcalc import Policy START_YEAR = '2016' class DynamicViewsTests(object): ''' Test the views of this app. ''' def setUp(self): # Every test needs a client. self.client = Client() def test_taxbrain_get(self): # Issue a GET request. response = self.client.get('/taxbrain/') # Check that the response is 200 OK. assert (response.status_code == 200) def behavioral_post_helper(self): #Monkey patch to mock out running of compute jobs import sys from webapp.apps.taxbrain import views webapp_views = sys.modules['webapp.apps.taxbrain.views'] webapp_views.dropq_compute = MockCompute() from webapp.apps.dynamic import views dynamic_views = sys.modules['webapp.apps.dynamic.views'] dynamic_views.dropq_compute = MockCompute(num_times_to_wait=2) # Do the microsim data = {'ID_BenefitSurtax_Switch_1': ['True'], 'ID_BenefitSurtax_Switch_0': ['True'], 'ID_BenefitSurtax_Switch_3': ['True'], 'ID_BenefitSurtax_Switch_2': ['True'], 'ID_BenefitSurtax_Switch_5': ['True'], 'ID_BenefitSurtax_Switch_4': ['True'], 'ID_BenefitSurtax_Switch_6': ['True'], 'has_errors': ['False'], 'II_em': ['4333'], 'start_year': '2016', 'csrfmiddlewaretoken': 'abc123'} response = self.client.post('/taxbrain/', data) # Check that redirect happens assert (response.status_code == 302) # Go to results page link_idx = response.url[:-1].rfind('/') assert response.url[:link_idx+1].endswith("taxbrain/") # Link to dynamic simulation model_num = response.url[link_idx+1:-1] dynamic_landing = '/dynamic/{0}/?start_year={1}'.format(model_num, START_YEAR) response = self.client.get(dynamic_landing) assert (response.status_code == 200) # Go to behavioral input page dynamic_behavior = '/dynamic/behavioral/{0}/?start_year={1}'.format(model_num, START_YEAR) response = self.client.get(dynamic_behavior) assert (response.status_code == 200) return dynamic_behavior def test_behavioral_post(self): dynamic_behavior = self.behavioral_post_helper() # Do the partial equilibrium job submission pe_data = {'BE_inc': ['-0.4']} response = self.client.post(dynamic_behavior, pe_data) assert (response.status_code == 302) print(response) #Check should get success this time response_success = self.client.get(response.url) assert (response_success.status_code == 200) link_idx = response.url[:-1].rfind('/') assert response.url[:link_idx+1].endswith("behavior_results/") def test_behavioral_post_invalid_param(self): """ Check that we get a 400 error if we submit an invalid field """ dynamic_behavior = self.behavioral_post_helper() pe_data = {'BE_inc': ['-0.4'], 'foo': ['0.0']} response = self.client.post(dynamic_behavior, pe_data) self.assertEqual(response.status_code, 400) # Test whether default elasticity is used if no param is given @pytest.mark.parametrize( 'el_data', [{'elastic_gdp': ['0.55']}, {}] ) def test_elastic_post(self, el_data): #Monkey patch to mock out running of compute jobs import sys from webapp.apps.taxbrain import views webapp_views = sys.modules['webapp.apps.taxbrain.views'] webapp_views.dropq_compute = MockCompute() from webapp.apps.dynamic import views dynamic_views = sys.modules['webapp.apps.dynamic.views'] dynamic_views.dropq_compute = ElasticMockCompute(num_times_to_wait=1) # Do the microsim data = {'ID_BenefitSurtax_Switch_1': ['True'], 'ID_BenefitSurtax_Switch_0': ['True'], 'ID_BenefitSurtax_Switch_3': ['True'], 'ID_BenefitSurtax_Switch_2': ['True'], 'ID_BenefitSurtax_Switch_5': ['True'], 'ID_BenefitSurtax_Switch_4': ['True'], 'ID_BenefitSurtax_Switch_6': ['True'], 'has_errors': ['False'], 'II_em': ['4333'], 'start_year': '2016', 'csrfmiddlewaretoken': 'abc123'} response = self.client.post('/taxbrain/', data) # Check that redirect happens assert (response.status_code == 302) # Go to results page link_idx = response.url[:-1].rfind('/') assert response.url[:link_idx+1].endswith("taxbrain/") # Link to dynamic simulation model_num = response.url[link_idx+1:-1] dynamic_landing = '/dynamic/{0}/?start_year={1}'.format(model_num, START_YEAR) response = self.client.get(dynamic_landing) assert (response.status_code == 200) # Go to macro input page dynamic_egdp = '/dynamic/macro/{0}/?start_year={1}'.format(model_num, START_YEAR) response = self.client.get(dynamic_egdp) assert (response.status_code == 200) # Do the elasticity job submission response = self.client.post(dynamic_egdp, el_data) assert (response.status_code == 302) print(response) #Check that we get success this time response_success = self.client.get(response.url) assert (response_success.status_code == 200) assert response.url[:-2].endswith("macro_results/") def test_elastic_failed_job(self): #Monkey patch to mock out running of compute jobs import sys from webapp.apps.taxbrain import views webapp_views = sys.modules['webapp.apps.taxbrain.views'] webapp_views.dropq_compute = MockCompute() from webapp.apps.dynamic import views dynamic_views = sys.modules['webapp.apps.dynamic.views'] #dynamic_views.dropq_compute = ElasticFailedMockCompute(num_times_to_wait=1) dynamic_views.dropq_compute = MockFailedCompute(num_times_to_wait=1) # Do the microsim data = {'ID_BenefitSurtax_Switch_1': ['True'], 'ID_BenefitSurtax_Switch_0': ['True'], 'ID_BenefitSurtax_Switch_3': ['True'], 'ID_BenefitSurtax_Switch_2': ['True'], 'ID_BenefitSurtax_Switch_5': ['True'], 'ID_BenefitSurtax_Switch_4': ['True'], 'ID_BenefitSurtax_Switch_6': ['True'], 'has_errors': ['False'], 'II_em': ['4333'], 'start_year': '2016', 'csrfmiddlewaretoken': 'abc123'} response = self.client.post('/taxbrain/', data) # Check that redirect happens assert (response.status_code == 302) # Go to results page link_idx = response.url[:-1].rfind('/') assert response.url[:link_idx+1].endswith("taxbrain/") # Link to dynamic simulation model_num = response.url[link_idx+1:-1] dynamic_landing = '/dynamic/{0}/?start_year={1}'.format(model_num, START_YEAR) response = self.client.get(dynamic_landing) assert (response.status_code == 200) # Go to macro input page dynamic_egdp = '/dynamic/macro/{0}/?start_year={1}'.format(model_num, START_YEAR) response = self.client.get(dynamic_egdp) assert (response.status_code == 200) # Do the elasticity job submission el_data = {'elastic_gdp': ['0.55']} response = self.client.post(dynamic_egdp, el_data) assert (response.status_code == 302) print(response) #Check that we get success this time response_success = self.client.get(response.url) assert (response_success.status_code == 200) assert response.url[:-2].endswith("macro_results/") response = self.client.get(response.url) # Make sure the failure message is in the response assert ("Your calculation failed" in response.content.decode('utf-8'))
41.465686
98
0.633172
1,007
8,459
5.093347
0.168818
0.060051
0.085982
0.087736
0.767401
0.749269
0.721583
0.721583
0.705596
0.696042
0
0.025665
0.249202
8,459
203
99
41.669951
0.781924
0.12933
0
0.720588
0
0
0.185216
0.11896
0
0
0
0
0.176471
1
0.051471
false
0
0.132353
0
0.198529
0.022059
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
b5947612297abad04b87aa7d7d4a913342039637
3,949
py
Python
metanic/features/migrations/0001_initial.py
LimpidTech/melody
a00b99f9b697864a078e2cb886be4d75c10458a9
[ "BSD-3-Clause" ]
null
null
null
metanic/features/migrations/0001_initial.py
LimpidTech/melody
a00b99f9b697864a078e2cb886be4d75c10458a9
[ "BSD-3-Clause" ]
1
2020-02-11T21:34:24.000Z
2020-02-11T21:34:24.000Z
metanic/features/migrations/0001_initial.py
LimpidTech/melody
a00b99f9b697864a078e2cb886be4d75c10458a9
[ "BSD-3-Clause" ]
null
null
null
# Generated by Django 2.1 on 2018-08-06 02:11 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('sites', '0002_alter_domain_unique'), ] operations = [ migrations.CreateModel( name='Feature', fields=[ ('created', models.DateTimeField(auto_now_add=True)), ('last_modified', models.DateTimeField(auto_now=True)), ('name', models.CharField(max_length=32)), ('identifier', models.SlugField(blank=True, primary_key=True, serialize=False, unique=True)), ], options={ 'ordering': ('created', 'last_modified'), 'abstract': False, }, ), migrations.CreateModel( name='FeatureUsage', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('last_modified', models.DateTimeField(auto_now=True)), ('feature', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usage', to='features.Feature')), ('sites', models.ManyToManyField(to='sites.Site')), ], options={ 'ordering': ('created', 'last_modified'), 'abstract': False, }, ), migrations.CreateModel( name='FeatureValue', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('last_modified', models.DateTimeField(auto_now=True)), ], options={ 'ordering': ('created', 'last_modified'), 'abstract': False, }, ), migrations.CreateModel( name='BooleanFeatureValue', fields=[ ('featurevalue_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='features.FeatureValue')), ('value', models.BooleanField()), ], options={ 'ordering': ('created', 'last_modified'), 'abstract': False, }, bases=('features.featurevalue',), ), migrations.CreateModel( name='NumericFeatureValue', fields=[ ('featurevalue_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='features.FeatureValue')), ('value', models.DecimalField(decimal_places=3, max_digits=11)), ], options={ 'ordering': ('created', 'last_modified'), 'abstract': False, }, bases=('features.featurevalue',), ), migrations.CreateModel( name='StringFeatureValue', fields=[ ('featurevalue_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='features.FeatureValue')), ('value', models.TextField()), ], options={ 'ordering': ('created', 'last_modified'), 'abstract': False, }, bases=('features.featurevalue',), ), migrations.AddField( model_name='featureusage', name='value', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usage', to='features.FeatureValue'), ), ]
40.71134
204
0.551279
339
3,949
6.271386
0.253687
0.0508
0.039511
0.062088
0.748354
0.748354
0.733302
0.733302
0.733302
0.733302
0
0.008468
0.312231
3,949
96
205
41.135417
0.7743
0.010889
0
0.640449
1
0
0.176486
0.043801
0
0
0
0
0
1
0
false
0
0.022472
0
0.067416
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
a910363048d3250a5ebb89a6047644ceef702030
24,893
py
Python
studybuddyfinder/tests.py
SindhuMente/CS3240-StudyBuddyFinder
c3c2f2b80b8351df9255e44194bce6503f984183
[ "MIT" ]
2
2020-12-10T02:39:00.000Z
2021-03-16T23:32:46.000Z
studybuddyfinder/tests.py
SindhuMente/CS3240-StudyBuddyFinder
c3c2f2b80b8351df9255e44194bce6503f984183
[ "MIT" ]
null
null
null
studybuddyfinder/tests.py
SindhuMente/CS3240-StudyBuddyFinder
c3c2f2b80b8351df9255e44194bce6503f984183
[ "MIT" ]
null
null
null
from django.test import TestCase, Client, RequestFactory from .models import UserProfile,User,FriendRequest, Group, Announcement, Calendar from django.urls import reverse from .views import register, send_request, user_list,delete_request,friends_list,create_group, add_group_member, remove_group_member, group_view, index, login, logout_view, edit, profile, create_announcement, remove_announcement, create_calendar, remove_calendar from .forms import SearchForm, CreateUserProfileForm, EditUserProfileForm # Create your tests here. class UserProfileTesting(TestCase): def setUp(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) def test_profileTest(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.year, 2) def test_profileTest1(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.major, 'CS') def test_profileTest2(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.city, 'Charlottesville') def test_profileTest3(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.state, 'VA') def test_profileTest4(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.school, 'UVA') def test_profileTest5(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.discord_id, '1234') def test_profileTest6(self): current_user = UserProfile(school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.assertEqual(current_user.zoom_id, '1234567890') def student_verification_Test1(self): current_user = UserProfile(email='123@virginia.edu', school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2, student_verified=True) self.assertEqual(current_user.student_verified, True) def student_verification_Test2(self): current_user = UserProfile(email='123@gmail.com', school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2, student_verified=True) self.assertEqual(current_user.student_verified, False) class UserListDisplayTesting(TestCase): def setUp(self): self.request_factory = RequestFactory() self.user = User.objects.create(username='Testuser', id=2) self.userProf = UserProfile(user=self.user, user_id=2, school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() def test_view_url_exists_at_desired_location(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = user_list(request) self.assertEqual(response.status_code, 200) class FriendshipTest(TestCase): def setUp(self): self.request_factory = RequestFactory() # make user1 self.user = User.objects.create(username='Testuser', id=1) self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() # make user2 self.user2 = User.objects.create(username='Testuser2', id=2) self.userProf2 = UserProfile(user=self.user2, school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf2.save() # make user3 self.user3 = User.objects.create(username='Testuser3', id=3) self.userProf3 = UserProfile(user=self.user3, school='UVA', major='CS', state='VA', city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf3.save() def test_view_url_exists_at_desired_location(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = friends_list(request,0) self.assertEqual(response.status_code, 200) def test_add_friend_request_when_friend_exists(self): #friend request sent from user1 to user2 request = RequestFactory() request.user = self.user response = send_request(request, self.user2.id) friend_request = FriendRequest.objects.get(to_user=self.userProf2) self.assertEqual(response.status_code, 302) self.assertTrue(friend_request) def test_add_friend_request_when_friend_doesnt_exists(self): #friend request sent from user1 to user5 who doesnt exist request = RequestFactory() request.user = self.user response = send_request(request, "5") friend_request = FriendRequest.objects.all().count() self.assertEqual(response.status_code, 302) self.assertTrue(friend_request ==0) def test_add_then_delete_friend_request(self): request = RequestFactory() request.user = self.user response = send_request(request, "2") friend_request_id = FriendRequest.objects.first().id response2= delete_request(request,friend_request_id) friend_requests_length = FriendRequest.objects.all().count() self.assertTrue(friend_requests_length == 0) def test_delete_friend_request_when_friend_doesnt_exist(self): request = RequestFactory() request.user = self.user #response = send_request(request, "2") try: friend_request_id = FriendRequest.objects.first().id response2= delete_request(request,friend_request_id) friend_requests_length = FriendRequest.objects.all().count() except: return True class GroupTest(TestCase): def setUp(self): self.request_factory = RequestFactory() # make user1 self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() # make user2 self.user2 = User.objects.create(username='Testuser2') self.userProf2 = UserProfile(user=self.user2, school='UVA', major='CS', state='VA', id=2, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf2.save() #make group 1 self.group= Group.objects.create(name = "Group1", owner = self.userProf) # i removed id def test_create_group(self): request = RequestFactory().post('/create_group/', {'group_name': "test group"}) request.user = self.user response = create_group(request) self.assertTrue(Group.objects.get(name= "test group")) def test_add_to_group_responding(self): # request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = add_group_member(request, self.group.id ,2) self.assertEqual(response.status_code, 302) def test_add_to_group_as_owner(self): # request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = add_group_member(request, self.group.id, 2) self.assertEqual(self.group.members.all().count(), 1) def test_create_group_on_friends_list_url_responding(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = friends_list(request,1) self.assertEqual(response.status_code, 200) def test_group_view_page_is_responding(self): # request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = group_view(request,self.group.id) self.assertEqual(response.status_code, 200) def test_group_view_page_doesnt_respond_on_false_group(self): try: request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = group_view(request, 200) except: return True def test_remove_group_member(self): # request = RequestFactory().get('/') request.user = self.user request.user_id = 1 add_group_member(request, self.group.id, 2) remove_group_member(request, self.group.id ,2) self.assertEqual(self.group.members.all().count(), 0) def test_remove_group_member_throws_error_on_false_user(self): try: request = RequestFactory().get('/') request.user = self.user request.user_id = 1 remove_group_member(request, 1, 2) except: return True class RestrictToUsersTest(TestCase): def setUp(self): self.request_factory = RequestFactory() self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() self.user2 = User.objects.create(username='Testuser2') self.userProf2 = UserProfile(user=self.user2, school='UVA', major='CS', state='VA', id=2, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf2.save() def test_view_url_exists_at_desired_location(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = user_list(request) self.assertEqual(response.status_code, 200) def test_user_list_displays_unfiltered(self): request = RequestFactory().get('/') request.user = self.user response = user_list(request) num_users = UserProfile.objects.all().count() self.assertTrue(num_users==2) class AccountTest(TestCase): def setUp(self): self.request_factory = RequestFactory() self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() self.user2 = User.objects.create(username='Testuser2') self.userProf2 = UserProfile(user=self.user2, school='UVA', major='CS', state='VA', id=2, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf2.save() def test_register_works(self): request = RequestFactory().get('/') test = User.objects.create(username='Tests') request.user = test request.user_id = 1 response = register(request) self.assertEqual(response.status_code, 200) def test_register_throws_error_if_not_valid_input(self): request = RequestFactory().get('/') try: self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() except: return True def test_edit_works(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = edit(request) self.assertEqual(response.status_code, 200) def test_user_list_works(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = user_list(request) self.assertEqual(response.status_code, 200) def test_friends_list_works(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = friends_list(request, 1) self.assertEqual(response.status_code, 200) def test_profile_works(self): request = RequestFactory().get('/') request.user = self.user request.user_id = 1 response = profile(request, "2") self.assertEqual(response.status_code, 200) class SearchFilterTest(TestCase): def setUp(self): self.request_factory = RequestFactory() self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() def test_restrict_by_school(self): form = SearchForm(data={"restrict_school" : "College of Arts & Sciences"}) self.assertEqual(form.errors, {}) def test_restrict_by_year(self): form = SearchForm(data={"restrict_year" : "First Year"}) self.assertEqual(form.errors, {}) def test_restrict_by_major(self): form = SearchForm(data={"restrict_major" : "Computer Science"}) self.assertEqual(form.errors, {}) def test_restrict_by_all(self): form = SearchForm(data={"restrict_year" : "Second Year", "restrict_school" : "College of Arts & Sciences", "restrict_major" : "Computer Science"}) self.assertEqual(form.errors, {}) def test_restrict_by_school_works(self): request = RequestFactory().post('/') request.user = self.user request.user_id = 1 form = SearchForm(data={"restrict_school" : "College of Arts & Sciences"}) self.assertEqual(form.errors, {}) def test_restrict_by_year_works(self): request = RequestFactory().post('/') request.user = self.user request.user_id = 1 form = SearchForm(data={"restrict_year" : "First Year"}) self.assertEqual(form.errors, {}) def test_restrict_by_major_works(self): request = RequestFactory().post('/') request.user = self.user request.user_id = 1 form = SearchForm(data={"restrict_major" : "Computer Science"}) self.assertEqual(form.errors, {}) def test_restrict_by_all_works(self): request = RequestFactory().post('/') request.user = self.user request.user_id = 1 form = SearchForm(data={"restrict_major" : "Computer Science", "restrict_year" : "Second Year", "restrict_school" : "College of Arts & Sciences"}) self.assertEqual(form.errors, {}) class FormsTest(TestCase): def setUp(self): self.request_factory = RequestFactory() self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() def test_create_user_profile_form_throws_error(self): form = CreateUserProfileForm(data={"hide_major":True, 'city':"Charlottesville", 'hide_school':False, 'major':"Computer Science",'hide_major':False, 'state':"Virginia",'hide_state':True, 'year':'Second Year','hide_year':False,'discord_id':'xyz','zoom_id':'qwerty'}) self.assertEqual(form.errors, {'school': ['This field is required.']}) def test_create_user_profile_form_works(self): form = CreateUserProfileForm(data={"hide_major":True, 'school':"College of Arts & Sciences", 'city':"Charlottesville", 'hide_school':False, 'major':"Computer Science",'hide_major':False, 'state':"Virginia",'hide_state':True, 'year':'Second Year','hide_year':False,'discord_id':'xyz','zoom_id':'qwerty'}) self.assertEqual(form.errors, {}) def test_edit_user_profile_form_throws_error(self): form = EditUserProfileForm(data={"hide_major":True, 'city':"Charlottesville", 'hide_school':False, 'major':"Computer Science",'hide_major':False, 'state':"Virginia",'hide_state':True, 'year':'Second Year','hide_year':False,'discord_id':'xyz','zoom_id':'qwerty'}) self.assertEqual(form.errors, {'school': ['This field is required.']}) def test_edit_user_profile_form_works(self): form = EditUserProfileForm(data={"hide_major":True, 'school':"College of Arts & Sciences", 'city':"Charlottesville", 'hide_school':False, 'major':"Computer Science",'hide_major':False, 'state':"Virginia",'hide_state':True, 'year':'Second Year','hide_year':False,'discord_id':'xyz','zoom_id':'qwerty'}) self.assertEqual(form.errors, {}) def test_search_form_doesnt_throw_error(self): form = SearchForm(data={}) self.assertEqual(form.errors, {}) def test_search_form_works(self): form = SearchForm(data={"restrict_major": "Computer Science"}) self.assertEqual(form.errors, {}) class UrlTest(TestCase): def setUp(self): self.request_factory = RequestFactory() self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() # def test_user_list_url_config(self): # response = self.client.get(reverse('user_list')) # self.assertEqual(response.status_code, 302) # def test_register_url_config(self): # response = self.client.get(reverse('register')) # self.assertEqual(response.status_code, 200) # def test_logout_url_config(self): # response = self.client.get(reverse('logout')) # self.assertEqual(response.status_code, 302) # def test_user_list_url_template(self): # response = self.client.get(reverse('user_list')) # self.assertEqual(response.status_code, 302) # self.assertTemplateUsed(response, 'studybuddyfinder/user_list.html') # def test_user_list_template_used_in_filter1(self): # form = SearchForm(data={}) # self.assertEqual(form.errors, {}) # response = self.client.get(reverse('user_list')) # self.assertEqual(response.status_code, 302) # self.assertTemplateUsed(response, 'studybuddyfinder/index.html') # def test_user_list_template_used_in_filter2(self): # form = SearchForm(data={'restrict_school':True}) # self.assertEqual(form.errors, {}) # response = self.client.get(reverse('user_list')) # self.assertEqual(response.status_code, 302) # self.assertTemplateUsed(response, 'studybuddyfinder/user_list.html') # def test_user_list_template_used_in_filter3(self): # form = SearchForm(data={'restrict_school':True, 'restrict_year':True, 'restrict_major':True}) # self.assertEqual(form.errors, {}) # response = self.client.get(reverse('user_list')) # self.assertEqual(response.status_code, 302) # self.assertTemplateUsed(response, 'studybuddyfinder/user_list.html') class AnnouncementTest(TestCase): def setUp(self): self.request_factory = RequestFactory() # make user1 self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() # make user2 self.user2 = User.objects.create(username='Testuser2') self.userProf2 = UserProfile(user=self.user2, school='UVA', major='CS', state='VA', id=2, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf2.save() # make group 1 self.group = Group.objects.create(name="Group1", owner=self.userProf) def test_create_announcement (self): request = RequestFactory().post('/create_announcement/', {'message': "test message"}) request.user = self.user self.group.members.add(self.userProf) response = create_announcement(request, self.group.id) self.assertEqual(self.group.announcements.first().message, "test message") def test_create_then_remove_announcement(self): request = RequestFactory().post('/create_announcement/', {'message': "test message"}) request.user = self.user self.group.members.add(self.userProf) create_announcement(request, self.group.id) announcement_id= self.group.announcements.first().id remove_announcement(request, self.group.id, announcement_id) self.assertEqual(self.group.announcements.all().count(), 0) class CalendarTest(TestCase): def setUp(self): self.request_factory = RequestFactory() # make user1 self.user = User.objects.create(username='Testuser') self.userProf = UserProfile(user=self.user, school='UVA', major='CS', state='VA', id=1, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf.save() # make user2 self.user2 = User.objects.create(username='Testuser2') self.userProf2 = UserProfile(user=self.user2, school='UVA', major='CS', state='VA', id=2, city='Charlottesville', discord_id='1234', zoom_id='1234567890', year=2) self.userProf2.save() # make group 1 self.group = Group.objects.create(name="Group1", owner=self.userProf) def test_create_calendar (self): request = RequestFactory().post('/create_calendar/', {'monttt': True}) request.user = self.user self.group.members.add(self.userProf) response = create_calendar(request, self.group.id) self.assertEqual(self.group.calendars.first().monttt, True) def test_create_then_remove_calendar(self): request = RequestFactory().post('/create_announcement/', {'monttt': True}) request.user = self.user self.group.members.add(self.userProf) create_calendar(request, self.group.id) calendar_id= self.group.calendars.first().id remove_calendar(request, self.group.id, calendar_id) self.assertEqual(self.group.calendars.all().count(), 0) class RedirectTests(TestCase): def test_user_list_redirect_when_not_logged_in(self): response = self.client.get(reverse('user_list')) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/') def test_profile_redirect_when_not_logged_in(self): response = self.client.get(reverse('self_profile')) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/') def test_courses_redirect_when_not_logged_in(self): response = self.client.get(reverse('uva_course_list')) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/') def test_create_group_redirect_when_not_logged_in(self): response = self.client.get(reverse('create_group')) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/') def test_friends_list_when_not_logged_in(self): response = self.client.get(reverse('friends_list', args=[0])) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/') def test_create_calendar_when_not_logged_in(self): response = self.client.get(reverse('create_calendar', args=[0])) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/') def test_remove_calendar_when_not_logged_in(self): response = self.client.get(reverse('remove_calendar', args=[0, 0])) self.assertEqual(response.status_code, 302) self.assertRedirects(response, '/index/')
46.703565
312
0.656329
2,900
24,893
5.446897
0.07069
0.027032
0.029628
0.024816
0.867435
0.839453
0.813624
0.791783
0.740884
0.737718
0
0.033415
0.211345
24,893
533
313
46.703565
0.77119
0.075965
0
0.63198
0
0
0.117603
0.002745
0
0
0
0
0.154822
1
0.170051
false
0
0.01269
0
0.22335
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
a933ea721687d8fade92c66a5746e9673fcc4b09
194
py
Python
tests/python_ann_assign/ann_assign.py
hixio-mh/plugin-python
d59dca4b6166dc20eec3e7aa57b0649c072507ce
[ "MIT" ]
362
2018-02-17T10:25:11.000Z
2022-03-30T21:04:59.000Z
tests/python_ann_assign/ann_assign.py
hixio-mh/plugin-python
d59dca4b6166dc20eec3e7aa57b0649c072507ce
[ "MIT" ]
70
2018-02-17T04:00:14.000Z
2019-08-21T18:01:52.000Z
tests/python_ann_assign/ann_assign.py
hixio-mh/plugin-python
d59dca4b6166dc20eec3e7aa57b0649c072507ce
[ "MIT" ]
36
2018-02-18T23:11:25.000Z
2021-09-20T07:19:36.000Z
a: str a: bool = True my_long_var_aaaaaaaaaaaaaaaaaaaaaaaaaa: MyLongTypeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA my_long_var_aaaaaaaaaaaaaaaaaaaaaaaaaa: MyLongTypeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 1
27.714286
86
0.896907
16
194
10.5
0.625
0.071429
0.107143
0.416667
0.916667
0
0
0
0
0
0
0.005556
0.072165
194
6
87
32.333333
0.927778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
1
null
0
0
1
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
6
a967c62185aa2fcfba3b3f187c00004d1930f9fd
24
py
Python
sympad/__init__.py
tom-pytel/sympad
859215e78e2b5cc2984cb0a9492e99f7b23fee4a
[ "BSD-2-Clause" ]
8
2020-12-29T15:28:56.000Z
2021-11-07T11:40:47.000Z
sympad/__init__.py
Pristine-Cat/SymPad
859215e78e2b5cc2984cb0a9492e99f7b23fee4a
[ "BSD-2-Clause" ]
null
null
null
sympad/__init__.py
Pristine-Cat/SymPad
859215e78e2b5cc2984cb0a9492e99f7b23fee4a
[ "BSD-2-Clause" ]
1
2020-02-04T11:32:33.000Z
2020-02-04T11:32:33.000Z
from .sympad import main
24
24
0.833333
4
24
5
1
0
0
0
0
0
0
0
0
0
0
0
0.125
24
1
24
24
0.952381
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
1
0
0
6
a9719ee0a4f24c1f429049142033342aa45f4029
132
py
Python
pkgs/ops-pkg/src/genie/libs/ops/routing/ios/routing.py
miott/genielibs
6464642cdd67aa2367bdbb12561af4bb060e5e62
[ "Apache-2.0" ]
94
2018-04-30T20:29:15.000Z
2022-03-29T13:40:31.000Z
pkgs/ops-pkg/src/genie/libs/ops/routing/ios/routing.py
miott/genielibs
6464642cdd67aa2367bdbb12561af4bb060e5e62
[ "Apache-2.0" ]
67
2018-12-06T21:08:09.000Z
2022-03-29T18:00:46.000Z
pkgs/ops-pkg/src/genie/libs/ops/routing/ios/routing.py
miott/genielibs
6464642cdd67aa2367bdbb12561af4bb060e5e62
[ "Apache-2.0" ]
49
2018-06-29T18:59:03.000Z
2022-03-10T02:07:59.000Z
''' Routing Genie Ops Object for IOS - CLI. ''' from ..iosxe.routing import Routing as RoutingXE class Routing(RoutingXE): pass
18.857143
48
0.719697
18
132
5.277778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.174242
132
7
49
18.857143
0.87156
0.295455
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
1
0
0
6
a984ad6cbfd9ef09e964246230bf2c71c7cb0904
31
py
Python
environment/carla/__init__.py
landjbs/Autopilot
aa9605feb10fda5c9f3dfdcf4143cf3ec4c5d53f
[ "MIT" ]
null
null
null
environment/carla/__init__.py
landjbs/Autopilot
aa9605feb10fda5c9f3dfdcf4143cf3ec4c5d53f
[ "MIT" ]
null
null
null
environment/carla/__init__.py
landjbs/Autopilot
aa9605feb10fda5c9f3dfdcf4143cf3ec4c5d53f
[ "MIT" ]
null
null
null
from carla_env import CarlaEnv
15.5
30
0.870968
5
31
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.129032
31
1
31
31
0.962963
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
1
0
0
6
8d4de85d4d4549ad7139d6e11520e833c3893c30
29
py
Python
project/gui/__init__.py
majoranthonyreyna/Random-Conlang-Generator
0e71aa7b187e3663b6594bb79d7f1071868f7d2d
[ "MIT" ]
null
null
null
project/gui/__init__.py
majoranthonyreyna/Random-Conlang-Generator
0e71aa7b187e3663b6594bb79d7f1071868f7d2d
[ "MIT" ]
null
null
null
project/gui/__init__.py
majoranthonyreyna/Random-Conlang-Generator
0e71aa7b187e3663b6594bb79d7f1071868f7d2d
[ "MIT" ]
null
null
null
from project.gui.gui import *
29
29
0.793103
5
29
4.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.103448
29
1
29
29
0.884615
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
1
0
0
6
8d50e9f55fec9d976a8a37ed9423b35e1dc030d4
37
py
Python
getnet/services/payments/boleto/__init__.py
rafagonc/getnet-py
d2a5278b497408b5245d5d0fecd2e424f4ddb0d5
[ "MIT" ]
2
2021-04-09T20:17:41.000Z
2021-04-09T20:18:06.000Z
getnet/services/payments/boleto/__init__.py
rafagonc/getnet-py
d2a5278b497408b5245d5d0fecd2e424f4ddb0d5
[ "MIT" ]
5
2019-11-24T16:24:11.000Z
2021-02-22T16:10:05.000Z
getnet/services/payments/boleto/__init__.py
rafagonc/getnet-py
d2a5278b497408b5245d5d0fecd2e424f4ddb0d5
[ "MIT" ]
3
2020-07-25T23:00:59.000Z
2022-02-15T02:37:27.000Z
from .service import Boleto, Service
18.5
36
0.810811
5
37
6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
1
37
37
0.9375
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
1
0
0
6
8d6446115ed506050a2bab97666017fc65d81322
8,616
py
Python
tests/unit_tests/sampling/MCMC/test_mcmc_algorithms.py
SURGroup/UncertaintyQuantification
a94c8db47d07134ea2b3b0a3ca53ca818532c3e6
[ "MIT" ]
null
null
null
tests/unit_tests/sampling/MCMC/test_mcmc_algorithms.py
SURGroup/UncertaintyQuantification
a94c8db47d07134ea2b3b0a3ca53ca818532c3e6
[ "MIT" ]
null
null
null
tests/unit_tests/sampling/MCMC/test_mcmc_algorithms.py
SURGroup/UncertaintyQuantification
a94c8db47d07134ea2b3b0a3ca53ca818532c3e6
[ "MIT" ]
null
null
null
from UQpy.sampling.mcmc import * import UQpy.distributions as Distributions # Tests for parent MCMC and MH algorithm def test_mh_1d_target_pdf(): target = Distributions.Normal().pdf x = MetropolisHastings(dimension=1, pdf_target=target, n_chains=1, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == -1.291 def test_mh_1d_samples_per_chain(): target = Distributions.Normal().pdf x = MetropolisHastings(dimension=1, pdf_target=target, n_chains=2, random_state=123, nsamples_per_chain=5) assert round(float(x.samples[-1]), 3) == 0.474 def test_mh_1d_acceptance_rate(): target = Distributions.Normal().pdf x = MetropolisHastings(dimension=1, pdf_target=target, n_chains=1, random_state=123, nsamples=100) assert round(float(x.acceptance_rate[0]), 3) == 0.707 def test_mh_1d_save_log_pdf(): target = Distributions.Normal().pdf x = MetropolisHastings(dimension=1, pdf_target=target, n_chains=1, random_state=123, save_log_pdf=True, nsamples=10) assert round(float(x.log_pdf_values[-1]), 3) == -1.752 def test_mh_1d_target_log_pdf(): target = Distributions.Normal().log_pdf x = MetropolisHastings(dimension=1, log_pdf_target=target, n_chains=1, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == -1.291 def test_mh_2d(): target = Distributions.MultivariateNormal([0., 0.]).pdf x = MetropolisHastings(dimension=2, pdf_target=target, n_chains=1, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.406, -1.217] def test_mh_2d_burn_jump(): target = Distributions.MultivariateNormal([0., 0.]).pdf x = MetropolisHastings(dimension=2, log_pdf_target=target, burn_length=10, jump=2, n_chains=1, random_state=123, nsamples=10) assert x.iterations_number == 30 def test_mh_2d_nsamples_check(): target = Distributions.MultivariateNormal([0., 0.]).pdf x = MetropolisHastings(dimension=2, pdf_target=target, n_chains=2, random_state=123, nsamples=60) assert x.nsamples_per_chain + x.samples_counter == 90 def test_mh_2d_2chains(): target = Distributions.MultivariateNormal([0., 0.]).pdf x = MetropolisHastings(dimension=2, pdf_target=target, n_chains=2, random_state=123, nsamples=60) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.064, -0.533] def test_mh_2d_2chains_non_concatenated(): target = Distributions.MultivariateNormal([0., 0.]).pdf x = MetropolisHastings(dimension=2, pdf_target=target, concatenate_chains=False, n_chains=2, random_state=123, nsamples=60) assert [[round(float(x.samples[-1][0][0]), 3), round(float(x.samples[-1][0][1]), 3)], [round(float(x.samples[-1][1][0]), 3), round(float(x.samples[-1][1][1]), 3)]] == [[1.767, 1.465], [-0.064, -0.533]] def test_mh_2d_seed(): target = Distributions.MultivariateNormal([0., 0.]).pdf x = MetropolisHastings(pdf_target=target, seed=[0., 0.], n_chains=1, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.406, -1.217] def test_mh_1d_symmetric_proposal_pdf(): target = Distributions.Normal().pdf proposal = Distributions.Normal() x = MetropolisHastings(dimension=1, pdf_target=target, proposal=proposal, proposal_is_symmetric=True, n_chains=1, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == -1.291 def test_mh_1d_asymmetric_proposal_pdf(): target = Distributions.Normal().pdf proposal = Distributions.Normal() x = MetropolisHastings(dimension=1, pdf_target=target, proposal=proposal, proposal_is_symmetric=False, n_chains=1, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == -1.291 def test_mmh_1d_burn_jump(): target = Distributions.Normal().pdf x = ModifiedMetropolisHastings(dimension=1, pdf_target=target, burn_length=10, jump=2, n_chains=1, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == 0.497 def test_mmh_2d_list_target_pdf(): target = [Distributions.Normal().pdf, Distributions.Normal().pdf] x = ModifiedMetropolisHastings(dimension=2, pdf_target=target, n_chains=1, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.810, 0.173] def test_mmh_2d_list_target_log_pdf(): target = [Distributions.Normal().log_pdf, Distributions.Normal().log_pdf] x = ModifiedMetropolisHastings(dimension=2, log_pdf_target=target, n_chains=1, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.810, 0.173] def test_mmh_2d_joint_proposal(): target = Distributions.MultivariateNormal([0., 0.]).pdf proposal = Distributions.JointIndependent(marginals=[Distributions.Normal(scale=0.2), Distributions.Normal(scale=0.2)]) x = ModifiedMetropolisHastings(dimension=2, pdf_target=target, n_chains=1, proposal=proposal, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.783, -0.195] def test_mmh_2d_list_proposal(): target = Distributions.MultivariateNormal([0., 0.]).pdf proposal = [Distributions.Normal(scale=0.2), Distributions.Normal(scale=0.2)] x = ModifiedMetropolisHastings(dimension=2, pdf_target=target, n_chains=1, proposal=proposal, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.783, -0.195] def test_mmh_2d_single1d_proposal(): target = Distributions.MultivariateNormal([0., 0.]).pdf proposal = Distributions.Normal(scale=0.2) x = ModifiedMetropolisHastings(dimension=2, pdf_target=target, n_chains=1, proposal=proposal, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.783, -0.195] def test_mmh_2d_list_proposal_log_target(): target = [Distributions.Normal().log_pdf, Distributions.Normal().log_pdf] proposal = [Distributions.Normal(scale=0.2), Distributions.Normal(scale=0.2)] x = ModifiedMetropolisHastings(dimension=2, log_pdf_target=target, n_chains=1, proposal=proposal, random_state=123, nsamples=10) assert [round(float(x.samples[-1][0]), 3), round(float(x.samples[-1][1]), 3)] == [-0.783, -0.195] def test_dram_1d_burn_jump(): target = Distributions.Normal().pdf x = DRAM(dimension=1, pdf_target=target, burn_length=10, jump=2, n_chains=1, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == 0.935 def test_dream_1d_burn_jump(): target = Distributions.Normal().pdf x = DREAM(pdf_target=target, burn_length=10, jump=2, dimension=1, n_chains=10, random_state=123, nsamples=20) assert round(float(x.samples[-1]), 3) == 0.0 def test_dream_1d_check_chains(): target = Distributions.Normal().pdf x = DREAM(pdf_target=target, burn_length=0, jump=2, save_log_pdf=True, dimension=1, check_chains=(1000, 1), n_chains=20, random_state=123, nsamples=2000) assert (round(float(x.samples[-1]), 3) == 0.593) def test_dream_1d_adapt_chains(): target = Distributions.Normal().pdf x = DREAM(pdf_target=target, burn_length=1000, jump=2, save_log_pdf=True, dimension=1, crossover_adaptation=(1000, 1), n_chains=20, random_state=123, nsamples=2000) assert (round(float(x.samples[-1]), 3) == -0.446) def test_stretch_1d_burn_jump(): target = Distributions.Normal().pdf x = Stretch(pdf_target=target, burn_length=10, jump=2, dimension=1, n_chains=2, random_state=123, nsamples=10) assert round(float(x.samples[-1]), 3) == -0.961 def test_unconcatenate_chains_mcmc(): target = Distributions.Normal().pdf x = ModifiedMetropolisHastings(dimension=1, pdf_target=target, burn_length=10, jump=2, n_chains=2, save_log_pdf=True, random_state=123) x.run(nsamples=5) x.run(nsamples=5) assert (round(float(x.samples[-1]), 3) == -0.744)
45.587302
115
0.663417
1,208
8,616
4.542219
0.089404
0.06561
0.072171
0.111536
0.871697
0.854565
0.833424
0.82577
0.764534
0.717332
0
0.075388
0.185585
8,616
188
116
45.829787
0.70657
0.00441
0
0.42963
0
0
0
0
0
0
0
0
0.192593
1
0.192593
false
0
0.014815
0
0.207407
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
8d72702f2069fd4c32933e67b6a2d18101a593b5
143
py
Python
quickfund/__init__.py
MapleCCC/QuickFund
9806be6d734a8d1e00815c26c0eaff5a40962721
[ "MIT" ]
3
2020-07-16T19:18:55.000Z
2020-08-03T11:28:32.000Z
quickfund/__init__.py
MapleCCC/QuickFund
9806be6d734a8d1e00815c26c0eaff5a40962721
[ "MIT" ]
null
null
null
quickfund/__init__.py
MapleCCC/QuickFund
9806be6d734a8d1e00815c26c0eaff5a40962721
[ "MIT" ]
1
2020-12-18T13:48:20.000Z
2020-12-18T13:48:20.000Z
from .__version__ import __version__, __version_info__ from .cli import cli_entry __all__ = ["cli_entry", "__version__", "__version_info__"]
23.833333
58
0.79021
17
143
5
0.411765
0.329412
0.423529
0
0
0
0
0
0
0
0
0
0.111888
143
5
59
28.6
0.669291
0
0
0
0
0
0.251748
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
6
8d9a59d15aab26a4859d22930f2aaa5be49baea5
35
py
Python
pegasus/pipeline/__init__.py
michael-alperovich/pegasus
b0720dd79756ca7e81d0b5de77b98067ad2be7c5
[ "BSD-3-Clause" ]
40
2019-10-16T09:57:57.000Z
2021-12-29T13:56:31.000Z
pegasus/pipeline/__init__.py
michael-alperovich/pegasus
b0720dd79756ca7e81d0b5de77b98067ad2be7c5
[ "BSD-3-Clause" ]
65
2019-10-16T02:15:00.000Z
2022-03-10T17:13:32.000Z
pegasus/pipeline/__init__.py
michael-alperovich/pegasus
b0720dd79756ca7e81d0b5de77b98067ad2be7c5
[ "BSD-3-Clause" ]
16
2019-10-17T02:03:52.000Z
2022-01-02T04:01:43.000Z
from .pipeline import run_pipeline
17.5
34
0.857143
5
35
5.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.114286
35
1
35
35
0.935484
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
1
0
0
6
57417daeb0104ddd046f32f3735eb0dd23cb2c9a
10,427
py
Python
tests/utils.py
eightBEC/wkstools
5370d62325ecdf134ead552e344d574fddf20de3
[ "MIT" ]
null
null
null
tests/utils.py
eightBEC/wkstools
5370d62325ecdf134ead552e344d574fddf20de3
[ "MIT" ]
null
null
null
tests/utils.py
eightBEC/wkstools
5370d62325ecdf134ead552e344d574fddf20de3
[ "MIT" ]
null
null
null
import json import os from typing import List, Tuple from wkstools.models import AnnoationLocation, Entity, Relation from pydantic import parse_obj_as def _load_json(filename: str) -> dict: with open( os.path.join(os.path.dirname(__file__), filename), "r", encoding="utf-8", ) as f: return json.load(f) def get_nlu_json_response() -> dict: return _load_json("./data/nlu_response.json") def get_nlu_single_entity_json_response() -> dict: return _load_json("./data/nlu_response_1_entity.json") def get_nlu_single_relation_json_response() -> dict: return _load_json("./data/nlu_response_1_relation.json") def get_head_overlapping_entity_relation() -> Tuple[Entity, Relation]: head = Entity( entity_type="head-type", text="head", location=AnnoationLocation(start=0, end=4), subtype="HEAD", ) tail = Entity( entity_type="tail-type", text="tail", location=AnnoationLocation(start=6, end=9), subtype="TAIL", ) relation = Relation( relation_type="some-relation-type", sentence="head tail", subtype="NONE", head=head, tail=tail, score=1.0, ) return (head, relation) def get_tail_overlapping_entity_relation() -> Tuple[Entity, Relation]: head = Entity( entity_type="head-type", text="head", location=AnnoationLocation(start=0, end=4), subtype="HEAD", score=0.99, ) tail = Entity( entity_type="tail-type", text="tail", location=AnnoationLocation(start=6, end=9), subtype="TAIL", score=0.99, ) relation = Relation( relation_type="some-relation-type", sentence="head tail", subtype="NONE", head=head, tail=tail, score=1.0, ) return (tail, relation) def get_non_overlapping_entity_relation() -> Tuple[Entity, Relation]: other_entity = Entity( entity_type="head-type", text="head", location=AnnoationLocation(start=10, end=14), subtype="HEAD", score=0.99, ) head = Entity( entity_type="head-type", text="head", location=AnnoationLocation(start=0, end=4), subtype="HEAD", score=0.99, ) tail = Entity( entity_type="tail-type", text="tail", location=AnnoationLocation(start=6, end=9), subtype="TAIL", score=0.99, ) relation = Relation( relation_type="some-relation-type", sentence="head tail", subtype="NONE", head=head, tail=tail, score=1.0, ) return (other_entity, relation) def get_entities(): entities = [ { "entity_type": "TYPE1", "text": "jährlich", "location": {"start": 24, "end": 32}, "score": 0.98282, "subtype": "JAEHRLICH", }, { "entity_type": "TYPE1", "text": "regelmäßig", "location": {"start": 24, "end": 34}, "score": 0.98282, "subtype": "NONE", }, ] return parse_obj_as(List[Entity], entities) def get_different_entities(): entities = [ { "entity_type": "TYPE1", "text": "jährlich", "location": {"start": 24, "end": 32}, "score": 0.98282, "subtype": "JAEHRLICH", }, { "entity_type": "TYPE2", "text": "regelmäßig", "location": {"start": 34, "end": 44}, "score": 0.98282, "subtype": "NONE", }, ] return parse_obj_as(List[Entity], entities) def get_different_relations(): relations = [ { "relation_type": "SAMPLE_RELATION_1", "sentence": "TYPE1 TYPE2", "score": 0.8, "head": { "entity_type": "TYPE1", "text": "jährlich", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, "tail": { "entity_type": "TYPE2", "text": "regelmäßig", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, }, { "relation_type": "SAMPLE_RELATION_2", "sentence": "TYPE3 TYPE4", "score": 0.8, "head": { "entity_type": "TYPE3", "text": "jährlich", "location": {"start": 10, "end": 15}, "score": 0.98282, "subtype": "SUBTYPE3", }, "tail": { "entity_type": "TYPE4", "text": "regelmäßig", "location": {"start": 17, "end": 21}, "score": 0.98282, "subtype": "SUBTYPE4", }, }, ] return parse_obj_as(List[Relation], relations) def get_joint_head_head_relations(): relations = [ { "relation_type": "SAMPLE_RELATION_1", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE1", "text": "type1", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, "tail": { "entity_type": "TYPE2", "text": "type2", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, }, { "relation_type": "SAMPLE_RELATION_2", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE1", "text": "type1", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, "tail": { "entity_type": "TYPE3", "text": "type3", "location": {"start": 12, "end": 15}, "score": 0.98282, "subtype": "SUBTYPE3", }, }, ] return parse_obj_as(List[Relation], relations) def get_joint_head_tail_relations(): relations = [ { "relation_type": "SAMPLE_RELATION_1", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE1", "text": "type1", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, "tail": { "entity_type": "TYPE2", "text": "type2", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, }, { "relation_type": "SAMPLE_RELATION_2", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE3", "text": "type3", "location": {"start": 12, "end": 15}, "score": 0.98282, "subtype": "SUBTYPE3", }, "tail": { "entity_type": "TYPE1", "text": "type1", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, }, ] return parse_obj_as(List[Relation], relations) def get_joint_tail_head_relations(): relations = [ { "relation_type": "SAMPLE_RELATION_1", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE1", "text": "type1", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, "tail": { "entity_type": "TYPE2", "text": "type2", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, }, { "relation_type": "SAMPLE_RELATION_2", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE2", "text": "type2", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, "tail": { "entity_type": "TYPE3", "text": "type3", "location": {"start": 12, "end": 15}, "score": 0.98282, "subtype": "SUBTYPE3", }, }, ] return parse_obj_as(List[Relation], relations) def get_joint_tail_tail_relations(): relations = [ { "relation_type": "SAMPLE_RELATION_1", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE1", "text": "type1", "location": {"start": 0, "end": 5}, "score": 0.98282, "subtype": "SUBTYPE1", }, "tail": { "entity_type": "TYPE2", "text": "type2", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, }, { "relation_type": "SAMPLE_RELATION_2", "sentence": "type1 type2 type3", "score": 0.8, "head": { "entity_type": "TYPE3", "text": "type3", "location": {"start": 12, "end": 15}, "score": 0.98282, "subtype": "SUBTYPE3", }, "tail": { "entity_type": "TYPE2", "text": "type2", "location": {"start": 7, "end": 11}, "score": 0.98282, "subtype": "SUBTYPE2", }, }, ] return parse_obj_as(List[Relation], relations)
28.257453
81
0.434257
906
10,427
4.835541
0.099338
0.053412
0.06026
0.098608
0.884273
0.871262
0.861219
0.84136
0.827665
0.817393
0
0.061251
0.409706
10,427
368
82
28.334239
0.650528
0
0
0.693215
0
0
0.236693
0.008823
0
0
0
0
0
1
0.041298
false
0
0.014749
0.00885
0.097345
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
574189b945fd62664d0593494e5ce20aa7755b9c
325
py
Python
base_models/__init__.py
Cousin-Zan/Semantic-Segmentation-for-Steel-Strip-Surface-Defect-Detection
ae135743cc190cdf5a04b5d3ca04dde44f6dd58a
[ "Apache-2.0" ]
null
null
null
base_models/__init__.py
Cousin-Zan/Semantic-Segmentation-for-Steel-Strip-Surface-Defect-Detection
ae135743cc190cdf5a04b5d3ca04dde44f6dd58a
[ "Apache-2.0" ]
null
null
null
base_models/__init__.py
Cousin-Zan/Semantic-Segmentation-for-Steel-Strip-Surface-Defect-Detection
ae135743cc190cdf5a04b5d3ca04dde44f6dd58a
[ "Apache-2.0" ]
1
2022-01-20T06:06:21.000Z
2022-01-20T06:06:21.000Z
from base_models.densenet import DenseNet from base_models.resnet import ResNet from base_models.vgg import VGG from base_models.xception import Xception from base_models.mobilenet import MobileNet from base_models.vovnet import VovNet from base_models.vovnet_shortcut import VovNet_shortcut from base_models.osa import OSA
32.5
55
0.873846
50
325
5.48
0.24
0.233577
0.408759
0.145985
0
0
0
0
0
0
0
0
0.101538
325
9
56
36.111111
0.938356
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
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
6
93e57cc7d029df458ffacbe46521d3137aae44aa
57
py
Python
test_pkg.py
ushvarma/seng20_group08
1a04257b8992389a2ae245e24b9e0a594c5558c7
[ "MIT" ]
null
null
null
test_pkg.py
ushvarma/seng20_group08
1a04257b8992389a2ae245e24b9e0a594c5558c7
[ "MIT" ]
2
2020-08-17T16:04:58.000Z
2020-08-17T18:10:10.000Z
test_pkg.py
ushvarma/seng20_group08
1a04257b8992389a2ae245e24b9e0a594c5558c7
[ "MIT" ]
null
null
null
import code def test_inc(): assert code.inc(3) == 4
11.4
27
0.631579
10
57
3.5
0.8
0
0
0
0
0
0
0
0
0
0
0.045455
0.22807
57
4
28
14.25
0.75
0
0
0
0
0
0
0
0
0
0
0
0.333333
1
0.333333
true
0
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
1
1
0
1
0
1
0
0
6
93f0bd00e8513359cc5d79191c3fb430038ebc8f
182
py
Python
app/core/tasks/consumer.py
umluizlima/email-sender
d952874918fc6edc896dabe6d1c1e1391f9d8697
[ "MIT" ]
7
2020-05-24T16:49:05.000Z
2021-05-03T18:50:00.000Z
app/core/tasks/consumer.py
umluizlima/email-sender
d952874918fc6edc896dabe6d1c1e1391f9d8697
[ "MIT" ]
1
2021-11-07T18:52:54.000Z
2021-11-07T18:52:55.000Z
app/core/tasks/consumer.py
umluizlima/email-sender
d952874918fc6edc896dabe6d1c1e1391f9d8697
[ "MIT" ]
2
2020-05-24T16:49:07.000Z
2022-02-03T00:57:25.000Z
from app.settings import Settings from .base import get_celery_app def get_tasks_consumer(settings: Settings, **kwargs): return get_celery_app("consumer", settings, **kwargs)
22.75
57
0.78022
25
182
5.44
0.48
0.132353
0.176471
0
0
0
0
0
0
0
0
0
0.126374
182
7
58
26
0.855346
0
0
0
0
0
0.043956
0
0
0
0
0
0
1
0.25
false
0
0.5
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
1
1
1
0
0
6
93ff5227a48408e109f4148250f0bc3fa8839969
39
py
Python
src/server/__init__.py
muenstermannmarius/ElectionSystem
a6e60d9147423787e869587b808def4771f89cb7
[ "RSA-MD" ]
null
null
null
src/server/__init__.py
muenstermannmarius/ElectionSystem
a6e60d9147423787e869587b808def4771f89cb7
[ "RSA-MD" ]
null
null
null
src/server/__init__.py
muenstermannmarius/ElectionSystem
a6e60d9147423787e869587b808def4771f89cb7
[ "RSA-MD" ]
null
null
null
print("server package initializes ...")
39
39
0.74359
4
39
7.25
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
39
1
39
39
0.805556
0
0
0
0
0
0.75
0
0
0
0
0
0
1
0
true
0
0
0
0
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
6
9e1474a9513cbd984fcf7e4e4b007804aa1faac8
48,538
pyw
Python
main.pyw
yuj09161/keyindicator
71efb3d3c5f07a811465a4755e684be0842bd187
[ "MIT" ]
null
null
null
main.pyw
yuj09161/keyindicator
71efb3d3c5f07a811465a4755e684be0842bd187
[ "MIT" ]
null
null
null
main.pyw
yuj09161/keyindicator
71efb3d3c5f07a811465a4755e684be0842bd187
[ "MIT" ]
null
null
null
from PySide2.QtCore import QObject,Signal,Qt,QCoreApplication from PySide2.QtGui import QIcon,QPixmap from PySide2.QtWidgets import QSystemTrayIcon,QMessageBox,QApplication,QMainWindow,QAction,QMenu,QWidget,QGridLayout,QPlainTextEdit,QPushButton import os,sys,time,threading,ctypes,re from base64 import b64decode LOAD_FROM_IMAGE=False PROGRAM_PATH = os.path.dirname(os.path.abspath(sys.argv[0]))+'\\' PATH = PROGRAM_PATH+'icons\\' VK_CAPITAL = 0x14 VK_HANGUL = 0x15 VK_NUMLOCK = 0x90 class MsgBox(QMessageBox): def deleteLater(): self.destroy() class Info(QMainWindow): def __init__(self,parent,title,info_text,display_qtinfo=False): self.__display_qtinfo=display_qtinfo super().__init__(parent) self.setupUI() self.retranslateUi(title,info_text) self.btnExit.clicked.connect(self.hide) if self.__display_qtinfo: self.btnQt.clicked.connect(lambda: QMessageBox.aboutQt(self)) def setupUI(self): if not self.objectName(): self.setObjectName(u"info") self.setFixedSize(400, 300) self.setWindowFlags(self.windowFlags()^Qt.WindowMinMaxButtonsHint) self.centralwidget = QWidget(self) self.centralwidget.setObjectName(u"centralwidget") self.glCentral = QGridLayout(self.centralwidget) self.glCentral.setObjectName(u"glCentral") self.pteInfo = QPlainTextEdit(self.centralwidget) self.pteInfo.setObjectName(u"pteInfo") self.pteInfo.setReadOnly(True) self.glCentral.addWidget(self.pteInfo, 0, 0, 1, 2) if self.__display_qtinfo: self.btnQt = QPushButton(self.centralwidget) self.btnQt.setObjectName(u"btnQt") self.glCentral.addWidget(self.btnQt, 1, 0, 1, 1, Qt.AlignLeft) self.btnExit = QPushButton(self.centralwidget) self.btnExit.setObjectName(u"btnExit") self.glCentral.addWidget(self.btnExit, 1, 1, 1, 1, Qt.AlignRight) self.setCentralWidget(self.centralwidget) def retranslateUi(self,title,info_text): self.setWindowTitle(QCoreApplication.translate("info", title, None)) self.pteInfo.setPlainText(re.sub('\n +','\n',re.sub('\n{2,} *','\n\n',info_text))) self.btnExit.setText(QCoreApplication.translate("info", u"\ub2eb\uae30", None)) if self.__display_qtinfo: self.btnQt.setText(QCoreApplication.translate("info", u"About Qt", None)) class KeyUI: def setupUI(self,key): #generate icons if LOAD_FROM_IMAGE: img_n0='n0.png' img_n1='n1.png' img_n2='n2.png' img_c0='c0.png' img_c1='c1.png' img_c2='c2.png' else: img_n0=QPixmap() img_n1=QPixmap() img_n2=QPixmap() img_c0=QPixmap() img_c1=QPixmap() img_c2=QPixmap() img_n0.loadFromData(b64decode(RAW_DATA['n0'])) img_n1.loadFromData(b64decode(RAW_DATA['n1'])) img_n2.loadFromData(b64decode(RAW_DATA['n2'])) img_c0.loadFromData(b64decode(RAW_DATA['c0'])) img_c1.loadFromData(b64decode(RAW_DATA['c1'])) img_c2.loadFromData(b64decode(RAW_DATA['c2'])) self.num0=QIcon(img_n0) self.num1=QIcon(img_n1) self.num2=QIcon(img_n2) self.caps0=QIcon(img_c0) self.caps1=QIcon(img_c1) self.caps2=QIcon(img_c2) #generate menu&actions self.acInfo=QAction('Info',key) self.acLicense=QAction('License',key) self.acExit=QAction('Exit',key) self.menu=QMenu('menu') self.menu.addAction(self.acInfo) self.menu.addAction(self.acLicense) self.menu.addSeparator() self.menu.addAction(self.acExit) #generate tray icons self.num=QSystemTrayIcon(self.num0,key) self.caps=QSystemTrayIcon(self.caps0,key) #set context menu self.num.setContextMenu(self.menu) self.caps.setContextMenu(self.menu) class Key(QWidget,KeyUI): def __init__(self): def close(): def processer(response): print(response) response=msgbox.standardButton(response) print(response) msgbox.destroy() if response==QMessageBox.Yes: self.__run=False while True: if self.__ended: sys.exit(0) app.processEvents() msgbox=MsgBox() msgbox.setWindowTitle('종료?') msgbox.setText('종료?') msgbox.setIcon(QMessageBox.Question) msgbox.addButton(QMessageBox.Yes) msgbox.addButton(QMessageBox.No) msgbox.show() msgbox.buttonClicked.connect(processer) super().__init__() self.setupUI(self) self.__run = True self.__ended = False self.__close_count = 0 self.__keydll = ctypes.WinDLL('user32.dll') #license&open source info if os.path.isfile(PROGRAM_PATH+'NOTICE'): with open(PROGRAM_PATH+'NOTICE','r',encoding='utf-8') as file: note_win=Info(self,'오픈 소스 라이선스',file.read(),True) else: note_win=Info(self,'오픈 소스 라이선스','Notice File is Missed',True) if os.path.isfile(PROGRAM_PATH+'LICENSE'): with open(PROGRAM_PATH+'LICENSE','r',encoding='utf-8') as file: license_win=Info(self,'정보',file.read()) else: license_win=Info(self,'정보','License File is Missed') self.acInfo.triggered.connect(note_win.show) self.acLicense.triggered.connect(license_win.show) self.acExit.triggered.connect(close) self.num.setVisible(True) self.caps.setVisible(True) #get state threading.Thread(target=self.__worker).start() def __worker(self): num=0; caps=0; kor=0 while self.__run: #save old state old_caps = caps old_kor = kor old_num = num #get current state num = self.__keydll.GetKeyState(VK_NUMLOCK) caps = self.__keydll.GetKeyState(VK_CAPITAL) if num!=old_num or caps!=old_caps: #if state changed self.__update(num,caps) if self.__close_count>0: self.__close_count-=0.5 time.sleep(0.2) self.__ended=True def __update(self,num,caps): if num==0: self.num.setIcon(self.num0) elif num==1: self.num.setIcon(self.num1) else: self.num.setIcon(self.num2) if caps==0: self.caps.setIcon(self.caps0) elif caps==1: self.caps.setIcon(self.caps1) else: self.caps.setIcon(self.caps2) #icons RAW_DATA={ 'n0': b'iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAC6npUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHja7ZddktwqDIXfWUWWgCSExHIwP1XZwV1+DtjtdM/k3iSVPN1q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XYkTOniZKiMK1gspvuA/YCuzD7BxsxxZ/3xlLJLJfrUjkT56/D7D00N8Hcx2suVFHITWVvhUKhUCgUCoVCoVAoFAqFQqFQKBQKhUKhUCgUCoVCEQH+B9PyCmzTC3XyAAAAAElFTkSuQmCC' } if __name__=='__main__': app=QApplication() key=Key() sys.exit(app.exec_())
214.769912
10,538
0.912769
1,983
48,538
22.273828
0.645487
0.001268
0.00326
0.003804
0.056148
0.052707
0.048813
0.047771
0.047771
0.047771
0
0.133187
0.044954
48,538
226
10,539
214.769912
0.819635
0.003193
0
0.057803
0
0.034682
0.858643
0.852193
0
1
0.000248
0
0
1
0.057803
false
0
0.028902
0
0.109827
0.011561
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
6
f548c78fed1e05d760919d7175d3eb5e65753c5a
51
py
Python
pypgdelta/__init__.py
SindreOsnes/pypgdelta
00234903a4e3c1c61ac5cc295133b6a69334fbeb
[ "MIT" ]
null
null
null
pypgdelta/__init__.py
SindreOsnes/pypgdelta
00234903a4e3c1c61ac5cc295133b6a69334fbeb
[ "MIT" ]
null
null
null
pypgdelta/__init__.py
SindreOsnes/pypgdelta
00234903a4e3c1c61ac5cc295133b6a69334fbeb
[ "MIT" ]
null
null
null
from ._delta import get_delta, get_delta_statement
25.5
50
0.862745
8
51
5
0.625
0.4
0
0
0
0
0
0
0
0
0
0
0.098039
51
1
51
51
0.869565
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
1
0
0
6
f54bf5756f7aee72cdfa5de6161ba523abad543d
74
py
Python
tests/chainerx_tests/unit_tests/test_array_index.py
zaltoprofen/chainer
3b03f9afc80fd67f65d5e0395ef199e9506b6ee1
[ "MIT" ]
2
2019-08-12T21:48:04.000Z
2020-08-27T18:04:20.000Z
tests/chainerx_tests/unit_tests/test_array_index.py
zaltoprofen/chainer
3b03f9afc80fd67f65d5e0395ef199e9506b6ee1
[ "MIT" ]
2
2019-05-14T15:45:01.000Z
2019-05-15T07:12:49.000Z
tests/chainerx_tests/unit_tests/test_array_index.py
zaltoprofen/chainer
3b03f9afc80fd67f65d5e0395ef199e9506b6ee1
[ "MIT" ]
2
2019-07-16T00:24:47.000Z
2021-02-26T10:27:27.000Z
import chainerx def test_newaxis(): assert chainerx.newaxis is None
12.333333
35
0.756757
10
74
5.5
0.8
0
0
0
0
0
0
0
0
0
0
0
0.189189
74
5
36
14.8
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.333333
1
0.333333
true
0
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
1
1
0
1
0
1
0
0
6
f5527c6476030d741de9444aca9ca8b40121a470
6,512
py
Python
tests/test_user.py
luandy64/singer-tap-tester
7adca5329325ea850e5fee67be8bbc1bd9fbcde4
[ "Apache-2.0" ]
1
2021-06-30T04:41:56.000Z
2021-06-30T04:41:56.000Z
tests/test_user.py
luandy64/singer-tap-tester
7adca5329325ea850e5fee67be8bbc1bd9fbcde4
[ "Apache-2.0" ]
null
null
null
tests/test_user.py
luandy64/singer-tap-tester
7adca5329325ea850e5fee67be8bbc1bd9fbcde4
[ "Apache-2.0" ]
2
2021-07-09T21:45:51.000Z
2021-07-12T10:39:10.000Z
import unittest from singer_tap_tester import user class TestStreamSelection(unittest.TestCase): def test_select_stream_from_catalog_entry(self): # Arrange catalog_entry = {"tap_stream_id": "stream id name", "stream": "name", "key_properties": [], "schema": {}, "replication_key": "id", "replication_method": "FULL_TABLE", "stream_alias": "alias name", "metadata": [{"breadcrumb": [], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field2"], "metadata": {"other_key": 1}}] } # Act new_catalog_entry = user.select_stream(catalog_entry) # Assert self.assertEqual({"other_key": 1, "selected": True}, new_catalog_entry["metadata"][0]["metadata"]) for mdata in new_catalog_entry["metadata"][1:]: self.assertEqual({"other_key": 1}, mdata["metadata"]) self.assertIsNot(catalog_entry, new_catalog_entry) def test_select_all_streams_in_catalog(self): catalog = { "streams": [ {"tap_stream_id": "stream id name", "stream": "name", "key_properties": [], "schema": {}, "replication_key": "id", "replication_method": "FULL_TABLE", "stream_alias": "alias name", "metadata": [{"breadcrumb": [], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field2"], "metadata": {"other_key": 1}}]}, {"tap_stream_id": "stream id name2", "stream": "name2", "key_properties": [], "schema": {}, "replication_key": "id", "replication_method": "FULL_TABLE", "stream_alias": "alias name2", "metadata": [{"breadcrumb": [], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field2"], "metadata": {"other_key": 1}}]}]} new_catalog = user.select_all_streams(catalog) for stream in new_catalog["streams"]: self.assertEqual({"other_key": 1, "selected": True}, stream["metadata"][0]["metadata"]) for mdata in stream["metadata"][1:]: self.assertEqual({"other_key": 1}, mdata["metadata"]) self.assertIsNot(catalog, new_catalog) class TestFieldSelection(unittest.TestCase): def test_select_field_from_metadata_entry(self): metadata_entry = {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}} new_metadata_entry = user.select_field(metadata_entry) self.assertEqual({"other_key": 1, "selected": True}, new_metadata_entry["metadata"]) self.assertIsNot(metadata_entry, new_metadata_entry) def test_select_all_fields_from_catalog_entry(self): catalog_entry = { "tap_stream_id": "stream id name", "stream": "name", "key_properties": [], "schema": {}, "replication_key": "id", "replication_method": "FULL_TABLE", "stream_alias": "alias name", "metadata": [{"breadcrumb": [], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field2"], "metadata": {"other_key": 1}}]} new_catalog_entry = user.select_all_fields(catalog_entry) self.assertEqual({"other_key": 1}, new_catalog_entry["metadata"][0]["metadata"]) for mdata in new_catalog_entry["metadata"][1:]: self.assertEqual({"other_key": 1, "selected": True}, mdata["metadata"]) self.assertIsNot(catalog_entry, new_catalog_entry) class SelectAllStreamsAndFields(unittest.TestCase): def test_select_all_streams_and_fields_in_catalog(self): catalog = { "streams": [ {"tap_stream_id": "stream id name", "stream": "name", "key_properties": [], "schema": {}, "replication_key": "id", "replication_method": "FULL_TABLE", "stream_alias": "alias name", "metadata": [{"breadcrumb": [], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field2"], "metadata": {"other_key": 1}}]}, {"tap_stream_id": "stream id name2", "stream": "name2", "key_properties": [], "schema": {}, "replication_key": "id", "replication_method": "FULL_TABLE", "stream_alias": "alias name2", "metadata": [{"breadcrumb": [], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field1"], "metadata": {"other_key": 1}}, {"breadcrumb": ["properties", "field2"], "metadata": {"other_key": 1}}]}]} new_catalog = user.select_all_streams_and_fields(catalog) for stream in new_catalog["streams"]: for mdata in stream["metadata"]: self.assertEqual({"other_key": 1, "selected": True}, mdata["metadata"]) self.assertIsNot(catalog, new_catalog)
47.882353
99
0.46852
524
6,512
5.543893
0.101145
0.074355
0.083649
0.111188
0.875043
0.796902
0.774182
0.716007
0.690189
0.67642
0
0.013007
0.386057
6,512
135
100
48.237037
0.713607
0.002764
0
0.743802
0
0
0.274114
0
0
0
0
0
0.107438
1
0.041322
false
0
0.016529
0
0.082645
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
f559acf2dddeafee74b88eaefdac96d65fe44587
4,749
py
Python
server/swagger_server/test/test_account_controller.py
kakwa/certascale
0df8da0f518506500117152fd0e28ee3286949af
[ "MIT" ]
null
null
null
server/swagger_server/test/test_account_controller.py
kakwa/certascale
0df8da0f518506500117152fd0e28ee3286949af
[ "MIT" ]
null
null
null
server/swagger_server/test/test_account_controller.py
kakwa/certascale
0df8da0f518506500117152fd0e28ee3286949af
[ "MIT" ]
2
2020-11-04T03:07:00.000Z
2020-11-05T08:14:33.000Z
# coding: utf-8 from __future__ import absolute_import from flask import json from six import BytesIO from swagger_server.models.account_create_update import AccountCreateUpdate # noqa: E501 from swagger_server.models.account_definition import AccountDefinition # noqa: E501 from swagger_server.models.account_definition_list import AccountDefinitionList # noqa: E501 from swagger_server.models.api_key import ApiKey # noqa: E501 from swagger_server.models.api_key_list import ApiKeyList # noqa: E501 from swagger_server.models.default_error import DefaultError # noqa: E501 from swagger_server.models.default_message import DefaultMessage # noqa: E501 from swagger_server.test import BaseTestCase class TestAccountController(BaseTestCase): """AccountController integration test stubs""" def test_account_create(self): """Test case for account_create """ body = AccountCreateUpdate() response = self.client.open( '/api/v1.0/account', method='POST', data=json.dumps(body), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_account_delete(self): """Test case for account_delete """ response = self.client.open( '/api/v1.0/account/{accountId}'.format(accountId='accountId_example'), method='DELETE', content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_account_get(self): """Test case for account_get """ response = self.client.open( '/api/v1.0/account/{accountId}'.format(accountId='accountId_example'), method='GET', content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_account_list(self): """Test case for account_list """ query_string = [('next_id', 56)] response = self.client.open( '/api/v1.0/account', method='GET', content_type='application/json', query_string=query_string) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_account_update(self): """Test case for account_update """ body = AccountCreateUpdate() response = self.client.open( '/api/v1.0/account/{accountId}'.format(accountId='accountId_example'), method='PUT', data=json.dumps(body), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_apikey_create(self): """Test case for apikey_create """ response = self.client.open( '/api/v1.0/account/{accountId}/apikey/'.format(accountId='accountId_example'), method='POST', content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_apikey_delete(self): """Test case for apikey_delete """ response = self.client.open( '/api/v1.0/account/{accountId}/apikey/{keyId}'.format(accountId='accountId_example', keyId='keyId_example'), method='DELETE', content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_apikey_get(self): """Test case for apikey_get """ response = self.client.open( '/api/v1.0/account/{accountId}/apikey/{keyId}'.format(accountId='accountId_example', keyId='keyId_example'), method='GET', content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) def test_apikey_list(self): """Test case for apikey_list """ query_string = [('next_id', 56)] response = self.client.open( '/api/v1.0/account/{accountId}/apikey/'.format(accountId='accountId_example'), method='GET', content_type='application/json', query_string=query_string) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) if __name__ == '__main__': import unittest unittest.main()
33.680851
120
0.596968
501
4,749
5.491018
0.151697
0.01454
0.039258
0.049073
0.842239
0.737913
0.737913
0.710287
0.648491
0.64631
0
0.023536
0.28427
4,749
140
121
33.921429
0.785819
0.115814
0
0.709302
0
0
0.204057
0.06013
0
0
0
0
0.104651
1
0.104651
false
0
0.139535
0
0.255814
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1931980714f9cb43ffead78fd1e0b008503be073
4,757
py
Python
net/hypernnxd.py
bcol23/HyperIM
c257d1c6296e399e734110d54d0ccd5fc91b5c02
[ "MIT" ]
44
2019-05-27T07:00:36.000Z
2021-12-06T14:05:56.000Z
net/hypernnxd.py
dragon9001/HyperIM
c257d1c6296e399e734110d54d0ccd5fc91b5c02
[ "MIT" ]
6
2019-06-02T16:43:49.000Z
2021-11-17T03:37:19.000Z
net/hypernnxd.py
dragon9001/HyperIM
c257d1c6296e399e734110d54d0ccd5fc91b5c02
[ "MIT" ]
10
2019-06-05T08:20:10.000Z
2021-08-09T11:49:25.000Z
import sys sys.path.append('..') import torch as th import torch.nn as nn import geoopt as gt from util.hyperop import * class hyperRNN(nn.Module): def __init__(self, input_size, hidden_size, d_ball, default_dtype=th.float64): super(hyperRNN, self).__init__() self.input_size = input_size self.hidden_size = hidden_size self.d_ball = d_ball self.default_dtype = default_dtype k = (1 / hidden_size)**0.5 self.w = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.u = gt.ManifoldParameter(gt.ManifoldTensor(input_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.b = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, manifold=gt.PoincareBall()).zero_()) def transition(self, x, h): W_otimes_h = mob_mat_mul_d(self.w, h, self.d_ball) U_otimes_x = mob_mat_mul_d(self.u, x, self.d_ball) Wh_plus_Ux = mob_add(W_otimes_h, U_otimes_x) return mob_add(Wh_plus_Ux, self.b) def init_rnn_state(self, batch_size, hidden_size, cuda_device): return th.zeros((batch_size, hidden_size, d_ball), dtype=self.default_dtype, device=cuda_device) def forward(self, inputs): hidden = self.init_rnn_state(inputs.shape[0], self.hidden_size, inputs.device) outputs = [] for x in inputs.transpose(0, 1): hidden = self.transition(x, hidden) outputs += [hidden] return th.stack(outputs).transpose(0, 1) class GRUCell(nn.Module): def __init__(self, input_size, hidden_size, d_ball): super(GRUCell, self).__init__() self.input_size = input_size self.hidden_size = hidden_size self.d_ball = d_ball k = (1 / hidden_size)**0.5 self.w_z = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.w_r = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.w_h = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.u_z = gt.ManifoldParameter(gt.ManifoldTensor(input_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.u_r = gt.ManifoldParameter(gt.ManifoldTensor(input_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.u_h = gt.ManifoldParameter(gt.ManifoldTensor(input_size, d_ball, hidden_size, d_ball).uniform_(-k, k)) self.b_z = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, manifold=gt.PoincareBall()).zero_()) self.b_r = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, manifold=gt.PoincareBall()).zero_()) self.b_h = gt.ManifoldParameter(gt.ManifoldTensor(hidden_size, d_ball, manifold=gt.PoincareBall()).zero_()) def transition(self, W, h, U, x, hyp_b): W_otimes_h = mob_mat_mul_d(W, h, self.d_ball) U_otimes_x = mob_mat_mul_d(U, x, self.d_ball) Wh_plus_Ux = mob_add(W_otimes_h, U_otimes_x) return mob_add(Wh_plus_Ux, hyp_b) def forward(self, hyp_x, hidden): z = self.transition(self.w_z, hidden, self.u_z, hyp_x, self.b_z) z = th.sigmoid(log_map_zero(z)) r = self.transition(self.w_r, hidden, self.u_r, hyp_x, self.b_r) r = th.sigmoid(log_map_zero(r)) r_point_h = mob_pointwise_prod(hidden, r) h_tilde = self.transition(self.w_h, r_point_h, self.u_r, hyp_x, self.b_h) # h_tilde = th.tanh(log_map_zero(h_tilde)) # non-linearity minus_h_oplus_htilde = mob_add(-hidden, h_tilde) new_h = mob_add(hidden, mob_pointwise_prod(minus_h_oplus_htilde, z)) return new_h class hyperGRU(nn.Module): def __init__(self, input_size, hidden_size, d_ball, default_dtype=th.float64): super(hyperGRU, self).__init__() self.input_size = input_size self.hidden_size = hidden_size self.default_dtype = default_dtype self.d_ball = d_ball self.gru_cell = GRUCell(input_size, hidden_size, d_ball) def init_gru_state(self, batch_size, hidden_size, cuda_device): return th.zeros((batch_size, hidden_size, self.d_ball), dtype=self.default_dtype, device=cuda_device) def forward(self, inputs): hidden = self.init_gru_state(inputs.shape[0], self.hidden_size, inputs.device) outputs = [] for x in inputs.transpose(0, 1): hidden = self.gru_cell(x, hidden) outputs += [hidden] return th.stack(outputs).transpose(0, 1)
40.313559
116
0.655245
707
4,757
4.072136
0.12447
0.062522
0.078152
0.109413
0.815561
0.781869
0.764502
0.741577
0.728378
0.726294
0
0.005459
0.229767
4,757
118
117
40.313559
0.780295
0.011562
0
0.341772
0
0
0.000426
0
0
0
0
0
0
1
0.126582
false
0
0.063291
0.025316
0.316456
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
1933029c46f71bf8ae04fb500313345b1feef0c1
13,380
py
Python
tests/rsocket/test_routing.py
Precognize/rsocket-py
31704d53c232e0c0f53783b9a56117e5bd0645ce
[ "MIT" ]
null
null
null
tests/rsocket/test_routing.py
Precognize/rsocket-py
31704d53c232e0c0f53783b9a56117e5bd0645ce
[ "MIT" ]
null
null
null
tests/rsocket/test_routing.py
Precognize/rsocket-py
31704d53c232e0c0f53783b9a56117e5bd0645ce
[ "MIT" ]
null
null
null
import asyncio import json import pytest from reactivestreams.subscriber import DefaultSubscriber from rsocket.awaitable.awaitable_rsocket import AwaitableRSocket from rsocket.extensions.authentication import Authentication, AuthenticationSimple from rsocket.extensions.composite_metadata import CompositeMetadata from rsocket.extensions.mimetypes import WellKnownMimeTypes from rsocket.helpers import create_future from rsocket.payload import Payload from rsocket.extensions.helpers import route, composite, authenticate_simple from rsocket.routing.request_router import RequestRouter from rsocket.routing.routing_request_handler import RoutingRequestHandler from rsocket.rx_support.rx_rsocket import RxRSocket from rsocket.streams.stream_from_generator import StreamFromGenerator async def test_routed_request_stream_properly_finished(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) def feed(): for x in range(3): yield Payload('Feed Item: {}'.format(x).encode('utf-8')), x == 2 @router.stream('test.path') async def response_stream(payload, composite_metadata): return StreamFromGenerator(feed) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): received_messages = await AwaitableRSocket(client).request_stream( Payload(metadata=composite(route('test.path')))) assert len(received_messages) == 3 assert received_messages[0].data == b'Feed Item: 0' assert received_messages[1].data == b'Feed Item: 1' assert received_messages[2].data == b'Feed Item: 2' async def test_routed_request_response_properly_finished(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.response('test.path') async def response(): return create_future(Payload(b'result')) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): result = await client.request_response(Payload(metadata=composite(route('test.path')))) assert result.data == b'result' async def test_routed_request_response_with_payload_mapper(lazy_pipe): router = RequestRouter(lambda cls, _: json.loads(_.data.decode())) def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.response('test.path') async def response(payload: dict): return create_future(Payload(('Response %s' % payload['key']).encode())) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): result = await client.request_response(Payload(data=json.dumps({'key': 'value'}).encode(), metadata=composite(route('test.path')))) assert result.data == b'Response value' async def test_routed_request_response_properly_finished_accept_payload_only(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.response('test.path') async def response(payload: Payload): return create_future(Payload(('Response %s' % payload.data.decode()).encode())) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): result = await client.request_response(Payload(data=b'request', metadata=composite(route('test.path')))) assert result.data == b'Response request' async def test_routed_request_response_properly_finished_accept_metadata_only(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.response('test.path') async def response(composite_metadata: CompositeMetadata): return create_future(Payload(metadata=composite_metadata.items[0].tags[0])) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): result = await client.request_response(Payload(metadata=composite(route('test.path')))) assert result.metadata == b'test.path' async def test_routed_request_response_properly_finished_accept_payload_and_metadata(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.response('test.path') async def response(payload: Payload, composite_metadata: CompositeMetadata): return create_future(Payload(('Response %s' % payload.data.decode()).encode(), composite_metadata.items[0].tags[0])) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): result = await client.request_response(Payload(data=b'request', metadata=composite(route('test.path')))) assert result.data == b'Response request' assert result.metadata == b'test.path' async def test_routed_fire_and_forget(lazy_pipe): router = RequestRouter() received_data = None received = asyncio.Event() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.fire_and_forget('test.path') async def fire_and_forget(payload): nonlocal received_data received_data = payload.data received.set() async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): client.fire_and_forget(Payload(b'request data', composite(route('test.path')))) await received.wait() assert received_data == b'request data' async def test_routed_request_channel_properly_finished(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) def feed(): for x in range(3): yield Payload('Feed Item: {}'.format(x).encode('utf-8')), x == 2 @router.channel('test.path') async def response_stream(): return StreamFromGenerator(feed), DefaultSubscriber() async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): received_messages = await AwaitableRSocket(client).request_channel( Payload(metadata=composite(route('test.path')))) assert len(received_messages) == 3 assert received_messages[0].data == b'Feed Item: 0' assert received_messages[1].data == b'Feed Item: 1' assert received_messages[2].data == b'Feed Item: 2' async def test_routed_push_metadata(lazy_pipe): router = RequestRouter() received_metadata = None received = asyncio.Event() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.metadata_push('test.path') async def metadata_push(payload): nonlocal received_metadata received_metadata = payload.metadata received.set() async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): metadata = composite(route('test.path')) client.metadata_push(metadata) await received.wait() assert received_metadata == metadata async def test_invalid_request_response(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.response('test.path') async def request_response(): raise Exception('error from server') async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): with pytest.raises(Exception) as exc_info: await client.request_response(Payload(metadata=composite(route('test.path')))) assert str(exc_info.value) == 'error from server' async def test_invalid_request_stream(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.stream('test.path') async def request_stream(): raise Exception('error from server') async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): with pytest.raises(Exception) as exc_info: await RxRSocket(client).request_stream(Payload(metadata=composite(route('test.path')))) assert str(exc_info.value) == 'error from server' async def test_invalid_request_channel(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) @router.channel('test.path') async def request_channel(): raise Exception('error from server') async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): with pytest.raises(Exception) as exc_info: await RxRSocket(client).request_channel(Payload(metadata=composite(route('test.path')))) assert str(exc_info.value) == 'error from server' async def test_no_route_in_request(lazy_pipe): router = RequestRouter() def handler_factory(socket): return RoutingRequestHandler(socket, router) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): with pytest.raises(Exception) as exc_info: await RxRSocket(client).request_channel(Payload(metadata=composite(authenticate_simple('user', 'pass')))) assert str(exc_info.value) == 'No route found in request' async def test_invalid_authentication_in_routing_handler(lazy_pipe): router = RequestRouter() async def authenticate(path: str, authentication: Authentication): if not isinstance(authentication, AuthenticationSimple) or authentication.password != b'pass': raise Exception('Invalid credentials') @router.channel('test.path') async def request_channel(): raise Exception('error from server') def handler_factory(socket): return RoutingRequestHandler(socket, router, authentication_verifier=authenticate) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): with pytest.raises(Exception) as exc_info: await RxRSocket(client).request_channel( Payload(metadata=composite(route('test.path'), authenticate_simple('user', 'wrong_password'))) ) assert str(exc_info.value) == 'Invalid credentials' async def test_valid_authentication_in_routing_handler(lazy_pipe): router = RequestRouter() async def authenticate(path: str, authentication: Authentication): if not isinstance(authentication, AuthenticationSimple) or authentication.password != b'pass': raise Exception('Invalid credentials') @router.response('test.path') async def response(): return create_future(Payload(b'result')) def handler_factory(socket): return RoutingRequestHandler(socket, router, authentication_verifier=authenticate) async with lazy_pipe( client_arguments={'metadata_encoding': WellKnownMimeTypes.MESSAGE_RSOCKET_COMPOSITE_METADATA}, server_arguments={'handler_factory': handler_factory}) as (server, client): result = await RxRSocket(client).request_response(Payload(metadata=composite(route('test.path'), authenticate_simple('user', 'pass')))) assert result.data == b'result'
40.301205
117
0.705381
1,438
13,380
6.335883
0.088317
0.069147
0.02283
0.028098
0.844474
0.803973
0.789924
0.775217
0.77357
0.75579
0
0.002236
0.197907
13,380
331
118
40.422961
0.84672
0
0
0.665254
0
0
0.093647
0
0
0
0
0
0.09322
1
0.072034
false
0.021186
0.063559
0.063559
0.233051
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
194e77b258a47266cd1632cccad75d50b200b91b
89
py
Python
src/eascheduler/executors/__init__.py
spacemanspiff2007/eascheduler
849fe8f43b7bbcb8db3e76c0dda2811eb935cf39
[ "Apache-2.0" ]
null
null
null
src/eascheduler/executors/__init__.py
spacemanspiff2007/eascheduler
849fe8f43b7bbcb8db3e76c0dda2811eb935cf39
[ "Apache-2.0" ]
3
2021-04-08T11:02:31.000Z
2022-02-14T06:07:56.000Z
src/eascheduler/executors/__init__.py
spacemanspiff2007/eascheduler
849fe8f43b7bbcb8db3e76c0dda2811eb935cf39
[ "Apache-2.0" ]
null
null
null
from .executor import AsyncExecutor, AsyncThreadSafeExecutor, ExecutorBase, SyncExecutor
44.5
88
0.876404
7
89
11.142857
1
0
0
0
0
0
0
0
0
0
0
0
0.078652
89
1
89
89
0.95122
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
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
1
0
1
0
1
0
0
6
197618144b1f907626f4f8d029a4950c8e56cec1
837
py
Python
simulation/test.py
ubirch/ubirch-client-go
3bed4359d78c54f4d5611be0c8368a2e2e9bce9b
[ "Apache-2.0" ]
4
2020-04-15T07:06:29.000Z
2021-07-06T00:51:29.000Z
simulation/test.py
ubirch/ubirch-client-go
3bed4359d78c54f4d5611be0c8368a2e2e9bce9b
[ "Apache-2.0" ]
11
2020-04-11T18:05:00.000Z
2021-11-08T11:58:07.000Z
simulation/test.py
ubirch/ubirch-client-go
3bed4359d78c54f4d5611be0c8368a2e2e9bce9b
[ "Apache-2.0" ]
2
2021-03-31T16:15:01.000Z
2021-07-16T08:34:26.000Z
import binascii import hashlib import ecdsa vkb = binascii.a2b_base64("o71ufIY0rP4GXQELZcXlm6t2s/LB29jzGfmheG3q8dJecxrGc/bqIODYcfROx6ofgunyarvG4lFiP+7p18qZqg==") sig = binascii.a2b_base64("WQ/xDF7LVU/CVFzqGwopleefBe5xMLFrnkyEUzE08s0pxZgbtudReaWw70FSPvf2f83kgMvd5gfLNBd1V3AGng==") vk = ecdsa.VerifyingKey.from_string(vkb, curve=ecdsa.curves.NIST256p, hashfunc=hashlib.sha256) vk.verify(signature=sig, data='{"algorithm":"ecdsa-p256v1","created":"2019-10-04T06:35:27.412Z","hwDeviceId":"9a47078c-ff09-478b-a68a-1b3686a2f6f1","pubKey":"o71ufIY0rP4GXQELZcXlm6t2s/LB29jzGfmheG3q8dJecxrGc/bqIODYcfROx6ofgunyarvG4lFiP+7p18qZqg==","pubKeyId":"o71ufIY0rP4GXQELZcXlm6t2s/LB29jzGfmheG3q8dJecxrGc/bqIODYcfROx6ofgunyarvG4lFiP+7p18qZqg==","validNotAfter":"2020-10-03T06:35:27.412Z","validNotBefore":"2019-10-04T06:35:27.412Z"}'.encode())
69.75
433
0.821983
80
837
8.5625
0.6125
0.210219
0.328467
0.363504
0.055474
0.055474
0
0
0
0
0
0.181366
0.038232
837
11
434
76.090909
0.669565
0
0
0
0
0.125
0.695341
0.695341
0
0
0
0
0
1
0
false
0
0.375
0
0.375
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
1
null
0
0
0
0
0
0
0
0
1
0
0
0
0
6
5fea82e44031f6c48c72b4b98de05ba9f29740c9
36
py
Python
lib/__init__.py
johndemlon/notebook-secure
4ba3504fce37f0eb252b9b55e559dae9729031a5
[ "MIT" ]
26
2019-02-22T08:53:16.000Z
2020-11-06T07:15:08.000Z
lib/__init__.py
redbouk/Notebook
a36efd6daf1a584db4a90249f16c1a3e9f14576e
[ "MIT" ]
3
2019-03-09T20:28:04.000Z
2020-03-03T02:06:29.000Z
lib/__init__.py
redbouk/Notebook
a36efd6daf1a584db4a90249f16c1a3e9f14576e
[ "MIT" ]
14
2019-03-07T13:14:14.000Z
2020-11-03T22:59:12.000Z
# Date: 02/07/2019 # Author: Mohamed
18
18
0.694444
6
36
4.166667
1
0
0
0
0
0
0
0
0
0
0
0.258065
0.138889
36
2
19
18
0.548387
0.888889
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
1
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
6
2799a65f8a83757e7a5574e1213aed3814c1a735
9,313
py
Python
mysite/tcgcreator/choices.py
jidpn/tcgcreator_eternal_beta
4a10a5a36eeb161cf35a3488453c00325d78ae83
[ "MIT" ]
null
null
null
mysite/tcgcreator/choices.py
jidpn/tcgcreator_eternal_beta
4a10a5a36eeb161cf35a3488453c00325d78ae83
[ "MIT" ]
null
null
null
mysite/tcgcreator/choices.py
jidpn/tcgcreator_eternal_beta
4a10a5a36eeb161cf35a3488453c00325d78ae83
[ "MIT" ]
null
null
null
from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse from django.db.models import Q from .models import ( Deck, Grave, Hand, Duel, Trigger, Lock, ) from pprint import pprint from .battle_det import battle_det,battle_det_return_org_ai from .duel import DuelObj from time import time def lock_lock(room_number, lock,request): duel = Duel.objects.filter(id=room_number).get() if duel.guest_flag is False: ID1 = -1 else: ID1 = duel.guest_id if duel.guest_flag2 is False: ID2 = -1 else: ID2 = duel.guest_id2 if "ID" in request.COOKIES : ID = request.COOKIES["ID"] else: ID = "" if room_number == 1: if lock.lock_1 is True and time() - lock.time_1 < 20: if duel.is_ai is False: return HttpResponse("waiting") duelobj = DuelObj(room_number) duelobj.duel = duel duelobj.room_number = room_number duelobj.in_execute = False decks = Deck.objects.all() graves = Grave.objects.all() hands = Hand.objects.all() user_1 = duel.user_1 user_2 = duel.user_2 if request.user != user_1 and request.user != user_2: if (ID1 == ID and duel.guest_flag) or (ID2 == ID and duel.guest_flag2): pass else: return HttpResponse("error") if request.user == user_1 or (ID1 == ID and duel.guest_flag): duelobj.user = 1 user = 1 other_user = 2 if request.user == user_2 or (ID2 == ID and duel.guest_flag2): duelobj.user = 2 user = 2 other_user = 1 duelobj.init_all(user, other_user, room_number) return battle_det_return_org_ai( duelobj, decks, graves, hands, user, other_user, choices, room_number ) else: lock.lock_1 = True lock.time_1 = time() lock.save() elif room_number == 2: if lock.lock_2 is True and time() - lock.time_2 < 20: if duel.is_ai is False: return HttpResponse("waiting") duelobj = DuelObj(room_number) duelobj.duel = duel duelobj.room_number = room_number duelobj.in_execute = False decks = Deck.objects.all() graves = Grave.objects.all() hands = Hand.objects.all() user_1 = duel.user_1 user_2 = duel.user_2 if request.user != user_1 and request.user != user_2: return HttpResponse("error") if request.user == user_1: duelobj.user = 1 user = 1 other_user = 2 if request.user == user_2: duelobj.user = 2 user = 2 other_user = 1 duelobj.init_all(user, other_user, room_number) return battle_det_return_org_ai( duelobj, decks, graves, hands, user, other_user, choices, room_number ) else: lock.lock_2 = True lock.time_2 = time() lock.save() elif room_number == 3: if lock.lock_3 is True and time() - lock.time_3 < 20: if duel.is_ai is False: return HttpResponse("waiting") duelobj = DuelObj(room_number) duelobj.duel = duel duelobj.room_number = room_number duelobj.in_execute = False decks = Deck.objects.all() graves = Grave.objects.all() hands = Hand.objects.all() user_1 = duel.user_1 user_2 = duel.user_2 if request.user != user_1 and request.user != user_2: return HttpResponse("error") if request.user == user_1: duelobj.user = 1 user = 1 other_user = 2 if request.user == user_2: duelobj.user = 2 user = 2 other_user = 1 duelobj.init_all(user, other_user, room_number) return battle_det_return_org_ai( duelobj, decks, graves, hands, user, other_user, choices, room_number ) else: lock.lock_3 = True lock.time_3 = time() lock.save() return "OK" def choices(request): room_number = int(request.POST["room_number"]) trigger_id = request.POST["trigger_id"] lock = Lock.objects.get() lock_flag = lock_lock(room_number, lock,request) duel = Duel.objects.filter(id=room_number).get() if duel.guest_flag is False: ID1 = -1 else: ID1 = duel.guest_id if duel.guest_flag2 is False: ID2 = -1 else: ID2 = duel.guest_id2 if "ID" in request.COOKIES : ID = request.COOKIES["ID"] else: ID = "" if lock_flag != "OK": if duel.is_ai == False: return HttpResponse("waiting") else: duelobj = DuelObj(room_number) duelobj.duel = duel duelobj.room_number = room_number duelobj.in_execute = False decks = Deck.objects.all() graves = Grave.objects.all() hands = Hand.objects.all() user_1 = duel.user_1 user_2 = duel.user_2 if request.user != user_1 and request.user != user_2: if (ID1 == ID and duel.guest_flag) or (ID2 == ID and duel.guest_flag2): pass else: return HttpResponse("error") if request.user == user_1 or(ID1 == ID and duel.guest_flag is True): duelobj.user = 1 user = 1 other_user = 2 if request.user == user_2 or(ID2 == ID and duel.guest_flag2 is True): duelobj.user = 2 user = 2 other_user = 1 duelobj.init_all(user, other_user, room_number) return battle_det_return_org_ai( duelobj, decks, graves, hands, user, other_user, choices, room_number ) if duel.user_1 != request.user and duel.user_2 != request.user: if (ID1 == ID and duel.guest_flag) or (ID2 == ID and duel.guest_flag2): pass else: free_lock(room_number, lock) return HttpResponseRedirect(reverse("tcgcreator:watch_battle")) if duel.user_1 == request.user or ( ID1 == ID and duel.guest_flag is True): user = 1 other_user = 2 elif duel.user_2 == request.user or (ID2 == ID and duel.guest_flag2 is True): user = 2 other_user = 1 duelobj = DuelObj(room_number) duelobj.duel = duel duelobj.user = user duelobj.room_number = room_number decks = Deck.objects.all() graves = Grave.objects.all() hands = Hand.objects.all() duelobj.init_all(user, other_user, room_number) duelobj.check_eternal_effect( decks, graves, hands, duel.phase, duel.user_turn, user, other_user ) if duel.in_cost is True: free_lock(room_number, lock) return HttpResponse("error") if duel.user_1 == request.user or ( ID1 == ID and duel.guest_flag is True): if duel.appoint != 1: free_lock(room_number, lock) return HttpResponse("error") duelobj.user = 1 user = 1 other_user = 2 if choices_det(duelobj, trigger_id, request, user) != -1: duelobj.duel.mute = False duelobj.save_all(user, other_user, room_number) free_lock(room_number, lock) return battle_det(request, duelobj) else: free_lock(room_number, lock) return HttpResponse("error") elif duel.user_2 == request.user or (ID2 == ID and duel.guest_flag2 is True): if duel.appoint != 2: free_lock(room_number, lock) return HttpResponse("error") duelobj.user = 2 user = 2 other_user = 1 if choices_det(duelobj, trigger_id, request, user) != -1: duelobj.duel.mute = False duelobj.save_all(user, other_user, room_number) free_lock(room_number, lock) return battle_det(request, duelobj) else: free_lock(room_number, lock) return HttpResponse("error") free_lock(room_number, lock) return HttpResponse("error") def choices_det(duelobj, trigger_id, request, user): if user == 1: other_user = 2 else: other_user = 1 triggers = Trigger.objects.all() trigger = triggers.get(id=trigger_id) if trigger is not None and duelobj.check_launch_trigger( trigger, duelobj.duel.phase, duelobj.duel.user_turn, user, other_user, user): return duelobj.invoke_trigger(trigger, "", "", "", duelobj.user, "") else: return -1 def free_lock(room_number, lock): if room_number == 1: lock.lock_1 = False lock.save() elif room_number == 2: lock.lock_2 = False lock.save() elif room_number == 3: lock.lock_3 = False lock.save()
35.276515
138
0.555567
1,162
9,313
4.262478
0.072289
0.096911
0.048455
0.039572
0.817888
0.788613
0.73612
0.722996
0.684837
0.679184
0
0.023936
0.354021
9,313
263
139
35.410646
0.799368
0
0
0.758893
0
0
0.014388
0.00247
0
0
0
0
0
1
0.01581
false
0.011858
0.031621
0
0.142292
0.003953
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
fd6d162b7347dea5e47fc60e653c4b768e707ee1
106
py
Python
ixconfig/__init__.py
beasteers/ixconfig
409c55f78dcd7ca1712afc9c5af79438ffb008c4
[ "MIT" ]
null
null
null
ixconfig/__init__.py
beasteers/ixconfig
409c55f78dcd7ca1712afc9c5af79438ffb008c4
[ "MIT" ]
null
null
null
ixconfig/__init__.py
beasteers/ixconfig
409c55f78dcd7ca1712afc9c5af79438ffb008c4
[ "MIT" ]
null
null
null
from . import core from .core import * def main(): import fire fire.Fire({'if': Ifc, 'iw': Iwc})
15.142857
37
0.59434
16
106
3.9375
0.625
0.253968
0
0
0
0
0
0
0
0
0
0
0.235849
106
6
38
17.666667
0.777778
0
0
0
0
0
0.037736
0
0
0
0
0
0
1
0.2
true
0
0.6
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
1
0
1
0
1
0
0
6
fd968932c6379c150ee9447a829362b627140307
34
py
Python
auth-function-mesh/__init__.py
HarshCasper/examples
3540b61071082beb1bb423a6969020a6d17f94c9
[ "Apache-2.0" ]
20
2018-12-26T22:41:33.000Z
2022-03-11T16:25:42.000Z
auth-function-mesh/__init__.py
HarshCasper/examples
3540b61071082beb1bb423a6969020a6d17f94c9
[ "Apache-2.0" ]
1
2022-03-08T15:06:09.000Z
2022-03-08T16:28:36.000Z
auth-function-mesh/__init__.py
HarshCasper/examples
3540b61071082beb1bb423a6969020a6d17f94c9
[ "Apache-2.0" ]
9
2019-02-21T23:41:00.000Z
2022-03-12T05:21:49.000Z
from auth import encrypt, decrypt
17
33
0.823529
5
34
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.147059
34
1
34
34
0.965517
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
1
0
0
6
e31184eeebb42ae6c4908f023bab164a5e92cc3a
24
py
Python
quantize/__init__.py
jeffreyzpan/micronet-submission
377d34e4a4a715d2fbac189117d12e8cdc270548
[ "Apache-2.0" ]
2
2019-10-12T02:43:33.000Z
2021-02-20T06:47:08.000Z
quantize/__init__.py
jeffreyzpan/micronet-submission
377d34e4a4a715d2fbac189117d12e8cdc270548
[ "Apache-2.0" ]
null
null
null
quantize/__init__.py
jeffreyzpan/micronet-submission
377d34e4a4a715d2fbac189117d12e8cdc270548
[ "Apache-2.0" ]
null
null
null
from .quantize import *
12
23
0.75
3
24
6
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
0.9
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
1
0
0
6
8b9f1a9a77f2705c87fbfea0eb3ac34b0404c798
33
py
Python
dpmhm/datasets/phmdc/__init__.py
yanncalec/dpmhm
0a242bc8add0ba1463bb2b63b2c15abb80b83fa7
[ "MIT" ]
null
null
null
dpmhm/datasets/phmdc/__init__.py
yanncalec/dpmhm
0a242bc8add0ba1463bb2b63b2c15abb80b83fa7
[ "MIT" ]
null
null
null
dpmhm/datasets/phmdc/__init__.py
yanncalec/dpmhm
0a242bc8add0ba1463bb2b63b2c15abb80b83fa7
[ "MIT" ]
null
null
null
from .phmap_2021 import Phmap2021
33
33
0.878788
5
33
5.6
1
0
0
0
0
0
0
0
0
0
0
0.266667
0.090909
33
1
33
33
0.666667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
6
8bdc83fe9a76732a9728ff4fe9a8e1ad7460df43
1,136
py
Python
simple_rl/tasks/trench/TrenchOOMDPState.py
david-abel/mdps
d8fe6007efb4840377f085a4e35ba89aaa2cdf6d
[ "Apache-2.0" ]
230
2016-08-04T12:59:11.000Z
2022-03-15T04:14:40.000Z
simple_rl/tasks/trench/TrenchOOMDPState.py
samlobel/simple_rl_mbrl
ed868916d06dbf68f4af23bea83b0e852e88df6e
[ "Apache-2.0" ]
36
2016-08-31T19:31:36.000Z
2021-11-17T03:58:24.000Z
simple_rl/tasks/trench/TrenchOOMDPState.py
samlobel/simple_rl_mbrl
ed868916d06dbf68f4af23bea83b0e852e88df6e
[ "Apache-2.0" ]
95
2016-08-31T19:10:45.000Z
2022-03-15T04:15:39.000Z
from simple_rl.mdp.oomdp.OOMDPStateClass import OOMDPState class TrenchOOMDPState(OOMDPState): ''' Class for Trench World States ''' def __init__(self, objects): OOMDPState.__init__(self, objects=objects) def get_agent_x(self): return self.objects["agent"][0]["x"] def get_agent_y(self): return self.objects["agent"][0]["y"] def __hash__(self): state_hash = str(self.get_agent_x()) + str(self.get_agent_y()) + str(self.objects["agent"][0]["dx"] + 1)\ + str(self.objects["agent"][0]["dy"] + 1) + str(self.objects["agent"][0]["dest_x"])\ + str(self.objects["agent"][0]["dest_x"]) + str(self.objects["agent"][0]["dest_y"]) + \ str(self.objects["agent"][0]["has_block"]) + "00" for b in self.objects["block"]: state_hash += str(b["x"]) + str(b["y"]) state_hash += "00" for l in self.objects["lava"]: state_hash += str(l["x"]) + str(l["y"]) return int(state_hash) def __eq__(self, other_trench_state): return hash(self) == hash(other_trench_state)
34.424242
113
0.569542
153
1,136
3.980392
0.267974
0.216749
0.210181
0.223317
0.315271
0.315271
0.121511
0.121511
0.121511
0.121511
0
0.01626
0.242077
1,136
32
114
35.5
0.691057
0.025528
0
0
0
0
0.081893
0
0
0
0
0
0
1
0.238095
false
0
0.047619
0.142857
0.52381
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
1
0
0
0
1
1
0
0
6
477a76f650719ac83a2ff5420bdd230c68017e34
9,256
py
Python
code/check_logs.py
AhmadQasim/MedAL
0ad6064d0d07f23722034b866ba86d93b62517f4
[ "MIT" ]
13
2021-03-11T09:38:19.000Z
2022-03-23T18:30:46.000Z
code/check_logs.py
AhmadQasim/MedAL
0ad6064d0d07f23722034b866ba86d93b62517f4
[ "MIT" ]
4
2021-08-06T05:10:57.000Z
2021-08-13T18:40:23.000Z
code/check_logs.py
AhmadQasim/MedAL
0ad6064d0d07f23722034b866ba86d93b62517f4
[ "MIT" ]
2
2020-12-12T10:46:12.000Z
2022-01-18T02:53:09.000Z
from options.train_options import get_arguments from utils import set_model_name import os root = '/home/ahmad/thesis/med_active_learning/logs_final' arguments = get_arguments() files = os.listdir(root) def main(args): args.dataset = 'isic' seeds = ['9999', '5555', '2323', '6666'] name = set_model_name(args) not_founds = [] for seed in seeds: found = False for file in files: file = f"{file.split('-')[1]}-{file.split('-')[2]}" if file == f'{name}-seed:{seed}': found = True if not found: print(f'{name}-seed:{seed}') not_founds.append(f'{name}-seed:{seed}') if __name__ == '__main__': states = [ ('active_learning', 'entropy_based', None, None, False, None), ('active_learning', 'mc_dropout', None, None, False, None), ('active_learning', 'augmentations_based', None, None, False, None), ('active_learning', 'least_confidence', None, None, False, None), ('active_learning', 'margin_confidence', None, None, False, None), ('active_learning', 'learning_loss', None, None, False, None), ('random_sampling', None, None, None, False, None), ('semi_supervised', None, 'simclr', None, False, None), ('semi_supervised', None, 'simclr_with_al', 'augmentations_based', False, None), ('semi_supervised', None, 'simclr_with_al', 'entropy_based', False, None), ('semi_supervised', None, 'simclr_with_al', 'mc_dropout', False, None), ('semi_supervised', None, 'simclr_with_al', 'least_confidence', False, None), ('semi_supervised', None, 'simclr_with_al', 'margin_confidence', False, None), ('semi_supervised', None, 'simclr_with_al', 'learning_loss', False, None), ('semi_supervised', None, 'auto_encoder', None, False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'augmentations_based', False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'entropy_based', False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'mc_dropout', False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'least_confidence', False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'margin_confidence', False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'learning_loss', False, None), ('semi_supervised', None, 'fixmatch', None, False, None), ('semi_supervised', None, 'fixmatch_with_al', 'augmentations_based', False, None), ('semi_supervised', None, 'fixmatch_with_al', 'entropy_based', False, None), ('semi_supervised', None, 'fixmatch_with_al', 'mc_dropout', False, None), ('semi_supervised', None, 'fixmatch_with_al', 'least_confidence', False, None), ('semi_supervised', None, 'fixmatch_with_al', 'margin_confidence', False, None), ('semi_supervised', None, 'fixmatch_with_al', 'learning_loss', False, None), ('semi_supervised', None, 'pseudo_label', None, False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'augmentations_based', False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'entropy_based', False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'mc_dropout', False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'least_confidence', False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'margin_confidence', False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'learning_loss', False, None), ('active_learning', 'entropy_based', None, None, True, None), ('active_learning', 'mc_dropout', None, None, True, None), ('active_learning', 'augmentations_based', None, None, True, None), ('active_learning', 'least_confidence', None, None, True, None), ('active_learning', 'margin_confidence', None, None, True, None), ('active_learning', 'learning_loss', None, None, True, None), ('random_sampling', None, None, None, True, None), ('semi_supervised', None, 'fixmatch', None, True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'augmentations_based', True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'entropy_based', True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'mc_dropout', True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'least_confidence', True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'margin_confidence', True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'learning_loss', True, 'pretrained'), ('semi_supervised', None, 'fixmatch', None, True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'augmentations_based', True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'entropy_based', True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'mc_dropout', True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'least_confidence', True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'margin_confidence', True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'learning_loss', True, 'simclr'), ('semi_supervised', None, 'fixmatch', None, True, 'autoencoder'), ('semi_supervised', None, 'fixmatch_with_al', 'augmentations_based', True, 'autoencoder'), ('semi_supervised', None, 'fixmatch_with_al', 'entropy_based', True, 'autoencoder'), ('semi_supervised', None, 'fixmatch_with_al', 'mc_dropout', True, 'autoencoder'), ('semi_supervised', None, 'fixmatch_with_al', 'least_confidence', True, 'autoencoder'), ('semi_supervised', None, 'fixmatch_with_al', 'margin_confidence', True, 'autoencoder'), ('semi_supervised', None, 'fixmatch_with_al', 'learning_loss', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label', None, True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'augmentations_based', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'entropy_based', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'mc_dropout', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'least_confidence', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'margin_confidence', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'learning_loss', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label', None, True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'augmentations_based', True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'entropy_based', True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'mc_dropout', True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'least_confidence', True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'margin_confidence', True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'learning_loss', True, 'simclr'), ('semi_supervised', None, 'pseudo_label', None, True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'augmentations_based', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'entropy_based', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'mc_dropout', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'least_confidence', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'margin_confidence', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'learning_loss', True, 'autoencoder'), ('active_learning', 'badge', None, None, False, None), ('semi_supervised', None, 'simclr_with_al', 'badge', False, None), ('semi_supervised', None, 'auto_encoder_with_al', 'badge', False, None), ('semi_supervised', None, 'fixmatch_with_al', 'badge', False, None), ('semi_supervised', None, 'pseudo_label_with_al', 'badge', False, None), ('active_learning', 'badge', None, None, True, None), ('semi_supervised', None, 'fixmatch_with_al', 'badge', True, 'pretrained'), ('semi_supervised', None, 'fixmatch_with_al', 'badge', True, 'simclr'), ('semi_supervised', None, 'fixmatch_with_al', 'badge', True, 'autoencoder'), ('semi_supervised', None, 'pseudo_label_with_al', 'badge', True, 'pretrained'), ('semi_supervised', None, 'pseudo_label_with_al', 'badge', True, 'simclr'), ('semi_supervised', None, 'pseudo_label_with_al', 'badge', True, 'autoencoder'), ] for (m, u, s, us, p, init) in states: arguments.weak_supervision_strategy = m arguments.uncertainty_sampling_method = u arguments.semi_supervised_method = s arguments.semi_supervised_uncertainty_method = us arguments.load_pretrained = p arguments.semi_supervised_init = init main(args=arguments)
66.589928
102
0.659896
1,060
9,256
5.403774
0.081132
0.202863
0.251397
0.130587
0.888094
0.877968
0.849511
0.752095
0.684532
0.256285
0
0.00236
0.175994
9,256
138
103
67.072464
0.748656
0
0
0
0
0
0.486603
0.009723
0
0
0
0
0
1
0.007874
false
0
0.023622
0
0.031496
0.007874
0
0
0
null
1
1
0
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
6
477faa43568f7a231e5aa827e4fc3726952b3407
166
py
Python
tug_diagnosis/tug_diagnosis/scripts/pymbd/util/debug.py
annajohny/sdp
2f66e226fc335ae357001d07fbc74d30ab469509
[ "BSD-3-Clause" ]
null
null
null
tug_diagnosis/tug_diagnosis/scripts/pymbd/util/debug.py
annajohny/sdp
2f66e226fc335ae357001d07fbc74d30ab469509
[ "BSD-3-Clause" ]
null
null
null
tug_diagnosis/tug_diagnosis/scripts/pymbd/util/debug.py
annajohny/sdp
2f66e226fc335ae357001d07fbc74d30ab469509
[ "BSD-3-Clause" ]
null
null
null
import inspect def __line__(): caller = inspect.stack()[1] return int(caller[2]) def __function__(): caller = inspect.stack()[1] return caller[3]
13.833333
31
0.638554
21
166
4.666667
0.571429
0.265306
0.367347
0.387755
0.510204
0
0
0
0
0
0
0.030769
0.216867
166
11
32
15.090909
0.723077
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.714286
0
1
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
1
0
0
0
0
1
0
0
6
9a3d3da91d237ffa1405fe587d955fe93be1d0f2
26
py
Python
src/lib/request/__init__.py
arnulfojr/simple-pos
119c4c52bf62f52004f4b2b031098ed71890d250
[ "MIT" ]
1
2018-09-11T19:32:25.000Z
2018-09-11T19:32:25.000Z
src/lib/request/__init__.py
arnulfojr/simple-pos
119c4c52bf62f52004f4b2b031098ed71890d250
[ "MIT" ]
null
null
null
src/lib/request/__init__.py
arnulfojr/simple-pos
119c4c52bf62f52004f4b2b031098ed71890d250
[ "MIT" ]
null
null
null
from src import is_json
6.5
23
0.769231
5
26
3.8
1
0
0
0
0
0
0
0
0
0
0
0
0.230769
26
3
24
8.666667
0.95
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
1
0
0
6
9a3f2a737298d3a567b223bbe7a2ebb92634505d
73
py
Python
scheduler/schedule/schedule/agent_ip_schedule.py
ike-dai/proxy_scheduler_for_zabbix
e315ade008b333148904e4e2f1410c9ed6cef29e
[ "Apache-2.0" ]
null
null
null
scheduler/schedule/schedule/agent_ip_schedule.py
ike-dai/proxy_scheduler_for_zabbix
e315ade008b333148904e4e2f1410c9ed6cef29e
[ "Apache-2.0" ]
null
null
null
scheduler/schedule/schedule/agent_ip_schedule.py
ike-dai/proxy_scheduler_for_zabbix
e315ade008b333148904e4e2f1410c9ed6cef29e
[ "Apache-2.0" ]
null
null
null
from schedule import Schedule class AgentIpSchedule(Schedule): pass
14.6
32
0.794521
8
73
7.25
0.75
0
0
0
0
0
0
0
0
0
0
0
0.164384
73
4
33
18.25
0.95082
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
1
0
0
6
7bf9c3f53a8571f82794aa61437c0601caaf98d2
29
py
Python
scikit_weak/tests/utils/__init__.py
AndreaCampagner/skweak
7ad621bea1c21c0144e08710efd882a0f82085ef
[ "MIT" ]
1
2021-10-01T13:33:52.000Z
2021-10-01T13:33:52.000Z
scikit_weak/tests/utils/__init__.py
AndreaCampagner/skweak
7ad621bea1c21c0144e08710efd882a0f82085ef
[ "MIT" ]
null
null
null
scikit_weak/tests/utils/__init__.py
AndreaCampagner/skweak
7ad621bea1c21c0144e08710efd882a0f82085ef
[ "MIT" ]
null
null
null
from .test_smoothers import *
29
29
0.827586
4
29
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.103448
29
1
29
29
0.884615
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
1
0
0
6
d020c3184360287fcab99a865c508d35691b4f25
99
py
Python
blockworld/towers/__init__.py
belledon/blockworld
be84bf304e688cdf4418c3990399722f181ad566
[ "MIT" ]
null
null
null
blockworld/towers/__init__.py
belledon/blockworld
be84bf304e688cdf4418c3990399722f181ad566
[ "MIT" ]
null
null
null
blockworld/towers/__init__.py
belledon/blockworld
be84bf304e688cdf4418c3990399722f181ad566
[ "MIT" ]
null
null
null
from .tower import Tower from .empty_tower import EmptyTower from .simple_tower import SimpleTower
24.75
37
0.848485
14
99
5.857143
0.5
0.402439
0
0
0
0
0
0
0
0
0
0
0.121212
99
3
38
33
0.942529
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
1
0
0
6
d031b005e4475df2f8bdd3b65539bf3965c749d2
86
py
Python
usernamerules/simple.py
74wny0wl/entusergenerator
45ae4dc9b8b8675454e3058708e004cfe5db5055
[ "MIT" ]
1
2020-08-26T08:10:08.000Z
2020-08-26T08:10:08.000Z
usernamerules/simple.py
74wny0wl/entusergenerator
45ae4dc9b8b8675454e3058708e004cfe5db5055
[ "MIT" ]
null
null
null
usernamerules/simple.py
74wny0wl/entusergenerator
45ae4dc9b8b8675454e3058708e004cfe5db5055
[ "MIT" ]
null
null
null
def simple(user_data, with_separator=''): return [with_separator.join(user_data)]
28.666667
43
0.755814
12
86
5.083333
0.666667
0.262295
0
0
0
0
0
0
0
0
0
0
0.104651
86
2
44
43
0.792208
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
1
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
6
d075b8b34c28e3ff6b568db2097f22671e8c7b65
49
py
Python
speech_feature_extraction/__init__.py
RyoOzaki/SpeechFeatureExtraction
e7ab0229ac0faf241c0e6445f6b6135fed8875b1
[ "MIT" ]
null
null
null
speech_feature_extraction/__init__.py
RyoOzaki/SpeechFeatureExtraction
e7ab0229ac0faf241c0e6445f6b6135fed8875b1
[ "MIT" ]
null
null
null
speech_feature_extraction/__init__.py
RyoOzaki/SpeechFeatureExtraction
e7ab0229ac0faf241c0e6445f6b6135fed8875b1
[ "MIT" ]
null
null
null
from .speech_feature_extraction import Extractor
24.5
48
0.897959
6
49
7
1
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
1
0
0
6
d0a008047bf4f36bad7ffd8d4d38fe21882b5af6
175
py
Python
questionbank/dashboards/tests/test_urls.py
SyafiqTermizi/questionbank
33e58db1a1610a85bd30a85d2f52e819bc27058b
[ "MIT" ]
1
2018-04-17T23:58:46.000Z
2018-04-17T23:58:46.000Z
questionbank/dashboards/tests/test_urls.py
SyafiqTermizi/questionbank
33e58db1a1610a85bd30a85d2f52e819bc27058b
[ "MIT" ]
8
2019-12-04T23:08:00.000Z
2022-02-13T22:48:26.000Z
questionbank/dashboards/tests/test_urls.py
SyafiqTermizi/questionbank
33e58db1a1610a85bd30a85d2f52e819bc27058b
[ "MIT" ]
null
null
null
from django.urls import reverse, resolve def test_dashboard(): assert reverse('dashboards:dashboard') == '/' assert resolve('/').view_name == 'dashboards:dashboard'
25
59
0.708571
19
175
6.421053
0.684211
0.245902
0
0
0
0
0
0
0
0
0
0
0.142857
175
6
60
29.166667
0.813333
0
0
0
0
0
0.24
0
0
0
0
0
0.5
1
0.25
true
0
0.25
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
1
0
1
1
0
0
0
0
0
0
6
d0a5f4005929512d97e15c9614f83b545a0d3356
100
py
Python
bugbuzz/packages/__init__.py
timgates42/bugbuzz-python
f1ba1ba8b6c22a60f3baac57ebfc2683bb2ec117
[ "MIT" ]
98
2015-05-17T23:22:46.000Z
2017-02-13T01:16:43.000Z
bugbuzz/packages/__init__.py
timgates42/bugbuzz-python
f1ba1ba8b6c22a60f3baac57ebfc2683bb2ec117
[ "MIT" ]
4
2015-05-24T02:34:35.000Z
2015-12-15T05:09:31.000Z
bugbuzz/packages/__init__.py
timgates42/bugbuzz-python
f1ba1ba8b6c22a60f3baac57ebfc2683bb2ec117
[ "MIT" ]
4
2015-05-24T00:08:48.000Z
2016-12-27T16:21:11.000Z
from __future__ import absolute_import from . import pubnub # noqa from . import requests # noqa
20
38
0.77
13
100
5.538462
0.538462
0.277778
0
0
0
0
0
0
0
0
0
0
0.19
100
4
39
25
0.888889
0.09
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
1
0
0
6
d0d53a7328b2ffb72cca08c6ec0e07f589144d18
1,240
py
Python
commands/editto.py
deathaxe/FileManager
08becc98f9e71f1d76c096b84708c927eaee9eba
[ "MIT" ]
null
null
null
commands/editto.py
deathaxe/FileManager
08becc98f9e71f1d76c096b84708c927eaee9eba
[ "MIT" ]
null
null
null
commands/editto.py
deathaxe/FileManager
08becc98f9e71f1d76c096b84708c927eaee9eba
[ "MIT" ]
null
null
null
# -*- encoding: utf-8 -*- from .fmcommand import FmWindowCommand class FmEditToTheRightCommand(FmWindowCommand): def run(self, files=None): self.window.set_layout( { "cols": [0.0, 0.5, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1], [1, 0, 2, 1]], } ) for file in files or [self.window.active_view().file_name()]: self.window.set_view_index(self.window.open_file(file), 1, 0) self.window.focus_group(1) def is_enabled(self, files=None): return (files is None or len(files) >= 1) and self.window.active_group() != 1 class FmEditToTheLeftCommand(FmWindowCommand): def run(self, files=None): self.window.set_layout( { "cols": [0.0, 0.5, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1], [1, 0, 2, 1]], } ) for file in files or [self.window.active_view().file_name()]: self.window.set_view_index(self.window.open_file(file), 0, 0) self.window.focus_group(0) def is_enabled(self, files=None): return (files is None or len(files) >= 1) and self.window.active_group() != 1
31.794872
85
0.53629
169
1,240
3.828402
0.242604
0.185471
0.080371
0.07728
0.837713
0.772798
0.772798
0.772798
0.772798
0.772798
0
0.054715
0.307258
1,240
38
86
32.631579
0.698487
0.018548
0
0.551724
0
0
0.021399
0
0
0
0
0
0
1
0.137931
false
0
0.034483
0.068966
0.310345
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
ef763d4f189a61a9411206bc2554a2ee4b9f65be
78
py
Python
en_transformer/__init__.py
dumpmemory/En-transformer
c99e6782e531efddac61e8081cfd431372bb4319
[ "MIT" ]
108
2021-02-27T06:50:43.000Z
2022-03-18T09:03:24.000Z
en_transformer/__init__.py
SuperXiang/En-transformer
273f72f8eb66fcccadaf8b6e72d6bbc091f55862
[ "MIT" ]
7
2021-03-21T11:23:42.000Z
2022-03-29T20:45:33.000Z
en_transformer/__init__.py
SuperXiang/En-transformer
273f72f8eb66fcccadaf8b6e72d6bbc091f55862
[ "MIT" ]
17
2021-02-27T13:17:53.000Z
2022-03-29T14:15:38.000Z
from en_transformer.en_transformer import EquivariantAttention, EnTransformer
39
77
0.910256
8
78
8.625
0.75
0.376812
0
0
0
0
0
0
0
0
0
0
0.064103
78
1
78
78
0.945205
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
1
0
0
6
ef7a5ac15249b45a61d669538cdcc7a0074fb660
42
py
Python
src/DataPreprocessingMethods.py
psuto/BayesNet4Nephrology
da606b1191b9445fc90308777daaed9a77a6cc99
[ "AFL-1.1" ]
1
2021-06-22T18:05:56.000Z
2021-06-22T18:05:56.000Z
src/DataPreprocessingMethods.py
psuto/BayesNet4Nephrology
da606b1191b9445fc90308777daaed9a77a6cc99
[ "AFL-1.1" ]
null
null
null
src/DataPreprocessingMethods.py
psuto/BayesNet4Nephrology
da606b1191b9445fc90308777daaed9a77a6cc99
[ "AFL-1.1" ]
null
null
null
class DataPreprocessingMethods(): pass
21
33
0.785714
3
42
11
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
42
2
34
21
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
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
1
1
0
0
0
0
0
6
4bd3ca84f9d276f82bdea9f98b65373a7fa19477
9,732
py
Python
applications/DEMApplication/tests/test_DEM_search_tolerance.py
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
778
2017-01-27T16:29:17.000Z
2022-03-30T03:01:51.000Z
applications/DEMApplication/tests/test_DEM_search_tolerance.py
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
6,634
2017-01-15T22:56:13.000Z
2022-03-31T15:03:36.000Z
applications/DEMApplication/tests/test_DEM_search_tolerance.py
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
224
2017-02-07T14:12:49.000Z
2022-03-06T23:09:34.000Z
import os import KratosMultiphysics from KratosMultiphysics import Logger Logger.GetDefaultOutput().SetSeverity(Logger.Severity.WARNING) import KratosMultiphysics.KratosUnittest as KratosUnittest import KratosMultiphysics.DEMApplication.DEM_analysis_stage import numpy as np import auxiliary_functions_for_tests this_working_dir_backup = os.getcwd() def GetFilePath(fileName): return os.path.join(os.path.dirname(os.path.realpath(__file__)), fileName) class DEM3D_SearchToleranceMain(KratosMultiphysics.DEMApplication.DEM_analysis_stage.DEMAnalysisStage, KratosUnittest.TestCase): def Initialize(self): super().Initialize() for node in self.spheres_model_part.Nodes: self.initial_normal_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Z) @classmethod def GetMainPath(self): return os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_search_tolerance") def GetProblemNameWithPath(self): return os.path.join(self.main_path, self.DEM_parameters["problem_name"].GetString()) def FinalizeSolutionStep(self): super().FinalizeSolutionStep() for node in self.spheres_model_part.Nodes: #reference data with freq=1 searchtolerance=0.0 if node.Id == 2: tol = 1.0e-15 if np.isclose(self.time, 0.02, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -5.86502139707038 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.115, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -3.3859516373258987 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.22, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -0.5929799879392164 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) def Finalize(self): self.procedures.RemoveFoldersWithResults(str(self.main_path), str(self.problem_name), '') super().Finalize() class DEM3D_SearchTolerance1(DEM3D_SearchToleranceMain): def FinalizeSolutionStep(self): KratosMultiphysics.DEMApplication.DEM_analysis_stage.DEMAnalysisStage.FinalizeSolutionStep(self) for node in self.spheres_model_part.Nodes: if node.Id == 2: tol = 1.0e-15 if np.isclose(self.time, 0.02, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -5.8654458179811835 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.115, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -3.3861319639727263 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.22, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -0.594495289987086 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) class DEM3D_SearchTolerance2(DEM3D_SearchToleranceMain): def FinalizeSolutionStep(self): KratosMultiphysics.DEMApplication.DEM_analysis_stage.DEMAnalysisStage.FinalizeSolutionStep(self) for node in self.spheres_model_part.Nodes: if node.Id == 2: tol = 1.0e-15 if np.isclose(self.time, 0.02, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -5.865445816566027 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.115, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -3.386128017385994 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.22, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -0.5941551772701182 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) class DEM3D_SearchTolerance3(DEM3D_SearchToleranceMain): def FinalizeSolutionStep(self): KratosMultiphysics.DEMApplication.DEM_analysis_stage.DEMAnalysisStage.FinalizeSolutionStep(self) for node in self.spheres_model_part.Nodes: if node.Id == 2: tol = 1.0e-15 if np.isclose(self.time, 0.02, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -5.86502139707038 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.115, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -3.3859516373258987 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) if np.isclose(self.time, 0.22, rtol=0.0, atol=1e-06): y_vel = node.GetSolutionStepValue(KratosMultiphysics.VELOCITY_Y) print(self.time, y_vel) y_vel_ref = -0.5929799879392164 self.assertAlmostEqual(y_vel, y_vel_ref, delta=tol) class TestSearchTolerance(KratosUnittest.TestCase): @classmethod def test_SearchA(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_search_tolerance") parameters_file_name = os.path.join(path, "ProjectParametersDEM.json") with open(parameters_file_name,'r') as parameter_file: project_parameters = KratosMultiphysics.Parameters(parameter_file.read()) project_parameters["SearchTolerance"].SetDouble(0.0) project_parameters["search_tolerance_against_walls"].SetDouble(0.0) project_parameters["NeighbourSearchFrequency"].SetInt(1) model = KratosMultiphysics.Model() auxiliary_functions_for_tests.CreateAndRunStageInSelectedNumberOfOpenMPThreads(DEM3D_SearchToleranceMain, model, project_parameters, auxiliary_functions_for_tests.GetHardcodedNumberOfThreads()) @classmethod def test_SearchB(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_search_tolerance") parameters_file_name = os.path.join(path, "ProjectParametersDEM.json") with open(parameters_file_name,'r') as parameter_file: project_parameters = KratosMultiphysics.Parameters(parameter_file.read()) project_parameters["SearchTolerance"].SetDouble(0.0) project_parameters["search_tolerance_against_walls"].SetDouble(0.0) project_parameters["NeighbourSearchFrequency"].SetInt(10) model = KratosMultiphysics.Model() auxiliary_functions_for_tests.CreateAndRunStageInSelectedNumberOfOpenMPThreads(DEM3D_SearchTolerance1, model, project_parameters, auxiliary_functions_for_tests.GetHardcodedNumberOfThreads()) @classmethod def test_SearchC(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_search_tolerance") parameters_file_name = os.path.join(path, "ProjectParametersDEM.json") with open(parameters_file_name,'r') as parameter_file: project_parameters = KratosMultiphysics.Parameters(parameter_file.read()) project_parameters["SearchTolerance"].SetDouble(1e-04) project_parameters["search_tolerance_against_walls"].SetDouble(1e-04) project_parameters["NeighbourSearchFrequency"].SetInt(20) model = KratosMultiphysics.Model() auxiliary_functions_for_tests.CreateAndRunStageInSelectedNumberOfOpenMPThreads(DEM3D_SearchTolerance2, model, project_parameters, auxiliary_functions_for_tests.GetHardcodedNumberOfThreads()) @classmethod def test_SearchD(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_search_tolerance") parameters_file_name = os.path.join(path, "ProjectParametersDEM.json") with open(parameters_file_name,'r') as parameter_file: project_parameters = KratosMultiphysics.Parameters(parameter_file.read()) project_parameters["SearchTolerance"].SetDouble(1e-03) project_parameters["search_tolerance_against_walls"].SetDouble(1e-03) project_parameters["NeighbourSearchFrequency"].SetInt(20) model = KratosMultiphysics.Model() auxiliary_functions_for_tests.CreateAndRunStageInSelectedNumberOfOpenMPThreads(DEM3D_SearchTolerance3, model, project_parameters, auxiliary_functions_for_tests.GetHardcodedNumberOfThreads()) if __name__ == "__main__": Logger.GetDefaultOutput().SetSeverity(Logger.Severity.WARNING) KratosUnittest.main()
50.42487
201
0.674887
1,074
9,732
5.866853
0.125698
0.038089
0.019045
0.030471
0.848119
0.827012
0.799714
0.799714
0.759562
0.725599
0
0.048702
0.232018
9,732
192
202
50.6875
0.794354
0.004727
0
0.690323
0
0
0.052142
0.043469
0
0
0
0
0.077419
1
0.083871
false
0
0.045161
0.019355
0.180645
0.077419
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
3246f80989348444fba12f98750b12f0fe4f8bbe
108
py
Python
tests/__init__.py
YPlan/yplan-logging-utils
b029ddc2fe7e3ecb9d8b77a48802eebe527c7e5d
[ "0BSD" ]
null
null
null
tests/__init__.py
YPlan/yplan-logging-utils
b029ddc2fe7e3ecb9d8b77a48802eebe527c7e5d
[ "0BSD" ]
2
2016-01-22T11:26:31.000Z
2017-02-01T20:18:14.000Z
tests/__init__.py
YPlan/yplan-logging-utils
b029ddc2fe7e3ecb9d8b77a48802eebe527c7e5d
[ "0BSD" ]
1
2016-09-19T11:24:05.000Z
2016-09-19T11:24:05.000Z
# -*- encoding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals
36
82
0.787037
13
108
6
0.923077
0
0
0
0
0
0
0
0
0
0
0.010309
0.101852
108
2
83
54
0.793814
0.203704
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
1
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
1
0
6
3294116ab8155fac2054912ff44f1e2171d6c009
1,109
py
Python
gullveig/server/date.py
Addvilz/gullveig
6ac5e66062c1b5ea8ad7c66f69be9e3d99ac0825
[ "Apache-2.0" ]
8
2020-08-24T14:53:14.000Z
2021-03-16T03:58:01.000Z
gullveig/server/date.py
Addvilz/gullveig
6ac5e66062c1b5ea8ad7c66f69be9e3d99ac0825
[ "Apache-2.0" ]
6
2020-08-25T13:19:02.000Z
2021-02-21T21:55:34.000Z
gullveig/server/date.py
Addvilz/gullveig
6ac5e66062c1b5ea8ad7c66f69be9e3d99ac0825
[ "Apache-2.0" ]
null
null
null
from datetime import datetime, timedelta def ts_current_second_start(ts: int) -> int: return ts - (ts % 1000) def ts_current_minute_start(ts: int) -> int: return ts - (ts % 60000) def ts_current_hour_start(ts: int) -> int: return ts - (ts % 3600000) def ts_last_monday_start(ts: int) -> int: dt = datetime.fromtimestamp(ts / 1000.0) dt = dt - timedelta(days=dt.weekday() % 7) dt = dt.replace(hour=0, minute=0, second=0, microsecond=0) return round(dt.timestamp() * 1000) def ts_current_day_start(ts: int) -> int: dt = datetime.fromtimestamp(ts / 1000.0) dt = dt.replace(hour=0, minute=0, second=0, microsecond=0) return round(dt.timestamp() * 1000) def ts_current_month_start(ts: int) -> int: dt = datetime.fromtimestamp(ts / 1000.0) dt = dt.replace(day=1, hour=0, minute=0, second=0, microsecond=0) return round(dt.timestamp() * 1000) def ts_current_year_start(ts: int) -> int: dt = datetime.fromtimestamp(ts / 1000.0) dt = dt.replace(month=1, day=1, hour=0, minute=0, second=0, microsecond=0) return round(dt.timestamp() * 1000)
28.435897
78
0.66817
174
1,109
4.137931
0.183908
0.048611
0.097222
0.126389
0.779167
0.779167
0.779167
0.683333
0.683333
0.683333
0
0.079734
0.185753
1,109
38
79
29.184211
0.717608
0
0
0.416667
0
0
0
0
0
0
0
0
0
1
0.291667
false
0
0.041667
0.125
0.625
0
0
0
0
null
0
0
0
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
1
0
0
0
1
1
0
0
6
32a11e34f9df7bee03f97ec66274f548f6a53ce6
20,582
py
Python
sfa_api/tests/test_api.py
lboeman/solarforecastarbiter-api
9df598b5c638c3e36d0649e08e955b3ddc1b542d
[ "MIT" ]
7
2018-12-07T22:05:36.000Z
2020-05-03T03:20:50.000Z
sfa_api/tests/test_api.py
lboeman/solarforecastarbiter-api
9df598b5c638c3e36d0649e08e955b3ddc1b542d
[ "MIT" ]
220
2018-11-01T23:33:19.000Z
2021-12-02T21:06:38.000Z
sfa_api/tests/test_api.py
lboeman/solarforecastarbiter-api
9df598b5c638c3e36d0649e08e955b3ddc1b542d
[ "MIT" ]
3
2018-10-31T20:55:07.000Z
2021-11-10T22:51:43.000Z
"""Tests that API maintains proper state after interactions """ import pytest import re import uuid from sfa_api.conftest import (VALID_SITE_JSON, VALID_OBS_JSON, VALID_FORECAST_JSON, VALID_CDF_FORECAST_JSON, BASE_URL) invalid_json = {'invalid': 'garbage'} @pytest.fixture() def auth_header(auth_token): return {'Authorization': f'Bearer {auth_token}'} def get_obs_list(sql_api, auth_header): get_obs = sql_api.get('/observations/', base_url=BASE_URL, headers=auth_header) return get_obs.get_json() def get_cdf_fx_list(sql_api, auth_header): get_cdf_fx = sql_api.get('/forecasts/cdf/', headers=auth_header, base_url=BASE_URL) return get_cdf_fx.get_json() def get_fx_list(sql_api, auth_header): get_fx = sql_api.get('/forecasts/single/', headers=auth_header, base_url=BASE_URL) return get_fx.get_json() def get_site_list(sql_api, auth_header): get_sites = sql_api.get('/sites/', headers=auth_header, base_url=BASE_URL) return get_sites.get_json() def get_site_fx(sql_api, auth_header, site_id): site_fx = sql_api.get(f'/sites/{site_id}/forecasts/single', headers=auth_header, base_url=BASE_URL) return site_fx.get_json() def get_site_cdf_fx(sql_api, auth_header, site_id): site_cdf_fx = sql_api.get(f'/sites/{site_id}/forecasts/cdf', headers=auth_header, base_url=BASE_URL) return site_cdf_fx.get_json() def get_site_obs(sql_api, auth_header, site_id): site_obs = sql_api.get(f'/sites/{site_id}/observations', headers=auth_header, base_url=BASE_URL) return site_obs.get_json() def test_create_delete_site(sql_api, auth_header): post = sql_api.post('/sites/', base_url=BASE_URL, headers=auth_header, json=VALID_SITE_JSON) assert post.status_code == 201 new_site_id = post.data.decode('utf-8') new_site_url = post.headers['Location'] get = sql_api.get(new_site_url, headers=auth_header) assert get.status_code == 200 new_site = get.get_json() assert new_site['site_id'] == new_site_id for key, value in VALID_SITE_JSON.items(): if key == 'modeling_parameters': for k, v in VALID_SITE_JSON['modeling_parameters'].items(): assert new_site['modeling_parameters'][k] == v else: assert new_site[key] == value assert new_site in get_site_list(sql_api, auth_header) delete = sql_api.delete(new_site_url, headers=auth_header) assert delete.status_code == 204 assert new_site not in get_site_list(sql_api, auth_header) def test_create_invalid_site(sql_api, auth_header): original_sites_list = get_site_list(sql_api, auth_header) post = sql_api.post('/sites/', headers=auth_header, base_url=BASE_URL, json=invalid_json) assert post.status_code == 400 assert original_sites_list == get_site_list(sql_api, auth_header) def test_create_site_unauthenticated(sql_api): post = sql_api.post('/sites/', base_url=BASE_URL, json=VALID_SITE_JSON) assert post.status_code == 401 def test_create_site_unauthorized(sql_api, auth_header): # 404 pass def test_create_delete_observation(sql_api, auth_header, mocked_queuing, obs_vals, startend): post = sql_api.post('/observations/', headers=auth_header, base_url=BASE_URL, json=VALID_OBS_JSON) assert post.status_code == 201 new_obs_id = post.data.decode('utf-8') new_obs_links_url = post.headers['Location'] get_links = sql_api.get(new_obs_links_url, headers=auth_header) assert get_links.status_code == 200 new_obs_links = get_links.get_json() new_obs_url = new_obs_links['_links']['metadata'] get_obs = sql_api.get(new_obs_url, headers=auth_header) assert get_obs.status_code == 200 new_obs = get_obs.get_json() assert new_obs['observation_id'] == new_obs_id for key, value in VALID_OBS_JSON.items(): assert new_obs[key] == value assert new_obs in get_obs_list(sql_api, auth_header) assert new_obs in get_site_obs(sql_api, auth_header, new_obs['site_id']) # Post json values to the observation obs_vals['quality_flag'] = 0 obs_vals['timestamp'] = obs_vals.index json_values = obs_vals.to_dict(orient='records') post_values = sql_api.post(f'/observations/{new_obs_id}/values', headers=auth_header, base_url=BASE_URL, json={'values': json_values}) assert post_values.status_code == 201 get_values = sql_api.get(f'/observations/{new_obs_id}/values{startend}', base_url=BASE_URL, headers={'Accept': 'application/json', **auth_header}) assert get_values.status_code == 200 # post csv_values to the observation obs_vals['quality_flag'] = 0 csv_values = obs_vals.to_csv() post_values = sql_api.post(f'/observations/{new_obs_id}/values', base_url=BASE_URL, headers={'Content-Type': 'text/csv', **auth_header}, data=csv_values) assert post_values.status_code == 201 get_values = sql_api.get(f'/observations/{new_obs_id}/values{startend}', base_url=BASE_URL, headers={'Accept': 'text/csv', **auth_header}) assert get_values.status_code == 200 delete = sql_api.delete(new_obs_links_url, headers=auth_header) assert delete.status_code == 204 assert new_obs not in get_obs_list(sql_api, auth_header) assert new_obs not in get_site_obs(sql_api, auth_header, new_obs['site_id']) get_values = sql_api.get(f'/observations/{new_obs_id}/values{startend}', base_url=BASE_URL, headers={'Accept': 'text/csv', **auth_header}) assert get_values.status_code == 404 def test_create_observation_invalid(sql_api, auth_header): original_obs_list = get_obs_list(sql_api, auth_header) post = sql_api.post('/observations/', headers=auth_header, base_url=BASE_URL, json={'invalid': 'garbage'}) assert post.status_code == 400 assert original_obs_list == get_obs_list(sql_api, auth_header) def test_create_observation_unauthorized(sql_api, auth_header): pass def test_create_observation_site_dne(sql_api, auth_header, missing_id): observations = get_obs_list(sql_api, auth_header) obs_json = VALID_OBS_JSON.copy() obs_json.update({'site_id': missing_id}) post = sql_api.post('/observations/', headers=auth_header, base_url=BASE_URL, json=obs_json) assert post.status_code == 404 assert observations == get_obs_list(sql_api, auth_header) def test_create_delete_forecast(sql_api, auth_header, fx_vals, startend): post = sql_api.post('/forecasts/single/', headers=auth_header, base_url=BASE_URL, json=VALID_FORECAST_JSON) assert post.status_code == 201 new_fx_id = post.data.decode('utf-8') new_fx_links_url = post.headers['Location'] get_links = sql_api.get(new_fx_links_url, headers=auth_header) assert get_links.status_code == 200 new_fx_links = get_links.get_json() new_fx_url = new_fx_links['_links']['metadata'] get_fx = sql_api.get(new_fx_url, headers=auth_header) assert get_fx.status_code == 200 new_fx = get_fx.get_json() assert new_fx['forecast_id'] == new_fx_id for key, value in VALID_FORECAST_JSON.items(): assert new_fx[key] == value assert new_fx in get_fx_list(sql_api, auth_header) assert new_fx in get_site_fx(sql_api, auth_header, new_fx['site_id']) # Post json values to the forecast fx_vals['timestamp'] = fx_vals.index json_values = fx_vals.to_dict(orient='records') post_values = sql_api.post( f'/forecasts/single/{new_fx_id}/values', headers=auth_header, base_url=BASE_URL, json={'values': json_values}) assert post_values.status_code == 201 # request json values get_values = sql_api.get(f'/forecasts/single/{new_fx_id}/values{startend}', base_url=BASE_URL, headers={'Accept': 'application/json', **auth_header}) assert get_values.status_code == 200 # post csv_values to the forecasts csv_values = fx_vals.to_csv() post_values = sql_api.post(f'/forecasts/single/{new_fx_id}/values', base_url=BASE_URL, headers={'Content-Type': 'text/csv', **auth_header}, data=csv_values) assert post_values.status_code == 201 # request csv values get_values = sql_api.get(f'/forecasts/single/{new_fx_id}/values{startend}', base_url=BASE_URL, headers={'Accept': 'text/csv', **auth_header}) assert get_values.status_code == 200 delete = sql_api.delete(new_fx_links_url, headers=auth_header) assert delete.status_code == 204 assert new_fx not in get_fx_list(sql_api, auth_header) assert new_fx not in get_site_fx(sql_api, auth_header, new_fx['site_id']) get_values = sql_api.get( f'/forecasts/single/{new_fx_id}/values{startend}', base_url=BASE_URL, headers={'Accept': 'text/csv', **auth_header}) assert get_values.status_code == 404 def test_create_forecast_invalid(sql_api, auth_header): original_forecast_list = get_fx_list(sql_api, auth_header) post = sql_api.post('/forecasts/single/', headers=auth_header, base_url=BASE_URL, json=invalid_json) assert post.status_code == 400 assert original_forecast_list == get_fx_list(sql_api, auth_header) def test_create_forecast_unauthorized(sql_api, auth_header): pass def test_post_forecast_site_dne(sql_api, auth_header, missing_id): forecasts = get_fx_list(sql_api, auth_header) fx_json = VALID_FORECAST_JSON.copy() fx_json.update({'site_id': missing_id}) post = sql_api.post('/forecasts/single/', headers=auth_header, base_url=BASE_URL, json=fx_json) assert post.status_code == 404 assert forecasts == get_fx_list(sql_api, auth_header) def test_create_delete_cdf_forecast(sql_api, auth_header, fx_vals, startend): post = sql_api.post('/forecasts/cdf/', headers=auth_header, base_url=BASE_URL, json=VALID_CDF_FORECAST_JSON) assert post.status_code == 201 new_cdf_fx_id = post.data.decode('utf-8') new_cdf_fx_url = post.headers['Location'] get_cdf_fx = sql_api.get(new_cdf_fx_url, headers=auth_header) assert get_cdf_fx.status_code == 200 new_cdf_fx = get_cdf_fx.get_json() assert new_cdf_fx['forecast_id'] == new_cdf_fx_id for key, value in VALID_CDF_FORECAST_JSON.items(): if key == 'constant_values': continue else: assert new_cdf_fx[key] == value assert new_cdf_fx in get_cdf_fx_list(sql_api, auth_header) assert new_cdf_fx in get_site_cdf_fx(sql_api, auth_header, new_cdf_fx['site_id']) for value in new_cdf_fx['constant_values']: static_vals = VALID_CDF_FORECAST_JSON['constant_values'] assert value['constant_value'] in static_vals get_const = sql_api.get( f'/forecasts/cdf/single/{value["forecast_id"]}', headers=auth_header, base_url=BASE_URL) assert get_const.status_code == 200 get_cdf_const_values = sql_api.get( value['_links']['values'] + startend, headers=auth_header) assert get_cdf_const_values.status_code == 200 # Post values to the forecast fx_vals['timestamp'] = fx_vals.index json_values = fx_vals.to_dict(orient='records') post_values = sql_api.post(value['_links']['values'] + startend, headers=auth_header, json={'values': json_values}) assert post_values.status_code == 201 get_values = sql_api.get(value['_links']['values'] + startend, headers={'Accept': 'application/json', **auth_header}) assert get_values.status_code == 200 delete = sql_api.delete(new_cdf_fx_url, headers=auth_header) assert delete.status_code == 204 assert new_cdf_fx not in get_cdf_fx_list(sql_api, auth_header) assert new_cdf_fx not in get_site_cdf_fx(sql_api, auth_header, new_cdf_fx['site_id']) for value in new_cdf_fx['constant_values']: fx_id = value['forecast_id'] get = sql_api.get(f'/forecasts/cdf/single/{fx_id}', headers=auth_header, base_url=BASE_URL) assert get.status_code == 404 def test_create_cdf_forecast_invalid(sql_api, auth_header): original_cdf_fx_list = get_cdf_fx_list(sql_api, auth_header) post = sql_api.post('/forecasts/cdf/', headers=auth_header, base_url=BASE_URL, json={'invalid': 'garbage'}) assert post.status_code == 400 assert original_cdf_fx_list == get_cdf_fx_list(sql_api, auth_header) def test_create_cdf_forecast_unauthenticated(sql_api): post = sql_api.post('/forecasts/cdf/', base_url=BASE_URL, json=VALID_CDF_FORECAST_JSON) assert post.status_code == 401 def test_create_cdf_forecast_unauthorized(sql_api, auth_header): pass def test_create_cdf_forecast_site_dne(sql_api, auth_header, missing_id): cdf_fx_list = get_cdf_fx_list(sql_api, auth_header) fx_json = VALID_CDF_FORECAST_JSON.copy() fx_json.update({'site_id': missing_id}) post = sql_api.post('/forecasts/cdf/', headers=auth_header, base_url=BASE_URL, json=fx_json) assert post.status_code == 404 assert cdf_fx_list == get_cdf_fx_list(sql_api, auth_header) def test_sequence(sql_api, auth_header): # Create a site post = sql_api.post('/sites/', headers=auth_header, base_url=BASE_URL, json=VALID_SITE_JSON) assert post.status_code == 201 new_site_id = post.data.decode('utf-8') new_site_url = post.headers['Location'] get = sql_api.get(new_site_url, headers=auth_header) assert get.status_code == 200 new_site = get.get_json() # Create obs at site obs_json = VALID_OBS_JSON.copy() obs_json['site_id'] = new_site_id post = sql_api.post('/observations/', headers=auth_header, base_url=BASE_URL, json=obs_json) assert post.status_code == 201 new_obs_id = post.data.decode('utf-8') new_obs_links_url = post.headers['Location'] get_links = sql_api.get(new_obs_links_url, headers=auth_header) assert get_links.status_code == 200 new_obs_links = get_links.get_json() new_obs_url = new_obs_links['_links']['metadata'] get_obs = sql_api.get(new_obs_url, headers=auth_header) assert get_obs.status_code == 200 new_obs = get_obs.get_json() # Create FX at site fx_json = VALID_FORECAST_JSON.copy() fx_json['site_id'] = new_site_id post = sql_api.post('/forecasts/single/', headers=auth_header, base_url=BASE_URL, json=VALID_FORECAST_JSON) assert post.status_code == 201 new_fx_id = post.data.decode('utf-8') new_fx_links_url = post.headers['Location'] get_links = sql_api.get(new_fx_links_url, headers=auth_header) assert get_links.status_code == 200 new_fx_links = get_links.get_json() new_fx_url = new_fx_links['_links']['metadata'] get_fx = sql_api.get(new_fx_url, headers=auth_header) assert get_fx.status_code == 200 new_fx = get_fx.get_json() # Create a cdf fx at the site post = sql_api.post('/forecasts/cdf/', headers=auth_header, base_url=BASE_URL, json=VALID_CDF_FORECAST_JSON) assert post.status_code == 201 new_cdf_fx_url = post.headers['Location'] get_cdf_fx = sql_api.get(new_cdf_fx_url, headers=auth_header) assert get_cdf_fx.status_code == 200 new_cdf_fx = get_cdf_fx.get_json() # Fail to delete site because obs, fx exist for it. delete_site = sql_api.delete(new_site_url, headers=auth_header) assert delete_site.status_code == 400 assert new_site in get_site_list(sql_api, auth_header) # Delete the created cdf fx delete_cdf_fx = sql_api.delete(new_cdf_fx_url, headers=auth_header) assert delete_cdf_fx.status_code == 204 assert new_cdf_fx not in get_cdf_fx_list(sql_api, auth_header) assert new_cdf_fx not in get_site_cdf_fx(sql_api, auth_header, new_site_id) # Delete the created fx delete_fx = sql_api.delete(f'/forecasts/single/{new_fx_id}', headers=auth_header, base_url=BASE_URL) assert delete_fx.status_code == 204 assert new_fx not in get_fx_list(sql_api, auth_header) assert new_fx not in get_site_fx(sql_api, auth_header, new_site_id) # delete the created obs delete_obs = sql_api.delete(f'/observations/{new_obs_id}', headers=auth_header, base_url=BASE_URL) assert delete_obs.status_code == 204 assert new_obs not in get_obs_list(sql_api, auth_header) assert new_obs not in get_site_obs(sql_api, auth_header, new_site_id) # Delete the site now that we've removed the obs & fx delete_site = sql_api.delete(new_site_url, headers=auth_header) assert delete_site.status_code == 204 assert new_site not in get_site_list(sql_api, auth_header) @pytest.fixture() def uuid_paths(sql_api): paths_with_id = [] for rule in sql_api.application.url_map.iter_rules(): if 'GET' in rule.methods and '_id' in rule.rule: paths_with_id.append(re.sub('<.+>', '{id}', rule.rule)) return paths_with_id @pytest.mark.parametrize('bad_id', [ '56061aa6-4cf4-11ea-a21d-0a580a800331%', 'not a real uuid', ]) def test_uuid_path_validation(sql_api, uuid_paths, auth_header, bad_id): for path in uuid_paths: req = sql_api.get(path.format(id=bad_id), headers=auth_header, base_url=BASE_URL) assert req.status_code == 404 @pytest.fixture(scope='module') def cvtr_testapp(sql_app): @sql_app.route('/test/<uuid_str:someuuid>') def testroute(someuuid): uuid.UUID(someuuid) return 'ok' yield sql_app @pytest.mark.parametrize('uuid_str', [ str(uuid.uuid1()), str(uuid.uuid3(uuid.NAMESPACE_DNS, 'solarfarorecastarbiter.org')), str(uuid.uuid4()), str(uuid.uuid5(uuid.NAMESPACE_DNS, 'solarfarorecastarbiter.org')) ]) def test_uuid_converter_all_versions(cvtr_testapp, uuid_str, auth_header): with cvtr_testapp.test_client() as api: req = api.get(f'/test/{uuid_str}', headers=auth_header, base_url=BASE_URL) assert req.status_code == 200
39.055028
79
0.625206
2,805
20,582
4.2
0.060963
0.063662
0.050081
0.080129
0.837705
0.80876
0.788728
0.747135
0.718784
0.658603
0
0.013675
0.278739
20,582
526
80
39.129278
0.779926
0.025119
0
0.610979
0
0
0.093304
0.036873
0
0
0
0
0.224344
1
0.073986
false
0.009547
0.009547
0.002387
0.107399
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
6
087fd605061dc6bf58c59ec0e2708dd269e07b28
134
py
Python
contact/admin.py
Shreesh76/Online_Course_Registration_portal
6aee55449469a22e75cd368d1397cf2e4768eb59
[ "MIT" ]
null
null
null
contact/admin.py
Shreesh76/Online_Course_Registration_portal
6aee55449469a22e75cd368d1397cf2e4768eb59
[ "MIT" ]
null
null
null
contact/admin.py
Shreesh76/Online_Course_Registration_portal
6aee55449469a22e75cd368d1397cf2e4768eb59
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import contact @admin.register(contact) class contactAdmin(admin.ModelAdmin): pass
19.142857
37
0.798507
17
134
6.294118
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.126866
134
6
38
22.333333
0.91453
0
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
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
6