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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
948430a228985d9ad9b0f6d8476cd8895b493e31
| 4,813
|
py
|
Python
|
tests/permutils/test_groups.py
|
quintant/Permuta
|
4cdc7990e3dc298d0089ba8c48cd8967acd9b81f
|
[
"BSD-3-Clause"
] | 12
|
2015-09-09T02:40:50.000Z
|
2021-06-02T13:40:25.000Z
|
tests/permutils/test_groups.py
|
quintant/Permuta
|
4cdc7990e3dc298d0089ba8c48cd8967acd9b81f
|
[
"BSD-3-Clause"
] | 80
|
2015-12-17T15:00:17.000Z
|
2022-01-25T20:31:54.000Z
|
tests/permutils/test_groups.py
|
quintant/Permuta
|
4cdc7990e3dc298d0089ba8c48cd8967acd9b81f
|
[
"BSD-3-Clause"
] | 19
|
2015-12-16T13:16:10.000Z
|
2021-06-01T14:37:33.000Z
|
from permuta import Perm
from permuta.permutils.groups import dihedral_group
def test_dihedral_group():
first_11 = {
0: set(),
1: set(),
2: set(),
3: {
Perm((1, 0, 2)),
Perm((2, 0, 1)),
Perm((0, 1, 2)),
Perm((2, 1, 0)),
Perm((1, 2, 0)),
Perm((0, 2, 1)),
},
4: {
Perm((3, 2, 1, 0)),
Perm((0, 3, 2, 1)),
Perm((3, 0, 1, 2)),
Perm((2, 1, 0, 3)),
Perm((2, 3, 0, 1)),
Perm((1, 2, 3, 0)),
Perm((1, 0, 3, 2)),
Perm((0, 1, 2, 3)),
},
5: {
Perm((0, 1, 2, 3, 4)),
Perm((3, 2, 1, 0, 4)),
Perm((4, 0, 1, 2, 3)),
Perm((0, 4, 3, 2, 1)),
Perm((4, 3, 2, 1, 0)),
Perm((1, 0, 4, 3, 2)),
Perm((3, 4, 0, 1, 2)),
Perm((2, 3, 4, 0, 1)),
Perm((1, 2, 3, 4, 0)),
Perm((2, 1, 0, 4, 3)),
},
6: {
Perm((3, 4, 5, 0, 1, 2)),
Perm((4, 3, 2, 1, 0, 5)),
Perm((2, 1, 0, 5, 4, 3)),
Perm((0, 1, 2, 3, 4, 5)),
Perm((2, 3, 4, 5, 0, 1)),
Perm((3, 2, 1, 0, 5, 4)),
Perm((1, 0, 5, 4, 3, 2)),
Perm((4, 5, 0, 1, 2, 3)),
Perm((5, 4, 3, 2, 1, 0)),
Perm((5, 0, 1, 2, 3, 4)),
Perm((0, 5, 4, 3, 2, 1)),
Perm((1, 2, 3, 4, 5, 0)),
},
7: {
Perm((2, 3, 4, 5, 6, 0, 1)),
Perm((5, 6, 0, 1, 2, 3, 4)),
Perm((0, 1, 2, 3, 4, 5, 6)),
Perm((4, 3, 2, 1, 0, 6, 5)),
Perm((1, 0, 6, 5, 4, 3, 2)),
Perm((0, 6, 5, 4, 3, 2, 1)),
Perm((3, 2, 1, 0, 6, 5, 4)),
Perm((6, 5, 4, 3, 2, 1, 0)),
Perm((4, 5, 6, 0, 1, 2, 3)),
Perm((2, 1, 0, 6, 5, 4, 3)),
Perm((1, 2, 3, 4, 5, 6, 0)),
Perm((6, 0, 1, 2, 3, 4, 5)),
Perm((3, 4, 5, 6, 0, 1, 2)),
Perm((5, 4, 3, 2, 1, 0, 6)),
},
8: {
Perm((1, 0, 7, 6, 5, 4, 3, 2)),
Perm((7, 0, 1, 2, 3, 4, 5, 6)),
Perm((4, 5, 6, 7, 0, 1, 2, 3)),
Perm((7, 6, 5, 4, 3, 2, 1, 0)),
Perm((2, 1, 0, 7, 6, 5, 4, 3)),
Perm((6, 5, 4, 3, 2, 1, 0, 7)),
Perm((1, 2, 3, 4, 5, 6, 7, 0)),
Perm((0, 7, 6, 5, 4, 3, 2, 1)),
Perm((2, 3, 4, 5, 6, 7, 0, 1)),
Perm((0, 1, 2, 3, 4, 5, 6, 7)),
Perm((3, 2, 1, 0, 7, 6, 5, 4)),
Perm((6, 7, 0, 1, 2, 3, 4, 5)),
Perm((5, 6, 7, 0, 1, 2, 3, 4)),
Perm((5, 4, 3, 2, 1, 0, 7, 6)),
Perm((3, 4, 5, 6, 7, 0, 1, 2)),
Perm((4, 3, 2, 1, 0, 7, 6, 5)),
},
9: {
Perm((3, 4, 5, 6, 7, 8, 0, 1, 2)),
Perm((7, 8, 0, 1, 2, 3, 4, 5, 6)),
Perm((4, 5, 6, 7, 8, 0, 1, 2, 3)),
Perm((0, 1, 2, 3, 4, 5, 6, 7, 8)),
Perm((5, 4, 3, 2, 1, 0, 8, 7, 6)),
Perm((2, 3, 4, 5, 6, 7, 8, 0, 1)),
Perm((8, 7, 6, 5, 4, 3, 2, 1, 0)),
Perm((0, 8, 7, 6, 5, 4, 3, 2, 1)),
Perm((2, 1, 0, 8, 7, 6, 5, 4, 3)),
Perm((3, 2, 1, 0, 8, 7, 6, 5, 4)),
Perm((4, 3, 2, 1, 0, 8, 7, 6, 5)),
Perm((5, 6, 7, 8, 0, 1, 2, 3, 4)),
Perm((6, 5, 4, 3, 2, 1, 0, 8, 7)),
Perm((7, 6, 5, 4, 3, 2, 1, 0, 8)),
Perm((6, 7, 8, 0, 1, 2, 3, 4, 5)),
Perm((8, 0, 1, 2, 3, 4, 5, 6, 7)),
Perm((1, 0, 8, 7, 6, 5, 4, 3, 2)),
Perm((1, 2, 3, 4, 5, 6, 7, 8, 0)),
},
10: {
Perm((3, 2, 1, 0, 9, 8, 7, 6, 5, 4)),
Perm((6, 5, 4, 3, 2, 1, 0, 9, 8, 7)),
Perm((4, 5, 6, 7, 8, 9, 0, 1, 2, 3)),
Perm((6, 7, 8, 9, 0, 1, 2, 3, 4, 5)),
Perm((0, 1, 2, 3, 4, 5, 6, 7, 8, 9)),
Perm((5, 6, 7, 8, 9, 0, 1, 2, 3, 4)),
Perm((3, 4, 5, 6, 7, 8, 9, 0, 1, 2)),
Perm((5, 4, 3, 2, 1, 0, 9, 8, 7, 6)),
Perm((7, 8, 9, 0, 1, 2, 3, 4, 5, 6)),
Perm((9, 8, 7, 6, 5, 4, 3, 2, 1, 0)),
Perm((9, 0, 1, 2, 3, 4, 5, 6, 7, 8)),
Perm((2, 3, 4, 5, 6, 7, 8, 9, 0, 1)),
Perm((0, 9, 8, 7, 6, 5, 4, 3, 2, 1)),
Perm((2, 1, 0, 9, 8, 7, 6, 5, 4, 3)),
Perm((8, 7, 6, 5, 4, 3, 2, 1, 0, 9)),
Perm((1, 0, 9, 8, 7, 6, 5, 4, 3, 2)),
Perm((1, 2, 3, 4, 5, 6, 7, 8, 9, 0)),
Perm((8, 9, 0, 1, 2, 3, 4, 5, 6, 7)),
Perm((4, 3, 2, 1, 0, 9, 8, 7, 6, 5)),
Perm((7, 6, 5, 4, 3, 2, 1, 0, 9, 8)),
},
}
for i in range(11):
assert set(dihedral_group(i)) == first_11[i]
| 36.18797
| 52
| 0.278413
| 908
| 4,813
| 1.469163
| 0.031938
| 0.065967
| 0.08096
| 0.083958
| 0.802099
| 0.726387
| 0.607196
| 0.45952
| 0.36057
| 0.178411
| 0
| 0.301667
| 0.46416
| 4,813
| 132
| 53
| 36.462121
| 0.215587
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007692
| 1
| 0.007692
| false
| 0
| 0.015385
| 0
| 0.023077
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
846f2d521e9256b8349ec8db3ed687c29eac602e
| 194
|
py
|
Python
|
pyautofinance/common/feeds/filterers/default_filterer.py
|
webclinic017/PyAutoFinance
|
532cb1c5418dd9eeb07f2f08646170cde1fe0303
|
[
"MIT"
] | null | null | null |
pyautofinance/common/feeds/filterers/default_filterer.py
|
webclinic017/PyAutoFinance
|
532cb1c5418dd9eeb07f2f08646170cde1fe0303
|
[
"MIT"
] | null | null | null |
pyautofinance/common/feeds/filterers/default_filterer.py
|
webclinic017/PyAutoFinance
|
532cb1c5418dd9eeb07f2f08646170cde1fe0303
|
[
"MIT"
] | 1
|
2022-02-24T09:18:13.000Z
|
2022-02-24T09:18:13.000Z
|
from pyautofinance.common.feeds.filterers.candles_filterer import CandlesFilterer
class DefaultCandlesFilterer(CandlesFilterer):
def filter_candles(self, candles):
return candles
| 24.25
| 81
| 0.809278
| 19
| 194
| 8.157895
| 0.789474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134021
| 194
| 7
| 82
| 27.714286
| 0.922619
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
848a907362802c7312ebe9968310b88b58e016aa
| 179
|
py
|
Python
|
pbxproj/pbxsections/PBXSourcesBuildPhase.py
|
xwf20050250/mod-pbxproj
|
2cd641157abab964d20e9bcd3769e02ebe651521
|
[
"MIT"
] | 991
|
2015-01-02T00:09:11.000Z
|
2022-03-31T02:32:28.000Z
|
pbxproj/pbxsections/PBXSourcesBuildPhase.py
|
xwf20050250/mod-pbxproj
|
2cd641157abab964d20e9bcd3769e02ebe651521
|
[
"MIT"
] | 262
|
2015-01-30T22:00:55.000Z
|
2022-03-31T20:26:21.000Z
|
pbxproj/pbxsections/PBXSourcesBuildPhase.py
|
xwf20050250/mod-pbxproj
|
2cd641157abab964d20e9bcd3769e02ebe651521
|
[
"MIT"
] | 255
|
2015-01-22T09:22:43.000Z
|
2022-03-27T07:53:37.000Z
|
from pbxproj.pbxsections.PBXGenericBuildPhase import PBXGenericBuildPhase
class PBXSourcesBuildPhase(PBXGenericBuildPhase):
def _get_comment(self):
return 'Sources'
| 25.571429
| 73
| 0.810056
| 15
| 179
| 9.533333
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134078
| 179
| 6
| 74
| 29.833333
| 0.922581
| 0
| 0
| 0
| 0
| 0
| 0.039106
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
84937d56334915921349723c3383005a9c72a64c
| 1,155
|
py
|
Python
|
network/resnet.py
|
karthikbhamidipati/image-classification-deeper-networks
|
d6fececa08092a0b8af6fd01fe89485958e61c01
|
[
"Apache-2.0"
] | 1
|
2021-06-16T09:13:45.000Z
|
2021-06-16T09:13:45.000Z
|
network/resnet.py
|
karthikbhamidipati/image-classification-deeper-networks
|
d6fececa08092a0b8af6fd01fe89485958e61c01
|
[
"Apache-2.0"
] | null | null | null |
network/resnet.py
|
karthikbhamidipati/image-classification-deeper-networks
|
d6fececa08092a0b8af6fd01fe89485958e61c01
|
[
"Apache-2.0"
] | null | null | null |
from torch.nn import Conv2d, Linear, DataParallel
from torchvision import models
def _get_resnet_model(resnet_model, input_filters, num_classes):
conv1 = resnet_model.conv1
fc = resnet_model.fc
resnet_model.conv1 = Conv2d(input_filters, conv1.out_channels, kernel_size=conv1.kernel_size,
stride=conv1.stride, padding=conv1.padding, bias=False)
resnet_model.fc = Linear(in_features=fc.in_features, out_features=num_classes,
bias=True)
return DataParallel(resnet_model)
def resnet18(input_filters, num_classes):
return _get_resnet_model(models.resnet18(), input_filters, num_classes)
def resnet34(input_filters, num_classes):
return _get_resnet_model(models.resnet34(), input_filters, num_classes)
def resnet50(input_filters, num_classes):
return _get_resnet_model(models.resnet50(), input_filters, num_classes)
def resnet101(input_filters, num_classes):
return _get_resnet_model(models.resnet101(), input_filters, num_classes)
def resnet152(input_filters, num_classes):
return _get_resnet_model(models.resnet152(), input_filters, num_classes)
| 35
| 97
| 0.758442
| 150
| 1,155
| 5.48
| 0.24
| 0.160584
| 0.20073
| 0.294404
| 0.542579
| 0.291971
| 0.291971
| 0.291971
| 0.291971
| 0
| 0
| 0.033951
| 0.158442
| 1,155
| 32
| 98
| 36.09375
| 0.811728
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0
| 0.1
| 0.25
| 0.7
| 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
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
84a4b2512e4dde995161d1234d857a335f9717dd
| 150
|
py
|
Python
|
src/orders/admin.py
|
kc97ble/icrew
|
6a75848b9e9c38dda5b641b54298735d3a749454
|
[
"MIT"
] | null | null | null |
src/orders/admin.py
|
kc97ble/icrew
|
6a75848b9e9c38dda5b641b54298735d3a749454
|
[
"MIT"
] | 12
|
2019-12-31T13:18:24.000Z
|
2021-09-22T18:21:50.000Z
|
src/orders/admin.py
|
kc97ble/icrew
|
6a75848b9e9c38dda5b641b54298735d3a749454
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Drink, Order
# Register your models here.
admin.site.register(Drink)
admin.site.register(Order)
| 21.428571
| 32
| 0.8
| 22
| 150
| 5.454545
| 0.545455
| 0.15
| 0.283333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113333
| 150
| 6
| 33
| 25
| 0.902256
| 0.173333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 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
| 5
|
84cb0fcd2c40f4ba876d1843b992a62e1ddc86db
| 211
|
py
|
Python
|
filter_plugins/dns_to_ip.py
|
ulucaydin/ansible-filters
|
2385875b3be1f3da22681bafdedb64825dec0971
|
[
"MIT"
] | null | null | null |
filter_plugins/dns_to_ip.py
|
ulucaydin/ansible-filters
|
2385875b3be1f3da22681bafdedb64825dec0971
|
[
"MIT"
] | null | null | null |
filter_plugins/dns_to_ip.py
|
ulucaydin/ansible-filters
|
2385875b3be1f3da22681bafdedb64825dec0971
|
[
"MIT"
] | null | null | null |
import socket
def dns_to_ip(val):
"""
Resolves DNS to IP address
"""
return socket.gethostbyname(val)
class FilterModule(object):
def filters(self):
return {'dns_to_ip': dns_to_ip}
| 17.583333
| 39
| 0.654028
| 29
| 211
| 4.551724
| 0.551724
| 0.151515
| 0.212121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.236967
| 211
| 11
| 40
| 19.181818
| 0.819876
| 0.123223
| 0
| 0
| 0
| 0
| 0.053254
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.166667
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
17023ec71d99883d5bfc02ceef117ad249c352cf
| 110
|
py
|
Python
|
embark/uploader/admin.py
|
BenediktMKuehne/embark
|
809f3fdd3b5634b52807796d4d8de1379d219b3d
|
[
"MIT"
] | null | null | null |
embark/uploader/admin.py
|
BenediktMKuehne/embark
|
809f3fdd3b5634b52807796d4d8de1379d219b3d
|
[
"MIT"
] | 2
|
2022-01-27T12:36:19.000Z
|
2022-01-27T12:36:19.000Z
|
embark/uploader/admin.py
|
BenediktMKuehne/embark
|
809f3fdd3b5634b52807796d4d8de1379d219b3d
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import FirmwareAnalysis
admin.site.register(FirmwareAnalysis)
| 18.333333
| 37
| 0.845455
| 13
| 110
| 7.153846
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 110
| 5
| 38
| 22
| 0.939394
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ca0aa7e7701dda69448cb7cbebd6ac3e7f47bb77
| 3,218
|
py
|
Python
|
basic/tones.py
|
willsheffler/games
|
0f894178aac8fbb3dd460fdac3b27c7d960846bb
|
[
"Apache-2.0"
] | null | null | null |
basic/tones.py
|
willsheffler/games
|
0f894178aac8fbb3dd460fdac3b27c7d960846bb
|
[
"Apache-2.0"
] | null | null | null |
basic/tones.py
|
willsheffler/games
|
0f894178aac8fbb3dd460fdac3b27c7d960846bb
|
[
"Apache-2.0"
] | null | null | null |
import itertools
TONES = [
('E4', 0.1, 0.1), ('E4', 0.1, 0.1), ('E4', 0.1, 0.3), ('C4', 0.1, 0.1), ('E4', 0.1, 0.3),
('G4', 0.1, 0.7), ('G3', 0.1, 0.7), ('C4', 0.3, 0.3), ('G3', 0.3, 0.3), ('E3', 0.3, 0.3),
('A3', 0.3, 0.1), ('B3', 0.1, 0.3), ('A#3', 0.2, 0.1), ('A3', 0.1, 0.3), ('G3', 0.1, 0.15),
('E4', 0.1, 0.15), ('G4', 0.1, 0.15), ('A4', 0.1, 0.3), ('F4', 0.1, 0.1), ('G4', 0.1, 0.3),
('E4', 0.1, 0.3), ('C4', 0.1, 0.1), ('D4', 0.1, 0.1), ('B3', 0.1, 0.5), ('C4', 0.3, 0.3),
('G3', 0.3, 0.3), ('E3', 0.3, 0.3), ('A3', 0.3, 0.1), ('B3', 0.1, 0.3), ('A#3', 0.2, 0.1),
('A3', 0.1, 0.3), ('G3', 0.1, 0.15), ('E4', 0.1, 0.15), ('G4', 0.1, 0.15), ('A4', 0.1, 0.3),
('F4', 0.1, 0.1), ('G4', 0.1, 0.3), ('E4', 0.1, 0.3), ('C4', 0.1, 0.1), ('D4', 0.1, 0.1),
('B3', 0.1, 0.9), ('G4', 0.1, 0.1), ('F#4', 0.1, 0.1), ('F4', 0.1, 0.1), ('D#4', 0.1, 0.3),
('E4', 0.1, 0.3), ('G#3', 0.1, 0.1), ('A3', 0.1, 0.1), ('C4', 0.1, 0.3), ('A3', 0.1, 0.1),
('C4', 0.1, 0.1), ('D4', 0.1, 0.5), ('G4', 0.1, 0.1), ('F#4', 0.1, 0.1), ('F4', 0.1, 0.1),
('D#4', 0.1, 0.3), ('E4', 0.1, 0.3), ('C5', 0.1, 0.3), ('C5', 0.1, 0.1), ('C5', 0.1, 1.1),
('G4', 0.1, 0.1), ('F#4', 0.1, 0.1), ('F4', 0.1, 0.1), ('D#4', 0.1, 0.3), ('E4', 0.1, 0.3),
('G#3', 0.1, 0.1), ('A3', 0.1, 0.1), ('C4', 0.1, 0.3), ('A3', 0.1, 0.1), ('C4', 0.1, 0.1),
('D4', 0.1, 0.5), ('D#4', 0.3, 0.3), ('D4', 0.3, 0.3), ('C4', 0.3, 1.3), ('C4', 0.1, 0.1),
('C4', 0.1, 0.3), ('C4', 0.1, 0.3), ('C4', 0.1, 0.1), ('D4', 0.1, 0.3), ('E4', 0.2, 0.05),
('C4', 0.2, 0.05), ('A3', 0.2, 0.05), ('G3', 0.1, 0.7), ('C4', 0.1, 0.1), ('C4', 0.1, 0.3),
('C4', 0.1, 0.3), ('C4', 0.1, 0.1), ('D4', 0.1, 0.1), ('E4', 0.1, 0.7), ('A4', 0.1, 0.3),
('G4', 0.1, 0.5), ('C4', 0.1, 0.1), ('C4', 0.1, 0.3), ('C4', 0.1, 0.3), ('C4', 0.1, 0.1),
('D4', 0.1, 0.3), ('E4', 0.2, 0.05), ('C4', 0.2, 0.05), ('A3', 0.2, 0.05), ('G3', 0.1, 0.7),
('E4', 0.1, 0.1), ('E4', 0.1, 0.3), ('E4', 0.1, 0.3), ('C4', 0.1, 0.1), ('E4', 0.1, 0.3),
('G4', 0.1, 0.7), ('G3', 0.1, 0.7), ('G3', 0.1, 0.125), ('C4', 0.1, 0.125), ('E4', 0.1, 0.125),
('G4', 0.1, 0.125), ('C5', 0.1, 0.125), ('E5', 0.1, 0.125), ('G5', 0.1, 0.575),
('E5', 0.1, 0.575), ('G#3', 0.1, 0.125), ('C4', 0.1, 0.125), ('D#4', 0.1, 0.125),
('G#4', 0.1, 0.125), ('C5', 0.1, 0.125), ('D#5', 0.1, 0.125), ('G#5', 0.1, 0.575),
('D#5', 0.1, 0.575), ('A#3', 0.1, 0.125), ('D4', 0.1, 0.125), ('F4', 0.1, 0.125),
('A#4', 0.1, 0.125), ('D5', 0.1, 0.125), ('F5', 0.1, 0.125), ('A#5', 0.1, 0.575),
('A#5', 0.1, 0.125), ('A#5', 0.1, 0.125), ('A#5', 0.1, 0.125), ('C6', 0.675, 0)
]
def play_sound():
note, length, wait = TONES.pop(0)
if TONES:
clock.schedule(play_sound, length + wait)
tone.play(note, length)
clock.schedule(play_sound, 1.0)
# We just put something on the screen
BLOCK_POSITIONS = [
(750, 50),
(750, 550),
(50, 550),
(50, 50),
]
block_positions = itertools.cycle(BLOCK_POSITIONS)
block = Actor('block', center=(50, 50))
def draw():
screen.clear()
block.draw()
def move_block():
"""Move the block to the next position over 1 second."""
animate(block, duration=1, pos=next(block_positions), on_finished=move_block)
move_block()
| 52.754098
| 98
| 0.402424
| 784
| 3,218
| 1.637755
| 0.094388
| 0.239875
| 0.264019
| 0.11215
| 0.609813
| 0.568536
| 0.557632
| 0.557632
| 0.536604
| 0.479751
| 0
| 0.292272
| 0.187694
| 3,218
| 60
| 99
| 53.633333
| 0.198929
| 0.027035
| 0
| 0
| 0
| 0
| 0.09472
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.058824
| false
| 0
| 0.019608
| 0
| 0.078431
| 0
| 0
| 0
| 1
| null | 1
| 1
| 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
| 5
|
ca0f9ed64ae35080856c42eee14885297a9b0770
| 77
|
py
|
Python
|
hutch_python/cookiecutter/{{ cookiecutter.hutch }}/{{ cookiecutter.hutch }}/beamline.py
|
tangkong/hutch-python
|
7127985182c56fa0ecd70efb9679621fe8f47702
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
hutch_python/cookiecutter/{{ cookiecutter.hutch }}/{{ cookiecutter.hutch }}/beamline.py
|
tangkong/hutch-python
|
7127985182c56fa0ecd70efb9679621fe8f47702
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
hutch_python/cookiecutter/{{ cookiecutter.hutch }}/{{ cookiecutter.hutch }}/beamline.py
|
tangkong/hutch-python
|
7127985182c56fa0ecd70efb9679621fe8f47702
|
[
"BSD-3-Clause-LBNL"
] | null | null | null |
from hutch_python.utils import safe_load
with safe_load('example'):
1/0
| 15.4
| 40
| 0.753247
| 13
| 77
| 4.230769
| 0.846154
| 0.290909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030769
| 0.155844
| 77
| 4
| 41
| 19.25
| 0.815385
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ca4c89b5378772b5589b7f20ea7998c3d6c62475
| 4,499
|
py
|
Python
|
app/auth/send_emails.py
|
Anti-Counter021/Anti-YouTube-back-end
|
eca9b26b4a1feb7e516c0164e86c5d6444af8db5
|
[
"MIT"
] | null | null | null |
app/auth/send_emails.py
|
Anti-Counter021/Anti-YouTube-back-end
|
eca9b26b4a1feb7e516c0164e86c5d6444af8db5
|
[
"MIT"
] | null | null | null |
app/auth/send_emails.py
|
Anti-Counter021/Anti-YouTube-back-end
|
eca9b26b4a1feb7e516c0164e86c5d6444af8db5
|
[
"MIT"
] | null | null | null |
from pathlib import Path
from uuid import UUID
from app.config import SERVER_HOST_FRONT_END, PROJECT_NAME, EMAIL_TEMPLATES_DIR
from app.send_emails import send_email
def send_export_data(email_to: str, file_name: str) -> None:
"""
Send export data
:param email_to: Email
:type email_to: str
:param file_name: File name
:type file_name: str
:return: None
:rtype: None
"""
project_name = PROJECT_NAME
subject = f'{project_name} - Export data'
with open(Path(EMAIL_TEMPLATES_DIR) / 'export_data.html') as f:
template_str = f.read()
send_email(
email_to=email_to,
subject_template=subject,
html_template=template_str,
environment={
'project_name': PROJECT_NAME,
'email': email_to,
},
attach=True,
file_name=file_name,
)
def send_about_change_password(email_to: str, username: str, password: str) -> None:
"""
Send about change password
:param email_to: Email to user
:type email_to: str
:param username: Username
:type username: str
:param password: Password
:type password: str
:return: None
:rtype: None
"""
project_name = PROJECT_NAME
subject = f'{project_name} - New account for user {username}'
with open(Path(EMAIL_TEMPLATES_DIR) / 'change_password.html') as f:
template_str = f.read()
send_email(
email_to=email_to,
subject_template=subject,
html_template=template_str,
environment={
'project_name': PROJECT_NAME,
'username': username,
'password': password,
'email': email_to,
},
)
def send_new_account_email(email_to: str, username: str, password: str, uuid: UUID) -> None:
"""
Activation user email send
:param email_to: Email to user
:type email_to: str
:param username: Username
:type username: str
:param password: Password
:type password: str
:param uuid: Uuid
:type uuid: UUID
:return: None
:rtype: None
"""
project_name = PROJECT_NAME
subject = f'{project_name} - New account for user {username}'
with open(Path(EMAIL_TEMPLATES_DIR) / 'new_account.html') as f:
template_str = f.read()
link = f'{SERVER_HOST_FRONT_END}/verify/?token={uuid}'
send_email(
email_to=email_to,
subject_template=subject,
html_template=template_str,
environment={
'project_name': PROJECT_NAME,
'username': username,
'password': password,
'email': email_to,
'link': link,
},
)
def send_reset_password_email(email_to: str, username: str, password: str, token: str) -> None:
"""
Reset password for user email send
:param email_to: Email to user
:type email_to: str
:param username: Username
:type username: str
:param password: Password
:type password: str
:param token: Token
:type token: str
:return: None
:rtype: None
"""
project_name = PROJECT_NAME
subject = f'{project_name} - Reset password for user {username}'
with open(Path(EMAIL_TEMPLATES_DIR) / 'reset_password.html') as f:
template_str = f.read()
link = f'{SERVER_HOST_FRONT_END}/password-reset/?token={token}'
send_email(
email_to=email_to,
subject_template=subject,
html_template=template_str,
environment={
'project_name': PROJECT_NAME,
'username': username,
'password': password,
'email': email_to,
'link': link,
},
)
def send_username_email(email_to: str, username: str) -> None:
"""
Send email for get username
:param email_to: Email
:type email_to: str
:param username: Username
:type username: str
:return: None
"""
project_name = PROJECT_NAME
subject = f'{project_name} - Get username'
with open(Path(EMAIL_TEMPLATES_DIR) / 'get_username.html') as f:
template_str = f.read()
send_email(
email_to=email_to,
subject_template=subject,
html_template=template_str,
environment={
'project_name': PROJECT_NAME,
'username': username,
'email': email_to,
},
)
| 29.405229
| 95
| 0.596355
| 523
| 4,499
| 4.887189
| 0.10325
| 0.090376
| 0.061033
| 0.086072
| 0.769562
| 0.769562
| 0.748044
| 0.721049
| 0.685837
| 0.630282
| 0
| 0
| 0.307846
| 4,499
| 152
| 96
| 29.598684
| 0.820809
| 0.208269
| 0
| 0.643678
| 0
| 0
| 0.170577
| 0.030755
| 0
| 0
| 0
| 0
| 0
| 1
| 0.057471
| false
| 0.114943
| 0.045977
| 0
| 0.103448
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ca5b3d770ec1e9b9727edff78dfb5fe41e2af00e
| 162
|
py
|
Python
|
innerscope/__init__.py
|
eriknw/innerscope
|
16e48fc745203d09c0bb57ee72cbe2f26b84c58f
|
[
"BSD-3-Clause"
] | 16
|
2020-08-10T04:46:50.000Z
|
2022-02-20T01:43:23.000Z
|
innerscope/__init__.py
|
eriknw/innerscope
|
16e48fc745203d09c0bb57ee72cbe2f26b84c58f
|
[
"BSD-3-Clause"
] | null | null | null |
innerscope/__init__.py
|
eriknw/innerscope
|
16e48fc745203d09c0bb57ee72cbe2f26b84c58f
|
[
"BSD-3-Clause"
] | null | null | null |
from .core import bindwith, call, callwith, scoped_function # noqa
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
| 23.142857
| 67
| 0.790123
| 21
| 162
| 5.666667
| 0.619048
| 0.277311
| 0.302521
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12963
| 162
| 6
| 68
| 27
| 0.843972
| 0.024691
| 0
| 0
| 0
| 0
| 0.044872
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
ca5c7ef69b6880d6914f16e4a7ff0e770318ac3a
| 35,792
|
py
|
Python
|
c2cgeoportal/tests/functional/test_mapserverproxy.py
|
pgiraud/c2cgeoportal
|
3ec955c5c67d16256af726a62d586b3f4ec3b500
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
c2cgeoportal/tests/functional/test_mapserverproxy.py
|
pgiraud/c2cgeoportal
|
3ec955c5c67d16256af726a62d586b3f4ec3b500
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
c2cgeoportal/tests/functional/test_mapserverproxy.py
|
pgiraud/c2cgeoportal
|
3ec955c5c67d16256af726a62d586b3f4ec3b500
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# The views and conclusions contained in the software and documentation are those
# of the authors and should not be interpreted as representing official policies,
# either expressed or implied, of the FreeBSD Project.
#
#
# ^
# |
# |
# |
# +--------------------------------------------------------------+ area1
# | +--------------------------------------------------------+ |
# | | p2 area3 |+45 p3 | |
# | +--------------------------------------------------------+ |
# | area1 | |
# +--------------------------------------------------------------+
# |
# +--------------------------------------------------------------+
# | area2 | |
# +---+--------------------------------------------------------------+-------->
# -100 -90 | +90 +100)
# |
# |
# |
# |
# |
# p1 |-45 p4
# |
# |
# +
#
#
# GetMap
# ======
#
# md5sum with 4 points: 61cbb0a6d18b72e4a28c1087019de245
# md5sum with the 2 top points: 0a4fac2209d06c6fa36048c125b1679a
# md5sum with no points: ef33223235b26c782736c88933b35331
#
#
import os
import hashlib
from unittest import TestCase
from nose.plugins.attrib import attr
from sqlalchemy import Column, types
from geoalchemy import GeometryColumn, MultiPoint, GeometryDDL, WKTSpatialElement
import transaction
import sqlahelper
from c2cgeoportal.views.mapserverproxy import MapservProxy
from c2cgeoportal.tests.functional import ( # NOQA
tearDownCommon as tearDownModule,
setUpCommon as setUpModule,
createDummyRequest, mapserv_url)
Base = sqlahelper.get_base()
class TestPoint(Base):
__tablename__ = 'testpoint'
__table_args__ = {'schema': 'main'}
id = Column(types.Integer, primary_key=True)
the_geom = GeometryColumn(MultiPoint(srid=21781))
name = Column(types.Unicode)
city = Column(types.Unicode)
country = Column(types.Unicode)
GeometryDDL(TestPoint.__table__)
GETFEATURE_REQUEST = u"""<?xml version='1.0' encoding="UTF-8" ?>
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Query typeName="feature:%(feature)s" srsName="EPSG:21781" xmlns:feature="http://mapserver.gis.umn.edu/mapserver">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIs%(function)s matchCase="false" %(arguments)s>
<ogc:PropertyName>%(property)s</ogc:PropertyName>
<ogc:Literal>%(value)s</ogc:Literal>
</ogc:PropertyIs%(function)s>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>"""
SUBSTITUTION_GETFEATURE_REQUEST = (GETFEATURE_REQUEST % {
'feature': u'testpoint_substitution',
'function': u'NotEqualTo',
'arguments': u'',
'property': u'name',
'value': 'toto',
}).encode('utf-8')
COLUMN_RESTRICTION_GETFEATURE_REQUEST = (GETFEATURE_REQUEST % {
'feature': u'testpoint_column_restriction',
'function': u'NotEqualTo',
'arguments': u'',
'property': u'name',
'value': 'bar',
}).encode('utf-8')
@attr(functional=True)
class TestMapserverproxyView(TestCase):
def setUp(self):
from c2cgeoportal.models import User, Role, Layer, RestrictionArea, \
Functionality, DBSession
TestPoint.__table__.create(bind=DBSession.bind, checkfirst=True)
geom = WKTSpatialElement("MULTIPOINT((-90 -45))", srid=21781)
p1 = TestPoint(the_geom=geom, name=u'foo', city=u'Lausanne', country=u'Swiss')
geom = WKTSpatialElement("MULTIPOINT((-90 45))", srid=21781)
p2 = TestPoint(the_geom=geom, name=u'bar', city=u'Chambéry', country=u'France')
geom = WKTSpatialElement("MULTIPOINT((90 45))", srid=21781)
p3 = TestPoint(the_geom=geom, name=u'éàè', city="Paris", country=u'France')
geom = WKTSpatialElement("MULTIPOINT((90 -45))", srid=21781)
p4 = TestPoint(the_geom=geom, name=u'123', city='Londre', country=u'UK')
pt1 = Functionality(name=u'print_template', value=u'1 Wohlen A4 portrait')
pt2 = Functionality(name=u'print_template', value=u'2 Wohlen A3 landscape')
user1 = User(username=u'__test_user1', password=u'__test_user1')
role1 = Role(name=u'__test_role1', description=u'__test_role1', functionalities=[pt1, pt2])
user1.role = role1
user1.email = u'Tarenpion'
user2 = User(username=u'__test_user2', password=u'__test_user2')
role2 = Role(name=u'__test_role2', description=u'__test_role2', functionalities=[pt1, pt2])
user2.role = role2
user2.email = u'Tarenpion'
user3 = User(username=u'__test_user3', password=u'__test_user3')
role3 = Role(name=u'__test_role3', description=u'__test_role3', functionalities=[pt1, pt2])
user3.role = role3
user3.email = u'Tarenpion'
layer2 = Layer(u'testpoint_protected', 400, public=False)
layer3 = Layer(u'testpoint_protected_query_with_collect', public=False)
area = "POLYGON((-100 30, -100 50, 100 50, 100 30, -100 30))"
area = WKTSpatialElement(area, srid=21781)
restricted_area1 = RestrictionArea(u'__test_ra1', u'', [layer2, layer3], [role1], area)
area = "POLYGON((-100 0, -100 20, 100 20, 100 0, -100 0))"
area = WKTSpatialElement(area, srid=21781)
restricted_area2 = RestrictionArea(u'__test_ra2', u'', [layer2, layer3], [role2, role3], area)
area = "POLYGON((-95 43, -95 47, 95 47, 95 43, -95 43))"
area = WKTSpatialElement(area, srid=21781)
restricted_area3 = RestrictionArea(u'__test_ra3', u'', [layer3], [role3], area, readwrite=True)
DBSession.add_all([
p1, p2, p3, p4, user1, user2, user3,
restricted_area1, restricted_area2, restricted_area3
])
DBSession.flush()
self.id_lausanne = p1.id
self.id_paris = p3.id
transaction.commit()
def tearDown(self):
from c2cgeoportal.models import User, Role, Layer, RestrictionArea, \
Functionality, DBSession
DBSession.query(User).filter(User.username == '__test_user1').delete()
DBSession.query(User).filter(User.username == '__test_user2').delete()
DBSession.query(User).filter(User.username == '__test_user3').delete()
ra = DBSession.query(RestrictionArea).filter(
RestrictionArea.name == '__test_ra1'
).one()
ra.roles = []
ra.layers = []
DBSession.delete(ra)
ra = DBSession.query(RestrictionArea).filter(
RestrictionArea.name == '__test_ra2'
).one()
ra.roles = []
ra.layers = []
DBSession.delete(ra)
ra = DBSession.query(RestrictionArea).filter(
RestrictionArea.name == '__test_ra3'
).one()
ra.roles = []
ra.layers = []
DBSession.delete(ra)
r = DBSession.query(Role).filter(Role.name == '__test_role1').one()
r.functionalities = []
DBSession.delete(r)
r = DBSession.query(Role).filter(Role.name == '__test_role2').one()
r.functionalities = []
DBSession.delete(r)
r = DBSession.query(Role).filter(Role.name == '__test_role3').one()
r.functionalities = []
DBSession.delete(r)
for f in DBSession.query(Functionality).filter(Functionality.value == u'1 Wohlen A4 portrait').all():
DBSession.delete(f)
for f in DBSession.query(Functionality).filter(Functionality.value == u'2 Wohlen A3 landscape').all():
DBSession.delete(f)
for layer in DBSession.query(Layer).filter(Layer.name == 'testpoint_unprotected').all():
DBSession.delete(layer) # pragma: nocover
for layer in DBSession.query(Layer).filter(Layer.name == 'testpoint_protected').all():
DBSession.delete(layer)
for layer in DBSession.query(Layer).filter(Layer.name == 'testpoint_protected_query_with_collect').all():
DBSession.delete(layer)
transaction.commit()
TestPoint.__table__.drop(bind=DBSession.bind, checkfirst=True)
def _create_dummy_request(self, username=None):
from c2cgeoportal.models import DBSession, User
request = createDummyRequest({
'mapserv_url': mapserv_url
})
request.params = {"map": os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'c2cgeoportal_test.map'
)}
if username:
request.user = DBSession.query(User) \
.filter_by(username=username).one()
return request
def test_GetLegendGraphic(self):
request = self._create_dummy_request()
request.params.update(dict(service='wms', version='1.1.1',
request='getlegendgraphic',
layer='testpoint_unprotected',
srs='EPSG:21781',
format='image/png',
extraparam=u'with spéciàl chârs'))
response = MapservProxy(request).proxy()
self.assertTrue(response.cache_control.public)
self.assertEqual(response.cache_control.max_age, 1000)
def test_GetFeatureInfo(self):
request = self._create_dummy_request()
request.params.update(dict(
service='wms', version='1.1.1',
request='getfeatureinfo', bbox='-90,-45,90,0',
layers='testpoint_unprotected',
query_layers='testpoint_unprotected',
srs='EPSG:21781', format='image/png',
info_format='application/vnd.ogc.gml',
width='600', height='400', x='0', y='400'
))
response = MapservProxy(request).proxy()
expected_response = """
<?xmlversion="1.0"encoding="UTF-8"?>
<msGMLOutput
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<testpoint_unprotected_layer>
<gml:name>countries</gml:name>
<testpoint_unprotected_feature>
<gml:boundedBy>
<gml:Box srsName="EPSG:21781">
<gml:coordinates>-90.000000,-45.000000 -90.000000,-45.000000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<the_geom>
<gml:Point srsName="EPSG:21781">
<gml:coordinates>-90.000000,-45.000000</gml:coordinates>
</gml:Point>
</the_geom>
<name>foo</name>
<city>Lausanne</city>
<country>Swiss</country>
</testpoint_unprotected_feature>
</testpoint_unprotected_layer>
</msGMLOutput>
"""
import re
pattern = re.compile(r'\s+')
expected_response = ''.join(
re.sub(pattern, '', l) for l in expected_response.splitlines()
)
response_body = ''.join(
re.sub(pattern, '', l) for l in response.body.splitlines()
)
self.assertEqual(response_body, expected_response)
self.assertEqual(str(response.cache_control), "no-cache")
def test_GetFeatureInfo_JSONP(self):
request = self._create_dummy_request()
request.params.update(dict(
service='wms', version='1.1.1',
request='getfeatureinfo', bbox='-90,-45,90,0',
layers='testpoint_unprotected',
query_layers='testpoint_unprotected',
srs='EPSG:21781', format='image/png',
info_format='application/vnd.ogc.gml',
width='600', height='400', x='0', y='400',
callback='cb'
))
response = MapservProxy(request).proxy()
expected_response = """
<?xmlversion="1.0"encoding="UTF-8"?>
<msGMLOutput
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<testpoint_unprotected_layer>
<gml:name>countries</gml:name>
<testpoint_unprotected_feature>
<gml:boundedBy>
<gml:Box srsName="EPSG:21781">
<gml:coordinates>-90.000000,-45.000000 -90.000000,-45.000000</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<the_geom>
<gml:Point srsName="EPSG:21781">
<gml:coordinates>-90.000000,-45.000000</gml:coordinates>
</gml:Point>
</the_geom>
<name>foo</name>
<city>Lausanne</city>
<country>Swiss</country>
</testpoint_unprotected_feature>
</testpoint_unprotected_layer>
</msGMLOutput>
"""
import re
pattern = re.compile(r'\s+')
expected_response = ''.join(
re.sub(pattern, '', l) for l in expected_response.splitlines()
)
expected_response = '%s(\'%s\');' % ('cb', expected_response)
response_body = ''.join(
re.sub(pattern, '', l) for l in response.body.splitlines()
)
self.assertEqual(response_body, expected_response)
self.assertFalse(response.cache_control.public)
self.assertEqual(str(response.cache_control), "no-cache")
def test_GetMap_unprotected_layer_anonymous(self):
request = self._create_dummy_request()
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_unprotected',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# 4 points
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, '61cbb0a6d18b72e4a28c1087019de245')
def test_GetMap_unprotected_layer_user1(self):
request = self._create_dummy_request(username=u'__test_user1')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_unprotected',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# 4 points
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, '61cbb0a6d18b72e4a28c1087019de245')
def test_GetMap_unprotected_layer_user2(self):
request = self._create_dummy_request(username=u'__test_user2')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_unprotected',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# 4 points
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, '61cbb0a6d18b72e4a28c1087019de245')
def test_GetMap_protected_layer_anonymous(self):
request = self._create_dummy_request()
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_protected',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# empty
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, 'ef33223235b26c782736c88933b35331')
def test_GetMap_protected_layer_user1(self):
request = self._create_dummy_request(username=u'__test_user1')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_protected',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# two points
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, '0a4fac2209d06c6fa36048c125b1679a')
def test_GetMap_protected_layer_user2(self):
request = self._create_dummy_request(username=u'__test_user2')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_protected',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertEqual(str(response.cache_control), "no-cache")
# empty
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, 'ef33223235b26c782736c88933b35331')
def test_GetMap_protected_layer_collect_query_user1(self):
request = self._create_dummy_request(username=u'__test_user1')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_protected_query_with_collect',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# two points
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, '0a4fac2209d06c6fa36048c125b1679a')
def test_GetMap_protected_layer_collect_query_user2(self):
request = self._create_dummy_request(username=u'__test_user2')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_protected_query_with_collect',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# empty
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, 'ef33223235b26c782736c88933b35331')
def test_GetMap_protected_layer_collect_query_user3(self):
request = self._create_dummy_request(username=u'__test_user3')
request.params.update(dict(
service='wms', version='1.1.1', request='getmap',
bbox='-180,-90,180,90', layers='testpoint_protected_query_with_collect',
width='600', height='400', srs='EPSG:21781', format='image/png'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertEqual(str(response.cache_control), "no-cache")
# two points
md5sum = hashlib.md5(response.body).hexdigest()
self.assertEquals(md5sum, '0a4fac2209d06c6fa36048c125b1679a')
def GetFeature_IsEqualTo(self, value):
request = self._create_dummy_request()
request.method = 'POST'
request.body = (GETFEATURE_REQUEST % {
'feature': u'testpoint_unprotected',
'function': u'EqualTo',
'arguments': u'',
'property': u'name',
'value': value,
}).encode('utf-8')
return MapservProxy(request).proxy()
def test_GetFeature_IsEqualTo(self):
response = self.GetFeature_IsEqualTo(u'foo')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
response = self.GetFeature_IsEqualTo(u'éàè')
self.assertTrue(response.status_int, 200) # 500)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
response = self.GetFeature_IsEqualTo(u'123')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') > 0)
def GetFeature_IsNotEqualTo(self, value):
request = self._create_dummy_request()
request.method = 'POST'
request.body = (GETFEATURE_REQUEST % {
'feature': u'testpoint_unprotected',
'function': u'NotEqualTo',
'arguments': u'',
'property': u'name',
'value': value,
}).encode('utf-8')
return MapservProxy(request).proxy()
def test_GetFeature_IsNotEqualTo(self):
response = self.GetFeature_IsNotEqualTo(u'foo')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') > 0)
response = self.GetFeature_IsNotEqualTo(u'éàè')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') > 0)
response = self.GetFeature_IsNotEqualTo(u'123')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
def GetFeature_IsLike(self, value):
request = self._create_dummy_request()
request.method = 'POST'
request.body = (GETFEATURE_REQUEST % {
'feature': u'testpoint_unprotected',
'function': u'Like',
'arguments': u'wildCard="*" singleChar="." escapeChar="!"',
'property': u'name',
'value': value,
}).encode('utf-8')
return MapservProxy(request).proxy()
def test_GetFeature_IsLike(self):
response = self.GetFeature_IsLike(u'*o*')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
response = self.GetFeature_IsLike(u'*à*')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
response = self.GetFeature_IsLike(u'*2*')
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') > 0)
def test_GetFeature_FeatureId_GET(self):
request = self._create_dummy_request()
featureid = '%(typename)s.%(fid1)s,%(typename)s.%(fid2)s' % {
'typename': 'testpoint_unprotected',
'fid1': self.id_lausanne,
'fid2': self.id_paris
}
request.params.update(dict(
service='wfs', version='1.0.0',
request='getfeature', typename='testpoint_unprotected',
featureid=featureid
))
response = MapservProxy(request).proxy()
self.assertTrue('Lausanne' in response.body)
self.assertTrue('Paris' in response.body)
self.assertFalse('Londre' in response.body)
self.assertFalse('Chambéry' in response.body)
self.assertEqual(response.content_type, 'text/xml')
def test_GetFeature_FeatureId_GET_JSONP(self):
request = self._create_dummy_request()
featureid = '%(typename)s.%(fid1)s,%(typename)s.%(fid2)s' % {
'typename': 'testpoint_unprotected',
'fid1': self.id_lausanne,
'fid2': self.id_paris
}
request.params.update(dict(
service='wfs', version='1.0.0',
request='getfeature', typename='testpoint_unprotected',
featureid=featureid, callback='cb'
))
response = MapservProxy(request).proxy()
self.assertTrue('Lausanne' in response.body)
self.assertTrue('Paris' in response.body)
self.assertFalse('Londre' in response.body)
self.assertFalse('Chambéry' in response.body)
self.assertEqual(response.content_type, 'application/javascript')
def test_GetFeature_wfs_url(self):
request = self._create_dummy_request()
request.registry.settings.update({
'mapserv_wfs_url': request.registry.settings['mapserv_url'],
})
featureid = '%(typename)s.%(fid1)s,%(typename)s.%(fid2)s' % {
'typename': 'testpoint_unprotected',
'fid1': self.id_lausanne,
'fid2': self.id_paris
}
request.params.update(dict(
service='wfs', version='1.0.0',
request='getfeature', typename='testpoint_unprotected',
featureid=featureid, callback='cb'
))
response = MapservProxy(request).proxy()
self.assertTrue(response.body != '')
self.assertEqual(str(response.cache_control), "no-cache")
def test_GetFeature_external_url(self):
request = self._create_dummy_request()
request.registry.settings.update({
'external_mapserv_url': request.registry.settings['mapserv_url'],
})
featureid = '%(typename)s.%(fid1)s,%(typename)s.%(fid2)s' % {
'typename': 'testpoint_unprotected',
'fid1': self.id_lausanne,
'fid2': self.id_paris
}
request.params.update(dict(
service='wfs', version='1.0.0',
request='getfeature', typename='testpoint_unprotected',
featureid=featureid, callback='cb', EXTERNAL=1
))
response = MapservProxy(request).proxy()
self.assertTrue(response.body != '')
self.assertEqual(str(response.cache_control), "no-cache")
def test_GetFeature_external_wfs_url(self):
request = self._create_dummy_request()
request.registry.settings.update({
'external_mapserv_wfs_url': request.registry.settings['mapserv_url'],
})
featureid = '%(typename)s.%(fid1)s,%(typename)s.%(fid2)s' % {
'typename': 'testpoint_unprotected',
'fid1': self.id_lausanne,
'fid2': self.id_paris
}
request.params.update(dict(
service='wfs', version='1.0.0',
request='getfeature', typename='testpoint_unprotected',
featureid=featureid, callback='cb', EXTERNAL=1
))
response = MapservProxy(request).proxy()
self.assertTrue(response.body != '')
self.assertEqual(str(response.cache_control), "no-cache")
def test_substitution(self):
request = self._create_dummy_request()
request.method = 'POST'
request.body = SUBSTITUTION_GETFEATURE_REQUEST
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
request.params.update(dict(s_name='bar'))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
request = self._create_dummy_request()
request.method = 'POST'
request.body = SUBSTITUTION_GETFEATURE_REQUEST
request.params.update(dict(S_NAME='bar'))
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
request = self._create_dummy_request()
request.method = 'POST'
request.body = SUBSTITUTION_GETFEATURE_REQUEST
request.registry.settings['functionalities']['anonymous'] = {
"mapserver_substitution": ["name=bar"]
}
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'foo') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'bar') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'éàè') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'123') < 0)
request.body = COLUMN_RESTRICTION_GETFEATURE_REQUEST
request.registry.settings['functionalities']['anonymous'] = {
"mapserver_substitution": ["cols=name", "cols=city", "cols=country"]
}
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Lausanne') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Swiss') > 0)
request.registry.settings['functionalities']['anonymous'] = {
"mapserver_substitution": ["cols=name", "cols=city"]
}
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Lausanne') > 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Swiss') < 0)
request.registry.settings['functionalities']['anonymous'] = {
"mapserver_substitution": ["cols=name", "cols=country"]
}
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Lausanne') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Swiss') > 0)
request.registry.settings['functionalities']['anonymous'] = {
"mapserver_substitution": ["cols=name"]
}
response = MapservProxy(request).proxy()
self.assertTrue(response.status_int, 200)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Lausanne') < 0)
self.assertTrue(unicode(response.body.decode('utf-8')).find(u'Swiss') < 0)
request = self._create_dummy_request()
request.method = 'POST'
request.body = SUBSTITUTION_GETFEATURE_REQUEST
request.registry.settings['functionalities']['anonymous'] = {
"mapserver_substitution": ["foo_bar"]
}
request.params.update(dict(
s_test1='to be removed', S_TEST2='to be removed'
))
# just pass in the log messagse
response = MapservProxy(request).proxy()
| 44.795995
| 232
| 0.605945
| 3,919
| 35,792
| 5.410564
| 0.110998
| 0.061404
| 0.059423
| 0.08206
| 0.791124
| 0.769855
| 0.750707
| 0.732598
| 0.717978
| 0.708168
| 0
| 0.047936
| 0.244049
| 35,792
| 798
| 233
| 44.85213
| 0.735743
| 0.088707
| 0
| 0.697452
| 0
| 0.006369
| 0.234083
| 0.074883
| 0
| 0
| 0
| 0
| 0.200637
| 1
| 0.042994
| false
| 0.004777
| 0.023885
| 0
| 0.08758
| 0.003185
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ca8caa4fdf311d06b8dcd575b50dfadbaea5b151
| 500
|
py
|
Python
|
บวกลบธรรมดา.py
|
wannaphongcom/code-python3
|
03322f9d7d12236438f3bb05b53325a6f47c6cc0
|
[
"MIT"
] | 6
|
2016-12-04T12:20:04.000Z
|
2019-05-29T15:31:14.000Z
|
บวกลบธรรมดา.py
|
wannaphongcom/code-python3
|
03322f9d7d12236438f3bb05b53325a6f47c6cc0
|
[
"MIT"
] | null | null | null |
บวกลบธรรมดา.py
|
wannaphongcom/code-python3
|
03322f9d7d12236438f3bb05b53325a6f47c6cc0
|
[
"MIT"
] | 2
|
2017-11-04T18:47:50.000Z
|
2019-05-18T07:39:00.000Z
|
__author__ = 'วรรณพงษ์'
#import re
print("Text")
a = input("Text")
if a.find("+"):
s = a.split("+")
in1 = int(s[0])
in2 = int(s[1])
cal = in1 + in2
elif a.find("-"):
s = a.split("-")
in1 = int(s[0])
in2 = int(s[1])
cal = in1 - in2
elif a.find("*"):
s = a.split("*")
in1 = int(s[0])
in2 = int(s[1])
cal = in1 * in2
elif a.find("//"):
s = a.split("//")
in1 = int(s[0])
in2 = int(s[1])
cal = in1 // in2
else:
cal = "error";
print(cal)
| 17.857143
| 23
| 0.452
| 83
| 500
| 2.686747
| 0.26506
| 0.143498
| 0.107623
| 0.125561
| 0.717489
| 0.717489
| 0.717489
| 0.717489
| 0.717489
| 0.717489
| 0
| 0.067797
| 0.292
| 500
| 27
| 24
| 18.518519
| 0.559322
| 0.018
| 0
| 0.307692
| 0
| 0
| 0.063265
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.076923
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
ca9bd8fa7426a81a5ca84835163a6ead50ff8fa1
| 75
|
py
|
Python
|
app/util/file.py
|
Titash/file-checker
|
20f736df3fc3cab03584229ae43e77bde76af07d
|
[
"Apache-2.0"
] | null | null | null |
app/util/file.py
|
Titash/file-checker
|
20f736df3fc3cab03584229ae43e77bde76af07d
|
[
"Apache-2.0"
] | null | null | null |
app/util/file.py
|
Titash/file-checker
|
20f736df3fc3cab03584229ae43e77bde76af07d
|
[
"Apache-2.0"
] | null | null | null |
def find_delta(list1, list2):
return list(set(list1).difference(list2))
| 37.5
| 45
| 0.746667
| 11
| 75
| 5
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.059701
| 0.106667
| 75
| 2
| 45
| 37.5
| 0.761194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
04a800ebfda76a12f2528d689a7f52f7286628cc
| 429
|
py
|
Python
|
tests/test_ci.py
|
DonQueso89/mongoengine
|
d73f0bb1af7fa63424137174da76f89dca762010
|
[
"MIT"
] | 3,314
|
2015-01-01T15:47:39.000Z
|
2022-03-31T11:39:12.000Z
|
tests/test_ci.py
|
DonQueso89/mongoengine
|
d73f0bb1af7fa63424137174da76f89dca762010
|
[
"MIT"
] | 1,703
|
2015-01-01T21:56:49.000Z
|
2022-03-31T23:08:18.000Z
|
tests/test_ci.py
|
DonQueso89/mongoengine
|
d73f0bb1af7fa63424137174da76f89dca762010
|
[
"MIT"
] | 995
|
2015-01-05T06:24:32.000Z
|
2022-03-28T16:34:58.000Z
|
def test_ci_placeholder():
# This empty test is used within the CI to
# setup the tox venv without running the test suite
# if we simply skip all test with pytest -k=wrong_pattern
# pytest command would return with exit_code=5 (i.e "no tests run")
# making travis fail
# this empty test is the recommended way to handle this
# as described in https://github.com/pytest-dev/pytest/issues/2393
pass
| 42.9
| 71
| 0.713287
| 71
| 429
| 4.253521
| 0.760563
| 0.059603
| 0.086093
| 0.099338
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015015
| 0.223776
| 429
| 9
| 72
| 47.666667
| 0.891892
| 0.815851
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 0
| 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
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
04c312cdbdb9d297836f1b69dcc5b12d159a7c21
| 22
|
py
|
Python
|
01.hello_softuni.py
|
krisskax348/python_basics
|
5af1ef6da1d88c912c1804a8cde11fbabe535691
|
[
"MIT"
] | 1
|
2022-01-26T07:38:11.000Z
|
2022-01-26T07:38:11.000Z
|
Software_University/python_basics/first_steps_in_coding/lecture/hello_softuni.py
|
Ivanazzz/SoftUni-W3resource-Python
|
892321a290e22a91ff2ac2fef5316179a93f2f17
|
[
"MIT"
] | null | null | null |
Software_University/python_basics/first_steps_in_coding/lecture/hello_softuni.py
|
Ivanazzz/SoftUni-W3resource-Python
|
892321a290e22a91ff2ac2fef5316179a93f2f17
|
[
"MIT"
] | 1
|
2021-12-04T12:30:57.000Z
|
2021-12-04T12:30:57.000Z
|
print("Hello SoftUni")
| 22
| 22
| 0.772727
| 3
| 22
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 22
| 1
| 22
| 22
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0.565217
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
04e3122f7f10af2f9a7c8cea91a47050e67f0ff9
| 110
|
py
|
Python
|
exoatlas/whatsup/night.py
|
zkbt/exopop
|
5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8
|
[
"MIT"
] | 4
|
2020-06-24T16:38:27.000Z
|
2022-01-23T01:57:19.000Z
|
exoatlas/whatsup/night.py
|
zkbt/exopop
|
5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8
|
[
"MIT"
] | 4
|
2018-09-20T23:12:30.000Z
|
2019-05-15T15:31:58.000Z
|
exoatlas/whatsup/night.py
|
zkbt/exopop
|
5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8
|
[
"MIT"
] | null | null | null |
from ..imports import *
class Night(Talker):
def __init__(self, midnight):
Talker.__init__(self)
| 18.333333
| 33
| 0.672727
| 13
| 110
| 5.076923
| 0.769231
| 0.242424
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.209091
| 110
| 5
| 34
| 22
| 0.758621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
04f16d83a060733cb666eabb1a46170fdd7d5648
| 114
|
py
|
Python
|
cloudlogs/admin.py
|
bhargava-kush/cloudlogs
|
d3b4ce61e38328b474497fa9600ed1fec94a7999
|
[
"MIT"
] | null | null | null |
cloudlogs/admin.py
|
bhargava-kush/cloudlogs
|
d3b4ce61e38328b474497fa9600ed1fec94a7999
|
[
"MIT"
] | null | null | null |
cloudlogs/admin.py
|
bhargava-kush/cloudlogs
|
d3b4ce61e38328b474497fa9600ed1fec94a7999
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Logs
# Register your models here.
admin.site.register(Logs)
| 19
| 32
| 0.798246
| 17
| 114
| 5.352941
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131579
| 114
| 5
| 33
| 22.8
| 0.919192
| 0.22807
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
04f9e952f3c442e31fb707d7cb59334424520b99
| 103
|
py
|
Python
|
ansible_events/event_filters/noop.py
|
benthomasson/ansible-events
|
bd90edb68778f9f5ad82591f46993335fada8ed4
|
[
"Apache-2.0"
] | null | null | null |
ansible_events/event_filters/noop.py
|
benthomasson/ansible-events
|
bd90edb68778f9f5ad82591f46993335fada8ed4
|
[
"Apache-2.0"
] | 17
|
2022-03-07T17:57:07.000Z
|
2022-03-23T18:58:48.000Z
|
tests/event_filters/noop.py
|
benthomasson/ansible-events
|
bd90edb68778f9f5ad82591f46993335fada8ed4
|
[
"Apache-2.0"
] | null | null | null |
"""
noop.py: An event filter that does nothing to the input.
"""
def main(event):
return event
| 12.875
| 58
| 0.650485
| 16
| 103
| 4.1875
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.23301
| 103
| 7
| 59
| 14.714286
| 0.848101
| 0.563107
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
b6bcb4415c1a0866c0178a98816e074d11f3f643
| 140
|
py
|
Python
|
python/8kyu/dna_to_rna_conversion.py
|
Sigmanificient/codewars
|
b34df4bf55460d312b7ddf121b46a707b549387a
|
[
"MIT"
] | 3
|
2021-06-08T01:57:13.000Z
|
2021-06-26T10:52:47.000Z
|
python/8kyu/dna_to_rna_conversion.py
|
Sigmanificient/codewars
|
b34df4bf55460d312b7ddf121b46a707b549387a
|
[
"MIT"
] | null | null | null |
python/8kyu/dna_to_rna_conversion.py
|
Sigmanificient/codewars
|
b34df4bf55460d312b7ddf121b46a707b549387a
|
[
"MIT"
] | 2
|
2021-06-10T21:20:13.000Z
|
2021-06-30T10:13:26.000Z
|
"""Kata url: https://www.codewars.com/kata/5556282156230d0e5e000089."""
def dna_to_rna(dna: str) -> str:
return dna.replace('T', 'U')
| 23.333333
| 71
| 0.671429
| 20
| 140
| 4.6
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170732
| 0.121429
| 140
| 5
| 72
| 28
| 0.577236
| 0.464286
| 0
| 0
| 0
| 0
| 0.028986
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
8e083bc2631bc5225b57d9562cf0afd719c473a5
| 1,116
|
py
|
Python
|
tests/test_label_performance.py
|
TeddTech/NLP_Firm_Prediction
|
7685cbe70095df7ed34035891f7fc20e5ac6df66
|
[
"MIT"
] | null | null | null |
tests/test_label_performance.py
|
TeddTech/NLP_Firm_Prediction
|
7685cbe70095df7ed34035891f7fc20e5ac6df66
|
[
"MIT"
] | 4
|
2020-01-28T22:54:09.000Z
|
2022-02-10T00:21:59.000Z
|
tests/test_label_performance.py
|
TeddTech/NLP_Firm_Prediction
|
7685cbe70095df7ed34035891f7fc20e5ac6df66
|
[
"MIT"
] | null | null | null |
import pytest
import pandas as pd
import numpy as np
from src.preprocessing.label_feature_eng import label_performance
class TestClass:
def test_up(self):
assert label_performance(1) == "up", "Error, 'up' labels are not working correctly"
def test_down(self):
assert label_performance(-1) == "down", "Error, 'down' labels are not working correctly"
def test_flat(self):
assert label_performance(-0.01) == "flat", "Error, 'flat' labels are not working correctly on the downside"
assert label_performance(0.01) == "flat", "Error, 'flat' labels are not working correctly on the upside"
def test_different_cutoff(self):
assert label_performance(1, 0.5) == "up", "Error, 'up' labels are not working correctly"
assert label_performance(-1, 0.5) == "down", "Error, 'down' labels are not working correctly"
assert label_performance(0.1, 0.5) == "flat", "Error, 'flat' labels are not working correctly on the downside"
assert label_performance(-0.1, 0.5) == "flat", "Error, 'flat' labels are not working correctly on the upside"
| 42.923077
| 118
| 0.685484
| 158
| 1,116
| 4.740506
| 0.246835
| 0.192256
| 0.23498
| 0.202937
| 0.790387
| 0.712951
| 0.675567
| 0.656876
| 0.419226
| 0.419226
| 0
| 0.024664
| 0.200717
| 1,116
| 25
| 119
| 44.64
| 0.815022
| 0
| 0
| 0
| 0
| 0
| 0.405381
| 0
| 0
| 0
| 0
| 0
| 0.470588
| 1
| 0.235294
| false
| 0
| 0.235294
| 0
| 0.529412
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
8e18ce0a98fc09d2b6ca3d12722bfef9da9980c3
| 28
|
py
|
Python
|
packages/jsii-rosetta/test/translations/classes/empty_class.py
|
NGL321/jsii
|
a31ebf5ef676391d97f2286edc21e5859c38c96c
|
[
"Apache-2.0"
] | 1,639
|
2019-07-05T07:21:00.000Z
|
2022-03-31T09:55:01.000Z
|
packages/jsii-rosetta/test/translations/classes/empty_class.py
|
NGL321/jsii
|
a31ebf5ef676391d97f2286edc21e5859c38c96c
|
[
"Apache-2.0"
] | 2,704
|
2019-07-01T23:10:28.000Z
|
2022-03-31T23:40:12.000Z
|
packages/jsii-rosetta/test/translations/classes/empty_class.py
|
NGL321/jsii
|
a31ebf5ef676391d97f2286edc21e5859c38c96c
|
[
"Apache-2.0"
] | 146
|
2019-07-02T14:36:25.000Z
|
2022-03-26T00:21:27.000Z
|
class empty_class:
pass
| 9.333333
| 18
| 0.714286
| 4
| 28
| 4.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 28
| 2
| 19
| 14
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
8e275158e94cbb1446ae1fdd0ff4d08df41e9a8a
| 203
|
py
|
Python
|
fetch_servers.py
|
daeken/QuestCompanions
|
a25260e09dace240b88672bde0e029dbb1322fc9
|
[
"MIT"
] | 4
|
2015-11-05T05:23:52.000Z
|
2019-11-21T23:02:48.000Z
|
fetch_servers.py
|
daeken/QuestCompanions
|
a25260e09dace240b88672bde0e029dbb1322fc9
|
[
"MIT"
] | null | null | null |
fetch_servers.py
|
daeken/QuestCompanions
|
a25260e09dace240b88672bde0e029dbb1322fc9
|
[
"MIT"
] | 1
|
2019-11-21T20:04:39.000Z
|
2019-11-21T20:04:39.000Z
|
import battlenet
from battlenet import Connection
connection = Connection()
print "wow_servers = [",
for realm in connection.get_all_realms(battlenet.UNITED_STATES):
print '%r,' % realm,
print "]",
| 22.555556
| 64
| 0.748768
| 25
| 203
| 5.92
| 0.64
| 0.27027
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 203
| 8
| 65
| 25.375
| 0.845714
| 0
| 0
| 0
| 0
| 0
| 0.093596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.285714
| null | null | 0.428571
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
8e3bfec0889a1c97e5e10e42ad3be86badf87e4c
| 32
|
py
|
Python
|
augmenty/lang/mk/__init__.py
|
koaning/augmenty
|
13dbdbb5fd56b36c97678ae48d1e0d869987f6dd
|
[
"MIT"
] | null | null | null |
augmenty/lang/mk/__init__.py
|
koaning/augmenty
|
13dbdbb5fd56b36c97678ae48d1e0d869987f6dd
|
[
"MIT"
] | 1
|
2022-03-12T02:25:00.000Z
|
2022-03-12T02:26:01.000Z
|
augmenty/lang/mk/__init__.py
|
HishamKhdair/augmenty
|
a65a7beac410f53706bb7838026f2bac9b89d544
|
[
"MIT"
] | null | null | null |
from .keyboard import create_mk
| 16
| 31
| 0.84375
| 5
| 32
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 32
| 1
| 32
| 32
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
eda453a4672f10fa82a8ad2450727e5c3da044c9
| 134
|
py
|
Python
|
python_training/list.py
|
Shogo-Sakai/everybodys_ai
|
8ea227d3b998e558f7dabbebd121eaff06a09085
|
[
"MIT"
] | null | null | null |
python_training/list.py
|
Shogo-Sakai/everybodys_ai
|
8ea227d3b998e558f7dabbebd121eaff06a09085
|
[
"MIT"
] | null | null | null |
python_training/list.py
|
Shogo-Sakai/everybodys_ai
|
8ea227d3b998e558f7dabbebd121eaff06a09085
|
[
"MIT"
] | null | null | null |
a = [2012, 2013, 2014]
print (a)
print (a[0])
print (a[1])
print (a[2])
b = 2012
c = [b, 2015, 20.1, "Hello", "Hi"]
print (c[1:4])
| 11.166667
| 34
| 0.514925
| 28
| 134
| 2.464286
| 0.535714
| 0.347826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.264151
| 0.208955
| 134
| 11
| 35
| 12.181818
| 0.386792
| 0
| 0
| 0
| 0
| 0
| 0.052239
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.625
| 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
| 1
|
0
| 5
|
eda66cd55b1fec544e3475e5160f521490835321
| 954
|
py
|
Python
|
src/oidcmsg/storage/__init__.py
|
Roomored/JWTConnect-Python-OidcMsg
|
3b7d667c0c36cd85e34db56cb745ef77eaeda140
|
[
"Apache-2.0"
] | null | null | null |
src/oidcmsg/storage/__init__.py
|
Roomored/JWTConnect-Python-OidcMsg
|
3b7d667c0c36cd85e34db56cb745ef77eaeda140
|
[
"Apache-2.0"
] | null | null | null |
src/oidcmsg/storage/__init__.py
|
Roomored/JWTConnect-Python-OidcMsg
|
3b7d667c0c36cd85e34db56cb745ef77eaeda140
|
[
"Apache-2.0"
] | 1
|
2020-11-08T21:22:55.000Z
|
2020-11-08T21:22:55.000Z
|
import logging
from .utils import importer
logger = logging.getLogger(__name__)
class Storage(object):
"""
Offers a standard set of methods and I/O on persistent data.
"""
def __init__(self, conf_dict=None):
pass
def get(self, k, default=None):
raise NotImplemented()
def update(self, ava):
raise NotImplemented()
def delete(self, k, v):
raise NotImplemented()
def __getitem__(self, k):
raise NotImplemented()
def __setitem__(self, k, v):
raise NotImplemented()
def __delitem__(self, v):
raise NotImplemented()
def __call__(self):
raise NotImplemented()
def __len__(self):
raise NotImplemented()
def __contains__(self, k):
raise NotImplemented()
def __iter__(self):
raise NotImplemented()
def synch(self):
raise NotImplemented()
def keys(self):
raise NotImplemented()
| 18.346154
| 64
| 0.618449
| 103
| 954
| 5.368932
| 0.466019
| 0.412297
| 0.437613
| 0.188065
| 0.198915
| 0.101266
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285115
| 954
| 51
| 65
| 18.705882
| 0.81085
| 0.062893
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.433333
| false
| 0.033333
| 0.066667
| 0
| 0.533333
| 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
| 1
| 0
|
0
| 5
|
edb94e09c2b32bcb39d6015a79d97fb4dab4a18a
| 229
|
py
|
Python
|
header.py
|
brown9804/Grafos
|
7ccc2b137c7d18624cbbd297454612ff23baaaf0
|
[
"Apache-2.0"
] | null | null | null |
header.py
|
brown9804/Grafos
|
7ccc2b137c7d18624cbbd297454612ff23baaaf0
|
[
"Apache-2.0"
] | null | null | null |
header.py
|
brown9804/Grafos
|
7ccc2b137c7d18624cbbd297454612ff23baaaf0
|
[
"Apache-2.0"
] | null | null | null |
import sys
import heapq
from collections import deque
from graph import *
from busqueda_anchura import *
from busqueda_profunda import *
from prim import *
from kruskal import *
from puntos_articu import *
from djikstra import *
| 20.818182
| 31
| 0.812227
| 32
| 229
| 5.71875
| 0.46875
| 0.327869
| 0.196721
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157205
| 229
| 10
| 32
| 22.9
| 0.948187
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
eddb85258f3a6f4c73b0310ee85b85f0d643db35
| 62
|
py
|
Python
|
app/rabbitmq/__init__.py
|
TartuNLP/speech-to-text-api
|
7ec5222bea3710311ff91e81af374e985d39ab5d
|
[
"MIT"
] | null | null | null |
app/rabbitmq/__init__.py
|
TartuNLP/speech-to-text-api
|
7ec5222bea3710311ff91e81af374e985d39ab5d
|
[
"MIT"
] | null | null | null |
app/rabbitmq/__init__.py
|
TartuNLP/speech-to-text-api
|
7ec5222bea3710311ff91e81af374e985d39ab5d
|
[
"MIT"
] | null | null | null |
from .session import mq_session
from .producer import publish
| 20.666667
| 31
| 0.83871
| 9
| 62
| 5.666667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 62
| 2
| 32
| 31
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
edef7e344e51dcc8cb26bdec588516b6b78eae4d
| 1,297
|
py
|
Python
|
web/producers/migrations/0021_auto_20210219_1416.py
|
MTES-MCT/biocarburants
|
ff084916e18cdbdc41400f36fa6cc76a5e05900e
|
[
"MIT"
] | 4
|
2020-03-22T18:13:12.000Z
|
2021-01-25T10:33:31.000Z
|
web/producers/migrations/0021_auto_20210219_1416.py
|
MTES-MCT/carbure
|
2876756b760ab4866fa783bb40e61a046eebb1ab
|
[
"MIT"
] | 20
|
2020-07-06T14:33:14.000Z
|
2022-03-15T16:54:17.000Z
|
web/producers/migrations/0021_auto_20210219_1416.py
|
MTES-MCT/biocarburants
|
ff084916e18cdbdc41400f36fa6cc76a5e05900e
|
[
"MIT"
] | 4
|
2020-04-03T12:19:12.000Z
|
2021-06-15T12:20:57.000Z
|
# Generated by Django 3.0.7 on 2021-02-19 13:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('producers', '0020_auto_20201118_1222'),
]
operations = [
migrations.AlterField(
model_name='productionsite',
name='city',
field=models.CharField(blank=True, max_length=64),
),
migrations.AlterField(
model_name='productionsite',
name='manager_email',
field=models.CharField(blank=True, max_length=64),
),
migrations.AlterField(
model_name='productionsite',
name='manager_name',
field=models.CharField(blank=True, max_length=64),
),
migrations.AlterField(
model_name='productionsite',
name='manager_phone',
field=models.CharField(blank=True, max_length=64),
),
migrations.AlterField(
model_name='productionsite',
name='postal_code',
field=models.CharField(blank=True, max_length=64),
),
migrations.AlterField(
model_name='productionsite',
name='site_id',
field=models.CharField(blank=True, max_length=64),
),
]
| 29.477273
| 62
| 0.577487
| 124
| 1,297
| 5.879032
| 0.362903
| 0.164609
| 0.205761
| 0.238683
| 0.744856
| 0.744856
| 0.680384
| 0.680384
| 0.625514
| 0.625514
| 0
| 0.048045
| 0.309946
| 1,297
| 43
| 63
| 30.162791
| 0.76648
| 0.034695
| 0
| 0.648649
| 1
| 0
| 0.1408
| 0.0184
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.027027
| 0
| 0.108108
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
edf181079a06a3e139610e9c171551c66734501f
| 515
|
py
|
Python
|
terrascript/data/alertmixer/amixr.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 507
|
2017-07-26T02:58:38.000Z
|
2022-01-21T12:35:13.000Z
|
terrascript/data/alertmixer/amixr.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 135
|
2017-07-20T12:01:59.000Z
|
2021-10-04T22:25:40.000Z
|
terrascript/data/alertmixer/amixr.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 81
|
2018-02-20T17:55:28.000Z
|
2022-01-31T07:08:40.000Z
|
# terrascript/data/alertmixer/amixr.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:11:40 UTC)
import terrascript
class amixr_action(terrascript.Data):
pass
class amixr_schedule(terrascript.Data):
pass
class amixr_slack_channel(terrascript.Data):
pass
class amixr_user(terrascript.Data):
pass
class amixr_user_group(terrascript.Data):
pass
__all__ = [
"amixr_action",
"amixr_schedule",
"amixr_slack_channel",
"amixr_user",
"amixr_user_group",
]
| 15.606061
| 73
| 0.728155
| 65
| 515
| 5.492308
| 0.415385
| 0.252101
| 0.266106
| 0.268908
| 0.347339
| 0.184874
| 0
| 0
| 0
| 0
| 0
| 0.028103
| 0.170874
| 515
| 32
| 74
| 16.09375
| 0.807963
| 0.209709
| 0
| 0.277778
| 1
| 0
| 0.175743
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.277778
| 0.055556
| 0
| 0.333333
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
b63adfbba63b2b025213a986071a2ba4993ea3a5
| 203
|
py
|
Python
|
tests/raycing/test_oes.py
|
adinatan/xrt
|
75b884c0cba7e1aac15b30f2d0d803597328a208
|
[
"MIT"
] | 71
|
2016-07-04T06:40:52.000Z
|
2022-03-31T10:03:07.000Z
|
tests/raycing/test_oes.py
|
adinatan/xrt
|
75b884c0cba7e1aac15b30f2d0d803597328a208
|
[
"MIT"
] | 99
|
2016-07-10T16:39:05.000Z
|
2022-03-28T07:50:10.000Z
|
tests/raycing/test_oes.py
|
adinatan/xrt
|
75b884c0cba7e1aac15b30f2d0d803597328a208
|
[
"MIT"
] | 30
|
2016-07-08T17:12:30.000Z
|
2022-03-30T06:54:21.000Z
|
# -*- coding: utf-8 -*-
"""
Tests for Optical elements
--------------------------
.. automodule:: tests.raycing.test_asymmetric_xtal
.. automodule:: tests.raycing.test_backcattering_xtal_Shvydko
"""
| 18.454545
| 61
| 0.630542
| 21
| 203
| 5.904762
| 0.714286
| 0.241935
| 0.354839
| 0.419355
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005495
| 0.103448
| 203
| 10
| 62
| 20.3
| 0.67033
| 0.103448
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 0
| null | null | 0
| 0
| null | null | null | 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b647a376ecc474720641f9ee82c0e930a07e58dc
| 1,658
|
py
|
Python
|
tensorsketch/modules/__init__.py
|
RuiShu/tensorsketch
|
849dceed6a43396b9b8259255f2c66d72db30d99
|
[
"MIT"
] | 68
|
2019-10-05T10:28:10.000Z
|
2020-08-11T01:46:35.000Z
|
tensorsketch/modules/__init__.py
|
RuiShu/tensorsketch
|
849dceed6a43396b9b8259255f2c66d72db30d99
|
[
"MIT"
] | null | null | null |
tensorsketch/modules/__init__.py
|
RuiShu/tensorsketch
|
849dceed6a43396b9b8259255f2c66d72db30d99
|
[
"MIT"
] | 3
|
2019-10-25T11:00:40.000Z
|
2020-03-27T16:35:30.000Z
|
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Modifications copyright (C) 2019 Rui Shu
# python3
"""Modules API.
"""
# pylint: disable=g-bad-import-order
from tensorsketch.modules.base import Module
from tensorsketch.modules.base import ModuleList
from tensorsketch.modules.base import Sequential
from tensorsketch.modules.shape import Flatten
from tensorsketch.modules.shape import Reshape
from tensorsketch.modules.affine import Affine
from tensorsketch.modules.affine import Dense
from tensorsketch.modules.affine import Conv2d
from tensorsketch.modules.affine import ConvTranspose2d
from tensorsketch.modules.norm import InstanceNorm
from tensorsketch.modules.norm import SpectralNorm
from tensorsketch.modules.norm import BatchNorm
from tensorsketch.modules.norm import WeightNorm
from tensorsketch.modules.activation import ReLU
from tensorsketch.modules.activation import Identity
from tensorsketch.modules.activation import LeakyReLU
from tensorsketch.modules.activation import Sigmoid
from tensorsketch.modules.pool import MaxPool
from tensorsketch.modules.pool import AvgPool
| 35.276596
| 74
| 0.819662
| 224
| 1,658
| 6.066964
| 0.473214
| 0.223694
| 0.32156
| 0.085357
| 0.486387
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010989
| 0.121834
| 1,658
| 46
| 75
| 36.043478
| 0.92239
| 0.40772
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
b6642bee035f168f690f3a460b407e3688ad71c3
| 65
|
py
|
Python
|
enthought/kiva/fonttools/fontTools/ttLib/sfnt.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/kiva/fonttools/fontTools/ttLib/sfnt.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/kiva/fonttools/fontTools/ttLib/sfnt.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from kiva.fonttools.fontTools.ttLib.sfnt import *
| 21.666667
| 49
| 0.8
| 9
| 65
| 5.777778
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107692
| 65
| 2
| 50
| 32.5
| 0.896552
| 0.184615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b66bc77a84eccf62afd49be4a2f32844851a2493
| 1,137
|
py
|
Python
|
tests/unit/test_card.py
|
LeGmask/witchesGame
|
9d0dfd28dc7c30014c0fcd58d11bc25288b3ef10
|
[
"MIT"
] | null | null | null |
tests/unit/test_card.py
|
LeGmask/witchesGame
|
9d0dfd28dc7c30014c0fcd58d11bc25288b3ef10
|
[
"MIT"
] | null | null | null |
tests/unit/test_card.py
|
LeGmask/witchesGame
|
9d0dfd28dc7c30014c0fcd58d11bc25288b3ef10
|
[
"MIT"
] | null | null | null |
from src.card import *
class TestCard:
card = Card(
[7, 8, 3, 4]
) # we use an attributes to avoid recreate a card instance for each test
def test_create_card(self):
assert self.card.sides == [7, 8, 3, 4]
def test_card_tostring(self):
assert self.card.toString() == "7, 8, 3, 4"
def test_card_rotation(self):
self.card.rotation()
assert self.card.sides == [4, 7, 8, 3]
assert self.card.rotation_count == 1
self.card.rotation()
assert self.card.sides == [3, 4, 7, 8]
assert self.card.rotation_count == 2
self.card.rotation()
assert self.card.sides == [8, 3, 4, 7]
assert self.card.rotation_count == 3
self.card.rotation()
assert self.card.sides == [7, 8, 3, 4]
assert self.card.rotation_count == 4
def test_card_getLeft(self):
assert self.card.getLeft() == 7
def test_card_getUp(self):
assert self.card.getUp() == 8
def test_card_getRight(self):
assert self.card.getRight() == 3
def test_card_getDown(self):
assert self.card.getDown() == 4
| 28.425
| 77
| 0.592788
| 164
| 1,137
| 4
| 0.219512
| 0.219512
| 0.29878
| 0.164634
| 0.458841
| 0.294207
| 0.294207
| 0.070122
| 0
| 0
| 0
| 0.043956
| 0.279683
| 1,137
| 39
| 78
| 29.153846
| 0.757021
| 0.059807
| 0
| 0.2
| 0
| 0
| 0.009372
| 0
| 0
| 0
| 0
| 0
| 0.466667
| 1
| 0.233333
| false
| 0
| 0.033333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b6a390f99783731f93a561ef71cb0b7ef5d3cd6a
| 1,115
|
py
|
Python
|
client/test/test_dataset.py
|
martinjrobins/battery-api
|
c416bdf487f3d41901c7155245ffce7330bdc496
|
[
"BSD-3-Clause"
] | 2
|
2021-11-11T11:03:22.000Z
|
2022-01-25T19:29:52.000Z
|
client/test/test_dataset.py
|
martinjrobins/battery-api
|
c416bdf487f3d41901c7155245ffce7330bdc496
|
[
"BSD-3-Clause"
] | null | null | null |
client/test/test_dataset.py
|
martinjrobins/battery-api
|
c416bdf487f3d41901c7155245ffce7330bdc496
|
[
"BSD-3-Clause"
] | null | null | null |
"""
Battery Data API
A standard API for accessing battery experiment datasets and metadata # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: martin.robinson@cs.ox.ac.uk
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import openapi_client
from openapi_client.model.cell import Cell
from openapi_client.model.column import Column
from openapi_client.model.equipment import Equipment
from openapi_client.model.range import Range
from openapi_client.model.user import User
globals()['Cell'] = Cell
globals()['Column'] = Column
globals()['Equipment'] = Equipment
globals()['Range'] = Range
globals()['User'] = User
from openapi_client.model.dataset import Dataset
class TestDataset(unittest.TestCase):
"""Dataset unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testDataset(self):
"""Test Dataset"""
# FIXME: construct object with mandatory attributes with example values
# model = Dataset() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()
| 23.723404
| 87
| 0.706726
| 141
| 1,115
| 5.48227
| 0.475177
| 0.117723
| 0.131953
| 0.170763
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010011
| 0.193722
| 1,115
| 46
| 88
| 24.23913
| 0.849833
| 0.328251
| 0
| 0.130435
| 0
| 0
| 0.050776
| 0
| 0
| 0
| 0
| 0.021739
| 0
| 1
| 0.130435
| false
| 0.130435
| 0.391304
| 0
| 0.565217
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
b6a79a01cd62af26f6583b131d38974356d90d99
| 205
|
py
|
Python
|
antisplodge/__init__.py
|
HealthML/AntiSplodge
|
20de0eff44022043d3601c14698b0fc4f6f95b5f
|
[
"MIT"
] | 1
|
2021-05-25T14:18:05.000Z
|
2021-05-25T14:18:05.000Z
|
antisplodge/__init__.py
|
HealthML/AntiSplodge
|
20de0eff44022043d3601c14698b0fc4f6f95b5f
|
[
"MIT"
] | null | null | null |
antisplodge/__init__.py
|
HealthML/AntiSplodge
|
20de0eff44022043d3601c14698b0fc4f6f95b5f
|
[
"MIT"
] | null | null | null |
# expose version from _version file
from ._version import __version__
# only expose needed function in the init module
from .antisplodge import DeconvolutionExperiment, SingleCellDataset, train, predict
| 34.166667
| 83
| 0.829268
| 24
| 205
| 6.833333
| 0.708333
| 0.134146
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136585
| 205
| 5
| 84
| 41
| 0.926554
| 0.390244
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
b6a7d5acf7412dc0efcc7f06e95b84b564800808
| 117
|
py
|
Python
|
src/ToolChainSCDG/procedures/linux/custom_package/gen_simproc5v.py
|
AnonymousSEMA/SEMA-ToolChain
|
05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82
|
[
"BSD-2-Clause"
] | null | null | null |
src/ToolChainSCDG/procedures/linux/custom_package/gen_simproc5v.py
|
AnonymousSEMA/SEMA-ToolChain
|
05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82
|
[
"BSD-2-Clause"
] | null | null | null |
src/ToolChainSCDG/procedures/linux/custom_package/gen_simproc5v.py
|
AnonymousSEMA/SEMA-ToolChain
|
05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82
|
[
"BSD-2-Clause"
] | null | null | null |
import angr
class gen_simproc5v(angr.SimProcedure):
def run(self, arg1, ar2, arg3, arg4, arg5):
return
| 16.714286
| 47
| 0.675214
| 16
| 117
| 4.875
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065934
| 0.222222
| 117
| 6
| 48
| 19.5
| 0.791209
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
fce7368162ac445c7779bbe7471c6fbe93ea6b44
| 199
|
py
|
Python
|
lib/geom/__init__.py
|
defgsus/thegame
|
38a627d9108f1418b94b08831fd640dd87fbba83
|
[
"MIT"
] | 1
|
2021-11-05T11:49:26.000Z
|
2021-11-05T11:49:26.000Z
|
lib/geom/__init__.py
|
defgsus/thegame
|
38a627d9108f1418b94b08831fd640dd87fbba83
|
[
"MIT"
] | null | null | null |
lib/geom/__init__.py
|
defgsus/thegame
|
38a627d9108f1418b94b08831fd640dd87fbba83
|
[
"MIT"
] | null | null | null |
from .LineMesh import LineMesh
from .MeshFactory import MeshFactory
from .Polygons import Polygons
from .Transformation import Transformation
from .TriangleMesh import TriangleMesh, TriangleHashMesh
| 33.166667
| 56
| 0.864322
| 21
| 199
| 8.190476
| 0.380952
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105528
| 199
| 5
| 57
| 39.8
| 0.966292
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1e41bcf4978684199f561243e2d3659a70b46172
| 171
|
py
|
Python
|
tests/web_platform/css_flexbox_1/test_flexbox_flex_1_1_auto_shrink.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 71
|
2015-04-13T09:44:14.000Z
|
2019-03-24T01:03:02.000Z
|
tests/web_platform/css_flexbox_1/test_flexbox_flex_1_1_auto_shrink.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 35
|
2019-05-06T15:26:09.000Z
|
2022-03-28T06:30:33.000Z
|
tests/web_platform/css_flexbox_1/test_flexbox_flex_1_1_auto_shrink.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 139
|
2015-05-30T18:37:43.000Z
|
2019-03-27T17:14:05.000Z
|
from tests.utils import W3CTestCase
class TestFlexbox_Flex11AutoShrink(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'flexbox_flex-1-1-auto-shrink'))
| 28.5
| 83
| 0.807018
| 21
| 171
| 6.238095
| 0.809524
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044586
| 0.081871
| 171
| 5
| 84
| 34.2
| 0.789809
| 0
| 0
| 0
| 0
| 0
| 0.163743
| 0.163743
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1e538f32bc057a18864ce8fc25ff29701028a136
| 4,000
|
py
|
Python
|
tests/utils/test_FieldValidator.py
|
ankitshah009/dcase_util
|
738571ce78faf60b0fdfa1d59fd42f42c8944f3d
|
[
"MIT"
] | 122
|
2017-11-10T16:51:04.000Z
|
2022-03-28T07:04:34.000Z
|
tests/utils/test_FieldValidator.py
|
gpinyero/dcase_util
|
298b2db13a2ffce7791f4de9d374616793564816
|
[
"MIT"
] | 18
|
2018-03-29T01:14:35.000Z
|
2022-03-30T11:21:17.000Z
|
tests/utils/test_FieldValidator.py
|
gpinyero/dcase_util
|
298b2db13a2ffce7791f4de9d374616793564816
|
[
"MIT"
] | 39
|
2017-11-16T14:34:26.000Z
|
2022-03-27T06:27:52.000Z
|
""" Unit tests for FieldValidator """
import nose.tools
import dcase_util
def test_process():
validator = dcase_util.utils.FieldValidator
nose.tools.eq_(validator.process(field='text'), validator.STRING)
nose.tools.eq_(validator.process(field='text123'), validator.STRING)
nose.tools.eq_(validator.process(field='122text12'), validator.STRING)
nose.tools.eq_(validator.process(field='t'), validator.ALPHA1)
nose.tools.eq_(validator.process(field='T'), validator.ALPHA1)
nose.tools.eq_(validator.process(field='Te'), validator.ALPHA2)
nose.tools.eq_(validator.process(field='tE'), validator.ALPHA2)
nose.tools.eq_(validator.process(field='audio.wav'), validator.AUDIOFILE)
nose.tools.eq_(validator.process(field='path/audio.wav'), validator.AUDIOFILE)
nose.tools.eq_(validator.process(field='path/path/audio.wav'), validator.AUDIOFILE)
nose.tools.eq_(validator.process(field='path/path/audio.flac'), validator.AUDIOFILE)
nose.tools.eq_(validator.process(field='path/path/audio.mp3'), validator.AUDIOFILE)
nose.tools.eq_(validator.process(field='0'), validator.NUMBER)
nose.tools.eq_(validator.process(field='1'), validator.NUMBER)
nose.tools.eq_(validator.process(field='12'), validator.NUMBER)
nose.tools.eq_(validator.process(field='123'), validator.NUMBER)
nose.tools.eq_(validator.process(field='12.2'), validator.NUMBER)
nose.tools.eq_(validator.process(field='0.01'), validator.NUMBER)
nose.tools.eq_(validator.process(field='-1.2'), validator.NUMBER)
nose.tools.eq_(validator.process(field='item1;item2'), validator.LIST)
nose.tools.eq_(validator.process(field='item1:item2'), validator.LIST)
nose.tools.eq_(validator.process(field='item1#item2'), validator.LIST)
nose.tools.eq_(validator.process(field=''), validator.EMPTY)
def test_is_number():
validator = dcase_util.utils.FieldValidator
# is_number
nose.tools.eq_(validator.is_number('0.1'), True)
nose.tools.eq_(validator.is_number('-2.1'), True)
nose.tools.eq_(validator.is_number('123'), True)
nose.tools.eq_(validator.is_number('-123'), True)
nose.tools.eq_(validator.is_number('0'), True)
nose.tools.eq_(validator.is_number('A'), False)
nose.tools.eq_(validator.is_number('A123'), False)
nose.tools.eq_(validator.is_number('A 123'), False)
nose.tools.eq_(validator.is_number('AabbCc'), False)
nose.tools.eq_(validator.is_number('A.2'), False)
def test_is_audiofile():
validator = dcase_util.utils.FieldValidator
# is_audiofile
nose.tools.eq_(validator.is_audiofile('audio.wav'), True)
nose.tools.eq_(validator.is_audiofile('audio.mp3'), True)
nose.tools.eq_(validator.is_audiofile('audio.flac'), True)
nose.tools.eq_(validator.is_audiofile('audio.raw'), True)
nose.tools.eq_(validator.is_audiofile('path/path/audio.flac'), True)
nose.tools.eq_(validator.is_audiofile('audio'), False)
nose.tools.eq_(validator.is_audiofile('123'), False)
nose.tools.eq_(validator.is_audiofile('54534.232'), False)
def test_is_list():
validator = dcase_util.utils.FieldValidator
# is_list
nose.tools.eq_(validator.is_list('test#'), True)
nose.tools.eq_(validator.is_list('test#test'), True)
nose.tools.eq_(validator.is_list('test:test'), True)
nose.tools.eq_(validator.is_list('test'), False)
nose.tools.eq_(validator.is_list('test-test'), False)
nose.tools.eq_(validator.is_list('12342.0'), False)
def test_is_alpha():
validator = dcase_util.utils.FieldValidator
# is_alpha
nose.tools.eq_(validator.is_alpha('a', length=1), True)
nose.tools.eq_(validator.is_alpha('aa', length=2), True)
nose.tools.eq_(validator.is_alpha('aaa', length=3), True)
nose.tools.eq_(validator.is_alpha('aaa', length=1), False)
nose.tools.eq_(validator.is_alpha('aa', length=1), False)
nose.tools.eq_(validator.is_alpha('aaa', length=2), False)
nose.tools.eq_(validator.is_alpha('1', length=1), False)
| 42.105263
| 88
| 0.722
| 564
| 4,000
| 4.93617
| 0.099291
| 0.177802
| 0.213362
| 0.387931
| 0.905891
| 0.885776
| 0.808549
| 0.685345
| 0.506106
| 0.358836
| 0
| 0.021873
| 0.1085
| 4,000
| 94
| 89
| 42.553191
| 0.758833
| 0.01775
| 0
| 0.106061
| 0
| 0
| 0.082929
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.075758
| false
| 0
| 0.030303
| 0
| 0.106061
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1e6093762e902030f9a708d6f3b61babbbacc663
| 54
|
py
|
Python
|
datasets/base/__init__.py
|
MeltingCake/acai
|
9627e55ff63aa3086deea4205258f5a4335ecae0
|
[
"Apache-2.0"
] | null | null | null |
datasets/base/__init__.py
|
MeltingCake/acai
|
9627e55ff63aa3086deea4205258f5a4335ecae0
|
[
"Apache-2.0"
] | null | null | null |
datasets/base/__init__.py
|
MeltingCake/acai
|
9627e55ff63aa3086deea4205258f5a4335ecae0
|
[
"Apache-2.0"
] | null | null | null |
from .dataset_base import *
from .datasets import *
| 18
| 28
| 0.740741
| 7
| 54
| 5.571429
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.185185
| 54
| 2
| 29
| 27
| 0.886364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1e7ff9f94f4ef95d339316b4e968f655cebbde01
| 153
|
py
|
Python
|
src/modules/iam/domain/repositories.py
|
pgorecki/python-ddd
|
0073ccce35c651be263f5d7d3d63f9a49bc0b78a
|
[
"MIT"
] | 10
|
2022-03-16T19:26:51.000Z
|
2022-03-31T23:50:51.000Z
|
src/modules/iam/domain/repositories.py
|
pgorecki/python-ddd
|
0073ccce35c651be263f5d7d3d63f9a49bc0b78a
|
[
"MIT"
] | null | null | null |
src/modules/iam/domain/repositories.py
|
pgorecki/python-ddd
|
0073ccce35c651be263f5d7d3d63f9a49bc0b78a
|
[
"MIT"
] | 2
|
2022-03-16T19:26:54.000Z
|
2022-03-27T13:21:02.000Z
|
from seedwork.domain.repositories import GenericRepository
class UserRepository(GenericRepository):
"""An interface to user repository"""
...
| 19.125
| 58
| 0.75817
| 14
| 153
| 8.285714
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150327
| 153
| 7
| 59
| 21.857143
| 0.892308
| 0.202614
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1eab00c4472de267d80504e4468843ef8457f02b
| 12,849
|
py
|
Python
|
lego/apps/comments/tests/test_views.py
|
andrinelo/lego
|
9b53c8fe538d9107b980a70e2a21fb487cc3b290
|
[
"MIT"
] | null | null | null |
lego/apps/comments/tests/test_views.py
|
andrinelo/lego
|
9b53c8fe538d9107b980a70e2a21fb487cc3b290
|
[
"MIT"
] | null | null | null |
lego/apps/comments/tests/test_views.py
|
andrinelo/lego
|
9b53c8fe538d9107b980a70e2a21fb487cc3b290
|
[
"MIT"
] | null | null | null |
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from rest_framework import status
from lego.apps.articles.models import Article
from lego.apps.comments.models import Comment
from lego.apps.users.models import AbakusGroup, User
from lego.utils.test_utils import BaseAPITestCase
def _get_list_url():
return reverse('api:v1:comment-list')
def _get_detail_url(pk):
return reverse('api:v1:comment-detail', kwargs={'pk': pk})
class CreateCommentsAPITestCase(BaseAPITestCase):
fixtures = ['test_abakus_groups.yaml', 'test_users.yaml', 'test_articles.yaml']
def setUp(self):
self.all_comments = Comment.objects.all()
self.all_users = User.objects.all()
self.with_permission = self.all_users.get(username='useradmin_test')
self.comments_test_group = AbakusGroup.objects.get(name='CommentTest')
self.comments_test_group.add_user(self.with_permission)
self.without_permission = self.all_users.exclude(pk=self.with_permission.pk).first()
def test_without_auth(self):
content_type = ContentType.objects.get_for_model(Article)
post_data = {
'text':
'Hey',
'comment_target':
'{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.first().pk
)
}
response = self.client.post(_get_list_url(), post_data)
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
def test_without_view_permissions(self):
self.client.force_authenticate(user=self.without_permission)
post_data = {
'text':
'Hey',
'comment_target':
'{0}-{1}'.format(
ContentType.objects.get_for_model(Article).app_label,
Article.objects.first().pk
)
}
response = self.client.post(_get_list_url(), post_data)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_with_view_permissions(self):
self.client.force_authenticate(user=self.with_permission)
content_type = ContentType.objects.get_for_model(Article)
post_data = {
'text':
'Hey',
'comment_target':
'{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.first().pk
)
}
response = self.client.post(_get_list_url(), post_data)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
comment = Comment.objects.get(pk=response.data['id'])
self.assertEqual(comment.text, post_data['text'])
self.assertEqual(comment.created_by.pk, self.with_permission.pk)
def test_with_empty_text_and_source(self):
self.client.force_authenticate(user=self.with_permission)
post_data = {'text': '', 'comment_target': ''}
response = self.client.post(_get_list_url(), post_data)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_with_invalid_contenttype(self):
self.client.force_authenticate(user=self.with_permission)
content_type = ContentType.objects.get_for_model(Article)
post_data = {
'text':
'Hey',
'comment_target':
'{0}.{1}-{2}'.format(
content_type.app_label + 'xyz', content_type.model,
Article.objects.first().pk
)
}
response = self.client.post(_get_list_url(), post_data)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_with_invalid_objectid(self):
self.client.force_authenticate(user=self.with_permission)
post_data = {
'text':
'Hey',
'comment_target':
'{0}-{1}'.format(
ContentType.objects.get_for_model(Article).app_label,
Article.objects.last().pk + 1000
),
}
response = self.client.post(_get_list_url(), post_data)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_with_parent(self):
self.client.force_authenticate(user=self.with_permission)
content_type = ContentType.objects.get_for_model(Article)
comment_target = '{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.last().pk
)
response = self.client.post(
_get_list_url(), {
'comment_target': comment_target,
'text': 'first comment'
}
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
pk = response.data['id']
response2 = self.client.post(
_get_list_url(),
{
'comment_target': comment_target,
'text': 'second comment',
'parent': pk
}
)
self.assertEqual(response2.status_code, status.HTTP_201_CREATED)
def test_with_invalid_parent(self):
self.client.force_authenticate(user=self.with_permission)
content_type = ContentType.objects.get_for_model(Article)
comment_target = '{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.last().pk
)
comment_target_2 = '{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.first().pk
)
response = self.client.post(
_get_list_url(), {
'comment_target': comment_target,
'text': 'first comment'
}
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
pk = response.data['id']
response2 = self.client.post(
_get_list_url(),
{
'comment_target': comment_target_2,
'text': 'second comment',
'parent': pk
}
)
self.assertEqual(response2.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn('parent', response2.data)
def test_with_nonexistent_parent(self):
self.client.force_authenticate(user=self.with_permission)
content_type = ContentType.objects.get_for_model(Article)
comment_target = '{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.last().pk
)
response = self.client.post(
_get_list_url(), {
'comment_target': comment_target,
'text': 'first comment'
}
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
pk = response.data['id']
response2 = self.client.post(
_get_list_url(), {
'comment_target': comment_target,
'text': 'second comment',
'parent': pk + 1000
}
)
self.assertEqual(response2.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIn('parent', response2.data)
def test_with_user_who_cannot_see_parent(self):
self.client.force_authenticate(user=self.with_permission)
with_permission_group_ids = map(lambda g: g.id, self.with_permission.all_groups)
group = AbakusGroup.objects.exclude(id__in=with_permission_group_ids).first()
"""
create an article which has a different owner and a group which with_permission does not
belong to. The user should then not be allowed to post a comment on this article
"""
article = Article.objects.create(text='hello world', current_user=self.without_permission)
article.can_view_groups.add(group)
content_type = ContentType.objects.get_for_model(Article)
comment_target = '{0}.{1}-{2}'.format(
content_type.app_label, content_type.model, article.id
)
response = self.client.post(
_get_list_url(), {
'comment_target': comment_target,
'text': 'first comment'
}
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
class UpdateCommentsAPITestCase(BaseAPITestCase):
fixtures = [
'test_abakus_groups.yaml',
'test_users.yaml',
'test_articles.yaml',
]
def setUp(self):
Comment.objects.create(
created_by_id=4, text='first comment', content_object=Article.objects.get(id=1)
)
Comment.objects.create(
created_by_id=3, text='second comment', content_object=Article.objects.get(id=2)
)
self.all_comments = Comment.objects.all()
self.all_users = User.objects.all()
self.with_permission = self.all_users.get(username='useradmin_test')
self.comments_test_group = AbakusGroup.objects.get(name='CommentTest')
self.comments_test_group.add_user(self.with_permission)
self.without_permission = self.all_users.exclude(pk=self.with_permission.pk).first()
self.test_comment = Comment.objects.first()
modified_comment = {'text': 'whats up'}
def successful_update(self, updater, update_object):
self.client.force_authenticate(user=updater)
response = self.client.patch(_get_detail_url(update_object.pk), self.modified_comment)
comment = Comment.objects.get(pk=update_object.pk)
self.assertEqual(response.status_code, status.HTTP_200_OK)
for key, value in self.modified_comment.items():
self.assertEqual(getattr(comment, key), value)
def test_self(self):
self.successful_update(self.test_comment.created_by, self.test_comment)
def test_with_useradmin(self):
self.successful_update(self.with_permission, self.test_comment)
def test_with_new_comment_target(self):
comment_update = self.modified_comment.copy()
content_type = ContentType.objects.get_for_model(Article)
comment_target = '{0}.{1}-{2}'.format(
content_type.app_label, content_type.model,
Article.objects.last().pk
)
comment_update['comment_target'] = comment_target
self.client.force_authenticate(user=self.with_permission)
response = self.client.put(_get_detail_url(self.test_comment.pk), comment_update)
comment = Comment.objects.get(pk=self.test_comment.pk)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(comment.content_object, self.test_comment.content_object)
def test_other_with_normal_user(self):
self.client.force_authenticate(user=self.without_permission)
response = self.client.put(_get_detail_url(self.test_comment.pk), self.modified_comment)
comment = Comment.objects.get(pk=self.test_comment.pk)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(comment, self.test_comment)
class DeleteUsersAPITestCase(BaseAPITestCase):
fixtures = ['test_abakus_groups.yaml', 'test_users.yaml', 'test_articles.yaml']
def setUp(self):
self.test_comment = Comment.objects.create(
created_by_id=4, text='first comment', content_object=Article.objects.get(id=1)
)
self.test_comment_2 = Comment.objects.create(
created_by_id=3, text='second comment', content_object=Article.objects.get(id=2)
)
self.all_comments = Comment.objects.all()
self.all_users = User.objects.all()
self.with_permission = self.all_users.get(username='useradmin_test')
self.comments_test_group = AbakusGroup.objects.get(name='CommentTest')
self.comments_test_group.add_user(self.with_permission)
self.without_permission = self.all_users.exclude(pk=self.with_permission.pk).first()
def successful_delete(self, user):
self.client.force_authenticate(user=user)
response = self.client.delete(_get_detail_url(self.test_comment.pk))
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
self.assertRaises(Comment.DoesNotExist, Comment.objects.get, pk=self.test_comment.pk)
def test_with_normal_user(self):
self.client.force_authenticate(user=self.without_permission)
response = self.client.delete(_get_detail_url(self.test_comment_2.pk))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_with_owner(self):
user = User.objects.get(username='pleb')
self.test_comment.created_by = user
self.test_comment.save()
self.successful_delete(self.test_comment.created_by)
def test_with_useradmin(self):
self.successful_delete(self.with_permission)
| 38.014793
| 100
| 0.649
| 1,505
| 12,849
| 5.259801
| 0.10897
| 0.040424
| 0.050025
| 0.045478
| 0.786382
| 0.747726
| 0.741283
| 0.731683
| 0.722208
| 0.701491
| 0
| 0.011825
| 0.243132
| 12,849
| 337
| 101
| 38.127596
| 0.802159
| 0
| 0
| 0.575646
| 0
| 0
| 0.069699
| 0.00712
| 0
| 0
| 0
| 0
| 0.095941
| 1
| 0.088561
| false
| 0
| 0.02583
| 0.00738
| 0.147601
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1ee2004b1df2ad9cc816ee3e4bb031f078488f3a
| 732
|
py
|
Python
|
lambda/tests/unit/utils/test_functions.py
|
voquis/aws-lambda-contact-form-handler
|
b1ab4309137ad8225bf8ad34cf92623dbe4f6e52
|
[
"MIT"
] | null | null | null |
lambda/tests/unit/utils/test_functions.py
|
voquis/aws-lambda-contact-form-handler
|
b1ab4309137ad8225bf8ad34cf92623dbe4f6e52
|
[
"MIT"
] | 8
|
2021-12-31T13:42:23.000Z
|
2022-01-09T16:07:03.000Z
|
lambda/tests/unit/utils/test_functions.py
|
voquis/aws-lambda-contact-form-handler
|
b1ab4309137ad8225bf8ad34cf92623dbe4f6e52
|
[
"MIT"
] | null | null | null |
"""
Utils unit tests
"""
from app_handler.utils.functions import string_to_dict
from app_handler.utils.functions import string_to_list
def test_string_to_dict():
"""
Test string to dictionary with separator
"""
assert not string_to_dict(None)
assert not string_to_dict({})
assert not string_to_dict('')
assert string_to_dict('a,b,,') == {'a':'', 'b':''}
assert string_to_dict('d|s|d', '|') == {'d':'','s':''}
def test_string_to_list():
"""
Test string to list with separator
"""
assert not string_to_list(None)
assert not string_to_list({})
assert not string_to_list('')
assert string_to_list('a,,,b') == ['a','b']
assert string_to_list('d|s||d', '|') == ['d','s']
| 27.111111
| 58
| 0.63388
| 109
| 732
| 3.963303
| 0.220183
| 0.296296
| 0.222222
| 0.236111
| 0.699074
| 0.638889
| 0.277778
| 0.194444
| 0
| 0
| 0
| 0
| 0.187158
| 732
| 26
| 59
| 28.153846
| 0.72605
| 0.125683
| 0
| 0
| 0
| 0
| 0.051495
| 0
| 0
| 0
| 0
| 0
| 0.714286
| 1
| 0.142857
| true
| 0
| 0.142857
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
94aab07bd7adab9e935df1f3e685fae227de4be1
| 72
|
py
|
Python
|
atcodertools/__init__.py
|
come2ry/atcoder-tools
|
d7ecf5c19427848e6c8f0aaa3c1a8af04c467f1b
|
[
"MIT"
] | 313
|
2016-12-04T13:25:21.000Z
|
2022-03-31T09:46:15.000Z
|
atcodertools/__init__.py
|
come2ry/atcoder-tools
|
d7ecf5c19427848e6c8f0aaa3c1a8af04c467f1b
|
[
"MIT"
] | 232
|
2016-12-02T22:55:20.000Z
|
2022-03-27T06:48:02.000Z
|
atcodertools/__init__.py
|
come2ry/atcoder-tools
|
d7ecf5c19427848e6c8f0aaa3c1a8af04c467f1b
|
[
"MIT"
] | 90
|
2017-09-23T15:09:48.000Z
|
2022-03-17T03:13:40.000Z
|
from atcodertools.release_management.version import __version__ # noqa
| 36
| 71
| 0.861111
| 8
| 72
| 7.125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097222
| 72
| 1
| 72
| 72
| 0.876923
| 0.055556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
94c06cd09b3bb829f4eb89b4933b8dd1d7b7ce8e
| 129
|
py
|
Python
|
recipe/__init__.py
|
JesperKauppinen/recipe-web-app
|
46cf0c43e6a67ddd20a2088d1e8ea0bffe8a5c31
|
[
"MIT"
] | null | null | null |
recipe/__init__.py
|
JesperKauppinen/recipe-web-app
|
46cf0c43e6a67ddd20a2088d1e8ea0bffe8a5c31
|
[
"MIT"
] | null | null | null |
recipe/__init__.py
|
JesperKauppinen/recipe-web-app
|
46cf0c43e6a67ddd20a2088d1e8ea0bffe8a5c31
|
[
"MIT"
] | null | null | null |
from flask import Blueprint
recipes = Blueprint('recipe', __name__)
from .recipe import all_recipes, create, look, save, unsave
| 25.8
| 59
| 0.782946
| 17
| 129
| 5.647059
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131783
| 129
| 5
| 59
| 25.8
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.046154
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0.666667
| 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
| 1
|
0
| 5
|
a20a19214d6aae79ce69bfe3e33b4107cb7722f2
| 27
|
py
|
Python
|
Python/empire/deprecated_stuff/structs2/struct_base.py
|
Tombmyst/Empire
|
f28782787c5fa9127e353549b73ec90d3c82c003
|
[
"Apache-2.0"
] | null | null | null |
Python/empire/deprecated_stuff/structs2/struct_base.py
|
Tombmyst/Empire
|
f28782787c5fa9127e353549b73ec90d3c82c003
|
[
"Apache-2.0"
] | null | null | null |
Python/empire/deprecated_stuff/structs2/struct_base.py
|
Tombmyst/Empire
|
f28782787c5fa9127e353549b73ec90d3c82c003
|
[
"Apache-2.0"
] | null | null | null |
class StructBase:
pass
| 13.5
| 18
| 0.703704
| 3
| 27
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.259259
| 27
| 2
| 19
| 13.5
| 0.95
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
a21fe85be150461bd88faabc3f38670ca5018bdf
| 64
|
py
|
Python
|
action-server/covidflow/__init__.py
|
nuecho/covidflow
|
050665c629ea46bfebc0920ba1dba841c2268d08
|
[
"MIT"
] | 7
|
2020-05-23T07:07:26.000Z
|
2021-11-29T05:58:51.000Z
|
action-server/covidflow/__init__.py
|
dialoguemd/covidflow
|
b159b76dc68462f272614db4cbf716844872ebca
|
[
"MIT"
] | 210
|
2020-04-13T17:21:55.000Z
|
2021-04-20T15:46:26.000Z
|
action-server/covidflow/__init__.py
|
dialoguemd/covidflow
|
b159b76dc68462f272614db4cbf716844872ebca
|
[
"MIT"
] | 3
|
2020-04-09T14:38:09.000Z
|
2020-07-29T15:06:11.000Z
|
from .setup_structlog import setup_structlog
setup_structlog()
| 16
| 44
| 0.859375
| 8
| 64
| 6.5
| 0.5
| 0.807692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09375
| 64
| 3
| 45
| 21.333333
| 0.896552
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a227e0596c20c5284fa4632fa3d53c0383891c10
| 172
|
py
|
Python
|
service/test_sqlalchemy.py
|
bentondrew/Infrastructure-Flask_Sqlalchemy
|
d274c37bda1e1072d70a89ffa983c18a35105bbd
|
[
"Apache-2.0"
] | null | null | null |
service/test_sqlalchemy.py
|
bentondrew/Infrastructure-Flask_Sqlalchemy
|
d274c37bda1e1072d70a89ffa983c18a35105bbd
|
[
"Apache-2.0"
] | null | null | null |
service/test_sqlalchemy.py
|
bentondrew/Infrastructure-Flask_Sqlalchemy
|
d274c37bda1e1072d70a89ffa983c18a35105bbd
|
[
"Apache-2.0"
] | null | null | null |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
import sqlalchemy
return 'Sqlalchemy version installed: {}'.format(sqlalchemy.__version__)
| 19.111111
| 74
| 0.738372
| 20
| 172
| 5.95
| 0.65
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133721
| 172
| 8
| 75
| 21.5
| 0.798658
| 0
| 0
| 0
| 0
| 0
| 0.19186
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 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
| 1
| 0
|
0
| 5
|
bf6649565848acb0fd6324b2df66605e7c4ac89b
| 247
|
py
|
Python
|
src/keyboards/inline/callback_datas.py
|
waydk/death-note_bot
|
2c76f2303f10be8a716a1e5a02866c581de21f5d
|
[
"MIT"
] | 9
|
2021-03-04T23:15:10.000Z
|
2021-06-09T08:07:47.000Z
|
src/keyboards/inline/callback_datas.py
|
waydk/death_note_bot
|
2c76f2303f10be8a716a1e5a02866c581de21f5d
|
[
"MIT"
] | null | null | null |
src/keyboards/inline/callback_datas.py
|
waydk/death_note_bot
|
2c76f2303f10be8a716a1e5a02866c581de21f5d
|
[
"MIT"
] | 2
|
2021-03-17T16:22:18.000Z
|
2021-06-09T08:07:48.000Z
|
from aiogram.utils.callback_data import CallbackData
close_callback = CallbackData("act", "name")
pagination_call = CallbackData("paginate", "key", "page")
delete_victims_call = CallbackData("act", "name")
shop_call = CallbackData("act", "name")
| 35.285714
| 57
| 0.761134
| 29
| 247
| 6.275862
| 0.62069
| 0.247253
| 0.313187
| 0.252747
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089069
| 247
| 6
| 58
| 41.166667
| 0.808889
| 0
| 0
| 0
| 0
| 0
| 0.145749
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bf88daa0b99b1f0c8b67127281aa8c9bbc693fe9
| 21
|
py
|
Python
|
ex9.py
|
arunkumarang/python
|
1960e285dfe2ef54d2e3ab37584bfef8b24ecca9
|
[
"Apache-2.0"
] | null | null | null |
ex9.py
|
arunkumarang/python
|
1960e285dfe2ef54d2e3ab37584bfef8b24ecca9
|
[
"Apache-2.0"
] | null | null | null |
ex9.py
|
arunkumarang/python
|
1960e285dfe2ef54d2e3ab37584bfef8b24ecca9
|
[
"Apache-2.0"
] | null | null | null |
print("Python" + 2)
| 10.5
| 19
| 0.571429
| 3
| 21
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.190476
| 21
| 2
| 19
| 10.5
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
bfa9897cf01e686510f83242ab637f06e1613b21
| 4,469
|
py
|
Python
|
tests/test_main_unix_only.py
|
source-foundry/fdiff
|
7e49daf7f599a593b891110de2f3a86af76f05f9
|
[
"Apache-2.0"
] | 27
|
2019-09-18T19:08:28.000Z
|
2022-02-26T12:39:17.000Z
|
tests/test_main_unix_only.py
|
source-foundry/fdiff
|
7e49daf7f599a593b891110de2f3a86af76f05f9
|
[
"Apache-2.0"
] | 123
|
2019-09-05T02:54:07.000Z
|
2022-03-21T10:05:26.000Z
|
tests/test_main_unix_only.py
|
source-foundry/fdiff
|
7e49daf7f599a593b891110de2f3a86af76f05f9
|
[
"Apache-2.0"
] | 1
|
2020-04-15T18:29:15.000Z
|
2020-04-15T18:29:15.000Z
|
#!/usr/bin/env python3
import os
import sys
import pytest
from fdiff.__main__ import run
ROBOTO_BEFORE_PATH = os.path.join("tests", "testfiles", "Roboto-Regular.subset1.ttf")
ROBOTO_AFTER_PATH = os.path.join("tests", "testfiles", "Roboto-Regular.subset2.ttf")
ROBOTO_EXTDIFF_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_extdiff_expected.txt")
ROBOTO_EXTDIFF_COLOR_EXPECTED_PATH = os.path.join("tests", "testfiles", "roboto_extdiff_color_expected.txt")
ROBOTO_BEFORE_URL = "https://github.com/source-foundry/fdiff/raw/master/tests/testfiles/Roboto-Regular.subset1.ttf"
ROBOTO_AFTER_URL = "https://github.com/source-foundry/fdiff/raw/master/tests/testfiles/Roboto-Regular.subset2.ttf"
# Setup: define the expected diff text for unified diff
with open(ROBOTO_EXTDIFF_EXPECTED_PATH, "r") as robo_extdiff:
ROBOTO_EXTDIFF_EXPECTED = robo_extdiff.read()
# Setup: define the expected diff text for unified color diff
with open(ROBOTO_EXTDIFF_COLOR_EXPECTED_PATH, "r") as robo_extdiff_color:
ROBOTO_EXTDIFF_COLOR_EXPECTED = robo_extdiff_color.read()
# # these tests rely on a PATH install of `diff` executable on Unix
# # they are not executed on Windows platforms
if sys.platform.startswith("win"):
pytest.skip("skipping windows-only tests", allow_module_level=True)
def test_main_external_diff_default(capsys):
args = ["--external", "diff -u", ROBOTO_BEFORE_PATH, ROBOTO_AFTER_PATH]
expected_string_list = ROBOTO_EXTDIFF_EXPECTED.split("\n")
with pytest.raises(SystemExit):
run(args)
captured = capsys.readouterr()
res_string_list = captured.out.split("\n")
for x, line in enumerate(res_string_list):
# treat top two lines of the diff as comparison of first 3 chars only
if x in (0, 1):
assert line[0:2] == expected_string_list[x][0:2]
elif x in range(2, 10):
assert line == expected_string_list[x]
else:
# skip lines beyond first 10
pass
def test_main_external_diff_remote(capsys):
args = ["--external", "diff -u", ROBOTO_BEFORE_URL, ROBOTO_AFTER_URL]
expected_string_list = ROBOTO_EXTDIFF_EXPECTED.split("\n")
with pytest.raises(SystemExit):
run(args)
captured = capsys.readouterr()
res_string_list = captured.out.split("\n")
for x, line in enumerate(res_string_list):
# treat top two lines of the diff as comparison of first 3 chars only
if x in (0, 1):
assert line[0:2] == expected_string_list[x][0:2]
elif x in range(2, 10):
assert line == expected_string_list[x]
else:
# skip lines beyond first 10
pass
def test_main_external_diff_color(capsys):
args = ["--external", "diff -u", "--color", ROBOTO_BEFORE_PATH, ROBOTO_AFTER_PATH]
expected_string_list = ROBOTO_EXTDIFF_COLOR_EXPECTED.split("\n")
with pytest.raises(SystemExit):
run(args)
captured = capsys.readouterr()
res_string_list = captured.out.split("\n")
for x, line in enumerate(res_string_list):
# treat top two lines of the diff as comparison of first 3 chars only
if x in (0, 1):
assert line[0:2] == expected_string_list[x][0:2]
elif x in range(2, 10):
assert line == expected_string_list[x]
else:
# skip lines beyond first 10
pass
def test_main_external_diff_with_head_fails(capsys):
args = ["--external", "diff -u", "--head", "1", ROBOTO_BEFORE_PATH, ROBOTO_AFTER_PATH]
with pytest.raises(SystemExit) as exit_info:
run(args)
captured = capsys.readouterr()
assert "[ERROR] The head and tail options are not supported" in captured.err
assert exit_info.value.code == 1
def test_main_external_diff_with_tail_fails(capsys):
args = ["--external", "diff -u", "--tail", "1", ROBOTO_BEFORE_PATH, ROBOTO_AFTER_PATH]
with pytest.raises(SystemExit) as exit_info:
run(args)
captured = capsys.readouterr()
assert "[ERROR] The head and tail options are not supported" in captured.err
assert exit_info.value.code == 1
def test_main_external_diff_with_lines_fails(capsys):
args = ["--external", "diff -u", "--lines", "1", ROBOTO_BEFORE_PATH, ROBOTO_AFTER_PATH]
with pytest.raises(SystemExit) as exit_info:
run(args)
captured = capsys.readouterr()
assert "[ERROR] The lines option is not supported" in captured.err
assert exit_info.value.code == 1
| 36.040323
| 115
| 0.694563
| 637
| 4,469
| 4.651491
| 0.199372
| 0.050624
| 0.054674
| 0.038475
| 0.840365
| 0.800203
| 0.746203
| 0.726628
| 0.657779
| 0.624705
| 0
| 0.013074
| 0.195569
| 4,469
| 124
| 116
| 36.040323
| 0.811127
| 0.118371
| 0
| 0.620253
| 0
| 0.025316
| 0.171079
| 0.028513
| 0
| 0
| 0
| 0
| 0.151899
| 1
| 0.075949
| false
| 0.037975
| 0.050633
| 0
| 0.126582
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bfb7cb724ad609c79467dce8846ad0723e063ced
| 117
|
py
|
Python
|
bb2_cyanide_api/__init__.py
|
dennisgranasen/bb2_cyanide_api
|
a629839f1f6d6b2288048df824b4d2ae3521cd57
|
[
"MIT"
] | null | null | null |
bb2_cyanide_api/__init__.py
|
dennisgranasen/bb2_cyanide_api
|
a629839f1f6d6b2288048df824b4d2ae3521cd57
|
[
"MIT"
] | 1
|
2022-02-12T17:20:09.000Z
|
2022-02-13T10:29:41.000Z
|
bb2_cyanide_api/__init__.py
|
dennisgranasen/bb2_cyanide_api
|
a629839f1f6d6b2288048df824b4d2ae3521cd57
|
[
"MIT"
] | 1
|
2022-02-11T06:30:43.000Z
|
2022-02-11T06:30:43.000Z
|
pass
from .adapter import adapter
from .match import Match
from .api import Agent
from .tournament import Tournament
| 19.5
| 34
| 0.820513
| 17
| 117
| 5.647059
| 0.470588
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145299
| 117
| 6
| 34
| 19.5
| 0.96
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.8
| 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
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
bfd4dea58b08b70ecd92241d7390e0ae5d0daf9e
| 17
|
py
|
Python
|
T00-00/slice0.1.py
|
pedromigueladao/SSof-Project1920
|
91e768312f1a6560db45fd4372010cca30bae65e
|
[
"MIT"
] | 2
|
2019-11-20T19:26:07.000Z
|
2019-11-22T00:42:23.000Z
|
T00-00/slice0.1.py
|
pedromigueladao/SSof-Project1920
|
91e768312f1a6560db45fd4372010cca30bae65e
|
[
"MIT"
] | 2
|
2019-11-28T05:21:24.000Z
|
2019-11-28T05:21:58.000Z
|
T00-00/slice0.1.py
|
pedromigueladao/SSof-Project1920
|
91e768312f1a6560db45fd4372010cca30bae65e
|
[
"MIT"
] | 25
|
2019-11-27T01:40:56.000Z
|
2019-12-04T23:38:59.000Z
|
x=oi()
q=x
z(q)
| 3.4
| 6
| 0.411765
| 6
| 17
| 1.166667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235294
| 17
| 4
| 7
| 4.25
| 0.538462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
44c2f95879b7dd2ad024620a0aa3edc8be3cca9b
| 65
|
py
|
Python
|
tests/unit/test_modulegraph/testpkg-regr7/pkg/mod.py
|
hawkhai/pyinstaller
|
016a24479b34de161792c72dde455a81ad4c78ae
|
[
"Apache-2.0"
] | 9,267
|
2015-01-01T04:08:45.000Z
|
2022-03-31T11:42:38.000Z
|
tests/unit/test_modulegraph/testpkg-regr7/pkg/mod.py
|
jeremysanders/pyinstaller
|
321b24f9a9a5978337735816b36ca6b4a90a2fb4
|
[
"Apache-2.0"
] | 5,150
|
2015-01-01T12:09:56.000Z
|
2022-03-31T18:06:12.000Z
|
tests/unit/test_modulegraph/testpkg-regr7/pkg/mod.py
|
jeremysanders/pyinstaller
|
321b24f9a9a5978337735816b36ca6b4a90a2fb4
|
[
"Apache-2.0"
] | 2,101
|
2015-01-03T10:25:27.000Z
|
2022-03-30T11:04:42.000Z
|
from .. import sys
from ... import os, xml
from ..foo import bar
| 16.25
| 23
| 0.676923
| 11
| 65
| 4
| 0.636364
| 0.454545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 65
| 3
| 24
| 21.666667
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
44f714ab1e14c5f64940edbbf556506c6aa03642
| 55
|
py
|
Python
|
tottle/dispatch/rules/__init__.py
|
TheBakerCat/tottle
|
c7dbe741014caff1fadaa39d06db56d44886c31d
|
[
"MIT"
] | 1
|
2022-02-11T17:43:18.000Z
|
2022-02-11T17:43:18.000Z
|
tottle/dispatch/rules/__init__.py
|
TheBakerCat/tottle
|
c7dbe741014caff1fadaa39d06db56d44886c31d
|
[
"MIT"
] | null | null | null |
tottle/dispatch/rules/__init__.py
|
TheBakerCat/tottle
|
c7dbe741014caff1fadaa39d06db56d44886c31d
|
[
"MIT"
] | null | null | null |
from .abc import ABCRule
from .message import TextRule
| 18.333333
| 29
| 0.818182
| 8
| 55
| 5.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145455
| 55
| 2
| 30
| 27.5
| 0.957447
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
781276848fe1c76cafc2203b9fe638ff64d00d8c
| 55
|
py
|
Python
|
ris/clickatellhttp/__init__.py
|
rwizi/clickatellhttp
|
d39acc299c4a76413cb563860941b01d0b430a8a
|
[
"Apache-2.0"
] | null | null | null |
ris/clickatellhttp/__init__.py
|
rwizi/clickatellhttp
|
d39acc299c4a76413cb563860941b01d0b430a8a
|
[
"Apache-2.0"
] | null | null | null |
ris/clickatellhttp/__init__.py
|
rwizi/clickatellhttp
|
d39acc299c4a76413cb563860941b01d0b430a8a
|
[
"Apache-2.0"
] | null | null | null |
from http import ClickatellClient, ClickatellException
| 27.5
| 54
| 0.890909
| 5
| 55
| 9.8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 55
| 1
| 55
| 55
| 0.98
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
7835f2f0d7762b09bc1c59e7faac0ec41e14778f
| 97
|
py
|
Python
|
src/spaceone/inventory/connector/aws_cloud_trail_connector/__init__.py
|
jean1042/plugin-aws-cloud-services
|
1cf192557b03478af33ae81f40b2a49f735716bb
|
[
"Apache-2.0"
] | 4
|
2020-06-22T01:48:07.000Z
|
2020-08-24T00:51:09.000Z
|
src/spaceone/inventory/connector/aws_cloud_trail_connector/__init__.py
|
jean1042/plugin-aws-cloud-services
|
1cf192557b03478af33ae81f40b2a49f735716bb
|
[
"Apache-2.0"
] | 2
|
2020-07-20T01:58:32.000Z
|
2020-08-04T07:41:37.000Z
|
src/spaceone/inventory/connector/aws_cloud_trail_connector/__init__.py
|
jean1042/plugin-aws-cloud-services
|
1cf192557b03478af33ae81f40b2a49f735716bb
|
[
"Apache-2.0"
] | 6
|
2020-06-22T09:19:40.000Z
|
2020-09-17T06:35:37.000Z
|
from spaceone.inventory.connector.aws_cloud_trail_connector.connector import CloudTrailConnector
| 48.5
| 96
| 0.917526
| 11
| 97
| 7.818182
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041237
| 97
| 1
| 97
| 97
| 0.924731
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
784a95166c033b7fb115c72f4ef2c537eabe1974
| 80
|
py
|
Python
|
simpleCoin/infrastructure.py
|
ppsirg/SimpleCoin
|
5fdc2cef9dc0e679073dfd21b48f7cf25169c532
|
[
"MIT"
] | 2
|
2018-05-18T20:13:32.000Z
|
2018-08-01T15:17:20.000Z
|
simpleCoin/infrastructure.py
|
ppsirg/SimpleCoin
|
5fdc2cef9dc0e679073dfd21b48f7cf25169c532
|
[
"MIT"
] | null | null | null |
simpleCoin/infrastructure.py
|
ppsirg/SimpleCoin
|
5fdc2cef9dc0e679073dfd21b48f7cf25169c532
|
[
"MIT"
] | 2
|
2018-05-18T20:13:35.000Z
|
2019-04-21T06:42:06.000Z
|
base_url = 'http://emdyp.pythonanywhere.com'
base_url = 'http://localhost:5000'
| 26.666667
| 44
| 0.7375
| 11
| 80
| 5.181818
| 0.727273
| 0.245614
| 0.385965
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.054054
| 0.075
| 80
| 2
| 45
| 40
| 0.716216
| 0
| 0
| 0
| 0
| 0
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
787dd9018548d5ff4983be73fed6cca643dbac56
| 241
|
py
|
Python
|
memes/permissions.py
|
Dishantm70/meme-generator
|
cc95d3dd416e14c1912e2a55906c1e516e52b15b
|
[
"MIT"
] | null | null | null |
memes/permissions.py
|
Dishantm70/meme-generator
|
cc95d3dd416e14c1912e2a55906c1e516e52b15b
|
[
"MIT"
] | null | null | null |
memes/permissions.py
|
Dishantm70/meme-generator
|
cc95d3dd416e14c1912e2a55906c1e516e52b15b
|
[
"MIT"
] | null | null | null |
from rest_framework.permissions import BasePermission
class CookieConsentAcceptedPermission(BasePermission):
def has_permission(self, request, view):
return request.user.is_authenticated and request.user.cookie_consent_accepted
| 40.166667
| 85
| 0.834025
| 26
| 241
| 7.538462
| 0.846154
| 0.112245
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112033
| 241
| 6
| 85
| 40.166667
| 0.915888
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
78c151859d927827ce265065f2504129ac9148bc
| 16,880
|
py
|
Python
|
scalesharkSpider/proxy.py
|
bhusures/indeed_crawler
|
8a0577a22962f5e08498af485e152a56ee4bf69b
|
[
"MIT"
] | 1
|
2018-07-03T14:46:03.000Z
|
2018-07-03T14:46:03.000Z
|
scalesharkSpider/proxy.py
|
bhusures/indeed_crawler
|
8a0577a22962f5e08498af485e152a56ee4bf69b
|
[
"MIT"
] | null | null | null |
scalesharkSpider/proxy.py
|
bhusures/indeed_crawler
|
8a0577a22962f5e08498af485e152a56ee4bf69b
|
[
"MIT"
] | 1
|
2018-07-02T19:14:39.000Z
|
2018-07-02T19:14:39.000Z
|
PROXIES = [
{'protocol':'http', 'ip_port':'118.193.26.18:8080'},
{'protocol':'http', 'ip_port':'213.136.77.246:80'},
{'protocol':'http', 'ip_port':'198.199.127.16:80'},
{'protocol':'http', 'ip_port':'103.78.213.147:80'},
{'protocol':'https', 'ip_port':'61.90.73.10:8080'},
{'protocol':'http', 'ip_port':'36.83.78.184:80'},
{'protocol':'http', 'ip_port':'66.119.180.101:80'},
{'protocol':'https', 'ip_port':'142.44.135.148:8080'},
{'protocol':'http', 'ip_port':'80.211.181.37:3128'},
{'protocol':'http', 'ip_port':'36.79.15.169:80'},
{'protocol':'https', 'ip_port':'140.227.81.53:3128'},
{'protocol':'http', 'ip_port':'47.52.231.140:8080'},
{'protocol':'https', 'ip_port':'185.93.3.123:8080'},
{'protocol':'http', 'ip_port':'121.121.125.55:80'},
{'protocol':'https', 'ip_port':'191.252.92.198:8080'},
{'protocol':'http', 'ip_port':'213.136.89.121:80'},
{'protocol':'http', 'ip_port':'36.83.82.36:80'},
{'protocol':'https', 'ip_port':'163.44.165.165:8080'},
{'protocol':'https', 'ip_port':'191.252.186.52:80'},
{'protocol':'https', 'ip_port':'140.227.78.54:3128'},
{'protocol':'http', 'ip_port':'36.75.254.142:80'},
{'protocol':'https', 'ip_port':'178.57.44.159:44331'},
{'protocol':'http', 'ip_port':'80.48.119.28:8080'},
{'protocol':'https', 'ip_port':'103.241.205.66:8080'},
{'protocol':'http', 'ip_port':'36.83.77.39:80'},
{'protocol':'https', 'ip_port':'149.56.45.68:10000'},
{'protocol':'http', 'ip_port':'177.67.83.134:3128'},
{'protocol':'https', 'ip_port':'167.99.224.142:8080'},
{'protocol':'http', 'ip_port':'66.70.190.244:8080'},
{'protocol':'http', 'ip_port':'36.83.93.62:80'},
{'protocol':'https', 'ip_port':'178.136.225.96:53281'},
{'protocol':'https', 'ip_port':'212.77.86.103:80'},
{'protocol':'https', 'ip_port':'158.69.150.164:8080'},
{'protocol':'http', 'ip_port':'66.119.180.104:80'},
{'protocol':'https', 'ip_port':'66.70.146.227:3128'},
{'protocol':'https', 'ip_port':'110.164.181.164:8080'},
{'protocol':'http', 'ip_port':'88.99.215.14:80'},
{'protocol':'https', 'ip_port':'124.120.105.127:3128'},
{'protocol':'http', 'ip_port':'159.65.63.23:80'},
{'protocol':'http', 'ip_port':'66.119.180.103:80'},
{'protocol':'http', 'ip_port':'18.130.46.39:80'},
{'protocol':'http', 'ip_port':'81.22.54.60:53281'},
{'protocol':'http', 'ip_port':'45.115.39.139:7777'},
{'protocol':'http', 'ip_port':'60.49.97.65:53281'},
{'protocol':'http', 'ip_port':'176.15.169.70:53281'},
{'protocol':'http', 'ip_port':'81.211.23.6:3128'},
{'protocol':'http', 'ip_port':'190.12.58.187:53281'},
{'protocol':'http', 'ip_port':'196.61.28.125:53281'},
{'protocol':'http', 'ip_port':'47.89.30.82:8118'},
{'protocol':'http', 'ip_port':'109.76.229.164:8080'},
{'protocol':'http', 'ip_port':'199.195.119.37:80'},
{'protocol':'http', 'ip_port':'122.54.105.143:53281'},
{'protocol':'http', 'ip_port':'62.43.201.40:53281'},
{'protocol':'http', 'ip_port':'41.204.84.182:53281'},
{'protocol':'http', 'ip_port':'196.202.194.127:62225'},
{'protocol':'http', 'ip_port':'159.224.176.205:53281'},
{'protocol':'http', 'ip_port':'136.169.141.254:8080'},
{'protocol':'http', 'ip_port':'125.162.211.20:80'},
{'protocol':'http', 'ip_port':'60.250.79.187:80'},
{'protocol':'http', 'ip_port':'165.90.11.18:8080'},
{'protocol':'http', 'ip_port':'111.93.64.113:80'},
{'protocol':'https', 'ip_port':'147.135.210.114:54566'},
{'protocol':'http', 'ip_port':'184.172.231.86:80'},
{'protocol':'https', 'ip_port':'89.236.17.106:3128'},
{'protocol':'http', 'ip_port':'175.139.252.193:80'},
{'protocol':'http', 'ip_port':'187.60.253.78:3128'},
{'protocol':'http', 'ip_port':'109.74.75.61:80'},
{'protocol':'http', 'ip_port':'14.136.246.173:3128'},
{'protocol':'http', 'ip_port':'198.1.122.29:80'},
{'protocol':'http', 'ip_port':'159.65.182.63:80'},
{'protocol':'http', 'ip_port':'129.213.76.9:3128'},
{'protocol':'https', 'ip_port':'189.115.92.71:80'},
{'protocol':'http', 'ip_port':'74.209.243.116:3128'},
{'protocol':'https', 'ip_port':'191.252.120.198:8080'},
{'protocol':'http', 'ip_port':'115.249.145.202:80'},
{'protocol':'https', 'ip_port':'94.130.20.85:31288'},
{'protocol':'https', 'ip_port':'185.65.192.36:8080'},
{'protocol':'http', 'ip_port':'185.70.79.131:3128'},
{'protocol':'https', 'ip_port':'77.120.72.235:53281'},
{'protocol':'https', 'ip_port':'191.252.194.156:3128'},
{'protocol':'https', 'ip_port':'71.13.112.152:3128'},
{'protocol':'http', 'ip_port':'5.189.133.231:80'},
{'protocol':'http', 'ip_port':'91.205.239.120:8080'},
{'protocol':'http', 'ip_port':'121.254.214.219:80'},
{'protocol':'http', 'ip_port':'185.229.224.61:80'},
{'protocol':'http', 'ip_port':'34.201.72.254:80'},
{'protocol':'http', 'ip_port':'163.172.86.64:3128'},
{'protocol':'http', 'ip_port':'46.4.62.108:80'},
{'protocol':'http', 'ip_port':'47.89.41.164:80'},
{'protocol':'http', 'ip_port':'34.244.2.143:80'},
{'protocol':'http', 'ip_port':'177.21.115.43:20183'},
{'protocol':'http', 'ip_port':'190.109.32.251:8080'},
{'protocol':'http', 'ip_port':'177.21.109.90:20183'},
{'protocol':'http', 'ip_port':'89.169.88.169:8080'},
{'protocol':'http', 'ip_port':'167.99.28.176:8080'},
{'protocol':'http', 'ip_port':'128.199.129.5:80'},
{'protocol':'http', 'ip_port':'192.141.206.176:20183'},
{'protocol':'http', 'ip_port':'85.109.69.223:9090'},
{'protocol':'http', 'ip_port':'103.18.180.1:8080'},
{'protocol':'http', 'ip_port':'36.65.187.232:8080'},
{'protocol':'http', 'ip_port':'103.41.96.186:8080'},
{'protocol':'http', 'ip_port':'186.94.179.162:8080'},
{'protocol':'http', 'ip_port':'93.143.193.34:8080'},
{'protocol':'http', 'ip_port':'4.35.210.222:8181'},
{'protocol':'http', 'ip_port':'87.118.208.125:8080'},
{'protocol':'http', 'ip_port':'103.26.54.21:8080'},
{'protocol':'http', 'ip_port':'80.245.117.133:8080'},
{'protocol':'http', 'ip_port':'123.49.53.210:8080'},
{'protocol':'http', 'ip_port':'201.249.49.105:8080'},
{'protocol':'http', 'ip_port':'201.44.187.67:20183'},
{'protocol':'http', 'ip_port':'103.25.155.5:8080'},
{'protocol':'http', 'ip_port':'193.150.117.61:8000'},
{'protocol':'http', 'ip_port':'62.69.195.249:8080'},
{'protocol':'http', 'ip_port':'103.35.168.14:8080'},
{'protocol':'http', 'ip_port':'74.83.246.125:8081'},
{'protocol':'http', 'ip_port':'27.123.0.153:8080'},
{'protocol':'http', 'ip_port':'5.13.254.175:8080'},
{'protocol':'http', 'ip_port':'103.216.144.17:8080'},
{'protocol':'http', 'ip_port':'5.40.227.209:8080'},
{'protocol':'http', 'ip_port':'182.18.200.92:8080'},
{'protocol':'http', 'ip_port':'170.79.200.233:20183'},
{'protocol':'http', 'ip_port':'52.128.58.102:8080'},
{'protocol':'http', 'ip_port':'103.218.24.41:8080'},
{'protocol':'http', 'ip_port':'221.187.134.102:8080'},
{'protocol':'http', 'ip_port':'103.111.228.2:8080'},
{'protocol':'http', 'ip_port':'103.218.25.33:8080'},
{'protocol':'http', 'ip_port':'61.8.78.130:8080'},
{'protocol':'http', 'ip_port':'177.36.208.121:3128'},
{'protocol':'http', 'ip_port':'45.125.223.145:8080'},
{'protocol':'http', 'ip_port':'193.19.135.1:8080'},
{'protocol':'http', 'ip_port':'103.48.70.193:8080'},
{'protocol':'http', 'ip_port':'81.34.18.159:8080'},
{'protocol':'http', 'ip_port':'175.209.132.102:808'},
{'protocol':'http', 'ip_port':'177.74.247.59:3128'},
{'protocol':'http', 'ip_port':'1.179.181.17:8081'},
{'protocol':'http', 'ip_port':'80.72.66.212:8081'},
{'protocol':'http', 'ip_port':'91.237.240.70:8080'},
{'protocol':'http', 'ip_port':'200.122.209.78:8080'},
{'protocol':'http', 'ip_port':'36.66.103.63:3128'},
{'protocol':'http', 'ip_port':'122.54.20.216:8090'},
{'protocol':'http', 'ip_port':'203.154.82.34:8080'},
{'protocol':'http', 'ip_port':'66.96.237.133:8080'},
{'protocol':'http', 'ip_port':'177.36.131.200:20183'},
{'protocol':'http', 'ip_port':'200.122.211.26:8080'},
{'protocol':'http', 'ip_port':'103.35.171.93:8080'},
{'protocol':'http', 'ip_port':'2.138.25.150:8080'},
{'protocol':'http', 'ip_port':'177.204.155.131:3128'},
{'protocol':'http', 'ip_port':'103.206.254.190:8080'},
{'protocol':'http', 'ip_port':'177.220.186.11:8080'},
{'protocol':'http', 'ip_port':'177.47.243.74:8088'},
{'protocol':'http', 'ip_port':'177.21.109.69:20183'},
{'protocol':'http', 'ip_port':'1.179.185.253:8080'},
{'protocol':'http', 'ip_port':'182.23.28.186:3128'},
{'protocol':'http', 'ip_port':'80.87.176.16:8080'},
{'protocol':'http', 'ip_port':'202.169.252.73:8080'},
{'protocol':'http', 'ip_port':'154.72.81.45:8080'},
{'protocol':'http', 'ip_port':'190.201.95.84:8080'},
{'protocol':'http', 'ip_port':'195.228.210.245:8080'},
{'protocol':'http', 'ip_port':'91.237.240.4:8080'},
{'protocol':'http', 'ip_port':'202.137.15.93:8080'},
{'protocol':'http', 'ip_port':'87.249.205.103:8080'},
{'protocol':'http', 'ip_port':'189.8.93.173:20183'},
{'protocol':'http', 'ip_port':'177.21.104.205:20183'},
{'protocol':'http', 'ip_port':'172.245.211.188:5836'},
{'protocol':'http', 'ip_port':'88.255.101.175:8080'},
{'protocol':'http', 'ip_port':'131.161.124.36:3128'},
{'protocol':'http', 'ip_port':'182.16.171.26:53281'},
{'protocol':'http', 'ip_port':'45.123.43.158:8080'},
{'protocol':'http', 'ip_port':'94.45.49.170:8080'},
{'protocol':'http', 'ip_port':'177.22.91.71:20183'},
{'protocol':'http', 'ip_port':'181.129.33.218:62225'},
{'protocol':'http', 'ip_port':'190.109.169.41:53281'},
{'protocol':'https', 'ip_port':'204.48.22.184:3432'},
{'protocol':'https', 'ip_port':'198.50.137.181:3128'},
{'protocol':'http', 'ip_port':'173.212.202.65:443'},
{'protocol':'https', 'ip_port':'170.78.23.245:8080'},
{'protocol':'https', 'ip_port':'158.69.143.77:8080'},
{'protocol':'http', 'ip_port':'103.87.16.2:80'},
{'protocol':'https', 'ip_port':'18.222.124.59:8080'},
{'protocol':'http', 'ip_port':'47.254.22.115:8080'},
{'protocol':'http', 'ip_port':'118.69.34.21:8080'},
{'protocol':'http', 'ip_port':'138.117.115.249:53281'},
{'protocol':'http', 'ip_port':'190.4.4.204:3128'},
{'protocol':'http', 'ip_port':'42.112.208.124:53281'},
{'protocol':'http', 'ip_port':'188.120.232.181:8118'},
{'protocol':'https', 'ip_port':'177.52.250.126:8080'},
{'protocol':'http', 'ip_port':'218.50.2.102:8080'},
{'protocol':'http', 'ip_port':'54.95.211.163:8080'},
{'protocol':'http', 'ip_port':'35.200.69.141:8080'},
{'protocol':'http', 'ip_port':'181.49.24.126:8081'},
{'protocol':'https', 'ip_port':'96.9.69.230:53281'},
{'protocol':'https', 'ip_port':'192.116.142.153:8080'},
{'protocol':'http', 'ip_port':'171.244.32.140:8080'},
{'protocol':'https', 'ip_port':'195.133.220.18:43596'},
{'protocol':'https', 'ip_port':'209.190.4.117:8080'},
{'protocol':'http', 'ip_port':'39.109.112.111:8080'},
{'protocol':'http', 'ip_port':'176.53.2.122:8080'},
{'protocol':'https', 'ip_port':'200.255.53.2:8080'},
{'protocol':'http', 'ip_port':'125.26.98.165:8080'},
{'protocol':'http', 'ip_port':'212.90.167.90:55555'},
{'protocol':'https', 'ip_port':'125.25.202.139:3128'},
{'protocol':'http', 'ip_port':'83.238.100.226:3128'},
{'protocol':'http', 'ip_port':'103.87.170.105:42421'},
{'protocol':'http', 'ip_port':'195.138.83.218:53281'},
{'protocol':'http', 'ip_port':'185.237.87.240:80'},
{'protocol':'http', 'ip_port':'188.0.138.147:8080'},
{'protocol':'http', 'ip_port':'181.211.166.105:54314'},
{'protocol':'http', 'ip_port':'87.185.153.132:8080'},
{'protocol':'http', 'ip_port':'67.238.124.52:8080'},
{'protocol':'http', 'ip_port':'159.192.206.10:8080'},
{'protocol':'http', 'ip_port':'159.65.168.7:80'},
{'protocol':'http', 'ip_port':'108.61.203.146:8118'},
{'protocol':'http', 'ip_port':'173.212.209.59:80'},
{'protocol':'http', 'ip_port':'88.205.171.222:8080'},
{'protocol':'http', 'ip_port':'38.103.239.2:44372'},
{'protocol':'http', 'ip_port':'182.16.171.18:53281'},
{'protocol':'http', 'ip_port':'177.21.108.222:20183'},
{'protocol':'http', 'ip_port':'182.253.139.36:65301'},
{'protocol':'https', 'ip_port':'200.7.205.198:8081'},
{'protocol':'https', 'ip_port':'41.169.67.242:53281'},
{'protocol':'http', 'ip_port':'41.190.33.162:8080'},
{'protocol':'https', 'ip_port':'94.130.14.146:31288'},
{'protocol':'https', 'ip_port':'88.99.149.188:31288'},
{'protocol':'https', 'ip_port':'80.211.151.246:8145'},
{'protocol':'https', 'ip_port':'136.169.225.53:3128'},
{'protocol':'http', 'ip_port':'47.252.1.152:80'},
{'protocol':'https', 'ip_port':'61.7.175.138:41496'},
{'protocol':'http', 'ip_port':'52.214.181.43:80'},
{'protocol':'https', 'ip_port':'67.205.148.246:8080'},
{'protocol':'https', 'ip_port':'176.31.250.164:3128'},
{'protocol':'http', 'ip_port':'109.195.243.177:8197'},
{'protocol':'http', 'ip_port':'46.105.51.183:80'},
{'protocol':'https', 'ip_port':'94.141.157.182:8080'},
{'protocol':'https', 'ip_port':'14.207.100.203:8080'},
{'protocol':'http', 'ip_port':'163.172.181.29:80'},
{'protocol':'https', 'ip_port':'54.36.162.123:10000'},
{'protocol':'http', 'ip_port':'52.87.190.26:80'},
{'protocol':'http', 'ip_port':'212.98.150.50:80'},
{'protocol':'https', 'ip_port':'66.82.144.29:8080'},
{'protocol':'http', 'ip_port':'188.166.223.181:80'},
{'protocol':'http', 'ip_port':'180.251.80.119:8080'},
{'protocol':'http', 'ip_port':'94.21.75.9:8080'},
{'protocol':'http', 'ip_port':'177.105.252.133:20183'},
{'protocol':'http', 'ip_port':'61.7.138.109:8080'},
{'protocol':'http', 'ip_port':'110.78.155.27:8080'},
{'protocol':'http', 'ip_port':'178.49.139.13:80'},
{'protocol':'https', 'ip_port':'146.158.30.192:53281'},
{'protocol':'https', 'ip_port':'171.255.199.129:80'},
{'protocol':'http', 'ip_port':'92.222.74.221:80'},
{'protocol':'http', 'ip_port':'170.79.202.23:20183'},
{'protocol':'http', 'ip_port':'179.182.63.63:20183'},
{'protocol':'http', 'ip_port':'212.14.166.26:3128'},
{'protocol':'https', 'ip_port':'103.233.118.83:808'},
{'protocol':'http', 'ip_port':'110.170.150.52:8080'},
{'protocol':'http', 'ip_port':'181.143.129.180:3128'},
{'protocol':'http', 'ip_port':'181.119.115.2:53281'},
{'protocol':'http', 'ip_port':'185.8.158.149:8080'},
{'protocol':'http', 'ip_port':'103.39.251.241:8080'},
{'protocol':'http', 'ip_port':'46.229.252.61:8080'},
{'protocol':'http', 'ip_port':'93.182.72.36:8080'},
{'protocol':'http', 'ip_port':'201.54.5.117:3128'},
{'protocol':'http', 'ip_port':'78.140.6.68:53281'},
{'protocol':'http', 'ip_port':'177.184.83.162:20183'},
{'protocol':'http', 'ip_port':'143.202.75.240:20183'},
{'protocol':'http', 'ip_port':'31.145.83.202:8080'},
{'protocol':'http', 'ip_port':'177.101.181.33:20183'},
{'protocol':'http', 'ip_port':'144.76.190.233:3128'},
{'protocol':'http', 'ip_port':'134.0.63.134:8000'},
{'protocol':'http', 'ip_port':'38.103.239.13:35617'},
{'protocol':'http', 'ip_port':'110.78.168.138:62225'},
{'protocol':'http', 'ip_port':'198.58.123.138:8123'},
{'protocol':'http', 'ip_port':'190.78.8.120:8080'},
{'protocol':'http', 'ip_port':'190.23.68.39:8080'},
{'protocol':'http', 'ip_port':'191.55.10.27:3128'},
{'protocol':'http', 'ip_port':'200.71.146.146:8080'},
{'protocol':'http', 'ip_port':'103.102.248.56:3128'},
{'protocol':'http', 'ip_port':'37.110.74.231:8181'},
{'protocol':'http', 'ip_port':'191.5.183.120:20183'},
{'protocol':'http', 'ip_port':'154.68.195.8:8080'},
{'protocol':'http', 'ip_port':'182.53.201.240:8080'},
{'protocol':'http', 'ip_port':'177.21.115.164:20183'},
{'protocol':'http', 'ip_port':'201.49.238.77:20183'},
{'protocol':'http', 'ip_port':'101.109.64.19:8080'},
{'protocol':'http', 'ip_port':'36.81.21.226:8080'},
{'protocol':'http', 'ip_port':'37.60.209.54:8081'},
{'protocol':'http', 'ip_port':'143.0.141.96:80'},
{'protocol':'http', 'ip_port':'201.49.238.28:20183'},
{'protocol':'http', 'ip_port':'175.107.208.74:8080'},
{'protocol':'http', 'ip_port':'80.211.226.156:80'},
{'protocol':'http', 'ip_port':'119.42.72.139:31588'},
{'protocol':'http', 'ip_port':'61.5.101.56:3128'},
{'protocol':'http', 'ip_port':'180.183.223.47:8080'},
{'protocol':'http', 'ip_port':'197.159.16.2:8080'},
{'protocol':'http', 'ip_port':'27.147.142.146:8080'},
{'protocol':'http', 'ip_port':'201.76.125.107:20183'},
{'protocol':'http', 'ip_port':'103.78.74.170:3128'},
{'protocol':'http', 'ip_port':'85.130.3.136:53281'},
{'protocol':'http', 'ip_port':'213.144.123.146:80'},
{'protocol':'http', 'ip_port':'182.253.179.230:8080'},
{'protocol':'http', 'ip_port':'170.79.202.162:20183'},
]
| 55.89404
| 59
| 0.590877
| 2,701
| 16,880
| 3.581636
| 0.107738
| 0.186066
| 0.354559
| 0.455861
| 0.751292
| 0.419372
| 0.100682
| 0.005789
| 0
| 0
| 0
| 0.273916
| 0.08904
| 16,880
| 302
| 60
| 55.89404
| 0.355206
| 0
| 0
| 0
| 0
| 0
| 0.661513
| 0.008708
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
152c767549bda8fbad59485db85fd7c95d67df00
| 24
|
py
|
Python
|
python/testData/resolve/multiFile/modulePackageConflict/validator/__init__.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/resolve/multiFile/modulePackageConflict/validator/__init__.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/resolve/multiFile/modulePackageConflict/validator/__init__.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
from validator import *
| 12
| 23
| 0.791667
| 3
| 24
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 24
| 1
| 24
| 24
| 0.95
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
153c397dcf536b72fe0ae3950689bb899e1c9644
| 473
|
py
|
Python
|
yt/geometry/coordinates/api.py
|
Xarthisius/yt
|
321643c3abff64a6f132d98d0747f3558f7552a3
|
[
"BSD-3-Clause-Clear"
] | 360
|
2017-04-24T05:06:04.000Z
|
2022-03-31T10:47:07.000Z
|
yt/geometry/coordinates/api.py
|
Xarthisius/yt
|
321643c3abff64a6f132d98d0747f3558f7552a3
|
[
"BSD-3-Clause-Clear"
] | 2,077
|
2017-04-20T20:36:07.000Z
|
2022-03-31T16:39:43.000Z
|
yt/geometry/coordinates/api.py
|
stonnes/yt
|
aad3cfa3b4ebab7838352ab467275a27c26ff363
|
[
"BSD-3-Clause-Clear"
] | 257
|
2017-04-19T20:52:28.000Z
|
2022-03-29T12:23:52.000Z
|
from .cartesian_coordinates import CartesianCoordinateHandler
from .coordinate_handler import CoordinateHandler
from .cylindrical_coordinates import CylindricalCoordinateHandler
from .geographic_coordinates import (
GeographicCoordinateHandler,
InternalGeographicCoordinateHandler,
)
from .polar_coordinates import PolarCoordinateHandler
from .spec_cube_coordinates import SpectralCubeCoordinateHandler
from .spherical_coordinates import SphericalCoordinateHandler
| 43
| 65
| 0.894292
| 37
| 473
| 11.216216
| 0.540541
| 0.245783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.082452
| 473
| 10
| 66
| 47.3
| 0.956221
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.7
| 0
| 0.7
| 0
| 0
| 0
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
154da5cc032aeebc54243bfb8b879badd6d1c2c2
| 16
|
py
|
Python
|
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/streams/api/__init__.py
|
kaka-lin/azure-intelligent-edge-patterns
|
766833c7c25d2458cec697937be288202d1763bc
|
[
"MIT"
] | 176
|
2019-07-03T00:20:15.000Z
|
2022-03-14T07:51:22.000Z
|
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/streams/api/__init__.py
|
kaka-lin/azure-intelligent-edge-patterns
|
766833c7c25d2458cec697937be288202d1763bc
|
[
"MIT"
] | 121
|
2019-06-24T20:47:27.000Z
|
2022-03-28T02:16:18.000Z
|
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/streams/api/__init__.py
|
kaka-lin/azure-intelligent-edge-patterns
|
766833c7c25d2458cec697937be288202d1763bc
|
[
"MIT"
] | 144
|
2019-06-18T18:48:43.000Z
|
2022-03-31T12:14:46.000Z
|
"""App API.
"""
| 5.333333
| 11
| 0.375
| 2
| 16
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 16
| 2
| 12
| 8
| 0.461538
| 0.5
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
154e92703e4cf5dbe800ff401c35b962ddc12166
| 61
|
py
|
Python
|
nyuki/__init__.py
|
surycat/nyuki-legacy
|
9ab3a212f2ce34b032984c712c87eb2326bd3960
|
[
"Apache-2.0"
] | 8
|
2016-08-08T12:09:16.000Z
|
2018-08-24T02:32:06.000Z
|
nyuki/__init__.py
|
surycat/nyuki-legacy
|
9ab3a212f2ce34b032984c712c87eb2326bd3960
|
[
"Apache-2.0"
] | 16
|
2015-10-06T10:24:53.000Z
|
2018-01-23T18:35:37.000Z
|
nyuki/__init__.py
|
surycat/nyuki-legacy
|
9ab3a212f2ce34b032984c712c87eb2326bd3960
|
[
"Apache-2.0"
] | 9
|
2015-09-30T15:00:44.000Z
|
2018-04-05T21:25:48.000Z
|
from .api import Response, resource
from .nyuki import Nyuki
| 20.333333
| 35
| 0.803279
| 9
| 61
| 5.444444
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147541
| 61
| 2
| 36
| 30.5
| 0.942308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1550bb695b931ed504d568bb6186369772ba857a
| 25
|
py
|
Python
|
test/run/t269.py
|
timmartin/skulpt
|
2e3a3fbbaccc12baa29094a717ceec491a8a6750
|
[
"MIT"
] | 2,671
|
2015-01-03T08:23:25.000Z
|
2022-03-31T06:15:48.000Z
|
test/run/t269.py
|
csev/skulpt
|
9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f
|
[
"MIT"
] | 972
|
2015-01-05T08:11:00.000Z
|
2022-03-29T13:47:15.000Z
|
test/run/t269.py
|
csev/skulpt
|
9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f
|
[
"MIT"
] | 845
|
2015-01-03T19:53:36.000Z
|
2022-03-29T18:34:22.000Z
|
print ~True
print ~False
| 8.333333
| 12
| 0.76
| 4
| 25
| 4.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 25
| 2
| 13
| 12.5
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
155e8b40b73de6405a18b04308ea62c8e39589f2
| 106
|
py
|
Python
|
core/__init__.py
|
DobroAlex/laolab-nmap-test
|
d4421fea4b1e3de580b9ad6b1c5952675ca8d68f
|
[
"Unlicense"
] | null | null | null |
core/__init__.py
|
DobroAlex/laolab-nmap-test
|
d4421fea4b1e3de580b9ad6b1c5952675ca8d68f
|
[
"Unlicense"
] | null | null | null |
core/__init__.py
|
DobroAlex/laolab-nmap-test
|
d4421fea4b1e3de580b9ad6b1c5952675ca8d68f
|
[
"Unlicense"
] | null | null | null |
import core.enums
import core.config
import core.cli
import core.context
import core.utils
import core.db
| 15.142857
| 19
| 0.830189
| 18
| 106
| 4.888889
| 0.444444
| 0.681818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113208
| 106
| 6
| 20
| 17.666667
| 0.93617
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
15763a3c8c258792483ecd124f732d3556b243e2
| 35
|
py
|
Python
|
libgenerateDS/gui/generateds_gui_session.py
|
andreif/generateDS
|
995fa381b3f1079937bb0c1cb14f8167e879c33d
|
[
"MIT"
] | null | null | null |
libgenerateDS/gui/generateds_gui_session.py
|
andreif/generateDS
|
995fa381b3f1079937bb0c1cb14f8167e879c33d
|
[
"MIT"
] | null | null | null |
libgenerateDS/gui/generateds_gui_session.py
|
andreif/generateDS
|
995fa381b3f1079937bb0c1cb14f8167e879c33d
|
[
"MIT"
] | 1
|
2020-10-18T07:58:16.000Z
|
2020-10-18T07:58:16.000Z
|
../../gui/generateds_gui_session.py
| 35
| 35
| 0.771429
| 5
| 35
| 5
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 35
| 1
| 35
| 35
| 0.714286
| 0
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1580c3eb7ac5eff65aade3e78a3396659c38c233
| 341
|
py
|
Python
|
measures/dependents_based.py
|
CivicDataLab/complang
|
82f2d098074b0fcd77a39023338fe96186e46c4f
|
[
"MIT"
] | null | null | null |
measures/dependents_based.py
|
CivicDataLab/complang
|
82f2d098074b0fcd77a39023338fe96186e46c4f
|
[
"MIT"
] | 8
|
2019-10-23T18:23:19.000Z
|
2019-11-05T07:46:23.000Z
|
measures/dependents_based.py
|
CivicDataLab/complang
|
82f2d098074b0fcd77a39023338fe96186e46c4f
|
[
"MIT"
] | null | null | null |
from utils import _average_statistic
import numpy as np
def average_punctuation_per_sentence(sentence_graphs):
return _average_statistic(punctuation_per_sentence, sentence_graphs)
def punctuation_per_sentence(g):
punctuation = set(["$.", "$,", "$("])
return len([v for v, l in g.nodes(data=True) if l["pos"] in punctuation])
| 28.416667
| 77
| 0.741935
| 47
| 341
| 5.106383
| 0.553191
| 0.175
| 0.275
| 0.25
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.13783
| 341
| 11
| 78
| 31
| 0.816327
| 0
| 0
| 0
| 0
| 0
| 0.026393
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.285714
| 0.142857
| 0.857143
| 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
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ec7e56a5e2dcc372507442bd04b646631efa76d7
| 89
|
py
|
Python
|
ProteinGraphML/DataAdapter/__init__.py
|
JessBinder/ProteinGraphML
|
e5d3304b44ad103afbaecd5bb1153042fa22a68b
|
[
"BSD-2-Clause"
] | 10
|
2020-01-22T21:49:43.000Z
|
2022-03-24T13:09:52.000Z
|
ProteinGraphML/DataAdapter/__init__.py
|
JessBinder/ProteinGraphML
|
e5d3304b44ad103afbaecd5bb1153042fa22a68b
|
[
"BSD-2-Clause"
] | 2
|
2019-09-04T21:21:20.000Z
|
2021-09-07T14:55:03.000Z
|
ProteinGraphML/DataAdapter/__init__.py
|
JessBinder/ProteinGraphML
|
e5d3304b44ad103afbaecd5bb1153042fa22a68b
|
[
"BSD-2-Clause"
] | 5
|
2019-09-04T21:32:08.000Z
|
2022-02-28T13:18:18.000Z
|
#from .OlegDB import *
from .Adapter import OlegDB, TCRD
from .biodata_helper import *
| 14.833333
| 33
| 0.752809
| 12
| 89
| 5.5
| 0.583333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.891892
| 0.235955
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ec84205e96e1fbfd3aee0c7bf0e790bec527f0f2
| 77
|
py
|
Python
|
hepaccelerate/__init__.py
|
irenedutta23/hepaccelerate
|
c18fac25a0b88414836bc0a84a333f30ba02ac47
|
[
"BSD-3-Clause"
] | 6
|
2019-10-17T10:06:47.000Z
|
2020-05-05T17:55:24.000Z
|
hepaccelerate/__init__.py
|
irenedutta23/hepaccelerate
|
c18fac25a0b88414836bc0a84a333f30ba02ac47
|
[
"BSD-3-Clause"
] | 14
|
2019-09-13T17:09:51.000Z
|
2020-07-29T01:41:16.000Z
|
hepaccelerate/__init__.py
|
irenedutta23/hepaccelerate
|
c18fac25a0b88414836bc0a84a333f30ba02ac47
|
[
"BSD-3-Clause"
] | 2
|
2020-01-15T17:57:47.000Z
|
2020-07-24T02:51:22.000Z
|
from .kernels import *
from .utils import Dataset, Histogram, choose_backend
| 25.666667
| 53
| 0.805195
| 10
| 77
| 6.1
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12987
| 77
| 2
| 54
| 38.5
| 0.910448
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
eca410c50cb29864eb778b781656de1920ce4345
| 25
|
py
|
Python
|
herbie/sequence.py
|
filaretov/quothe
|
0c3cf8b7d6e73c0bcfc4724318dcf06c89d85040
|
[
"MIT"
] | null | null | null |
herbie/sequence.py
|
filaretov/quothe
|
0c3cf8b7d6e73c0bcfc4724318dcf06c89d85040
|
[
"MIT"
] | null | null | null |
herbie/sequence.py
|
filaretov/quothe
|
0c3cf8b7d6e73c0bcfc4724318dcf06c89d85040
|
[
"MIT"
] | null | null | null |
class Sequence:
pass
| 8.333333
| 15
| 0.68
| 3
| 25
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.28
| 25
| 2
| 16
| 12.5
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
ecb67ee7d09950855ddedf497f08eecf7a009631
| 126
|
py
|
Python
|
notebooks/utility/writeList.py
|
vishalbelsare/LocalGraphClustering
|
a6325350997932d548a876deb259c2387fc2c809
|
[
"MIT"
] | 106
|
2017-09-06T04:47:02.000Z
|
2022-03-30T07:43:27.000Z
|
notebooks/utility/writeList.py
|
vishalbelsare/LocalGraphClustering
|
a6325350997932d548a876deb259c2387fc2c809
|
[
"MIT"
] | 51
|
2017-09-06T02:22:09.000Z
|
2021-12-15T11:39:28.000Z
|
notebooks/utility/writeList.py
|
vishalbelsare/LocalGraphClustering
|
a6325350997932d548a876deb259c2387fc2c809
|
[
"MIT"
] | 38
|
2017-09-04T21:45:13.000Z
|
2022-01-19T09:48:25.000Z
|
def writeList(l,name):
wptr = open(name,"w")
wptr.write("%d\n" % len(l))
for i in l:
wptr.write("%d\n" % i)
wptr.close()
| 21
| 28
| 0.579365
| 25
| 126
| 2.92
| 0.6
| 0.246575
| 0.273973
| 0.30137
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 126
| 6
| 29
| 21
| 0.695238
| 0
| 0
| 0
| 0
| 0
| 0.070866
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.166667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
019d60fd84b66fd945bb39ea91d7b4a41a553b00
| 143
|
py
|
Python
|
src/python-app/__init__.py
|
roeintheglasses/homer-v2
|
ed04ec3e902af7f56de24b437c0a1b7ee5e8b966
|
[
"RSA-MD"
] | 4
|
2020-07-23T08:38:52.000Z
|
2020-10-19T09:25:56.000Z
|
src/python-app/__init__.py
|
roeintheglasses/homer-v2
|
ed04ec3e902af7f56de24b437c0a1b7ee5e8b966
|
[
"RSA-MD"
] | 4
|
2021-06-08T22:18:45.000Z
|
2022-03-12T00:46:13.000Z
|
src/python-app/__init__.py
|
roeintheglasses/homer-v2
|
ed04ec3e902af7f56de24b437c0a1b7ee5e8b966
|
[
"RSA-MD"
] | 1
|
2020-08-14T16:31:34.000Z
|
2020-08-14T16:31:34.000Z
|
from detect import cv2
from detect import playsound
from detect import urlopen
__all__ = ["cv2", "playsound", "utils", "urlopen", "capture"]
| 20.428571
| 61
| 0.734266
| 18
| 143
| 5.611111
| 0.5
| 0.29703
| 0.475248
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016393
| 0.146853
| 143
| 6
| 62
| 23.833333
| 0.811475
| 0
| 0
| 0
| 0
| 0
| 0.21831
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
019f9334c27580a8cf93a11b254a5276f9d271de
| 20
|
py
|
Python
|
vedo/version.py
|
kclamar/vedo
|
2fd8b02ba8debcabbf43f0a4decbc141854273e1
|
[
"CC0-1.0"
] | null | null | null |
vedo/version.py
|
kclamar/vedo
|
2fd8b02ba8debcabbf43f0a4decbc141854273e1
|
[
"CC0-1.0"
] | null | null | null |
vedo/version.py
|
kclamar/vedo
|
2fd8b02ba8debcabbf43f0a4decbc141854273e1
|
[
"CC0-1.0"
] | null | null | null |
_version='2021.0.4'
| 10
| 19
| 0.7
| 4
| 20
| 3.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.315789
| 0.05
| 20
| 1
| 20
| 20
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
01b1348cc3eab68bb10c450e99c4fcfddd7cf864
| 38
|
py
|
Python
|
cryptlex/__init__.py
|
cryptlex/lexfloatclient-python
|
404735f2e4a5c16cb35db794d8580ef33cc83018
|
[
"MIT"
] | 1
|
2019-02-15T11:08:51.000Z
|
2019-02-15T11:08:51.000Z
|
cryptlex/__init__.py
|
cryptlex/lexfloatclient-python
|
404735f2e4a5c16cb35db794d8580ef33cc83018
|
[
"MIT"
] | null | null | null |
cryptlex/__init__.py
|
cryptlex/lexfloatclient-python
|
404735f2e4a5c16cb35db794d8580ef33cc83018
|
[
"MIT"
] | null | null | null |
from cryptlex.lexfloatclient import *
| 19
| 37
| 0.842105
| 4
| 38
| 8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 38
| 1
| 38
| 38
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
01b877020dc2b8448e147a442ab1677a04a3a8d6
| 181
|
py
|
Python
|
string_35.py
|
Technicoryx/python_strings_inbuilt_functions
|
78892d043c6c6d65affe3bd4906ba0162c5d6604
|
[
"MIT"
] | null | null | null |
string_35.py
|
Technicoryx/python_strings_inbuilt_functions
|
78892d043c6c6d65affe3bd4906ba0162c5d6604
|
[
"MIT"
] | null | null | null |
string_35.py
|
Technicoryx/python_strings_inbuilt_functions
|
78892d043c6c6d65affe3bd4906ba0162c5d6604
|
[
"MIT"
] | null | null | null |
#Example:
grocery = 'Milk\nChicken\r\nBread\rButter'
print(grocery.splitlines())
print(grocery.splitlines(True))
grocery = 'Milk Chicken Bread Butter'
print(grocery.splitlines())
| 20.111111
| 42
| 0.767956
| 22
| 181
| 6.318182
| 0.590909
| 0.258993
| 0.47482
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.082873
| 181
| 8
| 43
| 22.625
| 0.837349
| 0.044199
| 0
| 0.4
| 0
| 0
| 0.319767
| 0.174419
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.6
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
bf03ea282672b6b7bdd2fed016950c5a7b3da7a4
| 39
|
py
|
Python
|
dopple/__init__.py
|
xchmwang/dopple
|
df41b193837d493eaa962ab8d91bbb866b7371c5
|
[
"Apache-2.0"
] | 10
|
2017-12-30T19:18:16.000Z
|
2022-03-12T20:15:49.000Z
|
dopple/__init__.py
|
xchmwang/dopple
|
df41b193837d493eaa962ab8d91bbb866b7371c5
|
[
"Apache-2.0"
] | 6
|
2018-09-01T12:32:24.000Z
|
2019-11-07T13:00:25.000Z
|
dopple/__init__.py
|
xchmwang/dopple
|
df41b193837d493eaa962ab8d91bbb866b7371c5
|
[
"Apache-2.0"
] | 13
|
2017-12-25T16:59:24.000Z
|
2022-03-28T18:57:56.000Z
|
from .dopple import main # noqa: F401
| 19.5
| 38
| 0.717949
| 6
| 39
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 0.205128
| 39
| 1
| 39
| 39
| 0.806452
| 0.25641
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bf0ab9e7c22f8bd2ed46ab56a41c23b1fcc5c329
| 5,383
|
py
|
Python
|
src/ribo_api/views/api/task.py
|
RinPham/RiBo-Core
|
8c5a00a215b42aad2f6a4167b9cb97fe11d78823
|
[
"MIT"
] | null | null | null |
src/ribo_api/views/api/task.py
|
RinPham/RiBo-Core
|
8c5a00a215b42aad2f6a4167b9cb97fe11d78823
|
[
"MIT"
] | null | null | null |
src/ribo_api/views/api/task.py
|
RinPham/RiBo-Core
|
8c5a00a215b42aad2f6a4167b9cb97fe11d78823
|
[
"MIT"
] | null | null | null |
from rest_framework import status
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet
from ribo_api.models.task import Task
from ribo_api.models.user import User
from ribo_api.serializers.task import TaskSerializer
from ribo_api.services.utils import Utils
class TaskViewSet(ViewSet):
view_set = 'task'
serializer_class = TaskSerializer
def list(self, request, *args, **kwargs):
"""
@apiVersion 1.0.0
@api {GET} /task Get list task
@apiName TaskList
@apiGroup Ribo_api Task
@apiPermission Authentication
@apiHeader {string} Authorization format: token <token_string>
@apiHeaderExample {json} Request Header Example:
{
"Authorization": "token QL7RXWUJKDIISITBDLPRUPQZAXD81XYEHZ4HPL5J"
}
@apiSuccess {object[]} task
@apiSuccessExample {json}
[
{
"id": "5aafd181e3d8ee3175f5ae84",
"title": "goi dien cho bo",
"content": "goi dien cho bo",
"user_id": "5aadf857e3d8ee10db5546ba",
"intent_id": "5aa810bfe3d8ee4f97613dfa",
"at_time": "2018-09-08T07:00:00Z",
"done": false
}
]
"""
try:
user = self.request.user
tasks = Task.objects(user_id=user.id)
serializer = self.serializer_class(tasks, many=True)
return Response(serializer.data)
except Exception as e:
Utils.log_exception(e)
raise e
def create(self, request, *args, **kwargs):
"""
@apiVersion 1.0.0
@api {POST} /task Create task
@apiName TaskCreate
@apiGroup Ribo_api Task
@apiPermission Authentication
@apiHeader {string} Authorization format: token <token_string>
@apiHeaderExample {json} Request Header Example:
{
"Authorization": "token QL7RXWUJKDIISITBDLPRUPQZAXD81XYEHZ4HPL5J"
}
@apiParam {string} title
@apiParam {string} content
@apiParam {datetime} at_time format '2018-09-08T07:00:00Z'
@apiSuccess {object} task
@apiSuccessExample {json}
{
"id": "5aafd181e3d8ee3175f5ae84",
"title": "goi dien cho bo",
"content": "goi dien cho bo",
"user_id": "5aadf857e3d8ee10db5546ba",
"intent_id": "5aa810bfe3d8ee4f97613dfa",
"at_time": "2018-09-08T07:00:00Z",
"done": false
}
"""
try:
data = request.data.copy()
data['user_id'] = request.user.id
data['intent_id'] = "5aa810bfe3d8ee4f97613dfa"
serializer = self.serializer_class(data=data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data)
except Exception as e:
Utils.log_exception(e)
raise e
def update(self, request, pk, *args, **kwargs):
"""
@apiVersion 1.0.0
@api {PUT} /task/:id_task Edit task
@apiName TaskEdit
@apiGroup Ribo_api Task
@apiPermission Authentication
@apiHeader {string} Authorization format: token <token_string>
@apiHeaderExample {json} Request Header Example:
{
"Authorization": "token QL7RXWUJKDIISITBDLPRUPQZAXD81XYEHZ4HPL5J"
}
@apiParam {string} title
@apiParam {string} content
@apiParam {datetime} at_time format '2018-09-08T07:00:00Z'
@apiParam {boolean} done
@apiSuccess {object} task
@apiSuccessExample {json}
{
"id": "5aafd181e3d8ee3175f5ae84",
"title": "goi dien cho bo",
"content": "goi dien cho bo",
"user_id": "5aadf857e3d8ee10db5546ba",
"intent_id": "5aa810bfe3d8ee4f97613dfa",
"at_time": "2018-09-08T07:00:00Z",
"done": false
}
"""
try:
data = request.data.copy()
if pk:
task = Task.objects(id = pk)[0]
serializer = self.serializer_class(task, data=data,partial=True)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data)
else:
raise Response({'msg': "Id task is required"}, status=status.HTTP_400_BAD_REQUEST)
except Exception as e:
Utils.log_exception(e)
raise e
def delete(self, request,pk, *args, **kwargs):
"""
@apiVersion 1.0.0
@api {PUT} /task/:id_task Delete task
@apiName TaskDelete
@apiGroup Ribo_api Task
@apiPermission Authentication
@apiHeader {string} Authorization format: token <token_string>
@apiHeaderExample {json} Request Header Example:
{
"Authorization": "token QL7RXWUJKDIISITBDLPRUPQZAXD81XYEHZ4HPL5J"
}
@apiSuccess 200
"""
try:
task = Task.objects(id = pk)
if len(task) == 0:
return Response("Id is wrong!", status=404)
task.delete()
return Response("Success")
except Exception as e:
Utils.log_exception(e)
raise e
| 33.02454
| 98
| 0.5705
| 512
| 5,383
| 5.90625
| 0.220703
| 0.018519
| 0.019841
| 0.02381
| 0.715608
| 0.703042
| 0.703042
| 0.703042
| 0.703042
| 0.678571
| 0
| 0.065683
| 0.332528
| 5,383
| 163
| 99
| 33.02454
| 0.775953
| 0.459038
| 0
| 0.454545
| 0
| 0
| 0.038848
| 0.010969
| 0
| 0
| 0
| 0
| 0
| 1
| 0.072727
| false
| 0
| 0.127273
| 0
| 0.345455
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bf325a240da9c9b414093a1472b0cbdc738b147d
| 149
|
py
|
Python
|
eda5/core/admin.py
|
vasjapavlovic/eda5
|
bc4b387b24239ea1dfb927657f05ddabbf707479
|
[
"BSD-3-Clause"
] | null | null | null |
eda5/core/admin.py
|
vasjapavlovic/eda5
|
bc4b387b24239ea1dfb927657f05ddabbf707479
|
[
"BSD-3-Clause"
] | null | null | null |
eda5/core/admin.py
|
vasjapavlovic/eda5
|
bc4b387b24239ea1dfb927657f05ddabbf707479
|
[
"BSD-3-Clause"
] | null | null | null |
from django.contrib import admin
from .models import ObdobjeLeto, ObdobjeMesec
admin.site.register(ObdobjeLeto)
admin.site.register(ObdobjeMesec)
| 18.625
| 45
| 0.832215
| 18
| 149
| 6.888889
| 0.555556
| 0.145161
| 0.274194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09396
| 149
| 7
| 46
| 21.285714
| 0.918519
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 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
| 5
|
173e310192199fd43c1ea2defca046e051421b41
| 113
|
py
|
Python
|
cifr/models/optimizers/adam.py
|
shi510/cifr-pytorch
|
8e9aec5e520f0c1d89e97fd60abc7d72ff1a2854
|
[
"Apache-2.0"
] | null | null | null |
cifr/models/optimizers/adam.py
|
shi510/cifr-pytorch
|
8e9aec5e520f0c1d89e97fd60abc7d72ff1a2854
|
[
"Apache-2.0"
] | null | null | null |
cifr/models/optimizers/adam.py
|
shi510/cifr-pytorch
|
8e9aec5e520f0c1d89e97fd60abc7d72ff1a2854
|
[
"Apache-2.0"
] | null | null | null |
import torch
from ..builder import OPTIMIZERS
OPTIMIZERS.register_module(name='Adam', module=torch.optim.Adam)
| 18.833333
| 64
| 0.80531
| 15
| 113
| 6
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088496
| 113
| 5
| 65
| 22.6
| 0.873786
| 0
| 0
| 0
| 0
| 0
| 0.035398
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1745a77c8f6ff5fd36058976c91a70b2418aca4d
| 111
|
py
|
Python
|
cruncher/sensors/input-controllers/base_key_map.py
|
piofthings/piwars-2019
|
ac0316f8ae3e62f685509ecb41c0562106c90279
|
[
"MIT"
] | null | null | null |
cruncher/sensors/input-controllers/base_key_map.py
|
piofthings/piwars-2019
|
ac0316f8ae3e62f685509ecb41c0562106c90279
|
[
"MIT"
] | 31
|
2019-03-05T00:52:08.000Z
|
2019-03-29T00:53:25.000Z
|
cruncher/sensors/input-controllers/base_key_map.py
|
piofthings/piwars-2019
|
ac0316f8ae3e62f685509ecb41c0562106c90279
|
[
"MIT"
] | null | null | null |
class BaseKeyMap():
"""docstring for BaseKeyMap."""
def __init__(self, arg):
self.arg = arg
| 13.875
| 35
| 0.585586
| 12
| 111
| 5.083333
| 0.666667
| 0.229508
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.27027
| 111
| 7
| 36
| 15.857143
| 0.753086
| 0.225225
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
174da1528310bc5beb7c60833f23a60cd0fe293f
| 41
|
py
|
Python
|
integrations/samples/kfserving/ad-signs/signsad/signsad/__init__.py
|
mishinma/alibi-detect
|
9cc33902ed5f278d8efbcd9f58bf6ec5496be818
|
[
"Apache-2.0"
] | null | null | null |
integrations/samples/kfserving/ad-signs/signsad/signsad/__init__.py
|
mishinma/alibi-detect
|
9cc33902ed5f278d8efbcd9f58bf6ec5496be818
|
[
"Apache-2.0"
] | null | null | null |
integrations/samples/kfserving/ad-signs/signsad/signsad/__init__.py
|
mishinma/alibi-detect
|
9cc33902ed5f278d8efbcd9f58bf6ec5496be818
|
[
"Apache-2.0"
] | null | null | null |
from .model import SignsAdversarialModel
| 20.5
| 40
| 0.878049
| 4
| 41
| 9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 41
| 1
| 41
| 41
| 0.972973
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
17689f190a397a6eb28f901ee39899d448c13cec
| 126
|
py
|
Python
|
wavenet.py
|
outofculture/talk-like-me
|
11cad990d2e85c8d32a5dd5a3762f1b2f314cb27
|
[
"MIT"
] | null | null | null |
wavenet.py
|
outofculture/talk-like-me
|
11cad990d2e85c8d32a5dd5a3762f1b2f314cb27
|
[
"MIT"
] | null | null | null |
wavenet.py
|
outofculture/talk-like-me
|
11cad990d2e85c8d32a5dd5a3762f1b2f314cb27
|
[
"MIT"
] | 1
|
2021-01-09T05:30:50.000Z
|
2021-01-09T05:30:50.000Z
|
# TODO 9 convolutions in a row, each with dialation 2x the previous
# TODO 3 stacks of those 9
# TODO softmax to finish it
| 18
| 67
| 0.738095
| 23
| 126
| 4.043478
| 0.869565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041237
| 0.230159
| 126
| 6
| 68
| 21
| 0.917526
| 0.920635
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0.166667
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
17706ef1b13b6931a7af2cbd4262459c238e3de4
| 156
|
py
|
Python
|
ReSpider/extend/notify/__init__.py
|
zaoxg/ReSpiderFramework
|
bd49ffb79867f5cd0eceb5f820498fbbf8611a60
|
[
"MIT"
] | 1
|
2022-03-27T15:03:36.000Z
|
2022-03-27T15:03:36.000Z
|
ReSpider/extend/notify/__init__.py
|
zaoxg/ReSpiderFramework
|
bd49ffb79867f5cd0eceb5f820498fbbf8611a60
|
[
"MIT"
] | null | null | null |
ReSpider/extend/notify/__init__.py
|
zaoxg/ReSpiderFramework
|
bd49ffb79867f5cd0eceb5f820498fbbf8611a60
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# @Time : 2022/2/14 13:50
# @Author : ZhaoXiangPeng
# @File : __init__.py
class Monitor:
def update(self):
pass
| 17.333333
| 28
| 0.557692
| 20
| 156
| 4.15
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106195
| 0.275641
| 156
| 8
| 29
| 19.5
| 0.628319
| 0.615385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.333333
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
bd848923490759f409e0bb6765565f255aa5af33
| 137
|
py
|
Python
|
ads_project/rest_api/urls.py
|
bornajouya/softio
|
d309fb9f67bdabc1a1d6886cb92569c53ece2172
|
[
"Unlicense"
] | null | null | null |
ads_project/rest_api/urls.py
|
bornajouya/softio
|
d309fb9f67bdabc1a1d6886cb92569c53ece2172
|
[
"Unlicense"
] | null | null | null |
ads_project/rest_api/urls.py
|
bornajouya/softio
|
d309fb9f67bdabc1a1d6886cb92569c53ece2172
|
[
"Unlicense"
] | null | null | null |
from django.urls import path
from . import views
# urlpatterns = [
# path('users/', views.UserViewSet, name='UserViewSet'),
#
#
# ]
| 15.222222
| 60
| 0.656934
| 15
| 137
| 6
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.182482
| 137
| 9
| 61
| 15.222222
| 0.803571
| 0.554745
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
bd942a21420ebec3327de46f5676a799b3692606
| 99
|
py
|
Python
|
drawBot/__init__.py
|
LettError/drawbot
|
dce9af449d429af3f10827654d8b9d3bb8bb8efe
|
[
"BSD-2-Clause"
] | 2
|
2015-09-17T01:27:02.000Z
|
2020-11-26T12:07:13.000Z
|
drawBot/__init__.py
|
LettError/drawbot
|
dce9af449d429af3f10827654d8b9d3bb8bb8efe
|
[
"BSD-2-Clause"
] | null | null | null |
drawBot/__init__.py
|
LettError/drawbot
|
dce9af449d429af3f10827654d8b9d3bb8bb8efe
|
[
"BSD-2-Clause"
] | null | null | null |
from drawBotDrawingTools import _drawBotDrawingTool
_drawBotDrawingTool._addToNamespace(globals())
| 33
| 51
| 0.89899
| 7
| 99
| 12.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.050505
| 99
| 3
| 52
| 33
| 0.914894
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bd974be77b1a413cc88c885b4331c33f2cbe6546
| 218
|
py
|
Python
|
example/cmd.py
|
jan-g/remoter
|
5dd48132ce38ba4a3806948b48dea453aac8cef5
|
[
"Apache-2.0"
] | null | null | null |
example/cmd.py
|
jan-g/remoter
|
5dd48132ce38ba4a3806948b48dea453aac8cef5
|
[
"Apache-2.0"
] | null | null | null |
example/cmd.py
|
jan-g/remoter
|
5dd48132ce38ba4a3806948b48dea453aac8cef5
|
[
"Apache-2.0"
] | null | null | null |
import remoter.cmd
import example.demo
def server():
remoter.cmd.server(example.demo.Demo)
def client():
remoter.cmd.client(example.demo.Demo, example.demo.Player)
if __name__ == '__main__':
server()
| 14.533333
| 62
| 0.706422
| 29
| 218
| 5.034483
| 0.413793
| 0.30137
| 0.205479
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155963
| 218
| 14
| 63
| 15.571429
| 0.793478
| 0
| 0
| 0
| 0
| 0
| 0.036697
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bdad3c32777ce03ce9721d090e02825fcda2f899
| 174
|
py
|
Python
|
toast_cal/admin.py
|
young1004/Toast_Cal
|
924ba4e61ff72e0507f2fee0720559aaefc2b847
|
[
"MIT"
] | null | null | null |
toast_cal/admin.py
|
young1004/Toast_Cal
|
924ba4e61ff72e0507f2fee0720559aaefc2b847
|
[
"MIT"
] | 5
|
2020-11-18T05:47:45.000Z
|
2020-11-18T05:48:16.000Z
|
toast_cal/admin.py
|
young1004/Toast_Cal
|
924ba4e61ff72e0507f2fee0720559aaefc2b847
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Calendar, Student, Professor
admin.site.register(Calendar)
admin.site.register(Student)
admin.site.register(Professor)
| 21.75
| 48
| 0.821839
| 23
| 174
| 6.217391
| 0.478261
| 0.188811
| 0.356643
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086207
| 174
| 7
| 49
| 24.857143
| 0.899371
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
bdb29c0f83caf9efd312df60048a7d9dac77cfb1
| 24,732
|
py
|
Python
|
venv/lib/python3.6/site-packages/ansible_collections/vyos/vyos/tests/unit/modules/network/vyos/test_vyos_bgp_global.py
|
usegalaxy-no/usegalaxy
|
75dad095769fe918eb39677f2c887e681a747f3a
|
[
"MIT"
] | 1
|
2020-01-22T13:11:23.000Z
|
2020-01-22T13:11:23.000Z
|
venv/lib/python3.6/site-packages/ansible_collections/vyos/vyos/tests/unit/modules/network/vyos/test_vyos_bgp_global.py
|
usegalaxy-no/usegalaxy
|
75dad095769fe918eb39677f2c887e681a747f3a
|
[
"MIT"
] | 12
|
2020-02-21T07:24:52.000Z
|
2020-04-14T09:54:32.000Z
|
venv/lib/python3.6/site-packages/ansible_collections/vyos/vyos/tests/unit/modules/network/vyos/test_vyos_bgp_global.py
|
usegalaxy-no/usegalaxy
|
75dad095769fe918eb39677f2c887e681a747f3a
|
[
"MIT"
] | null | null | null |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.vyos.vyos.tests.unit.compat.mock import patch
from ansible_collections.vyos.vyos.plugins.modules import vyos_bgp_global
from ansible_collections.vyos.vyos.tests.unit.modules.utils import (
set_module_args,
)
from .vyos_module import TestVyosModule, load_fixture
class TestVyosBgpglobalModule(TestVyosModule):
module = vyos_bgp_global
def setUp(self):
super(TestVyosBgpglobalModule, self).setUp()
self.mock_get_resource_connection_config = patch(
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.rm_base.resource_module_base.get_resource_connection"
)
self.get_resource_connection_config = (
self.mock_get_resource_connection_config.start()
)
self.mock_execute_show_command_config = patch(
"ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.config.bgp_global.bgp_global.Bgp_global._get_config"
)
self.execute_show_command_config = (
self.mock_execute_show_command_config.start()
)
self.mock_get_resource_connection_facts = patch(
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection"
)
self.get_resource_connection_facts = (
self.mock_get_resource_connection_facts.start()
)
self.mock_execute_show_command = patch(
"ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.facts.bgp_global.bgp_global.Bgp_globalFacts.get_device_data"
)
self.execute_show_command = self.mock_execute_show_command.start()
def tearDown(self):
super(TestVyosBgpglobalModule, self).tearDown()
self.mock_get_resource_connection_config.stop()
self.mock_get_resource_connection_facts.stop()
self.mock_execute_show_command.stop()
self.mock_execute_show_command_config.stop()
def load_fixtures(self, commands=None, transport="cli", filename=None):
if filename is None:
filename = "vyos_bgp_global_config.cfg"
def load_from_file(*args, **kwargs):
output = load_fixture(filename)
return output
self.execute_show_command.side_effect = load_from_file
self.execute_show_command_config.side_effect = load_from_file
def test_vyos_bgp_global_merged_idempotent(self):
set_module_args(
dict(
config=dict(
as_number="65536",
neighbor=[
dict(
address="10.0.0.4",
disable_connected_check=True,
timers=dict(holdtime=30, keepalive=10),
capability=dict(orf="receive"),
),
dict(
address="192.168.0.2",
attribute_unchanged=dict(as_path=True, med=True),
ebgp_multihop=2,
remote_as="65535",
soft_reconfiguration=True,
update_source="192.168.0.1",
),
dict(
address="2001:db8::2",
ebgp_multihop=2,
remote_as="65535",
maximum_prefix=34,
update_source="2001:db8::1",
),
],
network=[
dict(address="172.16.42.32/27", backdoor=True),
dict(address="172.16.42.251/32", route_map="map01"),
],
bgp_params=dict(
bestpath=dict(as_path="confed", compare_routerid=True),
default=dict(no_ipv4_unicast=True),
router_id="10.1.1.1",
),
redistribute=[
dict(protocol="kernel", route_map="map01"),
dict(protocol="static", metric=20),
dict(protocol="static", route_map="map01"),
],
),
state="merged",
)
)
self.execute_module(changed=False, commands=[])
def test_vyos_bgp_global_merged(self):
set_module_args(
dict(
config=dict(
as_number="65536",
maximum_paths=[
dict(path="ebgp", count=20),
dict(path="ibgp", count=45),
],
neighbor=[
dict(
address="2001:db8::2",
ebgp_multihop=2,
remote_as="65535",
maximum_prefix=34,
update_source="2001:db8::1",
distribute_list=[
dict(action="export", acl=31),
dict(action="import", acl=9),
],
)
],
bgp_params=dict(
confederation=[dict(peers=20), dict(identifier=66)],
router_id="10.1.1.1",
),
),
state="merged",
)
)
commands = [
"set protocols bgp 65536 neighbor 2001:db8::2 distribute-list export 31",
"set protocols bgp 65536 neighbor 2001:db8::2 distribute-list import 9",
"set protocols bgp 65536 parameters confederation peers 20",
"set protocols bgp 65536 parameters confederation identifier 66",
"set protocols bgp 65536 maximum-paths ebgp 20",
"set protocols bgp 65536 maximum-paths ibgp 45",
]
self.execute_module(changed=True, commands=commands)
def test_vyos_bgp_global_replaced_idempotent(self):
set_module_args(
dict(
config=dict(
as_number="65536",
neighbor=[
dict(
address="10.0.0.4",
disable_connected_check=True,
timers=dict(holdtime=30, keepalive=10),
capability=dict(orf="receive"),
),
dict(
address="192.168.0.2",
attribute_unchanged=dict(as_path=True, med=True),
ebgp_multihop=2,
remote_as="65535",
soft_reconfiguration=True,
update_source="192.168.0.1",
),
dict(
address="2001:db8::2",
ebgp_multihop=2,
remote_as="65535",
maximum_prefix=34,
update_source="2001:db8::1",
),
],
network=[
dict(address="172.16.42.32/27", backdoor=True),
dict(address="172.16.42.251/32", route_map="map01"),
],
bgp_params=dict(
bestpath=dict(as_path="confed", compare_routerid=True),
default=dict(no_ipv4_unicast=True),
router_id="10.1.1.1",
),
redistribute=[
dict(protocol="kernel", route_map="map01"),
dict(protocol="static", metric=20),
dict(protocol="static", route_map="map01"),
],
),
state="replaced",
)
)
self.execute_module(changed=False, commands=[])
#
def test_vyos_bgp_global_replaced(self):
set_module_args(
dict(
config=dict(
as_number="65536",
timers=dict(holdtime=30, keepalive=10),
neighbor=[
dict(
address="200.11.155.3",
prefix_list=[
dict(action="export", prefix_list=10),
],
allowas_in=10,
),
dict(
address="2001:db8::2",
remote_as="65535",
as_override=True,
default_originate="map01",
route_map=[
dict(action="export", route_map="map01"),
],
),
],
bgp_params=dict(
log_neighbor_changes=True,
no_client_to_client_reflection=True,
confederation=[dict(peers=20), dict(identifier=66)],
router_id="10.1.1.1",
),
),
state="replaced",
)
)
commands = [
"delete protocols bgp 65536 parameters default",
"delete protocols bgp 65536 parameters bestpath compare-routerid",
"delete protocols bgp 65536 parameters bestpath as-path confed",
"delete protocols bgp 65536 network",
"delete protocols bgp 65536 redistribute",
"delete protocols bgp 65536 neighbor 2001:db8::2 update-source 2001:db8::1",
"delete protocols bgp 65536 neighbor 2001:db8::2 maximum-prefix 34",
"delete protocols bgp 65536 neighbor 2001:db8::2 ebgp-multihop 2",
"delete protocols bgp 65536 neighbor 192.168.0.2",
"delete protocols bgp 65536 neighbor 10.0.0.4",
"set protocols bgp 65536 neighbor 200.11.155.3 prefix-list export 10",
"set protocols bgp 65536 neighbor 200.11.155.3 allowas-in number 10",
"set protocols bgp 65536 neighbor 2001:db8::2 as-override",
"set protocols bgp 65536 neighbor 2001:db8::2 route-map export map01",
"set protocols bgp 65536 parameters log-neighbor-changes",
"set protocols bgp 65536 parameters no-client-to-client-reflection",
"set protocols bgp 65536 parameters confederation peers 20",
"set protocols bgp 65536 parameters confederation identifier 66",
"set protocols bgp 65536 timers holdtime 30",
"set protocols bgp 65536 timers keepalive 10",
]
self.execute_module(changed=True, commands=commands)
#
def test_vyos_bgp_global_purged(self):
set_module_args(dict(config=dict(as_number="65536"), state="purged"))
#
commands = ["delete protocols bgp 65536"]
self.execute_module(changed=True, commands=commands)
#
def test_vyos_bgp_global_incorrect_instance(self):
set_module_args(
dict(
config=dict(
as_number="100",
timers=dict(holdtime=30, keepalive=10),
neighbor=[
dict(
address="200.11.155.3",
prefix_list=[
dict(action="export", prefix_list=10),
],
allowas_in=10,
),
dict(
address="2001:db8::2",
remote_as="65535",
as_override=True,
default_originate="map01",
route_map=[
dict(action="export", route_map="map01"),
],
),
],
bgp_params=dict(
log_neighbor_changes=True,
no_client_to_client_reflection=True,
confederation=[dict(peers=20), dict(identifier=66)],
router_id="10.1.1.1",
),
),
state="replaced",
)
)
result = self.execute_module(failed=True)
self.assertIn(
"Only one bgp instance is allowed per device", result["msg"]
)
def test_vyos_bgp_global_replaced_af(self):
set_module_args(
dict(
config=dict(
as_number="65536",
timers=dict(holdtime=30, keepalive=10),
neighbor=[
dict(
address="200.11.155.3",
prefix_list=[
dict(action="export", prefix_list=10),
],
allowas_in=10,
),
dict(
address="2001:db8::2",
remote_as="65535",
as_override=True,
default_originate="map01",
route_map=[
dict(action="export", route_map="map01"),
],
),
],
bgp_params=dict(
log_neighbor_changes=True,
no_client_to_client_reflection=True,
confederation=[dict(peers=20), dict(identifier=66)],
router_id="10.1.1.1",
),
),
state="replaced",
)
)
result = self.execute_module(
failed=True, filename="vyos_bgp_global_af_config.cfg"
)
self.assertIn(
"Use the _bgp_address_family module to delete the address_family under neighbor 5001::64, before replacing/deleting the neighbor.",
result["msg"],
)
def test_vyos_bgp_global_rendered(self):
set_module_args(
dict(
config=dict(
as_number="65536",
neighbor=[
dict(
address="10.0.0.4",
disable_connected_check=True,
timers=dict(holdtime=30, keepalive=10),
capability=dict(orf="receive"),
),
dict(
address="192.168.0.2",
attribute_unchanged=dict(as_path=True, med=True),
ebgp_multihop=2,
remote_as="65535",
soft_reconfiguration=True,
update_source="192.168.0.1",
),
dict(
address="2001:db8::2",
ebgp_multihop=2,
remote_as="65535",
maximum_prefix=34,
update_source="2001:db8::1",
),
],
network=[
dict(address="172.16.42.32/27", backdoor=True),
dict(address="172.16.42.251/32", route_map="map01"),
],
bgp_params=dict(
bestpath=dict(as_path="confed", compare_routerid=True),
default=dict(no_ipv4_unicast=True),
router_id="10.1.1.1",
),
redistribute=[
dict(protocol="kernel", route_map="map01"),
dict(protocol="static", metric=20),
dict(protocol="static", route_map="map01"),
],
),
state="rendered",
)
)
rendered_cmds = [
"set protocols bgp 65536 neighbor 10.0.0.4 disable-connected-check",
"set protocols bgp 65536 neighbor 10.0.0.4 timers holdtime 30",
"set protocols bgp 65536 neighbor 10.0.0.4 timers keepalive 10",
"set protocols bgp 65536 neighbor 10.0.0.4 capability orf prefix-list receive",
"set protocols bgp 65536 neighbor 192.168.0.2 attribute-unchanged as-path",
"set protocols bgp 65536 neighbor 192.168.0.2 attribute-unchanged med",
"set protocols bgp 65536 neighbor 192.168.0.2 attribute-unchanged next-hop",
"set protocols bgp 65536 neighbor 192.168.0.2 ebgp-multihop 2",
"set protocols bgp 65536 neighbor 192.168.0.2 remote-as 65535",
"set protocols bgp 65536 neighbor 192.168.0.2 soft-reconfiguration",
"set protocols bgp 65536 neighbor 192.168.0.2 update-source 192.168.0.1",
"set protocols bgp 65536 neighbor 2001:db8::2 ebgp-multihop 2",
"set protocols bgp 65536 neighbor 2001:db8::2 remote-as 65535",
"set protocols bgp 65536 neighbor 2001:db8::2 maximum-prefix 34",
"set protocols bgp 65536 neighbor 2001:db8::2 update-source 2001:db8::1",
"set protocols bgp 65536 redistribute kernel route-map map01",
"set protocols bgp 65536 redistribute static route-map map01",
"set protocols bgp 65536 network 172.16.42.32/27 backdoor",
"set protocols bgp 65536 network 172.16.42.251/32 route-map map01",
"set protocols bgp 65536 parameters bestpath as-path confed",
"set protocols bgp 65536 parameters bestpath compare-routerid",
"set protocols bgp 65536 parameters default no-ipv4-unicast",
"set protocols bgp 65536 parameters router-id 10.1.1.1",
]
result = self.execute_module(changed=False)
self.assertEqual(
sorted(result["rendered"]),
sorted(rendered_cmds),
result["rendered"],
)
def test_vyos_bgp_global_parsed(self):
commands = [
"set protocols bgp 65536 neighbor 10.0.0.4 disable-connected-check",
"set protocols bgp 65536 neighbor 10.0.0.4 timers holdtime 30",
"set protocols bgp 65536 neighbor 10.0.0.4 timers keepalive 10",
"set protocols bgp 65536 neighbor 10.0.0.4 capability orf prefix-list receive",
"set protocols bgp 65536 neighbor 192.168.0.2 attribute-unchanged as-path",
"set protocols bgp 65536 neighbor 192.168.0.2 attribute-unchanged med",
"set protocols bgp 65536 neighbor 192.168.0.2 attribute-unchanged next-hop",
"set protocols bgp 65536 neighbor 192.168.0.2 ebgp-multihop 2",
"set protocols bgp 65536 neighbor 192.168.0.2 remote-as 65535",
"set protocols bgp 65536 neighbor 192.168.0.2 soft-reconfiguration",
"set protocols bgp 65536 neighbor 192.168.0.2 update-source 192.168.0.1",
"set protocols bgp 65536 neighbor 2001:db8::2 ebgp-multihop 2",
"set protocols bgp 65536 neighbor 2001:db8::2 remote-as 65535",
"set protocols bgp 65536 neighbor 2001:db8::2 maximum-prefix 34",
"set protocols bgp 65536 neighbor 2001:db8::2 update-source 2001:db8::1",
"set protocols bgp 65536 redistribute kernel route-map map01",
"set protocols bgp 65536 redistribute static route-map map01",
"set protocols bgp 65536 network 172.16.42.32/27 backdoor",
"set protocols bgp 65536 network 172.16.42.251/32 route-map map01",
"set protocols bgp 65536 parameters bestpath as-path confed",
"set protocols bgp 65536 parameters bestpath compare-routerid",
"set protocols bgp 65536 parameters default no-ipv4-unicast",
"set protocols bgp 65536 parameters router-id 10.1.1.1",
]
parsed_str = "\n".join(commands)
set_module_args(dict(running_config=parsed_str, state="parsed"))
result = self.execute_module(changed=False)
parsed_list = {
"as_number": 65536,
"bgp_params": {
"bestpath": {"as_path": "confed", "compare_routerid": True},
"default": {"no_ipv4_unicast": True},
"router_id": "10.1.1.1",
},
"neighbor": [
{
"address": "10.0.0.4",
"capability": {"orf": "receive"},
"disable_connected_check": True,
"timers": {"holdtime": 30, "keepalive": 10},
},
{
"address": "192.168.0.2",
"attribute_unchanged": {
"as_path": True,
"med": True,
"next_hop": True,
},
"ebgp_multihop": 2,
"remote_as": 65535,
"update_source": "192.168.0.1",
},
{
"address": "2001:db8::2",
"ebgp_multihop": 2,
"maximum_prefix": 34,
"remote_as": 65535,
"update_source": "2001:db8::1",
},
],
"network": [
{"address": "172.16.42.32/27", "backdoor": True},
{"address": "172.16.42.251/32", "route_map": "map01"},
],
"redistribute": [
{"protocol": "kernel", "route_map": "map01"},
{"protocol": "static", "route_map": "map01"},
],
}
self.assertEqual(sorted(parsed_list), sorted(result["parsed"]))
def test_vyos_bgp_global_gathered(self):
set_module_args(dict(state="gathered"))
result = self.execute_module(changed=False)
gather_list = {
"as_number": 65536,
"bgp_params": {
"bestpath": {"as_path": "confed", "compare_routerid": True},
"default": {"no_ipv4_unicast": True},
"router_id": "10.1.1.1",
},
"neighbor": [
{
"address": "10.0.0.4",
"capability": {"orf": "receive"},
"disable_connected_check": True,
"timers": {"holdtime": 30, "keepalive": 10},
},
{
"address": "192.168.0.2",
"attribute_unchanged": {"as_path": True, "med": True},
"ebgp_multihop": 2,
"remote_as": 65535,
"soft_reconfiguration": True,
"update_source": "192.168.0.1",
},
{
"address": "2001:db8::2",
"ebgp_multihop": 2,
"maximum_prefix": 34,
"remote_as": 65535,
"update_source": "2001:db8::1",
},
],
"network": [
{"address": "172.16.42.32/27", "backdoor": True},
{"address": "172.16.42.251/32", "route_map": "map01"},
],
"redistribute": [
{"protocol": "kernel", "route_map": "map01"},
{"metric": 20, "protocol": "static"},
{"protocol": "static", "route_map": "map01"},
],
}
self.assertEqual(sorted(gather_list), sorted(result["gathered"]))
| 43.928952
| 143
| 0.485525
| 2,402
| 24,732
| 4.840133
| 0.114488
| 0.075348
| 0.106744
| 0.106657
| 0.830724
| 0.793308
| 0.732496
| 0.701531
| 0.676071
| 0.666351
| 0
| 0.101492
| 0.417152
| 24,732
| 562
| 144
| 44.007117
| 0.705029
| 0.027252
| 0
| 0.698444
| 0
| 0.009728
| 0.289066
| 0.027043
| 0
| 0
| 0
| 0
| 0.009728
| 1
| 0.027237
| false
| 0
| 0.013619
| 0
| 0.046693
| 0.001946
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
bdfc7d6c0742638389a87204f571c02e748d0519
| 261
|
py
|
Python
|
python/niveau1/1-AffichageDeTexte/5.py
|
ThomasProg/France-IOI
|
03ea502e03f686d74ecf31a17273aded7b8e8a1f
|
[
"MIT"
] | 2
|
2022-02-13T13:35:13.000Z
|
2022-03-31T21:02:11.000Z
|
python/niveau1/1-AffichageDeTexte/5.py
|
ThomasProg/France-IOI
|
03ea502e03f686d74ecf31a17273aded7b8e8a1f
|
[
"MIT"
] | null | null | null |
python/niveau1/1-AffichageDeTexte/5.py
|
ThomasProg/France-IOI
|
03ea502e03f686d74ecf31a17273aded7b8e8a1f
|
[
"MIT"
] | 1
|
2020-11-15T15:21:24.000Z
|
2020-11-15T15:21:24.000Z
|
from robot import *
deplacer(1,2)
deplacer(1,3)
deplacer(2,3)
deplacer(1,2)
deplacer(3,1)
deplacer(3,2)
deplacer(1,2)
# bouge le gros rocher
deplacer(1,3)
deplacer(2,3)
deplacer(2,1)
deplacer(3,1)
deplacer(2,3)
deplacer(1,2)
deplacer(1,3)
deplacer(2,3)
| 10.038462
| 22
| 0.697318
| 52
| 261
| 3.5
| 0.211538
| 0.346154
| 0.21978
| 0.296703
| 0.637363
| 0.637363
| 0.637363
| 0.32967
| 0.32967
| 0
| 0
| 0.131004
| 0.122605
| 261
| 25
| 23
| 10.44
| 0.663755
| 0.076628
| 0
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.0625
| 0
| 0.0625
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
da2ace390d2fd58994e98cea94a315ac3430f14c
| 124
|
py
|
Python
|
circuit_maintenance_parser/constants.py
|
pke11y/circuit-maintenance-parser
|
964e6f00b7755f85ab8ea71a9ad95fb745ce05b6
|
[
"Apache-2.0"
] | null | null | null |
circuit_maintenance_parser/constants.py
|
pke11y/circuit-maintenance-parser
|
964e6f00b7755f85ab8ea71a9ad95fb745ce05b6
|
[
"Apache-2.0"
] | null | null | null |
circuit_maintenance_parser/constants.py
|
pke11y/circuit-maintenance-parser
|
964e6f00b7755f85ab8ea71a9ad95fb745ce05b6
|
[
"Apache-2.0"
] | null | null | null |
"""Constants used in the library."""
EMAIL_HEADER_SUBJECT = "email-header-subject"
EMAIL_HEADER_DATE = "email-header-date"
| 24.8
| 45
| 0.766129
| 17
| 124
| 5.352941
| 0.529412
| 0.483516
| 0.395604
| 0.505495
| 0.516484
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 124
| 4
| 46
| 31
| 0.8125
| 0.241935
| 0
| 0
| 0
| 0
| 0.420455
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
da3d03bc87efedc0ccd19a0f2b8a7514ab7b9d66
| 371
|
py
|
Python
|
fastapi_template/v1/server/handlers/users.py
|
DevLucca/python-fastapi-template
|
1a631afb3c4c6eedd436713a1213b9eb0c9c94eb
|
[
"MIT"
] | 3
|
2021-09-18T23:59:39.000Z
|
2021-12-12T14:50:25.000Z
|
fastapi_template/v1/server/handlers/users.py
|
DevLucca/python-fastapi-template
|
1a631afb3c4c6eedd436713a1213b9eb0c9c94eb
|
[
"MIT"
] | null | null | null |
fastapi_template/v1/server/handlers/users.py
|
DevLucca/python-fastapi-template
|
1a631afb3c4c6eedd436713a1213b9eb0c9c94eb
|
[
"MIT"
] | null | null | null |
from fastapi import Security
from .base import AbstractHandler
class Handler(AbstractHandler):
@classmethod
def get(
Security
): pass
@classmethod
def list(
): pass
@classmethod
def create(
): pass
@classmethod
def update(
): pass
| 13.740741
| 34
| 0.485175
| 28
| 371
| 6.428571
| 0.535714
| 0.311111
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.460916
| 371
| 26
| 35
| 14.269231
| 0.9
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.125
| 0
| 0.4375
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
da64bcc8e5dfd237a0643067ca33482082788366
| 101
|
py
|
Python
|
backend/apps/transcription/admin.py
|
apopovidis/speechex
|
e38da51d8b3e58cbaf5965a832de4e14fa0a73db
|
[
"MIT"
] | null | null | null |
backend/apps/transcription/admin.py
|
apopovidis/speechex
|
e38da51d8b3e58cbaf5965a832de4e14fa0a73db
|
[
"MIT"
] | null | null | null |
backend/apps/transcription/admin.py
|
apopovidis/speechex
|
e38da51d8b3e58cbaf5965a832de4e14fa0a73db
|
[
"MIT"
] | null | null | null |
# backend/apps/transcription/admin.py
from django.contrib import admin
# Register your models here.
| 20.2
| 37
| 0.80198
| 14
| 101
| 5.785714
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118812
| 101
| 4
| 38
| 25.25
| 0.910112
| 0.613861
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
da8e6287a182559a43c9c76150051b122ff97204
| 37
|
py
|
Python
|
tests/__init__.py
|
M4v3r1cK87/python-qnapstats
|
9ff63a8353fa882a102d84efac1f9955de3391ed
|
[
"MIT"
] | 42
|
2017-04-28T13:35:43.000Z
|
2022-02-03T06:53:36.000Z
|
tests/__init__.py
|
M4v3r1cK87/python-qnapstats
|
9ff63a8353fa882a102d84efac1f9955de3391ed
|
[
"MIT"
] | 60
|
2017-02-12T09:09:36.000Z
|
2022-03-26T11:59:57.000Z
|
tests/__init__.py
|
M4v3r1cK87/python-qnapstats
|
9ff63a8353fa882a102d84efac1f9955de3391ed
|
[
"MIT"
] | 17
|
2017-02-12T08:12:50.000Z
|
2021-12-26T09:52:36.000Z
|
"""Functional tests for qnapstats"""
| 18.5
| 36
| 0.72973
| 4
| 37
| 6.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 37
| 1
| 37
| 37
| 0.818182
| 0.810811
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e5163d52bee5a57bb29e55cb3719e6563ed5e222
| 8,513
|
py
|
Python
|
tests/integration/scheduler/test_eval.py
|
ipmb/salt
|
699912ef9cde28040378aa53d6c7a12d8af756b1
|
[
"Apache-2.0"
] | null | null | null |
tests/integration/scheduler/test_eval.py
|
ipmb/salt
|
699912ef9cde28040378aa53d6c7a12d8af756b1
|
[
"Apache-2.0"
] | null | null | null |
tests/integration/scheduler/test_eval.py
|
ipmb/salt
|
699912ef9cde28040378aa53d6c7a12d8af756b1
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import copy
import logging
import os
import random
import time
import dateutil.parser as dateutil_parser
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
# Import Salt Testing Libs
from tests.support.mock import MagicMock, patch
from tests.support.unit import skipIf
import tests.integration as integration
# Import Salt libs
import salt.utils.schedule
from salt.modules.test import ping as ping
try:
import croniter # pylint: disable=W0611
HAS_CRONITER = True
except ImportError:
HAS_CRONITER = False
log = logging.getLogger(__name__)
ROOT_DIR = os.path.join(integration.TMP, 'schedule-unit-tests')
SOCK_DIR = os.path.join(ROOT_DIR, 'test-socks')
DEFAULT_CONFIG = salt.config.minion_config(None)
DEFAULT_CONFIG['conf_dir'] = ROOT_DIR
DEFAULT_CONFIG['root_dir'] = ROOT_DIR
DEFAULT_CONFIG['sock_dir'] = SOCK_DIR
DEFAULT_CONFIG['pki_dir'] = os.path.join(ROOT_DIR, 'pki')
DEFAULT_CONFIG['cachedir'] = os.path.join(ROOT_DIR, 'cache')
class SchedulerEvalTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the pkg module
'''
def setUp(self):
with patch('salt.utils.schedule.clean_proc_dir', MagicMock(return_value=None)):
functions = {'test.ping': ping}
self.schedule = salt.utils.schedule.Schedule(copy.deepcopy(DEFAULT_CONFIG), functions, returners={})
self.schedule.opts['loop_interval'] = 1
def test_eval(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'when': '11/29/2017 4:00pm',
}
}
}
run_time2 = int(time.mktime(dateutil_parser.parse('11/29/2017 4:00pm').timetuple()))
run_time1 = run_time2 - 1
# Add the job to the scheduler
self.schedule.opts.update(job)
# Evaluate 1 second before the run time
self.schedule.eval(now=run_time1)
ret = self.schedule.job_status('job1')
self.assertNotIn('_last_run', ret)
# Evaluate 1 second at the run time
self.schedule.eval(now=run_time2)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time2)
def test_eval_multiple_whens(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'when': [
'11/29/2017 4:00pm',
'11/29/2017 5:00pm',
]
}
}
}
run_time1 = int(time.mktime(dateutil_parser.parse('11/29/2017 4:00pm').timetuple()))
run_time2 = int(time.mktime(dateutil_parser.parse('11/29/2017 5:00pm').timetuple()))
# Add the job to the scheduler
self.schedule.opts.update(job)
# Evaluate run time1
self.schedule.eval(now=run_time1)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time1)
# Evaluate run time2
self.schedule.eval(now=run_time2)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time2)
def test_eval_loop_interval(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'when': '11/29/2017 4:00pm',
}
}
}
# 30 second loop interval
LOOP_INTERVAL = random.randint(30, 59)
self.schedule.opts['loop_interval'] = LOOP_INTERVAL
run_time2 = int(time.mktime(dateutil_parser.parse('11/29/2017 4:00pm').timetuple()))
# Add the job to the scheduler
self.schedule.opts.update(job)
# Evaluate 1 second at the run time
self.schedule.eval(now=run_time2 + LOOP_INTERVAL)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time2 + LOOP_INTERVAL)
def test_eval_multiple_whens_loop_interval(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'when': [
'11/29/2017 4:00pm',
'11/29/2017 5:00pm',
]
}
}
}
# 30 second loop interval
LOOP_INTERVAL = random.randint(30, 59)
self.schedule.opts['loop_interval'] = LOOP_INTERVAL
run_time1 = int(time.mktime(dateutil_parser.parse('11/29/2017 4:00pm').timetuple()))
run_time2 = int(time.mktime(dateutil_parser.parse('11/29/2017 5:00pm').timetuple()))
# Add the job to the scheduler
self.schedule.opts.update(job)
# Evaluate 1 second at the run time
self.schedule.eval(now=run_time1 + LOOP_INTERVAL)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time1 + LOOP_INTERVAL)
# Evaluate 1 second at the run time
self.schedule.eval(now=run_time2 + LOOP_INTERVAL)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time2 + LOOP_INTERVAL)
def test_eval_once(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'once': '2017-12-13T13:00:00',
}
}
}
run_time = int(time.mktime(dateutil_parser.parse('12/13/2017 1:00pm').timetuple()))
# Add the job to the scheduler
self.schedule.opts.update(job)
# Evaluate 1 second at the run time
self.schedule.eval(now=run_time)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time)
def test_eval_once_loop_interval(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'once': '2017-12-13T13:00:00',
}
}
}
# Randomn second loop interval
LOOP_INTERVAL = random.randint(0, 59)
self.schedule.opts['loop_interval'] = LOOP_INTERVAL
# Run the job at the right plus LOOP_INTERVAL
run_time = int(time.mktime(dateutil_parser.parse('12/13/2017 1:00:{0}pm'.format(LOOP_INTERVAL)).timetuple()))
# Add the job to the scheduler
self.schedule.opts.update(job)
# Evaluate at the run time
self.schedule.eval(now=run_time)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time)
@skipIf(not HAS_CRONITER, 'Cannot find croniter python module')
def test_eval_cron(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'cron': '0 16 29 11 *'
}
}
}
# Add the job to the scheduler
self.schedule.opts.update(job)
run_time = int(time.mktime(dateutil_parser.parse('11/29/2017 4:00pm').timetuple()))
with patch('croniter.croniter.get_next', MagicMock(return_value=run_time)):
self.schedule.eval(now=run_time)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time)
@skipIf(not HAS_CRONITER, 'Cannot find croniter python module')
def test_eval_cron_loop_interval(self):
'''
verify that scheduled job runs
'''
job = {
'schedule': {
'job1': {
'function': 'test.ping',
'cron': '0 16 29 11 *'
}
}
}
# Randomn second loop interval
LOOP_INTERVAL = random.randint(0, 59)
self.schedule.opts['loop_interval'] = LOOP_INTERVAL
# Add the job to the scheduler
self.schedule.opts.update(job)
run_time = int(time.mktime(dateutil_parser.parse('11/29/2017 4:00pm').timetuple()))
with patch('croniter.croniter.get_next', MagicMock(return_value=run_time)):
self.schedule.eval(now=run_time)
ret = self.schedule.job_status('job1')
self.assertEqual(ret['_last_run'], run_time)
| 30.956364
| 117
| 0.587102
| 1,025
| 8,513
| 4.716098
| 0.140488
| 0.089367
| 0.023169
| 0.043235
| 0.77741
| 0.753206
| 0.744932
| 0.729624
| 0.729624
| 0.7259
| 0
| 0.048529
| 0.293199
| 8,513
| 274
| 118
| 31.069343
| 0.754861
| 0.123928
| 0
| 0.573864
| 0
| 0
| 0.14507
| 0.011893
| 0
| 0
| 0
| 0
| 0.073864
| 1
| 0.051136
| false
| 0
| 0.090909
| 0
| 0.147727
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
e59e03ea5bdada318819229ba4f1d092ddb6519d
| 97
|
py
|
Python
|
cloudiscovery/provider/az/command.py
|
ecorbett135/cloud-disco
|
d047f6ef46136320f1d8939983d0040a57087dc4
|
[
"Apache-2.0"
] | null | null | null |
cloudiscovery/provider/az/command.py
|
ecorbett135/cloud-disco
|
d047f6ef46136320f1d8939983d0040a57087dc4
|
[
"Apache-2.0"
] | null | null | null |
cloudiscovery/provider/az/command.py
|
ecorbett135/cloud-disco
|
d047f6ef46136320f1d8939983d0040a57087dc4
|
[
"Apache-2.0"
] | 1
|
2022-02-22T13:37:28.000Z
|
2022-02-22T13:37:28.000Z
|
from shared.common import BaseCommand
def az_main(args) -> BaseCommand:
print(args.resource)
| 24.25
| 37
| 0.773196
| 13
| 97
| 5.692308
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134021
| 97
| 4
| 38
| 24.25
| 0.880952
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 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
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e5b360c308c6c48246e0a77ddd6472baf0ebd228
| 65
|
py
|
Python
|
captchabreaker/image_processing/operations/parameters/__init__.py
|
arthurwozniak/CaptchaBreaker
|
697daa0bc592bf3ac7b4711d821c4387b129b334
|
[
"MIT"
] | 1
|
2020-08-08T22:27:30.000Z
|
2020-08-08T22:27:30.000Z
|
captchabreaker/image_processing/operations/parameters/__init__.py
|
arthurwozniak/CaptchaBreaker
|
697daa0bc592bf3ac7b4711d821c4387b129b334
|
[
"MIT"
] | null | null | null |
captchabreaker/image_processing/operations/parameters/__init__.py
|
arthurwozniak/CaptchaBreaker
|
697daa0bc592bf3ac7b4711d821c4387b129b334
|
[
"MIT"
] | null | null | null |
from .Integer import Integer
from .KernelShape import KernelShape
| 32.5
| 36
| 0.861538
| 8
| 65
| 7
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107692
| 65
| 2
| 36
| 32.5
| 0.965517
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e5bad14c1643d33e75f8c24ceaf282faffb3d8a9
| 4,195
|
py
|
Python
|
datas/utils/tushare_datasource.py
|
pl-greenplum/trading-system-methods
|
40d0186b300f962087140542a7e87cf9df1747b6
|
[
"Apache-2.0"
] | 7
|
2021-06-26T12:19:43.000Z
|
2022-01-23T16:14:46.000Z
|
datas/utils/tushare_datasource.py
|
pl-greenplum/trading-system-methods
|
40d0186b300f962087140542a7e87cf9df1747b6
|
[
"Apache-2.0"
] | null | null | null |
datas/utils/tushare_datasource.py
|
pl-greenplum/trading-system-methods
|
40d0186b300f962087140542a7e87cf9df1747b6
|
[
"Apache-2.0"
] | 2
|
2021-03-07T16:38:32.000Z
|
2021-03-11T06:05:16.000Z
|
import tushare as ts
import pandas as pd
class Tushare_DataSource():
"""
tushare datas source
"""
TOKEN = "3d8a826d5abb159ed9682816f5138168344e56a9a873d19d75710b56"
def __init__(self):
self.ts_pro = ts.pro_api(self.TOKEN)
ts.set_token(self.TOKEN)
def get_data_csv_1d(self, stock_code, from_date, to_date):
df = ts.pro_bar(ts_code=stock_code, start_date=from_date, end_date=to_date)
df['average_price'] = round(df.amount / df.vol*10,3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount','average_price']]
df.sort_values(by='trade_date',inplace=True)
df.to_csv("../tushare/daily/" + stock_code + ".csv",index=False)
def get_data_1d(self, stock_code, from_date, to_date):
df = self.ts_pro.daily(ts_code=stock_code, start_date=from_date, end_date=to_date)
df['average_price'] = round(df.amount / df.vol*10,3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount','average_price']]
df.sort_values(by='trade_date',inplace=True)
return df
def get_data_5min(self, stock_code, from_date, to_date):
df = ts.pro_bar(ts_code=stock_code,start_date=from_date, end_date=to_date,freq='5min')
df['average_price'] = round(df.amount / df.vol,3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount', 'average_price']]
df.sort_values(by='trade_date', inplace=True)
#df.to_csv("../" + stock_code + "_5m.csv", index=False)
return df
def get_data_weekly(self,stock_code, from_date, to_date):
df = self.ts_pro.weekly(ts_code=stock_code, start_date=from_date, end_date=to_date)
df['average_price'] = round(df.amount / df.vol * 10, 3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount', 'average_price']]
df.sort_values(by='trade_date', inplace=True)
return df
def get_data_monthly(self,stock_code, from_date, to_date):
df = self.ts_pro.monthly(ts_code=stock_code, start_date=from_date, end_date=to_date)
df['average_price'] = round(df.amount / df.vol * 10, 3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount', 'average_price']]
df.sort_values(by='trade_date', inplace=True)
return df
def get_data_weekly_csv(self,stock_code, from_date, to_date):
df = self.ts_pro.weekly(ts_code=stock_code, start_date=from_date, end_date=to_date)
df['average_price'] = round(df.amount / df.vol * 10, 3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount', 'average_price']]
df.sort_values(by='trade_date', inplace=True)
return df
def get_data_monthly_csv(self,stock_code, from_date, to_date):
df = self.ts_pro.monthly(ts_code=stock_code, start_date=from_date, end_date=to_date)
df['average_price'] = round(df.amount / df.vol * 10, 3)
df['volume'] = df['vol']
df = df.loc[:, ['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount', 'average_price']]
df.sort_values(by='trade_date', inplace=True)
return df
def get_daily_data():
ts_ds = Tushare_DataSource()
#stock_codes = ['159995.SZ', '512880.SH', '512290.SH']
stock_codes = ['300059.SZ']
from_date = '20200503'
to_date = '20201207'
for stock in stock_codes:
ts_ds.get_data_csv_1d(stock, from_date=from_date,to_date=to_date)
def get_minute_data():
ts_ds = Tushare_DataSource()
stock_codes = ['159995.SZ','512880.SH','512290.SH']
for stock in stock_codes:
df1 = ts_ds.get_data_5min(stock, '20200212', '20200331')
time.sleep(60)
df2 = ts_ds.get_data_5min(stock, '20200401', '20201203')
df1 = df1.append(df2)
time.sleep(60)
df1.to_csv("../" + stock + "_5m.csv", index=False)
import time
if __name__ == "__main__":
get_daily_data()
| 42.806122
| 107
| 0.62789
| 617
| 4,195
| 3.983793
| 0.137763
| 0.05533
| 0.065094
| 0.063466
| 0.78153
| 0.765256
| 0.736778
| 0.736778
| 0.723759
| 0.722132
| 0
| 0.050614
| 0.204052
| 4,195
| 97
| 108
| 43.247423
| 0.685535
| 0.030513
| 0
| 0.565789
| 0
| 0
| 0.188828
| 0.013841
| 0
| 0
| 0
| 0
| 0
| 1
| 0.131579
| false
| 0
| 0.039474
| 0
| 0.276316
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f91576523dc48745149f233ea9ee06c27e015199
| 61
|
py
|
Python
|
gesture-gaming-python-master/tempCodeRunnerFile.py
|
kumarrahul1825/Game-controller-using-hand-gestures-and-colour-detection--main
|
0cb129d7446aefd5ee783c1e825cdc94f2ea8e5f
|
[
"Apache-2.0"
] | null | null | null |
gesture-gaming-python-master/tempCodeRunnerFile.py
|
kumarrahul1825/Game-controller-using-hand-gestures-and-colour-detection--main
|
0cb129d7446aefd5ee783c1e825cdc94f2ea8e5f
|
[
"Apache-2.0"
] | null | null | null |
gesture-gaming-python-master/tempCodeRunnerFile.py
|
kumarrahul1825/Game-controller-using-hand-gestures-and-colour-detection--main
|
0cb129d7446aefd5ee783c1e825cdc94f2ea8e5f
|
[
"Apache-2.0"
] | null | null | null |
np.array([0, 129, 100])
orangeUpper = np.array([180,255,255])
| 30.5
| 37
| 0.672131
| 11
| 61
| 3.727273
| 0.727273
| 0.341463
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 0.081967
| 61
| 2
| 37
| 30.5
| 0.446429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.