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
3efcb58eb313bc16a20a03e53adc4bf8e487cd70
73
py
Python
arc111_a.py
hythof/atc
12cb94ebe693e1f469ce0d982bc2924b586552cd
[ "CC0-1.0" ]
null
null
null
arc111_a.py
hythof/atc
12cb94ebe693e1f469ce0d982bc2924b586552cd
[ "CC0-1.0" ]
null
null
null
arc111_a.py
hythof/atc
12cb94ebe693e1f469ce0d982bc2924b586552cd
[ "CC0-1.0" ]
null
null
null
N,M = [int(x) for x in open(0).read().split()] print(pow(10,N,M*M)//M%M)
24.333333
46
0.561644
19
73
2.157895
0.684211
0.146341
0.146341
0
0
0
0
0
0
0
0
0.046154
0.109589
73
2
47
36.5
0.584615
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
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
0
0
0
1
0
4
f5ce8b7aefd1033b6f8f51feb270e1ef2142dcf4
2,917
py
Python
tests/asp/weakConstraints/adf.3.gringo.test.py
bernardocuteri/wasp
05c8f961776dbdbf7afbf905ee00fc262eba51ad
[ "Apache-2.0" ]
19
2015-12-03T08:53:45.000Z
2022-03-31T02:09:43.000Z
tests/asp/weakConstraints/adf.3.gringo.test.py
bernardocuteri/wasp
05c8f961776dbdbf7afbf905ee00fc262eba51ad
[ "Apache-2.0" ]
80
2017-11-25T07:57:32.000Z
2018-06-10T19:03:30.000Z
tests/asp/weakConstraints/adf.3.gringo.test.py
bernardocuteri/wasp
05c8f961776dbdbf7afbf905ee00fc262eba51ad
[ "Apache-2.0" ]
6
2015-01-15T07:51:48.000Z
2020-06-18T14:47:48.000Z
input = """ 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 1 10 0 0 1 11 0 0 1 12 0 0 1 13 0 0 1 14 0 0 1 15 0 0 1 16 0 0 1 17 0 0 1 18 0 0 1 19 0 0 1 20 0 0 1 21 0 0 1 22 0 0 1 23 0 0 1 24 0 0 1 25 0 0 1 26 0 0 1 27 0 0 1 28 0 0 1 29 0 0 1 30 0 0 1 31 0 0 1 32 0 0 1 33 1 1 34 1 35 1 1 36 1 37 1 0 33 1 38 1 0 35 1 39 2 1 40 37 1 41 2 1 42 38 1 43 2 0 37 39 1 44 2 0 38 41 1 34 1 1 33 1 36 1 1 35 1 40 2 1 39 37 1 42 2 1 41 38 1 45 0 0 1 46 0 0 2 47 2 0 1 34 36 1 48 1 1 47 1 49 1 0 48 2 50 2 0 1 40 42 1 51 1 1 50 1 52 1 0 51 1 53 1 0 49 1 54 1 0 49 1 55 2 0 52 37 1 56 2 0 52 38 1 57 1 0 49 1 58 1 0 49 1 59 2 0 52 37 1 60 2 0 52 38 1 61 2 1 49 36 1 62 2 1 52 42 1 63 1 0 57 1 64 1 0 58 1 65 1 0 59 1 66 1 0 60 1 67 2 0 49 34 1 68 2 0 49 36 1 69 2 0 52 40 1 70 2 0 52 42 1 71 1 0 53 1 72 1 0 54 1 73 1 0 55 1 74 1 0 56 1 53 1 0 61 1 54 1 0 61 1 55 2 0 62 37 1 56 2 0 62 38 1 57 1 0 61 1 58 1 0 61 1 59 2 0 62 37 1 60 2 0 62 38 1 75 2 0 61 34 1 76 2 0 61 36 1 77 2 0 62 40 1 78 2 0 62 42 1 79 1 0 63 1 80 1 0 65 1 69 1 0 67 1 70 1 0 68 1 55 1 0 67 1 56 1 0 68 1 81 1 0 72 1 82 1 0 74 1 83 1 0 71 1 84 1 0 73 1 77 1 0 75 1 78 1 0 76 1 59 1 0 75 1 60 1 0 76 1 81 1 0 79 1 82 1 0 80 1 49 2 0 34 81 1 52 2 0 40 82 1 85 2 0 83 64 1 86 2 0 84 66 1 61 3 1 49 34 85 1 62 3 1 52 40 86 2 87 2 0 2 34 36 1 88 1 0 87 1 1 1 0 88 2 89 2 0 2 40 42 1 90 1 0 89 1 1 1 0 90 1 91 1 0 49 1 92 1 0 52 1 91 1 0 61 1 92 1 0 62 1 1 1 1 91 1 1 1 1 92 1 93 1 0 69 1 94 1 0 70 1 95 1 0 77 1 96 1 0 78 8 2 53 57 0 0 8 2 54 58 0 0 8 2 55 59 1 0 37 8 2 56 60 1 0 38 6 0 2 2 95 96 1 1 6 0 2 2 93 94 1 1 0 4 ac(3,or(neg(3),4)) 5 ac(4,c(f)) 2 statement(3) 3 statement(4) 6 subformula2(3,or(neg(3),4)) 7 subformula2(4,c(f)) 10 subformula2(3,neg(3)) 11 subformula2(3,4) 12 subformula2(3,3) 18 subformula(or(neg(3),4)) 19 subformula(c(f)) 20 subformula(neg(3)) 21 subformula(4) 22 subformula(3) 23 noatom(or(neg(3),4)) 24 noatom(neg(3)) 25 atom(c(f)) 26 atom(4) 27 atom(3) 53 in(3,1) 54 in(4,1) 55 in(3,0) 56 in(4,0) 71 ismodel(3,1) 72 ismodel(4,1) 73 ismodel(3,0) 74 ismodel(4,0) 79 ismodel(neg(3),1) 80 ismodel(neg(3),0) 81 ismodel(or(neg(3),4),1) 82 ismodel(or(neg(3),4),0) 31 iteration(1) 32 iteration(0) 45 nomodel(c(f),1) 46 nomodel(c(f),0) 63 nomodel(3,1) 64 nomodel(4,1) 65 nomodel(3,0) 66 nomodel(4,0) 83 nomodel(neg(3),1) 84 nomodel(neg(3),0) 85 nomodel(or(neg(3),4),1) 86 nomodel(or(neg(3),4),0) 57 out(3,1) 58 out(4,1) 59 out(3,0) 60 out(4,0) 28 snum(2) 29 undec(3,2) 30 undec(4,2) 37 undec(3,1) 38 undec(4,1) 43 undec(3,0) 44 undec(4,0) 67 inA(3,1) 68 inA(4,1) 69 inA(3,0) 70 inA(4,0) 75 inR(3,1) 76 inR(4,1) 77 inR(3,0) 78 inR(4,0) 33 deselect(3,1) 35 deselect(4,1) 39 deselect(3,0) 41 deselect(4,0) 34 select(3,1) 36 select(4,1) 40 select(3,0) 42 select(4,0) 49 okA(1) 52 okA(0) 61 okR(1) 62 okR(0) 91 ok(1) 92 ok(0) 93 accept(3) 94 accept(4) 95 reject(3) 96 reject(4) 0 B+ 0 B- 1 0 1 """ output = """ COST 2@2 1@1 """
13.080717
29
0.608502
1,011
2,917
1.755687
0.125618
0.058592
0.054085
0.031549
0.08338
0
0
0
0
0
0
0.588717
0.288996
2,917
222
30
13.13964
0.267117
0
0
0.009009
0
0
0.989373
0.056222
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f5d4fd2301a909531b538b4e254fb5edea72b0c8
126
py
Python
cloud_function_with_parameters/radioscrapper/requirements.py
orangebacked/GCP_references
3cdbe604666a3dc3877fb46f0af1079386df272a
[ "MIT" ]
null
null
null
cloud_function_with_parameters/radioscrapper/requirements.py
orangebacked/GCP_references
3cdbe604666a3dc3877fb46f0af1079386df272a
[ "MIT" ]
null
null
null
cloud_function_with_parameters/radioscrapper/requirements.py
orangebacked/GCP_references
3cdbe604666a3dc3877fb46f0af1079386df272a
[ "MIT" ]
1
2020-07-11T05:13:07.000Z
2020-07-11T05:13:07.000Z
# Function dependencies, for example: # package>=version google-cloud-bigquery pydub google-cloud-storage google-cloud-speech
18
37
0.81746
16
126
6.4375
0.75
0.320388
0
0
0
0
0
0
0
0
0
0
0.087302
126
6
38
21
0.895652
0.412698
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
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
0
0
0
0
0
4
f5fdf531191cce59cbcc7728a6e6c256a035ba05
91
py
Python
30.strings/4.center.py
robinson-1985/python-zero-dnc
df510d67e453611fcd320df1397cdb9ca47fecb8
[ "MIT" ]
null
null
null
30.strings/4.center.py
robinson-1985/python-zero-dnc
df510d67e453611fcd320df1397cdb9ca47fecb8
[ "MIT" ]
null
null
null
30.strings/4.center.py
robinson-1985/python-zero-dnc
df510d67e453611fcd320df1397cdb9ca47fecb8
[ "MIT" ]
null
null
null
# 3. center() -> Retorna a string como centro e preenche com espaços o restante do tamanho.
91
91
0.747253
15
91
4.533333
1
0
0
0
0
0
0
0
0
0
0
0.013333
0.175824
91
1
91
91
0.893333
0.978022
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
de4b87d22aba32c662b1d78af787d78b9b029377
91
py
Python
ValidApp/apps.py
cs-fullstack-2019-spring/django-validation-cw-Joshtg1104
5b910cbda87793f233ad41dfbffe19e40691db64
[ "Apache-2.0" ]
null
null
null
ValidApp/apps.py
cs-fullstack-2019-spring/django-validation-cw-Joshtg1104
5b910cbda87793f233ad41dfbffe19e40691db64
[ "Apache-2.0" ]
null
null
null
ValidApp/apps.py
cs-fullstack-2019-spring/django-validation-cw-Joshtg1104
5b910cbda87793f233ad41dfbffe19e40691db64
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class ValidappConfig(AppConfig): name = 'ValidApp'
15.166667
33
0.758242
10
91
6.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.164835
91
5
34
18.2
0.907895
0
0
0
0
0
0.087912
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
de800be7e9354bd2ec422b97699bcd53d7e30135
749
py
Python
skeleton/skeleton.py
AHJenin/VIM
fcad432ced358accdec315e2d6c9213293da0c9d
[ "MIT" ]
1
2018-12-18T07:44:37.000Z
2018-12-18T07:44:37.000Z
skeleton/skeleton.py
AHJenin/VIM
fcad432ced358accdec315e2d6c9213293da0c9d
[ "MIT" ]
null
null
null
skeleton/skeleton.py
AHJenin/VIM
fcad432ced358accdec315e2d6c9213293da0c9d
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # FILE: {untitled} # # @author: {developer} <{mail}> # # LINK: # # DATE CREATED: {datetime} # LAST MODIFIED: # # DEVELOPMENT HISTORY: # Date Version Description # -------------------------------------------------------------------- # {date} {version} {description} # # _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/ # _/ _/ _/_/ _/ _/ _/_/ _/ # _/ _/_/_/ _/ _/ _/ _/ _/ _/ _/ # _/ _/ _/ _/ _/_/ _/ _/ _/_/ # _/_/ _/_/_/_/ _/ _/ _/_/_/ _/ _/ # ############################################################################## if __name__ == '__main__':
25.827586
78
0.303071
29
749
5.655172
0.862069
0.134146
0.268293
0
0
0
0
0
0
0
0
0.004073
0.344459
749
28
79
26.75
0.329939
0.791722
0
0
0
0
0.145455
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
dea3ee4a5fa1e3b4d559135670afe3cfd594484e
789
py
Python
domain/excecoes.py
ESEGroup/Paraguai
42de0a15b7a31d470803e5f88d15e83f93c0a467
[ "Apache-2.0" ]
6
2016-11-08T16:08:48.000Z
2017-03-05T20:48:41.000Z
domain/excecoes.py
bamorim/eel873-final-assignment
42de0a15b7a31d470803e5f88d15e83f93c0a467
[ "Apache-2.0" ]
39
2016-11-13T00:36:49.000Z
2018-05-20T16:40:15.000Z
domain/excecoes.py
bamorim/eel873-final-assignment
42de0a15b7a31d470803e5f88d15e83f93c0a467
[ "Apache-2.0" ]
3
2016-11-08T22:33:54.000Z
2017-07-23T21:07:14.000Z
class ExcecaoParaguai(Exception): pass class ExcecaoRegraDeNegocio(ExcecaoParaguai): pass class ExcecaoNivelAcessoInvalido(ExcecaoParaguai): pass class ExcecaoUsuarioJaExistente(ExcecaoParaguai): pass class ExcecaoEntidadeInexistente(ExcecaoParaguai): pass class ExcecaoUsuarioInexistente(ExcecaoEntidadeInexistente): pass class ExcecaoRecursoInexistente(ExcecaoEntidadeInexistente): pass # Não herda da ExcecaoEntidadeInexistente porque Agendamento é um ValueObject class ExcecaoAgendamentoInexistente(ExcecaoParaguai): pass class ExcecaoAgendamentoRecursoOcupado(ExcecaoRegraDeNegocio): pass class ExcecaoAgendamentoUsuarioOcupado(ExcecaoRegraDeNegocio): pass class ExcecaoAgendamentoRecursoInutilizavel(ExcecaoRegraDeNegocio): pass
23.205882
77
0.833967
53
789
12.415094
0.415094
0.1231
0.182371
0
0
0
0
0
0
0
0
0
0.12294
789
33
78
23.909091
0.950867
0.095057
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
1
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
0
1
1
0
0
0
0
0
4
deea2604bd5c4121fa30c36a72ae6a288cd7e419
263
py
Python
dlutils/losses/iterative_discriminator.py
justusschock/dl-utils
1078f5030b8aac2bf022daf5fa14d66f74c3c893
[ "MIT" ]
13
2020-03-25T12:29:32.000Z
2022-02-05T15:02:11.000Z
dlutils/losses/iterative_discriminator.py
Royzon/dl-utils
be95707da9cb812a5f25a11f1469055e0b7abcd2
[ "MIT" ]
1
2021-07-05T10:14:52.000Z
2021-07-05T10:14:52.000Z
dlutils/losses/iterative_discriminator.py
Royzon/dl-utils
be95707da9cb812a5f25a11f1469055e0b7abcd2
[ "MIT" ]
5
2020-03-25T12:55:09.000Z
2020-12-22T20:18:52.000Z
import torch class IterativeDiscriminatorLoss(torch.nn.Module): def __init__(self): super().__init__() def forward(self, preds: torch.Tensor, gt: torch.Tensor) -> torch.Tensor: return sum([torch.mean((out - gt) ** 2) for out in preds])
26.3
77
0.661597
34
263
4.882353
0.617647
0.198795
0
0
0
0
0
0
0
0
0
0.004739
0.197719
263
9
78
29.222222
0.781991
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.166667
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
deff47352d899f82755a3afac97fd9623bb27e33
202
py
Python
tests/import_class.py
GitSumito/redash-dynamic-query
303e2f3b3bf62a0981a72fe0ee7a6426e434d621
[ "MIT" ]
45
2017-02-28T01:49:27.000Z
2021-10-22T02:43:36.000Z
tests/import_class.py
GitSumito/redash-dynamic-query
303e2f3b3bf62a0981a72fe0ee7a6426e434d621
[ "MIT" ]
11
2017-07-23T01:38:12.000Z
2019-02-15T15:49:11.000Z
tests/import_class.py
GitSumito/redash-dynamic-query
303e2f3b3bf62a0981a72fe0ee7a6426e434d621
[ "MIT" ]
9
2017-02-28T01:49:29.000Z
2019-05-04T13:35:54.000Z
import unittest class TestImport(unittest.TestCase): def test_import(self): from redash_dynamic_query import RedashDynamicQuery a = RedashDynamicQuery('','','') assert True
25.25
59
0.693069
20
202
6.85
0.8
0
0
0
0
0
0
0
0
0
0
0
0.217822
202
7
60
28.857143
0.867089
0
0
0
0
0
0
0
0
0
0
0
0.166667
1
0.166667
false
0
0.666667
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
723045f4358700ff04d9e8cd2d08c23a56c7f6aa
353
py
Python
sentinelhub/download/__init__.py
sentinel-hub/sentinelhub
de16389228946e1bce4176e8e335491ec4ea8ed9
[ "MIT" ]
null
null
null
sentinelhub/download/__init__.py
sentinel-hub/sentinelhub
de16389228946e1bce4176e8e335491ec4ea8ed9
[ "MIT" ]
null
null
null
sentinelhub/download/__init__.py
sentinel-hub/sentinelhub
de16389228946e1bce4176e8e335491ec4ea8ed9
[ "MIT" ]
null
null
null
""" A download part of the package """ from .client import DownloadClient from .request import DownloadRequest from .sentinelhub_client import SentinelHubDownloadClient from .sentinelhub_statistical_client import SentinelHubStatisticalDownloadClient from .session import SentinelHubSession, SessionSharing, SessionSharingThread, collect_shared_session
35.3
101
0.869688
34
353
8.882353
0.647059
0.119205
0
0
0
0
0
0
0
0
0
0
0.090652
353
9
102
39.222222
0.94081
0.084986
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
7234d12aad3ab885c9cee5368e46dcd9612ec115
309
py
Python
molmodmt/forms/classes/api_yank_Topography.py
LMMV/MolModMT
5725d6d5627b07edcbbd5e55318345a136b28c35
[ "MIT" ]
null
null
null
molmodmt/forms/classes/api_yank_Topography.py
LMMV/MolModMT
5725d6d5627b07edcbbd5e55318345a136b28c35
[ "MIT" ]
null
null
null
molmodmt/forms/classes/api_yank_Topography.py
LMMV/MolModMT
5725d6d5627b07edcbbd5e55318345a136b28c35
[ "MIT" ]
null
null
null
from os.path import basename as _basename from yank import Topography as _yank_Topography form_name=_basename(__file__).split('.')[0].replace('api_','').replace('_','.') is_form={ 'yank.Topography': form_name, _yank_Topography: form_name } def to_openmm_Topology(item): return item.topology()
22.071429
79
0.731392
41
309
5.073171
0.536585
0.201923
0.259615
0.317308
0
0
0
0
0
0
0
0.003704
0.126214
309
13
80
23.769231
0.766667
0
0
0
0
0
0.071197
0
0
0
0
0
0
1
0.111111
false
0
0.222222
0.111111
0.444444
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
4
7239e6cc3c61c83f2c9a1240a3c31563ba393257
135
py
Python
setup.py
TwistoPayments/jenkinsapi
aa3e23289b666feb02e1bde89aa2f75ca14cbd56
[ "MIT" ]
null
null
null
setup.py
TwistoPayments/jenkinsapi
aa3e23289b666feb02e1bde89aa2f75ca14cbd56
[ "MIT" ]
1
2019-07-03T11:16:39.000Z
2019-07-03T11:16:39.000Z
setup.py
TwistoPayments/jenkinsapi
aa3e23289b666feb02e1bde89aa2f75ca14cbd56
[ "MIT" ]
null
null
null
from setuptools import setup import os os.environ['PBR_VERSION'] = '0.3.9.twisto.4' setup( setup_requires=['pbr'], pbr=True)
15
44
0.681481
21
135
4.285714
0.714286
0
0
0
0
0
0
0
0
0
0
0.035398
0.162963
135
8
45
16.875
0.761062
0
0
0
0
0
0.207407
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a0df72757ce369028b574f4262cdd9b212345dcf
97
py
Python
prisma_configure_mesh.py
ebob9/prisma_configure_mesh
a699e8a44bda8f7b8e513a88e43f799cc3ceec80
[ "MIT" ]
1
2021-06-02T12:50:35.000Z
2021-06-02T12:50:35.000Z
prisma_configure_mesh.py
ebob9/prisma_configure_mesh
a699e8a44bda8f7b8e513a88e43f799cc3ceec80
[ "MIT" ]
1
2021-06-02T15:50:02.000Z
2021-06-02T15:50:02.000Z
prisma_configure_mesh.py
ebob9/prisma_configure_mesh
a699e8a44bda8f7b8e513a88e43f799cc3ceec80
[ "MIT" ]
null
null
null
#!/usr/bin/env python from prisma_mesh_functions import go if __name__ == "__main__": go()
13.857143
36
0.701031
14
97
4.142857
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.175258
97
6
37
16.166667
0.725
0.206186
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a0ecc910ea272c0a31e86f019f474b433e9b4a4a
1,018
py
Python
setup.py
DontEatThemCookies/ctof
1a74027e9c3def2686f6a6520f219d88528fb5cf
[ "MIT" ]
1
2021-11-08T01:25:02.000Z
2021-11-08T01:25:02.000Z
setup.py
DontEatThemCookies/ctof
1a74027e9c3def2686f6a6520f219d88528fb5cf
[ "MIT" ]
null
null
null
setup.py
DontEatThemCookies/ctof
1a74027e9c3def2686f6a6520f219d88528fb5cf
[ "MIT" ]
null
null
null
from setuptools import find_packages, setup setup ( name='ctof', packages=find_packages(include=['ctof']), version='0.2.01', description='A simple library for temperature unit conversion', long_description=open('README.md').read(), long_description_content_type='text/markdown', author='David Costell', author_email = 'davidcostell44@gmail.com', license='MIT', classifiers=[ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Operating System :: OS Independent" ], project_urls = { 'GitHub': 'https://github.com/DontEatThemCookies/ctof' } )
36.357143
68
0.605108
101
1,018
6.019802
0.623762
0.21875
0.287829
0.256579
0
0
0
0
0
0
0
0.023778
0.256385
1,018
27
69
37.703704
0.779392
0
0
0
0
0
0.530777
0.024218
0
0
0
0
0
1
0
true
0
0.037037
0
0.037037
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
a0ff2f766179278d6ca903c45b1903c06d7ef1ac
408
py
Python
src/aseb/api/oauth/viewsets.py
somosaseb/somosaseb-api
e55cf8f9d7f7a6b671eda825bf7fceac17f8cf06
[ "MIT" ]
1
2021-08-19T06:01:30.000Z
2021-08-19T06:01:30.000Z
src/aseb/api/oauth/viewsets.py
somosaseb/somosaseb-app
e55cf8f9d7f7a6b671eda825bf7fceac17f8cf06
[ "MIT" ]
null
null
null
src/aseb/api/oauth/viewsets.py
somosaseb/somosaseb-app
e55cf8f9d7f7a6b671eda825bf7fceac17f8cf06
[ "MIT" ]
null
null
null
from oauth2_provider import views class AuthorizationView(views.AuthorizationView): ... class TokenView(views.TokenView): ... class RevokeTokenView(views.RevokeTokenView): ... class IntrospectTokenView(views.IntrospectTokenView): ... class AuthorizedTokenDeleteView(views.AuthorizedTokenDeleteView): ... class AuthorizedTokensListView(views.AuthorizedTokensListView): ...
15.692308
65
0.754902
29
408
10.586207
0.413793
0
0
0
0
0
0
0
0
0
0
0.002857
0.142157
408
25
66
16.32
0.874286
0
0
0.461538
0
0
0
0
0
0
0
0
0
1
0
true
0
0.076923
0
0.538462
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
9d08afa953b428c7d5c3715b273ed105a40c28f8
386
py
Python
tests/test_docs.py
notslang/python-frontmatter
66888e7fee7368ccf7f5289ec0b23e4bbeca16ad
[ "MIT" ]
null
null
null
tests/test_docs.py
notslang/python-frontmatter
66888e7fee7368ccf7f5289ec0b23e4bbeca16ad
[ "MIT" ]
null
null
null
tests/test_docs.py
notslang/python-frontmatter
66888e7fee7368ccf7f5289ec0b23e4bbeca16ad
[ "MIT" ]
null
null
null
# all the doctests here import doctest import frontmatter def test_readme(): doctest.testfile("../README.md", extraglobs={"frontmatter": frontmatter}) def test_api_docs(): doctest.testmod(frontmatter, extraglobs={"frontmatter": frontmatter}) def test_handler_docs(): doctest.testmod( frontmatter.default_handlers, extraglobs={"frontmatter": frontmatter} )
21.444444
77
0.733161
40
386
6.925
0.475
0.151625
0.194946
0.252708
0.281588
0
0
0
0
0
0
0
0.145078
386
17
78
22.705882
0.839394
0.054404
0
0
0
0
0.123967
0
0
0
0
0
0
1
0.3
true
0
0.2
0
0.5
0
0
0
0
null
0
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
1
0
0
0
0
0
0
4
19d6558eeea711a536280e5b7cd16a73c1342206
145
py
Python
day06/test10.py
jaywoong/python
99daedd5a9418b72b2d5c3b800080e730eb9b3ea
[ "Apache-2.0" ]
null
null
null
day06/test10.py
jaywoong/python
99daedd5a9418b72b2d5c3b800080e730eb9b3ea
[ "Apache-2.0" ]
null
null
null
day06/test10.py
jaywoong/python
99daedd5a9418b72b2d5c3b800080e730eb9b3ea
[ "Apache-2.0" ]
null
null
null
data = [ ['2020-05-01',20.5], ['2020-05-02',21.5], ['2020-05-03',22.5], ] dic = dict(data) print(dic) data2 = list(dic) print(data2)
14.5
24
0.537931
26
145
3
0.576923
0.230769
0.179487
0
0
0
0
0
0
0
0
0.29661
0.186207
145
10
25
14.5
0.364407
0
0
0
0
0
0.205479
0
0
0
0
0
0
1
0
false
0
0
0
0
0.222222
1
0
0
null
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
19f2d30f9b9addee73b94563f5cec79718aee259
99
py
Python
bulkRoleManager/__init__.py
MichaelBoshell/RSCBot
6a77a76e7beab073bc40e8cab300b3031279298b
[ "MIT" ]
12
2018-12-19T17:00:00.000Z
2021-06-10T13:27:01.000Z
bulkRoleManager/__init__.py
MichaelBoshell/RSCBot
6a77a76e7beab073bc40e8cab300b3031279298b
[ "MIT" ]
37
2020-03-10T18:42:29.000Z
2021-09-29T19:36:42.000Z
bulkRoleManager/__init__.py
MichaelBoshell/RSCBot
6a77a76e7beab073bc40e8cab300b3031279298b
[ "MIT" ]
14
2018-12-31T02:12:18.000Z
2021-11-13T01:49:53.000Z
from .bulkRoleManager import BulkRoleManager def setup(bot): bot.add_cog(BulkRoleManager(bot))
24.75
44
0.79798
12
99
6.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.111111
99
4
45
24.75
0.886364
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
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
0
0
0
0
4
dfaaf586acda6a095db6f4bb4d3aa850537d70ae
189
py
Python
src/desktopautomator/exceptions.py
vadimtitov/desktop-automator
c1538e53f8a8caee263e4e77b1847442a4c50465
[ "Apache-2.0" ]
null
null
null
src/desktopautomator/exceptions.py
vadimtitov/desktop-automator
c1538e53f8a8caee263e4e77b1847442a4c50465
[ "Apache-2.0" ]
null
null
null
src/desktopautomator/exceptions.py
vadimtitov/desktop-automator
c1538e53f8a8caee263e4e77b1847442a4c50465
[ "Apache-2.0" ]
null
null
null
"""Host custom exceptions.""" class DesktopAutomatorError(Exception): """Base exception.""" class UnsopportedSystemError(DesktopAutomatorError): """Unsupported system error."""
18.9
52
0.730159
14
189
9.857143
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.126984
189
9
53
21
0.836364
0.343915
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
dfc583e5cfe98e94473a3bc80485234716a23e3b
260
py
Python
backend/garpix_page/translation/base_page.py
AlexandrMikhailovich/garpix_page
7d1123e7da35773551fd808228700c77c578b957
[ "MIT" ]
18
2021-05-12T09:56:56.000Z
2022-02-09T07:15:50.000Z
backend/garpix_page/translation/base_page.py
AlexandrMikhailovich/garpix_page
7d1123e7da35773551fd808228700c77c578b957
[ "MIT" ]
9
2021-08-30T07:56:11.000Z
2022-02-16T08:44:46.000Z
backend/garpix_page/translation/base_page.py
AlexandrMikhailovich/garpix_page
7d1123e7da35773551fd808228700c77c578b957
[ "MIT" ]
6
2021-03-18T08:20:19.000Z
2021-12-27T08:25:58.000Z
from modeltranslation.translator import TranslationOptions, register from ..models import BasePage @register(BasePage) class BasePageTranslationOptions(TranslationOptions): fields = ('title', 'seo_title', 'seo_keywords', 'seo_description', 'seo_author')
32.5
84
0.8
25
260
8.16
0.64
0.078431
0
0
0
0
0
0
0
0
0
0
0.096154
260
7
85
37.142857
0.868085
0
0
0
0
0
0.196154
0
0
0
0
0
0
1
0
false
0
0.4
0
0.8
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
0
0
1
0
1
0
0
4
dfdfca87fd6be1fd3b0c065f8c86c525162f03fd
2,574
py
Python
utils.py
omarhatem97/Deep-Learning-Framework
01c40cf75a05e630fc919bc7bb28d79cfc082ae5
[ "MIT" ]
null
null
null
utils.py
omarhatem97/Deep-Learning-Framework
01c40cf75a05e630fc919bc7bb28d79cfc082ae5
[ "MIT" ]
null
null
null
utils.py
omarhatem97/Deep-Learning-Framework
01c40cf75a05e630fc919bc7bb28d79cfc082ae5
[ "MIT" ]
2
2021-01-25T16:57:15.000Z
2021-08-10T12:22:13.000Z
import numpy as np def get_fans(shape): ''' :param shape: :return: ''' fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:]) fan_out = shape[1] if len(shape) == 2 else shape[0] return fan_in, fan_out def normal(shape, scale=0.05): ''' :param shape: :param scale: :return: ''' return np.random.normal(0, scale, size=shape) def uniform(shape, scale=0.05): ''' :param shape: :param scale: :return: ''' return np.random.uniform(-scale, scale, size=shape) def glorot_normal(shape): ''' A function for smart uniform distribution based initialization of parameters [Glorot et al. http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf] :param fan_in: The number of units in previous layer. :param fan_out: The number of units in current layer. :return:[numpy array, numpy array]: A randomly initialized array of shape [fan_out, fan_in] and the bias of shape [fan_out, 1] ''' fan_in, fan_out = get_fans(shape) scale = np.sqrt(2. / (fan_in + fan_out)) shape = (fan_out, fan_in) if len(shape) == 2 else shape # For a fully connected network bias_shape = (fan_out, 1) if len(shape) == 2 else ( 1, 1, 1, shape[3]) # This supports only CNNs and fully connected networks return normal(shape, scale), uniform(shape=bias_shape) def glorot_uniform(shape): ''' A function for smart uniform distribution based initialization of parameters [Glorot et al. http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf] :param fan_in: The number of units in previous layer. :param fan_out: The number of units in current layer. :return:[numpy array, numpy array]: A randomly initialized array of shape [fan_out, fan_in] and the bias of shape [fan_out, 1] ''' fan_in, fan_out = get_fans(shape) scale = np.sqrt(6. / (fan_in + fan_out)) shape = (fan_out, fan_in) if len(shape) == 2 else shape # For a fully connected network bias_shape = (fan_out, 1) if len(shape) == 2 else ( 1, 1, 1, shape[3]) # This supports only CNNs and fully connected networks return uniform(shape, scale), uniform(shape=bias_shape) def pad_inputs(X, pad): ''' Function to apply zero padding to the image :param X:[numpy array]: Dataset of shape (m, height, width, depth) :param pad:[int]: number of columns to pad :return:[numpy array]: padded dataset ''' return np.pad(X, ((0, 0), (pad[0], pad[0]), (pad[1], pad[1]), (0, 0)), 'constant')
35.260274
99
0.641414
392
2,574
4.114796
0.214286
0.059516
0.054557
0.040918
0.750155
0.740856
0.727836
0.685679
0.685679
0.685679
0
0.024898
0.235431
2,574
73
100
35.260274
0.794715
0.481352
0
0.32
0
0
0.006975
0
0
0
0
0
0
1
0.24
false
0
0.04
0
0.52
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
0
0
0
0
4
5f15393fc13ac95245e9d5ce3be09f9b8bcfa0b5
181
py
Python
quotations/templatetags/quotations_tags.py
jessamynsmith/quotations
b2a9b70190756fa261840faea181860b166e253f
[ "MIT" ]
2
2015-05-01T19:44:41.000Z
2015-07-17T13:52:46.000Z
quotations/templatetags/quotations_tags.py
jessamynsmith/quotations
b2a9b70190756fa261840faea181860b166e253f
[ "MIT" ]
13
2019-10-18T17:06:52.000Z
2022-02-10T07:37:30.000Z
quotations/templatetags/quotations_tags.py
jessamynsmith/quotations
b2a9b70190756fa261840faea181860b166e253f
[ "MIT" ]
3
2015-05-06T15:38:30.000Z
2015-07-26T21:12:32.000Z
from django.template import Library from urllib.parse import urlencode register = Library() @register.simple_tag def query_string(*args, **kwargs): return urlencode(kwargs)
16.454545
35
0.773481
23
181
6
0.73913
0
0
0
0
0
0
0
0
0
0
0
0.138122
181
10
36
18.1
0.884615
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.166667
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
5f1574b36bdf747d2396bcb5aad5f857d97ac74f
1,011
py
Python
dragon/python/_api/logging/__init__.py
seetaresearch/Dragon
494774d3a545f807d483fd9e6e4563cedec6dda5
[ "BSD-2-Clause" ]
81
2018-03-13T13:08:37.000Z
2020-06-13T14:36:29.000Z
dragon/python/_api/logging/__init__.py
seetaresearch/Dragon
494774d3a545f807d483fd9e6e4563cedec6dda5
[ "BSD-2-Clause" ]
2
2019-08-07T09:26:07.000Z
2019-08-26T07:33:55.000Z
dragon/python/_api/logging/__init__.py
seetaresearch/Dragon
494774d3a545f807d483fd9e6e4563cedec6dda5
[ "BSD-2-Clause" ]
13
2018-03-13T13:08:50.000Z
2020-05-28T08:20:22.000Z
# ------------------------------------------------------------ # Copyright (c) 2017-present, SeetaTech, Co.,Ltd. # # Licensed under the BSD 2-Clause License. # You should have received a copy of the BSD 2-Clause License # along with the software. If not, See, # # <https://opensource.org/licenses/BSD-2-Clause> # # ------------------------------------------------------------ from __future__ import absolute_import as _absolute_import from __future__ import division as _division from __future__ import print_function as _print_function from dragon.core.util.logging import debug from dragon.core.util.logging import error from dragon.core.util.logging import fatal from dragon.core.util.logging import get_verbosity from dragon.core.util.logging import info from dragon.core.util.logging import log from dragon.core.util.logging import set_directory from dragon.core.util.logging import set_verbosity from dragon.core.util.logging import warning __all__ = [_s for _s in dir() if not _s.startswith('_')]
37.444444
62
0.699308
138
1,011
4.905797
0.427536
0.132939
0.186115
0.239291
0.506647
0.447563
0.218612
0
0
0
0
0.007795
0.111771
1,011
26
63
38.884615
0.746102
0.355094
0
0
0
0
0.00156
0
0
0
0
0
0
1
0
false
0
0.923077
0
0.923077
0.076923
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5f239f6b3ba7f60b8c577dbd82963ac39317c034
16
py
Python
Algorithms/matrix_mul3.py
mayankjobanputra/Programing
eed62661ee9a745c7ea81dde317d83a40ea489f4
[ "MIT" ]
null
null
null
Algorithms/matrix_mul3.py
mayankjobanputra/Programing
eed62661ee9a745c7ea81dde317d83a40ea489f4
[ "MIT" ]
null
null
null
Algorithms/matrix_mul3.py
mayankjobanputra/Programing
eed62661ee9a745c7ea81dde317d83a40ea489f4
[ "MIT" ]
null
null
null
def mul(a,b):
5.333333
13
0.5
4
16
2
1
0
0
0
0
0
0
0
0
0
0
0
0.25
16
2
14
8
0.666667
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
0
0
4
a031f49050f5a6cf0f939610d61cd8bf9a6bf331
98
py
Python
stips/scene_module/__init__.py
york-stsci/STScI-STIPS-1
16c439fcea22b2768d462b3e375257f0f050c26a
[ "BSD-3-Clause" ]
4
2019-04-27T06:05:25.000Z
2020-02-19T19:33:29.000Z
stips/scene_module/__init__.py
york-stsci/STScI-STIPS-1
16c439fcea22b2768d462b3e375257f0f050c26a
[ "BSD-3-Clause" ]
113
2017-12-21T04:19:06.000Z
2021-12-13T20:41:38.000Z
stips/scene_module/__init__.py
york-stsci/STScI-STIPS-1
16c439fcea22b2768d462b3e375257f0f050c26a
[ "BSD-3-Clause" ]
12
2018-01-11T20:38:08.000Z
2022-01-25T16:20:05.000Z
__all__ = ['convert_units', 'scene_module'] # Local Imports from .scene_module import SceneModule
24.5
43
0.785714
12
98
5.833333
0.833333
0.314286
0
0
0
0
0
0
0
0
0
0
0.112245
98
3
44
32.666667
0.804598
0.132653
0
0
0
0
0.301205
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
a054b50ced025395f4b3b3bf8205e027024b0fe3
104
py
Python
dealer/contrib/django/__init__.py
remcogerlich/dealer
ad94535046d325b5253c8b7d8fa7b682d794bb30
[ "BSD-3-Clause" ]
41
2015-01-09T22:20:57.000Z
2019-04-21T22:28:52.000Z
dealer/contrib/django/__init__.py
remcogerlich/dealer
ad94535046d325b5253c8b7d8fa7b682d794bb30
[ "BSD-3-Clause" ]
12
2015-03-18T18:58:17.000Z
2019-09-06T09:56:13.000Z
dealer/contrib/django/__init__.py
remcogerlich/dealer
ad94535046d325b5253c8b7d8fa7b682d794bb30
[ "BSD-3-Clause" ]
10
2015-08-12T08:12:15.000Z
2019-09-06T09:50:18.000Z
""" Dealer django support. """ from .staff import context_processor, Middleware # pylama:ignore=W0611
17.333333
48
0.75
12
104
6.416667
1
0
0
0
0
0
0
0
0
0
0
0.044444
0.134615
104
5
49
20.8
0.811111
0.423077
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a06781f5bac70143557829ab8a0806c671e9ab8c
116
py
Python
bit_field/__init__.py
Arth-ur/bitfield
7f885f6a5bad8ca8861a1cbf057b29eeb128a251
[ "MIT" ]
6
2019-10-13T10:18:32.000Z
2022-03-15T15:57:35.000Z
bit_field/__init__.py
Arth-ur/bitfield
7f885f6a5bad8ca8861a1cbf057b29eeb128a251
[ "MIT" ]
2
2022-03-10T07:56:06.000Z
2022-03-23T22:53:00.000Z
bit_field/__init__.py
Arth-ur/bitfield
7f885f6a5bad8ca8861a1cbf057b29eeb128a251
[ "MIT" ]
1
2019-07-08T12:40:26.000Z
2019-07-08T12:40:26.000Z
from .render import render from .jsonml_stringify import jsonml_stringify __all__ = ['render', 'jsonml_stringify']
23.2
46
0.801724
14
116
6.142857
0.428571
0.523256
0
0
0
0
0
0
0
0
0
0
0.112069
116
4
47
29
0.834951
0
0
0
0
0
0.189655
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
2615250af681490b22d34b43c0c46313b55e582e
65
py
Python
test/test_minion_bot.py
emashkin/minion-bot
509177a54750628b84505bf0f289379520a3b658
[ "Apache-2.0" ]
null
null
null
test/test_minion_bot.py
emashkin/minion-bot
509177a54750628b84505bf0f289379520a3b658
[ "Apache-2.0" ]
null
null
null
test/test_minion_bot.py
emashkin/minion-bot
509177a54750628b84505bf0f289379520a3b658
[ "Apache-2.0" ]
null
null
null
from .context import minion_bot import unittest print 'success'
13
31
0.815385
9
65
5.777778
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.138462
65
5
32
13
0.928571
0
0
0
0
0
0.106061
0
0
0
0
0
0
0
null
null
0
0.666667
null
null
0.333333
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
1
0
0
0
1
0
0
0
0
4
261db68a791ee8bc1be5bf7b69a457d00bec0e4c
91
py
Python
shoppers/apps.py
andriov/footStore-django-webServer
5741cc78b857e2f73ea12b6f387c22c4f2788d30
[ "MIT" ]
null
null
null
shoppers/apps.py
andriov/footStore-django-webServer
5741cc78b857e2f73ea12b6f387c22c4f2788d30
[ "MIT" ]
10
2020-06-05T17:43:35.000Z
2022-02-11T03:38:45.000Z
shoppers/apps.py
andriov/footStore-django-webServer
5741cc78b857e2f73ea12b6f387c22c4f2788d30
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ShoppersConfig(AppConfig): name = 'shoppers'
15.166667
33
0.758242
10
91
6.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.164835
91
5
34
18.2
0.907895
0
0
0
0
0
0.087912
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
262d5ae646533620ce434456533d28f82b90ee0f
4,335
py
Python
sample/simple_https_notify_endpoint.py
jasonz93/python-toralimns
95a0bb1699db6518d7285818b5022703f80784f5
[ "MIT" ]
17
2017-07-24T08:49:13.000Z
2020-08-05T13:23:41.000Z
sample/simple_https_notify_endpoint.py
jasonz93/python-toralimns
95a0bb1699db6518d7285818b5022703f80784f5
[ "MIT" ]
null
null
null
sample/simple_https_notify_endpoint.py
jasonz93/python-toralimns
95a0bb1699db6518d7285818b5022703f80784f5
[ "MIT" ]
14
2017-08-25T06:39:57.000Z
2020-07-29T02:32:03.000Z
#!/usr/bin/env python #coding=utf8 # Copyright (C) 2015, Alibaba Cloud Computing #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: #The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import simple_http_notify_endpoint import sys import ssl __version__ = "1.0.3" class SimpleHttpsNotifyEndpoint(simple_http_notify_endpoint.SimpleHttpNotifyEndpoint): server_version = "SimpleHttpsNotifyEndpoint/" + __version__ access_log_file = "access_log" RSA_PRIVATE_KEY = "\n-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAKBgQC7UKbXif9YkFQAghYs0CEZL066Sy2YbEKHdVm1OqmIHHY9CV9s\nFeCMD9HbbDwsBA2XQsVb7NP5MRydwTCpwCOBpntr0w94PuE+Q8TcLSHxgoqqI29s\nzF0xyRXjAJFabzu2sei8RySLw57C64lWIOxPrWsi+GHQK0XcFU7JfFACIQIDAQAB\nAoGBAKtDfZia2vYN2FAyoLXOgkS1pWTdsc2oRlf16tSx0ynY5B7AgBeiFRHasQTP\nfGC+P/LqIOsAqXsw9Toj1iuOuqaSBYpuCHFMe/dxrEAPXXA7GCMwW3lDeSfMinHV\nrjLTDMhZRLN+jT5QvlkOBNibaZSc3bmCwmGbkEeREkDGD+fFAkEA6A/pQQfT25ip\nAKHh2VOIzfOpiBfC0sci6ZF845kh5GxyFUAeq+hjUUx+ihzI7eIqKrkY+41eYz73\nSGhwuBkmhwJBAM6jGWNv0PgxcLs+sGa55BL53KuiVjIONxOhKrk3OfoF+i8jY7c7\ngUE3kgckcx7FZY323kjGSwX626+jvyRdFBcCQDv9kQEcsun75wSg1K/H5n/HU7Y4\n3kZ68E2NLMnxlk9ksYFI2CT8qGAl9DhkBJVqeBgfTZQKEbJ6Xpa7WRheeBUCQQDE\nS5oFpSYdcFIH/lBy9aodALFJdqhtWqWlhxff5P+1bNIyz2qdmPB7tL+K+2xE0f5c\nMyUMexqv7pOdMW+Vqro3AkAVx3pYn7e1YqMM40jI0J+CqyhXYZ2esiWvBylS+FUN\nY6WOonIAv774LIURaTplcAMuOAj6VDHpVmSDVvnVMgEu\n-----END RSA PRIVATE KEY-----" CERTIFICATE = "\n-----BEGIN CERTIFICATE-----\nMIIDbDCCAtWgAwIBAgIJALKoPicL21iaMA0GCSqGSIb3DQEBBQUAMIGBMQswCQYD\nVQQGEwJDTjERMA8GA1UECBMIWmhlamlhbmcxETAPBgNVBAcTCEhhbmd6aG91MQ8w\nDQYDVQQKDAZBbGluCAgxEzARBgNVBAsTCkFwc2FyYSBPU1MxDDAKBgNVBAMTA09T\nUzEYMBYGCSqGSIb3DQEJARYJYWxleC5rcQgIMB4XDTE0MDgyMDA4MjM1NVoXDTE1\nMDgyMDA4MjM1NVowgYExCzAJBgNVBAYTAkNOMREwDwYDVQQIEwhaaGVqaWFuZzER\nMA8GA1UEBxMISGFuZ3pob3UxDzANBgNVBAoMBkFsaW4ICDETMBEGA1UECxMKQXBz\nYXJhIE9TUzEMMAoGA1UEAxMDT1NTMRgwFgYJKoZIhvcNAQkBFglhbGV4LmtxCAgw\ngZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALtQpteJ/1iQVACCFizQIRkvTrpL\nLZhsQod1WbU6qYgcdj0JX2wV4IwP0dtsPCwEDZdCxVvs0/kxHJ3BMKnAI4Gme2vT\nD3g+4T5DxNwtIfGCiqojb2zMXTHJFeMAkVpvO7ax6LxHJIvDnsLriVYg7E+tayL4\nYdArRdwVTsl8UAIhAgMBAAGjgekwgeYwHQYDVR0OBBYEFMuRh/onWCJ+geGxBp6Y\nMEugx/0HMIG2BgNVHSMEga4wgauAFMuRh/onWCJ+geGxBp6YMEugx/0HoYGHpIGE\nMIGBMQswCQYDVQQGEwJDTjERMA8GA1UECBMIWmhlamlhbmcxETAPBgNVBAcTCEhh\nbmd6aG91MQ8wDQYDVQQKDAZBbGluCAgxEzARBgNVBAsTCkFwc2FyYSBPU1MxDDAK\nBgNVBAMTA09TUzEYMBYGCSqGSIb3DQEJARYJYWxleC5rcQgIggkAsqg+JwvbWJow\nDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQA/8bbaN0Zwb44belQ+OaWj\n7xgn1Bp7AbkDnybpCB1xZGE5sDSkoy+5lNW3D/G5cEQkMYc8g18JtEOy0PPMKHvN\nmqxXUOCSGTmiqOxSY0kZwHG5sMv6Tf0KOmBZte3Ob2h/+pzNMHOBTFFd0xExKGlr\nGr788nh1/5YblcBHl3VEBA==\n-----END CERTIFICATE-----" def setup(self): tmpkeyfile = "rsa_private_key_checkhttp.pem" tmpcertfile = "x509_public_certificate_checkhttp.pem" open(tmpkeyfile, 'w').write(self.RSA_PRIVATE_KEY) open(tmpcertfile, 'w').write(self.CERTIFICATE) SSLSocket = ssl.wrap_socket(self.request,server_side=True, keyfile=tmpkeyfile, certfile=tmpcertfile,ssl_version=ssl.PROTOCOL_SSLv23) self.rfile = SSLSocket.makefile('rb', self.rbufsize) self.wfile = SSLSocket.makefile('wb', self.wbufsize) if __name__ == "__main__": port = int(sys.argv[1]) if sys.argv[1:] else 8081 msg_type = sys.argv[2] if sys.argv[2:] else "XML" simple_http_notify_endpoint.main(port, SimpleHttpsNotifyEndpoint, msg_type, "https://")
120.416667
1,290
0.853518
393
4,335
9.300254
0.613232
0.024077
0.017784
0.019699
0
0
0
0
0
0
0
0.061199
0.080277
4,335
35
1,291
123.857143
0.85553
0.252134
0
0
0
0.095238
0.71199
0.676143
0
0
0
0
0
1
0.047619
false
0
0.142857
0
0.428571
0
0
0
0
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
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2641cd99f2f7315a4827c0a28a237e75426de0ad
419
py
Python
pathfinder/util/enums.py
Tenebrar/codebase
59c9a35289fb29afedad0e3edd0519b67372ef9f
[ "Unlicense" ]
1
2020-04-21T11:39:25.000Z
2020-04-21T11:39:25.000Z
pathfinder/util/enums.py
Tenebrar/codebase
59c9a35289fb29afedad0e3edd0519b67372ef9f
[ "Unlicense" ]
7
2020-02-12T01:08:01.000Z
2022-02-10T11:56:56.000Z
pathfinder/util/enums.py
Tenebrar/codebase
59c9a35289fb29afedad0e3edd0519b67372ef9f
[ "Unlicense" ]
null
null
null
from enum import Enum from typing import List, Tuple, Type def enum_to_choices(enum_class: Type[Enum]) -> List[Tuple[str, str]]: """ Convert an Enum into choices for a CharField where the stored values are the Enum names and the human-readable values are are the Enum values """ # TODO there is a class DjangoChoices, check it out return [(member.name, member.value) for member in enum_class]
34.916667
114
0.720764
67
419
4.447761
0.58209
0.060403
0.067114
0
0
0
0
0
0
0
0
0
0.205251
419
11
115
38.090909
0.894895
0.458234
0
0
0
0
0
0
0
0
0
0.090909
0
1
0.25
false
0
0.5
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
1
0
1
0
0
4
cd076a981b75e119af7277a3f887dc960eee31d2
139
py
Python
fakerdemo.py
feel-easy/myspider
dcc65032015d7dbd8bea78f846fd3cac7638c332
[ "Apache-2.0" ]
1
2019-02-28T10:16:00.000Z
2019-02-28T10:16:00.000Z
fakerdemo.py
wasalen/myspider
dcc65032015d7dbd8bea78f846fd3cac7638c332
[ "Apache-2.0" ]
null
null
null
fakerdemo.py
wasalen/myspider
dcc65032015d7dbd8bea78f846fd3cac7638c332
[ "Apache-2.0" ]
null
null
null
from faker import Factory fake = Factory().create('zh_CN') print(fake.address()) # print(dir(fake)) print(fake.url()) print(fake.chrome())
19.857143
32
0.71223
21
139
4.666667
0.619048
0.27551
0
0
0
0
0
0
0
0
0
0
0.086331
139
7
33
19.857143
0.771654
0.115108
0
0
0
0
0.040984
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.6
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
cd36ba5dd41da734b0efb8aef983c4ff57d02181
132
py
Python
pytgcalls/methods/groups/calls.py
fadhil-riyanto/radiovc
fe02a01ce10b93775fce8c569f6062d71b07b4d4
[ "MIT" ]
null
null
null
pytgcalls/methods/groups/calls.py
fadhil-riyanto/radiovc
fe02a01ce10b93775fce8c569f6062d71b07b4d4
[ "MIT" ]
null
null
null
pytgcalls/methods/groups/calls.py
fadhil-riyanto/radiovc
fe02a01ce10b93775fce8c569f6062d71b07b4d4
[ "MIT" ]
null
null
null
from ...scaffold import Scaffold class Calls(Scaffold): @property def calls(self): return self._call_holder.calls
16.5
38
0.689394
16
132
5.5625
0.6875
0
0
0
0
0
0
0
0
0
0
0
0.219697
132
7
39
18.857143
0.864078
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.8
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
0
0
0
1
1
0
0
4
cd5446dd4e108732003e2a968c5d5392fbb01c6a
197
py
Python
avsn/avsn/spiders/avsn.py
hao619/avsn
0b0d4d3c796fa79f410e4f4dac9f7a83b3816bbd
[ "Apache-2.0" ]
null
null
null
avsn/avsn/spiders/avsn.py
hao619/avsn
0b0d4d3c796fa79f410e4f4dac9f7a83b3816bbd
[ "Apache-2.0" ]
null
null
null
avsn/avsn/spiders/avsn.py
hao619/avsn
0b0d4d3c796fa79f410e4f4dac9f7a83b3816bbd
[ "Apache-2.0" ]
null
null
null
import scrapy class AvsnSpider(scrapy.Spider): name = 'avsn' allowed_domains = ['javlibrary.com'] start_urls = ['http://javlibrary.com/'] def parse(self, response): pass
17.909091
43
0.639594
22
197
5.636364
0.863636
0.209677
0
0
0
0
0
0
0
0
0
0
0.22335
197
10
44
19.7
0.810458
0
0
0
0
0
0.203046
0
0
0
0
0
0
1
0.142857
false
0.142857
0.142857
0
0.857143
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
cd7188acc7b4d87a051096c612aa017eabce1e5a
899
py
Python
apps/schedules/migrations/0002_auto_20181129_1535.py
seanlefevre/openduty
34ab21117f114ccc808d8b0aa2cb801c819bdb86
[ "MIT" ]
145
2016-04-11T06:53:13.000Z
2022-03-22T05:15:49.000Z
apps/schedules/migrations/0002_auto_20181129_1535.py
seanlefevre/openduty
34ab21117f114ccc808d8b0aa2cb801c819bdb86
[ "MIT" ]
78
2017-09-24T10:59:49.000Z
2022-02-12T07:36:27.000Z
apps/schedules/migrations/0002_auto_20181129_1535.py
seanlefevre/openduty
34ab21117f114ccc808d8b0aa2cb801c819bdb86
[ "MIT" ]
30
2016-04-11T06:53:16.000Z
2021-12-29T11:39:26.000Z
# Generated by Django 2.1.3 on 2018-11-29 15:35 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('services', '0002_auto_20181129_1535'), ('schedules', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='schedulepolicyrule', name='group_id', ), migrations.RemoveField( model_name='schedulepolicyrule', name='schedule', ), migrations.RemoveField( model_name='schedulepolicyrule', name='schedule_policy', ), migrations.RemoveField( model_name='schedulepolicyrule', name='user_id', ), migrations.DeleteModel( name='SchedulePolicy', ), migrations.DeleteModel( name='SchedulePolicyRule', ), ]
24.297297
48
0.557286
70
899
7
0.557143
0.22449
0.212245
0.244898
0.457143
0.457143
0.244898
0
0
0
0
0.058528
0.334816
899
36
49
24.972222
0.76087
0.050056
0
0.533333
1
0
0.2277
0.026995
0
0
0
0
0
1
0
false
0
0.033333
0
0.133333
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
cd83fe440fdb2803282214d2e9f303450e3b9053
50
py
Python
generator/system/control_unit/controller/controller.py
SimkaNed/lw_cw
72d878820f20ac73dc7c14f5ccd70471dda4d6da
[ "MIT" ]
null
null
null
generator/system/control_unit/controller/controller.py
SimkaNed/lw_cw
72d878820f20ac73dc7c14f5ccd70471dda4d6da
[ "MIT" ]
null
null
null
generator/system/control_unit/controller/controller.py
SimkaNed/lw_cw
72d878820f20ac73dc7c14f5ccd70471dda4d6da
[ "MIT" ]
null
null
null
# THE IMPLEMENTATION OF THE CONTROLLER GOES HERE
16.666667
48
0.8
7
50
5.714286
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.18
50
2
49
25
0.97561
0.92
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
26b42a1e4046cb063644bc97d73ef558f5f359f6
3,586
py
Python
PythonProjects/99-CapstoneProject-202020-DavidAndVIbha/libs/rosebot_line_follower.py
much2mutch/csse120-public
4f862a6deb7a5373fb5723fb2a23e4042e4d4157
[ "MIT" ]
null
null
null
PythonProjects/99-CapstoneProject-202020-DavidAndVIbha/libs/rosebot_line_follower.py
much2mutch/csse120-public
4f862a6deb7a5373fb5723fb2a23e4042e4d4157
[ "MIT" ]
null
null
null
PythonProjects/99-CapstoneProject-202020-DavidAndVIbha/libs/rosebot_line_follower.py
much2mutch/csse120-public
4f862a6deb7a5373fb5723fb2a23e4042e4d4157
[ "MIT" ]
null
null
null
""" Capstone Team Project. Code to run on the EV3 robot (NOT on a laptop). This code defines the LineFollower class which is used to follow a black line by using the downward-facing Color Sensor. Authors: Your professors (for the framework) and PUT_YOUR_NAMES_HERE. Winter term, 2019-2020. """ # TODO: Put the name of EACH team member who contributes # to this module in the above. import time import libs.rosebot_ev3dev_api as ev3dev import libs.rosebot_color_sensor as color import libs.rosebot_drive_system as drive ############################################################################### # STUDENTS: OPTIONALLY, extend the code in this module to contain methods like # those specified below. ############################################################################### ############################################################################### # LineFollower ############################################################################### class LineFollower(object): """ Methods using the reflected light intensity to drive the robot. """ def __init__(self, color_sensor, drive_system): """ Constructs LineFollower to track black lines. :type color_sensor: color.ColorSensor :type drive_system: drive.DriveSystem """ self.color_sensor = color_sensor self.drive_system = drive_system self.white_reading = 95 # Approximation until a calibration is done. self.black_reading = 5 # Approximation until a calibration is done. def calibrate(self): """ Calibrates the white and black values for the given room conditions. Asks the user to place the robot on white first, then hit enter to take the reading. Prints (and stores) the white_reading. Then this method asks the user to place the robot on black, then hit enter to take the black reading. Prints (and stores) the black_reading. """ def follow_line_inside_ccw(self, max_speed, duration_s): """ Makes the robot follow a line around in a circle. In this version of line following the robot goes straight on white and does an arc left turn when on black. - White is might be 90+ values of the reflected light intensity - Black is might be as low as 5 on the reflected light intensity but here white is anything above light_threshold, otherwise black. This method should make the robot follow the inside of a line in a counter-clockwise direction at the given speed. After duration_s seconds have passed this method will stop both motors. :param max_speed: 1 to 100 value for the max wheel motor speed :type max_speed: int :param duration_s: How long to continue this action (in seconds) :type duration_s: float """ def stay_on_line(self, max_speed, duration_s): """ Makes the robot follow a arbitrary line that turns left and right. When the robot is on black it continues straight, but when the robot is on white it stops and looks (arcs left for a while, arcs right for while) to try to find the line. Once the line is found again it continues moving forward. After duration_s seconds have passed this method will stop both motors. :param max_speed: 1 to 100 value for the max wheel motor speed :type max_speed: int :param duration_s: How long to continue this action (in seconds) :type duration_s: float """
42.690476
79
0.628555
484
3,586
4.56405
0.369835
0.032594
0.023087
0.03531
0.323223
0.286102
0.234495
0.234495
0.209144
0.209144
0
0.009184
0.240937
3,586
83
80
43.204819
0.802351
0.660904
0
0
0
0
0
0
0
0
0
0.012048
0
1
0.307692
false
0
0.307692
0
0.692308
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
1
0
1
0
0
4
26c8a848ec056d2dc5521555a036c77139a6cd84
666
py
Python
opium/config.py
panagiks/opium
267ef4d24eb66c803c0941d614e731cd4456b8bd
[ "MIT" ]
2
2020-10-26T11:40:00.000Z
2020-10-28T07:54:57.000Z
opium/config.py
panagiks/opium
267ef4d24eb66c803c0941d614e731cd4456b8bd
[ "MIT" ]
null
null
null
opium/config.py
panagiks/opium
267ef4d24eb66c803c0941d614e731cd4456b8bd
[ "MIT" ]
null
null
null
from dataclasses import dataclass, field from typing import List from yaab.adapter import BaseAdapter @dataclass class OpiumOKDConfig(BaseAdapter): base_url: str = field(metadata={"transformations": ("OPIUM_OKD_URL",)}) token: str = field(metadata={"transformations": ("OPIUM_OKD_TOKEN",)}) @dataclass class OpiumConfig(BaseAdapter): okd: OpiumOKDConfig = field(metadata={"transformations": (OpiumOKDConfig,)}) project: str = field(metadata={"transformations": ("OPIUM_PROJECT",)}) deployment_configs: List[str] = field( metadata={ "transformations": ("OPIUM_DEPLOYMENT_CONFIGS", lambda el: el.split(",")) } )
31.714286
85
0.701201
66
666
6.939394
0.409091
0.141921
0.305677
0.270742
0.327511
0.170306
0
0
0
0
0
0
0.160661
666
20
86
33.3
0.81932
0
0
0.125
0
0
0.211712
0.036036
0
0
0
0
0
1
0
true
0
0.1875
0
0.625
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
f82724ace48aebab7c0f797a8160d54aa066f827
115
py
Python
backend/Backendapi/booklist/tests.py
f0rdream/SkyRead
798b4dd35b7e6be41e5fed4537d3f6034d20494e
[ "MIT" ]
null
null
null
backend/Backendapi/booklist/tests.py
f0rdream/SkyRead
798b4dd35b7e6be41e5fed4537d3f6034d20494e
[ "MIT" ]
null
null
null
backend/Backendapi/booklist/tests.py
f0rdream/SkyRead
798b4dd35b7e6be41e5fed4537d3f6034d20494e
[ "MIT" ]
null
null
null
from django.test import TestCase # Create your tests here. import jieba list = "&1&2" a =list.split("&") print a
16.428571
32
0.695652
19
115
4.210526
0.842105
0
0
0
0
0
0
0
0
0
0
0.021053
0.173913
115
7
33
16.428571
0.821053
0.2
0
0
0
0
0.054945
0
0
0
0
0
0
0
null
null
0
0.4
null
null
0.2
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
1
0
0
0
1
0
0
0
0
4
f85d47f9b9191cb76f28fe0421bcfa8b762f3e16
189
py
Python
podcast/apps.py
richardcornish/django-applepodcast
50732acfbe1ca258e5afb44c117a6ac5fa0c1219
[ "BSD-3-Clause" ]
7
2017-11-18T13:02:13.000Z
2021-07-31T21:55:24.000Z
podcast/apps.py
dmitriydef/django-applepodcast
50732acfbe1ca258e5afb44c117a6ac5fa0c1219
[ "BSD-3-Clause" ]
24
2017-07-17T21:53:58.000Z
2018-02-16T07:13:39.000Z
podcast/apps.py
dmitriydef/django-applepodcast
50732acfbe1ca258e5afb44c117a6ac5fa0c1219
[ "BSD-3-Clause" ]
4
2017-09-21T12:43:54.000Z
2020-07-19T21:56:30.000Z
from __future__ import unicode_literals from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class PodcastConfig(AppConfig): name = _('podcast')
21
55
0.804233
23
189
6.26087
0.73913
0.138889
0
0
0
0
0
0
0
0
0
0
0.137566
189
8
56
23.625
0.883436
0
0
0
0
0
0.037037
0
0
0
0
0
0
1
0
false
0
0.6
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
f8860d3688ab9665360568ecb6fa484c1f4a91b7
865
py
Python
33-Mor-se-Coding/test_MorseCode.py
PawelZabinski/ocr-code-challenges-files
24d30de694a00f2190790003778c6d65b8b2554b
[ "MIT" ]
null
null
null
33-Mor-se-Coding/test_MorseCode.py
PawelZabinski/ocr-code-challenges-files
24d30de694a00f2190790003778c6d65b8b2554b
[ "MIT" ]
null
null
null
33-Mor-se-Coding/test_MorseCode.py
PawelZabinski/ocr-code-challenges-files
24d30de694a00f2190790003778c6d65b8b2554b
[ "MIT" ]
null
null
null
import unittest from main import encodeMorsecode, decodeMorsecode class TestMorseCode(unittest.TestCase): def test_plain_text_to_morse(self): self.assertEqual('- .... .. ... | .. ... | - .... . | ..-. .. .-. ... - | - . ... - | -.-. .- ... . .-.-.-', encodeMorsecode('This is the first test case.')) def test_morse_to_plain_text(self): self.assertEqual('NOW TESTING THE DECODE FUNCTIONALITY, TEST NUMBER 2.', decodeMorsecode('-. --- .-- | - . ... - .. -. --. | - .... . | -.. . -.-. --- -.. . | ..-. ..- -. -.-. - .. --- -. .- .-.. .. - -.-- --..-- | - . ... - | -. ..- -- -... . .-. | ..--- .-.-.-')) def test_handle_special_characters(self): self.assertEqual('.... . .-.. .-.. --- --..-- | .-- --- .-. .-.. -.. | .-... | .--. . --- .--. .-.. . -.-.--', encodeMorsecode('Hello, world & people!')) if __name__ == '__main__': unittest.main()
54.0625
269
0.453179
62
865
6.016129
0.580645
0.0563
0.152815
0.182306
0
0
0
0
0
0
0
0.001427
0.189595
865
16
270
54.0625
0.53067
0
0
0
0
0.272727
0.531178
0
0
0
0
0
0.272727
1
0.272727
false
0
0.181818
0
0.545455
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
f886d1ecd2f1d01ffba5fad14f7da3fb20a444ab
46
py
Python
idioms_examples/dict_comprehension/bad.py
jjmerchante/Pythonic-webserver
b57fe35975b60d7fe8d04d63094068e54d9e3ee8
[ "Apache-2.0" ]
3
2017-11-06T14:00:30.000Z
2018-04-07T08:02:40.000Z
idioms_examples/dict_comprehension/bad.py
jjmerchante/Pythonic-webserver
b57fe35975b60d7fe8d04d63094068e54d9e3ee8
[ "Apache-2.0" ]
null
null
null
idioms_examples/dict_comprehension/bad.py
jjmerchante/Pythonic-webserver
b57fe35975b60d7fe8d04d63094068e54d9e3ee8
[ "Apache-2.0" ]
null
null
null
d = {} for k in range(10000): d[k] = k**2
11.5
22
0.456522
10
46
2.1
0.7
0
0
0
0
0
0
0
0
0
0
0.1875
0.304348
46
3
23
15.333333
0.46875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f88c8a17ecf3b5fbab1d5ca10385a7434d956b84
80
py
Python
t_10_brief_tour_of_the_standard_library/t_10_4_error_output_redirection_and_program_termination/main.py
naokiur/Python-tutorial
7b03dc8fd2e5992859fde00bfe2873b4fb7ca5e5
[ "Apache-2.0" ]
null
null
null
t_10_brief_tour_of_the_standard_library/t_10_4_error_output_redirection_and_program_termination/main.py
naokiur/Python-tutorial
7b03dc8fd2e5992859fde00bfe2873b4fb7ca5e5
[ "Apache-2.0" ]
null
null
null
t_10_brief_tour_of_the_standard_library/t_10_4_error_output_redirection_and_program_termination/main.py
naokiur/Python-tutorial
7b03dc8fd2e5992859fde00bfe2873b4fb7ca5e5
[ "Apache-2.0" ]
null
null
null
import sys sys.stderr.write('Warning, log file not found starting a new one\n')
26.666667
68
0.7625
15
80
4.066667
0.933333
0
0
0
0
0
0
0
0
0
0
0
0.1375
80
2
69
40
0.884058
0
0
0
0
0
0.6
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f897b4ce72378b8d41c1bfd99399eeb3aca9bfeb
271
py
Python
netmiko1.py
kclopp/pyNetEng
17a512e107a51871ff46a89655f2fdc05985a65a
[ "Unlicense" ]
null
null
null
netmiko1.py
kclopp/pyNetEng
17a512e107a51871ff46a89655f2fdc05985a65a
[ "Unlicense" ]
null
null
null
netmiko1.py
kclopp/pyNetEng
17a512e107a51871ff46a89655f2fdc05985a65a
[ "Unlicense" ]
null
null
null
from netmiko import ConnectHandler iosv_l2_s1 = { 'device_type': 'cisco_ios', 'ip': '192.168.122.11', 'username': 'kevin', 'password': 'cisco' } net_connect = ConnectHandler(**iosv_l2_s1) output = net_connect.send_command('show ip int br') print(output)
22.583333
51
0.686347
37
271
4.783784
0.756757
0.20339
0.225989
0.248588
0
0
0
0
0
0
0
0.065789
0.158672
271
12
52
22.583333
0.710526
0
0
0
0
0
0.279412
0
0
0
0
0
0
1
0
false
0.1
0.1
0
0.1
0.1
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
f8b21b0007e2eae5da4e8163e8b2fb8ecd00b164
136
py
Python
lambda/src/main.py
TanguyCme/python3-lambda-layers
4ab0e27dda7d0614d111e721bf162fcf8d58e4db
[ "MIT" ]
null
null
null
lambda/src/main.py
TanguyCme/python3-lambda-layers
4ab0e27dda7d0614d111e721bf162fcf8d58e4db
[ "MIT" ]
null
null
null
lambda/src/main.py
TanguyCme/python3-lambda-layers
4ab0e27dda7d0614d111e721bf162fcf8d58e4db
[ "MIT" ]
2
2020-05-31T20:18:49.000Z
2021-04-05T03:23:58.000Z
import json import pandas as pd def handle(event, context): MyEmptydf = pd.DataFrame({'A' : []}) return MyEmptydf.to_string()
17
40
0.676471
18
136
5.055556
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.191176
136
7
41
19.428571
0.827273
0
0
0
0
0
0.007407
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
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
0
0
1
0
1
0
0
4
3e5ac79567fb35cca285264cd473bcdba0e08021
273
py
Python
stacks/XIAOMATECH/1.0/services/KDC/package/scripts/status_params.py
tvorogme/dataops
acfa21df42a20768c004c6630a064f4e38e280b2
[ "Apache-2.0" ]
3
2019-08-13T01:44:16.000Z
2019-12-10T04:05:56.000Z
stacks/XIAOMATECH/1.0/services/KDC/package/scripts/status_params.py
tvorogme/dataops
acfa21df42a20768c004c6630a064f4e38e280b2
[ "Apache-2.0" ]
null
null
null
stacks/XIAOMATECH/1.0/services/KDC/package/scripts/status_params.py
tvorogme/dataops
acfa21df42a20768c004c6630a064f4e38e280b2
[ "Apache-2.0" ]
7
2019-05-29T17:35:25.000Z
2021-12-04T07:55:10.000Z
#!/usr/bin/env python from resource_management import * config = Script.get_config() #kdc_piddir = config['configurations']['krb5-env']['kdc.piddir'] #kdc_pidfile = format("{kdc_piddir}/kdc-env.pid") krb5_template_config = config['configurations']['krb5-env']['content']
30.333333
70
0.739927
36
273
5.416667
0.555556
0.138462
0.246154
0.276923
0
0
0
0
0
0
0
0.011858
0.07326
273
8
71
34.125
0.758893
0.479853
0
0
0
0
0.208633
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
3e74bb0cb3af0174330e585642c08a397836f541
3,083
py
Python
mri_works/NodeEditor/modules/Tools/ListOperation.py
montigno/mri_works
8ec6ff1500aa34d3540e44e4b0148023cf821f61
[ "CECILL-B" ]
2
2020-08-20T21:00:53.000Z
2021-08-16T15:28:51.000Z
mri_works/NodeEditor/modules/Tools/ListOperation.py
montigno/mri_works
8ec6ff1500aa34d3540e44e4b0148023cf821f61
[ "CECILL-B" ]
3
2020-09-24T06:50:43.000Z
2020-12-15T11:02:04.000Z
mri_works/NodeEditor/modules/Tools/ListOperation.py
montigno/mri_works
8ec6ff1500aa34d3540e44e4b0148023cf821f61
[ "CECILL-B" ]
1
2020-08-20T21:00:59.000Z
2020-08-20T21:00:59.000Z
class addSimpleValues: def __init__(self, in1=0.0, in2=0.0): self.result = in1 + in2 def valAdd(self: 'float'): return self.result ############################################################### class subtractSimpleValues: def __init__(self, in1=0.0, in2=0.0): self.result = in1 - in2 def valSub(self: 'float'): return self.result ############################################################### class MultiplySimpleValues: def __init__(self, in1=0.0, in2=0.0): self.result = in1 * in2 def valMult(self: 'float'): return self.result ############################################################### class DivideSimpleValues: def __init__(self, in1=0.0, in2=0.0): try: self.result = in1 / in2 except Exception as e: self.result = in1 def valDiv(self: 'float'): return self.result ############################################################### class addListValues: def __init__(self, list1=[0.0], list2=[0.0]): import numpy as np self.result = np.add(list1, list2) def listAdd(self: 'list_float'): return self.result ############################################################### class subtractListValues: def __init__(self, list1=[0.0], list2=[0.0]): import numpy as np self.result = np.subtract(list1, list2) def listSub(self: 'list_float'): return self.result ############################################################### class MultiplyListValues: def __init__(self, list1=[0.0], list2=[0.0]): import numpy as np self.result = np.multiply(list1, list2) def listMult(self: 'list_float'): return self.result ############################################################### class DivideListValues: def __init__(self, list1=[0.0], list2=[0.0]): import numpy as np try: self.result = np.divide(list1, list2) except Exception as e: self.result = list1 def listDiv(self: 'list_float'): return self.result ############################################################### class NegativeListValues: def __init__(self, listFloat=[0.0]): import numpy as np self.result = np.negative(listFloat) def listDiv(self: 'list_float'): return self.result ############################################################### class MeanListValues: def __init__(self, listFloat=[0.0]): import numpy as np self.result = np.mean(listFloat) def listDiv(self: 'float'): return self.result ############################################################### class Add_Int: def __init__(self, in1_Int=0, in2_Int=0): self.int_inc = in1_Int + in2_Int def out_Incr(self: 'int'): return self.int_inc ###############################################################
23.180451
64
0.439507
297
3,083
4.37037
0.16835
0.169492
0.09322
0.161787
0.640216
0.640216
0.48151
0.402928
0.402928
0.318952
0
0.032986
0.252676
3,083
132
65
23.356061
0.530382
0
0
0.477612
0
0
0.034559
0
0
0
0
0
0
1
0.328358
false
0
0.089552
0.164179
0.746269
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
3e7773edebb79140ace8eaebf3f2997e9c542c7a
329
py
Python
textattack/models/helpers/utils.py
cclauss/TextAttack
98b8d6102aa47bf3c41afedace0215d48f8ed046
[ "MIT" ]
2
2021-02-22T12:15:27.000Z
2021-05-02T15:22:05.000Z
textattack/models/helpers/utils.py
53X/TextAttack
e6a7969abc1e28a2a8a7e2ace709b78eb9dc94be
[ "MIT" ]
null
null
null
textattack/models/helpers/utils.py
53X/TextAttack
e6a7969abc1e28a2a8a7e2ace709b78eb9dc94be
[ "MIT" ]
1
2021-11-12T05:26:21.000Z
2021-11-12T05:26:21.000Z
import os import torch from textattack.shared import utils def load_cached_state_dict(model_folder_path): model_folder_path = utils.download_if_needed(model_folder_path) model_path = os.path.join(model_folder_path, "model.bin") state_dict = torch.load(model_path, map_location=utils.device) return state_dict
25.307692
67
0.796353
50
329
4.88
0.48
0.180328
0.245902
0.245902
0
0
0
0
0
0
0
0
0.130699
329
12
68
27.416667
0.853147
0
0
0
0
0
0.027356
0
0
0
0
0
0
1
0.125
false
0
0.375
0
0.625
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
3e780d94f7d3d0ee884f3a86e453922c89ca61df
281
py
Python
backend/users/admin.py
marakaci/Likemind
5066d934dae9d424db8c46d31f291ad4e560632a
[ "MIT" ]
1
2019-05-06T10:03:34.000Z
2019-05-06T10:03:34.000Z
backend/users/admin.py
marakaci/Likemind
5066d934dae9d424db8c46d31f291ad4e560632a
[ "MIT" ]
null
null
null
backend/users/admin.py
marakaci/Likemind
5066d934dae9d424db8c46d31f291ad4e560632a
[ "MIT" ]
1
2021-09-14T11:46:27.000Z
2021-09-14T11:46:27.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from users.models import Person, Friend @admin.register(Person) class PersonAdmin(admin.ModelAdmin): pass @admin.register(Friend) class FriendAdmin(admin.ModelAdmin): pass
18.733333
39
0.765125
35
281
6
0.6
0.12381
0.180952
0
0
0
0
0
0
0
0
0.004115
0.135231
281
15
40
18.733333
0.860082
0.074733
0
0.222222
0
0
0
0
0
0
0
0
0
1
0
true
0.222222
0.333333
0
0.555556
0
0
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
0
1
1
1
0
0
0
0
4
e41050bddc615d5b55cbc04ec2a841a33cfbf184
195
py
Python
bin/ominoes/pentominoes-plus-square-tetromino-cross-1.py
tiwo/puzzler
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
[ "Intel" ]
null
null
null
bin/ominoes/pentominoes-plus-square-tetromino-cross-1.py
tiwo/puzzler
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
[ "Intel" ]
null
null
null
bin/ominoes/pentominoes-plus-square-tetromino-cross-1.py
tiwo/puzzler
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
[ "Intel" ]
1
2022-01-02T16:54:14.000Z
2022-01-02T16:54:14.000Z
#!/usr/bin/env python # $Id$ """5380 solutions""" import puzzler from puzzler.puzzles.pentominoes import PentominoesPlusSquareTetrominoCross1 puzzler.run(PentominoesPlusSquareTetrominoCross1)
19.5
76
0.820513
18
195
8.888889
0.777778
0
0
0
0
0
0
0
0
0
0
0.03352
0.082051
195
9
77
21.666667
0.860335
0.205128
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e43ddab7976d73bc66df25c889f47746a4fe1a2f
122
py
Python
text/_cascade/_typing/numeric/__init__.py
jedhsu/text
8525b602d304ac571a629104c48703443244545c
[ "Apache-2.0" ]
null
null
null
text/_cascade/_typing/numeric/__init__.py
jedhsu/text
8525b602d304ac571a629104c48703443244545c
[ "Apache-2.0" ]
null
null
null
text/_cascade/_typing/numeric/__init__.py
jedhsu/text
8525b602d304ac571a629104c48703443244545c
[ "Apache-2.0" ]
null
null
null
from .number import Number from .integer import Integer from .percentage import Percentage from .fraction import Fraction
24.4
34
0.836066
16
122
6.375
0.375
0
0
0
0
0
0
0
0
0
0
0
0.131148
122
4
35
30.5
0.962264
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e453a30c87e391c892bc69c90868440df597f734
420
py
Python
gem_controllers/__init__.py
upb-lea/gem_control
242393dce0bbcb3a982594318daa1757687b1d3a
[ "MIT" ]
15
2021-05-03T18:31:22.000Z
2022-03-15T01:56:33.000Z
gem_controllers/__init__.py
upb-lea/gem_control
242393dce0bbcb3a982594318daa1757687b1d3a
[ "MIT" ]
5
2021-05-09T19:16:35.000Z
2021-06-08T20:44:22.000Z
gem_controllers/__init__.py
upb-lea/gem_control
242393dce0bbcb3a982594318daa1757687b1d3a
[ "MIT" ]
null
null
null
from . import stages from . import utils from . import parameter_reader from .gem_controller import GemController from .current_controller import CurrentController from .cascaded_controller import CascadedController from .pi_current_controller import PICurrentController from .torque_controller import TorqueController from .pi_speed_controller import PISpeedController from .gem_adapter import GymElectricMotorAdapter
35
54
0.878571
47
420
7.638298
0.446809
0.267409
0.128134
0
0
0
0
0
0
0
0
0
0.097619
420
11
55
38.181818
0.94723
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
e47c30b26068ccee8e773eb65e1cee59ea44fcf2
271
py
Python
reportbuilder/ReportBuilder.py
giovannicuriel/report_builder
e728e77d7647f248198e39521278ed246171b256
[ "BSD-2-Clause" ]
null
null
null
reportbuilder/ReportBuilder.py
giovannicuriel/report_builder
e728e77d7647f248198e39521278ed246171b256
[ "BSD-2-Clause" ]
null
null
null
reportbuilder/ReportBuilder.py
giovannicuriel/report_builder
e728e77d7647f248198e39521278ed246171b256
[ "BSD-2-Clause" ]
1
2019-11-25T12:51:29.000Z
2019-11-25T12:51:29.000Z
class ReportBuilder: def __init__(self, filename): self.filename = filename def buildReport(self, data): print('Calling buildReport from ReportBuilder.') print('Filename is: {}'.format(self.filename)) raise NotImplementedError()
27.1
56
0.664207
26
271
6.769231
0.576923
0.204545
0
0
0
0
0
0
0
0
0
0
0.228782
271
9
57
30.111111
0.842105
0
0
0
0
0
0.2
0
0
0
0
0
0
1
0.285714
false
0
0
0
0.428571
0.285714
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
e49f5672eecfca6ab858afc22151ae3e7901a201
316
py
Python
project/efrain/routes.py
ArturoMorales93/Plataformas_II_Project
7dd54c8c5159a1eb8c761a3a8e4f4bfb96a078eb
[ "Unlicense" ]
1
2021-01-29T15:16:49.000Z
2021-01-29T15:16:49.000Z
project/efrain/routes.py
ArturoMorales93/Plataformas_II_Project
7dd54c8c5159a1eb8c761a3a8e4f4bfb96a078eb
[ "Unlicense" ]
12
2021-02-01T20:31:31.000Z
2021-04-15T07:34:54.000Z
project/efrain/routes.py
ArturoMorales93/Plataformas_II_Project
7dd54c8c5159a1eb8c761a3a8e4f4bfb96a078eb
[ "Unlicense" ]
1
2021-03-08T23:34:37.000Z
2021-03-08T23:34:37.000Z
from flask import render_template from . import efrain @efrain.route('/es/rpa', methods=['GET']) @efrain.route('/rpa', methods=['GET']) def es_efrain(): return render_template('es_index_efrain.html') @efrain.route('/en/rpa', methods=['GET']) def en_efrain(): return render_template('en_index_efrain.html')
26.333333
50
0.71519
45
316
4.822222
0.355556
0.193548
0.179724
0.147465
0
0
0
0
0
0
0
0
0.101266
316
12
51
26.333333
0.764085
0
0
0
0
0
0.211356
0
0
0
0
0
0
1
0.222222
true
0
0.222222
0.222222
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
1
0
0
4
e4e449838a9f1e6d61c91eb3ee7249f45c3ca250
749
py
Python
tests/unit/test_api_system.py
cglewis/vent
73723271cea018afd5345baa782cc903ebf6825a
[ "Apache-2.0" ]
75
2016-07-02T21:50:32.000Z
2022-02-04T12:39:00.000Z
tests/unit/test_api_system.py
CyberReboot/vent
5ca8baf82b4198f38609e1fc471ebd278335536f
[ "Apache-2.0" ]
1,317
2016-07-03T21:57:15.000Z
2019-12-24T21:49:20.000Z
tests/unit/test_api_system.py
cglewis/vent
73723271cea018afd5345baa782cc903ebf6825a
[ "Apache-2.0" ]
75
2016-07-02T21:50:41.000Z
2020-11-26T14:38:28.000Z
from vent.api.system import System def test_configure(): """ Test the configure function """ system = System() system.configure() def test_gpu(): """ Test the gpu function """ system = System() system.gpu() def test_history(): """ Test the history function """ system = System() system.history() def test_restore(): """ Test the restore function """ system = System() system.restore('foo') def test_rollback(): """ Test the rollback function """ system = System() system.rollback() def test_stop(): """ Test the stop function """ system = System() system.stop() def test_upgrade(): """ Test the upgrade function """ system = System() system.upgrade()
17.022727
39
0.606142
84
749
5.321429
0.202381
0.375839
0.313199
0.407159
0
0
0
0
0
0
0
0
0.248331
749
43
40
17.418605
0.793961
0.244326
0
0.318182
0
0
0.005747
0
0
0
0
0
0
1
0.318182
false
0
0.045455
0
0.363636
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
0
0
0
0
4
9018b12de328e89dfad1af8a0685cd77307918f6
45
py
Python
demo/classification/fast_neural_network/kaggle/__init__.py
DanielMorales9/LinearRegression
7c905e5317a2eb4cc3b2cab275bbcec8e9db57f9
[ "MIT" ]
null
null
null
demo/classification/fast_neural_network/kaggle/__init__.py
DanielMorales9/LinearRegression
7c905e5317a2eb4cc3b2cab275bbcec8e9db57f9
[ "MIT" ]
null
null
null
demo/classification/fast_neural_network/kaggle/__init__.py
DanielMorales9/LinearRegression
7c905e5317a2eb4cc3b2cab275bbcec8e9db57f9
[ "MIT" ]
null
null
null
from .store import Store __all__ = ["Store"]
15
24
0.711111
6
45
4.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.155556
45
3
25
15
0.736842
0
0
0
0
0
0.108696
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
5f44fccd7a61dd18ec31cbad27dbb9692bd63a96
253
py
Python
pystratis/api/blockstore/requestmodels/getutxosetforaddressrequest.py
TjadenFroyda/pyStratis
9cc7620d7506637f8a2b84003d931eceb36ac5f2
[ "MIT" ]
8
2021-06-30T20:44:22.000Z
2021-12-07T14:42:22.000Z
pystratis/api/blockstore/requestmodels/getutxosetforaddressrequest.py
TjadenFroyda/pyStratis
9cc7620d7506637f8a2b84003d931eceb36ac5f2
[ "MIT" ]
2
2021-07-01T11:50:18.000Z
2022-01-25T18:39:49.000Z
pystratis/api/blockstore/requestmodels/getutxosetforaddressrequest.py
TjadenFroyda/pyStratis
9cc7620d7506637f8a2b84003d931eceb36ac5f2
[ "MIT" ]
4
2021-07-01T04:36:42.000Z
2021-09-17T10:54:19.000Z
from pystratis.api import Model from pystratis.core.types import Address class GetUTXOSetForAddressRequest(Model): """A request model for the GetUTXOSetForAddressRequest. Args: address (int): The address. """ address: Address
21.083333
59
0.72332
27
253
6.777778
0.592593
0.142077
0
0
0
0
0
0
0
0
0
0
0.201581
253
11
60
23
0.905941
0.359684
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
5f7c340f6f172f4486cd0eadb52404083c53d7e6
494
py
Python
reseval/__init__.py
reseval/reseval
322e28ef080e4b28585bcf85ae63af15f8d158de
[ "MIT" ]
22
2022-03-08T23:40:38.000Z
2022-03-19T18:20:27.000Z
reseval/__init__.py
reseval/reseval
322e28ef080e4b28585bcf85ae63af15f8d158de
[ "MIT" ]
4
2022-03-11T14:42:04.000Z
2022-03-29T16:06:42.000Z
reseval/__init__.py
reseval/reseval
322e28ef080e4b28585bcf85ae63af15f8d158de
[ "MIT" ]
1
2022-03-17T10:33:40.000Z
2022-03-17T10:33:40.000Z
from .constants import * from .core import * from .error import * from .create import create from .credentials import credentials from .extend import extend from .destroy import destroy from .monitor import monitor from .results import results from .pay import pay from . import app from . import convert from . import crowdsource from . import database from . import load from . import npm from . import random from . import server from . import stats from . import storage from . import test
22.454545
36
0.781377
70
494
5.514286
0.328571
0.284974
0
0
0
0
0
0
0
0
0
0
0.17004
494
21
37
23.52381
0.941463
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
5f81870812bcc3df654448dbdadb5d1165e2967d
702
py
Python
Lab3-XGBoost/src/metric.py
v-liuwei/USTC2020-
0ec4cf48cbd42a3cd71f8ed7c27201beaee19a8e
[ "MIT" ]
4
2021-06-18T13:45:05.000Z
2021-12-26T07:18:23.000Z
Lab3-XGBoost/src/metric.py
v-liuwei/USTC2020-
0ec4cf48cbd42a3cd71f8ed7c27201beaee19a8e
[ "MIT" ]
null
null
null
Lab3-XGBoost/src/metric.py
v-liuwei/USTC2020-
0ec4cf48cbd42a3cd71f8ed7c27201beaee19a8e
[ "MIT" ]
null
null
null
import numpy as np def accuracy(ytrue: np.ndarray, ypred: np.ndarray): return np.sum(ytrue == ypred) / ytrue.size def error_rate(ytrue: np.ndarray, ypred: np.ndarray): return np.sum(ytrue != ypred) / ytrue.size def mean_squared_error(ytrue: np.ndarray, ypred: np.ndarray): return np.sum((ytrue - ypred) ** 2) / ytrue.size def rooted_mean_squared_error(ytrue: np.ndarray, ypred: np.ndarray): return np.sqrt(np.sum((ytrue - ypred) ** 2) / ytrue.size) def f1_score(ytrue: np.ndarray, ypred: np.ndarray): tp = np.sum(np.logical_and(ytrue == 1, ypred == 1)) recall = tp / np.sum(ytrue == 1) prec = tp / np.sum(ypred == 1) return 2 * prec * recall / (prec + recall)
28.08
68
0.65812
111
702
4.09009
0.243243
0.198238
0.154185
0.209251
0.678414
0.678414
0.61674
0.61674
0.526432
0.526432
0
0.014011
0.18661
702
24
69
29.25
0.781086
0
0
0
0
0
0
0
0
0
0
0
0
1
0.357143
false
0
0.071429
0.285714
0.785714
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
5fa83396623bf271253ce47dd702b3ec43a4aa37
278
py
Python
musikk/test/test_utils.py
stevebeard/musikk
f878038a3f20a092832fe492500b6dbb896a46ed
[ "MIT" ]
null
null
null
musikk/test/test_utils.py
stevebeard/musikk
f878038a3f20a092832fe492500b6dbb896a46ed
[ "MIT" ]
1
2018-05-12T13:38:18.000Z
2018-05-12T13:38:18.000Z
musikk/test/test_utils.py
stevebeard/musikk
f878038a3f20a092832fe492500b6dbb896a46ed
[ "MIT" ]
null
null
null
import os dir_path = os.path.dirname(os.path.realpath(__file__)) import pathlib def get_test_filepath(filename): return os.path.join(dir_path, filename) def get_test_file_uri(filename): filepath = get_test_filepath(filename) return pathlib.Path(filepath).as_uri()
27.8
54
0.776978
42
278
4.809524
0.404762
0.089109
0.09901
0.227723
0.287129
0
0
0
0
0
0
0
0.118705
278
10
55
27.8
0.82449
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.125
0.75
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
3988d1e7173f1884a6b59d23ea4d502c0b5c4de5
200
py
Python
pictures/admin.py
PremPawar/djangogirls
4dbe9c39577d360e453c82969cf7c7dcabe4f260
[ "BSD-3-Clause" ]
1
2020-04-08T00:12:01.000Z
2020-04-08T00:12:01.000Z
pictures/admin.py
madihakh/djangogirls
333693ff66fdfc8f1cdb948dfe3002c01576e18e
[ "BSD-3-Clause" ]
6
2020-06-06T01:38:47.000Z
2021-12-13T20:36:27.000Z
pictures/admin.py
madihakh/djangogirls
333693ff66fdfc8f1cdb948dfe3002c01576e18e
[ "BSD-3-Clause" ]
null
null
null
from django.contrib import admin from .models import StockPicture class StockPictureAdmin(admin.ModelAdmin): list_display = ("photo", "kind") admin.site.register(StockPicture, StockPictureAdmin)
28.571429
52
0.8
22
200
7.227273
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.105
200
6
53
33.333333
0.888268
0
0
0
0
0
0.045
0
0
0
0
0
0
1
0
false
0
0.4
0
0.8
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
0
0
1
0
1
0
0
4
39b0a3996b3eea53d32ac41110c349bb6614ff1c
19
py
Python
pyshgp/push/__init__.py
epicfaace/pyshgp
ab6fc85e6a474f1603c43ad3d298bcf5cf4a53c6
[ "MIT" ]
null
null
null
pyshgp/push/__init__.py
epicfaace/pyshgp
ab6fc85e6a474f1603c43ad3d298bcf5cf4a53c6
[ "MIT" ]
null
null
null
pyshgp/push/__init__.py
epicfaace/pyshgp
ab6fc85e6a474f1603c43ad3d298bcf5cf4a53c6
[ "MIT" ]
null
null
null
"""pyshgp.push."""
9.5
18
0.526316
2
19
5
1
0
0
0
0
0
0
0
0
0
0
0
0.052632
19
1
19
19
0.555556
0.631579
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
39f0c7c5e4574596a40da9953f6075028d7a5a18
73
py
Python
src/petronia/core/validation/__init__.py
groboclown/petronia
486338023d19cee989e92f0c5692680f1a37811f
[ "MIT" ]
19
2017-06-21T10:28:24.000Z
2021-12-31T11:49:28.000Z
src/petronia/core/validation/__init__.py
groboclown/petronia
486338023d19cee989e92f0c5692680f1a37811f
[ "MIT" ]
10
2016-11-11T18:57:57.000Z
2021-02-01T15:33:43.000Z
src/petronia/core/validation/__init__.py
groboclown/petronia
486338023d19cee989e92f0c5692680f1a37811f
[ "MIT" ]
3
2017-09-17T03:29:35.000Z
2019-06-03T10:43:08.000Z
""" Events and global state for controlling the validation actions. """
14.6
63
0.739726
9
73
6
1
0
0
0
0
0
0
0
0
0
0
0
0.164384
73
4
64
18.25
0.885246
0.863014
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f2d4a20678eac5a17eac69f084fa7882ce96f882
960
py
Python
autofactory/django/builders/strings.py
nickgashkov/autofactoryboy
b897346c34333512d8b5503679336d316113ec48
[ "MIT" ]
5
2019-01-09T19:43:40.000Z
2019-09-09T04:54:32.000Z
autofactory/django/builders/strings.py
nickgashkov/autofactoryboy
b897346c34333512d8b5503679336d316113ec48
[ "MIT" ]
null
null
null
autofactory/django/builders/strings.py
nickgashkov/autofactoryboy
b897346c34333512d8b5503679336d316113ec48
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # Copyright (c) 2018-2019 Nick Gashkov # # Distributed under MIT License. See LICENSE file for details. from __future__ import unicode_literals import factory def build_charfield(field_cls): # FAQ: `pystr` is used insted of `text` because `text` provider may # contain newlines. For a text-like data `TextField` should be used. return factory.Faker("pystr", max_chars=field_cls.max_length) def build_emailfield(field_cls): return factory.Faker("email") def build_genericipaddressfield(field_cls): return factory.Faker("ipv4") def build_slugfield(field_cls): return factory.Faker("slug") def build_textfield(field_cls): if field_cls.max_length is not None: return factory.Faker("text", max_nb_chars=field_cls.max_length) return factory.Faker("text") def build_urlfield(field_cls): return factory.Faker("url") def build_uuidfield(field_cls): return factory.Faker("uuid4")
22.857143
72
0.735417
135
960
5.022222
0.481481
0.117994
0.212389
0.154867
0.256637
0
0
0
0
0
0
0.013631
0.159375
960
41
73
23.414634
0.826518
0.2625
0
0
0
0
0.048571
0
0
0
0
0
0
1
0.388889
false
0
0.111111
0.333333
0.944444
0
0
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
0
0
0
1
1
0
0
4
ffbd860e0cc2b422ed819cbf910d5b7719d0092a
1,351
py
Python
overlay_generator/linear.py
chrisruenes1/Collisions-I
176a14884c483a422e1e457efa61d79140f77893
[ "MIT" ]
null
null
null
overlay_generator/linear.py
chrisruenes1/Collisions-I
176a14884c483a422e1e457efa61d79140f77893
[ "MIT" ]
null
null
null
overlay_generator/linear.py
chrisruenes1/Collisions-I
176a14884c483a422e1e457efa61d79140f77893
[ "MIT" ]
null
null
null
from .constants import HEIGHT; def calculate_slope_from(start, end): return (end.y - start.y) / (end.x - start.x) def calculate_y_intercept_from(slope, point): return point.y - (slope * point.x) class Point: def __init__(self, coordinate_duple): self.x = coordinate_duple[0] self.y = coordinate_duple[1] # TODO this should really be a function # so that it responds to changes in x and y self.coordinates = coordinate_duple def has_extreme_y(self): return self.y == 0 or self.y == HEIGHT def __str__(self): return str(self.x) + "," + str(self.y) class Line: # TODO can probably remove all_points as an argument def __init__(self, start, end, all_points = []): self.all_points = all_points self.start = start self.end = end self.slope = calculate_slope_from(start, end) self.y_intercept = calculate_y_intercept_from(self.slope, end) # TODO it's possible I always want these to enforce the domain and range. def get_x_from(self, y): return (y - self.y_intercept) / self.slope def get_y_from(self, x, boundaries = None): y = (self.slope * x) + self.y_intercept if boundaries is None or boundaries.contain_point(Point((x,y))): return y else: return None
31.418605
77
0.638046
197
1,351
4.172589
0.340102
0.048662
0.051095
0.055961
0.06326
0
0
0
0
0
0
0.003021
0.264989
1,351
42
78
32.166667
0.824773
0.149519
0
0
0
0
0.000874
0
0
0
0
0.02381
0
1
0.275862
false
0
0.034483
0.172414
0.62069
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
080b3dc52618216cf1fe09bf6d39b5878f7ea8de
60
py
Python
tests/__init__.py
rajeshmprao/svmpy
1132bfae719f74762fe987cb4d2fd8c6c14c4625
[ "MIT" ]
null
null
null
tests/__init__.py
rajeshmprao/svmpy
1132bfae719f74762fe987cb4d2fd8c6c14c4625
[ "MIT" ]
null
null
null
tests/__init__.py
rajeshmprao/svmpy
1132bfae719f74762fe987cb4d2fd8c6c14c4625
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Unit test package for svmpy."""
15
34
0.55
8
60
4.125
1
0
0
0
0
0
0
0
0
0
0
0.020408
0.183333
60
3
35
20
0.653061
0.85
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
081b8d1934699103c73b06a8f7be5c9aa016d786
136
py
Python
appengine_config.py
alecf/strava-raceways
82e922996ddb73d80789ffc249baf5ce52525d0f
[ "MIT" ]
null
null
null
appengine_config.py
alecf/strava-raceways
82e922996ddb73d80789ffc249baf5ce52525d0f
[ "MIT" ]
null
null
null
appengine_config.py
alecf/strava-raceways
82e922996ddb73d80789ffc249baf5ce52525d0f
[ "MIT" ]
null
null
null
from google.appengine.ext import vendor # https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring vendor.add('lib')
27.2
76
0.801471
19
136
5.736842
0.842105
0
0
0
0
0
0
0
0
0
0
0.015625
0.058824
136
4
77
34
0.835938
0.536765
0
0
0
0
0.05
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
0826481391327ac4761f3692b6aff8f12c66433b
148
py
Python
AKDPRFramework/dl/__init__.py
theroyakash/AKDPRFramework
a75c5d68c0d00c9d1450c2ab1e77ab450b812925
[ "Apache-2.0" ]
2
2020-10-10T11:17:04.000Z
2020-11-03T23:13:31.000Z
AKDPRFramework/dl/__init__.py
DeepNet-Research/AKDPRFramework
a863265d779125dde4560607e129f59c84f18c65
[ "Apache-2.0" ]
null
null
null
AKDPRFramework/dl/__init__.py
DeepNet-Research/AKDPRFramework
a863265d779125dde4560607e129f59c84f18c65
[ "Apache-2.0" ]
1
2020-10-20T09:34:25.000Z
2020-10-20T09:34:25.000Z
from .activations import Sigmoid, Softmax, TanH, ReLU, LeakyReLU, SoftPlus from .layers import Dense, Conv2D from .neuralnets import NeuralNetworks
37
74
0.817568
18
148
6.722222
0.777778
0
0
0
0
0
0
0
0
0
0
0.007692
0.121622
148
3
75
49.333333
0.923077
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f246648788e66de770cf653f3483166916d6dbc2
94
py
Python
models/resnext.py
pharrellyhy/PyTorch-CIFAR10
752e87dc65dbb69e549fe7f9d1348ae9915ef0e5
[ "MIT" ]
5
2018-01-23T17:20:10.000Z
2020-03-05T14:16:26.000Z
models/resnext.py
pharrellyhy/PyTorch-CIFAR10
752e87dc65dbb69e549fe7f9d1348ae9915ef0e5
[ "MIT" ]
null
null
null
models/resnext.py
pharrellyhy/PyTorch-CIFAR10
752e87dc65dbb69e549fe7f9d1348ae9915ef0e5
[ "MIT" ]
null
null
null
''' Pytorch implementation for ResNeXt. Original paper: https://arxiv.org/abs/1611.05431 '''
15.666667
48
0.734043
12
94
5.75
1
0
0
0
0
0
0
0
0
0
0
0.107143
0.106383
94
5
49
18.8
0.714286
0.904255
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f2503b04b4dc69ad994eccc72785e79a73e8bbe4
68
py
Python
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentLocalUnpackedAssignmentTarget_after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentLocalUnpackedAssignmentTarget_after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentLocalUnpackedAssignmentTarget_after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
def func(): var, _ = 'spam', 42 # type: ([str], [int]) var
17
47
0.441176
9
68
3.222222
0.888889
0
0
0
0
0
0
0
0
0
0
0.042553
0.308824
68
3
48
22.666667
0.574468
0.294118
0
0
0
0
0.086957
0
0
0
0
0
0
1
0.333333
true
0
0
0
0.333333
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
0
0
0
0
0
4
f250e8e9e068616e49388c4d53e255ca70d675b2
4,774
py
Python
tests/utils/test_html.py
psibean/django-rest-registration
15f720ab3aa040775d97a2b337c98e4833d0268d
[ "MIT" ]
329
2018-05-09T13:10:37.000Z
2022-03-25T11:05:20.000Z
tests/utils/test_html.py
psibean/django-rest-registration
15f720ab3aa040775d97a2b337c98e4833d0268d
[ "MIT" ]
167
2018-04-21T00:28:17.000Z
2022-03-30T09:24:52.000Z
tests/utils/test_html.py
psibean/django-rest-registration
15f720ab3aa040775d97a2b337c98e4833d0268d
[ "MIT" ]
97
2018-05-09T14:17:59.000Z
2022-02-23T08:46:30.000Z
from textwrap import dedent import pytest from rest_registration.utils.html import convert_html_to_text @pytest.mark.parametrize('html,kwargs,expected_text', [ pytest.param( dedent('''\ <!DOCTYPE html> <html><body> Look &amp; click <a href="https://example.com">here</a> </body></html>'''), {'preserve_urls': True}, 'Look & click here (https://example.com)', id='entityref and link', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> Look &amp; click <a href="https://example.com?timestamp=1234">here</a> </body></html>'''), {'preserve_urls': True}, 'Look & click here (https://example.com?timestamp=1234)', id='entityref and link with query', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> Look &#38; click here </body></html>'''), {'preserve_urls': True}, 'Look & click here', id='charref', ), pytest.param( dedent('''\ <html><body> Look &#38; click here </body></html>'''), {'preserve_urls': True}, 'Look & click here', id='missing doctype', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> Look &amp; click on <a href="https://example.com">https://example.com</a> </body></html>'''), {'preserve_urls': True}, 'Look & click on https://example.com', id='entityref and url link', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> I'm here, <br> click <a href="https://example.com">me</a> </body></html>'''), {'preserve_urls': True}, "I'm here,\nclick me (https://example.com)", id='newline tag with link', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> I'm here, <br/> click <a href="https://example.com">me</a> </body></html>'''), {'preserve_urls': True}, "I'm here,\nclick me (https://example.com)", id='newline tag (slash) with link', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> I'm here, <br/> click <a href="https://example.com">me</a> </body></html>'''), {'preserve_urls': False}, "I'm here,\nclick me", id='paragraphs with link, no urls preserving', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> <p>I'm here!</p> <p>Click <a href="https://example.com">me</a></p> </body></html>'''), {'preserve_urls': True}, "I'm here!\nClick me (https://example.com)\n", id='paragraphs with link', ), pytest.param( dedent('''\ <!DOCTYPE html> <html> <head> <title>I'm here</title> </head> <body> <p>I'm here!</p> <p>Click <a href="https://example.com">me</a></p> </body> </html>'''), {'preserve_urls': True}, "I'm here!\nClick me (https://example.com)\n", id='html head', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> <p>&copy; by SomeCompany;</p> <p>SomeMark &reg; is registered trademark</p> </body></html>'''), {'preserve_urls': True}, "\u00A9 by SomeCompany;\nSomeMark \u00AE is registered trademark\n", id='entityref', ), pytest.param( dedent('''\ <!DOCTYPE html> <html><body> <p>&#169; by SomeCompany;</p> <p>SomeMark &#174; is registered trademark</p> </body></html>'''), {'preserve_urls': True}, "\u00A9 by SomeCompany;\nSomeMark \u00AE is registered trademark\n", id='charref2', ), ]) def test_convert_html_to_text_succeeds(html, kwargs, expected_text): assert convert_html_to_text(html, **kwargs) == expected_text @pytest.mark.parametrize('html,kwargs', [ pytest.param( '<![spam]><html><body>eggs</body><html>', {'preserve_urls': True}, id='invalid declaration', ), ]) def test_convert_html_to_text_fails(html, kwargs): with pytest.raises(ValueError): convert_html_to_text(html, **kwargs)
30.21519
76
0.467951
495
4,774
4.440404
0.171717
0.087352
0.10919
0.118289
0.812102
0.743858
0.646042
0.646042
0.549591
0.549591
0
0.009465
0.35819
4,774
157
77
30.407643
0.707898
0
0
0.701987
0
0
0.650398
0.022413
0
0
0
0
0.006623
1
0.013245
false
0
0.019868
0
0.033113
0
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f27a464936741f7f2771244600bffdc99d2c24a0
121
py
Python
mmdet/models/necks/__init__.py
Nitin-Mane/MMDET
7410b25f27c200719482955cb4a8a1c381e67e04
[ "Apache-2.0" ]
2
2019-10-15T09:42:33.000Z
2020-02-05T11:37:09.000Z
mmdet/models/necks/__init__.py
Nitin-Mane/MMDET
7410b25f27c200719482955cb4a8a1c381e67e04
[ "Apache-2.0" ]
null
null
null
mmdet/models/necks/__init__.py
Nitin-Mane/MMDET
7410b25f27c200719482955cb4a8a1c381e67e04
[ "Apache-2.0" ]
1
2020-07-31T18:42:13.000Z
2020-07-31T18:42:13.000Z
from .fpn import FPN from .bfp import BFP,FRCNBFP from .hrfpn import HRFPN __all__ = ['FPN', 'BFP', 'HRFPN', 'FRCNBFP']
20.166667
44
0.694215
18
121
4.444444
0.388889
0
0
0
0
0
0
0
0
0
0
0
0.157025
121
5
45
24.2
0.784314
0
0
0
0
0
0.14876
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
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
0
0
1
0
1
0
0
4
f27e79692bc5160a07509626fdf170a60b83cad0
311
py
Python
cgi_module_test.py
plant99/import-system-talk-resources
a48620ee8e6eda5c3a1c09a708804770781d4bea
[ "MIT" ]
1
2020-08-20T16:37:49.000Z
2020-08-20T16:37:49.000Z
cgi_module_test.py
plant99/import-system-talk-resources
a48620ee8e6eda5c3a1c09a708804770781d4bea
[ "MIT" ]
null
null
null
cgi_module_test.py
plant99/import-system-talk-resources
a48620ee8e6eda5c3a1c09a708804770781d4bea
[ "MIT" ]
1
2020-08-20T16:38:22.000Z
2020-08-20T16:38:22.000Z
from cgii_module import GithubFinder import sys gf = GithubFinder("vulb", "testproject") sys.meta_path.append(gf) from testproject.two import three import os three.print_dummy(4) print(sys.modules["testproject"].__name__, sys.modules["testproject.two"].__name__, sys.modules["testproject.two.three"].__name__)
31.1
130
0.797428
43
311
5.418605
0.465116
0.180258
0.270386
0.214592
0.240343
0
0
0
0
0
0
0.00346
0.07074
311
9
131
34.555556
0.802768
0
0
0
0
0
0.199357
0.067524
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0.25
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
4ba60e259a6994f1903953cb3a9b6385497d29ed
205
py
Python
scripts/portal/aranTutorOut2.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
54
2019-04-16T23:24:48.000Z
2021-12-18T11:41:50.000Z
scripts/portal/aranTutorOut2.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
3
2019-05-19T15:19:41.000Z
2020-04-27T16:29:16.000Z
scripts/portal/aranTutorOut2.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
49
2020-11-25T23:29:16.000Z
2022-03-26T16:20:24.000Z
# Created by MechAviv # ID :: [914000200] # Black Road : Burning Forest 1 sm.killMobs() sm.removeSkill(20000014) sm.removeSkill(20000015) sm.giveSkill(20000014) sm.giveSkill(20000015) sm.warp(914000210, 1)
22.777778
31
0.765854
28
205
5.607143
0.642857
0.165605
0
0
0
0
0
0
0
0
0
0.282609
0.102439
205
9
32
22.777778
0.570652
0.326829
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
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
0
0
0
0
0
4
4bc057dac0bc8cc7c3ff4e0959c272a3d1530216
3,284
py
Python
src/parser/abstract_domain.py
sunblaze-ucb/privguard-artifact
b1b5f3a16af6ab5f7cb0f0737aba27dd9d76c25b
[ "MIT" ]
6
2021-11-06T00:48:30.000Z
2021-12-17T04:51:34.000Z
src/parser/abstract_domain.py
sunblaze-ucb/privguard-artifact
b1b5f3a16af6ab5f7cb0f0737aba27dd9d76c25b
[ "MIT" ]
null
null
null
src/parser/abstract_domain.py
sunblaze-ucb/privguard-artifact
b1b5f3a16af6ab5f7cb0f0737aba27dd9d76c25b
[ "MIT" ]
1
2021-11-02T18:24:43.000Z
2021-11-02T18:24:43.000Z
# MIT License # Copyright (c) 2021 sunblaze-ucb # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. """ Abstract domains for PrivGuard. """ from typed_value import ExtendV class Lattice(object): """ Parent class for abstract lattices in PrivGuard policies. """ def is_subset_of(self, other): pass def disjunct(self, other): pass def conjunct(self, other): pass class ClosedIntervalL(Lattice): """ ClosedInterval lattice for extended values. """ def __init__(self, lower, upper, lower_bound=None, upper_bound=None): assert isinstance(lower, ExtendV) assert isinstance(upper, ExtendV) self.lower = lower self.upper = upper self.lower_bound = lower_bound self.upper_bound = upper_bound def is_subset_of(self, other: Lattice): assert isinstance(other, ClosedIntervalL) if self.lower >= other.lower and self.upper <= other.upper: return True return False def disjunct(self, other: Lattice): return ClosedInterval(lower=min_exval(self.lower, other.lower), upper=max_exval(self.upper, other.upper), lower_bound=self.lower_bound, upper_bound=self.upper_bound) def conjunct(self, other: Lattice): return ClosedInterval(lower=max_exval(self.lower, other.lower), upper=min_exval(self.upper, other.upper), lower_bound=self.lower_bound, upper_bound=self.upper_bound) def __str__(self): return '[' + str(self.lower) + ', ' + str(self.upper) + ']' def __repr__(self): return self.__str__() class SchemaL(Lattice): """ Schema lattice. """ def __init__(self, schema, full_schema=None): self.schema = schema self.full_schema = full_schema def is_subset_of(self, other: Lattice): return set(self.schema).issubset(set(other.schema)) def disjunct(self, other: Lattice): return [x for x in self.schema if x in other.schema] def conjunct(self, other: Lattice): return list(set(self.schema)|set(other.schema)) def __str__(self): string = '[' + self.schema[0] for i in range(1, len(self.schema)): string += ", " + self.schema[i] return string def __repr__(self): return self.__str__()
34.93617
173
0.69458
445
3,284
4.991011
0.334831
0.03647
0.043224
0.049527
0.226475
0.226475
0.093652
0.067537
0.067537
0.067537
0
0.002323
0.213459
3,284
93
174
35.311828
0.85753
0.371194
0
0.326087
0
0
0.003459
0
0
0
0
0
0.065217
1
0.326087
false
0.065217
0.021739
0.173913
0.652174
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
29b6e0df3b75e313cab4504d22f96c9b44b07ce6
774
py
Python
python/MoveHistory.py
khml/sanmoku
35e5f307100e4b645c059590ef9835a4fef90b0f
[ "MIT" ]
1
2018-10-26T07:39:39.000Z
2018-10-26T07:39:39.000Z
python/MoveHistory.py
khml/sanmoku
35e5f307100e4b645c059590ef9835a4fef90b0f
[ "MIT" ]
1
2018-10-26T07:30:05.000Z
2019-04-07T02:00:27.000Z
python/MoveHistory.py
khml/sanmoku
35e5f307100e4b645c059590ef9835a4fef90b0f
[ "MIT" ]
null
null
null
# -*- coding:utf-8 -*- import numpy as np import Board class Move: def __init__(self, pos: int, data: np.ndarray): self._pos = pos self._data = data @property def pos(self): return self._pos @property def data(self): return self._data class MoveHistory: def __init__(self): self._data_dict = { Board.CROSS: [], Board.CYCLE: [] } def add(self, color: int, pos: int, board_data: np.ndarray): self._data_dict[color].append(Move(pos, board_data)) @property def data(self): return self._data_dict @property def cross(self): return self.data[Board.CROSS] @property def cycle(self): return self.data[Board.CYCLE]
18
64
0.576227
97
774
4.391753
0.268041
0.131455
0.164319
0.169014
0.262911
0.15493
0.15493
0
0
0
0
0.001869
0.308786
774
42
65
18.428571
0.794393
0.02584
0
0.241379
0
0
0
0
0
0
0
0
0
1
0.275862
false
0
0.068966
0.172414
0.586207
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
29c7e704a9e6a4f626540a6d58374af958a7d0cb
237
py
Python
updateme/admin.py
patrickrop-cloud/Django-Updater
b0917285ebf8aa7267d87f9315da56194104a175
[ "MIT" ]
null
null
null
updateme/admin.py
patrickrop-cloud/Django-Updater
b0917285ebf8aa7267d87f9315da56194104a175
[ "MIT" ]
null
null
null
updateme/admin.py
patrickrop-cloud/Django-Updater
b0917285ebf8aa7267d87f9315da56194104a175
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import NeighbourHood, User, Business, Admin # Register your models here. admin.site.register(Admin) admin.site.register(User) admin.site.register(NeighbourHood) admin.site.register(Business)
29.625
56
0.818565
32
237
6.0625
0.40625
0.185567
0.350515
0
0
0
0
0
0
0
0
0
0.084388
237
8
57
29.625
0.894009
0.109705
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
29f5a3b196921c14f2aed7fe6770dae7ac52cebb
181
py
Python
lab03.04-random.py
dm0860777682/52167-Prog-Scripting
11170d2159d4d7b36c4b354c50eb0ae209d57b35
[ "MIT" ]
null
null
null
lab03.04-random.py
dm0860777682/52167-Prog-Scripting
11170d2159d4d7b36c4b354c50eb0ae209d57b35
[ "MIT" ]
null
null
null
lab03.04-random.py
dm0860777682/52167-Prog-Scripting
11170d2159d4d7b36c4b354c50eb0ae209d57b35
[ "MIT" ]
null
null
null
import random num1 = int(input("Enter the range 1: ")) num2 = int(input("Enter the range 2: ")) num = random.randint(num1,num2) print("here is a random number {} " .format(num))
36.2
49
0.668508
29
181
4.172414
0.655172
0.132231
0.214876
0.264463
0.347107
0
0
0
0
0
0
0.039735
0.165746
181
5
49
36.2
0.761589
0
0
0
0
0
0.365169
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.2
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
4b14f517bb8204e251b13f28876cac4ae9708abd
3,592
py
Python
passwordLocker.py
Krasivaya/Test01_Password-Locker
5accb52ee95e82d18117bb2c73ff8ddecb7ffc0f
[ "MIT" ]
2
2019-09-07T12:31:40.000Z
2021-02-15T12:32:13.000Z
passwordLocker.py
Krasivaya/Test01_Password-Locker
5accb52ee95e82d18117bb2c73ff8ddecb7ffc0f
[ "MIT" ]
null
null
null
passwordLocker.py
Krasivaya/Test01_Password-Locker
5accb52ee95e82d18117bb2c73ff8ddecb7ffc0f
[ "MIT" ]
1
2021-02-15T12:26:30.000Z
2021-02-15T12:26:30.000Z
import string # Importing string import random # Importing random import pyperclip # Importing pyperclip class User: ''' User class that generate new object of users ''' user_list = [] # Empty object to hold new user def __init__(self,username,password): ''' __init__ Method to define user properties (what to except from the user) ''' self.username = username self.password = password #The end! def save_user(self): ''' save_user method to save a new user to user_list ''' User.user_list.append(self) #The end! @classmethod def display_user(cls): ''' display_user method to display user_list ''' return cls.user_list #The end! def delete_user(self): ''' delete_user method to delete a user stored in user_list ''' User.user_list.remove(self) #The End! def user_check_me(username, password): """ user_check_me method to check if a certain user is in user_list or not """ check_me = "" for user in User.user_list: if(user.username == username and user.password == password): check_me == user.username return check_me #The End! #The End of User Class! class Credentials: ''' Credentials class to create new objects of Credentials ''' credentials_list = [] # Empty object to hold new credentials def __init__(self,platform,email,password): ''' __init__ Method to define credentials properties ''' self.platform = platform self.email = email self.password = password #The End! def save_credentials(self): ''' save_credentials class to save and store new credentials into credentials_list ''' Credentials.credentials_list.append(self) #The end! def delete_credentials(self): ''' delete_credentials class to remove credential ffrom credentials_list ''' Credentials.credentials_list.remove(self) #The end! @classmethod def find_credentials(cls, platform): ''' find_credentials class to find credentials and display their information ''' for crede in cls.credentials_list: if crede.platform == platform: return crede #The end! @classmethod def credential_exists(cls, platform): ''' credential_exists class to check if credentials already exists ''' for crede in cls.credentials_list: if crede.platform == platform: return True return False #The end! @classmethod def display_credentials(cls): ''' display_credentials class to display credentials from credentials_list ''' return cls.credentials_list #The end! def new_password(stringLength = 10): ''' new_password method to generate a new password ''' password = string.ascii_uppercase + string.ascii_lowercase + string.digits + "~!@#$%^&*" return ''.join(random.choice(password) for i in range(stringLength)) #The end! @classmethod def copy_credentials(cls,platform): ''' copy_credentials class to be able to copy credentials to the clipboard ''' found_credentials = Credentials.find_credentials('Gmail') pyperclip.copy(found_credentials.platform) #The end! #The End of Credentials class
26.607407
96
0.61108
404
3,592
5.269802
0.205446
0.042273
0.025364
0.04697
0.261155
0.107093
0.084547
0.053546
0.053546
0.053546
0
0.000807
0.310134
3,592
134
97
26.80597
0.858354
0.330735
0
0.211538
1
0
0.006823
0
0
0
0
0
0
1
0.25
false
0.173077
0.057692
0
0.519231
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
d9a29402d376ec524b4eba5438da37de9606d4a6
72
py
Python
benchmarks/benchmarks/ci/__init__.py
lbdreyer/iris-esmf-regrid
2456f9b08c9a49cb6cd33555bc5938bdf0edb5be
[ "BSD-3-Clause" ]
7
2020-10-24T08:47:45.000Z
2021-07-06T10:17:08.000Z
benchmarks/benchmarks/ci/__init__.py
lbdreyer/iris-esmf-regrid
2456f9b08c9a49cb6cd33555bc5938bdf0edb5be
[ "BSD-3-Clause" ]
154
2020-10-21T14:21:59.000Z
2022-03-31T16:08:18.000Z
benchmarks/benchmarks/ci/__init__.py
stephenworsley/iris-esmf-regrid
0965c8df7fffe12a51fa01875dc632fcfeeb16cc
[ "BSD-3-Clause" ]
7
2020-10-21T09:49:05.000Z
2021-06-28T15:50:44.000Z
"""Quick running benchmarks to be included in iris-esmf-regrid's CI."""
36
71
0.736111
12
72
4.416667
1
0
0
0
0
0
0
0
0
0
0
0
0.125
72
1
72
72
0.84127
0.902778
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d9b847cc1666d02a37599ccdb93a7195f4400132
32
py
Python
example_config.py
mwweinberg/weather_cloud
3cf84a47290044be128efd482064820cdd02b2ae
[ "MIT" ]
null
null
null
example_config.py
mwweinberg/weather_cloud
3cf84a47290044be128efd482064820cdd02b2ae
[ "MIT" ]
null
null
null
example_config.py
mwweinberg/weather_cloud
3cf84a47290044be128efd482064820cdd02b2ae
[ "MIT" ]
null
null
null
API_KEY = "[YOUR API KEY HERE]"
16
31
0.65625
6
32
3.333333
0.666667
0.6
0
0
0
0
0
0
0
0
0
0
0.1875
32
1
32
32
0.769231
0
0
0
0
0
0.59375
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d9d62fd8dd6c078888851971c629bde746d7649a
607
py
Python
build/vehicle/catkin_generated/pkg.installspace.context.pc.py
duongvuhyperx/CAN-Autoware
5a43b2194eaf61324cff40ebdbda3b4662880462
[ "Apache-2.0" ]
null
null
null
build/vehicle/catkin_generated/pkg.installspace.context.pc.py
duongvuhyperx/CAN-Autoware
5a43b2194eaf61324cff40ebdbda3b4662880462
[ "Apache-2.0" ]
null
null
null
build/vehicle/catkin_generated/pkg.installspace.context.pc.py
duongvuhyperx/CAN-Autoware
5a43b2194eaf61324cff40ebdbda3b4662880462
[ "Apache-2.0" ]
null
null
null
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/hyperxai01/can-autoware/install/include".split(';') if "/home/hyperxai01/can-autoware/install/include" != "" else [] PROJECT_CATKIN_DEPENDS = "roscpp;geometry_msgs;rosconsole;autoware_msgs;message_runtime;std_msgs;can_msgs;socketcan_interface".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "-ltopic_to_socketcan".split(';') if "-ltopic_to_socketcan" != "" else [] PROJECT_NAME = "vehicle" PROJECT_SPACE_DIR = "/home/hyperxai01/can-autoware/install" PROJECT_VERSION = "0.0.0"
67.444444
157
0.782537
80
607
5.6125
0.55
0.093541
0.113586
0.167038
0.244989
0.173719
0
0
0
0
0
0.015845
0.06425
607
8
158
75.875
0.774648
0.088962
0
0
1
0
0.511797
0.410163
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8a06ec058e524c961da3e2bcfd66e083b3651f89
92
py
Python
KaSaAn/scripts/__init__.py
hmedina/KaSaAn
83e4e31ff0e0062762aacfbc65bbdd290808bb51
[ "MIT" ]
1
2020-05-11T14:31:54.000Z
2020-05-11T14:31:54.000Z
KaSaAn/scripts/__init__.py
hmedina/KaSaAn
83e4e31ff0e0062762aacfbc65bbdd290808bb51
[ "MIT" ]
4
2017-08-31T11:16:08.000Z
2020-07-10T22:31:45.000Z
KaSaAn/scripts/__init__.py
hmedina/KaSaAn
83e4e31ff0e0062762aacfbc65bbdd290808bb51
[ "MIT" ]
2
2018-02-06T20:53:26.000Z
2019-05-11T18:05:38.000Z
#!/usr/bin/env python3 """Used via setup-tool's entry points as command line utilities."""
23
67
0.717391
15
92
4.4
1
0
0
0
0
0
0
0
0
0
0
0.0125
0.130435
92
3
68
30.666667
0.8125
0.902174
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
8a169672c95937fb3db4992bf0e668c6747e92f6
21,146
py
Python
tests/test_sigfoxapi.py
KanduTeam/python-sigfox-backend-api
bc07905acf3a5cad04c8229ca8092f8a9bd37dfd
[ "BSD-2-Clause" ]
null
null
null
tests/test_sigfoxapi.py
KanduTeam/python-sigfox-backend-api
bc07905acf3a5cad04c8229ca8092f8a9bd37dfd
[ "BSD-2-Clause" ]
null
null
null
tests/test_sigfoxapi.py
KanduTeam/python-sigfox-backend-api
bc07905acf3a5cad04c8229ca8092f8a9bd37dfd
[ "BSD-2-Clause" ]
null
null
null
""" Tests for sigfoxapi. The following environment variables have to be set: SIGFOX_LOGIN_ID SIGFOX_PASSWORD SIGFOX_DEVICETYPE_ID SIGFOX_DEVICE_ID SIGFOX_USER_ID SIGFOX_GROUP_ID WARNING: These tests operate against the live Sigfox backend. Some tests are specific to my personal setup. """ from __future__ import print_function import os import time from nose.tools import raises import sigfoxapi sigfoxapi.DEBUG = True SIGFOX_LOGIN_ID = os.environ["SIGFOX_LOGIN_ID"] SIGFOX_PASSWORD = os.environ["SIGFOX_PASSWORD"] SIGFOX_DEVICETYPE_ID = os.environ["SIGFOX_DEVICETYPE_ID"] SIGFOX_DEVICE_ID = os.environ["SIGFOX_DEVICE_ID"] SIGFOX_USER_ID = os.environ["SIGFOX_USER_ID"] SIGFOX_GROUP_ID = os.environ["SIGFOX_GROUP_ID"] TIMESTAMP = time.strftime("%Y-%m-%d %H:%M:%S") SINCE = 1496239200 BEFORE = SINCE # int(time.time()) @raises(sigfoxapi.SigfoxApiBadRequest) def test_sigfoxapi_autherror(): s = sigfoxapi.Sigfox("wrong_login_id", "wrong_password") s.group_info(SIGFOX_GROUP_ID) @raises(sigfoxapi.SigfoxApiAuthError) def test_sigfoxapi_autherror(): s = sigfoxapi.Sigfox("012345678901234567891234", "12345678901234567890123456789012") s.group_info(SIGFOX_GROUP_ID) # Doesn work with @raises def test_sigfoxapi_notfound(): s = sigfoxapi.Sigfox(SIGFOX_LOGIN_ID, SIGFOX_PASSWORD) try: s.group_info("123456789012345678901234") except sigfoxapi.SigfoxApiNotFound: pass @raises(sigfoxapi.SigfoxApiError) def test_sigfoxapi_apierror(): s = sigfoxapi.Sigfox(SIGFOX_LOGIN_ID, SIGFOX_PASSWORD) s.group_info("does_not_exist") # TODO: Add more exceotion testing class _TestSigfoxBase(object): def setup(self): self.s = sigfoxapi.Sigfox(SIGFOX_LOGIN_ID, SIGFOX_PASSWORD) sigfoxapi.RETURN_OBJECTS = False class _TestSigfoxBaseObject(object): def setup(self): self.s = sigfoxapi.Sigfox(SIGFOX_LOGIN_ID, SIGFOX_PASSWORD) sigfoxapi.RETURN_OBJECTS = True class TestSigfoxUsers(_TestSigfoxBase): def test_user_list(self): users = self.s.user_list(SIGFOX_GROUP_ID) assert isinstance(users, list) assert len(users) == 1 assert users[0]["timezone"] == "Australia/Melbourne" def test_user_list_limit(self): users = self.s.user_list(SIGFOX_GROUP_ID, offset=0, limit=1) assert len(users) == 1 # @raises(sigfoxapi.SigfoxApiError) # def test_user_list_invalid_groupid(self): # self.s.user_list('invalid') class TestSigfoxUsersObject(_TestSigfoxBaseObject): def test_user_list(self): users = self.s.user_list(SIGFOX_GROUP_ID) assert isinstance(users, sigfoxapi.Object) assert len(users) == 1 assert users[0].timezone == "Australia/Melbourne" class TestSigfoxGroups(_TestSigfoxBase): def test_group_info(self): group = self.s.group_info(SIGFOX_GROUP_ID) assert isinstance(group, dict) assert group["id"] == SIGFOX_GROUP_ID def test_group_list(self): groups = self.s.group_list() assert isinstance(groups, list) assert len(groups) == 0 def test_group_list_limit(self): groups = self.s.group_list(limit=1) assert len(groups) <= 1 def test_group_list_offset(self): groups = self.s.group_list(offset=10) class TestSigfoxGroupsObject(_TestSigfoxBaseObject): def test_group_info(self): group = self.s.group_info(SIGFOX_GROUP_ID) assert isinstance(group, sigfoxapi.Object) assert group.id == SIGFOX_GROUP_ID def test_group_list(self): groups = self.s.group_list() assert isinstance(groups, sigfoxapi.Object) assert len(groups) == 0 class TestSigfoxDevicetypes(_TestSigfoxBase): def test_devicetype_info_and_edit(self): devicetype = self.s.devicetype_info(SIGFOX_DEVICETYPE_ID) assert isinstance(devicetype, dict) assert devicetype["id"] == SIGFOX_DEVICETYPE_ID assert devicetype["description"] != TIMESTAMP params = {"id": SIGFOX_DEVICETYPE_ID, "description": TIMESTAMP} self.s.devicetype_edit(SIGFOX_DEVICETYPE_ID, params) devicetype = self.s.devicetype_info(SIGFOX_DEVICETYPE_ID) assert devicetype["description"] == TIMESTAMP def test_devicetype_list(self): devicetypes = self.s.devicetype_list() assert isinstance(devicetypes, list) found = [ devicetype for devicetype in devicetypes if devicetype["id"] == SIGFOX_DEVICETYPE_ID ] assert len(found) == 1 def test_devicetype_errors(self): errors = self.s.devicetype_errors(SIGFOX_DEVICETYPE_ID) assert isinstance(errors, list) if len(errors) > 0: pass # TODO def test_devicetype_errors_limit(self): self.s.devicetype_errors(SIGFOX_DEVICETYPE_ID, limit=1) def test_devicetype_errors_offset(self): self.s.devicetype_errors(SIGFOX_DEVICETYPE_ID, offset=1) def test_devicetype_errors_before(self): errors = self.s.devicetype_errors(SIGFOX_DEVICETYPE_ID, before=BEFORE) def test_devicetype_errors_since(self): self.s.devicetype_errors(SIGFOX_DEVICETYPE_ID, since=SINCE) def test_devicetype_warnings(self): warnings = self.s.devicetype_warnings(SIGFOX_DEVICETYPE_ID) assert isinstance(warnings, list) if len(warnings) > 0: pass # TODO def test_devicetype_warnings_limit(self): self.s.devicetype_warnings(SIGFOX_DEVICETYPE_ID, limit=1) def test_devicetype_warnings_offset(self): self.s.devicetype_warnings(SIGFOX_DEVICETYPE_ID, offset=1) def test_devicetype_warnings_before(self): self.s.devicetype_warnings(SIGFOX_DEVICETYPE_ID, before=BEFORE) def test_devicetype_warnings_since(self): self.s.devicetype_warnings(SIGFOX_DEVICETYPE_ID, since=SINCE) def test_devicetype_messages(self): messages = self.s.devicetype_messages(SIGFOX_DEVICETYPE_ID) assert isinstance(messages, list) if len(messages) > 0: for message in messages: assert isinstance(message["data"], str) assert isinstance(message["device"], str) assert isinstance(message["linkQuality"], str) assert isinstance(message["snr"], str) assert isinstance(message["time"], int) def test_devicetype_messages_limit(self): self.s.devicetype_messages(SIGFOX_DEVICETYPE_ID, limit=1) def test_devicetype_messages_offset(self): self.s.devicetype_messages(SIGFOX_DEVICETYPE_ID, offset=1) def test_devicetype_messages_before(self): self.s.devicetype_messages(SIGFOX_DEVICETYPE_ID, before=BEFORE) def test_devicetype_messages_since(self): self.s.devicetype_messages(SIGFOX_DEVICETYPE_ID, since=SINCE) class TestSigfoxDevicetypesObject(_TestSigfoxBaseObject): def test_devicetype_info(self): devicetype = self.s.devicetype_info(SIGFOX_DEVICETYPE_ID) assert isinstance(devicetype, sigfoxapi.Object) assert devicetype.id == SIGFOX_DEVICETYPE_ID def test_devicetype_list(self): devicetypes = self.s.devicetype_list() assert isinstance(devicetypes, sigfoxapi.Object) found = [ devicetype for devicetype in devicetypes if devicetype.id == SIGFOX_DEVICETYPE_ID ] assert len(found) == 1 def test_devicetype_errors(self): errors = self.s.devicetype_errors(SIGFOX_DEVICETYPE_ID) assert isinstance(errors, sigfoxapi.Object) if len(errors) > 0: pass # TODO def test_devicetype_warnings(self): warnings = self.s.devicetype_warnings(SIGFOX_DEVICETYPE_ID) assert isinstance(warnings, sigfoxapi.Object) if len(warnings) > 0: pass # TODO def test_devicetype_messages(self): messages = self.s.devicetype_messages(SIGFOX_DEVICETYPE_ID) assert isinstance(messages, sigfoxapi.Object) if len(messages) > 0: for message in messages: assert isinstance(message.data, str) assert isinstance(message.device, str) assert isinstance(message.linkQuality, str) assert isinstance(message.snr, str) CALLBACKID = None class TestSigfoxCallbacks(_TestSigfoxBase): def test_callback_0_list_and_edit(self): callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) found = [ callback for callback in callbacks if callback["channel"] == "EMAIL" and callback["message"] == TIMESTAMP ] assert found == [] new_callbacks = [ { "channel": "EMAIL", "subject": "SIGFOXAPI TEST", "recipient": "noone@example.com", "message": TIMESTAMP, "callbackType": 0, "callbackSubtype": 2, "enabled": False, "sendDuplicate": False, "payloadConfig": "", } ] self.s.callback_new(SIGFOX_DEVICETYPE_ID, new_callbacks) callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) found = [ callback for callback in callbacks if callback["channel"] == "EMAIL" and callback["message"] == TIMESTAMP ] assert len(found) == 1 global CALLBACKID CALLBACKID = found[0]["id"] def test_callback_1_enable(self): self.s.callback_enable(SIGFOX_DEVICETYPE_ID, CALLBACKID) callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) found = [ callback for callback in callbacks if callback["channel"] == "EMAIL" and callback["message"] == TIMESTAMP ] assert found[0]["enabled"] is True def test_callback_2_disable(self): self.s.callback_disable(SIGFOX_DEVICETYPE_ID, CALLBACKID) callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) found = [ callback for callback in callbacks if callback["channel"] == "EMAIL" and callback["message"] == TIMESTAMP ] assert found[0]["enabled"] is False def test_callback_2_disable(self): callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) for callback in callbacks: if ( callback["channel"] == "EMAIL" and callback["subject"] == "SIGFOXAPI TEST" ): self.s.callback_delete(SIGFOX_DEVICETYPE_ID, callback["id"]) callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) found = [ callback for callback in callbacks if callback["channel"] == "EMAIL" and callback["subject"] == "SIGFOXAPI TEST" ] assert len(found) == 0 def test_callback_errors(self): errors = self.s.callback_errors() for error in errors: assert error["device"] assert error["deviceType"] assert error["data"] assert error["time"] assert error["snr"] def test_callback_errors_devicetypeid(self): errors = self.s.callback_errors(deviceTypeId=SIGFOX_DEVICETYPE_ID) for error in errors: assert error["deviceType"] == SIGFOX_DEVICETYPE_ID def test_callback_errors_deviceid(self): errors = self.s.callback_errors(hexId=SIGFOX_DEVICE_ID) for error in errors: assert error["device"] == SIGFOX_DEVICE_ID def test_callback_errors_groupid(self): errors = self.s.callback_errors(groupId=SIGFOX_GROUP_ID) def test_callback_errors_limit(self): self.s.callback_errors(limit=1) def test_callback_errors_offset(self): self.s.callback_errors(offset=10) def test_callback_errors_since(self): self.s.callback_errors(since=SINCE) @raises(sigfoxapi.SigfoxApiError) def test_callback_errors_before(self): self.s.callback_errors(before=BEFORE) class TestSigfoxCallbacksObject(_TestSigfoxBaseObject): def test_callback_list(self): callbacks = self.s.callback_list(SIGFOX_DEVICETYPE_ID) found = [ callback for callback in callbacks if callback.channel == "EMAIL" and callback.message == TIMESTAMP ] assert found == [] def test_callback_errors(self): errors = self.s.callback_errors() for error in errors: assert error.device assert error.deviceType assert error.data assert error.time assert error.snr class TestSigfoxDevices(_TestSigfoxBase): def test_device_list(self): devices = self.s.device_list(SIGFOX_DEVICETYPE_ID) assert isinstance(devices, list) found = [device for device in devices if device["id"] == SIGFOX_DEVICE_ID] assert len(found) == 1 assert isinstance(found[0], dict) def test_device_list_snr(self): self.s.device_list(SIGFOX_DEVICETYPE_ID, snr=1) def test_device_list_limit(self): self.s.device_list(SIGFOX_DEVICETYPE_ID, limit=1) def test_device_list_offset(self): self.s.device_list(SIGFOX_DEVICETYPE_ID, offset=10) def test_device_info(self): device = self.s.device_info(SIGFOX_DEVICE_ID) assert device["id"] == SIGFOX_DEVICE_ID def test_device_tokenstate(self): tokenstate = self.s.device_tokenstate(SIGFOX_DEVICE_ID) assert tokenstate["code"] in [0, 1, 2] def test_device_messages(self): messages = self.s.device_messages(SIGFOX_DEVICE_ID) assert isinstance(messages, list) if len(messages) > 0: for message in messages: assert isinstance(message["data"], str) assert isinstance(message["device"], str) assert isinstance(message["linkQuality"], str) assert isinstance(message["snr"], str) assert isinstance(message["time"], int) def test_device_messages_limit_offset(self): messages1 = self.s.device_messages(SIGFOX_DEVICE_ID, limit=10) assert len(messages1) == 10 messages2 = self.s.device_messages(SIGFOX_DEVICE_ID, limit=1, offset=9) assert messages1[9]["time"] == messages2[0]["time"] def test_device_messages_before(self): messages = self.s.device_messages(SIGFOX_DEVICE_ID, before=1497905981) assert len(messages) == 1 @raises(sigfoxapi.SigfoxApiBadRequest) def test_device_messages_before_invalid(self): messages = self.s.device_messages(SIGFOX_DEVICE_ID, before=BEFORE) assert len(messages) == 0 def test_device_messages_next_add(self): messages = self.s.device_messages(SIGFOX_DEVICE_ID) if len(messages) == 100: assert self.s.next is not None while self.s.next: messages = messages + self.s.next() assert len(messages) > 100 assert self.s.next is None def test_device_messages_next_iadd(self): messages = self.s.device_messages(SIGFOX_DEVICE_ID) if len(messages) == 100: assert self.s.next is not None while self.s.next: messages += self.s.next() assert len(messages) > 100 assert self.s.next is None def test_device_locations(self): locations = self.s.device_locations(SIGFOX_DEVICE_ID) assert isinstance(locations, list) if len(locations) > 0: for location in locations: assert isinstance(location["valid"], bool) def test_device_locations_limit(self): self.s.device_locations(SIGFOX_DEVICE_ID, limit=1) def test_device_locations_offset(self): self.s.device_locations(SIGFOX_DEVICE_ID, offset=10) def test_device_locations_since(self): self.s.device_locations(SIGFOX_DEVICE_ID, since=SINCE) @raises(sigfoxapi.SigfoxApiError) def test_device_locations_before(self): self.s.device_locations(SIGFOX_DEVICE_ID, before=BEFORE) def test_device_warnings(self): warnings = self.s.device_warnings(SIGFOX_DEVICE_ID) assert isinstance(warnings, list) def test_device_warnings_limit(self): self.s.device_warnings(SIGFOX_DEVICE_ID, limit=1) def test_device_warnings_offset(self): self.s.device_warnings(SIGFOX_DEVICE_ID, offset=10) def test_device_warnings_since(self): self.s.device_warnings(SIGFOX_DEVICE_ID, since=SINCE) @raises(sigfoxapi.SigfoxApiError) def test_device_warnings_before(self): self.s.device_warnings(SIGFOX_DEVICE_ID, before=BEFORE) def test_device_errors(self): errors = self.s.device_errors(SIGFOX_DEVICE_ID) assert isinstance(errors, list) def test_device_errors_limit(self): errors = self.s.device_errors(SIGFOX_DEVICE_ID, limit=1) def test_device_errors_offset(self): errors = self.s.device_errors(SIGFOX_DEVICE_ID, offset=10) def test_device_errors_since(self): errors = self.s.device_errors(SIGFOX_DEVICE_ID, since=SINCE) @raises(sigfoxapi.SigfoxApiError) def test_device_errors_before(self): errors = self.s.device_errors(SIGFOX_DEVICE_ID, before=BEFORE) def test_device_networkstate(self): networkstate = self.s.device_networkstate(SIGFOX_DEVICE_ID) assert isinstance(networkstate, dict) assert networkstate["networkStatus"] in ["OK", "NOK"] def test_device_messagemetrics(self): metrics = self.s.device_messagemetrics(SIGFOX_DEVICE_ID) assert isinstance(metrics, dict) assert isinstance(metrics["lastDay"], int) assert isinstance(metrics["lastMonth"], int) assert isinstance(metrics["lastWeek"], int) def test_device_consumptions(self): consumptions = self.s.device_messagemetrics(SIGFOX_DEVICE_ID) assert isinstance(consumptions, dict) class TestSigfoxDevicesObject(_TestSigfoxBaseObject): def test_device_list(self): devices = self.s.device_list(SIGFOX_DEVICETYPE_ID) assert isinstance(devices, sigfoxapi.Object) found = [device for device in devices if device.id == SIGFOX_DEVICE_ID] assert len(found) == 1 assert isinstance(found[0], sigfoxapi.Object) def test_device_info(self): device = self.s.device_info(SIGFOX_DEVICE_ID) assert device.id == SIGFOX_DEVICE_ID def test_device_tokenstate(self): tokenstate = self.s.device_tokenstate(SIGFOX_DEVICE_ID) assert tokenstate.code in [0, 1, 2] def test_device_messages(self): messages = self.s.device_messages(SIGFOX_DEVICE_ID) assert isinstance(messages, sigfoxapi.Object) if len(messages) > 0: for message in messages: assert isinstance(message.data, str) assert isinstance(message.device, str) assert isinstance(message.linkQuality, str) assert isinstance(message.snr, str) assert isinstance(message.time, int) def test_device_locations(self): locations = self.s.device_locations(SIGFOX_DEVICE_ID) assert isinstance(locations, sigfoxapi.Object) if len(locations) > 0: for location in locations: assert isinstance(location.valid, bool) def test_device_warnings(self): warnings = self.s.device_warnings(SIGFOX_DEVICE_ID) assert isinstance(warnings, sigfoxapi.Object) def test_device_errors(self): errors = self.s.device_errors(SIGFOX_DEVICE_ID) assert isinstance(errors, sigfoxapi.Object) def test_device_networkstate(self): networkstate = self.s.device_networkstate(SIGFOX_DEVICE_ID) assert isinstance(networkstate, sigfoxapi.Object) assert networkstate.networkStatus in ["OK", "NOK"] def test_device_messagemetrics(self): metrics = self.s.device_messagemetrics(SIGFOX_DEVICE_ID) assert isinstance(metrics, sigfoxapi.Object) assert isinstance(metrics.lastDay, int) assert isinstance(metrics.lastMonth, int) assert isinstance(metrics.lastWeek, int) def test_device_consumptions(self): consumptions = self.s.device_messagemetrics(SIGFOX_DEVICE_ID) class TestSigfoxCoverage(_TestSigfoxBase): def test_coverage_redundancy(self): redundancy = self.s.coverage_redundancy(43.415, 1.9693, mode="OUTDOOR") assert redundancy["redundancy"] > 1 def test_coverage_predictions(self): predictions = self.s.coverage_predictions(43.415, 1.9693) assert len(predictions["margins"]) == 3 class TestSigfoxCoverageObject(_TestSigfoxBaseObject): def test_coverage_redundancy(self): redundancy = self.s.coverage_redundancy(43.415, 1.9693, mode="OUTDOOR") assert redundancy.redundancy > 1 def test_coverage_predictions(self): predictions = self.s.coverage_predictions(43.415, 1.9693) assert len(predictions.margins) == 3
34.552288
88
0.67521
2,474
21,146
5.52304
0.080032
0.039886
0.063232
0.02781
0.80079
0.740779
0.702503
0.680767
0.575527
0.541203
0
0.01477
0.234749
21,146
611
89
34.608838
0.829626
0.023882
0
0.47807
0
0
0.039277
0.003879
0
0
0
0.001637
0.254386
1
0.208333
false
0.024123
0.010965
0
0.25
0.002193
0
0
0
null
0
0
0
1
1
1
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
0
0
0
4
8a264c860c3bb3ffe3c2fd444592998d23f47ac6
224
py
Python
mmdet3d/models/necks/__init__.py
xiaoMrzhang/mmdetection3d
1e7695297e60afe3e09834de1582c3437086ed49
[ "Apache-2.0" ]
null
null
null
mmdet3d/models/necks/__init__.py
xiaoMrzhang/mmdetection3d
1e7695297e60afe3e09834de1582c3437086ed49
[ "Apache-2.0" ]
null
null
null
mmdet3d/models/necks/__init__.py
xiaoMrzhang/mmdetection3d
1e7695297e60afe3e09834de1582c3437086ed49
[ "Apache-2.0" ]
1
2021-07-21T05:17:24.000Z
2021-07-21T05:17:24.000Z
from mmdet.models.necks.fpn import FPN from .second_fpn import SECONDFPN from .second_fpn_ran import SECONDFPN_RAN from .second_fpn_mask import SECONDFPNMASK __all__ = ['FPN', 'SECONDFPN', 'SECONDFPN_RAN', 'SECONDFPNMASK']
32
64
0.808036
31
224
5.483871
0.387097
0.176471
0.229412
0
0
0
0
0
0
0
0
0
0.102679
224
6
65
37.333333
0.845771
0
0
0
0
0
0.169643
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
8a2824abb1478a39cbf7c94a9b5963a35c2f94d3
732
py
Python
backend/naki/naki/schemas/view.py
iimcz/emod
432094c020247597a94e95f76cc524c20b68b685
[ "MIT" ]
null
null
null
backend/naki/naki/schemas/view.py
iimcz/emod
432094c020247597a94e95f76cc524c20b68b685
[ "MIT" ]
6
2021-03-08T23:32:15.000Z
2022-02-26T08:11:38.000Z
backend/naki/naki/schemas/view.py
iimcz/emod
432094c020247597a94e95f76cc524c20b68b685
[ "MIT" ]
null
null
null
from naki.model.view import View from colanderalchemy import SQLAlchemySchemaNode from naki.schemas.metadata import MetadataSequenceSchema import colander import datetime # ViewSchema = SQLAlchemySchemaNode(View) # ViewSchema.add(MetadataSequenceSchema(name = 'metadata', missing = [])) class ViewSchema(colander.MappingSchema): id_view = colander.SchemaNode(colander.String(), missing='') created = colander.SchemaNode(colander.DateTime(), missing=datetime.datetime.now()) description = colander.SchemaNode(colander.String(), missing='') id_user = colander.SchemaNode(colander.String(),missing='') public = colander.SchemaNode(colander.Integer(),missing=0) metadata = MetadataSequenceSchema(missing=[])
38.526316
87
0.775956
72
732
7.861111
0.388889
0.159011
0.229682
0.169611
0.206714
0
0
0
0
0
0
0.001529
0.106557
732
18
88
40.666667
0.863914
0.151639
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.416667
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
8a3754eeda76633351ea8e078e37bec257b58092
377
py
Python
server/zeta_basic/LEXER/Token.py
bennaaym/Zeta-Basic
7fcc0acbb37146e7c5a5c05000af72a99d102b8f
[ "MIT" ]
3
2021-07-16T08:12:52.000Z
2022-03-20T11:30:53.000Z
server/zeta_basic/LEXER/Token.py
bennaaym/zeta-basic
7fcc0acbb37146e7c5a5c05000af72a99d102b8f
[ "MIT" ]
null
null
null
server/zeta_basic/LEXER/Token.py
bennaaym/zeta-basic
7fcc0acbb37146e7c5a5c05000af72a99d102b8f
[ "MIT" ]
null
null
null
class Token : def __init__(self,type_,value = None,position=None): self.type = type_ self.value = value if position: self.position = position.copy() def matches(self,type_,value): return self.type == type_ and self.value == value def __repr__(self): return f'{self.type} : {self.value}' if self.value else f'{self.type}'
29
78
0.623342
51
377
4.372549
0.333333
0.215247
0.116592
0
0
0
0
0
0
0
0
0
0.249337
377
13
78
29
0.787986
0
0
0
0
0
0.097884
0
0
0
0
0
0
1
0.333333
false
0
0
0.222222
0.666667
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
8a385c5021c70af94266a098b49394284077df58
912
py
Python
pandas_ta/performance/__init__.py
tg12/pandas-ta
ebec748fb1150cbe29dd591a9493c86b202ed5b1
[ "MIT" ]
1
2020-10-16T11:31:31.000Z
2020-10-16T11:31:31.000Z
pandas_ta/performance/__init__.py
tg12/pandas-ta
ebec748fb1150cbe29dd591a9493c86b202ed5b1
[ "MIT" ]
null
null
null
pandas_ta/performance/__init__.py
tg12/pandas-ta
ebec748fb1150cbe29dd591a9493c86b202ed5b1
[ "MIT" ]
null
null
null
'''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''' # Bitcoin Cash (BCH) qpz32c4lg7x7lnk9jg6qg7s4uavdce89myax5v5nuk # Ether (ETH) - 0x843d3DEC2A4705BD4f45F674F641cE2D0022c9FB # Litecoin (LTC) - Lfk5y4F7KZa9oRxpazETwjQnHszEPvqPvu # Bitcoin (BTC) - 34L8qWiQyKr8k4TnHDacfjbaSqQASbBtTd # contact :- github@jamessawyer.co.uk # -*- coding: utf-8 -*- from .log_return import log_return from .percent_return import percent_return from .trend_return import trend_return
39.652174
74
0.788377
116
912
6.146552
0.672414
0.061711
0
0
0
0
0
0
0
0
0
0.062176
0.153509
912
22
75
41.454545
0.861399
0.846491
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
8a55f0afabb860226c80387bdb265ac8692fc196
116
py
Python
destacame/routes/admin.py
osocaramelosofer/destacame
7b816be1d785bcd6525265d708c584545490816e
[ "MIT" ]
null
null
null
destacame/routes/admin.py
osocaramelosofer/destacame
7b816be1d785bcd6525265d708c584545490816e
[ "MIT" ]
null
null
null
destacame/routes/admin.py
osocaramelosofer/destacame
7b816be1d785bcd6525265d708c584545490816e
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Route # Register your models here. admin.site.register(Route)
19.333333
32
0.801724
17
116
5.470588
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.12931
116
5
33
23.2
0.920792
0.224138
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
8a5b2b1caae51b096e650058efcbf4dd11fe1f30
136
py
Python
codewof/programming/content/en/pen-picker/solution.py
uccser-admin/programming-practice-prototype
3af4c7d85308ac5bb35bb13be3ec18cac4eb8308
[ "MIT" ]
null
null
null
codewof/programming/content/en/pen-picker/solution.py
uccser-admin/programming-practice-prototype
3af4c7d85308ac5bb35bb13be3ec18cac4eb8308
[ "MIT" ]
null
null
null
codewof/programming/content/en/pen-picker/solution.py
uccser-admin/programming-practice-prototype
3af4c7d85308ac5bb35bb13be3ec18cac4eb8308
[ "MIT" ]
1
2018-04-12T23:58:35.000Z
2018-04-12T23:58:35.000Z
def pick_pens(writing_colours, is_marking): if is_marking is True: writing_colours.append('red') return writing_colours
27.2
43
0.735294
19
136
4.947368
0.631579
0.446809
0
0
0
0
0
0
0
0
0
0
0.191176
136
4
44
34
0.854545
0
0
0
0
0
0.022059
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
8a6c0a3bd312f345a1c86725c9ca5530d130a5e0
158
py
Python
cmdliner/__init__.py
joaompinto/cmdliner
c77db9d5ccb916b10358c1aba27408b36f24efda
[ "MIT" ]
null
null
null
cmdliner/__init__.py
joaompinto/cmdliner
c77db9d5ccb916b10358c1aba27408b36f24efda
[ "MIT" ]
null
null
null
cmdliner/__init__.py
joaompinto/cmdliner
c77db9d5ccb916b10358c1aba27408b36f24efda
[ "MIT" ]
null
null
null
from .minimal import cli from .print import verbose from .command import Command from .app import Application __all__ = [cli, verbose, Application, Command]
22.571429
46
0.791139
21
158
5.761905
0.47619
0
0
0
0
0
0
0
0
0
0
0
0.14557
158
6
47
26.333333
0.896296
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0.2
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
0
0
1
0
1
0
0
4
8a6e0ba8276a266d789d645daec2ac928fec2f88
2,655
py
Python
scraper/items.py
KuoRave/watch_spider
7bcda670ba64b509f0f1f944d1daf2ee62efe6b6
[ "MIT" ]
null
null
null
scraper/items.py
KuoRave/watch_spider
7bcda670ba64b509f0f1f944d1daf2ee62efe6b6
[ "MIT" ]
null
null
null
scraper/items.py
KuoRave/watch_spider
7bcda670ba64b509f0f1f944d1daf2ee62efe6b6
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class Dictionary(scrapy.Item): """Watch Dictionary""" # Refer to fields of the watch_dictionary table brand = scrapy.Field(serializer=str) series = scrapy.Field(serializer=str) number = scrapy.Field(serializer=str) sex = scrapy.Field() cny = scrapy.Field(serializer=int) cny_date = scrapy.Field(serializer=str) euro = scrapy.Field(serializer=int) euro_date = scrapy.Field(serializer=str) dollor = scrapy.Field(serializer=int) dollor_date = scrapy.Field(serializer=str) hkd = scrapy.Field(serializer=int) hkd_date = scrapy.Field(serializer=str) mm_id = scrapy.Field(serializer=int) total_diameter = scrapy.Field(serializer=float) shell_thickness = scrapy.Field(serializer=float) shell_material = scrapy.Field(serializer=float) dial_color = scrapy.Field(serializer=str) dial_shape = scrapy.Field(serializer=str) dial_material = scrapy.Field(serializer=str) glass_material = scrapy.Field(serializer=str) crown_material = scrapy.Field(serializer=str) band_color = scrapy.Field(serializer=str) band_material = scrapy.Field(serializer=str) clasp_type = scrapy.Field(serializer=str) clasp_material = scrapy.Field(serializer=str) back_through = scrapy.Field(serializer=str) weight = scrapy.Field(serializer=float) diving_depth = scrapy.Field(serializer=int) feature = scrapy.Field(serializer=str) mm_obj = scrapy.Field() brand_obj = scrapy.Field() brand_id = scrapy.Field() class Movement(scrapy.Item): """Watch Movement""" # Refer to fields of the watch_movement table name = scrapy.Field(serializer=str) type = scrapy.Field() manufacture = scrapy.Field(serializer=str) basic = scrapy.Field(serializer=str) diameter = scrapy.Field(serializer=float) thickness = scrapy.Field(serializer=float) vibration = scrapy.Field(serializer=str) jewels = scrapy.Field(serializer=int) part_number = scrapy.Field(serializer=int) power_reserve = scrapy.Field(serializer=int) introduction = scrapy.Field(serializer=str) battery_life = scrapy.Field(serializer=str) wobbler = scrapy.Field(serializer=str) hairspring = scrapy.Field(serializer=str) suspension = scrapy.Field(serializer=str) token = scrapy.Field(serializer=str) class Brand(scrapy.Item): """Watch Brand""" name = scrapy.Field(serializer=str) name_en = scrapy.Field(serializer=str) img_uri = scrapy.Field(serializer=str)
37.394366
52
0.720151
331
2,655
5.688822
0.259819
0.297929
0.513011
0.395114
0.362188
0.024429
0
0
0
0
0
0.000451
0.164595
2,655
71
53
37.394366
0.848512
0.103202
0
0.036364
0
0
0
0
0
0
0
0
0
1
0
false
0
0.018182
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
8a81504c5d189cd0afb3ba6b4c22e2486d86256f
22
py
Python
pyinfra/version.py
charles-l/pyinfra
1992d98ff31d41404427dbb3cc6095a7bebd4052
[ "MIT" ]
21
2020-05-29T22:30:32.000Z
2021-11-03T01:16:44.000Z
pyinfra/version.py
charles-l/pyinfra
1992d98ff31d41404427dbb3cc6095a7bebd4052
[ "MIT" ]
16
2015-01-31T21:17:31.000Z
2017-09-05T18:40:12.000Z
pyinfra/version.py
charles-l/pyinfra
1992d98ff31d41404427dbb3cc6095a7bebd4052
[ "MIT" ]
18
2015-05-29T18:12:02.000Z
2018-11-05T14:49:17.000Z
__version__ = '1.0.4'
11
21
0.636364
4
22
2.5
1
0
0
0
0
0
0
0
0
0
0
0.157895
0.136364
22
1
22
22
0.368421
0
0
0
0
0
0.227273
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8a9d44028de7fc7781b73329e899d812d5d74e85
13,109
py
Python
test/data_tests/data_utilities_test.py
YosefLab/Cassiopeia
3002617a00e1281ef073a6f17b6dd55c3337bdad
[ "MIT" ]
52
2019-05-14T02:06:24.000Z
2022-03-27T05:22:56.000Z
test/data_tests/data_utilities_test.py
YosefLab/Cassiopeia
3002617a00e1281ef073a6f17b6dd55c3337bdad
[ "MIT" ]
88
2019-06-07T15:07:45.000Z
2022-03-22T14:40:03.000Z
test/data_tests/data_utilities_test.py
YosefLab/Cassiopeia
3002617a00e1281ef073a6f17b6dd55c3337bdad
[ "MIT" ]
17
2019-05-17T00:46:16.000Z
2022-03-25T00:39:18.000Z
""" This file tests the utilities stored in cassiopeia/data/utilities.py """ import unittest from typing import Dict, Optional import networkx as nx import numpy as np import pandas as pd from cassiopeia.data import CassiopeiaTree from cassiopeia.data import utilities as data_utilities from cassiopeia.preprocess import utilities as preprocessing_utilities class TestDataUtilities(unittest.TestCase): def setUp(self): # this should obey PP for easy checking of ancestral states self.character_matrix = pd.DataFrame.from_dict( { "node3": [1, 0, 0, 0, 0, 0, 0, 0], "node7": [1, 1, 0, 0, 0, 0, 0, 0], "node9": [1, 1, 1, 0, 0, 0, 0, 0], "node11": [1, 1, 1, 1, 0, 0, 0, 0], "node13": [1, 1, 1, 1, 1, 0, 0, 0], "node15": [1, 1, 1, 1, 1, 1, 0, 0], "node17": [1, 1, 1, 1, 1, 1, 1, 0], "node18": [1, 1, 1, 1, 1, 1, 1, 1], "node5": [2, 0, 0, 0, 0, 0, 0, 0], "node6": [2, 2, 0, 0, 0, 0, 0, 0], }, orient="index", ) self.priors = { 0: {1: 0.5, 2: 0.5}, 1: {1: 0.4, 2: 0.6}, 2: {1: 1.0}, 3: {1: 1.0}, 4: {1: 1.0}, 5: {1: 1.0}, 6: {1: 1.0}, 7: {1: 1.0}, } # Test allele table at_dict = { "cellBC": ["cellA", "cellA", "cellA", "cellB", "cellC"], "intBC": ["A", "B", "C", "A", "C"], "r1": ["None", "ATC", "GGG", "ATA", "GAA"], "r2": ["None", "AAA", "GAA", "TTT", "GAA"], "r3": ["ATC", "TTT", "ATA", "ATA", "ATA"], "UMI": [5, 10, 1, 30, 30], } self.allele_table = pd.DataFrame.from_dict(at_dict) self.indel_to_prior = pd.DataFrame.from_dict( { "ATC": 0.5, "GGG": 0.2, "GAA": 0.1, "AAA": 0.05, "TTT": 0.05, "ATA": 0.1, }, orient="index", columns=["freq"], ) # Test allele table without normal cassiopeia columns self.non_cassiopeia_allele_table = self.allele_table.copy() self.non_cassiopeia_allele_table.rename( columns={"r1": "cs1", "r2": "cs2", "r3": "cs3"}, inplace=True ) def test_bootstrap_character_matrices_no_priors(self): random_state = np.random.RandomState(123431235) bootstrap_samples = data_utilities.sample_bootstrap_character_matrices( self.character_matrix, num_bootstraps=10, random_state=random_state ) self.assertEqual(len(bootstrap_samples), 10) for (bootstrap_matrix, bootstrap_priors) in bootstrap_samples: self.assertCountEqual( self.character_matrix.index, bootstrap_matrix.index ) self.assertEqual( self.character_matrix.shape[1], bootstrap_matrix.shape[1] ) self.assertRaises( AssertionError, pd.testing.assert_frame_equal, self.character_matrix, bootstrap_matrix, ) def test_bootstrap_character_matrices_with_priors(self): random_state = np.random.RandomState(12345) bootstrap_samples = data_utilities.sample_bootstrap_character_matrices( self.character_matrix, num_bootstraps=10, prior_probabilities=self.priors, random_state=random_state, ) self.assertEqual(len(bootstrap_samples), 10) for (bootstrap_matrix, bootstrap_priors) in bootstrap_samples: self.assertCountEqual( self.character_matrix.index, bootstrap_matrix.index ) self.assertEqual( self.character_matrix.shape[1], bootstrap_matrix.shape[1] ) self.assertRaises( AssertionError, pd.testing.assert_frame_equal, self.character_matrix, bootstrap_matrix, ) self.assertEqual( len(bootstrap_priors), self.character_matrix.shape[1] ) def test_bootstrap_allele_tables(self): random_state = np.random.RandomState(123431235) ( character_matrix, _, _, ) = preprocessing_utilities.convert_alleletable_to_character_matrix( self.allele_table ) bootstrap_samples = data_utilities.sample_bootstrap_allele_tables( self.allele_table, num_bootstraps=10, random_state=random_state ) self.assertEqual(len(bootstrap_samples), 10) for ( bootstrap_matrix, bootstrap_priors, boostarp_state_to_indel, bootstrap_intbcs, ) in bootstrap_samples: self.assertEqual( len(bootstrap_intbcs), len(self.allele_table["intBC"].unique()) * 3, ) self.assertCountEqual( character_matrix.index, bootstrap_matrix.index ) self.assertEqual( character_matrix.shape[1], bootstrap_matrix.shape[1] ) self.assertRaises( AssertionError, pd.testing.assert_frame_equal, character_matrix, bootstrap_matrix, ) def test_bootstrap_allele_tables_non_cassiopeia_allele_table(self): random_state = np.random.RandomState(123431235) ( character_matrix, _, _, ) = preprocessing_utilities.convert_alleletable_to_character_matrix( self.non_cassiopeia_allele_table, cut_sites=["cs1", "cs2", "cs3"] ) bootstrap_samples = data_utilities.sample_bootstrap_allele_tables( self.non_cassiopeia_allele_table, num_bootstraps=10, random_state=random_state, cut_sites=["cs1", "cs2", "cs3"], ) self.assertEqual(len(bootstrap_samples), 10) for ( bootstrap_matrix, bootstrap_priors, boostrap_state_to_indel, bootstrap_intbcs, ) in bootstrap_samples: self.assertEqual( len(bootstrap_intbcs), len(self.non_cassiopeia_allele_table["intBC"].unique()) * 3, ) self.assertCountEqual( character_matrix.index, bootstrap_matrix.index ) self.assertEqual( character_matrix.shape[1], bootstrap_matrix.shape[1] ) self.assertRaises( AssertionError, pd.testing.assert_frame_equal, character_matrix, bootstrap_matrix, ) def test_bootstrap_allele_tables_priors(self): random_state = np.random.RandomState(12345) ( character_matrix, _, _, ) = preprocessing_utilities.convert_alleletable_to_character_matrix( self.allele_table ) bootstrap_samples = data_utilities.sample_bootstrap_allele_tables( self.allele_table, num_bootstraps=10, indel_priors=self.indel_to_prior, random_state=random_state, ) self.assertEqual(len(bootstrap_samples), 10) for ( bootstrap_matrix, bootstrap_priors, boostrap_state_to_indel, bootstrap_intbcs, ) in bootstrap_samples: self.assertEqual( len(bootstrap_intbcs), len(self.allele_table["intBC"].unique()) * 3, ) self.assertCountEqual( character_matrix.index, bootstrap_matrix.index ) self.assertEqual( character_matrix.shape[1], bootstrap_matrix.shape[1] ) self.assertRaises( AssertionError, pd.testing.assert_frame_equal, character_matrix, bootstrap_matrix, ) self.assertEqual(len(bootstrap_priors), character_matrix.shape[1]) def test_to_newick_no_branch_lengths(self): tree = nx.DiGraph() tree.add_nodes_from(["A", "B", "C", "D", "E", "F"]) tree.add_edge("F", "A", length=0.1) tree.add_edge("F", "B", length=0.2) tree.add_edge("F", "E", length=0.5) tree.add_edge("E", "C", length=0.3) tree.add_edge("E", "D", length=0.4) newick_string = data_utilities.to_newick(tree) self.assertEqual(newick_string, "(A,B,(C,D));") def test_to_newick_branch_lengths(self): tree = nx.DiGraph() tree.add_nodes_from(["A", "B", "C", "D", "E", "F"]) tree.add_edge("F", "A", length=0.1) tree.add_edge("F", "B", length=0.2) tree.add_edge("F", "E", length=0.5) tree.add_edge("E", "C", length=0.3) tree.add_edge("E", "D", length=0.4) newick_string = data_utilities.to_newick( tree, record_branch_lengths=True ) self.assertEqual(newick_string, "(A:0.1,B:0.2,(C:0.3,D:0.4):0.5);") def test_lca_characters(self): vecs = [[1, 0, 3, 4, 5], [1, -1, -1, 3, -1], [1, 2, 3, 2, -1]] ret_vec = data_utilities.get_lca_characters( vecs, missing_state_indicator=-1 ) self.assertEqual(ret_vec, [1, 0, 3, 0, 5]) def test_lca_characters_ambiguous(self): vecs = [ [(1, 1), (0, 2), (3,), (4,), (5,)], [1, -1, -1, 3, -1], [1, 2, 3, 2, -1], ] ret_vec = data_utilities.get_lca_characters( vecs, missing_state_indicator=-1 ) self.assertEqual(ret_vec, [1, 0, 3, 0, 5]) def test_resolve_most_abundant(self): state = (1, 2, 3, 3) self.assertEqual(data_utilities.resolve_most_abundant(state), 3) def test_simple_phylogenetic_weights_matrix(self): tree = nx.DiGraph() tree.add_nodes_from(["A", "B", "C", "D", "E", "F"]) tree.add_edge("F", "A", length=0.1) tree.add_edge("F", "B", length=0.2) tree.add_edge("F", "E", length=0.5) tree.add_edge("E", "C", length=0.3) tree.add_edge("E", "D", length=0.4) tree = CassiopeiaTree(tree=tree) weight_matrix = data_utilities.compute_phylogenetic_weight_matrix(tree) expected_weight_matrix = pd.DataFrame.from_dict( { "A": [0.0, 0.3, 0.9, 1.0], "B": [0.3, 0.0, 1.0, 1.1], "C": [0.9, 1.0, 0.0, 0.7], "D": [1.0, 1.1, 0.7, 0.0], }, orient="index", columns=["A", "B", "C", "D"], ) pd.testing.assert_frame_equal(weight_matrix, expected_weight_matrix) def test_simple_phylogenetic_weights_matrix_inverse(self): tree = nx.DiGraph() tree.add_nodes_from(["A", "B", "C", "D", "E", "F"]) tree.add_edge("F", "A", length=0.1) tree.add_edge("F", "B", length=0.2) tree.add_edge("F", "E", length=0.5) tree.add_edge("E", "C", length=0.3) tree.add_edge("E", "D", length=0.4) tree = CassiopeiaTree(tree=tree) weight_matrix = data_utilities.compute_phylogenetic_weight_matrix( tree, inverse=True ) expected_weight_matrix = pd.DataFrame.from_dict( { "A": [0.0, 1.0 / 0.3, 1.0 / 0.9, 1.0], "B": [1.0 / 0.3, 0.0, 1.0, 1.0 / 1.1], "C": [1.0 / 0.9, 1.0, 0.0, 1.0 / 0.7], "D": [1.0, 1.0 / 1.1, 1.0 / 0.7, 0.0], }, orient="index", columns=["A", "B", "C", "D"], ) pd.testing.assert_frame_equal(weight_matrix, expected_weight_matrix) def test_phylogenetic_weights_matrix_inverse_fn(self): tree = nx.DiGraph() tree.add_nodes_from(["A", "B", "C", "D", "E", "F"]) tree.add_edge("F", "A", length=0.1) tree.add_edge("F", "B", length=0.2) tree.add_edge("F", "E", length=0.5) tree.add_edge("E", "C", length=0.3) tree.add_edge("E", "D", length=0.4) tree = CassiopeiaTree(tree=tree) weight_matrix = data_utilities.compute_phylogenetic_weight_matrix( tree, inverse=True, inverse_fn=lambda x: -np.log(x) ) expected_weight_matrix = pd.DataFrame.from_dict( { "A": [0.0, -np.log(0.3), -np.log(0.9), 0], "B": [-np.log(0.3), 0.0, 0, -np.log(1.1)], "C": [-np.log(0.9), 0, 0.0, -np.log(0.7)], "D": [0.0, -np.log(1.1), -np.log(0.7), 0.0], }, orient="index", columns=["A", "B", "C", "D"], ) pd.testing.assert_frame_equal(weight_matrix, expected_weight_matrix) if __name__ == "__main__": unittest.main()
31.895377
79
0.526051
1,556
13,109
4.20437
0.115681
0.017426
0.013757
0.011006
0.813054
0.755426
0.723938
0.697646
0.683889
0.657291
0
0.053087
0.339004
13,109
410
80
31.973171
0.701904
0.015028
0
0.518405
0
0.003067
0.031235
0.00248
0
0
0
0
0.131902
1
0.042945
false
0
0.02454
0
0.070552
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8ac40c478c0c90508bda84b479e0ca48b375af3d
28
py
Python
mq_http_aliyun_sdk/__init__.py
Ahrli/rocketmq_aliyun
19b102fccc2bc4d902886fdbf39e0b9071d2b6cc
[ "Apache-2.0" ]
null
null
null
mq_http_aliyun_sdk/__init__.py
Ahrli/rocketmq_aliyun
19b102fccc2bc4d902886fdbf39e0b9071d2b6cc
[ "Apache-2.0" ]
null
null
null
mq_http_aliyun_sdk/__init__.py
Ahrli/rocketmq_aliyun
19b102fccc2bc4d902886fdbf39e0b9071d2b6cc
[ "Apache-2.0" ]
null
null
null
name = "mq_http_aliyun_sdk"
14
27
0.785714
5
28
3.8
1
0
0
0
0
0
0
0
0
0
0
0
0.107143
28
1
28
28
0.76
0
0
0
0
0
0.642857
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8ad3744032c10cd2f39708d70504db9b3c082dca
6,987
py
Python
src/flask_restalchemy/tests/test_api_processors.py
ESSS/flask-restalchemy
81dcaadf519e6cefe4b7945267328ef9a3b6451b
[ "MIT" ]
32
2018-04-04T15:55:38.000Z
2021-07-14T21:21:57.000Z
src/flask_restalchemy/tests/test_api_processors.py
ESSS/flask-restalchemy
81dcaadf519e6cefe4b7945267328ef9a3b6451b
[ "MIT" ]
28
2018-05-03T02:57:41.000Z
2021-02-06T19:02:52.000Z
src/flask_restalchemy/tests/test_api_processors.py
ESSS/flask-rest-orm
81dcaadf519e6cefe4b7945267328ef9a3b6451b
[ "MIT" ]
4
2019-01-05T23:35:31.000Z
2021-06-18T22:55:33.000Z
import json from unittest.mock import call import pytest from flask_restalchemy import Api from flask_restalchemy.decorators.request_hooks import before_request, after_request from flask_restalchemy.tests.sample_model import Employee, Company, Address @pytest.fixture def sample_api(flask_app): return Api(flask_app) @pytest.fixture(autouse=True) def create_test_sample(db_session): company = Company(id=5, name="Terrans") emp1 = Employee(id=1, firstname="Jim", lastname="Raynor", company=company) addr1 = Address(street="5 Av", number="943", city="Tarsonis") emp1.address = addr1 db_session.add(company) db_session.add(emp1) db_session.commit() @pytest.mark.parametrize("decorator_verb", ["ALL", "GET"]) def test_get_item_preprocessor(sample_api, client, mocker, decorator_verb): pre_processor_mock = mocker.Mock(return_value=None) sample_api.add_model( Employee, request_decorators={decorator_verb: before_request(pre_processor_mock)}, ) resp = client.get("/employee/1") assert resp.status_code == 200 pre_processor_mock.assert_called_once_with(id=1) resp = client.post("/employee", data=json.dumps({"firstname": "Jeff"})) assert resp.status_code == 201 # 2 calls if all verbs were decorated, otherwise test only for GET call assert pre_processor_mock.call_count == 2 if decorator_verb == "all" else 1 def test_get_collection_preprocessor(sample_api, client, mocker): pre_processor_mock = mocker.Mock(return_value=None) sample_api.add_model( Employee, request_decorators=before_request(pre_processor_mock) ) resp = client.get("/employee") assert resp.status_code == 200 assert pre_processor_mock.call_args == call(id=None) resp = client.post("/employee", data=json.dumps({"firstname": "Jeff"})) assert resp.status_code == 201 assert pre_processor_mock.call_args == call() resp = client.put("/employee/1", data=json.dumps({"lastname": "R."})) assert resp.status_code == 200 assert pre_processor_mock.call_args == call(id=1) assert pre_processor_mock.call_count == 3 def test_post_processors(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) post_mock = mocker.Mock(return_value=None) sample_api.add_model( Employee, request_decorators={ "ALL": after_request(post_mock), "POST": before_request(pre_mock), }, ) data = {"firstname": "Ana", "lastname": "Queen"} resp = client.post("/employee", data=json.dumps(data)) assert resp.status_code == 201 assert pre_mock.call_count == 1 employee_id = resp.get_json()["id"] assert employee_id assert post_mock.call_count == 1 post_mock_args = post_mock.call_args[0] assert post_mock_args[0][1] == 201 assert post_mock_args[0][0].data == resp.data def test_put_preprocessors(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) post_mock = mocker.Mock(return_value=None) sample_api.add_model( Employee, request_decorators={ "PUT": [before_request(pre_mock), after_request(post_mock)] }, ) data = {"firstname": "Ana", "lastname": "Queen"} resp = client.put("/employee/1", data=json.dumps(data)) assert resp.status_code == 200 assert pre_mock.call_count == 1 assert pre_mock.call_args == call(id=1) assert post_mock.call_count == 1 def test_delete_preprocessors(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) post_mock = mocker.Mock(return_value=None) sample_api.add_model( Employee, request_decorators={ "DELETE": [before_request(pre_mock), after_request(post_mock)] }, ) resp = client.delete("/employee/1") assert resp.status_code == 204 assert pre_mock.call_args == call(id=1) assert post_mock.call_args == call(("", 204), id=1) def test_property_get_collection_processor(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) sample_api.add_property( Employee, Employee, "colleagues", request_decorators={"GET": before_request(pre_mock)}, ) resp = client.get("/employee/1/colleagues") assert resp.status_code == 200 pre_mock.assert_called_once_with(id=None, relation_id=1) def test_relation_get_item_preprocessor(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) sample_api.add_relation( Company.employees, request_decorators={"GET": before_request(pre_mock)} ) resp = client.get("/company/5/employees/1") assert resp.status_code == 200 pre_mock.assert_called_once_with(relation_id=5, id=1) def test_relation_get_collection_preprocessor(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) sample_api.add_relation( Company.employees, request_decorators={"GET": before_request(pre_mock)} ) resp = client.get("/company/5/employees") assert resp.status_code == 200 pre_mock.assert_called_once_with(relation_id=5, id=None) def test_relation_post_processors(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) post_mock = mocker.Mock(return_value=None) sample_api.add_relation( Company.employees, request_decorators={ "POST": [before_request(pre_mock), after_request(post_mock)] }, ) data = {"firstname": "Ana", "lastname": "Queen"} resp = client.post("/company/5/employees", data=json.dumps(data)) assert resp.status_code == 201 pre_mock.assert_called_once_with(relation_id=5) assert post_mock.call_count == 1 assert post_mock.call_args[1] == {"relation_id": 5} def test_relation_put_preprocessors(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) post_mock = mocker.Mock(return_value=None) sample_api.add_relation( Company.employees, request_decorators={ "PUT": [before_request(pre_mock), after_request(post_mock)] }, ) data = {"firstname": "Ana", "lastname": "Queen"} resp = client.put("/company/5/employees/1", data=json.dumps(data)) assert resp.status_code == 200 assert pre_mock.call_args == call(relation_id=5, id=1) assert post_mock.call_count == 1 assert post_mock.call_args[1] == {"relation_id": 5, "id": 1} def test_relation_delete_preprocessors(sample_api, client, mocker): pre_mock = mocker.Mock(return_value=None) post_mock = mocker.Mock(return_value=None) sample_api.add_relation( Company.employees, request_decorators={ "DELETE": [before_request(pre_mock), after_request(post_mock)] }, ) resp = client.delete("/company/5/employees/1") assert resp.status_code == 204 assert pre_mock.call_count == 1 assert post_mock.call_count == 1 assert post_mock.call_args[1] == {"relation_id": 5, "id": 1}
32.802817
84
0.695721
943
6,987
4.870626
0.110286
0.042674
0.051818
0.074026
0.784237
0.768343
0.731548
0.701502
0.665796
0.607228
0
0.019096
0.183054
6,987
212
85
32.957547
0.785564
0.009875
0
0.484848
0
0
0.070127
0.012724
0
0
0
0
0.254545
1
0.078788
false
0
0.036364
0.006061
0.121212
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8ad59f63d7fd2e12771c6d6c6c8e82a5eaaca712
2,477
py
Python
user/mixins.py
hackkosice/registration
086103571638706e80b9215ab9f7d57e18ebf13e
[ "MIT" ]
4
2019-02-04T21:21:34.000Z
2021-03-25T01:49:21.000Z
user/mixins.py
hackkosice/registration
086103571638706e80b9215ab9f7d57e18ebf13e
[ "MIT" ]
null
null
null
user/mixins.py
hackkosice/registration
086103571638706e80b9215ab9f7d57e18ebf13e
[ "MIT" ]
1
2018-11-19T10:17:19.000Z
2018-11-19T10:17:19.000Z
from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.mixins import UserPassesTestMixin from django.core.exceptions import PermissionDenied class IsOrganizerMixin(UserPassesTestMixin): raise_exception = True def test_func(self): if not self.request.user.is_authenticated: return False if not self.request.user.email_verified: return False return self.request.user.is_authenticated and self.request.user.is_organizer class IsVolunteerMixin(UserPassesTestMixin): raise_exception = True def test_func(self): if not self.request.user.is_authenticated: return False if not self.request.user.email_verified: return False return \ self.request.user.is_authenticated and (self.request.user.is_volunteer or self.request.user.is_organizer) class IsExternalMixin(UserPassesTestMixin): raise_exception = True def test_func(self): if not self.request.user.is_authenticated: return False if not self.request.user.email_verified: return False return \ self.request.user.is_authenticated and (self.request.user.is_external or self.request.user.is_organizer) class IsDirectorMixin(UserPassesTestMixin): raise_exception = True def test_func(self): if not self.request.user.is_authenticated: return False if not self.request.user.email_verified: return False return \ self.request.user.is_authenticated and self.request.user.is_director class IsHardwareAdminMixin(UserPassesTestMixin): raise_exception = True def test_func(self): if not self.request.user.is_authenticated: return False if not self.request.user.email_verified: return False return self.request.user.is_hardware_admin or self.request.user.is_organizer def is_organizer(f, raise_exception=True): """ Decorator for views that checks whether a user is an organizer or not """ def check_perms(user): if user.is_authenticated and user.email_verified and user.is_organizer: return True # In case the 403 handler should be called raise the exception if raise_exception: raise PermissionDenied # As the last resort, show the login form return False return user_passes_test(check_perms)(f)
31.35443
117
0.696407
306
2,477
5.490196
0.222222
0.144048
0.196429
0.172024
0.633929
0.633929
0.608929
0.569643
0.569643
0.569643
0
0.001598
0.242229
2,477
78
118
31.75641
0.893447
0.069035
0
0.62963
0
0
0
0
0
0
0
0
0
1
0.12963
false
0.148148
0.055556
0
0.703704
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
76de9a07b987f9d6096b7ea514a61bf899e4a3a7
89
py
Python
spyder_kernels/console/__main__.py
ghisvail/spyder-kernels
add7133d68b361b674cb42bfaf1622007e185137
[ "MIT" ]
null
null
null
spyder_kernels/console/__main__.py
ghisvail/spyder-kernels
add7133d68b361b674cb42bfaf1622007e185137
[ "MIT" ]
null
null
null
spyder_kernels/console/__main__.py
ghisvail/spyder-kernels
add7133d68b361b674cb42bfaf1622007e185137
[ "MIT" ]
null
null
null
if __name__ == '__main__': from spyder_kernels.console import start start.main()
22.25
44
0.707865
11
89
4.909091
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.191011
89
3
45
29.666667
0.75
0
0
0
0
0
0.089888
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
76e42a8c5a83c20d878ca5fdb1091164209531ee
3,991
py
Python
tests/get_nested_pod_data_attribute_test.py
eht16/kube-cargo-load
4bc57d8bdd4789c096da05647682fde62f5dcd99
[ "Apache-2.0" ]
10
2020-04-28T04:28:10.000Z
2022-01-13T11:16:58.000Z
tests/get_nested_pod_data_attribute_test.py
eht16/kube-cargo-load
4bc57d8bdd4789c096da05647682fde62f5dcd99
[ "Apache-2.0" ]
4
2020-04-15T20:05:49.000Z
2021-05-24T17:06:24.000Z
tests/get_nested_pod_data_attribute_test.py
eht16/kube-cargo-load
4bc57d8bdd4789c096da05647682fde62f5dcd99
[ "Apache-2.0" ]
4
2020-04-15T10:54:54.000Z
2022-01-26T21:12:58.000Z
# -*- coding: utf-8 -*- # # This software may be modified and distributed under the terms # of the Apache License, Version 2.0 license. See the LICENSE file for details. from unittest import mock import json import unittest from kubecargoload import KubernetesCargoLoadOverviewProvider # pylint: disable=protected-access class GetNestedPodDataAttributeTest(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._pod_data = None def setUp(self): super().setUp() filename = 'tests/test_data/pods.json' with open(filename, encoding='utf-8') as all_pod_data_f: all_pod_data = json.load(all_pod_data_f) self._pod_data = all_pod_data['items'][0] def test_get_nested_pod_data_attribute_flat(self): provider = self._factor_provider() # test result = provider._get_nested_pod_data_attribute('kind', pod_data=self._pod_data) # check expected_result = 'Pod' self.assertEqual(result, expected_result) def _factor_provider(self): # pylint: disable=no-self-use return KubernetesCargoLoadOverviewProvider( namespace=None, context=None, show_cpu_usage=None) def test_get_nested_pod_data_attribute_nested(self): provider = self._factor_provider() # test result = provider._get_nested_pod_data_attribute( 'spec', 'schedulerName', pod_data=self._pod_data) # check expected_result = 'default-scheduler' self.assertEqual(result, expected_result) def test_get_nested_pod_data_attribute_flat_default(self): provider = self._factor_provider() default = 'default-for-nonexistent-key' # test result = provider._get_nested_pod_data_attribute( 'non-nonexistent-key', default=default, pod_data=self._pod_data) # check expected_result = default self.assertEqual(result, expected_result) def test_get_nested_pod_data_attribute_nested_default(self): provider = self._factor_provider() default = 'default-for-nonexistent-key' # test result = provider._get_nested_pod_data_attribute( 'spec', 'nested-non-nonexistent-key', default=default, pod_data=self._pod_data) # check expected_result = default self.assertEqual(result, expected_result) def test_get_nested_pod_data_attribute_nested_default_ex(self): provider = self._factor_provider() default = 'default-for-nonexistent-key' # test result = provider._get_nested_pod_data_attribute( 'non-nonexistent-key', 'nested-non-nonexistent-key', default=default, pod_data=self._pod_data) # check expected_result = default self.assertEqual(result, expected_result) def test_get_nested_pod_data_attribute_empty_pod_data(self): provider = self._factor_provider() default = 'default-for-nonexistent-key' # test with mock.patch.object(provider, '_pod_data', {}): result = provider._get_nested_pod_data_attribute( 'non-nonexistent-key', 'nested-non-nonexistent-key', default=default) # check expected_result = default self.assertEqual(result, expected_result) def test_get_nested_pod_data_attribute_empty_pod_data_passed(self): provider = self._factor_provider() default = 'default-for-nonexistent-key' # test with mock.patch.object(provider, '_pod_data', {}): result = provider._get_nested_pod_data_attribute( 'non-nonexistent-key', 'nested-non-nonexistent-key', default=default, pod_data={}) # check expected_result = default self.assertEqual(result, expected_result)
34.704348
89
0.654974
446
3,991
5.5
0.201794
0.099878
0.068488
0.091317
0.728496
0.728496
0.713004
0.713004
0.666123
0.644925
0
0.001685
0.256577
3,991
114
90
35.008772
0.825076
0.075169
0
0.558442
0
0
0.112534
0.071935
0
0
0
0
0.090909
1
0.12987
false
0.012987
0.051948
0.012987
0.207792
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
76f47254d18c2639673c033428cb44b3262ce773
8,603
py
Python
webull/endpoints.py
DT021/webull
775f64632475999bd7ef3d06e19d4c8970b83c47
[ "MIT" ]
null
null
null
webull/endpoints.py
DT021/webull
775f64632475999bd7ef3d06e19d4c8970b83c47
[ "MIT" ]
null
null
null
webull/endpoints.py
DT021/webull
775f64632475999bd7ef3d06e19d4c8970b83c47
[ "MIT" ]
null
null
null
class urls : def __init__(self) : self.base_info_url = 'https://infoapi.webull.com/api' self.base_options_url = 'https://quoteapi.webullbroker.com/api' self.base_options_gw_url = 'https://quotes-gw.webullbroker.com/api' self.base_paper_url = 'https://act.webullbroker.com/webull-paper-center/api' self.base_quote_url = 'https://quoteapi.webullbroker.com/api' self.base_securities_url = 'https://securitiesapi.webullbroker.com/api' self.base_trade_url = 'https://tradeapi.webullbroker.com/api/trade' self.base_user_url = 'https://userapi.webull.com/api' self.base_userbroker_url = 'https://userapi.webullbroker.com/api' self.base_ustrade_url = 'https://ustrade.webullfinance.com/api' self.base_paperfintech_url = 'https://act.webullfintech.com/webull-paper-center/api' self.base_fintech_gw_url = 'https://quotes-gw.webullfintech.com/api' self.base_userfintech_url = 'https://userapi.webullfintech.com/api' self.base_new_trade_url = 'https://trade.webullfintech.com/api' self.base_ustradebroker_url = 'https://ustrade.webullbroker.com/api' def account(self, account_id): return f'{self.base_trade_url}/v3/home/{account_id}' def account_id(self): return f'{self.base_trade_url}/account/getSecAccountList/v5' def account_activities(self, account_id): return f'{self.base_ustrade_url}/trade/v2/funds/{account_id}/activities' def active_gainers_losers(self, direction, region_code, rank_type, num) : if direction == 'gainer' : url = 'topGainers' elif direction == 'loser' : url = 'dropGainers' else : url = 'topActive' return f'{self.base_fintech_gw_url}/wlas/ranking/{url}?regionId={region_code}&rankType={rank_type}&pageIndex=1&pageSize={num}' def add_alert(self): return f'{self.base_userbroker_url}/user/warning/v2/manage/overlap' def analysis(self, stock): return f'{self.base_securities_url}/securities/ticker/v5/analysis/{stock}' def analysis_shortinterest(self, stock): return f'{self.base_securities_url}/securities/stock/{stock}/shortInterest' def analysis_institutional_holding(self, stock): return f'{self.base_securities_url}/securities/stock/v5/{stock}/institutionalHolding' def analysis_etf_holding(self, stock, has_num, page_size): return f'{self.base_securities_url}/securities/stock/v5/{stock}/belongEtf?hasNum={has_num}&pageSize={page_size}' def analysis_capital_flow(self, stock, show_hist): return f'{self.base_securities_url}/wlas/capitalflow/ticker?tickerId={stock}&showHis={show_hist}' def bars(self, stock): return f'{self.base_quote_url}/quote/tickerChartDatas/v5/{stock}' def cancel_order(self, account_id): return f'{self.base_ustrade_url}/trade/order/{account_id}/cancelStockOrder/' def modify_otoco_orders(self, account_id): return f'{self.base_ustrade_url}/trade/v2/corder/stock/modify/{account_id}' def cancel_otoco_orders(self, account_id, combo_id): return f'{self.base_ustrade_url}/trade/v2/corder/stock/cancel/{account_id}/{combo_id}' def check_otoco_orders(self, account_id): return f'{self.base_ustrade_url}/trade/v2/corder/stock/check/{account_id}' def place_otoco_orders(self, account_id): return f'{self.base_ustrade_url}/trade/v2/corder/stock/place/{account_id}' def dividends(self, account_id): return f'{self.base_trade_url}/v2/account/{account_id}/dividends?direct=in' def fundamentals(self, stock): return f'{self.base_securities_url}/securities/financial/index/{stock}' def is_tradable(self, stock): return f'{self.base_trade_url}/ticker/broker/permissionV2?tickerId={stock}' def list_alerts(self): return f'{self.base_userbroker_url}/user/warning/v2/query/tickers' def login(self): return f'{self.base_user_url}/passport/login/v5/account' def get_mfa(self) : return f'{self.base_userfintech_url}/passport/v2/verificationCode/send' def check_mfa(self) : return f'{self.base_userfintech_url}/passport/v2/verificationCode/checkCode' def get_security(self, username, account_type, region_code, event, time, url=0) : if url == 1 : url = 'getPrivacyQuestion' else : url = 'getSecurityQuestion' return f'{self.base_userfintech_url}/user/risk/{url}?account={username}&accountType={account_type}&regionId={region_code}&event={event}&v={time}' def next_security(self, username, account_type, region_code, event, time, url=0) : if url == 1 : url = 'nextPrivacyQuestion' else : url = 'nextSecurityQuestion' return f'{self.base_userfintech_url}/user/risk/{url}?account={username}&accountType={account_type}&regionId={region_code}&event={event}&v={time}' def check_security(self) : return f'{self.base_userfintech_url}/user/risk/checkAnswer' def logout(self): return f'{self.base_userbroker_url}/passport/login/logout' def news(self, stock): return f'{self.base_securities_url}/information/news/v5/tickerNews/{stock}' def option_quotes(self): return f'{self.base_options_gw_url}/quote/option/query/list' def options(self, stock): return f'{self.base_options_url}/quote/option/{stock}/list' def options_exp_date(self, stock): return f'{self.base_options_url}/quote/option/{stock}/list' def options_bars(self, derivativeId): return f'{self.base_options_gw_url}/quote/option/chart/query?derivativeId={derivativeId}' def orders(self, account_id, page_size): return f'{self.base_ustradebroker_url}/v2/option/list?secAccountId={account_id}&startTime=1970-0-1&dateType=ORDER&pageSize={page_size}&status=' def paper_orders(self, paper_account_id, page_size): return f'{self.base_paper_url}/paper/1/acc/{paper_account_id}/order?&startTime=1970-0-1&dateType=ORDER&pageSize={page_size}&status=' def paper_account(self, paper_account_id): return f'{self.base_paperfintech_url}/paper/1/acc/{paper_account_id}' def paper_account_id(self): return f'{self.base_paperfintech_url}/myaccounts/true' def paper_cancel_order(self, paper_account_id, order_id): return f'{self.base_paper_url}/paper/1/acc/{paper_account_id}/orderop/cancel/{order_id}' def paper_modify_order(self, paper_account_id, order_id): return f'{self.base_paper_url}/paper/1/acc/{paper_account_id}/orderop/modify/{order_id}' def paper_place_order(self, paper_account_id, stock): return f'{self.base_paper_url}/paper/1/acc/{paper_account_id}/orderop/place/{stock}' def place_option_orders(self, account_id): return f'{self.base_ustrade_url}/trade/v2/option/placeOrder/{account_id}' def place_orders(self, account_id): return f'{self.base_ustrade_url}/trade/order/{account_id}/placeStockOrder' def modify_order(self, account_id, order_id): return f'{self.base_trade_url}/trade/order/{account_id}/modifyStockOrder/{order_id}' def quotes(self, stock): return f'{self.base_options_gw_url}/quotes/ticker/getTickerRealTime?tickerId={stock}&includeSecu=1&includeQuote=1' def rankings(self): return f'{self.base_securities_url}/securities/market/v5/6/portal' def refresh_login(self): return f'{self.base_user_url}/passport/refreshToken?refreshToken=' def remove_alert(self): return f'{self.base_userbroker_url}/user/warning/v2/manage/overlap' def replace_option_orders(self, account_id): return f'{self.base_trade_url}/v2/option/replaceOrder/{account_id}' def stock_id(self, stock, region_code): return f'{self.base_options_gw_url}/search/pc/tickers?keyword={stock}&pageIndex=1&pageSize=20&regionId={region_code}' def trade_token(self): return f'{self.base_new_trade_url}/trading/v1/global/trade/login' def user(self): return f'{self.base_user_url}/user' def screener(self): return f'{self.base_userbroker_url}/wlas/screener/ng/query' def social_posts(self, topic, num=100): return f'{self.base_user_url}/social/feed/topic/{topic}/posts?size={num}' def social_home(self, topic, num=100): return f'{self.base_user_url}/social/feed/topic/{topic}/home?size={num}' def portfolio_lists(self): return f'{self.base_options_gw_url}/personal/portfolio/v2/check'
43.892857
153
0.708358
1,185
8,603
4.90211
0.164557
0.095025
0.102255
0.139439
0.592185
0.524703
0.498709
0.438974
0.391978
0.33999
0
0.00829
0.158666
8,603
195
154
44.117949
0.79428
0
0
0.079137
0
0.057554
0.514007
0.432756
0
0
0
0
0
1
0.395683
false
0.035971
0
0.366906
0.791367
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4