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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2299e7cf47da75cd56291fb736b22764f44b82e7
| 166
|
py
|
Python
|
sbalance/__init__.py
|
puttsk/slurm-sbalance
|
4e46e57104289237ebd649529eb152b05bd8b63c
|
[
"MIT"
] | 3
|
2019-02-18T07:13:49.000Z
|
2021-04-25T11:58:19.000Z
|
sbalance/__init__.py
|
thaisc-hpc/slurm-sbalance
|
f23c3f2c653ed254b70ec80a4d56a025c7f382ca
|
[
"MIT"
] | 2
|
2020-03-24T16:46:33.000Z
|
2020-03-31T01:33:44.000Z
|
sbalance/__init__.py
|
thaisc-hpc/slurm-sbalance
|
f23c3f2c653ed254b70ec80a4d56a025c7f382ca
|
[
"MIT"
] | 1
|
2020-01-22T07:32:00.000Z
|
2020-01-22T07:32:00.000Z
|
from .sbalance import main
from .config import __version__, __author__, __license__
name = "sbalance"
__all__ = ['__version__', '__author__', '__license__', 'main']
| 27.666667
| 62
| 0.753012
| 17
| 166
| 5.705882
| 0.588235
| 0.268041
| 0.412371
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120482
| 166
| 6
| 62
| 27.666667
| 0.664384
| 0
| 0
| 0
| 0
| 0
| 0.263473
| 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
|
22a2d205aff8289dad59cd545543502f7d11c45b
| 112
|
py
|
Python
|
skimage/viewer/canvastools/__init__.py
|
RKDSOne/scikit-image
|
baa67eafcace9cde1b94ad2d467e2f2e0468e759
|
[
"BSD-3-Clause"
] | 1
|
2020-12-27T18:42:22.000Z
|
2020-12-27T18:42:22.000Z
|
skimage/viewer/canvastools/__init__.py
|
RKDSOne/scikit-image
|
baa67eafcace9cde1b94ad2d467e2f2e0468e759
|
[
"BSD-3-Clause"
] | null | null | null |
skimage/viewer/canvastools/__init__.py
|
RKDSOne/scikit-image
|
baa67eafcace9cde1b94ad2d467e2f2e0468e759
|
[
"BSD-3-Clause"
] | 2
|
2015-12-29T17:04:26.000Z
|
2020-10-17T15:47:30.000Z
|
from linetool import LineTool, ThickLineTool
from recttool import RectangleTool
from painttool import PaintTool
| 28
| 44
| 0.875
| 13
| 112
| 7.538462
| 0.538462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116071
| 112
| 3
| 45
| 37.333333
| 0.989899
| 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
|
22c5d4eb297acc556501fc2f1cea4d08a17817b0
| 311
|
py
|
Python
|
src/endpoints.py
|
sarthakgupta072/fcApp
|
442b353f2451614b2eca3ee38a70e75e9c0d305c
|
[
"Apache-2.0"
] | null | null | null |
src/endpoints.py
|
sarthakgupta072/fcApp
|
442b353f2451614b2eca3ee38a70e75e9c0d305c
|
[
"Apache-2.0"
] | null | null | null |
src/endpoints.py
|
sarthakgupta072/fcApp
|
442b353f2451614b2eca3ee38a70e75e9c0d305c
|
[
"Apache-2.0"
] | null | null | null |
def getPeople():
""" In practice, here I would have a reference of a collection in the
database. The collection can be stored in a variable like config
of the app, and later retrieved here using current_app module of
Flask. Then on that collection we can perform a query. """
return 'Hello'
| 44.428571
| 73
| 0.720257
| 50
| 311
| 4.46
| 0.72
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228296
| 311
| 6
| 74
| 51.833333
| 0.929167
| 0.803859
| 0
| 0
| 0
| 0
| 0.121951
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 1
| 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
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
22c8e67e31f88383130be422dad0a152dc870ca7
| 16
|
py
|
Python
|
test/login.py
|
ljh105/django-object
|
25db85876bc2e32257253ca40adf9131e675d88d
|
[
"MIT"
] | null | null | null |
test/login.py
|
ljh105/django-object
|
25db85876bc2e32257253ca40adf9131e675d88d
|
[
"MIT"
] | null | null | null |
test/login.py
|
ljh105/django-object
|
25db85876bc2e32257253ca40adf9131e675d88d
|
[
"MIT"
] | null | null | null |
第一行 立项
num=100
| 5.333333
| 7
| 0.6875
| 4
| 16
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 0.25
| 16
| 2
| 8
| 8
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
22eb64cd4f77163ce6d4aa362a4b625cf967a3e0
| 182
|
py
|
Python
|
nimare/base/misc.py
|
Julio-Yanes/NiMARE
|
36bb05034041998519814b55fe402489147fdd63
|
[
"MIT"
] | null | null | null |
nimare/base/misc.py
|
Julio-Yanes/NiMARE
|
36bb05034041998519814b55fe402489147fdd63
|
[
"MIT"
] | null | null | null |
nimare/base/misc.py
|
Julio-Yanes/NiMARE
|
36bb05034041998519814b55fe402489147fdd63
|
[
"MIT"
] | null | null | null |
"""
Miscellaneous base classes.
"""
from .estimators import Estimator
class Parcellator(Estimator):
"""
Base class for meta-analytic parcellation methods.
"""
pass
| 15.166667
| 54
| 0.686813
| 18
| 182
| 6.944444
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208791
| 182
| 11
| 55
| 16.545455
| 0.868056
| 0.428571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
a3c1d3445bc9458a29dda990f9d434f218ffa249
| 17
|
py
|
Python
|
neo_autoscript/__init__.py
|
jakovsch/NEO-Autoscript
|
046f1c87595051dabd320b457aa010871eb96f02
|
[
"MIT"
] | null | null | null |
neo_autoscript/__init__.py
|
jakovsch/NEO-Autoscript
|
046f1c87595051dabd320b457aa010871eb96f02
|
[
"MIT"
] | null | null | null |
neo_autoscript/__init__.py
|
jakovsch/NEO-Autoscript
|
046f1c87595051dabd320b457aa010871eb96f02
|
[
"MIT"
] | null | null | null |
# NEO-Autoscript
| 8.5
| 16
| 0.764706
| 2
| 17
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 17
| 1
| 17
| 17
| 0.866667
| 0.823529
| 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
|
a3daffaf8e7522fcacae64b8e90c05dacd583c55
| 49
|
py
|
Python
|
app/shops/exceptions.py
|
ExiledNarwal28/glo-2005-project
|
3b5b5f9cdcfe53d1e6e702609587068c4bd3310d
|
[
"MIT"
] | null | null | null |
app/shops/exceptions.py
|
ExiledNarwal28/glo-2005-project
|
3b5b5f9cdcfe53d1e6e702609587068c4bd3310d
|
[
"MIT"
] | null | null | null |
app/shops/exceptions.py
|
ExiledNarwal28/glo-2005-project
|
3b5b5f9cdcfe53d1e6e702609587068c4bd3310d
|
[
"MIT"
] | 1
|
2020-05-21T10:07:07.000Z
|
2020-05-21T10:07:07.000Z
|
class ShopNotFoundException(Exception):
pass
| 16.333333
| 39
| 0.795918
| 4
| 49
| 9.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 49
| 2
| 40
| 24.5
| 0.928571
| 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
|
43188688def3c5170fde2991efcc940df0795a45
| 240
|
py
|
Python
|
problems/art/solutions/figlet3.py
|
lucidsoftware/lucid-programming-competition-2018
|
be22bff0f0d1b008f5729c0b6e5e2adb08925c96
|
[
"Apache-2.0"
] | 2
|
2019-03-05T22:35:47.000Z
|
2019-03-05T22:35:55.000Z
|
problems/art/solutions/figlet3.py
|
lucidsoftware/lucid-programming-competition-2018
|
be22bff0f0d1b008f5729c0b6e5e2adb08925c96
|
[
"Apache-2.0"
] | 2
|
2020-07-16T21:55:43.000Z
|
2021-05-08T12:14:05.000Z
|
problems/art/solutions/figlet3.py
|
lucidsoftware/lucid-programming-competition-2018
|
be22bff0f0d1b008f5729c0b6e5e2adb08925c96
|
[
"Apache-2.0"
] | 4
|
2019-03-08T01:42:00.000Z
|
2021-01-28T03:01:34.000Z
|
import sys
(lambda s, n, h, font : print(([font.update({input():[sys.stdin.readline()[:-1] for _ in range(h)]}) for _ in range(n)] and '\n').join(''.join([font[c][r] for c in s]) for r in range(h))))(input(), int(input()), int(input()), {})
| 120
| 229
| 0.5875
| 44
| 240
| 3.159091
| 0.477273
| 0.151079
| 0.143885
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004739
| 0.120833
| 240
| 2
| 229
| 120
| 0.654028
| 0
| 0
| 0
| 0
| 0
| 0.008299
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
4a65b6425f1991295996c8aba1108e251cecc37f
| 392
|
py
|
Python
|
wqxlib/WQXSample.py
|
FlippingBinary/wqxlib-python
|
5aa1d41384928f1faca47d5984485e2efa93174c
|
[
"MIT"
] | null | null | null |
wqxlib/WQXSample.py
|
FlippingBinary/wqxlib-python
|
5aa1d41384928f1faca47d5984485e2efa93174c
|
[
"MIT"
] | null | null | null |
wqxlib/WQXSample.py
|
FlippingBinary/wqxlib-python
|
5aa1d41384928f1faca47d5984485e2efa93174c
|
[
"MIT"
] | null | null | null |
from .wqx_v3_0 import ReferenceMethod, SampleDescription
class WQXSample(SampleDescription, ReferenceMethod):
def __init__(self):
ReferenceMethod.__init__(self)
SampleDescription.__init__(self)
def __enter__(self):
return self
def __exit__(self, exception_type, exception_value, exception_traceback):
pass # TODO: add a rule test
| 28
| 78
| 0.704082
| 40
| 392
| 6.275
| 0.625
| 0.095618
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006623
| 0.229592
| 392
| 13
| 79
| 30.153846
| 0.824503
| 0.053571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 0
| 1
| 0.333333
| false
| 0.111111
| 0.111111
| 0.111111
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 5
|
4a7e62ff710883029b65d48460504365f109519f
| 42
|
py
|
Python
|
cygraphblas/wrappertypes/ss.py
|
eriknw/cygraphblas
|
81ae37591ec38aa698d5f37716464a6c366076f9
|
[
"Apache-2.0"
] | 3
|
2020-09-03T21:47:25.000Z
|
2021-08-06T20:24:19.000Z
|
cygraphblas/wrappertypes/ss.py
|
eriknw/cygraphblas
|
81ae37591ec38aa698d5f37716464a6c366076f9
|
[
"Apache-2.0"
] | null | null | null |
cygraphblas/wrappertypes/ss.py
|
eriknw/cygraphblas
|
81ae37591ec38aa698d5f37716464a6c366076f9
|
[
"Apache-2.0"
] | 2
|
2020-09-03T21:47:52.000Z
|
2021-08-06T20:24:20.000Z
|
from cygraphblas_ss.wrappertypes import *
| 21
| 41
| 0.857143
| 5
| 42
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 42
| 1
| 42
| 42
| 0.921053
| 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
|
4a95920e1702d7a72347528167dd2cb08a0866f7
| 82
|
py
|
Python
|
backend/mmlp/middleware/__init__.py
|
magreiner/MMLP
|
23113866d8d0062c8c0e54c7fa5a0bbd0fa15f4e
|
[
"Apache-2.0"
] | null | null | null |
backend/mmlp/middleware/__init__.py
|
magreiner/MMLP
|
23113866d8d0062c8c0e54c7fa5a0bbd0fa15f4e
|
[
"Apache-2.0"
] | null | null | null |
backend/mmlp/middleware/__init__.py
|
magreiner/MMLP
|
23113866d8d0062c8c0e54c7fa5a0bbd0fa15f4e
|
[
"Apache-2.0"
] | null | null | null |
from .CustomMiddleware import CustomMiddleware
from .HandleCORS import HandleCORS
| 27.333333
| 46
| 0.878049
| 8
| 82
| 9
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 82
| 2
| 47
| 41
| 0.972973
| 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
|
4a996dcb4d6e0270c1dfad55788f56fa8b1c540c
| 9,755
|
py
|
Python
|
tests/app/dao/test_service_letter_contact_dao.py
|
alphagov-mirror/notifications-api
|
4a2e47b118c51f0ad45e87c89521f6087b1fcc2f
|
[
"MIT"
] | 51
|
2016-04-03T23:36:17.000Z
|
2022-03-21T20:04:52.000Z
|
tests/app/dao/test_service_letter_contact_dao.py
|
alphagov-mirror/notifications-api
|
4a2e47b118c51f0ad45e87c89521f6087b1fcc2f
|
[
"MIT"
] | 1,335
|
2015-12-15T14:28:50.000Z
|
2022-03-30T16:24:27.000Z
|
tests/app/dao/test_service_letter_contact_dao.py
|
alphagov-mirror/notifications-api
|
4a2e47b118c51f0ad45e87c89521f6087b1fcc2f
|
[
"MIT"
] | 30
|
2016-01-08T19:05:32.000Z
|
2021-12-20T16:37:23.000Z
|
import uuid
import pytest
from sqlalchemy.exc import SQLAlchemyError
from app.dao.service_letter_contact_dao import (
add_letter_contact_for_service,
archive_letter_contact,
dao_get_letter_contact_by_id,
dao_get_letter_contacts_by_service_id,
update_letter_contact,
)
from app.models import ServiceLetterContact
from tests.app.db import create_letter_contact, create_service, create_template
def test_dao_get_letter_contacts_by_service_id(notify_db_session):
service = create_service()
default_letter_contact = create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
second_letter_contact = create_letter_contact(service=service, contact_block='Cardiff, CA1 2DB', is_default=False)
third_letter_contact = create_letter_contact(service=service, contact_block='London, E1 8QS', is_default=False)
results = dao_get_letter_contacts_by_service_id(service_id=service.id)
assert len(results) == 3
assert default_letter_contact == results[0]
assert third_letter_contact == results[1]
assert second_letter_contact == results[2]
def test_dao_get_letter_contacts_by_service_id_does_not_return_archived_contacts(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
create_letter_contact(service=service, contact_block='Cardiff, CA1 2DB', is_default=False)
archived_contact = create_letter_contact(
service=service,
contact_block='London, E1 8QS',
is_default=False,
archived=True
)
results = dao_get_letter_contacts_by_service_id(service_id=service.id)
assert len(results) == 2
assert archived_contact not in results
def test_add_letter_contact_for_service_creates_additional_letter_contact_for_service(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
add_letter_contact_for_service(service_id=service.id, contact_block='Swansea, SN1 3CC', is_default=False)
results = dao_get_letter_contacts_by_service_id(service_id=service.id)
assert len(results) == 2
assert results[0].contact_block == 'Edinburgh, ED1 1AA'
assert results[0].is_default
assert not results[0].archived
assert results[1].contact_block == 'Swansea, SN1 3CC'
assert not results[1].is_default
assert not results[1].archived
def test_add_another_letter_contact_as_default_overrides_existing(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
add_letter_contact_for_service(service_id=service.id, contact_block='Swansea, SN1 3CC', is_default=True)
results = dao_get_letter_contacts_by_service_id(service_id=service.id)
assert len(results) == 2
assert results[0].contact_block == 'Swansea, SN1 3CC'
assert results[0].is_default
assert results[1].contact_block == 'Edinburgh, ED1 1AA'
assert not results[1].is_default
def test_add_letter_contact_does_not_override_default(notify_db_session):
service = create_service()
add_letter_contact_for_service(service_id=service.id, contact_block='Edinburgh, ED1 1AA', is_default=True)
add_letter_contact_for_service(service_id=service.id, contact_block='Swansea, SN1 3CC', is_default=False)
results = dao_get_letter_contacts_by_service_id(service_id=service.id)
assert len(results) == 2
assert results[0].contact_block == 'Edinburgh, ED1 1AA'
assert results[0].is_default
assert results[1].contact_block == 'Swansea, SN1 3CC'
assert not results[1].is_default
def test_add_letter_contact_with_no_default_is_fine(notify_db_session):
service = create_service()
letter_contact = add_letter_contact_for_service(
service_id=service.id,
contact_block='Swansea, SN1 3CC',
is_default=False
)
assert service.letter_contacts == [letter_contact]
def test_add_letter_contact_when_multiple_defaults_exist_raises_exception(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
create_letter_contact(service=service, contact_block='Aberdeen, AB12 23X')
with pytest.raises(Exception):
add_letter_contact_for_service(service_id=service.id, contact_block='Swansea, SN1 3CC', is_default=False)
def test_can_update_letter_contact(notify_db_session):
service = create_service()
letter_contact = create_letter_contact(service=service, contact_block='Aberdeen, AB12 23X')
update_letter_contact(
service_id=service.id,
letter_contact_id=letter_contact.id,
contact_block='Warwick, W14 TSR',
is_default=True
)
updated_letter_contact = ServiceLetterContact.query.get(letter_contact.id)
assert updated_letter_contact.contact_block == 'Warwick, W14 TSR'
assert updated_letter_contact.updated_at
assert updated_letter_contact.is_default
def test_update_letter_contact_as_default_overides_existing_default(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Aberdeen, AB12 23X')
second_letter_contact = create_letter_contact(service=service, contact_block='Swansea, SN1 3CC', is_default=False)
update_letter_contact(
service_id=service.id,
letter_contact_id=second_letter_contact.id,
contact_block='Warwick, W14 TSR',
is_default=True
)
results = dao_get_letter_contacts_by_service_id(service_id=service.id)
assert len(results) == 2
assert results[0].contact_block == 'Warwick, W14 TSR'
assert results[0].is_default
assert results[1].contact_block == 'Aberdeen, AB12 23X'
assert not results[1].is_default
def test_update_letter_contact_unset_default_for_only_letter_contact_is_fine(notify_db_session):
service = create_service()
only_letter_contact = create_letter_contact(service=service, contact_block='Aberdeen, AB12 23X')
update_letter_contact(
service_id=service.id,
letter_contact_id=only_letter_contact.id,
contact_block='Warwick, W14 TSR',
is_default=False
)
assert only_letter_contact.is_default is False
def test_archive_letter_contact(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Aberdeen, AB12 23X')
letter_contact = create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA', is_default=False)
archive_letter_contact(service.id, letter_contact.id)
assert letter_contact.archived
assert letter_contact.updated_at is not None
def test_archive_letter_contact_does_not_archive_a_letter_contact_for_a_different_service(
notify_db_session,
sample_service,
):
service = create_service(service_name="First service")
letter_contact = create_letter_contact(
service=sample_service,
contact_block='Edinburgh, ED1 1AA',
is_default=False)
with pytest.raises(SQLAlchemyError):
archive_letter_contact(service.id, letter_contact.id)
assert not letter_contact.archived
def test_archive_letter_contact_can_archive_a_service_default_letter_contact(notify_db_session):
service = create_service()
letter_contact = create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
archive_letter_contact(service.id, letter_contact.id)
assert letter_contact.archived is True
def test_archive_letter_contact_does_dissociates_template_defaults_before_archiving(notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block='Edinburgh, ED1 1AA')
template_default = create_letter_contact(service=service, contact_block='Aberdeen, AB12 23X', is_default=False)
associated_template_1 = create_template(service=service, template_type='letter', reply_to=template_default.id)
associated_template_2 = create_template(service=service, template_type='letter', reply_to=template_default.id)
assert associated_template_1.reply_to == template_default.id
assert associated_template_2.reply_to == template_default.id
assert template_default.archived is False
archive_letter_contact(service.id, template_default.id)
assert associated_template_1.reply_to is None
assert associated_template_2.reply_to is None
assert template_default.archived is True
def test_dao_get_letter_contact_by_id(sample_service):
letter_contact = create_letter_contact(service=sample_service, contact_block='Aberdeen, AB12 23X')
result = dao_get_letter_contact_by_id(service_id=sample_service.id, letter_contact_id=letter_contact.id)
assert result == letter_contact
def test_dao_get_letter_contact_by_id_raises_sqlalchemy_error_when_letter_contact_does_not_exist(sample_service):
with pytest.raises(SQLAlchemyError):
dao_get_letter_contact_by_id(service_id=sample_service.id, letter_contact_id=uuid.uuid4())
def test_dao_get_letter_contact_by_id_raises_sqlalchemy_error_when_letter_contact_is_archived(sample_service):
archived_contact = create_letter_contact(
service=sample_service,
contact_block='Aberdeen, AB12 23X',
archived=True)
with pytest.raises(SQLAlchemyError):
dao_get_letter_contact_by_id(service_id=sample_service.id, letter_contact_id=archived_contact.id)
def test_dao_get_letter_contact_by_id_raises_sqlalchemy_error_when_service_does_not_exist(sample_service):
letter_contact = create_letter_contact(service=sample_service, contact_block='Some address')
with pytest.raises(SQLAlchemyError):
dao_get_letter_contact_by_id(service_id=uuid.uuid4(), letter_contact_id=letter_contact.id)
| 39.176707
| 118
| 0.788929
| 1,328
| 9,755
| 5.35994
| 0.081325
| 0.200899
| 0.084293
| 0.084012
| 0.804439
| 0.7644
| 0.717336
| 0.695139
| 0.659455
| 0.62349
| 0
| 0.015775
| 0.135725
| 9,755
| 248
| 119
| 39.334677
| 0.82849
| 0
| 0
| 0.411429
| 0
| 0
| 0.073501
| 0
| 0
| 0
| 0
| 0
| 0.251429
| 1
| 0.102857
| false
| 0
| 0.034286
| 0
| 0.137143
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4ab2edb66b97c8c682623a92ec1dcf320ac21b84
| 239
|
py
|
Python
|
src/wea/shared_memory/__init__.py
|
casabre/WrappedExchangeArray.py
|
856ca456a59708122503f258e00c0baa46fe0832
|
[
"MIT"
] | null | null | null |
src/wea/shared_memory/__init__.py
|
casabre/WrappedExchangeArray.py
|
856ca456a59708122503f258e00c0baa46fe0832
|
[
"MIT"
] | 1
|
2021-05-18T20:40:19.000Z
|
2021-05-18T20:40:19.000Z
|
src/wea/shared_memory/__init__.py
|
casabre/wea.py
|
856ca456a59708122503f258e00c0baa46fe0832
|
[
"MIT"
] | null | null | null |
"""
Shared Memory Wrapped Exchange Array
"""
from .shared_exchange_array import SharedExchangeArray,\
create_shared_array, attach_shared_array
__all__ = ['SharedExchangeArray',
'create_shared_array', 'attach_shared_array']
| 26.555556
| 56
| 0.769874
| 25
| 239
| 6.8
| 0.44
| 0.258824
| 0.364706
| 0.423529
| 0.623529
| 0.623529
| 0.623529
| 0
| 0
| 0
| 0
| 0
| 0.142259
| 239
| 8
| 57
| 29.875
| 0.829268
| 0.150628
| 0
| 0
| 0
| 0
| 0.292308
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 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
|
4abb12748191f37e3d6a74eb5ff5559ce22dbbd8
| 67
|
py
|
Python
|
src/flotilla/db/__init__.py
|
pebble/flotilla
|
23d9b3aefd8312879549c50e52ea73f3e3f493be
|
[
"MIT"
] | 5
|
2016-01-01T15:50:21.000Z
|
2018-11-27T17:38:15.000Z
|
src/flotilla/db/__init__.py
|
pebble/flotilla
|
23d9b3aefd8312879549c50e52ea73f3e3f493be
|
[
"MIT"
] | 27
|
2015-12-17T07:49:56.000Z
|
2018-07-13T15:06:33.000Z
|
src/flotilla/db/__init__.py
|
pebble/flotilla
|
23d9b3aefd8312879549c50e52ea73f3e3f493be
|
[
"MIT"
] | 7
|
2015-12-01T22:04:24.000Z
|
2021-11-28T13:21:35.000Z
|
from .tables import DynamoDbTables
from .lock import DynamoDbLocks
| 22.333333
| 34
| 0.850746
| 8
| 67
| 7.125
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119403
| 67
| 2
| 35
| 33.5
| 0.966102
| 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
|
4349240c773878034c728afae7e041cc8cf5f64e
| 130
|
py
|
Python
|
ligolike/__init__.py
|
grburgess/ligolike
|
54a28a39f6b7092212ddf9f259d6e56d1747d608
|
[
"BSD-3-Clause"
] | null | null | null |
ligolike/__init__.py
|
grburgess/ligolike
|
54a28a39f6b7092212ddf9f259d6e56d1747d608
|
[
"BSD-3-Clause"
] | null | null | null |
ligolike/__init__.py
|
grburgess/ligolike
|
54a28a39f6b7092212ddf9f259d6e56d1747d608
|
[
"BSD-3-Clause"
] | null | null | null |
from .healpix_map_like import HEALPixMapLike
from .ligo_map_like import LIGOMapLike
__all__ = ['HEALPixMapLike', 'LIGOMapLike']
| 21.666667
| 44
| 0.815385
| 15
| 130
| 6.533333
| 0.6
| 0.142857
| 0.265306
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107692
| 130
| 5
| 45
| 26
| 0.844828
| 0
| 0
| 0
| 0
| 0
| 0.192308
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
435c4158e9b579d63b88d002ad51317a3ef930e2
| 80
|
py
|
Python
|
tasks/parsing/train.py
|
rasmusbergpalm/attend-copy-parse
|
4673be36db64e982ceabc1e29ff34a296917f969
|
[
"MIT"
] | 8
|
2021-05-11T12:12:23.000Z
|
2022-02-10T09:56:14.000Z
|
tasks/parsing/train.py
|
karimcossentini/attend-copy-parse
|
4acbe7bfc2be1b5c21c197a44b27143a9422b426
|
[
"MIT"
] | 3
|
2021-08-11T06:44:56.000Z
|
2022-03-14T09:16:03.000Z
|
tasks/parsing/train.py
|
rasmusbergpalm/attend-copy-parse
|
4673be36db64e982ceabc1e29ff34a296917f969
|
[
"MIT"
] | 2
|
2021-05-22T07:41:21.000Z
|
2021-05-26T12:39:02.000Z
|
import trainer
from tasks.parsing.parser import Parser
trainer.train(Parser())
| 16
| 39
| 0.8125
| 11
| 80
| 5.909091
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 80
| 4
| 40
| 20
| 0.902778
| 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
|
436048a9946b5e53a5477e991acd852d89403ae9
| 1,438
|
py
|
Python
|
CacheDBWrapper.py
|
chong601/PyStackOverflow
|
0556b7cd74e3bb0c0433aa2f26ea2c1bfe280b85
|
[
"MIT"
] | null | null | null |
CacheDBWrapper.py
|
chong601/PyStackOverflow
|
0556b7cd74e3bb0c0433aa2f26ea2c1bfe280b85
|
[
"MIT"
] | null | null | null |
CacheDBWrapper.py
|
chong601/PyStackOverflow
|
0556b7cd74e3bb0c0433aa2f26ea2c1bfe280b85
|
[
"MIT"
] | null | null | null |
from ExampleStackOverflowRest import Response, db_cache, db
def get_responses_by_page(req, page_number, size_per_page):
if db_cache.check(req):
return db_cache.get(req)
result = db.session.query(Response).paginate(page=page_number, per_page=size_per_page, error_out=False).items
db.session.remove()
db_cache.insert(req, result)
return result
def get_responses_by_year_per_page(req, year, page_number, size_per_page):
if db_cache.check(req):
return db_cache.get(req)
result = db.session.query(Response).filter_by(response_year=year).paginate(page=page_number, per_page=size_per_page,
error_out=False).items
db.session.remove()
db_cache.insert(req, result)
return result
def get_response_by_response_id(req, response_id):
if db_cache.check(req):
return db_cache.get(req)
result = db.session.query(Response).filter_by(response_id=response_id).all()
db.session.remove()
db_cache.insert(req, result)
return result
def get_response_by_year_respondent_id(req, year, respondent_id):
if db_cache.check(req):
return db_cache.get(req)
result = db.session.query(Response).filter_by(response_year=year, respondent_id=respondent_id).all()
db.session.remove()
db_cache.insert(req, result)
return result
def get_stats():
return db_cache.get_stats()
| 33.44186
| 120
| 0.700974
| 208
| 1,438
| 4.557692
| 0.163462
| 0.103376
| 0.068565
| 0.084388
| 0.772152
| 0.772152
| 0.772152
| 0.772152
| 0.772152
| 0.772152
| 0
| 0
| 0.197497
| 1,438
| 42
| 121
| 34.238095
| 0.82149
| 0
| 0
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.15625
| false
| 0
| 0.03125
| 0.03125
| 0.46875
| 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
|
4373f91da44b672698d63e450eccd3f30d84bfeb
| 79
|
py
|
Python
|
code/models/stacked_classification.py
|
ikhlo/LinkPrediction_Kaggle
|
377dd1e266111aa71866e62417827d9ef29d140b
|
[
"MIT"
] | null | null | null |
code/models/stacked_classification.py
|
ikhlo/LinkPrediction_Kaggle
|
377dd1e266111aa71866e62417827d9ef29d140b
|
[
"MIT"
] | null | null | null |
code/models/stacked_classification.py
|
ikhlo/LinkPrediction_Kaggle
|
377dd1e266111aa71866e62417827d9ef29d140b
|
[
"MIT"
] | null | null | null |
class StackModel():
def __init__(self, models:list) -> None:
pass
| 26.333333
| 45
| 0.607595
| 9
| 79
| 4.888889
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.265823
| 79
| 3
| 46
| 26.333333
| 0.758621
| 0
| 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
|
43ad2a2fd420e685447b1dc5a39efe237e51543f
| 218
|
py
|
Python
|
regparser/tree/supplement.py
|
ascott1/regulations-parser
|
1d653ec2d78c9cbfd3b0c651788e5ab14dcc76ca
|
[
"CC0-1.0"
] | 1
|
2019-12-29T17:52:32.000Z
|
2019-12-29T17:52:32.000Z
|
regparser/tree/supplement.py
|
ascott1/regulations-parser
|
1d653ec2d78c9cbfd3b0c651788e5ab14dcc76ca
|
[
"CC0-1.0"
] | null | null | null |
regparser/tree/supplement.py
|
ascott1/regulations-parser
|
1d653ec2d78c9cbfd3b0c651788e5ab14dcc76ca
|
[
"CC0-1.0"
] | null | null | null |
import re
from regparser.search import find_start
def find_supplement_start(text, supplement='I'):
"""Find the start of the supplement (e.g. Supplement I)"""
return find_start(text, 'Supplement', supplement)
| 27.25
| 62
| 0.743119
| 31
| 218
| 5.096774
| 0.516129
| 0.113924
| 0.240506
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146789
| 218
| 7
| 63
| 31.142857
| 0.849462
| 0.238532
| 0
| 0
| 0
| 0
| 0.06875
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
43b81df9dc3ab9bfd1499b2bf21db072fa236ad8
| 34
|
py
|
Python
|
settings.py
|
nathantreid/app-driver-client-python
|
6419093632d5cad5a58acf19c602831ad8383e71
|
[
"MIT"
] | 1
|
2018-04-10T00:01:55.000Z
|
2018-04-10T00:01:55.000Z
|
settings.py
|
nathantreid/app-driver-client-python
|
6419093632d5cad5a58acf19c602831ad8383e71
|
[
"MIT"
] | null | null | null |
settings.py
|
nathantreid/app-driver-client-python
|
6419093632d5cad5a58acf19c602831ad8383e71
|
[
"MIT"
] | 1
|
2018-04-10T03:24:36.000Z
|
2018-04-10T03:24:36.000Z
|
address = '127.0.0.1'
port = 9000
| 11.333333
| 21
| 0.617647
| 7
| 34
| 3
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.357143
| 0.176471
| 34
| 2
| 22
| 17
| 0.392857
| 0
| 0
| 0
| 0
| 0
| 0.264706
| 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
|
60149606a182a0e5e9aa7f912671026acba554d4
| 25
|
py
|
Python
|
python/testData/psi/ExecPy2.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/psi/ExecPy2.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/psi/ExecPy2.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
exec 'print 1' in {}, {}
| 12.5
| 24
| 0.48
| 4
| 25
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 0.24
| 25
| 1
| 25
| 25
| 0.578947
| 0
| 0
| 0
| 0
| 0
| 0.28
| 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
|
60304a0ae8bc41e52e7de7d725b262b6d6a78088
| 268
|
py
|
Python
|
ros_programs/devel/lib/python2.7/dist-packages/ros_essentials_cpp/msg/__init__.py
|
pranavs1911/Robot-Operating-System-ROS-Exercises
|
6ca557c588a141dd98eeb4daf90e685dadf70958
|
[
"MIT"
] | null | null | null |
ros_programs/devel/lib/python2.7/dist-packages/ros_essentials_cpp/msg/__init__.py
|
pranavs1911/Robot-Operating-System-ROS-Exercises
|
6ca557c588a141dd98eeb4daf90e685dadf70958
|
[
"MIT"
] | null | null | null |
ros_programs/devel/lib/python2.7/dist-packages/ros_essentials_cpp/msg/__init__.py
|
pranavs1911/Robot-Operating-System-ROS-Exercises
|
6ca557c588a141dd98eeb4daf90e685dadf70958
|
[
"MIT"
] | null | null | null |
from ._FibonacciAction import *
from ._FibonacciActionFeedback import *
from ._FibonacciActionGoal import *
from ._FibonacciActionResult import *
from ._FibonacciFeedback import *
from ._FibonacciGoal import *
from ._FibonacciResult import *
from ._IoTSensor import *
| 29.777778
| 39
| 0.820896
| 24
| 268
| 8.833333
| 0.416667
| 0.330189
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119403
| 268
| 8
| 40
| 33.5
| 0.898305
| 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
|
60779fe4786ee3a3f5a85ea9aed7cb626e41f87d
| 56
|
py
|
Python
|
fly/__init__.py
|
liusong-cn/python
|
f67933f0879021a595258e09c4cde5ca1f9f6aed
|
[
"Apache-2.0"
] | 1
|
2019-11-12T13:38:54.000Z
|
2019-11-12T13:38:54.000Z
|
fly/__init__.py
|
liusong-cn/python
|
f67933f0879021a595258e09c4cde5ca1f9f6aed
|
[
"Apache-2.0"
] | null | null | null |
fly/__init__.py
|
liusong-cn/python
|
f67933f0879021a595258e09c4cde5ca1f9f6aed
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding:utf-8 -*-
# @auther: ls
# @date: 2021/10/14
| 18.666667
| 22
| 0.535714
| 9
| 56
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.191489
| 0.160714
| 56
| 3
| 23
| 18.666667
| 0.446809
| 0.892857
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
60a664e849e60725aa7b62b7c7348b57d76356e8
| 66
|
py
|
Python
|
test/io_handler_test.py
|
YuriChayamachi/syaroho-rating
|
51a5e830365a3cc3813ada8c6b25c5d4598307fa
|
[
"MIT"
] | null | null | null |
test/io_handler_test.py
|
YuriChayamachi/syaroho-rating
|
51a5e830365a3cc3813ada8c6b25c5d4598307fa
|
[
"MIT"
] | null | null | null |
test/io_handler_test.py
|
YuriChayamachi/syaroho-rating
|
51a5e830365a3cc3813ada8c6b25c5d4598307fa
|
[
"MIT"
] | null | null | null |
from syaroho_rating.io_handler import LocalIOHandler, S3IOHandler
| 33
| 65
| 0.893939
| 8
| 66
| 7.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016393
| 0.075758
| 66
| 1
| 66
| 66
| 0.918033
| 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
|
60bad4d99603ebcffba356e1adb58938417ec072
| 170
|
py
|
Python
|
lhotse/features/kaldi/__init__.py
|
stachu86/lhotse
|
d5e78154db2d4d52f15aaadc8882f76eb5b77640
|
[
"Apache-2.0"
] | 353
|
2020-10-31T10:38:51.000Z
|
2022-03-30T05:22:52.000Z
|
lhotse/features/kaldi/__init__.py
|
stachu86/lhotse
|
d5e78154db2d4d52f15aaadc8882f76eb5b77640
|
[
"Apache-2.0"
] | 353
|
2020-10-27T23:25:12.000Z
|
2022-03-31T22:16:05.000Z
|
lhotse/features/kaldi/__init__.py
|
stachu86/lhotse
|
d5e78154db2d4d52f15aaadc8882f76eb5b77640
|
[
"Apache-2.0"
] | 66
|
2020-11-01T06:08:08.000Z
|
2022-03-29T02:03:07.000Z
|
from .extractors import KaldiFbank, KaldiFbankConfig, KaldiMfcc, KaldiMfccConfig
from .layers import Wav2FFT, Wav2LogFilterBank, Wav2LogSpec, Wav2MFCC, Wav2Spec, Wav2Win
| 56.666667
| 88
| 0.847059
| 16
| 170
| 9
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038961
| 0.094118
| 170
| 2
| 89
| 85
| 0.896104
| 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
|
60c19bff2e2f028fa56336a80779ba5904101fdc
| 120
|
py
|
Python
|
OpenGLCffi/EGL/EXT/NV/stream_reset.py
|
cydenix/OpenGLCffi
|
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
|
[
"MIT"
] | null | null | null |
OpenGLCffi/EGL/EXT/NV/stream_reset.py
|
cydenix/OpenGLCffi
|
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
|
[
"MIT"
] | null | null | null |
OpenGLCffi/EGL/EXT/NV/stream_reset.py
|
cydenix/OpenGLCffi
|
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
|
[
"MIT"
] | null | null | null |
from OpenGLCffi.EGL import params
@params(api='egl', prms=['dpy', 'stream'])
def eglResetStreamNV(dpy, stream):
pass
| 17.142857
| 42
| 0.716667
| 16
| 120
| 5.375
| 0.75
| 0.209302
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116667
| 120
| 6
| 43
| 20
| 0.811321
| 0
| 0
| 0
| 0
| 0
| 0.101695
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
60d8adc2a3184579ab76379432ec260525a21514
| 132
|
py
|
Python
|
models/__init__.py
|
redperiabras/FILIPINEU
|
833fd8d44c9d4de94d3433ca810a4a17831343ff
|
[
"MIT"
] | null | null | null |
models/__init__.py
|
redperiabras/FILIPINEU
|
833fd8d44c9d4de94d3433ca810a4a17831343ff
|
[
"MIT"
] | 1
|
2017-10-30T12:02:44.000Z
|
2017-10-30T12:02:44.000Z
|
models/__init__.py
|
redperiabras/FILIPINEU
|
833fd8d44c9d4de94d3433ca810a4a17831343ff
|
[
"MIT"
] | 1
|
2020-11-16T07:56:58.000Z
|
2020-11-16T07:56:58.000Z
|
import os
import sys
import pickle
import traceback
from models.en_fl import model as en_fl
from models.fl_en import model as fl_en
| 18.857143
| 39
| 0.833333
| 26
| 132
| 4.076923
| 0.423077
| 0.188679
| 0.245283
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 132
| 7
| 40
| 18.857143
| 0.946429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 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
|
60e9b645daa2b7908e0d4d90eb0fbfce9d3305ed
| 175
|
py
|
Python
|
10_pipeline/sagemaker_mlops/sagemaker-project-modelbuild/tests/test_pipelines.py
|
dpai/workshop
|
d4936da77dac759ba2bac95a9584fde8e86c6b2b
|
[
"Apache-2.0"
] | 2,327
|
2020-03-01T09:47:34.000Z
|
2021-11-25T12:38:42.000Z
|
10_pipeline/sagemaker_mlops/sagemaker-project-modelbuild/tests/test_pipelines.py
|
trideau/Data-Science-with-AWS-Workshop
|
7dbe7989fa99e88544da8bf262beec907c536093
|
[
"Apache-2.0"
] | 209
|
2020-03-01T17:14:12.000Z
|
2021-11-08T20:35:42.000Z
|
10_pipeline/sagemaker_mlops/sagemaker-project-modelbuild/tests/test_pipelines.py
|
trideau/Data-Science-with-AWS-Workshop
|
7dbe7989fa99e88544da8bf262beec907c536093
|
[
"Apache-2.0"
] | 686
|
2020-03-03T17:24:51.000Z
|
2021-11-25T23:39:12.000Z
|
import pytest
@pytest.mark.xfail
def test_that_you_wrote_tests():
assert False, "No tests written"
def test_pipelines_importable():
import pipelines # noqa: F401
| 15.909091
| 36
| 0.748571
| 24
| 175
| 5.208333
| 0.75
| 0.112
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02069
| 0.171429
| 175
| 10
| 37
| 17.5
| 0.841379
| 0.057143
| 0
| 0
| 0
| 0
| 0.09816
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 1
| 0.333333
| true
| 0
| 0.5
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
60f9f2ebbc7f2834ebc1d1bf9df1b6690971f5f6
| 114
|
py
|
Python
|
source_code/central_monitor/api/admin.py
|
Doctor-Venom/Cyber-Oracle
|
0cc3475416ea552704f4b1086d850fa90117ccc6
|
[
"MIT"
] | null | null | null |
source_code/central_monitor/api/admin.py
|
Doctor-Venom/Cyber-Oracle
|
0cc3475416ea552704f4b1086d850fa90117ccc6
|
[
"MIT"
] | null | null | null |
source_code/central_monitor/api/admin.py
|
Doctor-Venom/Cyber-Oracle
|
0cc3475416ea552704f4b1086d850fa90117ccc6
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import Host
admin.site.register(Host)
| 19
| 32
| 0.798246
| 17
| 114
| 5.352941
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131579
| 114
| 6
| 33
| 19
| 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
|
71691b9a64d08a5d6fbc292845d08721845ef408
| 6,928
|
py
|
Python
|
tests/test_utils_secrets_vault.py
|
arup-group/genet
|
24bfbee31da6d7951598adb29ddf17d3a08ed5e6
|
[
"MIT"
] | 22
|
2020-12-22T11:11:44.000Z
|
2022-03-07T16:25:35.000Z
|
tests/test_utils_secrets_vault.py
|
tkahng/genet
|
d5c29ed9e44408b60f55d8de889d7430debc9f04
|
[
"MIT"
] | 27
|
2020-12-22T09:45:35.000Z
|
2022-03-03T14:52:24.000Z
|
tests/test_utils_secrets_vault.py
|
tkahng/genet
|
d5c29ed9e44408b60f55d8de889d7430debc9f04
|
[
"MIT"
] | 7
|
2021-01-02T10:00:05.000Z
|
2022-01-06T03:53:43.000Z
|
from unittest import mock
import os
import boto3
import pytest
from genet.utils import secrets_vault
# pytest's expected error mechanism ('raises' context mgr) is not intuitive and I want to make it clearer
expected_error = pytest.raises
def test_gets_api_key_with_secrets_manager_string_key(mocker):
mocker.patch.object(secrets_vault, 'get_secret_as_dict', return_value={'key': 'awesome_key'})
key = secrets_vault.get_google_directions_api_key(secret_name='secret', region_name='region')
assert key == "awesome_key"
def test_gets_api_key_with_secrets_manager_string_api_key(mocker):
mocker.patch.object(secrets_vault, 'get_secret_as_dict', return_value={'api_key': 'awesome_key'})
key = secrets_vault.get_google_directions_api_key(secret_name='secret', region_name='region')
assert key == "awesome_key"
def test_gets_api_key_with_environmental_variable():
try:
os.environ["GOOGLE_DIR_API_KEY"] = "awesome_key"
key = secrets_vault.get_google_directions_api_key()
assert key == "awesome_key"
except Exception as e:
raise e
finally:
del os.environ["GOOGLE_DIR_API_KEY"]
def test_finds_text_secret_when_present_in_secrets_manager():
secrets_manager_response = {
"Name": "some-project/some-credentials",
"VersionId": "95bda51c-1451-4f48-8171-e287518d8299",
"SecretString": "{\"api_key\":\"abc123def456\"}",
"VersionStages": ["AWSCURRENT"],
"CreatedDate": 1534174155.103,
"ARN": "arn:aws:secretsmanager:eu-west-1:275257401670:secret:some-project/some-credentials-uMUd5v"
}
with mock.patch('boto3.client') as mock_client:
mock_client.return_value.get_secret_value.return_value = secrets_manager_response
secret = secrets_vault.get_secret("some-project/some-credentials", region_name='some-region')
assert secret == secrets_manager_response['SecretString']
def test_swallows_not_found_exception_when_retrieving_unknown_secret():
# ugly hack: boto3 client subclass exceptions seem to be dynamically generated, so cannot be imported, instantiated
# or mocked in the usual way, hence the following abomination, which makes a real client solely in order to access
# the 'exceptions' attribute in lieu of a simple import, create an exception of the right kind, and then copy the
# real client 'exceptions' attribute on to the mock client object
#
# see https://github.com/boto/boto3/issues/1470 and https://github.com/boto/boto3/issues/1262 for more detail
real_client = boto3.client('secretsmanager', 'eu-west-1')
not_found_exception = real_client.exceptions.ResourceNotFoundException({}, 'Boom!')
with mock.patch('boto3.client') as mock_client:
# exception handler block expects the client to have the definition of ResourceNotFoundException
mock_client.return_value.exceptions = real_client.exceptions
mock_client.return_value.get_secret_value.side_effect = not_found_exception
secret = secrets_vault.get_secret("some-project/some-credentials", region_name='some-region')
mock_client.return_value.get_secret_value.assert_called_once()
assert secret is None
def test_transforms_text_secret_to_dict():
secrets_manager_response = {
"Name": "some-project/some-credentials",
"VersionId": "95bda51c-1451-4f48-8171-e287518d8299",
"SecretString": "{\"api_key\":\"abc123def456\"}",
"VersionStages": ["AWSCURRENT"],
"CreatedDate": 1534174155.103,
"ARN": "arn:aws:secretsmanager:eu-west-1:275257401670:secret:some-project/some-credentials-uMUd5v"
}
with mock.patch('boto3.client') as mock_client:
mock_client.return_value.get_secret_value.return_value = secrets_manager_response
secret = secrets_vault.get_secret_as_dict("some-project/some-credentials", region_name='some-region')
assert secret == {'api_key': 'abc123def456'}
def test_transforms_not_found_secret_value_to_empty_dict():
real_client = boto3.client('secretsmanager', 'eu-west-1')
not_found_exception = real_client.exceptions.ResourceNotFoundException({}, 'Boom!')
with mock.patch('boto3.client') as mock_client:
# exception handler block expects the client to have the definition of ResourceNotFoundException
mock_client.return_value.exceptions = real_client.exceptions
mock_client.return_value.get_secret_value.side_effect = not_found_exception
secret_dict = secrets_vault.get_secret_as_dict("some-project/some-credentials", region_name='some-region')
mock_client.return_value.get_secret_value.assert_called_once()
assert secret_dict == {}
def test_propagates_general_exceptions_from_secrets_manager_client():
real_client = boto3.client('secretsmanager', 'eu-west-1')
internal_service_error = real_client.exceptions.InternalServiceError({}, 'Boom!')
with mock.patch('boto3.client') as mock_client:
# exception handler block expects the client to have the definition of InternalServiceError
mock_client.return_value.exceptions = real_client.exceptions
mock_client.return_value.get_secret_value.side_effect = internal_service_error
with expected_error(real_client.exceptions.InternalServiceError) as exc_info:
secrets_vault.get_secret("some-project/some-credentials", region_name='some-region')
assert exc_info.value is internal_service_error
def test_finds_binary_secret_when_present_in_secrets_manager():
secrets_manager_response = {
"Name": "some-project/some-credentials",
"VersionId": "95bda51c-1451-4f48-8171-e287518d8299",
"SecretBinary": "bm93IHRoZW4gbWFyZHkgYnVt",
"VersionStages": ["AWSCURRENT"],
"CreatedDate": 1534174155.103,
"ARN": "arn:aws:secretsmanager:eu-west-1:275257401670:secret:some-project/some-credentials-uMUd5v"
}
with mock.patch('boto3.client') as mock_client:
mock_client.return_value.get_secret_value.return_value = secrets_manager_response
secret = secrets_vault.get_secret("some-project/some-credentials", region_name='some-region')
assert secret == secrets_manager_response['SecretBinary']
def test_transforms_binary_secret_to_dict():
secrets_manager_response = {
"Name": "some-project/some-credentials",
"VersionId": "95bda51c-1451-4f48-8171-e287518d8299",
"SecretBinary": "bm93IHRoZW4gbWFyZHkgYnVt",
"VersionStages": ["AWSCURRENT"],
"CreatedDate": 1534174155.103,
"ARN": "arn:aws:secretsmanager:eu-west-1:275257401670:secret:some-project/some-credentials-uMUd5v"
}
with mock.patch('boto3.client') as mock_client:
mock_client.return_value.get_secret_value.return_value = secrets_manager_response
secret = secrets_vault.get_secret("some-project/some-credentials", region_name='some-region')
assert secret == "bm93IHRoZW4gbWFyZHkgYnVt"
| 49.485714
| 119
| 0.74668
| 869
| 6,928
| 5.66168
| 0.195627
| 0.04065
| 0.045732
| 0.079268
| 0.785163
| 0.76687
| 0.746545
| 0.746545
| 0.738008
| 0.72561
| 0
| 0.04418
| 0.150549
| 6,928
| 139
| 120
| 49.841727
| 0.791844
| 0.129042
| 0
| 0.588235
| 0
| 0.039216
| 0.267143
| 0.147933
| 0
| 0
| 0
| 0
| 0.117647
| 1
| 0.098039
| false
| 0
| 0.04902
| 0
| 0.147059
| 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
|
7186d6e0b5515001d35884a8a93a1dcbf90ff60e
| 528
|
py
|
Python
|
tensorflow/python/platform/app.py
|
aksaxena80/test
|
db0b5da485e1d1f23003ee08ed2e191451ee0319
|
[
"Apache-2.0"
] | 4
|
2021-06-11T09:43:32.000Z
|
2021-11-17T11:15:52.000Z
|
tensorflow/python/platform/app.py
|
TheRockStarDBA/tensorflow
|
db0b5da485e1d1f23003ee08ed2e191451ee0319
|
[
"Apache-2.0"
] | null | null | null |
tensorflow/python/platform/app.py
|
TheRockStarDBA/tensorflow
|
db0b5da485e1d1f23003ee08ed2e191451ee0319
|
[
"Apache-2.0"
] | 1
|
2016-01-31T22:49:48.000Z
|
2016-01-31T22:49:48.000Z
|
"""Switch between depending on pyglib.app or an OSS replacement."""
from __future__ import absolute_import
# pylint: disable=unused-import
# pylint: disable=g-import-not-at-top
# pylint: disable=wildcard-import
import tensorflow.python.platform
from . import control_imports
if control_imports.USE_OSS and control_imports.OSS_APP:
from tensorflow.python.platform.default._app import *
else:
from tensorflow.python.platform.google._app import *
# Import 'flags' into this module
from tensorflow.python.platform import flags
| 35.2
| 67
| 0.808712
| 74
| 528
| 5.608108
| 0.5
| 0.154217
| 0.231325
| 0.20241
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106061
| 528
| 14
| 68
| 37.714286
| 0.879237
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.875
| 0
| 0.875
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
718b54e9838ba69fa2e8bd23af91b28dcb51a108
| 2,084
|
py
|
Python
|
misago/users/tests/test_user_middleware.py
|
HenryChenV/iJiangNan
|
68f156d264014939f0302222e16e3125119dd3e3
|
[
"MIT"
] | 1
|
2017-07-25T03:04:36.000Z
|
2017-07-25T03:04:36.000Z
|
misago/users/tests/test_user_middleware.py
|
HenryChenV/iJiangNan
|
68f156d264014939f0302222e16e3125119dd3e3
|
[
"MIT"
] | null | null | null |
misago/users/tests/test_user_middleware.py
|
HenryChenV/iJiangNan
|
68f156d264014939f0302222e16e3125119dd3e3
|
[
"MIT"
] | null | null | null |
from django.urls import reverse
from misago.users.bans import ban_ip, ban_user
from misago.users.testutils import AuthenticatedUserTestCase
class UserMiddlewareTest(AuthenticatedUserTestCase):
def setUp(self):
super(UserMiddlewareTest, self).setUp()
self.api_link = reverse('misago:api:auth')
self.test_link = reverse('misago:index')
def test_banned_user(self):
"""middleware handles user that has been banned in meantime"""
ban_user(self.user)
response = self.client.get(self.test_link)
self.assertEqual(response.status_code, 200)
response = self.client.get(self.api_link)
self.assertEqual(response.status_code, 200)
self.assertIsNone(response.json()['id'])
def test_banned_staff(self):
"""middleware handles staff user that has been banned in meantime"""
self.user.is_staff = True
self.user.save()
ban_user(self.user)
response = self.client.get(self.test_link)
self.assertEqual(response.status_code, 200)
response = self.client.get(self.api_link)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json()['id'], self.user.pk)
def test_ip_banned_user(self):
"""middleware handles user that has been banned in meantime"""
ban_ip('127.0.0.1')
response = self.client.get(self.test_link)
self.assertEqual(response.status_code, 200)
response = self.client.get(self.api_link)
self.assertEqual(response.status_code, 200)
self.assertIsNone(response.json()['id'])
def test_ip_banned_staff(self):
"""middleware handles staff user that has been banned in meantime"""
self.user.is_staff = True
self.user.save()
ban_ip('127.0.0.1')
response = self.client.get(self.test_link)
self.assertEqual(response.status_code, 200)
response = self.client.get(self.api_link)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json()['id'], self.user.pk)
| 33.079365
| 76
| 0.671785
| 269
| 2,084
| 5.070632
| 0.185874
| 0.109971
| 0.168622
| 0.123167
| 0.78739
| 0.78739
| 0.78739
| 0.78739
| 0.78739
| 0.78739
| 0
| 0.021991
| 0.214491
| 2,084
| 62
| 77
| 33.612903
| 0.81124
| 0.114683
| 0
| 0.7
| 0
| 0
| 0.029057
| 0
| 0
| 0
| 0
| 0
| 0.3
| 1
| 0.125
| false
| 0
| 0.075
| 0
| 0.225
| 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
|
718ba99aaefc2ef2564f9a6dd3c257befbb9058c
| 177
|
py
|
Python
|
scripts/cogapp/__init__.py
|
ptrahrens/ReproBLAS
|
ae50ec6bcb4426af8f08f065c148227b8dcfe763
|
[
"BSD-3-Clause"
] | 6
|
2018-10-02T18:51:26.000Z
|
2021-03-13T02:23:24.000Z
|
scripts/cogapp/__init__.py
|
ptrahrens/ReproBLAS
|
ae50ec6bcb4426af8f08f065c148227b8dcfe763
|
[
"BSD-3-Clause"
] | 6
|
2017-08-01T22:27:28.000Z
|
2019-12-20T08:34:48.000Z
|
scripts/cogapp/__init__.py
|
ptrahrens/ReproBLAS
|
ae50ec6bcb4426af8f08f065c148227b8dcfe763
|
[
"BSD-3-Clause"
] | 8
|
2017-07-01T22:19:09.000Z
|
2022-02-01T21:02:31.000Z
|
""" Cog code generation tool.
http://nedbatchelder.com/code/cog
Copyright 2004-2015, Ned Batchelder.
"""
from __future__ import absolute_import
from .cogapp import *
| 17.7
| 40
| 0.728814
| 22
| 177
| 5.636364
| 0.772727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.054422
| 0.169492
| 177
| 9
| 41
| 19.666667
| 0.789116
| 0.548023
| 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
|
719a4350281b4fa17e49719dd458a6e7ab2904a4
| 540
|
py
|
Python
|
Flask/app/models.py
|
96486d9b/jianshu
|
b7c50b0c5bbfd09810177cf7f561e6d04da3d8c6
|
[
"Apache-2.0"
] | 3
|
2018-01-25T10:34:11.000Z
|
2018-12-27T09:04:23.000Z
|
Flask/app/models.py
|
ttcqaq/jianshu
|
b7c50b0c5bbfd09810177cf7f561e6d04da3d8c6
|
[
"Apache-2.0"
] | null | null | null |
Flask/app/models.py
|
ttcqaq/jianshu
|
b7c50b0c5bbfd09810177cf7f561e6d04da3d8c6
|
[
"Apache-2.0"
] | 1
|
2018-09-11T00:04:47.000Z
|
2018-09-11T00:04:47.000Z
|
from app import db
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(32), unique=True)
password = db.Column(db.String(32), nullable=False)
class Book(db.Model):
__tablename__ = 'books'
book_id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(32))
isbn = db.Column(db.String(32), nullable=False)
favorite = db.Column(db.String(10))
content = db.Column(db.String(200))
date = db.Column(db.String(20))
| 33.75
| 55
| 0.677778
| 81
| 540
| 4.382716
| 0.382716
| 0.202817
| 0.253521
| 0.315493
| 0.507042
| 0.507042
| 0.507042
| 0.332394
| 0.332394
| 0.332394
| 0
| 0.033408
| 0.168519
| 540
| 16
| 56
| 33.75
| 0.757238
| 0
| 0
| 0
| 0
| 0
| 0.018484
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.071429
| 0.071429
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
71ba6e565e87640997db166d05df52483602f3c9
| 75
|
py
|
Python
|
app.py
|
marinater/virtual-tab
|
b98e19b9d5b53bbfcbcf47f09f4424479534b81b
|
[
"MIT"
] | null | null | null |
app.py
|
marinater/virtual-tab
|
b98e19b9d5b53bbfcbcf47f09f4424479534b81b
|
[
"MIT"
] | 30
|
2021-04-19T19:47:09.000Z
|
2021-05-01T00:58:50.000Z
|
app.py
|
marinater/virtual-tab
|
b98e19b9d5b53bbfcbcf47f09f4424479534b81b
|
[
"MIT"
] | 1
|
2021-04-01T18:46:52.000Z
|
2021-04-01T18:46:52.000Z
|
from core.tracking import Tracking
tracking = Tracking()
tracking.start()
| 15
| 34
| 0.786667
| 9
| 75
| 6.555556
| 0.555556
| 0.813559
| 0.813559
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 75
| 4
| 35
| 18.75
| 0.893939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 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
|
71d97d0577010df6f9b5dd42358941ece872da99
| 74
|
py
|
Python
|
pm4pymdl/util/parquet_importer/__init__.py
|
dorian1000/pm4py-mdl
|
71e0c2425abb183da293a58d31e25e50137c774f
|
[
"MIT"
] | 5
|
2021-01-31T22:45:29.000Z
|
2022-02-22T14:26:06.000Z
|
pm4pymdl/util/parquet_importer/__init__.py
|
Javert899/pm4py-mdl
|
4cc875999100f3f1ad60b925a20e40cf52337757
|
[
"MIT"
] | 3
|
2021-07-07T15:32:55.000Z
|
2021-07-07T16:15:36.000Z
|
pm4pymdl/util/parquet_importer/__init__.py
|
dorian1000/pm4py-mdl
|
71e0c2425abb183da293a58d31e25e50137c774f
|
[
"MIT"
] | 9
|
2020-09-23T15:34:11.000Z
|
2022-03-17T09:15:40.000Z
|
from pm4pymdl.util.parquet_importer import versions, importer, parameters
| 37
| 73
| 0.864865
| 9
| 74
| 7
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014706
| 0.081081
| 74
| 1
| 74
| 74
| 0.911765
| 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
|
e0892a7e20a393d9d28c36080dff390ae28fdd52
| 235
|
py
|
Python
|
Sacra/__init__.py
|
thesombady/Sacra
|
166cedefba214f1091cfff9846448f0c65429137
|
[
"MIT"
] | null | null | null |
Sacra/__init__.py
|
thesombady/Sacra
|
166cedefba214f1091cfff9846448f0c65429137
|
[
"MIT"
] | 3
|
2020-07-08T16:45:01.000Z
|
2020-07-20T21:23:44.000Z
|
Sacra/__init__.py
|
thesombady/Sacra
|
166cedefba214f1091cfff9846448f0c65429137
|
[
"MIT"
] | 1
|
2020-07-15T02:05:40.000Z
|
2020-07-15T02:05:40.000Z
|
from .Renderer.Rederer import RenderError, Renderer2
from .Renderer.Materials import Pinewood, Marble, Stone
from .Renderer.Lightsource import Lightsource
from .BuildGame.BuildWorld.Build import Build
from .EditorApps import Construct
| 39.166667
| 55
| 0.846809
| 28
| 235
| 7.107143
| 0.571429
| 0.180905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004717
| 0.097872
| 235
| 5
| 56
| 47
| 0.933962
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
e09c5895ea74c2b05a05b1e754d7d4774b862b73
| 388
|
py
|
Python
|
application/init_nltk.py
|
paasovaara/data-crawler
|
6eb592f95ab545e11280f61dfde53073b25ebd3c
|
[
"MIT"
] | null | null | null |
application/init_nltk.py
|
paasovaara/data-crawler
|
6eb592f95ab545e11280f61dfde53073b25ebd3c
|
[
"MIT"
] | null | null | null |
application/init_nltk.py
|
paasovaara/data-crawler
|
6eb592f95ab545e11280f61dfde53073b25ebd3c
|
[
"MIT"
] | null | null | null |
import nltk
#https://www.analyticsvidhya.com/blog/2017/01/ultimate-guide-to-understand-implement-natural-language-processing-codes-in-python/
#http://snowball.tartarus.org/algorithms/finnish/stemmer.html
#http://snowballstem.org/
print('Importing nltk, please select appropriate packages. Consider taking all.')
print('(At least make sure SnowballStemmer is included.)')
nltk.download()
| 43.111111
| 129
| 0.801546
| 51
| 388
| 6.098039
| 0.901961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016438
| 0.059278
| 388
| 8
| 130
| 48.5
| 0.835616
| 0.546392
| 0
| 0
| 0
| 0
| 0.699422
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
e0a24805eaf21442967f2aabe32816e3faf2ab8f
| 233
|
py
|
Python
|
ffai/ai/bots/__init__.py
|
rainandwind1/ffai_2019
|
db32bdb4bbece4b14684c2571de61e1e2ba2b433
|
[
"Apache-2.0"
] | null | null | null |
ffai/ai/bots/__init__.py
|
rainandwind1/ffai_2019
|
db32bdb4bbece4b14684c2571de61e1e2ba2b433
|
[
"Apache-2.0"
] | null | null | null |
ffai/ai/bots/__init__.py
|
rainandwind1/ffai_2019
|
db32bdb4bbece4b14684c2571de61e1e2ba2b433
|
[
"Apache-2.0"
] | null | null | null |
from ffai.ai.bots.testbots.crash_bot import ChrashBot
from ffai.ai.bots.testbots.idle_bot import IdleBot
from ffai.ai.bots.testbots.manipulator_bot import ManipulatorBot
from .proc_bot import ProcBot
from .random_bot import RandomBot
| 46.6
| 64
| 0.858369
| 37
| 233
| 5.27027
| 0.459459
| 0.230769
| 0.153846
| 0.215385
| 0.338462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081545
| 233
| 5
| 65
| 46.6
| 0.911215
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e0a8f9c167e5212649dc63f6d480b7a715a711e4
| 18
|
py
|
Python
|
object_detection/Swin/det_necks/__init__.py
|
no-name-xiaosheng/PaddleViT
|
50226a3be5095b3727d3c62d2eab23ef1e9612ec
|
[
"Apache-2.0"
] | 993
|
2021-08-30T01:58:57.000Z
|
2022-03-31T14:03:07.000Z
|
object_detection/Swin/det_necks/__init__.py
|
Dongsheng-Bi/PaddleViT
|
c90a6c8dc3787e69cef3a37b9a260bd59eeff1f7
|
[
"Apache-2.0"
] | 120
|
2021-09-03T13:05:32.000Z
|
2022-03-29T02:08:22.000Z
|
object_detection/Swin/det_necks/__init__.py
|
Dongsheng-Bi/PaddleViT
|
c90a6c8dc3787e69cef3a37b9a260bd59eeff1f7
|
[
"Apache-2.0"
] | 253
|
2021-08-30T08:50:27.000Z
|
2022-03-26T09:21:08.000Z
|
from . import fpn
| 9
| 17
| 0.722222
| 3
| 18
| 4.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 18
| 1
| 18
| 18
| 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
|
e0af319af6872ce9c393e2209a57cd29968870e0
| 371
|
py
|
Python
|
examples/todo/forum_432037.py
|
rhalbersma/gravon
|
ad0b4ddefc0448d7bc6c59032089966926b25ee6
|
[
"BSL-1.0"
] | 2
|
2018-08-02T16:42:56.000Z
|
2019-08-16T07:49:39.000Z
|
examples/todo/forum_432037.py
|
rhalbersma/gravon
|
ad0b4ddefc0448d7bc6c59032089966926b25ee6
|
[
"BSL-1.0"
] | null | null | null |
examples/todo/forum_432037.py
|
rhalbersma/gravon
|
ad0b4ddefc0448d7bc6c59032089966926b25ee6
|
[
"BSL-1.0"
] | null | null | null |
# Copyright Rein Halbersma 2018-2021.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# http://forum.stratego.com/topic/357378-strategy-question-findingavoiding-bombs-at-the-end-of-games/?p=432037
print('TODO: implement first move statistics')
| 46.375
| 110
| 0.738544
| 55
| 371
| 4.909091
| 0.8
| 0.022222
| 0.066667
| 0.088889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081761
| 0.142857
| 371
| 7
| 111
| 53
| 0.767296
| 0.816712
| 0
| 0
| 0
| 0
| 0.698113
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
e0b9513bc573bd2283f0d463f8d8da77f0037059
| 3,797
|
py
|
Python
|
app/auth/forms.py
|
youralphadevelopers/RedditClone
|
14f652fd5f57bb31d6910d0d078c9765b4e3e25e
|
[
"MIT"
] | null | null | null |
app/auth/forms.py
|
youralphadevelopers/RedditClone
|
14f652fd5f57bb31d6910d0d078c9765b4e3e25e
|
[
"MIT"
] | null | null | null |
app/auth/forms.py
|
youralphadevelopers/RedditClone
|
14f652fd5f57bb31d6910d0d078c9765b4e3e25e
|
[
"MIT"
] | null | null | null |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, BooleanField
from wtforms.validators import DataRequired, Email, Length, Regexp, EqualTo, ValidationError
from app.models import User
class RegisterForm(FlaskForm):
email = StringField('Email', validators=[DataRequired(), Email(), Length(min=1, max=64)])
username = StringField('Username', validators=[DataRequired(), Length(min=1, max=64), Regexp('^[a-zA-Z][a-zA-Z0-9_]*$',flags=0, message="Username can only contain alphanumerical characters")])
password = PasswordField('Password', validators=[DataRequired(), Length(min=8, max=20), EqualTo('confirm_password', message="Passwords must match")])
confirm_password = PasswordField('Confirm Password', validators=[DataRequired()])
submit = SubmitField('Register')
def validate_email(self, field):
if User.query.filter_by(email=field.data.lower()).first():
raise ValidationError('Email already exists')
def validate_username(self, field):
if User.query.filter_by(username=field.data).first():
raise ValidationError('Username already exists')
class LoginForm(FlaskForm):
email = StringField('Email', validators=[DataRequired(), Email(), Length(min=1, max=64)])
password = PasswordField('Password', validators=[DataRequired()])
remember_me = BooleanField('Remember me')
submit = SubmitField('Login')
def validate_email(self, field):
if not User.query.filter_by(email=field.data.lower()).first():
raise ValidationError('Email does not exist')
class ChangePasswordForm(FlaskForm):
password = PasswordField('Old password', validators=[DataRequired()])
new_password = PasswordField('New password', validators=[DataRequired(), Length(min=8, max=20), EqualTo('confirm_new_password', message='Passwords must match')])
confirm_new_password = PasswordField('Confirm new password', validators=[DataRequired()])
submit = SubmitField('Change password')
class ChangeUsernameForm(FlaskForm):
new_username = StringField('Username', validators=[DataRequired(), Length(min=1, max=64), Regexp('^[a-zA-Z][a-zA-Z0-9_]*$', flags=0, message='Username can only contain alphanumerical characters')])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Change username')
def validate_new_username(self, field):
if User.query.filter_by(username=field.data).first():
raise ValidationError('Username already exists')
class RequestForgotPasswordForm(FlaskForm):
email = StringField('Email', validators=[DataRequired(), Length(min=1, max=64), Email()])
submit = SubmitField('Send link')
def validate_email(self, field):
if not User.query.filter_by(email=field.data.lower()).first():
raise ValidationError('Email does not exist')
class ConfirmForgotPasswordForm(FlaskForm):
password = PasswordField('Password', validators=[DataRequired(), Length(min=8, max=20), EqualTo('confirm_password', message='Passwords must match')])
confirm_password = PasswordField('Confirm password', validators=[DataRequired()])
submit = SubmitField('Change password')
class RequestChangeEmailForm(FlaskForm):
new_email = StringField('New email', validators=[DataRequired(), Email(), Length(min=1, max=64)])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Change email')
def validate_new_email(self, field):
if User.query.filter_by(email=field.data.lower()).first():
raise ValidationError('Email already exists')
| 56.671642
| 207
| 0.690545
| 402
| 3,797
| 6.450249
| 0.199005
| 0.13575
| 0.115696
| 0.030081
| 0.749711
| 0.749711
| 0.718473
| 0.704204
| 0.653683
| 0.653683
| 0
| 0.01055
| 0.176192
| 3,797
| 66
| 208
| 57.530303
| 0.818414
| 0
| 0
| 0.415094
| 0
| 0
| 0.166447
| 0.012115
| 0
| 0
| 0
| 0
| 0
| 1
| 0.113208
| false
| 0.301887
| 0.075472
| 0
| 0.773585
| 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
|
1cda06775d72e806cc3752200cc28d2813a1ce68
| 1,732
|
py
|
Python
|
elastalert/alerter/__init__.py
|
JasperJuergensen/elastalert
|
8033361083b5edad1845ad9b307b8280ef278da7
|
[
"Apache-2.0"
] | 2
|
2020-06-19T13:02:19.000Z
|
2021-02-11T19:35:46.000Z
|
elastalert/alerter/__init__.py
|
JasperJuergensen/elastalert
|
8033361083b5edad1845ad9b307b8280ef278da7
|
[
"Apache-2.0"
] | 9
|
2020-04-09T15:40:37.000Z
|
2022-01-19T17:49:22.000Z
|
elastalert/alerter/__init__.py
|
JasperJuergensen/elastalert
|
8033361083b5edad1845ad9b307b8280ef278da7
|
[
"Apache-2.0"
] | null | null | null |
# flake8: noqa
from elastalert.alerter.alerter import Alerter
from elastalert.alerter.alerta_alerter import AlertaAlerter
from elastalert.alerter.command_alerter import CommandAlerter
from elastalert.alerter.debug_alerter import DebugAlerter
from elastalert.alerter.email_alerter import EmailAlerter
from elastalert.alerter.exotel_alerter import ExotelAlerter
from elastalert.alerter.gitter_alerter import GitterAlerter
from elastalert.alerter.google_chat_alerter import GoogleChatAlerter
from elastalert.alerter.hipchat_alerter import HipChatAlerter
from elastalert.alerter.hive_alerter import HiveAlerter
from elastalert.alerter.http_post_alerter import HTTPPostAlerter
from elastalert.alerter.jira_alerter import JiraAlerter
from elastalert.alerter.line_notify_alerter import LineNotifyAlerter
from elastalert.alerter.mattermost_alerter import MattermostAlerter
from elastalert.alerter.ms_teams_alerter import MsTeamsAlerter
from elastalert.alerter.opsgenie_alerter import OpsGenieAlerter
from elastalert.alerter.pager_duty_alerter import PagerDutyAlerter
from elastalert.alerter.pager_tree_alerter import PagerTreeAlerter
from elastalert.alerter.service_now_alerter import ServiceNowAlerter
from elastalert.alerter.slack_alerter import SlackAlerter
from elastalert.alerter.sns_alerter import SnsAlerter
from elastalert.alerter.stomp_alerter import StompAlerter
from elastalert.alerter.stride_alerter import StrideAlerter
from elastalert.alerter.telegram_alerter import TelegramAlerter
from elastalert.alerter.twilio_alerter import TwilioAlerter
from elastalert.alerter.victor_ops_alerter import VictorOpsAlerter
from elastalert.alerter.zabbix_alerter import ZabbixAlerter
from elastalert.alerter.test_alerter import TestAlerter
| 57.733333
| 68
| 0.900115
| 205
| 1,732
| 7.434146
| 0.326829
| 0.257218
| 0.385827
| 0.034121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.000618
| 0.066397
| 1,732
| 29
| 69
| 59.724138
| 0.941868
| 0.006928
| 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
|
e81d4868e69905cfe3ca38ae33d713aa16cc27e9
| 66
|
py
|
Python
|
binary_reader/__init__.py
|
SutandoTsukai181/PyBinaryReader
|
0607f950f17c6e75b437cf0658acaf247592ea18
|
[
"MIT"
] | 5
|
2021-04-20T12:57:56.000Z
|
2021-07-08T01:48:22.000Z
|
binary_reader/__init__.py
|
SutandoTsukai181/PyBinaryReader
|
0607f950f17c6e75b437cf0658acaf247592ea18
|
[
"MIT"
] | 1
|
2021-04-20T16:30:15.000Z
|
2021-04-20T16:30:15.000Z
|
binary_reader/__init__.py
|
SutandoTsukai181/PyBinaryReader
|
0607f950f17c6e75b437cf0658acaf247592ea18
|
[
"MIT"
] | 2
|
2021-04-20T14:40:49.000Z
|
2021-07-08T01:48:25.000Z
|
from .binary_reader import BinaryReader, BrStruct, Endian, Whence
| 33
| 65
| 0.833333
| 8
| 66
| 6.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106061
| 66
| 1
| 66
| 66
| 0.915254
| 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
|
e82329a1cd0a0ac38770d593bc12a4096cfe4db1
| 64
|
py
|
Python
|
tests/model_tests/app/signals.py
|
if1live/importd
|
4b1dd2cc43923f44f2c509a3e4a0568fa3d4f9b2
|
[
"BSD-3-Clause"
] | 183
|
2015-01-14T02:15:54.000Z
|
2021-04-02T01:31:08.000Z
|
tests/model_tests/app/signals.py
|
if1live/importd
|
4b1dd2cc43923f44f2c509a3e4a0568fa3d4f9b2
|
[
"BSD-3-Clause"
] | 31
|
2015-01-07T16:25:46.000Z
|
2021-02-15T08:30:45.000Z
|
tests/model_tests/app/signals.py
|
if1live/importd
|
4b1dd2cc43923f44f2c509a3e4a0568fa3d4f9b2
|
[
"BSD-3-Clause"
] | 23
|
2015-01-05T09:34:55.000Z
|
2018-05-17T07:27:36.000Z
|
from django.conf import settings
settings.SIGNALS_IMPORTED=True
| 21.333333
| 32
| 0.875
| 9
| 64
| 6.111111
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078125
| 64
| 3
| 33
| 21.333333
| 0.932203
| 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
|
e8347c9146ced5d73c0711b799052d66cfd02c88
| 202
|
py
|
Python
|
Module/Lista 1/Thiago/07.py
|
Vitor-ORB/algorithms-and-programming-1-ufms
|
10821e9b580b78b7f78c27e740f3ead9c6b9f0bd
|
[
"MIT"
] | 7
|
2021-05-25T16:49:20.000Z
|
2022-02-17T11:57:32.000Z
|
Module/Lista 1/Thiago/07.py
|
Vitor-ORB/algorithms-and-programming-1-ufms
|
10821e9b580b78b7f78c27e740f3ead9c6b9f0bd
|
[
"MIT"
] | null | null | null |
Module/Lista 1/Thiago/07.py
|
Vitor-ORB/algorithms-and-programming-1-ufms
|
10821e9b580b78b7f78c27e740f3ead9c6b9f0bd
|
[
"MIT"
] | 8
|
2021-05-25T16:49:39.000Z
|
2021-09-30T18:02:07.000Z
|
# Leia uma frase e descubra quantos caracteres existem nesta frase.
# Implemente uma função chamada contaCaracter().
def contaCaracter(str):
return len(str)
print(contaCaracter(input()))
| 22.444444
| 68
| 0.732673
| 24
| 202
| 6.166667
| 0.791667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183168
| 202
| 8
| 69
| 25.25
| 0.89697
| 0.554455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 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
| 0
| 1
| 1
| 0
|
0
| 5
|
e837d2178ad692070a0523b725c97c078d9181ef
| 16,689
|
py
|
Python
|
addons/mod.py
|
NightYoshi370/Kurisu
|
a4a40498791a6a54f8bec6bc89444dd5a9b5651a
|
[
"Apache-2.0"
] | null | null | null |
addons/mod.py
|
NightYoshi370/Kurisu
|
a4a40498791a6a54f8bec6bc89444dd5a9b5651a
|
[
"Apache-2.0"
] | null | null | null |
addons/mod.py
|
NightYoshi370/Kurisu
|
a4a40498791a6a54f8bec6bc89444dd5a9b5651a
|
[
"Apache-2.0"
] | null | null | null |
import discord
import json
import re
from discord.ext import commands
from subprocess import call
from sys import argv
class Mod:
"""
Staff commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
async def add_restriction(self, member, rst):
with open("data/restrictions.json", "r") as f:
rsts = json.load(f)
if member.id not in rsts:
rsts[member.id] = []
if rst not in rsts[member.id]:
rsts[member.id].append(rst)
with open("data/restrictions.json", "w") as f:
json.dump(rsts, f)
async def remove_restriction(self, member, rst):
with open("data/restrictions.json", "r") as f:
rsts = json.load(f)
if member.id not in rsts:
rsts[member.id] = []
if rst in rsts[member.id]:
rsts[member.id].remove(rst)
with open("data/restrictions.json", "w") as f:
json.dump(rsts, f)
@commands.has_permissions(administrator=True)
@commands.command()
async def quit(self, *gamename):
"""Stops the bot."""
await self.bot.say("👋 Bye bye!")
await self.bot.close()
@commands.has_permissions(manage_server=True)
@commands.command(hidden=True)
async def pull(self, *gamename):
"""Pull new changes from GitHub and restart."""
await self.bot.say("Pulling changes...")
call(['git', 'pull'])
await self.bot.say("👋 Restarting bot!")
await self.bot.close()
@commands.has_permissions(manage_server=True)
@commands.command(pass_context=True, hidden=True)
async def userinfo(self, ctx, user):
"""Gets user info. SuperOP+."""
u = ctx.message.mentions[0]
role = u.top_role.name
if role == "@everyone":
role = "@ everyone"
await self.bot.say("name = {}\nid = {}\ndiscriminator = {}\navatar = {}\nbot = {}\navatar_url = {}\ndefault_avatar = {}\ndefault_avatar_url = <{}>\ncreated_at = {}\ndisplay_name = {}\njoined_at = {}\nstatus = {}\ngame = {}\ncolour = {}\ntop_role = {}\n".format(u.name, u.id, u.discriminator, u.avatar, u.bot, u.avatar_url, u.default_avatar, u.default_avatar_url, u.created_at, u.display_name, u.joined_at, u.status, u.game, u.colour, role))
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, hidden=True)
async def matchuser(self, ctx, *, rgx: str):
"""Match users by regex."""
author = ctx.message.author
msg = "```\nmembers:\n"
for m in self.bot.server.members:
if bool(re.search(rgx, m.name, re.IGNORECASE)):
msg += "{} - {}#{}\n".format(m.id, m.name, m.discriminator)
msg += "```"
await self.bot.send_message(author, msg)
@commands.has_permissions(administrator=True)
@commands.command(pass_context=True, hidden=True)
async def multiban(self, ctx, *, members: str):
"""Multi-ban users."""
author = ctx.message.author
msg = "```\nbanned:\n"
for m in ctx.message.mentions:
msg += "{} - {}#{}\n".format(m.id, m.name, m.discriminator)
try:
await self.bot.ban(m)
except discord.error.NotFound:
pass
msg += "```"
await self.bot.send_message(author, msg)
@commands.has_permissions(administrator=True)
@commands.command(pass_context=True, hidden=True)
async def multibanre(self, ctx, *, rgx: str):
"""Multi-ban users by regex."""
author = ctx.message.author
msg = "```\nbanned:\n"
toban = [] # because "dictionary changed size during iteration"
for m in self.bot.server.members:
if bool(re.search(rgx, m.name, re.IGNORECASE)):
msg += "{} - {}#{}\n".format(m.id, m.name, m.discriminator)
toban.append(m)
for m in toban:
try:
await self.bot.ban(m)
except discord.error.NotFound:
pass
msg += "```"
await self.bot.send_message(author, msg)
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="clear")
async def purge(self, ctx, limit: int):
"""Clears a given number of messages. Staff only."""
try:
await self.bot.purge_from(ctx.message.channel, limit=limit)
msg = "🗑 **Cleared**: {} cleared {} messages in {}".format(ctx.message.author.mention, limit, ctx.message.channel.mention)
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="mute")
async def mute(self, ctx, user, *, reason=""):
"""Mutes a user so they can't speak. Staff only."""
try:
member = ctx.message.mentions[0]
await self.add_restriction(member, "Muted")
await self.bot.add_roles(member, self.bot.muted_role)
msg_user = "You were muted!"
if reason != "":
msg_user += " The given reason is: " + reason
try:
await self.bot.send_message(member, msg_user)
except discord.errors.Forbidden:
pass # don't fail in case user has DMs disabled for this server, or blocked the bot
await self.bot.say("{} can no longer speak.".format(member.mention))
msg = "🔇 **Muted**: {} muted {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
if reason != "":
msg += "\n✏️ __Reason__: " + reason
else:
msg += "\nPlease add an explanation below. In the future, it is recommended to use `.mute <user> [reason]` as the reason is automatically sent to the user."
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="unmute")
async def unmute(self, ctx, user):
"""Unmutes a user so they can speak. Staff only."""
try:
member = ctx.message.mentions[0]
await self.remove_restriction(member, "Muted")
await self.bot.remove_roles(member, self.bot.muted_role)
await self.bot.say("{} can now speak again.".format(member.mention))
msg = "🔈 **Unmuted**: {} unmuted {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="noembed")
async def noembed(self, ctx, user, *, reason=""):
"""Removes embed permissions from a user. Staff only."""
try:
member = ctx.message.mentions[0]
await self.add_restriction(member, "No-Embed")
await self.bot.add_roles(member, self.bot.noembed_role)
msg_user = "You lost embed and upload permissions!"
if reason != "":
msg_user += " The given reason is: " + reason
try:
await self.bot.send_message(member, msg_user)
except discord.errors.Forbidden:
pass # don't fail in case user has DMs disabled for this server, or blocked the bot
await self.bot.say("{} can no longer embed links or attach files.".format(member.mention))
msg = "🚫 **Removed Embed**: {} removed embed from {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
if reason != "":
msg += "\n✏️ __Reason__: " + reason
else:
msg += "\nPlease add an explanation below. In the future, it is recommended to use `.noembed <user> [reason]` as the reason is automatically sent to the user."
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="embed")
async def embed(self, ctx, user):
"""Restore embed permissios for a user. Staff only."""
try:
member = ctx.message.mentions[0]
await self.remove_restriction(member, "No-Embed")
await self.bot.remove_roles(member, self.bot.noembed_role)
await self.bot.say("{} can now embed links and attach files again.".format(member.mention))
msg = "⭕️ **Restored Embed**: {} restored embed to {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.command(pass_context=True, name="takehelp")
async def takehelp(self, ctx, user, *, reason=""):
"""Remove access to help-and-questions. Staff and Helpers only."""
author = ctx.message.author
if (self.bot.helpers_role not in author.roles) and (self.bot.staff_role not in author.roles):
msg = "{} You cannot use this command.".format(author.mention)
await self.bot.say(msg)
return
try:
member = ctx.message.mentions[0]
await self.add_restriction(member, "No-Help")
await self.bot.add_roles(member, self.bot.nohelp_role)
msg_user = "You lost access to help channels!"
if reason != "":
msg_user += " The given reason is: " + reason
try:
await self.bot.send_message(member, msg_user)
except discord.errors.Forbidden:
pass # don't fail in case user has DMs disabled for this server, or blocked the bot
await self.bot.say("{} can no longer access the help channels.".format(member.mention))
msg = "🚫 **Help access removed**: {} removed access to help channels from {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
if reason != "":
msg += "\n✏️ __Reason__: " + reason
else:
msg += "\nPlease add an explanation below. In the future, it is recommended to use `.takehelp <user> [reason]` as the reason is automatically sent to the user."
await self.bot.send_message(self.bot.modlogs_channel, msg)
await self.bot.send_message(self.bot.helpers_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.command(pass_context=True, name="givehelp")
async def givehelp(self, ctx, user):
"""Restore access to help-and-questions. Staff and Helpers only."""
author = ctx.message.author
if (self.bot.helpers_role not in author.roles) and (self.bot.staff_role not in author.roles):
msg = "{} You cannot use this command.".format(author.mention)
await self.bot.say(msg)
return
try:
member = ctx.message.mentions[0]
await self.remove_restriction(member, "No-Help")
await self.bot.remove_roles(member, self.bot.nohelp_role)
await self.bot.say("{} can access the help channels again.".format(member.mention))
msg = "⭕️ **Help access restored**: {} restored access to help channels to {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
await self.bot.send_message(self.bot.modlogs_channel, msg)
await self.bot.send_message(self.bot.helpers_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="probate")
async def probate(self, ctx, user, *, reason=""):
"""Probate a user. Staff only."""
try:
member = ctx.message.mentions[0]
await self.add_restriction(member, "Probation")
await self.bot.add_roles(member, self.bot.probation_role)
msg_user = "You are under probation!"
if reason != "":
msg_user += " The given reason is: " + reason
try:
await self.bot.send_message(member, msg_user)
except discord.errors.Forbidden:
pass # don't fail in case user has DMs disabled for this server, or blocked the bot
await self.bot.say("{} is now in probation.".format(member.mention))
msg = "🚫 **Probated**: {} probated {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
if reason != "":
msg += "\n✏️ __Reason__: " + reason
else:
msg += "\nPlease add an explanation below. In the future, it is recommended to use `.probate <user> [reason]` as the reason is automatically sent to the user."
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True, name="unprobate")
async def unprobate(self, ctx, user):
"""Unprobate a user. Staff only."""
try:
member = ctx.message.mentions[0]
await self.remove_restriction(member, "Probation")
await self.bot.remove_roles(member, self.bot.probation_role)
await self.bot.say("{} is out of probation.".format(member.mention))
msg = "⭕️ **Un-probated**: {} un-probated {} | {}#{}".format(ctx.message.author.mention, member.mention, self.bot.escape_name(member.name), self.bot.escape_name(member.discriminator))
await self.bot.send_message(self.bot.modlogs_channel, msg)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(ban_members=True)
@commands.command(pass_context=True)
async def playing(self, ctx, *gamename):
"""Sets playing message. Staff only."""
try:
await self.bot.change_presence(game=discord.Game(name='{}'.format(" ".join(gamename))))
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(ban_members=True)
@commands.command(pass_context=True)
async def status(self, ctx, status):
"""Sets status. Staff only."""
try:
if status == "online":
await self.bot.change_presence(status=discord.Status.online)
elif status == "offline":
await self.bot.change_presence(status=discord.Status.offline)
elif status == "idle":
await self.bot.change_presence(status=discord.Status.idle)
elif status == "dnd":
await self.bot.change_presence(status=discord.Status.dnd)
elif status == "invisible":
await self.bot.change_presence(status=discord.Status.invisible)
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
@commands.has_permissions(ban_members=True)
@commands.command(pass_context=True, hidden=True)
async def username(self, ctx, *, username):
"""Sets bot name. Staff only."""
try:
await self.bot.edit_profile(username=('{}'.format(username)))
except discord.errors.Forbidden:
await self.bot.say("💢 I don't have permission to do this.")
def setup(bot):
bot.add_cog(Mod(bot))
| 51.668731
| 448
| 0.614237
| 2,143
| 16,689
| 4.713019
| 0.120859
| 0.074158
| 0.07604
| 0.038614
| 0.778218
| 0.751188
| 0.72396
| 0.702673
| 0.645743
| 0.642574
| 0
| 0.000723
| 0.254359
| 16,689
| 322
| 449
| 51.829193
| 0.808181
| 0.02247
| 0
| 0.587814
| 0
| 0.017921
| 0.176206
| 0.007074
| 0
| 0
| 0
| 0
| 0
| 1
| 0.007168
| false
| 0.078853
| 0.021505
| 0
| 0.039427
| 0.003584
| 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
|
1c02f9b6664803cf2ba64c8f548bcaab0a303bbf
| 36
|
py
|
Python
|
hello.py
|
Alfie0226/firstgip
|
64d565fe7fa9cd01342e638ea643f26949e8044a
|
[
"Apache-2.0"
] | null | null | null |
hello.py
|
Alfie0226/firstgip
|
64d565fe7fa9cd01342e638ea643f26949e8044a
|
[
"Apache-2.0"
] | null | null | null |
hello.py
|
Alfie0226/firstgip
|
64d565fe7fa9cd01342e638ea643f26949e8044a
|
[
"Apache-2.0"
] | null | null | null |
print('hello python')
print("nice")
| 12
| 21
| 0.694444
| 5
| 36
| 5
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 36
| 2
| 22
| 18
| 0.757576
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 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
|
1c406cd8fdb1878cf53168c030b0169aa8a44417
| 117,677
|
py
|
Python
|
tk_ui/admin_program.py
|
SuperH-0630/HGSSystem
|
4bd0b18cec810df4915fea9473adbea6faea4fe2
|
[
"MIT"
] | null | null | null |
tk_ui/admin_program.py
|
SuperH-0630/HGSSystem
|
4bd0b18cec810df4915fea9473adbea6faea4fe2
|
[
"MIT"
] | null | null | null |
tk_ui/admin_program.py
|
SuperH-0630/HGSSystem
|
4bd0b18cec810df4915fea9473adbea6faea4fe2
|
[
"MIT"
] | null | null | null |
import abc
import datetime
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfilename
from math import ceil
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.axes import Axes
import numpy as np
from matplotlib.colorbar import Colorbar
from matplotlib.figure import Figure
from tool.color import random_color
from tool.typing import *
from tool.tk import make_font, set_tk_disable_from_list
from tool.login import create_uid
from conf import Config
from . import admin
from . import admin_event as tk_event
from sql import DBBit
from sql.user import find_user_by_name
from core.garbage import GarbageType
class AdminProgram(metaclass=abc.ABCMeta):
def __init__(self, station: "admin.AdminStation", win: Union[tk.Frame, tk.Toplevel, tk.Tk], color: str, title: str):
self.station = station
self.win = win
self.color = color
self.frame = tk.Frame(self.win)
self.frame['bg'] = color
self.program_title = title
@abc.abstractmethod
def set_disable(self):
...
@abc.abstractmethod
def reset_disable(self):
...
@abc.abstractmethod
def conf_gui(self, n: int = 1):
...
def to_program(self):
pass
def leave_program(self):
pass
def get_title(self) -> str:
return self.program_title
def get_program_frame(self) -> Tuple[str, tk.Frame]:
return self.program_title, self.frame
class WelcomeProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "欢迎页")
self.title = tk.Label(self.frame)
self.info = tk.Label(self.frame)
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(25 * n)
self.info_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size, weight="bold")
info_font = make_font(size=self.info_font_size)
self.title['font'] = title_font
self.title['bg'] = self.color
self.title['text'] = '欢迎使用 HGSSystem 管理员系统\n[帮助]'
self.info['bg'] = self.color
self.info['font'] = info_font
self.info['anchor'] = 'nw'
self.info['justify'] = 'left'
self.info['text'] = (f'''
HGSSystem 管理者界面:
1) 点击菜单按钮进入子菜单或程序
2) 创建 菜单包含创建类的程序
3) 删除 菜单包含删除类的程序
4) 搜索 菜单包含数据分析类的程序
5) 更新 菜单包含数据更新类的程序
6) 当离开操作系统时请退出登录以确保安全
7) 只能使用具有管理员权限的账号登陆系统
8) 只有admin用户可以完成危险操作(例如删除所有垃圾袋数据)
程序的运行:
1) 在菜单中选中程序后,根据程序界面提示完成操作
2) 操作过程通常会显示进度条,除非任务执行迅速
3) 结果通常会被反馈, 且不会自动消失
系统登录:
1) 仅Manager用户可以登录
'''.strip())
self.title.place(relx=0.1, rely=0.0, relwidth=0.8, relheight=0.2)
self.info.place(relx=0.05, rely=0.21, relwidth=0.90, relheight=0.75)
def set_disable(self):
pass
def reset_disable(self):
pass
class AboutProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "关于")
self.title = tk.Label(self.frame)
self.info = tk.Label(self.frame)
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(25 * n)
self.info_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size, weight="bold")
info_font = make_font(size=self.info_font_size)
self.title['font'] = title_font
self.title['bg'] = self.color
self.title['text'] = '关于 HGSSystem 管理员系统'
self.info['bg'] = self.color
self.info['font'] = info_font
self.info['anchor'] = 'nw'
self.info['justify'] = 'left'
self.info['text'] = Config.about_info
self.title.place(relx=0.1, rely=0.0, relwidth=0.8, relheight=0.2)
self.info.place(relx=0.05, rely=0.21, relwidth=0.90, relheight=0.75)
def set_disable(self):
pass
def reset_disable(self):
pass
class CreateUserProgramBase(AdminProgram):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.enter_frame = tk.Frame(self.frame)
self.title: List[tk.Label] = [tk.Label(self.enter_frame) for _ in range(3)]
self.enter: List[tk.Entry] = [tk.Entry(self.enter_frame) for _ in range(3)]
self.var: List[tk.Variable] = [tk.StringVar() for _ in range(3)]
self.btn: List[tk.Button] = [tk.Button(self.frame) for _ in range(2)]
self._conf("#FA8072", False) # 默认颜色
self.__conf_font()
def _conf(self, bg_color, is_manager: bool):
self.bg_color = bg_color
self.is_manager = is_manager
return self
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = self.bg_color
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.3, relwidth=0.6, relheight=0.30)
height = 0.1
for lb, text, enter, var in zip(self.title, ["用户名:", "用户密码:", "手机号:"], self.enter, self.var):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = self.bg_color
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.17)
enter.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.17)
height += 0.30
for btn, text, x, func in zip(self.btn,
["创建用户", "获取用户ID"],
[0.2, 0.6],
[lambda: self.create_by_name(), lambda: self.get_uid()]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
btn['command'] = func
btn.place(relx=x, rely=0.7, relwidth=0.2, relheight=0.08)
def __get_info(self) -> Optional[Tuple[uname_t, passwd_t, str]]:
name: uname_t = self.var[0].get()
passwd: passwd_t = self.var[1].get()
phone: str = self.var[2].get()
if len(name) == 0 or len(passwd) == 0 or len(phone) != 11:
self.station.show_msg("用户创建失败", "请再次尝试, 输入用户名, 用户密码和11位手机号")
return None
return name, passwd, phone
def create_by_name(self):
res = self.__get_info()
if res is None:
return
name, passwd, phone = res
event = tk_event.CreateUserEvent(self.station).start(name, passwd, phone, self.is_manager)
self.station.push_event(event)
def get_uid(self):
res = self.__get_info()
if res is None:
return
name, passwd, phone = res
uid = create_uid(name, passwd, phone)
self.station.show_msg("获取用户ID", f"用户名: {name}\n用户ID: {uid}")
def set_disable(self):
set_tk_disable_from_list(self.btn)
set_tk_disable_from_list(self.enter)
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
set_tk_disable_from_list(self.enter, flat='normal')
class CreateNormalUserProgram(CreateUserProgramBase):
def __init__(self, station, win, color):
super(CreateNormalUserProgram, self).__init__(station, win, color, "创建普通用户")
class CreateManagerUserProgram(CreateUserProgramBase):
def __init__(self, station, win, color):
super(CreateManagerUserProgram, self).__init__(station, win, color, "创建管理员")
self._conf("#4b5cc4", True)
class CreateAutoNormalUserProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "创建自动用户")
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.var: tk.Variable = tk.StringVar()
self.btn: tk.Button = tk.Button(self.frame) # create(生成用户) try(计算uid)
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = "#bce672"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.3, relwidth=0.6, relheight=0.12)
self.title['font'] = title_font
self.title['text'] = "手机号:"
self.title['bg'] = "#bce672"
self.title['anchor'] = 'e'
self.enter['font'] = title_font
self.enter['textvariable'] = self.var
self.title.place(relx=0.02, rely=0.25, relwidth=0.25, relheight=0.50)
self.enter.place(relx=0.30, rely=0.25, relwidth=0.60, relheight=0.50)
self.btn['font'] = btn_font
self.btn['text'] = "创建用户"
self.btn['bg'] = Config.tk_btn_bg
self.btn['command'] = lambda: self.create_user()
self.btn.place(relx=0.4, rely=0.7, relwidth=0.2, relheight=0.08)
def create_user(self):
phone = self.var.get()
if len(phone) != 11:
self.station.show_msg("UserInfoError", "Please, enter Phone(11)")
event = tk_event.CreateUserEvent(self.station).start(None, None, phone, False)
self.station.push_event(event)
def set_disable(self):
self.btn['state'] = 'disable'
self.enter['state'] = 'disable'
def reset_disable(self):
self.btn['state'] = 'normal'
self.enter['state'] = 'normal'
class CreateGarbageProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "创建垃圾袋")
self.enter_frame = tk.Frame(self.frame)
self.title: List[tk.Label] = [tk.Label(self.enter_frame), tk.Label(self.enter_frame)]
self.enter: List[tk.Entry] = [tk.Entry(self.enter_frame), tk.Entry(self.enter_frame)]
self.var: List[tk.Variable] = [tk.StringVar(), tk.StringVar()]
self.create_btn: tk.Button = tk.Button(self.frame)
self.file_btn: tk.Button = tk.Button(self.frame)
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = "#b69968"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.3, relwidth=0.6, relheight=0.17)
height = 0.1
for lb, text, enter, var in zip(self.title, ["数量:", "导出位置:"], self.enter, self.var):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = "#b69968"
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.35)
enter.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.35)
height += 0.43
for btn, text, x, func in zip([self.create_btn, self.file_btn],
["创建垃圾袋", "选择目录"],
[0.2, 0.6],
[lambda: self.create_garbage(), lambda: self.choose_file()]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
btn['command'] = func
btn.place(relx=x, rely=0.7, relwidth=0.2, relheight=0.08)
def choose_file(self):
path = askdirectory(title='选择二维码导出位置')
self.var[1].set(path)
def create_garbage(self):
try:
count = int(self.var[0].get())
if count <= 0:
raise ValueError
except (ValueError, TypeError):
self.station.show_msg("类型错误", "数量必须为大于0的数字")
else:
path = self.var[1].get()
if len(path) == 0:
path = None
event = tk_event.CreateGarbageEvent(self.station).start(path, count)
self.station.push_event(event)
def set_disable(self):
self.create_btn['state'] = 'disable'
self.file_btn['state'] = 'disable'
set_tk_disable_from_list(self.enter)
def reset_disable(self):
self.create_btn['state'] = 'normal'
self.file_btn['state'] = 'normal'
set_tk_disable_from_list(self.enter, flat='normal')
class ExportProgramBase(AdminProgram):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.gid_frame = tk.Frame(self.frame)
self.gid_title: List[tk.Label] = [tk.Label(self.gid_frame), tk.Label(self.gid_frame)]
self.gid_enter: List[tk.Entry] = [tk.Entry(self.gid_frame), tk.Entry(self.gid_frame)]
self.gid_var: List[tk.Variable] = [tk.StringVar(), tk.StringVar()]
self.where_frame = tk.Frame(self.frame)
self.where_title: List[tk.Label] = [tk.Label(self.where_frame), tk.Label(self.where_frame)]
self.where_enter: List[tk.Entry] = [tk.Entry(self.where_frame), tk.Entry(self.where_frame)]
self.where_var: List[tk.Variable] = [tk.StringVar(), tk.StringVar()]
self.create_btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self.file_btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self._conf("", [], [], [])
self.__conf_font()
def _conf(self, bg_color: str, title_id, title_where, title_command):
self.bg_color = bg_color
self.title_id = title_id
self.title_where = title_where
self.title_command = title_command
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.where_frame['bg'] = self.bg_color
self.where_frame['bd'] = 5
self.where_frame['relief'] = "ridge"
self.where_frame.place(relx=0.2, rely=0.2, relwidth=0.6, relheight=0.17)
self.gid_frame['bg'] = self.bg_color
self.gid_frame['bd'] = 5
self.gid_frame['relief'] = "ridge"
self.gid_frame.place(relx=0.2, rely=0.6, relwidth=0.6, relheight=0.17)
height = 0.1
for lb, text, enter, var, lb_w, text_w, enter_w, var_w in zip(
self.gid_title, self.title_id, self.gid_enter, self.gid_var,
self.where_title, self.title_where, self.where_enter, self.where_var):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = self.bg_color
lb['anchor'] = 'e'
lb_w['font'] = title_font
lb_w['text'] = text_w
lb_w['bg'] = self.bg_color
lb_w['anchor'] = 'e'
enter['textvariable'] = var
enter['font'] = title_font
enter_w['textvariable'] = var_w
enter_w['font'] = title_font
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.35)
enter.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.35)
lb_w.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.35)
enter_w.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.35)
height += 0.43
for btn, text in zip(self.create_btn + self.file_btn, self.title_command):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
self.create_btn[1]['command'] = self.export_where
self.create_btn[0]['command'] = self.export_id
self.create_btn[1].place(relx=0.2, rely=0.39, relwidth=0.25, relheight=0.08)
self.create_btn[0].place(relx=0.2, rely=0.79, relwidth=0.25, relheight=0.08)
self.file_btn[1]['command'] = self.choose_file_where
self.file_btn[0]['command'] = self.choose_file_id
self.file_btn[1].place(relx=0.6, rely=0.39, relwidth=0.2, relheight=0.08)
self.file_btn[0].place(relx=0.6, rely=0.79, relwidth=0.2, relheight=0.08)
def choose_file_id(self):
path = askdirectory(title='选择二维码导出位置')
self.gid_var[1].set(path)
def choose_file_where(self):
path = askdirectory(title='选择二维码导出位置')
self.where_var[1].set(path)
def export_id(self):
...
def export_where(self):
...
def set_disable(self):
set_tk_disable_from_list(self.gid_enter)
set_tk_disable_from_list(self.create_btn)
set_tk_disable_from_list(self.file_btn)
def reset_disable(self):
set_tk_disable_from_list(self.gid_enter, flat='normal')
set_tk_disable_from_list(self.create_btn, flat='normal')
set_tk_disable_from_list(self.file_btn, flat='normal')
class ExportGarbageProgram(ExportProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "导出垃圾袋二维码")
self._conf("#afdfe4", ["垃圾袋ID:", "导出位置:"], ["条件:", "导出位置:"],
["根据垃圾袋ID导出", "根据条件导出", "选择目录", "选择目录"])
def export_id(self):
gid = self.gid_var[0].get()
path = self.gid_var[1].get()
if len(path) == 0:
self.station.show_warning("导出失败", "请指定导出的位置")
return
event = tk_event.ExportGarbageByIDEvent(self.station).start(path, gid)
self.station.push_event(event)
def export_where(self):
where = self.where_var[0].get()
path = self.where_var[1].get()
if len(path) == 0:
self.station.show_warning("导出失败", "请指定导出的位置")
return
event = tk_event.ExportGarbageAdvancedEvent(self.station).start(path, where)
self.station.push_event(event)
class ExportUserProgram(ExportProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "导出用户二维码")
self._conf("#f69c9f", ["用户ID:", "导出位置:"], ["条件:", "导出位置:"],
["根据用户ID导出", "根据条件导出", "选择目录", "选择目录"])
def export_id(self):
uid = self.gid_var[0].get()
path = self.gid_var[1].get()
if len(path) == 0:
self.station.show_warning("导出失败", "请指定导出的位置")
return
event = tk_event.ExportUserByIDEvent(self.station).start(path, uid)
self.station.push_event(event)
def export_where(self):
where = self.where_var[0].get()
path = self.where_var[1].get()
if len(path) == 0:
self.station.show_warning("导出失败", "请指定导出的位置")
return
event = tk_event.ExportUserAdvancedEvent(self.station).start(path, where)
self.station.push_event(event)
class CreateUserFromCSVProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "从CSV导入用户")
self.auto_frame = tk.Frame(self.frame)
self.auto_title: tk.Label = tk.Label(self.auto_frame)
self.auto_enter: tk.Entry = tk.Entry(self.auto_frame)
self.auto_var: tk.Variable = tk.StringVar()
self.enter_frame = tk.Frame(self.frame)
self.path_title: tk.Label = tk.Label(self.enter_frame)
self.path_enter: tk.Entry = tk.Entry(self.enter_frame)
self.path_var: tk.Variable = tk.StringVar()
self.create_btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self.file_btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = "#EEE8AA"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.2, relwidth=0.6, relheight=0.12)
self.auto_frame['bg'] = "#EEE8AA"
self.auto_frame['bd'] = 5
self.auto_frame['relief'] = "ridge"
self.auto_frame.place(relx=0.2, rely=0.6, relwidth=0.6, relheight=0.12)
self.auto_title['font'] = title_font
self.auto_title['text'] = "CSV文件:"
self.auto_title['bg'] = "#EEE8AA"
self.auto_title['anchor'] = 'e'
self.path_title['font'] = title_font
self.path_title['text'] = "CSV文件:"
self.path_title['bg'] = "#EEE8AA"
self.path_title['anchor'] = 'e'
self.auto_enter['textvariable'] = self.auto_var
self.auto_enter['font'] = title_font
self.path_enter['textvariable'] = self.path_var
self.path_enter['font'] = title_font
self.auto_title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.auto_enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
self.path_title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.path_enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
for btn, text in zip(self.create_btn + self.file_btn,
["创建用户", "创建自动用户", "选择CSV", "选择CSV"]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
self.create_btn[0]['command'] = self.create
self.create_btn[1]['command'] = self.create_auto
self.create_btn[0].place(relx=0.2, rely=0.34, relwidth=0.25, relheight=0.08)
self.create_btn[1].place(relx=0.2, rely=0.74, relwidth=0.25, relheight=0.08)
self.file_btn[0]['command'] = self.choose_file
self.file_btn[1]['command'] = self.choose_file_auto
self.file_btn[0].place(relx=0.6, rely=0.34, relwidth=0.2, relheight=0.08)
self.file_btn[1].place(relx=0.6, rely=0.74, relwidth=0.2, relheight=0.08)
def choose_file_auto(self):
path = askopenfilename(title='选择CSV文件', filetypes=[("CSV", ".csv")])
self.auto_var.set(path)
def choose_file(self):
path = askopenfilename(title='选择CSV文件', filetypes=[("CSV", ".csv")])
self.path_var.set(path)
def create_auto(self):
path = self.auto_var.get()
event = tk_event.CreateAutoUserFromCSVEvent(self.station).start(path)
self.station.push_event(event)
def create(self):
path = self.path_var.get()
event = tk_event.CreateUserFromCSVEvent(self.station).start(path)
self.station.push_event(event)
def set_disable(self):
self.auto_enter['state'] = 'disable'
self.path_enter['state'] = 'disable'
set_tk_disable_from_list(self.create_btn)
set_tk_disable_from_list(self.file_btn)
def reset_disable(self):
self.auto_enter['state'] = 'normal'
self.path_enter['state'] = 'normal'
set_tk_disable_from_list(self.create_btn, flat='normal')
set_tk_disable_from_list(self.file_btn, flat='normal')
class DeleteUserProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "删除用户")
self.uid_frame = tk.Frame(self.frame)
self.uid_title: tk.Label = tk.Label(self.uid_frame)
self.uid_enter: tk.Entry = tk.Entry(self.uid_frame)
self.uid_var: tk.Variable = tk.StringVar()
self.name_frame = tk.Frame(self.frame)
self.name_title: List[tk.Label] = [tk.Label(self.name_frame) for _ in range(2)]
self.name_enter: List[tk.Entry] = [tk.Entry(self.name_frame) for _ in range(2)]
self.name_var: List[tk.Variable] = [tk.StringVar() for _ in range(2)]
self.btn: List[tk.Button] = [tk.Button(self.frame) for _ in range(2)] # uid-del, name-passwd-del
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.uid_frame['bg'] = "#FA8072"
self.uid_frame['bd'] = 5
self.uid_frame['relief'] = "ridge"
self.uid_frame.place(relx=0.2, rely=0.20, relwidth=0.6, relheight=0.10)
self.name_frame['bg'] = "#FA8072"
self.name_frame['bd'] = 5
self.name_frame['relief'] = "ridge"
self.name_frame.place(relx=0.2, rely=0.48, relwidth=0.6, relheight=0.25)
height = 0.17
for lb, text, enter, var in zip(self.name_title, ["用户名:", "密码:"], self.name_enter, self.name_var):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = "#FA8072"
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.20)
enter.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.20)
height += 0.45
self.uid_title['font'] = title_font
self.uid_title['text'] = "用户ID:"
self.uid_title['bg'] = "#FA8072"
self.uid_title['anchor'] = 'e'
self.uid_enter['font'] = title_font
self.uid_enter['textvariable'] = self.uid_var
self.uid_title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.uid_enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
for btn, text, func in zip(self.btn,
["通过用户ID删除", "通过用户名删除"],
[lambda: self.del_by_uid(), lambda: self.del_by_name()]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
btn['command'] = func
self.btn[0].place(relx=0.6, rely=0.32, relwidth=0.2, relheight=0.08)
self.btn[1].place(relx=0.6, rely=0.75, relwidth=0.2, relheight=0.08)
def del_by_uid(self):
uid = self.uid_var.get()
if len(uid) != 32:
self.station.show_warning("用户ID错误", "用户ID必须为32位")
return
event = tk_event.DelUserEvent(self.station).start(uid)
self.station.push_event(event)
def del_by_name(self):
name = self.name_var[0].get()
passwd = self.name_var[1].get()
if len(name) == 0 or len(passwd) == 0:
self.station.show_warning("用户名或密码错误", "请输入用户名和密码")
return
uid = create_uid(name, passwd)
event = tk_event.DelUserEvent(self.station).start(uid)
self.station.push_event(event)
def set_disable(self):
set_tk_disable_from_list(self.btn)
set_tk_disable_from_list(self.name_enter)
self.uid_enter['state'] = 'disable'
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
set_tk_disable_from_list(self.name_enter, flat='normal')
self.uid_enter['state'] = 'normal'
class DeleteUsersProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "删除多个用户")
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.var: tk.Variable = tk.StringVar()
self.btn: List[tk.Button] = [tk.Button(self.frame) for _ in range(2)] # del, scan
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = "#48c0a3"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.30, relwidth=0.6, relheight=0.10)
self.title['font'] = title_font
self.title['text'] = "条件:"
self.title['anchor'] = 'e'
self.title['bg'] = "#48c0a3"
self.enter['font'] = title_font
self.enter['textvariable'] = self.var
self.title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
for btn, text, x, func in zip(self.btn,
["删除", "扫描"],
[0.2, 0.6],
[lambda: self.delete_user(), lambda: self.scan_user()]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
btn['command'] = func
btn.place(relx=x, rely=0.6, relwidth=0.2, relheight=0.08)
def delete_user(self):
where = self.var.get()
if len(where) == 0:
self.station.show_warning("条件错误", "条件必须为正确的SQL语句")
return
event = tk_event.DelUserFromWhereEvent(self.station).start(where)
self.station.push_event(event)
def scan_user(self):
where = self.var.get()
if len(where) == 0:
self.station.show_warning("条件错误", "条件必须为正确的SQL语句")
return
event = tk_event.DelUserFromWhereScanEvent(self.station).start(where)
self.station.push_event(event)
def set_disable(self):
set_tk_disable_from_list(self.btn)
self.enter['state'] = 'disable'
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
self.enter['state'] = 'normal'
class DeleteGarbageProgramBase(AdminProgram):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.var: tk.Variable = tk.StringVar()
self.int_var: tk.Variable = tk.IntVar()
self.int_var.set(0)
self.radio: List[tk.Radiobutton] = [tk.Radiobutton(self.frame) for _ in range(4)]
self.btn: tk.Button = tk.Button(self.frame)
self.__conf_font()
self._conf()
def _conf(self, title: str = "垃圾袋ID:", color: str = "#b69968", support_del_all: bool = True):
self.frame_title = title
self.frame_color = color
self.support_del_all = support_del_all
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = self.frame_color
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.30, relwidth=0.6, relheight=0.10)
self.title['font'] = title_font
self.title['text'] = self.frame_title
self.title['bg'] = self.frame_color
self.title['anchor'] = 'e'
self.enter['font'] = title_font
self.enter['textvariable'] = self.var
self.title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
for i in range(4):
radio = self.radio[i]
radio['font'] = btn_font
radio['text'] = ['均可', '仅未使用', '仅待检测', '仅已检测'][i]
radio['bg'] = self.color
radio['value'] = i
radio['variable'] = self.int_var
radio['anchor'] = 'w'
if not self.support_del_all:
self.int_var.set(1)
self.radio[0]['state'] = 'disable'
self.radio[0].place(relx=0.20, rely=0.43, relwidth=0.20, relheight=0.1)
self.radio[1].place(relx=0.60, rely=0.43, relwidth=0.20, relheight=0.1)
self.radio[2].place(relx=0.20, rely=0.55, relwidth=0.20, relheight=0.1)
self.radio[3].place(relx=0.60, rely=0.55, relwidth=0.20, relheight=0.1)
self.btn['font'] = btn_font
self.btn['text'] = '删除'
self.btn['bg'] = Config.tk_btn_bg
self.btn['command'] = lambda: self.delete_garbage()
self.btn.place(relx=0.4, rely=0.68, relwidth=0.2, relheight=0.08)
def delete_garbage(self):
...
def set_disable(self):
self.enter['state'] = 'disable'
self.btn['state'] = 'disable'
def reset_disable(self):
self.enter['state'] = 'normal'
self.btn['state'] = 'normal'
class DeleteGarbageProgram(DeleteGarbageProgramBase):
def __init__(self, station, win, color):
super(DeleteGarbageProgram, self).__init__(station, win, color, "删除垃圾袋")
def delete_garbage(self):
where = self.int_var.get()
assert where in [0, 1, 2, 3]
gid = self.var.get()
if len(gid) == 0:
self.station.show_warning("垃圾袋ID错误", "请输入正确的垃圾袋ID")
return
event = tk_event.DelGarbageEvent(self.station).start(gid, where)
self.station.push_event(event)
class DeleteGarbageMoreProgram(DeleteGarbageProgramBase):
def __init__(self, station, win, color):
super(DeleteGarbageMoreProgram, self).__init__(station, win, color, "删除多个垃圾袋")
self.scan_btn = tk.Button(self.frame)
self._conf("条件:", "#f58f98", False)
def conf_gui(self, n: int = 1):
super(DeleteGarbageMoreProgram, self).conf_gui(n)
self.btn.place_forget()
self.btn.place(relx=0.2, rely=0.68, relwidth=0.2, relheight=0.08)
self.scan_btn['font'] = make_font(size=self.btn_font_size)
self.scan_btn['text'] = '扫描'
self.scan_btn['bg'] = Config.tk_btn_bg
self.scan_btn['command'] = self.scan_garbage
self.scan_btn.place(relx=0.6, rely=0.68, relwidth=0.2, relheight=0.08)
def set_disable(self):
super(DeleteGarbageMoreProgram, self).set_disable()
self.scan_btn['state'] = 'disable'
def reset_disable(self):
super(DeleteGarbageMoreProgram, self).reset_disable()
self.scan_btn['state'] = 'normal'
def delete_garbage(self):
where = self.int_var.get()
assert where in [1, 2, 3]
where_sql = self.var.get()
if len(where_sql) == 0:
self.station.show_warning("条件错误", "条件必须为正确的SQL语句")
return
event = tk_event.DelGarbageWhereEvent(self.station).start(where, where_sql)
self.station.push_event(event)
def scan_garbage(self):
where = self.int_var.get()
assert where in [1, 2, 3]
where_sql = self.var.get()
if len(where_sql) == 0:
self.station.show_warning("条件错误", "条件必须为正确的SQL语句")
return
event = tk_event.DelGarbageWhereScanEvent(self.station).start(where, where_sql)
self.station.push_event(event)
class DeleteAllGarbageProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "删除所有垃圾袋")
self.dangerous: tk.Label = tk.Label(self.frame)
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.var: tk.Variable = tk.StringVar()
self.btn: List[tk.Button] = [tk.Button(self.frame) for _ in range(2)] # del, scan
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.danger_font_size = int(20 * n)
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
danger_font = make_font(size=self.danger_font_size, weight="bold", underline=1)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
danger_btn_font = make_font(size=self.btn_font_size, weight="bold", overstrike=1)
self.dangerous['bg'] = self.color
self.dangerous['font'] = danger_font
self.dangerous['fg'] = "#f20c00"
self.dangerous['text'] = ("确定要从数据库删除所有垃圾袋吗?\n"
"请输入[admin]用户的密码再继续操作.\n"
"只有[admin]用户具有该操作的权限.\n"
"这是相当危险的操作.\n"
"操作后数据库可能无法恢复原数据.\n"
"SuperHuan和程序的缔造者不会对\n"
"此操作负责.\n"
"删库跑路可不是一件好事.\n"
"请遵守当地法律法规.")
self.dangerous.place(relx=0.05, rely=0.03, relwidth=0.9, relheight=0.53)
self.enter_frame['bg'] = "#f20c00"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.60, relwidth=0.6, relheight=0.10)
self.title['font'] = title_font
self.title['text'] = "密码:"
self.title['bg'] = "#f20c00"
self.title['anchor'] = 'e'
self.enter['font'] = title_font
self.enter['textvariable'] = self.var
self.title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
for btn, text, x in zip(self.btn, ["删除", "扫描"], [0.2, 0.6]):
btn['text'] = text
btn.place(relx=x, rely=0.78, relwidth=0.2, relheight=0.08)
self.btn[0]['font'] = danger_btn_font
self.btn[0]['bg'] = "#f20c00"
self.btn[0]['command'] = lambda: self.delete_garbage()
self.btn[1]['font'] = btn_font
self.btn[1]['bg'] = Config.tk_btn_bg
self.btn[1]['command'] = lambda: self.scan_garbage()
def scan_garbage(self):
event = tk_event.DelAllGarbageScanEvent(self.station) # 不需要start
self.station.push_event(event)
def delete_garbage(self):
passwd = self.var.get()
if len(passwd) == 0:
self.station.show_warning("密码错误", "请输入正确的[admin]用户密码")
user = find_user_by_name('admin', passwd, self.station.get_db())
if user is None or not user.is_manager():
self.station.show_warning("密码错误", "请输入正确的[admin]用户密码")
return
event = tk_event.DelAllGarbageEvent(self.station) # 不需要start
self.station.push_event(event)
def set_disable(self):
set_tk_disable_from_list(self.btn)
self.enter['state'] = 'disable'
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
self.enter['state'] = 'normal'
class SearchProgramBase(AdminProgram, metaclass=abc.ABCMeta):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.view_frame = tk.Frame(self.frame)
self.view = ttk.Treeview(self.view_frame)
self.y_scroll = tk.Scrollbar(self.view_frame)
self.x_scroll = tk.Scrollbar(self.view_frame)
def conf_view_gui(self, columns: list, relx, rely, relwidth, relheight,
x_scroll=0.05, y_scroll=0.02, color: str = "#FA8072"):
self.view_frame['bg'] = color
self.view_frame['bd'] = 2
self.view_frame['relief'] = "ridge"
self.view_frame.place(relx=relx, rely=rely, relwidth=relwidth, relheight=relheight)
self.view['columns'] = columns
self.view['show'] = 'headings'
self.view['selectmode'] = 'none'
for i in columns:
self.view.column(i, anchor="c")
self.view.heading(i, text=i)
self.y_scroll['orient'] = 'vertical'
self.y_scroll['command'] = self.view.yview
self.view['yscrollcommand'] = self.y_scroll.set
self.x_scroll['orient'] = 'horizontal'
self.x_scroll['command'] = self.view.xview
self.view['xscrollcommand'] = self.x_scroll.set
self.view.place(relx=0.0, rely=0.0, relwidth=1 - y_scroll, relheight=1 - x_scroll)
self.y_scroll.place(relx=0.98, rely=0.0, relwidth=y_scroll, relheight=1.0)
self.x_scroll.place(relx=0.0, rely=1 - x_scroll, relwidth=1 - y_scroll, relheight=x_scroll)
class SearchUserProgram(SearchProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "搜索用户")
self.enter_frame = tk.Frame(self.frame)
self.title: List[tk.Label] = [tk.Label(self.enter_frame) for _ in range(3)]
self.enter: List[tk.Entry] = [tk.Entry(self.enter_frame) for _ in range(3)]
self.var: List[tk.Variable] = [tk.StringVar() for _ in range(3)]
self.check: List[Tuple[tk.Checkbutton, tk.Variable]] = [(tk.Checkbutton(self.enter_frame), tk.IntVar())
for _ in range(3)]
self.btn: tk.Button = tk.Button(self.frame)
self._columns = ["UserID", "Name", "Phone", "Score", "Reputation", "IsManager"]
self._columns_ch = ["用户ID[UserID]", "用户名[Name]", "手机号[Phone]",
"积分[Score]", "垃圾分类信用[Reputation]", "是否管理员[IsManager]"]
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = "#FA8072"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.0, relwidth=0.6, relheight=0.30)
height = 0.1
for lb, text, enter, var, check in zip(self.title,
["用户ID:", "用户名:", "手机号:"],
self.enter, self.var, self.check):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = "#FA8072"
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var
check[0]['font'] = title_font
check[0]['text'] = ''
check[0]['bg'] = "#FA8072"
check[0]['variable'] = check[1]
check[1].set(1)
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.17)
enter.place(relx=0.35, rely=height, relwidth=0.55, relheight=0.17)
check[0].place(relx=0.92, rely=height, relwidth=0.04, relheight=0.17)
height += 0.30
self.btn['font'] = btn_font
self.btn['text'] = "搜索"
self.btn['bg'] = Config.tk_btn_bg
self.btn['command'] = self.search_user
self.btn.place(relx=0.4, rely=0.9, relwidth=0.2, relheight=0.08)
self.conf_view_gui(self._columns_ch, relx=0.05, rely=0.32, relwidth=0.9, relheight=0.55)
def search_user(self):
use_uid = self.check[0][1].get()
use_name = self.check[1][1].get()
use_phone = self.check[2][1].get()
uid = None
name = None
phone = None
if use_uid:
uid = self.var[0].get()
if len(uid) == 0:
uid = None
if use_name:
name = self.var[1].get()
if len(name) == 0:
name = None
if use_phone:
phone = self.var[2].get()
if len(phone) == 0:
phone = None
event = tk_event.SearchUserEvent(self.station).start(self._columns, uid, name, phone, self)
self.station.push_event(event)
def set_disable(self):
self.btn['state'] = 'disable'
set_tk_disable_from_list(self.enter)
def reset_disable(self):
self.btn['state'] = 'normal'
set_tk_disable_from_list(self.enter, flat='normal')
class SearchAdvancedProgramBase(SearchProgramBase, metaclass=abc.ABCMeta):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.var: tk.Variable = tk.StringVar()
self.btn: tk.Button = tk.Button(self.frame)
self._conf([], [], "#FA8072") # 默认颜色
self.__conf_font()
def _conf(self, columns: list, columns_ch: list, bg_color):
self.bg_color = bg_color
self._columns = columns
self._columns_ch = columns_ch
return self
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = self.bg_color
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.00, relwidth=0.6, relheight=0.10)
self.title['font'] = title_font
self.title['bg'] = self.bg_color
self.title['text'] = "条件:"
self.title['anchor'] = 'e'
self.enter['font'] = title_font
self.enter['textvariable'] = self.var
self.title.place(relx=0.01, rely=0.25, relwidth=0.30, relheight=0.50)
self.enter.place(relx=0.35, rely=0.25, relwidth=0.60, relheight=0.50)
self.btn['text'] = "搜索"
self.btn['font'] = btn_font
self.btn['bg'] = Config.tk_btn_bg
self.btn['command'] = self.search
self.btn.place(relx=0.4, rely=0.9, relwidth=0.2, relheight=0.08)
self.conf_view_gui(self._columns_ch, relx=0.05, rely=0.12, relwidth=0.9, relheight=0.76)
def search(self):
...
def set_disable(self):
self.btn['state'] = 'disable'
self.enter['state'] = 'disable'
def reset_disable(self):
self.btn['state'] = 'normal'
self.enter['state'] = 'normal'
class SearchUserAdvancedProgram(SearchAdvancedProgramBase):
def __init__(self, station, win, color):
super(SearchUserAdvancedProgram, self).__init__(station, win, color, "高级搜索-用户")
columns = ["UserID", "Name", "Phone", "Score", "Reputation", "IsManager"]
columns_ch = ["用户ID[UserID]", "用户名[Name]", "手机号[Phone]",
"积分[Score]", "垃圾分类信用[Reputation]", "是否管理员[IsManager]"]
self._conf(columns, columns_ch, '#48c0a3')
def search(self):
where = self.var.get()
event = tk_event.SearchUserAdvancedEvent(self.station).start(self._columns, where, self)
self.station.push_event(event)
class SearchGarbageProgram(SearchProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "搜索垃圾袋")
self.enter_frame = tk.Frame(self.frame)
self.title: List[tk.Label] = [tk.Label(self.enter_frame) for _ in range(8)]
self.enter: List[tk.Entry] = [tk.Entry(self.enter_frame) for _ in range(8)]
self.var: List[tk.Variable] = [tk.StringVar() for _ in range(8)]
self.check: List[Tuple[tk.Checkbutton, tk.Variable]] = [(tk.Checkbutton(self.enter_frame), tk.IntVar())
for _ in range(8)]
self._columns = ["GarbageID", "UserID", "CheckerID", "CreateTime", "UseTime", "Location", "GarbageType",
"CheckResult"]
self._columns_zh = ["垃圾袋ID[GarbageID]", "使用者ID[UserID]", "检测者ID[CheckerID]", "创建时间[CreateTime]",
"使用时间[UseTime]", "使用地点[Location]", "垃圾类型[GarbageType]", "检测结果[CheckResult]"]
self.btn: tk.Button = tk.Button(self.frame)
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.enter_frame['bg'] = "#7bbfea"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.0, relwidth=0.6, relheight=0.47)
height = 0.02
for lb, text, enter, var, check in zip(self.title,
["垃圾袋ID:", "使用者ID:", "检查者ID:", "创建时间:", "使用时间:",
"使用地点:", "垃圾类型:", "检测结果:"],
self.enter, self.var, self.check):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = "#7bbfea"
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var
check[0]['font'] = title_font
check[0]['bg'] = "#7bbfea"
check[0]['text'] = ''
check[0]['variable'] = check[1]
check[1].set(1)
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.10)
enter.place(relx=0.35, rely=height, relwidth=0.55, relheight=0.10)
check[0].place(relx=0.92, rely=height, relwidth=0.04, relheight=0.10)
height += 0.121
self.btn['font'] = btn_font
self.btn['bg'] = Config.tk_btn_bg
self.btn['text'] = "Search"
self.btn['command'] = self.search_user
self.btn.place(relx=0.4, rely=0.9, relwidth=0.2, relheight=0.08)
self.conf_view_gui(self._columns_zh, relx=0.05, rely=0.49, relwidth=0.9, relheight=0.38, x_scroll=0.07)
def search_user(self):
keys = ["gid", "uid", "cuid", "create_time", "use_time", "loc", "type_", "check"]
key_values = {}
for i, key in enumerate(keys):
ck = self.check[i][1].get()
if ck:
res = self.enter[i].get()
if len(res) > 0:
key_values[key] = res
continue
key_values[key] = None
event = tk_event.SearchGarbageEvent(self.station).start(self._columns, key_values, self)
self.station.push_event(event)
def set_disable(self):
self.btn['state'] = 'disable'
set_tk_disable_from_list(self.enter)
def reset_disable(self):
self.btn['state'] = 'normal'
set_tk_disable_from_list(self.enter, flat='normal')
class SearchGarbageAdvancedProgram(SearchAdvancedProgramBase):
def __init__(self, station, win, color):
super(SearchGarbageAdvancedProgram, self).__init__(station, win, color, "高级搜索-垃圾袋")
columns = ["GarbageID", "UserID", "CheckerID", "CreateTime", "UseTime", "Location", "GarbageType",
"CheckResult"]
columns_zh = ["垃圾袋ID[GarbageID]", "使用者ID[UserID]", "检测者ID[CheckerID]", "创建时间[CreateTime]",
"使用时间[UseTime]", "使用地点[Location]", "垃圾类型[GarbageType]", "检测结果[CheckResult]"]
self._conf(columns, columns_zh, '#d1923f')
def search(self):
where = self.var.get()
event = tk_event.SearchGarbageAdvancedEvent(self.station).start(self._columns, where, self)
self.station.push_event(event)
class SearchAdvancedProgram(SearchAdvancedProgramBase):
def __init__(self, station, win, color):
super(SearchAdvancedProgram, self).__init__(station, win, color, "高级搜索")
columns = ["GarbageID", "UserID", "UserName", "UserPhone", "UserScore",
"UserReputation", "CheckerID", "CheckerName", "CheckerPhone",
"CreateTime", "UseTime", "Location", "GarbageType", "CheckResult"]
columns_zh = ["垃圾袋ID[GarbageID]", "使用者ID[UserID]", "使用者名[UserName]", "使用者手机号[UserPhone]",
"使用者积分[UserScore]", "使用者垃圾分类信用[UserReputation]", "检测者ID[CheckerID]",
"检测这名[CheckerName]", "检测者手机号[CheckerPhone]", "创建时间[CreateTime]", "使用时间[UseTime]",
"使用地点[Location]", "垃圾类型[GarbageType]", "检测结果[CheckResult]"]
self._conf(columns, columns_zh, '#426ab3')
def search(self):
where = self.var.get()
event = tk_event.SearchAdvancedEvent(self.station).start(self._columns, where, self)
self.station.push_event(event)
class UpdateUserProgramBase(AdminProgram):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.enter_frame = tk.Frame(self.frame)
self.title: List[tk.Label] = [tk.Label(self.enter_frame) for _ in range(2)]
self.enter: List[tk.Entry] = [tk.Entry(self.enter_frame) for _ in range(2)]
self.var: List[tk.Variable] = [tk.StringVar() for _ in range(2)]
self.where_frame = tk.Frame(self.frame)
self.where_title: List[tk.Label] = [tk.Label(self.where_frame) for _ in range(2)]
self.where_enter: List[tk.Entry] = [tk.Entry(self.where_frame) for _ in range(2)]
self.where_var: List[tk.Variable] = [tk.StringVar() for _ in range(2)]
self.btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self._conf(["", ""], "#FA8072")
self.__conf_font()
def _conf(self, title: List[str], bg_color: str):
self.bg_color = bg_color
self.bg_color_where = bg_color
self.enter_title = title
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.where_frame['bg'] = self.bg_color_where
self.where_frame['bd'] = 5
self.where_frame['relief'] = "ridge"
self.where_frame.place(relx=0.2, rely=0.20, relwidth=0.6, relheight=0.17)
self.enter_frame['bg'] = self.bg_color
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.58, relwidth=0.6, relheight=0.17)
height = 0.1
for lb, text, enter, var, lb_w, text_w, enter_w, var_w in (
zip(self.title, self.enter_title, self.enter, self.var,
self.where_title, ["条件:", self.enter_title[1]], self.where_enter, self.where_var)):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = self.bg_color
lb['anchor'] = 'e'
lb_w['font'] = title_font
lb_w['text'] = text_w
lb_w['bg'] = self.bg_color_where
lb_w['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var
enter_w['font'] = title_font
enter_w['textvariable'] = var_w
lb.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.35)
enter.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.35)
lb_w.place(relx=0.01, rely=height, relwidth=0.30, relheight=0.35)
enter_w.place(relx=0.35, rely=height, relwidth=0.60, relheight=0.35)
height += 0.43
for btn, text, func in zip(self.btn,
["通过条件更新", "通过用户ID更新"],
[self.update_by_where, self.update_by_uid]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
btn['command'] = func
self.btn[0].place(relx=0.55, rely=0.40, relwidth=0.25, relheight=0.08)
self.btn[1].place(relx=0.55, rely=0.78, relwidth=0.25, relheight=0.08)
def update_by_uid(self):
...
def update_by_where(self):
...
def set_disable(self):
set_tk_disable_from_list(self.btn)
set_tk_disable_from_list(self.enter)
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
set_tk_disable_from_list(self.enter, flat='normal')
class UpdateUserScore(UpdateUserProgramBase):
def __init__(self, station, win, color):
super(UpdateUserScore, self).__init__(station, win, color, "更新用户-积分")
self._conf(["用户ID:", "积分:"], "#afdfe4")
def update_by_uid(self):
uid = self.enter[0].get()
score = int(self.enter[1].get())
event = tk_event.UpdateUserScoreEvent(self.station).start(score, f"UserID='{uid}'")
self.station.push_event(event)
def update_by_where(self):
where = self.where_enter[0].get()
score = int(self.where_enter[1].get())
event = tk_event.UpdateUserScoreEvent(self.station).start(score, where)
self.station.push_event(event)
class UpdateUserReputation(UpdateUserProgramBase):
def __init__(self, station, win, color):
super(UpdateUserReputation, self).__init__(station, win, color, "更新用户-垃圾分类信用")
self._conf(["用户ID:", "垃圾分类信用:"], "#f8aba6")
def update_by_uid(self):
uid = self.enter[0].get()
reputation = int(self.enter[1].get())
event = tk_event.UpdateUserReputationEvent(self.station).start(reputation, f"UserID='{uid}'")
self.station.push_event(event)
def update_by_where(self):
where = self.where_enter[0].get()
reputation = int(self.where_enter[1].get())
event = tk_event.UpdateUserReputationEvent(self.station).start(reputation, where)
self.station.push_event(event)
class UpdateGarbageTypeProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "更新垃圾袋-垃圾类型")
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.type: List[tk.Radiobutton] = [tk.Radiobutton(self.frame) for _ in range(4)]
self.var: List[tk.Variable] = [tk.StringVar, tk.IntVar()]
self.where_frame = tk.Frame(self.frame)
self.where_title: tk.Label = tk.Label(self.where_frame)
self.where_enter: tk.Entry = tk.Entry(self.where_frame)
self.where_type: List[tk.Radiobutton] = [tk.Radiobutton(self.frame) for _ in range(4)]
self.where_var: List[tk.Variable] = [tk.StringVar, tk.IntVar()]
self.btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.where_frame['bg'] = "#fdb933"
self.where_frame['bd'] = 5
self.where_frame['relief'] = "ridge"
self.where_frame.place(relx=0.2, rely=0.20, relwidth=0.6, relheight=0.10)
self.enter_frame['bg'] = "#fdb933"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.60, relwidth=0.6, relheight=0.10)
for lb, enter, radios, var, y, text in zip([self.title, self.where_title],
[self.enter, self.where_enter],
[self.type, self.where_type],
[self.var, self.where_var],
[0.32, 0.72],
["垃圾袋ID:", "条件:"]):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = "#fdb933"
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var[0]
for i, radio in enumerate(radios):
radio['font'] = btn_font
radio['bg'] = self.color
radio['text'] = GarbageType.GarbageTypeStrList_ch[i + 1]
radio['value'] = i + 1
radio['variable'] = var[1]
radio['anchor'] = 'w'
var[1].set(1)
radios[0].place(relx=0.20, rely=y + 0.00, relwidth=0.20, relheight=0.04)
radios[1].place(relx=0.60, rely=y + 0.00, relwidth=0.20, relheight=0.04)
radios[2].place(relx=0.20, rely=y + 0.05, relwidth=0.20, relheight=0.04)
radios[3].place(relx=0.60, rely=y + 0.05, relwidth=0.20, relheight=0.04)
lb.place(relx=0.02, rely=0.2, relwidth=0.25, relheight=0.48)
enter.place(relx=0.30, rely=0.2, relwidth=0.60, relheight=0.48)
for btn, text, func in zip(self.btn,
["通过条件更新", "通过垃圾袋ID更新"],
[self.update_by_where, self.update_by_gid]):
btn['font'] = btn_font
btn['text'] = text
btn['bg'] = Config.tk_btn_bg
btn['command'] = func
self.btn[0].place(relx=0.55, rely=0.43, relwidth=0.25, relheight=0.08)
self.btn[1].place(relx=0.55, rely=0.83, relwidth=0.25, relheight=0.08)
def update_by_gid(self):
gid = self.enter.get()
type_ = self.var[1].get()
event = tk_event.UpdateGarbageTypeEvent(self.station).start(type_, f"GarbageID={gid}")
self.station.push_event(event)
def update_by_where(self):
where = self.where_enter.get()
type_ = self.where_var[1].get()
event = tk_event.UpdateGarbageTypeEvent(self.station).start(type_, where)
self.station.push_event(event)
def set_disable(self):
set_tk_disable_from_list(self.btn)
self.enter['state'] = 'disable'
self.where_enter['state'] = 'normal'
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
self.enter['state'] = 'normal'
self.where_enter['state'] = 'normal'
class UpdateGarbageCheckResultProgram(AdminProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "更新垃圾袋-检测结果")
self.enter_frame = tk.Frame(self.frame)
self.title: tk.Label = tk.Label(self.enter_frame)
self.enter: tk.Entry = tk.Entry(self.enter_frame)
self.type: List[tk.Radiobutton] = [tk.Radiobutton(self.frame) for _ in range(2)]
self.var: List[tk.Variable] = [tk.StringVar, tk.IntVar()]
self.where_frame = tk.Frame(self.frame)
self.where_title: tk.Label = tk.Label(self.where_frame)
self.where_enter: tk.Entry = tk.Entry(self.where_frame)
self.where_type: List[tk.Radiobutton] = [tk.Radiobutton(self.frame) for _ in range(2)]
self.where_var: List[tk.Variable] = [tk.StringVar, tk.IntVar()]
self.btn: List[tk.Button] = [tk.Button(self.frame), tk.Button(self.frame)]
self.__conf_font()
def __conf_font(self, n: int = Config.tk_zoom):
self.title_font_size = int(16 * n)
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
title_font = make_font(size=self.title_font_size)
btn_font = make_font(size=self.btn_font_size)
self.where_frame['bg'] = "#abc88b"
self.where_frame['bd'] = 5
self.where_frame['relief'] = "ridge"
self.where_frame.place(relx=0.2, rely=0.20, relwidth=0.6, relheight=0.10)
self.enter_frame['bg'] = "#abc88b"
self.enter_frame['bd'] = 5
self.enter_frame['relief'] = "ridge"
self.enter_frame.place(relx=0.2, rely=0.60, relwidth=0.6, relheight=0.10)
for lb, enter, radios, var, y, text in zip([self.title, self.where_title],
[self.enter, self.where_enter],
[self.type, self.where_type],
[self.var, self.where_var],
[0.32, 0.72],
["垃圾袋ID:", "条件:"]):
lb['font'] = title_font
lb['text'] = text
lb['bg'] = "#abc88b"
lb['anchor'] = 'e'
enter['font'] = title_font
enter['textvariable'] = var[0]
for i, radio in enumerate(radios):
radio['font'] = btn_font
radio['bg'] = self.color
radio['text'] = ["投放错误", "投放正确"][i]
radio['value'] = i
radio['variable'] = var[1]
radio['anchor'] = 'w'
var[1].set(1)
radios[0].place(relx=0.20, rely=y + 0.00, relwidth=0.20, relheight=0.04)
radios[1].place(relx=0.60, rely=y + 0.00, relwidth=0.20, relheight=0.04)
lb.place(relx=0.02, rely=0.2, relwidth=0.25, relheight=0.48)
enter.place(relx=0.30, rely=0.2, relwidth=0.60, relheight=0.48)
for btn, text, func in zip(self.btn,
["通过条件更新", "通过垃圾袋ID更新"],
[self.update_by_where, self.update_by_gid]):
btn['font'] = btn_font
btn['bg'] = Config.tk_btn_bg
btn['text'] = text
btn['command'] = func
self.btn[0].place(relx=0.55, rely=0.38, relwidth=0.25, relheight=0.08)
self.btn[1].place(relx=0.55, rely=0.78, relwidth=0.25, relheight=0.08)
def update_by_gid(self):
gid = self.enter.get()
check = (self.var[1].get() == 1)
event = tk_event.UpdateGarbageCheckEvent(self.station).start(check, f"GarbageID={gid}")
self.station.push_event(event)
def update_by_where(self):
where = self.where_enter.get()
check = (self.where_var[1].get() == 1)
event = tk_event.UpdateGarbageCheckEvent(self.station).start(check, where)
self.station.push_event(event)
def set_disable(self):
set_tk_disable_from_list(self.btn)
self.enter['state'] = 'disable'
self.where_enter['state'] = 'normal'
def reset_disable(self):
set_tk_disable_from_list(self.btn, flat='normal')
self.enter['state'] = 'normal'
self.where_enter['state'] = 'normal'
class StatisticsTimeProgramBase(AdminProgram):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.figure_frame = tk.Frame(self.frame)
self.figure = Figure(dpi=100)
self.plt_1: Axes = self.figure.add_subplot(211) # 添加子图:2行1列第1个
self.plt_2: Axes = self.figure.add_subplot(212, sharex=self.plt_1) # 添加子图:2行1列第2个 (共享x轴)
self.figure.subplots_adjust(hspace=0.7)
self.canvas = FigureCanvasTkAgg(self.figure, master=self.figure_frame)
self.canvas_tk = self.canvas.get_tk_widget()
self.toolbar = NavigationToolbar2Tk(self.canvas, self.figure_frame)
self.color_frame = tk.Frame(self.frame)
self.show_list_tk = tk.Listbox(self.color_frame)
self.show_list_scroll = tk.Scrollbar(self.color_frame)
self.hide_list_tk = tk.Listbox(self.color_frame)
self.hide_list_scroll = tk.Scrollbar(self.color_frame)
self.btn_show = tk.Button(self.color_frame)
self.btn_hide = tk.Button(self.color_frame)
self.color_show_dict = {}
self.color_hide_dict = {}
self.export_lst = []
self.export_btn = tk.Button(self.frame)
self.refresh_btn = tk.Button(self.frame)
self.reset_btn = tk.Button(self.frame)
self.reverse_btn = tk.Button(self.frame)
self.legend_show = tk.Checkbutton(self.frame), tk.IntVar()
self._conf("#abc88b")
self.__conf_font()
def _conf(self, bg_color):
self.bg_color = bg_color
def __conf_font(self, n: int = Config.tk_zoom):
self.btn_font_size = int(14 * n)
self.little_btn_font_size = int(12 * n)
def to_program(self):
self.refresh()
def update_listbox(self):
self.show_list_tk.delete(0, tk.END) # 清空列表
self.hide_list_tk.delete(0, tk.END) # 清空列表
for i in self.color_show_dict:
self.show_list_tk.insert(tk.END, i)
self.show_list_tk.itemconfig(tk.END,
selectbackground=self.color_show_dict[i],
bg=self.color_show_dict[i],
selectforeground='#FFFFFF',
fg='#000000')
for i in self.color_hide_dict:
self.hide_list_tk.insert(tk.END, i)
self.hide_list_tk.itemconfig(tk.END,
selectbackground=self.color_hide_dict[i],
bg=self.color_hide_dict[i],
selectforeground='#FFFFFF',
fg='#000000')
def check_show(self, res: str):
color = self.color_show_dict.get(res)
if color is not None:
return color
color = self.color_hide_dict.get(res)
if color is not None:
return None
color = random_color()
self.color_show_dict[res] = color
return color
def hide(self):
i = self.show_list_tk.curselection()
if len(i) == 0:
return
res = self.show_list_tk.get(i[0])
self.hide_(res)
self.update_listbox()
def show(self):
i = self.hide_list_tk.curselection()
if len(i) == 0:
return
res = self.hide_list_tk.get(i[0])
self.show_(res)
self.update_listbox()
def hide_(self, res):
color = self.color_show_dict.get(res)
if color is not None:
del self.color_show_dict[res]
self.color_hide_dict[res] = color
def show_(self, res):
color = self.color_hide_dict.get(res)
if color is not None:
del self.color_hide_dict[res]
self.color_show_dict[res] = color
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
btn_font = make_font(size=self.btn_font_size)
little_btn_font = make_font(size=self.little_btn_font_size)
self.color_frame['bg'] = self.bg_color
self.color_frame['bd'] = 5
self.color_frame['relief'] = "ridge"
self.show_list_tk.place(relx=0, rely=0, relwidth=0.90, relheight=0.475)
self.show_list_scroll.place(relx=0.90, rely=0, relwidth=0.10, relheight=0.475)
self.show_list_scroll['orient'] = 'vertical'
self.show_list_scroll['command'] = self.show_list_tk.yview
self.show_list_tk['yscrollcommand'] = self.show_list_scroll.set
self.show_list_tk['activestyle'] = tk.NONE
self.hide_list_tk.place(relx=0, rely=0.525, relwidth=0.90, relheight=0.475)
self.hide_list_scroll.place(relx=0.90, rely=0.525, relwidth=0.10, relheight=0.475)
self.hide_list_scroll['orient'] = 'vertical'
self.hide_list_scroll['command'] = self.hide_list_tk.yview
self.hide_list_tk['yscrollcommand'] = self.hide_list_scroll.set
self.hide_list_tk['activestyle'] = tk.NONE
for btn, text, func, x in zip([self.btn_show, self.btn_hide],
["显示", "隐藏"],
[self.show, self.hide],
[0.00, 0.50]):
btn['font'] = little_btn_font
btn['bg'] = Config.tk_btn_bg
btn['text'] = text
btn['command'] = func
btn.place(relx=x, rely=0.475, relwidth=0.50, relheight=0.05)
self.color_frame.place(relx=0.01, rely=0.02, relwidth=0.18, relheight=0.88)
self.figure_frame['bg'] = self.bg_color
self.figure_frame['bd'] = 5
self.figure_frame['relief'] = "ridge"
self.figure_frame.place(relx=0.21, rely=0.02, relwidth=0.79, relheight=0.88)
self.canvas_tk.place(relx=0, rely=0, relwidth=1.0, relheight=0.9)
self.toolbar.place(relx=0, rely=0.9, relwidth=1.0, relheight=0.1)
for btn, text, func, x in zip([self.reset_btn, self.reverse_btn, self.refresh_btn, self.export_btn],
["复位选择", "反转选择", "刷新数据", "导出数据"],
[self.reset, self.reverse, self.refresh, self.export],
[0.37, 0.53, 0.69, 0.85]):
btn['font'] = btn_font
btn['bg'] = Config.tk_btn_bg
btn['text'] = text
btn['command'] = func
btn.place(relx=x, rely=0.91, relwidth=0.15, relheight=0.08)
self.legend_show[0]['font'] = btn_font
self.legend_show[0]['bg'] = self.color
self.legend_show[0]['text'] = "显示图例"
self.legend_show[0]['variable'] = self.legend_show[1]
self.legend_show[0].place(relx=0.21, rely=0.91, relwidth=0.15, relheight=0.08)
def export(self, title, func: Callable):
path = asksaveasfilename(title='选择CSV文件保存位置', filetypes=[("CSV", ".csv")])
if not path.endswith(".csv"):
path += ".csv"
with open(path, "w") as f:
f.write(f"Hour, Count, {title}\n")
for i in self.export_lst:
f.write(f"{i[0]}, {i[1]}, {func(i)}\n")
self.station.show_msg("保存数据", f"数据导出成功\n保存位置:\n {path}")
def refresh(self):
self.plt_1.cla()
self.plt_2.cla()
def reset(self):
self.color_show_dict.update(self.color_hide_dict)
self.color_hide_dict = {}
self.update_listbox()
def reverse(self):
tmp = self.color_show_dict
self.color_show_dict = self.color_hide_dict
self.color_hide_dict = tmp
self.update_listbox()
def show_result(self, res: Dict[str, any], lst: List):
bottom = np.zeros(24)
label_num = [i for i in range(24)]
label_str = [f"{i}" for i in range(24)]
res_type_lst: List = res['res_type']
self.export_lst = lst
max_y_plot = 1
max_y_bar = 1
for res_type in res_type_lst:
res_count: Tuple[str] = res[res_type]
if len(res_count) != 0:
color = self.check_show(res_type)
if color is None:
continue
y = [0 for _ in range(24)]
for i in res_count:
y[int(i[0])] += int(i[1])
self.color_show_dict[res_type] = color
self.plt_1.bar(label_num, y,
color=color,
align="center",
bottom=bottom,
tick_label=label_str,
label=res_type)
self.plt_2.plot(label_num, y,
color=color,
label=res_type,
marker='o',
markersize=5)
bottom += np.array(y)
max_y_plot = max(max(y), max_y_plot)
if self.legend_show[1].get() == 1: # 显示图例
self.plt_1.legend(loc="upper left")
self.plt_2.legend(loc="upper left")
self.plt_1.set_xlim(-1, 24)
self.plt_1.set_xticks([i for i in range(0, 24, 2)])
self.plt_1.set_xticklabels([f"{i}h" for i in range(0, 24, 2)])
max_y_bar = int(max(bottom.max(), max_y_bar))
self.plt_1.set_ylim(0, max_y_bar + max_y_bar * 0.1)
step = ceil(max_y_bar / 5) # 向上取整
if step > 0:
y_ticks = [i for i in range(0, max_y_bar, step)]
y_ticklabels = [f'{i}' for i in range(0, max_y_bar, step)]
else:
y_ticks = []
y_ticklabels = []
y_ticks.append(max_y_bar)
y_ticklabels.append(f"{max_y_bar}")
self.plt_1.set_yticks(y_ticks)
self.plt_1.set_yticklabels(y_ticklabels) # 倒序
self.plt_1.spines['right'].set_color('none')
self.plt_1.spines['top'].set_color('none')
self.plt_1.grid(axis='y')
self.plt_1.set_title(f"{self.program_title}柱状图")
self.plt_2.set_xlim(-1, 24)
self.plt_2.set_xticks([i for i in range(0, 24, 2)])
self.plt_2.set_xticklabels([f"{i}h" for i in range(0, 24, 2)])
self.plt_2.set_ylim(0, max_y_plot + max_y_plot * 0.1)
step = ceil(max_y_plot / 5) # 向上取整
if step > 0:
y_ticks = [i for i in range(0, max_y_plot, step)]
y_ticklabels = [f'{i}' for i in range(0, max_y_plot, step)]
else:
y_ticks = []
y_ticklabels = []
y_ticks.append(max_y_plot)
y_ticklabels.append(f"{max_y_plot}")
self.plt_2.set_yticks(y_ticks)
self.plt_2.set_yticklabels(y_ticklabels)
self.plt_2.spines['right'].set_color('none')
self.plt_2.spines['top'].set_color('none')
self.plt_2.grid(axis='y')
self.plt_2.set_title(f"{self.program_title}折线图")
self.canvas.draw()
self.toolbar.update()
self.update_listbox()
def set_disable(self):
self.export_btn['state'] = 'disable'
self.reset_btn['state'] = 'disable'
self.refresh_btn['state'] = 'disable'
self.reverse_btn['state'] = 'disable'
self.btn_show['state'] = 'disable'
self.btn_hide['state'] = 'disable'
def reset_disable(self):
self.export_btn['state'] = 'normal'
self.reset_btn['state'] = 'normal'
self.refresh_btn['state'] = 'normal'
self.reverse_btn['state'] = 'normal'
self.btn_show['state'] = 'normal'
self.btn_hide['state'] = 'normal'
class StatisticsTimeLocProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-按投放区域")
self._conf("#abc88b")
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station).start(["Location"], lambda i: i[2], self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Location", lambda i: i[2])
class StatisticsTimeTypeProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-按投放类型")
self._conf("#abc88b")
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[1]] = "#00BFFF"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[2]] = "#32CD32"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[3]] = "#DC143C"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[4]] = "#A9A9A9"
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station).start(["GarbageType"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Type", self.get_name)
@staticmethod
def get_name(i: Tuple):
data: bytes = i[2]
return GarbageType.GarbageTypeStrList_ch[int(data.decode('utf-8'))]
class StatisticsTimeTypeLocProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-按投放类型和区域")
self._conf("#abc88b")
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station).start(["GarbageType", "Location"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Type-Location", self.get_name)
@staticmethod
def get_name(i: Tuple):
data: bytes = i[2]
return f"{GarbageType.GarbageTypeStrList_ch[int(data.decode('utf-8'))]}-{i[3]}"
class StatisticsTimeCheckResultProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-按检查结果")
self._conf("#abc88b")
self.color_show_dict['Pass'] = "#00BFFF"
self.color_show_dict['Fail'] = "#DC143C"
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station).start(["CheckResult"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Result", self.get_name)
@staticmethod
def get_name(i: Tuple):
if i[2] is None:
return 'None'
data: bytes = i[2]
return 'Pass' if data == DBBit.BIT_1 else 'Fail'
class StatisticsTimeCheckResultAndTypeProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-按检查结果和类型")
self._conf("#abc88b")
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station).start(["CheckResult", "GarbageType"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Result-Location", self.get_name)
@staticmethod
def get_name(i: Tuple):
data_1: bytes = i[2]
data_2: bytes = i[3]
if data_1 is None:
tmp = 'None'
elif data_1 == DBBit.BIT_1:
tmp = 'Pass'
else:
tmp = 'Fail'
return tmp + f'-{GarbageType.GarbageTypeStrList_ch[int(data_2.decode("utf-8"))]}'
class StatisticsTimeCheckResultAndLocProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-按检查结果和区域")
self._conf("#abc88b")
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station).start(["CheckResult", "Location"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Result-Type", self.get_name)
@staticmethod
def get_name(i: Tuple):
if i[2] is None:
return 'None'
data_1: bytes = i[2]
return (f'Pass' if data_1 == DBBit.BIT_1 else 'Fail') + f"-{i[3]}"
class StatisticsTimeDetailProgram(StatisticsTimeProgramBase):
def __init__(self, station, win, color):
super().__init__(station, win, color, "时段分析-详细分类")
self._conf("#abc88b")
def refresh(self):
super().refresh()
event = tk_event.CountTimeEvent(self.station)
event.start(["CheckResult", "GarbageType", "Location"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Detail", self.get_name)
@staticmethod
def get_name(i: Tuple):
data_1: bytes = i[2]
data_2: bytes = i[3]
if data_1 is None:
tmp = 'None'
elif data_1 == DBBit.BIT_1:
tmp = 'Pass'
else:
tmp = 'Fail'
return tmp + f'-{GarbageType.GarbageTypeStrList_ch[int(data_2.decode("utf-8"))]}' + f'-{i[4]}'
class StatisticsUserBaseProgram(AdminProgram):
def __init__(self, station, win, color, title: str):
super().__init__(station, win, color, title)
self.figure_frame = tk.Frame(self.frame)
self.figure = Figure(dpi=100)
self.plt: Axes = self.figure.add_subplot(111) # 添加子图:1行1列第1个
self.figure.subplots_adjust(bottom=0.2, top=0.93)
self.canvas = FigureCanvasTkAgg(self.figure, master=self.figure_frame)
self.canvas_tk = self.canvas.get_tk_widget()
self.toolbar = NavigationToolbar2Tk(self.canvas, self.figure_frame)
self.color_bar: Optional[Colorbar] = None
self.export_lst: Optional[np.array] = None
self.export_btn = tk.Button(self.frame)
self.refresh_btn = tk.Button(self.frame)
self._conf("#abc88b")
self.__conf_font()
def _conf(self, bg_color):
self.bg_color = bg_color
def __conf_font(self, n: int = Config.tk_zoom):
self.btn_font_size = int(14 * n)
def conf_gui(self, n: int = 1):
self.__conf_font(n * Config.tk_zoom)
btn_font = make_font(size=self.btn_font_size)
self.figure_frame['bg'] = self.bg_color
self.figure_frame['bd'] = 5
self.figure_frame['relief'] = "ridge"
self.figure_frame.place(relx=0.00, rely=0.02, relwidth=1, relheight=0.88)
self.canvas_tk.place(relx=0, rely=0, relwidth=1.0, relheight=0.9)
self.toolbar.place(relx=0, rely=0.9, relwidth=1.0, relheight=0.1)
for btn, text, func, x in zip([self.refresh_btn, self.export_btn],
["刷新数据", "导出数据"],
[self.refresh, self.export],
[0.34, 0.51]):
btn['font'] = btn_font
btn['bg'] = Config.tk_btn_bg
btn['text'] = text
btn['command'] = func
btn.place(relx=x, rely=0.91, relwidth=0.15, relheight=0.08)
def export(self):
...
def refresh(self, event_class):
self.plt.cla()
if self.color_bar is not None:
self.color_bar.remove()
event = event_class(self.station).start(self)
self.station.push_event(event)
def set_disable(self):
self.export_btn['state'] = 'disable'
self.refresh_btn['state'] = 'disable'
def reset_disable(self):
self.export_btn['state'] = 'normal'
self.refresh_btn['state'] = 'normal'
class StatisticsUserTinyProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsUserTinyProgram, self).__init__(station, win, color, "积分信用分析-细致")
def show_result(self, lst: np.array):
self.export_lst = lst
x_label = [f'{i * 10}' for i in range(0, 51, 10)]
y_label = [f'{i * 10}' for i in range(0, 101, 20)]
im = self.plt.pcolormesh(lst, cmap='Blues') # 用cmap设置配色方案
self.plt.set_xticks(range(0, 101, 20)) # 设置x轴刻度
self.plt.set_yticks(range(0, 101, 20)) # 设置y轴刻度
self.plt.set_xticklabels(x_label) # 设置x轴刻度标签
self.plt.set_yticklabels(y_label) # 设置y轴刻度标签
self.plt.set_xlabel("用户积分") # 设置x轴刻度标签
self.plt.set_ylabel("垃圾分类信用") # 设置y轴刻度标签
self.color_bar = self.figure.colorbar(im, pad=0.03, ax=self.plt) # 设置颜色条
self.plt.set_title("积分信用分析-细致热图") # 设置标题以及其位置和字体大小
self.canvas.draw()
self.toolbar.update()
def export(self):
if self.export_lst is None:
self.station.show_msg("保存数据", f"没有数据需要保存")
return
path = asksaveasfilename(title='选择CSV文件保存位置', filetypes=[("CSV", ".csv")])
if not path.endswith(".csv"):
path += ".csv"
with open(path, "w") as f:
f.write("#, " + ", ".join([f'[{i * 10} {i * 10 + 10}]' for i in range(0, 100, 1)]) + "\n")
for i, lst in zip(range(0, 50, 1), self.export_lst):
f.write(f"[{i * 10} {i * 10 + 10}], " + ", ".join([f"{a}" for a in lst]) + "\n")
self.station.show_msg("保存数据", f"数据导出成功\n保存位置:\n {path}")
def to_program(self):
self.refresh()
def refresh(self, _=None):
super().refresh(tk_event.CountScoreReputationTinyEvent)
class StatisticsUserLargeProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsUserLargeProgram, self).__init__(station, win, color, "积分信用分析-大致")
def show_result(self, lst: np.array):
self.export_lst = lst
x_label = [f'{i * 10}' for i in range(0, 51, 10)]
y_label = [f'{i * 10}' for i in range(0, 101, 20)]
im = self.plt.pcolormesh(lst, cmap='Blues') # 用cmap设置配色方案
self.plt.set_xticks(range(0, 11, 2)) # 设置x轴刻度
self.plt.set_yticks(range(0, 11, 2)) # 设置y轴刻度
self.plt.set_xticklabels(x_label) # 设置x轴刻度标签
self.plt.set_yticklabels(y_label) # 设置y轴刻度标签
self.plt.set_xlabel("用户积分") # 设置x轴刻度标签
self.plt.set_ylabel("垃圾分类信用") # 设置y轴刻度标签
self.color_bar = self.figure.colorbar(im, pad=0.03, ax=self.plt) # 设置颜色条
self.plt.set_title("积分信用分析-大致热图") # 设置标题以及其位置和字体大小
self.canvas.draw()
self.toolbar.update()
def export(self):
if self.export_lst is None:
self.station.show_msg("保存数据", f"没有数据需要保存")
return
path = asksaveasfilename(title='选择CSV文件保存位置', filetypes=[("CSV", ".csv")])
if not path.endswith(".csv"):
path += ".csv"
with open(path, "w") as f:
f.write("#, " + ", ".join([f'[{i * 10} {i * 10 + 100}]' for i in range(0, 100, 10)]) + "\n")
for i, lst in zip(range(0, 50, 5), self.export_lst):
f.write(f"[{i * 10} {i * 10 + 50}], " + ", ".join([f"{a}" for a in lst]) + "\n")
self.station.show_msg("保存数据", f"数据导出成功\n保存位置:\n {path}")
def to_program(self):
self.refresh()
def refresh(self, _=None):
super().refresh(tk_event.CountScoreReputationLargeEvent)
class StatisticsScoreDistributedProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsScoreDistributedProgram, self).__init__(station, win, color, "积分分布")
def show_result(self, lst: np.array):
bins = [i for i in range(0, 501, 10)]
res = self.plt.hist(lst, bins)
self.export_lst = res[0]
self.plt.set_xlabel("用户积分") # 设置x轴刻度标签
self.plt.set_ylabel("分布") # 设置x轴刻度标签
self.plt.set_title("积分分布直方图") # 设置标题以及其位置和字体大小
self.canvas.draw()
self.toolbar.update()
def export(self):
if self.export_lst is None:
self.station.show_msg("保存数据", f"没有数据需要保存")
return
path = asksaveasfilename(title='选择CSV文件保存位置', filetypes=[("CSV", ".csv")])
if not path.endswith(".csv"):
path += ".csv"
with open(path, "w") as f:
f.write("积分区间," + ", ".join([f'[{i * 10} {i * 10 + 100}]' for i in range(0, 501, 10)]) + "\n")
f.write("积分分布," + ", ".join([f'{i}' for i in self.export_lst]) + "\n")
self.station.show_msg("保存数据", f"数据导出成功\n保存位置:\n {path}")
def to_program(self):
self.refresh()
def refresh(self, _=None):
self.plt.cla()
if self.color_bar is not None:
self.color_bar.remove()
event = tk_event.ScoreReputationDistributedEvent(self.station).start("Score", self)
self.station.push_event(event)
class StatisticsReputationDistributedProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsReputationDistributedProgram, self).__init__(station, win, color, "垃圾分类信用分布")
def show_result(self, lst: np.array):
bins = [i for i in range(0, 1001, 20)]
res = self.plt.hist(lst, bins)
self.export_lst = res[0]
self.plt.set_xlabel("垃圾分类信用") # 设置x轴刻度标签
self.plt.set_ylabel("分布") # 设置x轴刻度标签
self.plt.set_title("垃圾分类信用分布直方图") # 设置标题以及其位置和字体大小
self.canvas.draw()
self.toolbar.update()
def export(self):
if self.export_lst is None:
self.station.show_msg("保存数据", f"没有数据需要保存")
return
path = asksaveasfilename(title='选择CSV文件保存位置', filetypes=[("CSV", ".csv")])
if not path.endswith(".csv"):
path += ".csv"
with open(path, "w") as f:
f.write("信用区间," + ", ".join([f'[{i * 10} {i * 10 + 100}]' for i in range(0, 501, 10)]) + "\n")
f.write("信用分布," + ", ".join([f'{i}' for i in self.export_lst]) + "\n")
self.station.show_msg("保存数据", f"数据导出成功\n保存位置:\n {path}")
def to_program(self):
self.refresh()
def refresh(self, _=None):
self.plt.cla()
if self.color_bar is not None:
self.color_bar.remove()
event = tk_event.ScoreReputationDistributedEvent(self.station).start("Reputation", self)
self.station.push_event(event)
class StatisticsPassRateGlobalProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsPassRateGlobalProgram, self).__init__(station, win, color, "通过率-全局")
def show_result(self, lst: np.array):
passing = float(lst[0][0])
not_passing = 1 - passing
data = [passing, not_passing]
label = ["通过", "未通过"]
res = self.plt.pie(data, radius=1, pctdistance=0.7, textprops=dict(color='w'), # 不显示文字
startangle=45, autopct="%6.3f%%", wedgeprops=dict(width=0.6, edgecolor="w"))
self.plt.legend(res[0], label, loc="lower left")
self.plt.set_title("全局垃圾分类通过率") # 设置标题以及其位置和字体大小
self.plt.table(cellText=[data], cellLoc="center", colLabels=label,
rowLabels=['全局'], rowLoc='center', loc='bottom', colWidths=[0.4] * 2)
self.canvas.draw()
self.toolbar.update()
def export(self):
self.station.show_msg("保存数据", f"数据不支持导出")
return
def to_program(self):
self.refresh()
def refresh(self, _=None):
self.plt.cla()
event = tk_event.PassingRateEvent(self.station).start([], [], [], [], self)
self.station.push_event(event)
class StatisticsPassRateTypeProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsPassRateTypeProgram, self).__init__(station, win, color, "通过率-按类型")
def show_result(self, lst: List[Tuple[bytes, any]]):
data_1, data_2, data_3, data_4 = [1.0, 0.0], [1.0, 0.0], [1.0, 0.0], [1.0, 0.0]
for i in lst:
tmp: bytes = i[0]
type_ = tmp.decode('utf-8')
if type_ == '1':
data_1 = [float(i[1]), 1 - float(i[1])]
elif type_ == '2':
data_2 = [float(i[1]), 1 - float(i[1])]
elif type_ == '3':
data_3 = [float(i[1]), 1 - float(i[1])]
elif type_ == '4':
data_4 = [float(i[1]), 1 - float(i[1])]
legend_text = []
for data, r, s in zip([data_1, data_2, data_3, data_4], [0.3, 0.6, 0.9, 1.2], [0, 15, 30, 45]):
res = self.plt.pie(data, radius=r, pctdistance=0.7, # 不显示文字
startangle=s, autopct="%6.3f%%", wedgeprops=dict(width=0.3, edgecolor="w"))
legend_text += res[0]
label = []
for i in GarbageType.GarbageTypeStrList_ch[1:]:
label.append(f"{i}-通过")
label.append(f"{i}-不通过")
self.plt.table(cellText=[data_1, data_2, data_3, data_4], cellLoc="center", colLabels=['通过', '未通过'],
rowLabels=GarbageType.GarbageTypeStrList_ch[1:], rowLoc='center', loc='bottom')
self.plt.legend(legend_text, label)
self.plt.set_title("全局垃圾分类通过率") # 设置标题以及其位置和字体大小
self.canvas.draw()
self.toolbar.update()
def export(self):
self.station.show_msg("保存数据", f"数据不支持导出")
return
def to_program(self):
self.refresh()
def refresh(self, _=None):
self.plt.cla()
event = tk_event.PassingRateEvent(self.station).start(["GarbageType"],
[],
["g.GarbageType=garbage.GarbageType"],
["GarbageType"], self)
self.station.push_event(event)
class StatisticsPassRateLocProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsPassRateLocProgram, self).__init__(station, win, color, "通过率-按区域")
self.loc_frame = tk.Frame(self.frame)
self.loc_title = tk.Label(self.loc_frame)
self.loc_enter = tk.Entry(self.loc_frame), tk.StringVar()
def conf_gui(self, n: int = 1):
super(StatisticsPassRateLocProgram, self).conf_gui(n)
title_font = make_font(size=16)
self.loc_frame['bg'] = self.bg_color
self.loc_frame['bd'] = 5
self.loc_frame['relief'] = "ridge"
self.loc_frame.place(relx=0.0, rely=0.92, relwidth=0.33, relheight=0.07)
self.loc_title['font'] = title_font
self.loc_title['text'] = "区域:"
self.loc_title['bg'] = self.bg_color
self.loc_title['anchor'] = 'e'
self.loc_enter[0]['font'] = title_font
self.loc_enter[0]['textvariable'] = self.loc_enter[1]
self.loc_title.place(relx=0.0, rely=0.02, relwidth=0.3, relheight=0.96)
self.loc_enter[0].place(relx=0.3, rely=0.02, relwidth=0.7, relheight=0.96)
def show_result(self, lst: np.array):
passing = float(lst[0][0])
label = ["通过", "未通过"]
not_passing = 1 - passing
data = [passing, not_passing]
res = self.plt.pie(data, radius=1, pctdistance=0.7, textprops=dict(color='w'), # 不显示文字
startangle=45, autopct="%6.3f%%", wedgeprops=dict(width=0.6, edgecolor="w"))
self.plt.legend(res[0], label, loc="lower left")
self.plt.table(cellText=[data], cellLoc="center", colLabels=label,
rowLabels=[f"区域"], rowLoc='center', loc='bottom')
self.canvas.draw()
self.toolbar.update()
def to_program(self):
self.refresh()
def refresh(self, _=None):
where = self.loc_enter[1].get()
if len(where) == 0:
where = "全局"
where_ = []
else:
where_ = [f"Location='{where}'"]
self.plt.cla()
self.plt.set_title(f"{where}垃圾分类通过率") # 设置标题以及其位置和字体大小
event = tk_event.PassingRateEvent(self.station).start([], where_, where_, [], self)
self.station.push_event(event)
class StatisticsPassRateTypeAndLocProgram(StatisticsUserBaseProgram):
def __init__(self, station, win, color):
super(StatisticsPassRateTypeAndLocProgram, self).__init__(station, win, color, "通过率-按类型和区域")
self.loc_frame = tk.Frame(self.frame)
self.loc_title = tk.Label(self.loc_frame)
self.loc_enter = tk.Entry(self.loc_frame), tk.StringVar()
def conf_gui(self, n: int = 1):
super(StatisticsPassRateTypeAndLocProgram, self).conf_gui(n)
title_font = make_font(size=16)
self.loc_frame['bg'] = self.bg_color
self.loc_frame['relief'] = "ridge"
self.loc_frame['bd'] = 5
self.loc_frame.place(relx=0.0, rely=0.92, relwidth=0.33, relheight=0.07)
self.loc_title['font'] = title_font
self.loc_title['bg'] = self.bg_color
self.loc_title['text'] = "区域:"
self.loc_title['anchor'] = 'e'
self.loc_enter[0]['font'] = title_font
self.loc_enter[0]['textvariable'] = self.loc_enter[1]
self.loc_title.place(relx=0.0, rely=0.02, relwidth=0.3, relheight=0.96)
self.loc_enter[0].place(relx=0.3, rely=0.02, relwidth=0.7, relheight=0.96)
def show_result(self, lst: List[Tuple[bytes, any]]):
data_1, data_2, data_3, data_4 = [1.0, 0.0], [1.0, 0.0], [1.0, 0.0], [1.0, 0.0]
for i in lst:
tmp: bytes = i[0]
type_ = tmp.decode('utf-8')
if type_ == '4':
data_4 = [float(i[1]), 1 - float(i[1])]
elif type_ == '3':
data_3 = [float(i[1]), 1 - float(i[1])]
elif type_ == '2':
data_2 = [float(i[1]), 1 - float(i[1])]
elif type_ == '1':
data_1 = [float(i[1]), 1 - float(i[1])]
legend_text = []
for data, r, s in zip([data_1, data_2, data_3, data_4], [0.3, 0.6, 0.9, 1.2], [5, 20, 35, 50]):
res = self.plt.pie(data, radius=r, pctdistance=0.7, # 不显示文字
startangle=s, autopct="%6.3f%%", wedgeprops=dict(width=0.3, edgecolor="w"))
legend_text += res[0]
label = []
for i in GarbageType.GarbageTypeStrList_ch[1:]:
label.append(f"{i}-通过")
label.append(f"{i}-不通过")
self.plt.table(cellText=[data_1, data_2, data_3, data_4], cellLoc="center", colLabels=['通过', '未通过'],
rowLabels=GarbageType.GarbageTypeStrList_ch[1:], rowLoc='center', loc='bottom')
self.plt.legend(legend_text, label)
self.canvas.draw()
self.toolbar.update()
def export(self):
self.station.show_msg("保存数据", f"数据不支持导出")
return
def to_program(self):
self.refresh()
def refresh(self, _=None):
where = self.loc_enter[1].get()
if len(where) == 0:
where = "全局"
where_ = []
else:
where_ = [f"Location='{where}'"]
self.plt.cla()
self.plt.set_title(f"{where}垃圾分类通过率") # 设置标题以及其位置和字体大小
event = tk_event.PassingRateEvent(self.station).start(["GarbageType"],
where_,
where_ + ["g.GarbageType=garbage.GarbageType"],
["GarbageType"], self)
self.station.push_event(event)
class StatisticsDateProgramBase(StatisticsTimeProgramBase):
def _conf(self, bg_color, days: int = 7, days_sep: int = 1):
super(StatisticsDateProgramBase, self)._conf(bg_color)
self._days = days
self._days_sep = days_sep
def export(self, title, func: Callable):
path = asksaveasfilename(title='选择CSV文件保存位置', filetypes=[("CSV", ".csv")])
if not path.endswith(".csv"):
path += ".csv"
with open(path, "w") as f:
f.write(f"Days, Count, {title}\n")
for i in self.export_lst:
f.write(f"{i[0]}, {i[1]}, {func(i)}\n")
self.station.show_msg("保存数据", f"数据导出成功\n保存位置:\n {path}")
def show_result(self, res: Dict[str, any], lst: List, end_time: Optional[str] = None):
if end_time is None:
end_time = datetime.datetime.now()
else:
end_time = datetime.datetime.strptime(end_time, '%Y-%m-%d')
bottom = np.zeros(self._days)
label_num = [i for i in range(self._days)]
label_str = [f"{i}" for i in range(self._days)]
res_type_lst: List = res['res_type']
self.export_lst = lst
max_y_plot = 1 # max_y的最大值
max_y_bar = 1 # max_y的最大值
for res_type in res_type_lst:
res_count: List[Tuple[int, int, bytes]] = res[res_type] # 距离今天的日期, 统计值, 分类值
if len(res_count) != 0:
color = self.check_show(res_type)
if color is None:
continue
y = [0 for _ in range(self._days)]
for i in range(0, len(res_count)): # 反向迭代列表
y[res_count[i][0]] = res_count[i][1]
y = y[::-1] # 反转列表, 使距离今天小的数据靠数据轴右侧
max_y_plot = max(max(y), max_y_plot)
self.color_show_dict[res_type] = color
self.plt_1.plot(label_num, y,
color=color,
label=res_type,
marker='o',
markersize=5)
self.plt_2.bar(label_num, y,
color=color,
align="center",
bottom=bottom,
tick_label=label_str,
label=res_type)
bottom += np.array(y)
if self.legend_show[1].get() == 1: # 显示图例
self.plt_1.legend(loc="upper left")
self.plt_2.legend(loc="upper left")
x_label = []
for i in range(self._days - 1, -1, -self._days_sep):
d = end_time - datetime.timedelta(days=i)
x_label.append(d.strftime("%Y-%m-%d"))
self.plt_1.set_xlim(-1, self._days)
self.plt_1.set_xticks([i for i in range(0, self._days, self._days_sep)])
self.plt_1.set_xticklabels(x_label, rotation=20) # 倒序
self.plt_1.set_ylim(0, max_y_plot + max_y_plot * 0.1)
step = ceil(max_y_plot / 5) # 向上取整
if step > 0:
y_ticks = [i for i in range(0, max_y_plot, step)]
y_ticklabels = [f'{i}' for i in range(0, max_y_plot, step)]
else:
y_ticks = []
y_ticklabels = []
y_ticks.append(max_y_plot)
y_ticklabels.append(f"{max_y_plot}")
self.plt_1.set_yticks(y_ticks)
self.plt_1.set_yticklabels(y_ticklabels)
self.plt_1.spines['right'].set_color('none')
self.plt_1.spines['top'].set_color('none')
self.plt_1.grid(axis='y')
self.plt_1.set_title(f"{self.program_title}折线图")
self.plt_2.set_xlim(-1, self._days)
self.plt_2.set_xticks([i for i in range(0, self._days, self._days_sep)])
self.plt_2.set_xticklabels(x_label, rotation=20)
max_y_bar = int(max(bottom.max(), max_y_bar))
self.plt_2.set_ylim(0, max_y_bar + max_y_bar * 0.1)
step = ceil(max_y_bar / 5) # 向上取整
if step > 0:
y_ticks = [i for i in range(0, max_y_bar, step)]
y_ticklabels = [f'{i}' for i in range(0, max_y_bar, step)]
else:
y_ticks = []
y_ticklabels = []
y_ticks.append(max_y_bar)
y_ticklabels.append(f"{max_y_bar}")
self.plt_2.set_yticks(y_ticks)
self.plt_2.set_yticklabels(y_ticklabels) # 倒序
self.plt_2.spines['right'].set_color('none')
self.plt_2.spines['top'].set_color('none')
self.plt_2.grid(axis='y')
self.plt_2.set_title(f"{self.program_title}柱状图")
self.canvas.draw()
self.toolbar.update()
self.update_listbox()
class StatisticsDateTypeProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[1]] = "#00BFFF"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[2]] = "#32CD32"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[3]] = "#DC143C"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[4]] = "#A9A9A9"
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station).start(7, ["GarbageType"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Type", self.get_name)
@staticmethod
def get_name(i: Tuple):
data: bytes = i[2]
return GarbageType.GarbageTypeStrList_ch[int(data.decode('utf-8'))]
class StatisticsDateLocProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station).start(7, ["Location"], lambda i: i[2], self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Location", lambda i: i[2])
class StatisticsDateTypeLocProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station).start(7, ["GarbageType", "Location"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Type-Location", self.get_name)
@staticmethod
def get_name(i: Tuple):
data: bytes = i[2]
return f"{GarbageType.GarbageTypeStrList_ch[int(data.decode('utf-8'))]}-{i[3]}"
class StatisticsDateCheckResultProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
self.color_show_dict['Pass'] = "#00BFFF"
self.color_show_dict['Fail'] = "#DC143C"
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station).start(7, ["CheckResult"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Result", self.get_name)
@staticmethod
def get_name(i: Tuple):
if i[2] is None:
return 'None'
data: int = i[2] # 返回garbage表时, BIT类型都是按bytes回传的, 但garbage_7和garbage_30会以int的方式回传
return 'Pass' if data == 1 else 'Fail'
class StatisticsDateCheckResultAndTypeProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station).start(7, ["CheckResult", "GarbageType"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Result-Location", self.get_name)
@staticmethod
def get_name(i: Tuple):
data_1: int = i[2]
data_2: bytes = i[3]
if data_1 is None:
tmp = 'None'
elif data_1 == DBBit.BIT_1:
tmp = 'Pass'
else:
tmp = 'Fail'
return tmp + f'-{GarbageType.GarbageTypeStrList_ch[int(data_2.decode("utf-8"))]}'
class StatisticsDateCheckResultAndLocProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station).start(7, ["CheckResult", "Location"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Result-Type", self.get_name)
@staticmethod
def get_name(i: Tuple):
data_1: int = i[2]
if data_1 is None:
tmp = 'None'
elif data_1 == DBBit.BIT_1:
tmp = 'Pass'
else:
tmp = 'Fail'
return tmp + f"-{i[3]}"
class StatisticsDateDetailProgram(StatisticsDateProgramBase):
def __init__(self, station, win, color, title):
super().__init__(station, win, color, title)
self._conf("#abc88b", 7, 1)
def refresh(self):
super().refresh()
event = tk_event.CountDateEvent(self.station)
event.start(7, ["CheckResult", "GarbageType", "Location"], self.get_name, self)
self.station.push_event(event)
def export(self, *_, **__):
super().export("Detail", self.get_name)
@staticmethod
def get_name(i: Tuple):
data_1: int = i[2]
data_2: bytes = i[3]
if data_1 is None:
tmp = 'None'
elif data_1 == DBBit.BIT_1:
tmp = 'Pass'
else:
tmp = 'Fail'
return tmp + f'-{GarbageType.GarbageTypeStrList_ch[int(data_2.decode("utf-8"))]}' + f'-{i[4]}'
class StatisticsDate7TypeProgram(StatisticsDateTypeProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-按投放类型")
self._conf("#abc88b", 7, 1)
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[1]] = "#00BFFF"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[2]] = "#32CD32"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[3]] = "#DC143C"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[4]] = "#A9A9A9"
class StatisticsDate7LocProgram(StatisticsDateLocProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-按投放区域")
self._conf("#abc88b", 7, 1)
class StatisticsDate7TypeLocProgram(StatisticsDateTypeLocProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-按投放类型和区域")
self._conf("#abc88b", 7, 1)
class StatisticsDate7CheckResultProgram(StatisticsDateCheckResultProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-按检查结果")
self._conf("#abc88b", 7, 1)
self.color_show_dict['Pass'] = "#00BFFF"
self.color_show_dict['Fail'] = "#DC143C"
class StatisticsDate7CheckResultAndTypeProgram(StatisticsDateCheckResultAndTypeProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-按检查结果和类型")
self._conf("#abc88b", 7, 1)
class StatisticsDate7CheckResultAndLocProgram(StatisticsDateCheckResultAndLocProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-按检查结果和区域")
self._conf("#abc88b", 7, 1)
class StatisticsDate7DetailProgram(StatisticsDateDetailProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近7日-详细分类")
self._conf("#abc88b", 7, 1)
class StatisticsDate30TypeProgram(StatisticsDateTypeProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-按投放类型")
self._conf("#abc88b", 30, 5)
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[1]] = "#00BFFF"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[2]] = "#32CD32"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[3]] = "#DC143C"
self.color_show_dict[GarbageType.GarbageTypeStrList_ch[4]] = "#A9A9A9"
class StatisticsDate30LocProgram(StatisticsDateLocProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-按投放区域")
self._conf("#abc88b", 30, 5)
class StatisticsDate30TypeLocProgram(StatisticsDateTypeLocProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-按投放类型和区域")
self._conf("#abc88b", 30, 5)
class StatisticsDate30CheckResultProgram(StatisticsDateCheckResultProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-按检查结果")
self._conf("#abc88b", 30, 5)
self.color_show_dict['Pass'] = "#00BFFF"
self.color_show_dict['Fail'] = "#DC143C"
class StatisticsDate30CheckResultAndTypeProgram(StatisticsDateCheckResultAndTypeProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-按检查结果和类型")
self._conf("#abc88b", 30, 5)
class StatisticsDate30CheckResultAndLocProgram(StatisticsDateCheckResultAndLocProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-按检查结果和区域")
self._conf("#abc88b", 30, 5)
class StatisticsDate30DetailProgram(StatisticsDateDetailProgram):
def __init__(self, station, win, color):
super().__init__(station, win, color, "最近30日-详细分类")
self._conf("#abc88b", 30, 5)
all_program = [WelcomeProgram, CreateNormalUserProgram, CreateManagerUserProgram, CreateAutoNormalUserProgram,
CreateGarbageProgram, DeleteUserProgram, DeleteUsersProgram, DeleteGarbageProgram,
DeleteGarbageMoreProgram, DeleteAllGarbageProgram, SearchUserProgram, SearchUserAdvancedProgram,
SearchGarbageProgram, SearchGarbageAdvancedProgram, SearchAdvancedProgram, UpdateUserScore,
UpdateUserReputation, UpdateGarbageTypeProgram, UpdateGarbageCheckResultProgram,
ExportGarbageProgram, ExportUserProgram, CreateUserFromCSVProgram, AboutProgram,
StatisticsTimeLocProgram, StatisticsTimeTypeProgram, StatisticsTimeTypeLocProgram,
StatisticsTimeCheckResultProgram, StatisticsTimeCheckResultAndTypeProgram,
StatisticsTimeCheckResultAndLocProgram, StatisticsTimeDetailProgram, StatisticsUserTinyProgram,
StatisticsUserLargeProgram, StatisticsScoreDistributedProgram, StatisticsReputationDistributedProgram,
StatisticsPassRateGlobalProgram, StatisticsPassRateTypeProgram, StatisticsPassRateLocProgram,
StatisticsPassRateTypeAndLocProgram, StatisticsDate7TypeProgram, StatisticsDate7LocProgram,
StatisticsDate7TypeLocProgram, StatisticsDate7CheckResultProgram,
StatisticsDate7CheckResultAndTypeProgram, StatisticsDate7CheckResultAndLocProgram,
StatisticsDate7DetailProgram, StatisticsDate30TypeProgram, StatisticsDate30LocProgram,
StatisticsDate30TypeLocProgram, StatisticsDate30CheckResultProgram,
StatisticsDate30CheckResultAndTypeProgram, StatisticsDate30CheckResultAndLocProgram,
StatisticsDate30DetailProgram]
| 38.318789
| 120
| 0.591483
| 15,357
| 117,677
| 4.333789
| 0.049684
| 0.033717
| 0.030201
| 0.018391
| 0.804324
| 0.771253
| 0.739279
| 0.713691
| 0.67434
| 0.651877
| 0
| 0.031774
| 0.264784
| 117,677
| 3,070
| 121
| 38.33127
| 0.737477
| 0.005413
| 0
| 0.639201
| 0
| 0
| 0.074954
| 0.006155
| 0
| 0
| 0
| 0
| 0.001248
| 1
| 0.123179
| false
| 0.022472
| 0.008739
| 0.000832
| 0.180191
| 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
|
1c993b015dc72e80eb8ebf3347f9cdf4d29b79b4
| 127
|
py
|
Python
|
colearning/game/__init__.py
|
A-Malone/genetic-neural-nets
|
e8284cc820e6f67a52b4064d7e7320eb29629791
|
[
"MIT"
] | null | null | null |
colearning/game/__init__.py
|
A-Malone/genetic-neural-nets
|
e8284cc820e6f67a52b4064d7e7320eb29629791
|
[
"MIT"
] | null | null | null |
colearning/game/__init__.py
|
A-Malone/genetic-neural-nets
|
e8284cc820e6f67a52b4064d7e7320eb29629791
|
[
"MIT"
] | null | null | null |
from .player import Player
from .coopgame import CoopGame
from .gameobjects import Move, GameObject
from .bullet import Bullet
| 25.4
| 41
| 0.826772
| 17
| 127
| 6.176471
| 0.470588
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133858
| 127
| 4
| 42
| 31.75
| 0.954545
| 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
|
c702ecbaeaabbfc9a35cf83beca3c21e1b2d213e
| 76
|
py
|
Python
|
prismnet/model/__init__.py
|
sunlei0227/PrismNet
|
836c3bf2c1d1b194b7c2d9de0cfb07818d3d76e4
|
[
"MIT"
] | 2
|
2020-06-17T13:37:20.000Z
|
2021-12-07T11:46:50.000Z
|
prismnet/model/__init__.py
|
sunlei0227/PrismNet
|
836c3bf2c1d1b194b7c2d9de0cfb07818d3d76e4
|
[
"MIT"
] | null | null | null |
prismnet/model/__init__.py
|
sunlei0227/PrismNet
|
836c3bf2c1d1b194b7c2d9de0cfb07818d3d76e4
|
[
"MIT"
] | null | null | null |
from .PrismNet import PrismNet
from .utils import param_num, compute_acc_auc
| 38
| 45
| 0.855263
| 12
| 76
| 5.166667
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 76
| 2
| 45
| 38
| 0.911765
| 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
|
c725c6407f77760af711fa635c86e688296bf270
| 66
|
py
|
Python
|
vimtips/__init__.py
|
IngoMeyer441/vimtips
|
3c75256277ba33c76b51a337476a241ddc3610fb
|
[
"MIT"
] | 58
|
2018-04-09T08:11:26.000Z
|
2022-02-18T06:52:55.000Z
|
vimtips/__init__.py
|
IngoHeimbach/vimtips
|
3c75256277ba33c76b51a337476a241ddc3610fb
|
[
"MIT"
] | 12
|
2018-05-30T10:53:18.000Z
|
2019-06-20T04:17:59.000Z
|
vimtips/__init__.py
|
IngoHeimbach/vimtips
|
3c75256277ba33c76b51a337476a241ddc3610fb
|
[
"MIT"
] | 5
|
2015-06-16T12:18:07.000Z
|
2021-12-14T12:52:53.000Z
|
from ._version import __version__, __version_info__ # noqa: F401
| 33
| 65
| 0.80303
| 8
| 66
| 5.375
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 0.136364
| 66
| 1
| 66
| 66
| 0.701754
| 0.151515
| 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
|
c7323a134a1167a656505108c241a73e79055d04
| 225
|
py
|
Python
|
20-fs-ias-lec/groups/09-loraSense/LoRaSense/boot.py
|
Kyrus1999/BACnet
|
5be8e1377252166041bcd0b066cce5b92b077d06
|
[
"MIT"
] | 8
|
2020-03-17T21:12:18.000Z
|
2021-12-12T15:55:54.000Z
|
20-fs-ias-lec/groups/09-loraSense/LoRaSense/boot.py
|
Kyrus1999/BACnet
|
5be8e1377252166041bcd0b066cce5b92b077d06
|
[
"MIT"
] | 2
|
2021-07-19T06:18:43.000Z
|
2022-02-10T12:17:58.000Z
|
20-fs-ias-lec/groups/09-loraSense/LoRaSense/boot.py
|
Kyrus1999/BACnet
|
5be8e1377252166041bcd0b066cce5b92b077d06
|
[
"MIT"
] | 25
|
2020-03-20T09:32:45.000Z
|
2021-07-18T18:12:59.000Z
|
##import lib.lorasense as lorasense
##lorasense = lorasense.LoraSense(mode=1, debug=1)
##lorasense.setupWLAN("CasaSalsi","S@lsi1968")
##lorasense.setupLoRa(start=True)
##lorasense.setupUDP("192.168.1.123",54528, start=True)
| 32.142857
| 55
| 0.755556
| 30
| 225
| 5.666667
| 0.633333
| 0.317647
| 0.317647
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099057
| 0.057778
| 225
| 6
| 56
| 37.5
| 0.70283
| 0.928889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c79b1453442e0f760cef668a989d459d9909d8d4
| 1,646
|
py
|
Python
|
tests/test_helpers_column.py
|
quelhasu/pysparkly
|
1ef72bdb6a8f0d6fe3d3619df3ef3239b266b1ec
|
[
"MIT"
] | null | null | null |
tests/test_helpers_column.py
|
quelhasu/pysparkly
|
1ef72bdb6a8f0d6fe3d3619df3ef3239b266b1ec
|
[
"MIT"
] | null | null | null |
tests/test_helpers_column.py
|
quelhasu/pysparkly
|
1ef72bdb6a8f0d6fe3d3619df3ef3239b266b1ec
|
[
"MIT"
] | null | null | null |
import pytest
from pyspark.sql import SparkSession, Row
from pyspark.sql import functions as F
import pysparkly
import datetime
def create_df(rows: list, spark: SparkSession):
return spark.createDataFrame(rows)
def test_without_parentheses_content_func(spark: SparkSession):
dataframe = create_df([
Row(id=1, name="john (doe)")
], spark)
result = dataframe.withColumn("new_name", pysparkly.without_parentheses_content(F.col("name")))
expected_result = "john"
collected_result = result.collect()
assert collected_result[0].new_name == expected_result
def test_without_parentheses_func(spark: SparkSession):
dataframe = create_df([
Row(id=1, name="john (doe)")
], spark)
result = dataframe.withColumn("new_name", pysparkly.without_parentheses(F.col("name")))
expected_result = "john doe"
collected_result = result.collect()
assert collected_result[0].new_name == expected_result
def test_single_space_func(spark: SparkSession):
dataframe = create_df([
Row(id=1, name="john doe")
], spark)
result = dataframe.withColumn("new_name", pysparkly.single_space(F.col("name")))
expected_result = "john doe"
collected_result = result.collect()
assert collected_result[0].new_name == expected_result
def test_without_tirets_func(spark: SparkSession):
dataframe = create_df([
Row(id=1, name="john-doe")
], spark)
result = dataframe.withColumn("new_name", pysparkly.without_tirets(F.col("name")))
expected_result = "john doe"
collected_result = result.collect()
assert collected_result[0].new_name == expected_result
| 33.591837
| 99
| 0.71932
| 207
| 1,646
| 5.492754
| 0.207729
| 0.049252
| 0.126649
| 0.105541
| 0.773087
| 0.773087
| 0.75022
| 0.75022
| 0.75022
| 0.75022
| 0
| 0.00581
| 0.163426
| 1,646
| 49
| 100
| 33.591837
| 0.819898
| 0
| 0
| 0.538462
| 0
| 0
| 0.069217
| 0
| 0
| 0
| 0
| 0
| 0.102564
| 1
| 0.128205
| false
| 0
| 0.128205
| 0.025641
| 0.282051
| 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
|
c7e5a56cc09ac562af016d7ebe22aa571a185bb0
| 75
|
py
|
Python
|
src/__init__.py
|
DeNederlandscheBank/data-quality-rules
|
311487b8a9c97018c0a4c15ba1f95036c00b9e1a
|
[
"MIT"
] | 5
|
2020-09-22T07:32:49.000Z
|
2021-07-09T19:52:58.000Z
|
src/__init__.py
|
DeNederlandscheBank/solvency2-rules
|
311487b8a9c97018c0a4c15ba1f95036c00b9e1a
|
[
"MIT"
] | 27
|
2020-09-01T14:28:36.000Z
|
2021-07-13T07:27:33.000Z
|
src/__init__.py
|
DeNederlandscheBank/solvency2-rules
|
311487b8a9c97018c0a4c15ba1f95036c00b9e1a
|
[
"MIT"
] | 3
|
2021-01-19T14:59:41.000Z
|
2022-03-23T09:51:25.000Z
|
__version__ = '0.5.1'
from .evaluator import *
from .generateCSV import *
| 15
| 26
| 0.72
| 10
| 75
| 5
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 0.16
| 75
| 4
| 27
| 18.75
| 0.746032
| 0
| 0
| 0
| 1
| 0
| 0.066667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
400c44d15cc4f11d5668b4dff7e329b4eab6caf8
| 26
|
py
|
Python
|
opt/ConstantF.py
|
camilos-ufm/Compiler
|
e29f750a13323b59583f4acd7d3a51d3e29cc0e6
|
[
"MIT"
] | 1
|
2020-09-20T03:24:24.000Z
|
2020-09-20T03:24:24.000Z
|
opt/ConstantF.py
|
camilos-ufm/Compiler
|
e29f750a13323b59583f4acd7d3a51d3e29cc0e6
|
[
"MIT"
] | null | null | null |
opt/ConstantF.py
|
camilos-ufm/Compiler
|
e29f750a13323b59583f4acd7d3a51d3e29cc0e6
|
[
"MIT"
] | 1
|
2021-09-20T19:09:52.000Z
|
2021-09-20T19:09:52.000Z
|
class ConstantF:
pass
| 8.666667
| 16
| 0.692308
| 3
| 26
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.269231
| 26
| 2
| 17
| 13
| 0.947368
| 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
|
403abc5df7cd6f5a50a285fcabffbe777b102e79
| 38
|
py
|
Python
|
tests/img.py
|
raff/gopyr
|
924c5f7f687c9396524b709a74d342253ba85411
|
[
"MIT"
] | 9
|
2018-10-20T07:34:28.000Z
|
2020-04-21T03:03:54.000Z
|
tests/img.py
|
raff/gopyr
|
924c5f7f687c9396524b709a74d342253ba85411
|
[
"MIT"
] | 2
|
2018-10-20T17:47:25.000Z
|
2019-11-20T23:30:21.000Z
|
tests/img.py
|
raff/gopyr
|
924c5f7f687c9396524b709a74d342253ba85411
|
[
"MIT"
] | null | null | null |
# test imaginary numbers
print(1+3j)
| 9.5
| 24
| 0.736842
| 6
| 38
| 4.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 0.157895
| 38
| 3
| 25
| 12.666667
| 0.8125
| 0.578947
| 0
| 0
| 0
| 0
| 0
| 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
|
4088092a2a03b72ccdd8d88ab84ca5d95f7123ad
| 34
|
py
|
Python
|
mariadb/mqtt_mariaDB_connector/__main__.py
|
akk988/5G-IO-BOX
|
597408c858aaca64522f1a9cd2d0e60d67b231a9
|
[
"Apache-2.0"
] | 9
|
2019-05-03T16:30:24.000Z
|
2021-07-17T07:36:38.000Z
|
__main__.py
|
David-Lor/MQTT2MySQL
|
25a2f723c9b172ad4a323422ac9ac54be32eb1af
|
[
"Apache-2.0"
] | 3
|
2021-01-26T04:08:10.000Z
|
2021-02-04T04:28:56.000Z
|
mariadb/mqtt_mariaDB_connector/__main__.py
|
akk988/5G-IO-BOX
|
597408c858aaca64522f1a9cd2d0e60d67b231a9
|
[
"Apache-2.0"
] | 6
|
2019-04-17T12:25:23.000Z
|
2021-11-07T09:53:13.000Z
|
from mqtt2mysql import run
run()
| 8.5
| 26
| 0.764706
| 5
| 34
| 5.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0.176471
| 34
| 3
| 27
| 11.333333
| 0.892857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
40b56f24c8912ea7a8a8be2c45024fca19259a5f
| 73
|
py
|
Python
|
rbacProject/utils/__init__.py
|
xeroCBW/testmodel
|
6000d79f91d11bcf6ba76befb3a94a007231ecdc
|
[
"MIT"
] | null | null | null |
rbacProject/utils/__init__.py
|
xeroCBW/testmodel
|
6000d79f91d11bcf6ba76befb3a94a007231ecdc
|
[
"MIT"
] | 54
|
2020-06-24T07:12:19.000Z
|
2022-03-12T00:43:57.000Z
|
rbacProject/utils/__init__.py
|
xeroCBW/testmodel
|
6000d79f91d11bcf6ba76befb3a94a007231ecdc
|
[
"MIT"
] | null | null | null |
# -*- coding: UTF-8 -*-
# __author__ : RobbieHan
# __data__ : 2017/10/12
| 24.333333
| 24
| 0.616438
| 9
| 73
| 4.111111
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 0.178082
| 73
| 3
| 25
| 24.333333
| 0.466667
| 0.917808
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
40d16beef24c404eb0b154288a3e68a41268ec54
| 52,241
|
py
|
Python
|
appengine/swarming/proto/api/plugin_prpc_pb2.py
|
hixio-mh/luci-py
|
5e2606b0db8f5dac25e9f84fdf71d103da393894
|
[
"Apache-2.0"
] | null | null | null |
appengine/swarming/proto/api/plugin_prpc_pb2.py
|
hixio-mh/luci-py
|
5e2606b0db8f5dac25e9f84fdf71d103da393894
|
[
"Apache-2.0"
] | 1
|
2022-03-02T11:45:18.000Z
|
2022-03-02T11:45:18.000Z
|
appengine/swarming/proto/api/plugin_prpc_pb2.py
|
hixio-mh/luci-py
|
5e2606b0db8f5dac25e9f84fdf71d103da393894
|
[
"Apache-2.0"
] | 1
|
2021-07-23T15:32:55.000Z
|
2021-07-23T15:32:55.000Z
|
# Generated by the pRPC protocol buffer compiler plugin. DO NOT EDIT!
# source: plugin.proto
import base64
import zlib
from google.protobuf import descriptor_pb2
# Includes description of the plugin.proto and all of its transitive
# dependencies. Includes source code info.
FILE_DESCRIPTOR_SET = descriptor_pb2.FileDescriptorSet()
FILE_DESCRIPTOR_SET.ParseFromString(zlib.decompress(base64.b64decode(
'eJzUvQ18ZNdRJ5rbrc8rjeZOj8cey1/XsseS7FZrRjMe2+PYWB/tGTkaSemWMnaCI191X0kdt7'
'qbvt0jyyFhNyRgCEkg7MuSffkClgBhYcPmhSSEzywkgRDCy3cesPDekseSX/ZH3m+Xj4XAvvrX'
'qXPuuS1pZuwAP9Y/J1bXPffcOnXq1KmqU6fKfetj7mCj2t6s1HKNZr1VzwxEO0Fzu1LbzF0+NX'
'zbZr2+WQ0n+dF6e2OyVdkOo1aw3VCth4dMa/498ieO27cSRE8XG2EpM+SmKuXjju+M9Rfor0zG'
'7WoFm9HxlJ8mCP+dybk9UbVSCqPjaYIOTF2fs76fK+IR+ipIq0zW7abvt8LjXdTtUEdz/jKeFl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19++pwUsUUBgcZOCxXlMKTLoV98odi5fM'
'rxVqtcK8LhYQ7XcwFNlRfkK/3snOk70Y+6Y6X2fdF7imZVyAT1lBlFXUb0dJEGWdimBS14V3Qg'
'SNreh/AQmN+Dw=')))
_INDEX = {
f.name: {
'descriptor': f,
'services': {s.name: s for s in f.service},
}
for f in FILE_DESCRIPTOR_SET.file
}
ExternalSchedulerServiceDescription = {
'file_descriptor_set': FILE_DESCRIPTOR_SET,
'file_descriptor': _INDEX[u'plugin.proto']['descriptor'],
'service_descriptor': _INDEX[u'plugin.proto']['services'][u'ExternalScheduler'],
}
| 78.794872
| 82
| 0.881224
| 2,204
| 52,241
| 20.879764
| 0.95735
| 0.001825
| 0.001847
| 0.001369
| 0.001999
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153991
| 0.062977
| 52,241
| 662
| 83
| 78.913897
| 0.786113
| 0.003771
| 0
| 0
| 1
| 0.001531
| 0.905725
| 0.902977
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.004594
| 0
| 0.004594
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
40d2904ee234418032334393f8a06887e0e13e0f
| 54
|
py
|
Python
|
WEEKS/CD_Sata-Structures/_MISC/misc-examples/04-fileio04.py
|
webdevhub42/Lambda
|
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
|
[
"MIT"
] | null | null | null |
WEEKS/CD_Sata-Structures/_MISC/misc-examples/04-fileio04.py
|
webdevhub42/Lambda
|
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
|
[
"MIT"
] | null | null | null |
WEEKS/CD_Sata-Structures/_MISC/misc-examples/04-fileio04.py
|
webdevhub42/Lambda
|
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
|
[
"MIT"
] | null | null | null |
# lets detect lines with no number on them
import sys
| 18
| 42
| 0.777778
| 10
| 54
| 4.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.203704
| 54
| 2
| 43
| 27
| 0.976744
| 0.740741
| 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
|
40d56fdbabf93dc1b75d8b28c158a448ba355eaa
| 204
|
py
|
Python
|
ephypype/interfaces/mne/__init__.py
|
jasmainak/ephypype
|
257603cbb099cef7847a96c8eb141332fb85ebfa
|
[
"BSD-3-Clause"
] | null | null | null |
ephypype/interfaces/mne/__init__.py
|
jasmainak/ephypype
|
257603cbb099cef7847a96c8eb141332fb85ebfa
|
[
"BSD-3-Clause"
] | null | null | null |
ephypype/interfaces/mne/__init__.py
|
jasmainak/ephypype
|
257603cbb099cef7847a96c8eb141332fb85ebfa
|
[
"BSD-3-Clause"
] | null | null | null |
from .spectral import (SpectralConn)
from .power import (Power)
from .preproc import (CompIca)
from .LF_computation import (LFComputation)
from .Inverse_solution import (NoiseCovariance, InverseSolution)
| 34
| 64
| 0.818627
| 23
| 204
| 7.173913
| 0.608696
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102941
| 204
| 5
| 65
| 40.8
| 0.901639
| 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
|
40e6ed6f2631e495237f913be4f0c129aa24e867
| 51
|
py
|
Python
|
built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/utils/__init__.py
|
Huawei-Ascend/modelzoo
|
df51ed9c1d6dbde1deef63f2a037a369f8554406
|
[
"Apache-2.0"
] | 12
|
2020-12-13T08:34:24.000Z
|
2022-03-20T15:17:17.000Z
|
built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/utils/__init__.py
|
Huawei-Ascend/modelzoo
|
df51ed9c1d6dbde1deef63f2a037a369f8554406
|
[
"Apache-2.0"
] | 3
|
2021-03-31T20:15:40.000Z
|
2022-02-09T23:50:46.000Z
|
built-in/TensorFlow/Research/cv/image_classification/Darts_for_TensorFlow/automl/vega/search_space/networks/pytorch/utils/__init__.py
|
Huawei-Ascend/modelzoo
|
df51ed9c1d6dbde1deef63f2a037a369f8554406
|
[
"Apache-2.0"
] | 2
|
2021-07-10T12:40:46.000Z
|
2021-12-17T07:55:15.000Z
|
from .bbox_utils import *
from .roi_align import *
| 17
| 25
| 0.764706
| 8
| 51
| 4.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156863
| 51
| 2
| 26
| 25.5
| 0.860465
| 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
|
905a3d7d4c4dd0cf9d883448d4fa4d7df2c0b6a6
| 165
|
py
|
Python
|
webhooks/urls.py
|
KeoH/orchestrapi
|
575e66a86c42b5c249fd943bb5f40c8c310139aa
|
[
"MIT"
] | 1
|
2021-07-05T19:37:37.000Z
|
2021-07-05T19:37:37.000Z
|
webhooks/urls.py
|
KeoH/orchestrapi
|
575e66a86c42b5c249fd943bb5f40c8c310139aa
|
[
"MIT"
] | 6
|
2020-06-05T19:30:52.000Z
|
2021-07-05T19:28:53.000Z
|
webhooks/urls.py
|
KeoH/orchestrapi
|
575e66a86c42b5c249fd943bb5f40c8c310139aa
|
[
"MIT"
] | 1
|
2020-05-15T23:58:24.000Z
|
2020-05-15T23:58:24.000Z
|
from django.urls import path
from .views import manage_repository_webhook
urlpatterns = [
path('<str:repository>/<str:app_id>', manage_repository_webhook),
]
| 18.333333
| 69
| 0.763636
| 21
| 165
| 5.761905
| 0.619048
| 0.264463
| 0.380165
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.127273
| 165
| 8
| 70
| 20.625
| 0.840278
| 0
| 0
| 0
| 0
| 0
| 0.176829
| 0.176829
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 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
|
906869b2098b8949f6ebab67a7a1b73656670213
| 62
|
py
|
Python
|
python/sit_idcardlib_py/__init__.py
|
SIT-DigiCre/student-id-card-read-sample
|
34650172000f5c3e657727a4fd3c8fef7e67cb4c
|
[
"MIT"
] | 2
|
2021-04-09T00:20:38.000Z
|
2021-04-09T01:29:27.000Z
|
python/sit_idcardlib_py/__init__.py
|
SIT-DigiCre/student-id-card-read-sample
|
34650172000f5c3e657727a4fd3c8fef7e67cb4c
|
[
"MIT"
] | null | null | null |
python/sit_idcardlib_py/__init__.py
|
SIT-DigiCre/student-id-card-read-sample
|
34650172000f5c3e657727a4fd3c8fef7e67cb4c
|
[
"MIT"
] | null | null | null |
from .sit_id_card import SITIDCard
from .reader import Reader
| 20.666667
| 34
| 0.83871
| 10
| 62
| 5
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 62
| 2
| 35
| 31
| 0.925926
| 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
|
90721b052e9fd756e2d5bf8d1cd6ebde26d602fe
| 9,633
|
py
|
Python
|
Huang2017AdaIN/model.py
|
czczup/URST
|
000ec9f7728f12ffad989ec1d07b1dd579514133
|
[
"Apache-2.0"
] | 119
|
2021-03-21T18:30:51.000Z
|
2022-03-29T07:28:33.000Z
|
Huang2017AdaIN/model.py
|
czczup/URST
|
000ec9f7728f12ffad989ec1d07b1dd579514133
|
[
"Apache-2.0"
] | 5
|
2021-04-02T14:26:03.000Z
|
2022-01-12T12:59:17.000Z
|
Huang2017AdaIN/model.py
|
czczup/URST
|
000ec9f7728f12ffad989ec1d07b1dd579514133
|
[
"Apache-2.0"
] | 16
|
2021-03-21T18:30:53.000Z
|
2022-03-29T07:28:34.000Z
|
import torch.nn as nn
import torch
from function import coral
from function import adaptive_instance_normalization as adain
from function import calc_mean_std
import torch.nn.functional as F
decoder = nn.Sequential(
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 256, (3, 3)),
nn.ReLU(),
nn.Upsample(scale_factor=2, mode='nearest'),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 256, (3, 3)),
nn.ReLU(),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 256, (3, 3)),
nn.ReLU(),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 256, (3, 3)),
nn.ReLU(),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 128, (3, 3)),
nn.ReLU(),
nn.Upsample(scale_factor=2, mode='nearest'),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(128, 128, (3, 3)),
nn.ReLU(),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(128, 64, (3, 3)),
nn.ReLU(),
nn.Upsample(scale_factor=2, mode='nearest'),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(64, 64, (3, 3)),
nn.ReLU(),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(64, 3, (3, 3)),
)
vgg = nn.Sequential(
nn.Conv2d(3, 3, (1, 1)),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(3, 64, (3, 3)),
nn.ReLU(), # relu1-1
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(64, 64, (3, 3)),
nn.ReLU(), # relu1-2
nn.MaxPool2d((2, 2), (2, 2), (0, 0), ceil_mode=True),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(64, 128, (3, 3)),
nn.ReLU(), # relu2-1
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(128, 128, (3, 3)),
nn.ReLU(), # relu2-2
nn.MaxPool2d((2, 2), (2, 2), (0, 0), ceil_mode=True),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(128, 256, (3, 3)),
nn.ReLU(), # relu3-1
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 256, (3, 3)),
nn.ReLU(), # relu3-2
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 256, (3, 3)),
nn.ReLU(), # relu3-3
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 256, (3, 3)),
nn.ReLU(), # relu3-4
nn.MaxPool2d((2, 2), (2, 2), (0, 0), ceil_mode=True),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(256, 512, (3, 3)),
nn.ReLU(), # relu4-1, this is the last layer used
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU(), # relu4-2
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU(), # relu4-3
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU(), # relu4-4
nn.MaxPool2d((2, 2), (2, 2), (0, 0), ceil_mode=True),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU(), # relu5-1
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU(), # relu5-2
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU(), # relu5-3
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 512, (3, 3)),
nn.ReLU() # relu5-4
)
class Net(nn.Module):
def __init__(self, encoder, decoder):
super(Net, self).__init__()
enc_layers = list(encoder.children())
self.enc_1 = nn.Sequential(*enc_layers[:4]) # input -> relu1_1
self.enc_2 = nn.Sequential(*enc_layers[4:11]) # relu1_1 -> relu2_1
self.enc_3 = nn.Sequential(*enc_layers[11:18]) # relu2_1 -> relu3_1
self.enc_4 = nn.Sequential(*enc_layers[18:31]) # relu3_1 -> relu4_1
self.decoder = decoder
self.mse_loss = nn.MSELoss()
# fix the encoder
for name in ['enc_1', 'enc_2', 'enc_3', 'enc_4']:
for param in getattr(self, name).parameters():
param.requires_grad = False
# extract relu1_1, relu2_1, relu3_1, relu4_1 from input image
def encode_with_intermediate(self, input):
results = [input]
for i in range(4):
func = getattr(self, 'enc_{:d}'.format(i + 1))
results.append(func(results[-1]))
return results[1:]
# extract relu4_1 from input image
def encode(self, input):
for i in range(4):
input = getattr(self, 'enc_{:d}'.format(i + 1))(input)
return input
def calc_content_loss(self, input, target):
assert (input.size() == target.size())
assert (target.requires_grad is False)
return self.mse_loss(input, target)
def calc_style_loss(self, input, target):
assert (input.size() == target.size())
assert (target.requires_grad is False)
input_mean, input_std = calc_mean_std(input)
target_mean, target_std = calc_mean_std(target)
return self.mse_loss(input_mean, target_mean) + \
self.mse_loss(input_std, target_std)
def forward(self, content, style, alpha=1.0):
assert 0 <= alpha <= 1
with torch.no_grad():
style_feats = self.encode_with_intermediate(style)
content_feat = self.encode(content)
t = adain(content_feat, style_feats[-1])
t = alpha * t + (1 - alpha) * content_feat
g_t = self.decoder(t)
g_t_feats = self.encode_with_intermediate(g_t)
loss_c = self.calc_content_loss(g_t_feats[-1], t)
loss_s = self.calc_style_loss(g_t_feats[0], style_feats[0])
for i in range(1, 4):
loss_s += self.calc_style_loss(g_t_feats[i], style_feats[i])
return loss_c, loss_s
class NetV2(nn.Module):
def __init__(self, encoder, decoder):
super(NetV2, self).__init__()
enc_layers = list(encoder.children())
self.enc_1 = nn.Sequential(*enc_layers[:4]) # input -> relu1_1
self.enc_2 = nn.Sequential(*enc_layers[4:11]) # relu1_1 -> relu2_1
self.enc_3 = nn.Sequential(*enc_layers[11:18]) # relu2_1 -> relu3_1
self.enc_4 = nn.Sequential(*enc_layers[18:31]) # relu3_1 -> relu4_1
self.decoder = decoder
self.mse_loss = nn.MSELoss()
# fix the encoder
for name in ['enc_1', 'enc_2', 'enc_3', 'enc_4']:
for param in getattr(self, name).parameters():
param.requires_grad = False
# extract relu1_1, relu2_1, relu3_1, relu4_1 from input image
def encode_with_intermediate(self, input):
results = [input]
for i in range(4):
func = getattr(self, 'enc_{:d}'.format(i + 1))
results.append(func(results[-1]))
return results[1:]
# extract relu4_1 from input image
def encode(self, input):
for i in range(4):
input = getattr(self, 'enc_{:d}'.format(i + 1))(input)
return input
def calc_content_loss(self, input, target):
assert (target.requires_grad is False)
return self.mse_loss(input, target)
def calc_style_loss(self, input, target):
assert (target.requires_grad is False)
input_mean, input_std = calc_mean_std(input)
target_mean, target_std = calc_mean_std(target)
return self.mse_loss(input_mean, target_mean) + \
self.mse_loss(input_std, target_std)
def thumb_adaptive_instance_normalization(self, content_thumb_feat, content_patch_feat, style_thumb_feat):
size = content_thumb_feat.size()
style_mean, style_std = calc_mean_std(style_thumb_feat)
content_thumb_mean, content_thumb_std = calc_mean_std(content_thumb_feat)
content_thumb_feat = (content_thumb_feat - content_thumb_mean.expand(size)) / content_thumb_std.expand(size)
content_thumb_feat = content_thumb_feat * style_std.expand(size) + style_mean.expand(size)
content_patch_feat = (content_patch_feat - content_thumb_mean.expand(size)) / content_thumb_std.expand(size)
content_patch_feat = content_patch_feat * style_std.expand(size) + style_mean.expand(size)
return content_thumb_feat, content_patch_feat
def forward(self, content_patches, content_thumbs, style_thumbs, position, alpha=1.0):
assert 0 <= alpha <= 1
with torch.no_grad():
style_thumb_feats = self.encode_with_intermediate(style_thumbs)
content_thumb_feat = self.encode(content_thumbs)
content_patch_feat = self.encode(content_patches)
t_thumb, t_patch = self.thumb_adaptive_instance_normalization(content_thumb_feat,
content_patch_feat,
style_thumb_feats[-1])
t_thumb = alpha * t_thumb + (1 - alpha) * content_thumb_feat
t_patch = alpha * t_patch + (1 - alpha) * content_patch_feat
g_t_thumb = self.decoder(t_thumb)
g_t_patch = self.decoder(t_patch)
with torch.no_grad():
g_t_thumb_up = F.interpolate(g_t_thumb, scale_factor=2, mode='bilinear', align_corners=False)
g_t_thumb_crop = g_t_thumb_up[..., position[0]:position[1], position[2]:position[3]]
g_t_thumb_crop_feats = self.encode_with_intermediate(g_t_thumb_crop)
g_t_thumb_feats = self.encode_with_intermediate(g_t_thumb)
g_t_patch_feats = self.encode_with_intermediate(g_t_patch)
loss_c = self.calc_content_loss(g_t_thumb_feats[-1], t_thumb)
loss_s = self.calc_style_loss(g_t_thumb_feats[0], style_thumb_feats[0])
for i in range(1, 4):
loss_s += self.calc_style_loss(g_t_thumb_feats[i], style_thumb_feats[i])
loss_sp = self.calc_content_loss(g_t_patch_feats[-1], g_t_thumb_crop_feats[-1])
return loss_c, loss_s, loss_sp
| 39.805785
| 116
| 0.600021
| 1,421
| 9,633
| 3.832512
| 0.084448
| 0.02791
| 0.027543
| 0.08722
| 0.813625
| 0.789203
| 0.746603
| 0.729159
| 0.659199
| 0.623026
| 0
| 0.07493
| 0.254645
| 9,633
| 241
| 117
| 39.970954
| 0.683565
| 0.054189
| 0
| 0.684466
| 0
| 0
| 0.011123
| 0
| 0
| 0
| 0
| 0
| 0.038835
| 1
| 0.063107
| false
| 0
| 0.029126
| 0
| 0.15534
| 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
|
9087cdd82acc35cf211009a33a0ff607ad6fa496
| 283
|
py
|
Python
|
test.py
|
NightDrivers/PythonStudy
|
25c4eafc0c68d0faac06af0e27622c74ff9dac22
|
[
"MIT"
] | null | null | null |
test.py
|
NightDrivers/PythonStudy
|
25c4eafc0c68d0faac06af0e27622c74ff9dac22
|
[
"MIT"
] | null | null | null |
test.py
|
NightDrivers/PythonStudy
|
25c4eafc0c68d0faac06af0e27622c74ff9dac22
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
import openpyxl
import os
import subprocess
import argparse
import uuid
import re
from script import ShellCommand
import py_compile
if __name__ == '__main__':
print(ShellCommand.excute_shell("cd /usr;pwd;"))
print(ShellCommand.excute_shell("pwd;"))
| 18.866667
| 52
| 0.745583
| 37
| 283
| 5.405405
| 0.648649
| 0.17
| 0.23
| 0.28
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004115
| 0.141343
| 283
| 14
| 53
| 20.214286
| 0.81893
| 0.074205
| 0
| 0
| 0
| 0
| 0.092308
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.727273
| 0
| 0.727273
| 0.181818
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9093807df28298b6bd9b15f9914c3baeee24e2b5
| 147
|
py
|
Python
|
tests/web_platform/CSS2/linebox/test_vertical_align.py
|
fletchgraham/colosseum
|
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
|
[
"BSD-3-Clause"
] | null | null | null |
tests/web_platform/CSS2/linebox/test_vertical_align.py
|
fletchgraham/colosseum
|
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
|
[
"BSD-3-Clause"
] | null | null | null |
tests/web_platform/CSS2/linebox/test_vertical_align.py
|
fletchgraham/colosseum
|
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
|
[
"BSD-3-Clause"
] | 1
|
2020-01-16T01:56:41.000Z
|
2020-01-16T01:56:41.000Z
|
from tests.utils import W3CTestCase
class TestVerticalAlign(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'vertical-align-'))
| 24.5
| 70
| 0.789116
| 16
| 147
| 6.9375
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022556
| 0.095238
| 147
| 5
| 71
| 29.4
| 0.81203
| 0
| 0
| 0
| 0
| 0
| 0.10274
| 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
|
90a42e97a0c9365be7dc84d8b622965abc9f1baa
| 44
|
py
|
Python
|
nautobot_chatops/tests/__init__.py
|
tanvimoharir/nautobot-plugin-chatops
|
8fe984b7918f02eb8015c4c0ae3df889688c7a12
|
[
"Apache-2.0"
] | 27
|
2021-02-24T13:27:28.000Z
|
2022-03-09T12:01:04.000Z
|
nautobot_chatops/tests/__init__.py
|
progala/nautobot-plugin-chatops
|
8cf03633ec9f8d1905795577aefc5341fc723700
|
[
"Apache-2.0"
] | 83
|
2021-03-11T17:45:22.000Z
|
2022-03-18T14:51:29.000Z
|
nautobot_chatops/tests/__init__.py
|
progala/nautobot-plugin-chatops
|
8cf03633ec9f8d1905795577aefc5341fc723700
|
[
"Apache-2.0"
] | 22
|
2021-03-09T18:22:29.000Z
|
2022-03-15T13:54:04.000Z
|
"""Test for the nautobot_chatops plugin."""
| 22
| 43
| 0.727273
| 6
| 44
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113636
| 44
| 1
| 44
| 44
| 0.794872
| 0.840909
| 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
|
2913eb12c023ef123677a5f5aaa3d71a524b2089
| 146
|
py
|
Python
|
main/managers.py
|
MasterBDX/find-your-api
|
23e22093df36574cb81703f315da5bfdf1efc51e
|
[
"MIT"
] | 2
|
2020-12-31T10:32:18.000Z
|
2021-01-01T03:15:30.000Z
|
main/managers.py
|
MasterBDX/find-your-api
|
23e22093df36574cb81703f315da5bfdf1efc51e
|
[
"MIT"
] | null | null | null |
main/managers.py
|
MasterBDX/find-your-api
|
23e22093df36574cb81703f315da5bfdf1efc51e
|
[
"MIT"
] | null | null | null |
from django.db import models
class APIGuideManager(models.Manager):
def active(self):
return self.get_queryset().filter(active=True)
| 24.333333
| 54
| 0.739726
| 19
| 146
| 5.631579
| 0.842105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157534
| 146
| 6
| 54
| 24.333333
| 0.869919
| 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
|
4646e785f55e392d91692eb99a3b10c4bb0ea710
| 6,585
|
py
|
Python
|
src/tests/test_core/test_entities.py
|
eugene-p/bcrm
|
bba6628df6a12ecac8aa6bb50ee86f0c14414939
|
[
"Apache-2.0"
] | null | null | null |
src/tests/test_core/test_entities.py
|
eugene-p/bcrm
|
bba6628df6a12ecac8aa6bb50ee86f0c14414939
|
[
"Apache-2.0"
] | 32
|
2019-01-29T18:59:58.000Z
|
2019-02-10T23:11:35.000Z
|
src/tests/test_core/test_entities.py
|
eugene-p/bcrm
|
bba6628df6a12ecac8aa6bb50ee86f0c14414939
|
[
"Apache-2.0"
] | 4
|
2019-01-29T20:13:11.000Z
|
2020-07-11T22:57:08.000Z
|
# coding: utf-8
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
'''
Entity Types Api Tests
==============
'''
import json
from test_entity_types import create_entity_type
entity_stub = {
'entity_type_id': 'test_entity_type_id',
'content': {'content':'content'}
}
def create_entity(client, entity_type_name):
stub = {
'entity_type_id': create_entity_type(client, entity_type_name),
'content': entity_stub['content']
}
response = client.post('/api/entities',
data=json.dumps(stub),
content_type='application/json')
json_data = response.get_json()
if response.status_code != 201:
raise TypeError('error creating entity')
return json_data['id']
def test_create_entity_success(client):
create_entity(client, 'test_entity_type_name')
def test_create_entity_invalid_content(client):
stub = {
'entity_type_id': create_entity_type(client, 'test_entity_type_name--invalid_content'),
'content': {'crap': 'crap'}
}
response = client.post('/api/entities',
data=json.dumps(stub),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == "Entity content does not match type schema"
def test_create_entity_invalid_entity_type(client):
response = client.post('/api/entities',
data=json.dumps(entity_stub),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == "Entity type id '{}' does not exist".format(entity_stub['entity_type_id'])
def test_create_entity_not_json(client):
response = client.post('/api/entities',
data=json.dumps(entity_stub),
content_type='application/text')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == 'payload is not json'
def test_create_entity_no_entity_type(client):
stub = {
'content': {'content':'content'}
}
response = client.post('/api/entities',
data=json.dumps(stub),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == "'entity_type_id' is a required property"
def test_create_entity_no_content(client):
stub = {
'entity_type_id': 'entity_type_id'
}
response = client.post('/api/entities',
data=json.dumps(stub),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == "'content' is a required property"
def test_create_entity_no_content_not_object(client):
stub = {
'entity_type_id': 'entity_type_id',
'content': 'content'
}
response = client.post('/api/entities',
data=json.dumps(stub),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == "'content' is not of type 'object'"
def test_get_entity_by_id(client):
entity_id = create_entity(client, 'test_get_entity--entity_type_name')
response = client.get('/api/entities/{}'.format(entity_id))
json_data = response.get_json()
assert response.status_code == 200
assert json_data['content'] == entity_stub['content']
def test_get_entity_by_id_fail(client):
response = client.get('/api/entities/unknown')
json_data = response.get_json()
assert response.status_code == 404
assert json_data['message'] == "Not found"
def test_delete_entity_by_id(client):
entity_id = create_entity(client, 'test_delete_entity--entity_type_name')
response = client.delete('/api/entities/{}'.format(entity_id))
json_data = response.get_json()
assert response.status_code == 200
assert json_data['acknowledge'] == True
def test_delete_entity_by_id_not_found(client):
response = client.delete('/api/entities/not_found')
json_data = response.get_json()
assert response.status_code == 404
assert json_data['message'] == 'Not found'
def test_update_entity_success(client):
'''
Tests that entity types can be updated
'''
name = 'test_update_entity_success'
entity_id = create_entity(client, name)
entity_type_id = create_entity_type(client, name + '_updated')
payload = {
'entity_type_id': entity_type_id,
'content': {'test': 'new test'}
}
response = client.put('/api/entities/{}'.format(entity_id),
data=json.dumps(payload),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 200
assert json_data['entity_type_id'] == entity_type_id
assert json_data['content'] == {'test': 'new test'}
def test_update_entity_invalid_type(client):
'''
Tests that entity types can be updated
'''
name = 'test_update_entity_invalid_type'
entity_id = create_entity(client, name)
payload = {
'entity_type_id': name + '_no',
'content': {'test': 'new test'}
}
response = client.put('/api/entities/{}'.format(entity_id),
data=json.dumps(payload),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == "Entity type id '{}' does not exist".format(name+'_no')
def test_update_entity_not_found(client):
'''
Tests that entity types can be updated
'''
payload = {
'entity_type_id': 'test_update_entity_not_found',
'content': {'test': 'new test'}
}
response = client.put('/api/entities/nope',
data=json.dumps(payload),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 404
assert json_data['message'] == 'Not found'
def test_update_entity_invalid_content(client):
'''
Tests that entity types can be updated
'''
name = 'test_update_entity_invalid_content'
entity_id = create_entity(client, name)
entity_type_id = create_entity_type(client, name + '_updated')
payload = {
'entity_type_id': entity_type_id,
'content': {'crap': 'crap'}
}
response = client.put('/api/entities/{}'.format(entity_id),
data=json.dumps(payload),
content_type='application/json')
json_data = response.get_json()
assert response.status_code == 400
assert json_data['message'] == 'Entity content does not match type schema'
| 30.486111
| 109
| 0.67426
| 838
| 6,585
| 4.997613
| 0.090692
| 0.083572
| 0.063037
| 0.068052
| 0.867001
| 0.762416
| 0.716094
| 0.716094
| 0.672636
| 0.661652
| 0
| 0.009051
| 0.194685
| 6,585
| 215
| 110
| 30.627907
| 0.78069
| 0.039484
| 0
| 0.562914
| 0
| 0
| 0.236611
| 0.046523
| 0
| 0
| 0
| 0
| 0.192053
| 1
| 0.10596
| false
| 0
| 0.013245
| 0
| 0.125828
| 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
|
4651e0d16aac345b5c6aed32d43f9f52d2399d0d
| 991
|
py
|
Python
|
prediction/endpoints/utilities.py
|
EcoJesss/ecosystem-notebooks
|
095b2bc59b9749129a454a7b16c97e20d9484fd4
|
[
"MIT"
] | null | null | null |
prediction/endpoints/utilities.py
|
EcoJesss/ecosystem-notebooks
|
095b2bc59b9749129a454a7b16c97e20d9484fd4
|
[
"MIT"
] | null | null | null |
prediction/endpoints/utilities.py
|
EcoJesss/ecosystem-notebooks
|
095b2bc59b9749129a454a7b16c97e20d9484fd4
|
[
"MIT"
] | null | null | null |
CONVERT_JSON_TO_YAML = {
"type": "post",
"endpoint": "/convertJSONtoYAML",
"call_message": "{type} {endpoint}",
"error_message": "{type} {endpoint} {response_code}"
}
CONVERT_RANGE_FROM_TO = {
"type": "get",
"endpoint": "/convertRangeFromTo",
"call_message": "{type} {endpoint}",
"error_message": "{type} {endpoint} {response_code}"
}
CONVERT_TEXT_FILE_FROM_TO = {
"type": "get",
"endpoint": "/convertTextFileFromTo",
"call_message": "{type} {endpoint}",
"error_message": "{type} {endpoint} {response_code}"
}
CONVERT_YAML_TO_JSON = {
"type": "post",
"endpoint": "/convertYAMLtoJSON",
"call_message": "{type} {endpoint}",
"error_message": "{type} {endpoint} {response_code}"
}
COPY_FILE = {
"type": "get",
"endpoint": "/copyFile",
"call_message": "{type} {endpoint}",
"error_message": "{type} {endpoint} {response_code}"
}
GET_FILE = {
"type": "get",
"endpoint": "/getFile",
"call_message": "{type} {endpoint}",
"error_message": "{type} {endpoint} {response_code}"
}
| 26.783784
| 53
| 0.660949
| 105
| 991
| 5.92381
| 0.228571
| 0.212219
| 0.366559
| 0.221865
| 0.670418
| 0.602894
| 0.602894
| 0.602894
| 0.602894
| 0.602894
| 0
| 0
| 0.115035
| 991
| 36
| 54
| 27.527778
| 0.709236
| 0
| 0
| 0.5
| 0
| 0
| 0.641776
| 0.0222
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
46b3fc939cee2727a7784669932dd5468ccec84f
| 71
|
py
|
Python
|
my_happy_pandas/core/computation/api.py
|
ggservice007/my-happy-pandas
|
63145d54e452177f7d5b2fc8fdbc1fdf37dd5b16
|
[
"Apache-2.0"
] | null | null | null |
my_happy_pandas/core/computation/api.py
|
ggservice007/my-happy-pandas
|
63145d54e452177f7d5b2fc8fdbc1fdf37dd5b16
|
[
"Apache-2.0"
] | null | null | null |
my_happy_pandas/core/computation/api.py
|
ggservice007/my-happy-pandas
|
63145d54e452177f7d5b2fc8fdbc1fdf37dd5b16
|
[
"Apache-2.0"
] | null | null | null |
# flake8: noqa
from my_happy_pandas.core.computation.eval import eval
| 17.75
| 54
| 0.816901
| 11
| 71
| 5.090909
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015873
| 0.112676
| 71
| 3
| 55
| 23.666667
| 0.873016
| 0.169014
| 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
|
d3eded0308d895b6822b4e1be75f608e7986312f
| 125
|
py
|
Python
|
recipe/conftest.py
|
conda-forge/binpickle-feedstock
|
ba510534da60ade78c341597eea50e613d2510e4
|
[
"BSD-3-Clause"
] | 1
|
2020-06-05T22:32:35.000Z
|
2020-06-05T22:32:35.000Z
|
recipe/conftest.py
|
conda-forge/binpickle-feedstock
|
ba510534da60ade78c341597eea50e613d2510e4
|
[
"BSD-3-Clause"
] | 9
|
2020-06-05T23:32:39.000Z
|
2021-11-23T23:02:55.000Z
|
recipe/conftest.py
|
conda-forge/binpickle-feedstock
|
ba510534da60ade78c341597eea50e613d2510e4
|
[
"BSD-3-Clause"
] | 2
|
2020-06-05T23:31:39.000Z
|
2020-06-06T15:58:07.000Z
|
import hypothesis
hypothesis.settings.register_profile('package', deadline=1000)
hypothesis.settings.load_profile('package')
| 31.25
| 62
| 0.848
| 14
| 125
| 7.428571
| 0.642857
| 0.346154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.04
| 125
| 4
| 63
| 31.25
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 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
|
310d69336af15520596907ba439411732f538c58
| 7,827
|
py
|
Python
|
cherche/compose/union_inter.py
|
NicolasBizzozzero/cherche
|
3869206438a15ff9c14d3d36468b578f193b9a57
|
[
"MIT"
] | 1
|
2022-01-21T21:25:01.000Z
|
2022-01-21T21:25:01.000Z
|
cherche/compose/union_inter.py
|
NicolasBizzozzero/cherche
|
3869206438a15ff9c14d3d36468b578f193b9a57
|
[
"MIT"
] | null | null | null |
cherche/compose/union_inter.py
|
NicolasBizzozzero/cherche
|
3869206438a15ff9c14d3d36468b578f193b9a57
|
[
"MIT"
] | null | null | null |
__all__ = ["Intersection", "Union"]
import collections
from .base import Compose
from .pipeline import Pipeline
class UnionIntersection(Compose):
"""Base class for union and intersection."""
def __repr__(self) -> str:
repr = self.__class__.__name__
repr += "\n-----\n"
repr += super().__repr__()
repr += "\n-----"
return repr
def __add__(self, other) -> Pipeline:
"""Pipeline operator."""
if isinstance(other, list):
return Pipeline(
[self] + [{document[self.models[0].key]: document for document in other}]
)
return Pipeline([self, other])
class Union(UnionIntersection):
"""Union gathers retrieved documents from multiples retrievers and ranked documents from
multiples rankers.
Parameters
----------
model
List of models of the union.
Examples
--------
>>> from pprint import pprint as print
>>> from cherche import retrieve
>>> documents = [
... {"id": 0, "title": "Paris", "article": "This town is the capital of France", "author": "Wiki"},
... {"id": 1, "title": "Eiffel tower", "article": "Eiffel tower is based in Paris.", "author": "Wiki"},
... {"id": 2, "title": "Montreal", "article": "Montreal is in Canada.", "author": "Wiki"},
... ]
>>> search = (
... retrieve.TfIdf(key="id", on="title", documents=documents) |
... retrieve.TfIdf(key="id", on="article", documents=documents) |
... retrieve.Flash(key="id", on="author")
... ) + documents
>>> search.add(documents)
Union
-----
TfIdf retriever
key: id
on: title
documents: 3
TfIdf retriever
key: id
on: article
documents: 3
Flash retriever
key: id
on: author
documents: 1
-----
Mapping to documents
>>> print(search(q = "Paris"))
[{'article': 'This town is the capital of France',
'author': 'Wiki',
'id': 0,
'similarity': 1.0,
'title': 'Paris'},
{'article': 'Eiffel tower is based in Paris.',
'author': 'Wiki',
'id': 1,
'similarity': 0.4505,
'title': 'Eiffel tower'}]
>>> print(search(q = "Montreal"))
[{'article': 'Montreal is in Canada.',
'author': 'Wiki',
'id': 2,
'similarity': 1.0,
'title': 'Montreal'}]
>>> print(search(q = "Wiki"))
[{'article': 'This town is the capital of France',
'author': 'Wiki',
'id': 0,
'title': 'Paris'},
{'article': 'Eiffel tower is based in Paris.',
'author': 'Wiki',
'id': 1,
'title': 'Eiffel tower'},
{'article': 'Montreal is in Canada.',
'author': 'Wiki',
'id': 2,
'title': 'Montreal'}]
"""
def __init__(self, models: list):
super().__init__(models=models)
for model in self.models:
if hasattr(model, "key"):
self.key = model.key
break
def __call__(self, q: str, **kwargs) -> list:
"""
Parameters
----------
q
Input query.
"""
query = {"q": q, **kwargs}
union = []
similarities = {}
for model in self.models:
for document in model(**query):
# Remove similarities to avoid duplicates
if "similarity" in document:
similarity = document.pop("similarity")
if document[self.key] not in similarities:
similarities[document[self.key]] = similarity
# Drop duplicates documents:
if document in union:
continue
union.append(document)
ranked = []
for document in union:
similarity = similarities.get(document.get(self.key, None), None)
if similarity is not None:
ranked.append({**document, **{"similarity": similarity}})
else:
ranked.append(document)
return ranked
def __or__(self, other) -> "Union":
"""Union operator"""
return Union(models=self.models + [other])
class Intersection(UnionIntersection):
"""Intersection gathers retrieved documents from multiples retrievers and ranked documents from
multiples rankers only if they are proposed by all models of the intersection pipeline.
Parameters
----------
model
List of models of the union.
Examples
--------
>>> from pprint import pprint as print
>>> from cherche import retrieve
>>> documents = [
... {"id": 0, "title": "Paris", "article": "Paris is the capital of France", "author": "Wiki"},
... {"id": 1, "title": "Eiffel tower", "article": "Eiffel tower is based in Paris.", "author": "Wiki"},
... {"id": 2, "title": "Montreal", "article": "Montreal is in Canada.", "author": "Wiki"},
... ]
>>> search = (
... retrieve.TfIdf(key="id", on="title", documents=documents) &
... retrieve.TfIdf(key="id", on="article", documents=documents) &
... retrieve.Flash(key="id", on="author")
... ) + documents
>>> search.add(documents)
Intersection
-----
TfIdf retriever
key: id
on: title
documents: 3
TfIdf retriever
key: id
on: article
documents: 3
Flash retriever
key: id
on: author
documents: 1
-----
Mapping to documents
>>> print(search(q = "Wiki Paris"))
[{'article': 'Paris is the capital of France',
'author': 'Wiki',
'id': 0,
'similarity': 1.0,
'title': 'Paris'}]
>>> print(search(q = "Paris"))
[]
>>> print(search(q = "Wiki Paris Montreal Eiffel"))
[{'article': 'Paris is the capital of France',
'author': 'Wiki',
'id': 0,
'similarity': 0.57735,
'title': 'Paris'},
{'article': 'Montreal is in Canada.',
'author': 'Wiki',
'id': 2,
'similarity': 0.57735,
'title': 'Montreal'},
{'article': 'Eiffel tower is based in Paris.',
'author': 'Wiki',
'id': 1,
'similarity': 0.40825,
'title': 'Eiffel tower'}]
"""
def __init__(self, models: list):
super().__init__(models=models)
for model in self.models:
if hasattr(model, "key"):
self.key = model.key
break
def __call__(self, q: str, **kwargs) -> list:
"""
Parameters
----------
q
Input query.
"""
query = {"q": q, **kwargs}
similarities = {}
counter_docs = collections.defaultdict(int)
for model in self.models:
for document in model(**query):
# Remove similarities to avoid duplicates
if "similarity" in document:
similarity = document.pop("similarity")
if document[self.key] not in similarities:
similarities[document[self.key]] = similarity
counter_docs[tuple(sorted(document.items()))] += 1
intersection = [
dict(document) for document, count in counter_docs.items() if count >= len(self.models)
]
# Add similarity that we previously removed.
ranked = []
for document in intersection:
similarity = similarities.get(document.get(self.key, None), None)
if similarity is not None:
ranked.append({**document, **{"similarity": similarity}})
else:
ranked.append(document)
return ranked
def __and__(self, other) -> "Intersection":
return Intersection(models=self.models + [other])
| 28.053763
| 111
| 0.526
| 794
| 7,827
| 5.110831
| 0.149874
| 0.039428
| 0.0414
| 0.0207
| 0.723509
| 0.717348
| 0.714145
| 0.714145
| 0.708231
| 0.698866
| 0
| 0.010013
| 0.323751
| 7,827
| 278
| 112
| 28.154676
| 0.75666
| 0.498403
| 0
| 0.564103
| 0
| 0
| 0.035921
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.102564
| false
| 0
| 0.038462
| 0.012821
| 0.269231
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
31411e070f835112c932b772c51cc62cd9b5bfb6
| 114
|
py
|
Python
|
advent_of_code/year2018/day1/part1_frequencies.py
|
Tenebrar/codebase
|
59c9a35289fb29afedad0e3edd0519b67372ef9f
|
[
"Unlicense"
] | 1
|
2020-04-21T11:39:25.000Z
|
2020-04-21T11:39:25.000Z
|
advent_of_code/year2018/day1/part1_frequencies.py
|
Tenebrar/codebase
|
59c9a35289fb29afedad0e3edd0519b67372ef9f
|
[
"Unlicense"
] | 7
|
2020-02-12T01:08:01.000Z
|
2022-02-10T11:56:56.000Z
|
advent_of_code/year2018/day1/part1_frequencies.py
|
Tenebrar/codebase
|
59c9a35289fb29afedad0e3edd0519b67372ef9f
|
[
"Unlicense"
] | null | null | null |
from advent_of_code.util import input_file
with input_file() as file:
print(sum(int(line) for line in file))
| 22.8
| 42
| 0.754386
| 21
| 114
| 3.904762
| 0.761905
| 0.219512
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 114
| 4
| 43
| 28.5
| 0.854167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 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
|
314ab49a85edb1d8562faefb9fb24380bb4fb7dc
| 1,535
|
py
|
Python
|
MakingMagicHappen/rabbit/models.py
|
MaeKat/MMRH
|
4952194b714c673a93f21f78d7f5256ba674162b
|
[
"MIT"
] | 1
|
2019-02-26T15:57:19.000Z
|
2019-02-26T15:57:19.000Z
|
MakingMagicHappen/rabbit/models.py
|
MaeKat/MMRH
|
4952194b714c673a93f21f78d7f5256ba674162b
|
[
"MIT"
] | null | null | null |
MakingMagicHappen/rabbit/models.py
|
MaeKat/MMRH
|
4952194b714c673a93f21f78d7f5256ba674162b
|
[
"MIT"
] | null | null | null |
from django.db import models
from django.conf import settings
# Create your models here.
# model for the calendar event
class calendarEvent(models.Model):
user= models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
event_name = models.CharField(max_length= 100, null= False)
event_time = models.TimeField((u"event Time"), auto_now_add=True, blank=True)
event_location = models.CharField(max_length = 1000, null= False)
# model for the rabbit profile
class rabbitProfile(models.Model):
name = models.CharField(max_length= 42, blank= False)
Breed = models.CharField(max_length= 30)
Gender = models.CharField(max_length= 6)
Age = models.CharField(max_length= 10)
Size = models.CharField(max_length= 10)
Spayed_Neutered = models.CharField(max_length=5)
Location = models.CharField(max_length=300, default='')
about = models.TextField()
profile_createdDate = models.DateTimeField(auto_now_add=True)
image = models.CharField(max_length=400)
class gunieaProfile(models.Model):
name = models.CharField(max_length= 42, blank= False)
Breed = models.CharField(max_length= 30)
Gender = models.CharField(max_length= 6)
Age = models.CharField(max_length= 10)
Size = models.CharField(max_length= 10)
Spayed_Neutered = models.CharField(max_length=5)
Location = models.CharField(max_length=300, default='')
about = models.TextField()
profile_createdDate = models.DateTimeField(auto_now_add=True)
image = models.CharField(max_length=400)
| 42.638889
| 81
| 0.745928
| 204
| 1,535
| 5.446078
| 0.308824
| 0.243024
| 0.291629
| 0.388839
| 0.694869
| 0.640864
| 0.640864
| 0.640864
| 0.640864
| 0.640864
| 0
| 0.029839
| 0.148534
| 1,535
| 36
| 82
| 42.638889
| 0.820199
| 0.05342
| 0
| 0.689655
| 0
| 0
| 0.006897
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.068966
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
314f1a0f98945e256deb29d3eff8f7321c3a22fe
| 35
|
py
|
Python
|
mailgunbot/__init__.py
|
cochoa0x1/mailgunbot
|
77b5b1b93cd7ea355c247232cfd0b24e14225cec
|
[
"MIT"
] | 1
|
2017-04-09T12:44:25.000Z
|
2017-04-09T12:44:25.000Z
|
mailgunbot/__init__.py
|
cochoa0x1/mailgunbot
|
77b5b1b93cd7ea355c247232cfd0b24e14225cec
|
[
"MIT"
] | null | null | null |
mailgunbot/__init__.py
|
cochoa0x1/mailgunbot
|
77b5b1b93cd7ea355c247232cfd0b24e14225cec
|
[
"MIT"
] | 1
|
2018-02-25T00:26:54.000Z
|
2018-02-25T00:26:54.000Z
|
from mailgunbot.mailgunbot import *
| 35
| 35
| 0.857143
| 4
| 35
| 7.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085714
| 35
| 1
| 35
| 35
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3161e472618aed9b9e13f738b9cfff417c8b99f9
| 1,158
|
py
|
Python
|
tests/test_strex.py
|
alex-700/nr-deprecated
|
f9f8b89ea1b084841a8ab65784eaf68852686b2a
|
[
"MIT"
] | null | null | null |
tests/test_strex.py
|
alex-700/nr-deprecated
|
f9f8b89ea1b084841a8ab65784eaf68852686b2a
|
[
"MIT"
] | 2
|
2016-12-09T16:43:31.000Z
|
2018-01-09T00:15:31.000Z
|
tests/test_strex.py
|
alex-700/nr-deprecated
|
f9f8b89ea1b084841a8ab65784eaf68852686b2a
|
[
"MIT"
] | 3
|
2018-08-20T14:47:58.000Z
|
2020-10-13T13:42:35.000Z
|
from nose.tools import *
from nr import strex
def test_seek():
s = strex.Scanner("foo\nbar")
assert_equal(s.char, 'f')
assert_equal(s.cursor, strex.Cursor(0, 1, 0))
s.next()
assert_equal(s.char, 'o')
assert_equal(s.cursor, strex.Cursor(1, 1, 1))
s.seek(5)
assert_equal(s.char, 'a')
assert_equal(s.cursor, strex.Cursor(5, 2, 1))
s.seek(-1, 'cur')
assert_equal(s.char, 'b')
assert_equal(s.cursor, strex.Cursor(4, 2, 0))
s.seek(-1, 'cur')
assert_equal(s.char, '\n')
assert_equal(s.cursor, strex.Cursor(3, 1, 3))
s.seek(-1, 'cur')
assert_equal(s.char, 'o')
assert_equal(s.cursor, strex.Cursor(2, 1, 2))
s.seek(-1, 'cur')
assert_equal(s.char, 'o')
assert_equal(s.cursor, strex.Cursor(1, 1, 1))
s.seek(-1, 'cur')
assert_equal(s.char, 'f')
assert_equal(s.cursor, strex.Cursor(0, 1, 0))
# At the start, seek ingored.
s.seek(-1, 'cur')
assert_equal(s.char, 'f')
assert_equal(s.cursor, strex.Cursor(0, 1, 0))
s.seek(0, 'end')
assert_equal(s.char, '')
assert_equal(s.cursor, strex.Cursor(7, 2, 3))
s.seek(-20, 'cur')
assert_equal(s.char, 'f')
assert_equal(s.cursor, strex.Cursor(0, 1, 0))
| 23.16
| 47
| 0.632988
| 211
| 1,158
| 3.364929
| 0.175355
| 0.340845
| 0.371831
| 0.247887
| 0.778873
| 0.778873
| 0.615493
| 0.615493
| 0.580282
| 0.543662
| 0
| 0.044103
| 0.158031
| 1,158
| 49
| 48
| 23.632653
| 0.684103
| 0.023316
| 0
| 0.527778
| 0
| 0
| 0.038121
| 0
| 0
| 0
| 0
| 0
| 0.611111
| 1
| 0.027778
| false
| 0
| 0.055556
| 0
| 0.083333
| 0
| 0
| 0
| 0
| null | 1
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
31be9ac22c495930e5f66d5838d68dc5be590b9b
| 71
|
py
|
Python
|
day2/heaven.py
|
nikhilsamninan/python-files
|
15198459081097058a939b40b5e8ef754e578fe0
|
[
"Apache-2.0"
] | null | null | null |
day2/heaven.py
|
nikhilsamninan/python-files
|
15198459081097058a939b40b5e8ef754e578fe0
|
[
"Apache-2.0"
] | null | null | null |
day2/heaven.py
|
nikhilsamninan/python-files
|
15198459081097058a939b40b5e8ef754e578fe0
|
[
"Apache-2.0"
] | null | null | null |
print('h' in 'heaven')
print('H' not in 'Hell')
print(5 in (1,2,3,4,))
| 23.666667
| 24
| 0.577465
| 16
| 71
| 2.5625
| 0.6875
| 0.292683
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081967
| 0.140845
| 71
| 3
| 25
| 23.666667
| 0.590164
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
9ee7675da81bd3974a807fe3f8e20cd059d382cb
| 62
|
py
|
Python
|
egs/madcat_arabic/v1/local/models/__init__.py
|
huangruizhe/waldo_old
|
75ead75c3320643888141573f191f5190f9aa203
|
[
"Apache-2.0"
] | 12
|
2018-05-07T05:47:37.000Z
|
2020-05-15T15:58:43.000Z
|
egs/madcat_arabic/v1/local/models/__init__.py
|
huangruizhe/waldo_old
|
75ead75c3320643888141573f191f5190f9aa203
|
[
"Apache-2.0"
] | 53
|
2018-04-29T20:51:17.000Z
|
2018-08-22T07:06:56.000Z
|
egs/madcat_arabic/v1/local/models/__init__.py
|
huangruizhe/waldo_old
|
75ead75c3320643888141573f191f5190f9aa203
|
[
"Apache-2.0"
] | 13
|
2018-04-28T22:00:19.000Z
|
2022-01-15T13:24:59.000Z
|
from __future__ import absolute_import
from .Unet import *
| 10.333333
| 38
| 0.790323
| 8
| 62
| 5.5
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177419
| 62
| 5
| 39
| 12.4
| 0.862745
| 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
|
9ef847d2d108d75bd39db8c3ce7b34a35095bdfa
| 64
|
py
|
Python
|
message/__init__.py
|
paulmchen/cmd2browser
|
1b079b05e9a9ef2c306bd86c5fac7f95d82e8005
|
[
"Apache-2.0"
] | 1
|
2020-08-09T19:23:11.000Z
|
2020-08-09T19:23:11.000Z
|
message/__init__.py
|
paulmchen/cmd2browser
|
1b079b05e9a9ef2c306bd86c5fac7f95d82e8005
|
[
"Apache-2.0"
] | null | null | null |
message/__init__.py
|
paulmchen/cmd2browser
|
1b079b05e9a9ef2c306bd86c5fac7f95d82e8005
|
[
"Apache-2.0"
] | 2
|
2020-08-09T19:20:43.000Z
|
2021-11-21T18:38:35.000Z
|
# __init__.py
from .message import error_404_msg, error_500_msg
| 21.333333
| 49
| 0.828125
| 11
| 64
| 4.090909
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 0.109375
| 64
| 2
| 50
| 32
| 0.684211
| 0.171875
| 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
|
7315b8c664d2ae80038ba97ee17efcaaf7c28982
| 258
|
py
|
Python
|
sandy-disaster-recovery/question_db.py
|
toddjcrane/crisiscleanup-legacy
|
74dbad143ebc3bfae4cc5afc478e43ab4033ff69
|
[
"Apache-2.0"
] | 1
|
2017-01-07T21:44:21.000Z
|
2017-01-07T21:44:21.000Z
|
sandy-disaster-recovery/question_db.py
|
aarontitus/crisiscleanup-legacy
|
74dbad143ebc3bfae4cc5afc478e43ab4033ff69
|
[
"Apache-2.0"
] | 1
|
2021-03-26T00:25:19.000Z
|
2021-03-26T00:25:19.000Z
|
sandy-disaster-recovery/question_db.py
|
toddjcrane/crisiscleanup-legacy
|
74dbad143ebc3bfae4cc5afc478e43ab4033ff69
|
[
"Apache-2.0"
] | 1
|
2017-09-07T09:52:15.000Z
|
2017-09-07T09:52:15.000Z
|
from google.appengine.ext import db
class MultipleChoiceQuestion(db.Model):
question = db.TextProperty(required=True)
correct_answer = db.TextProperty(required=True)
wrong_answers = db.StringListProperty()
explanation = db.TextProperty()
| 23.454545
| 51
| 0.75969
| 28
| 258
| 6.928571
| 0.678571
| 0.216495
| 0.226804
| 0.268041
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147287
| 258
| 10
| 52
| 25.8
| 0.881818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
7327cb3cbe9d12fed439b375fa6beb09cddea943
| 136
|
py
|
Python
|
postgres_kernel/__main__.py
|
Basic-Components/postgres_kernel
|
ea0703202f3fa7d05b8f684efe498895fb9974c8
|
[
"MIT"
] | 65
|
2016-06-07T19:26:18.000Z
|
2021-09-18T12:53:13.000Z
|
postgres_kernel/__main__.py
|
Basic-Components/postgres_kernel
|
ea0703202f3fa7d05b8f684efe498895fb9974c8
|
[
"MIT"
] | 18
|
2017-03-02T14:39:59.000Z
|
2020-09-30T09:32:54.000Z
|
postgres_kernel/__main__.py
|
Basic-Components/postgres_kernel
|
ea0703202f3fa7d05b8f684efe498895fb9974c8
|
[
"MIT"
] | 18
|
2016-06-07T19:27:23.000Z
|
2021-07-01T09:55:19.000Z
|
from ipykernel.kernelapp import IPKernelApp
from .kernel import PostgresKernel
IPKernelApp.launch_instance(kernel_class=PostgresKernel)
| 34
| 56
| 0.889706
| 15
| 136
| 7.933333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066176
| 136
| 3
| 57
| 45.333333
| 0.937008
| 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
|
7329c44d77f4499bfa1c792a4e1033590862a84a
| 28
|
py
|
Python
|
src/sqlitehelper/__init__.py
|
0xtr/minimud_python
|
7241e3b904cd39426adbe0d884b0d6782bff82bf
|
[
"MIT"
] | null | null | null |
src/sqlitehelper/__init__.py
|
0xtr/minimud_python
|
7241e3b904cd39426adbe0d884b0d6782bff82bf
|
[
"MIT"
] | null | null | null |
src/sqlitehelper/__init__.py
|
0xtr/minimud_python
|
7241e3b904cd39426adbe0d884b0d6782bff82bf
|
[
"MIT"
] | null | null | null |
from . import SQLiteHelper
| 9.333333
| 26
| 0.785714
| 3
| 28
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178571
| 28
| 2
| 27
| 14
| 0.956522
| 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
|
7339536aaa83939d4aef497c4c526ff5db6b1bde
| 33
|
py
|
Python
|
myfirst/login.py
|
jjwang-tester/TestFirstUse
|
4fb224462818c968b14d2a88a1aa96f8a4f4792e
|
[
"MIT"
] | null | null | null |
myfirst/login.py
|
jjwang-tester/TestFirstUse
|
4fb224462818c968b14d2a88a1aa96f8a4f4792e
|
[
"MIT"
] | null | null | null |
myfirst/login.py
|
jjwang-tester/TestFirstUse
|
4fb224462818c968b14d2a88a1aa96f8a4f4792e
|
[
"MIT"
] | null | null | null |
num =10
num2= 20
num3=30
num4=40
| 6.6
| 8
| 0.69697
| 8
| 33
| 2.875
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.407407
| 0.181818
| 33
| 4
| 9
| 8.25
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
b40866432554205ee57567afdf2527d666cba5c2
| 49
|
py
|
Python
|
mbench/intervention/efficacy/__init__.py
|
sepmein/mBench
|
5f2d7115ac8178ca0e076cfceebc75fa8d46127d
|
[
"BSD-3-Clause"
] | 1
|
2022-03-21T14:18:11.000Z
|
2022-03-21T14:18:11.000Z
|
mbench/intervention/efficacy/__init__.py
|
sepmein/mBench
|
5f2d7115ac8178ca0e076cfceebc75fa8d46127d
|
[
"BSD-3-Clause"
] | 6
|
2022-03-04T11:37:52.000Z
|
2022-03-31T19:13:43.000Z
|
mbench/intervention/efficacy/__init__.py
|
sepmein/mBench
|
5f2d7115ac8178ca0e076cfceebc75fa8d46127d
|
[
"BSD-3-Clause"
] | null | null | null |
from .converter import Converter, Converter_2022
| 24.5
| 48
| 0.857143
| 6
| 49
| 6.833333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.102041
| 49
| 1
| 49
| 49
| 0.840909
| 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
|
b40ab59eea068e82b6ac6d51a00452a5407ee305
| 203
|
py
|
Python
|
AlgoExpert-Array/Non Constructible Change.py
|
betaSolver05609/LeetCode
|
0e7386e7ead80597e2893ec45f6dc6dfcd5d694b
|
[
"MIT"
] | null | null | null |
AlgoExpert-Array/Non Constructible Change.py
|
betaSolver05609/LeetCode
|
0e7386e7ead80597e2893ec45f6dc6dfcd5d694b
|
[
"MIT"
] | null | null | null |
AlgoExpert-Array/Non Constructible Change.py
|
betaSolver05609/LeetCode
|
0e7386e7ead80597e2893ec45f6dc6dfcd5d694b
|
[
"MIT"
] | null | null | null |
def nonConstructibleChange(coins):
coins.sort()
# Write your code here.
changeable=0
for coin in coins:
if coin>changeable+1:
return changeable+1
changeable+=coin
return changeable+1
| 18.454545
| 34
| 0.719212
| 27
| 203
| 5.407407
| 0.592593
| 0.226027
| 0.232877
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02454
| 0.197044
| 203
| 10
| 35
| 20.3
| 0.871166
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b43b6d9f6bc4c15012891f8228d0ea81fad5c4de
| 80
|
py
|
Python
|
src/compas_igs/ui/Rhino/IGS/dev/__plugin__.py
|
BlockResearchGroup/compas-IGS
|
b40698466b91c867600b94ae2530b19d336ad1b0
|
[
"MIT"
] | 1
|
2021-11-03T23:22:37.000Z
|
2021-11-03T23:22:37.000Z
|
src/compas_igs/ui/Rhino/IGS/dev/__plugin__.py
|
BlockResearchGroup/compas-IGS
|
b40698466b91c867600b94ae2530b19d336ad1b0
|
[
"MIT"
] | 1
|
2021-11-10T03:27:58.000Z
|
2021-11-17T13:51:17.000Z
|
src/compas_igs/ui/Rhino/IGS/dev/__plugin__.py
|
BlockResearchGroup/compas-IGS
|
b40698466b91c867600b94ae2530b19d336ad1b0
|
[
"MIT"
] | null | null | null |
id = "{3e33b31b-86ac-402c-babf-d3c16962ed33}"
version = "0.1.0.0"
title = "IGS"
| 20
| 45
| 0.6625
| 13
| 80
| 4.076923
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.309859
| 0.1125
| 80
| 3
| 46
| 26.666667
| 0.43662
| 0
| 0
| 0
| 0
| 0
| 0.6
| 0.475
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
b4439c039b7ca8c553810fb1ec1b16bf93d91006
| 11,369
|
py
|
Python
|
filebeat/tests/system/test_harvester.py
|
consulthys/beats
|
e72206e43e20f477190ce22e4e8d8aee00155c6a
|
[
"Apache-2.0"
] | null | null | null |
filebeat/tests/system/test_harvester.py
|
consulthys/beats
|
e72206e43e20f477190ce22e4e8d8aee00155c6a
|
[
"Apache-2.0"
] | null | null | null |
filebeat/tests/system/test_harvester.py
|
consulthys/beats
|
e72206e43e20f477190ce22e4e8d8aee00155c6a
|
[
"Apache-2.0"
] | null | null | null |
from filebeat import BaseTest
import os
import time
"""
Test Harvesters
"""
class Test(BaseTest):
def test_close_renamed(self):
"""
Checks that a file is closed when its renamed / rotated
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
close_renamed="true",
scan_frequency="0.1s"
)
os.mkdir(self.working_dir + "/log/")
testfile1 = self.working_dir + "/log/test.log"
testfile2 = self.working_dir + "/log/test.log.rotated"
file = open(testfile1, 'w')
iterations1 = 5
for n in range(0, iterations1):
file.write("rotation file")
file.write("\n")
file.close()
filebeat = self.start_beat()
# Let it read the file
self.wait_until(
lambda: self.output_has(lines=iterations1), max_timeout=10)
os.rename(testfile1, testfile2)
file = open(testfile1, 'w', 0)
file.write("Hello World\n")
file.close()
# Wait until error shows up
self.wait_until(
lambda: self.log_contains(
"Closing because close_renamed is enabled"),
max_timeout=15)
# Let it read the file
self.wait_until(
lambda: self.output_has(lines=iterations1 + 1), max_timeout=10)
filebeat.check_kill_and_wait()
data = self.get_registry()
# Make sure new file was picked up. As it has the same file name,
# one entry for the new and one for the old should exist
assert len(data) == 2
def test_close_removed(self):
"""
Checks that a file is closed if removed
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
close_removed="true",
scan_frequency="0.1s"
)
os.mkdir(self.working_dir + "/log/")
testfile1 = self.working_dir + "/log/test.log"
file = open(testfile1, 'w')
iterations1 = 5
for n in range(0, iterations1):
file.write("rotation file")
file.write("\n")
file.close()
filebeat = self.start_beat()
# Let it read the file
self.wait_until(
lambda: self.output_has(lines=iterations1), max_timeout=10)
os.remove(testfile1)
# Wait until error shows up on windows
self.wait_until(
lambda: self.log_contains(
"Closing because close_removed is enabled"),
max_timeout=15)
filebeat.check_kill_and_wait()
data = self.get_registry()
# Make sure the state for the file was persisted
assert len(data) == 1
def test_close_eof(self):
"""
Checks that a file is closed if eof is reached
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
close_eof="true",
scan_frequency="0.1s"
)
os.mkdir(self.working_dir + "/log/")
testfile1 = self.working_dir + "/log/test.log"
file = open(testfile1, 'w')
iterations1 = 5
for n in range(0, iterations1):
file.write("rotation file")
file.write("\n")
file.close()
filebeat = self.start_beat()
# Let it read the file
self.wait_until(
lambda: self.output_has(lines=iterations1), max_timeout=10)
# Wait until error shows up on windows
self.wait_until(
lambda: self.log_contains(
"Closing because close_eof is enabled"),
max_timeout=15)
filebeat.check_kill_and_wait()
data = self.get_registry()
# Make sure the state for the file was persisted
assert len(data) == 1
def test_empty_line(self):
"""
Checks that no empty events are sent for an empty line but state is still updated
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
)
os.mkdir(self.working_dir + "/log/")
logfile = self.working_dir + "/log/test.log"
filebeat = self.start_beat()
with open(logfile, 'w') as f:
f.write("Hello world\n")
# Let it read the file
self.wait_until(
lambda: self.output_has(lines=1), max_timeout=10)
with open(logfile, 'a') as f:
f.write("\n")
expectedOffset = 13
if os.name == "nt":
# Two additional newline chars
expectedOffset += 2
# Wait until offset for new line is updated
self.wait_until(
lambda: self.log_contains(
"offset: " + str(expectedOffset)),
max_timeout=15)
with open(logfile, 'a') as f:
f.write("Third line\n")
# Make sure only 2 events are written
self.wait_until(
lambda: self.output_has(lines=2), max_timeout=10)
filebeat.check_kill_and_wait()
data = self.get_registry()
# Make sure the state for the file was persisted
assert len(data) == 1
def test_empty_lines_only(self):
"""
Checks that no empty events are sent for a file with only empty lines
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
)
os.mkdir(self.working_dir + "/log/")
logfile = self.working_dir + "/log/test.log"
filebeat = self.start_beat()
with open(logfile, 'w') as f:
f.write("\n")
f.write("\n")
f.write("\n")
expectedOffset = 3
if os.name == "nt":
# Two additional newline chars
expectedOffset += 3
# Wait until offset for new line is updated
self.wait_until(
lambda: self.log_contains(
"offset: " + str(expectedOffset)),
max_timeout=15)
assert os.path.isfile(self.working_dir + "/output/filebeat") == False
filebeat.check_kill_and_wait()
data = self.get_registry()
# Make sure the state for the file was persisted
assert len(data) == 1
def test_exceed_buffer(self):
"""
Checks that also full line is sent if lines exceeds buffer
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
harvester_buffer_size=10,
)
os.mkdir(self.working_dir + "/log/")
logfile = self.working_dir + "/log/test.log"
filebeat = self.start_beat()
message = "This exceeds the buffer"
with open(logfile, 'w') as f:
f.write(message + "\n")
# Wait until state is written
self.wait_until(
lambda: self.log_contains(
"1 states written."),
max_timeout=15)
filebeat.check_kill_and_wait()
data = self.get_registry()
assert len(data) == 1
output = self.read_output_json()
assert message == output[0]["message"]
def test_truncated_file_open(self):
"""
Checks if it is correctly detected if an open file is truncated
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
)
os.mkdir(self.working_dir + "/log/")
logfile = self.working_dir + "/log/test.log"
message = "Hello World"
filebeat = self.start_beat()
# Write 3 lines
with open(logfile, 'w') as f:
f.write(message + "\n")
f.write(message + "\n")
f.write(message + "\n")
# wait for the "Skipping file" log message
self.wait_until(
lambda: self.output_has(lines=3),
max_timeout=10)
# Write 1 line -> truncation
with open(logfile, 'w') as f:
f.write(message + "\n")
# wait for the "Skipping file" log message
self.wait_until(
lambda: self.output_has(lines=4),
max_timeout=10)
# Test if truncation was reported properly
self.wait_until(
lambda: self.log_contains(
"File was truncated as offset"),
max_timeout=15)
self.wait_until(
lambda: self.log_contains(
"File was truncated. Begin reading file from offset 0"),
max_timeout=15)
filebeat.check_kill_and_wait()
def test_truncated_file_closed(self):
"""
Checks if it is correctly detected if a closed file is truncated
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
close_inactive="1s",
)
os.mkdir(self.working_dir + "/log/")
logfile = self.working_dir + "/log/test.log"
message = "Hello World"
filebeat = self.start_beat()
# Write 3 lines
with open(logfile, 'w') as f:
f.write(message + "\n")
f.write(message + "\n")
f.write(message + "\n")
# wait for the "Skipping file" log message
self.wait_until(
lambda: self.output_has(lines=3),
max_timeout=10)
# Wait until harvester is closed
self.wait_until(
lambda: self.log_contains(
"Stopping harvester for file"),
max_timeout=15)
# Write 1 line -> truncation
with open(logfile, 'w') as f:
f.write(message + "\n")
# wait for the "Skipping file" log message
self.wait_until(
lambda: self.output_has(lines=4),
max_timeout=10)
# Test if truncation was reported properly
self.wait_until(
lambda: self.log_contains(
"Old file was truncated. Starting from the beginning"),
max_timeout=15)
filebeat.check_kill_and_wait()
def test_close_timeout(self):
"""
Checks that a file is closed after close_timeout
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/test.log",
close_timeout="1s",
scan_frequency="1s"
)
os.mkdir(self.working_dir + "/log/")
filebeat = self.start_beat()
testfile1 = self.working_dir + "/log/test.log"
file = open(testfile1, 'w')
# Write 1000 lines with a sleep between each line to make sure it takes more then 1s to complete
iterations1 = 1000
for n in range(0, iterations1):
file.write("example data")
file.write("\n")
time.sleep(0.001)
file.close()
# Wait until harvester is closed because of ttl
self.wait_until(
lambda: self.log_contains(
"Closing harvester because close_timeout was reached"),
max_timeout=15)
filebeat.check_kill_and_wait()
data = self.get_registry()
assert len(data) == 1
# Check that not all but some lines were read
assert self.output_lines() < 1000
assert self.output_lines() > 0
| 27.729268
| 104
| 0.558976
| 1,389
| 11,369
| 4.435565
| 0.12743
| 0.051777
| 0.065898
| 0.07726
| 0.788671
| 0.769843
| 0.76124
| 0.736893
| 0.690148
| 0.66223
| 0
| 0.017402
| 0.337849
| 11,369
| 409
| 105
| 27.797066
| 0.80101
| 0.157798
| 0
| 0.738397
| 0
| 0
| 0.096348
| 0.002256
| 0
| 0
| 0
| 0
| 0.046414
| 1
| 0.037975
| false
| 0
| 0.012658
| 0
| 0.054852
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
81f27e802ecca9470bc631bc4afd63fb66befa79
| 150
|
py
|
Python
|
run.py
|
RemoteCodersAtWork/Personal-Workspace
|
4247d406c351c252f0a43a44feece1f16d017762
|
[
"MIT"
] | null | null | null |
run.py
|
RemoteCodersAtWork/Personal-Workspace
|
4247d406c351c252f0a43a44feece1f16d017762
|
[
"MIT"
] | null | null | null |
run.py
|
RemoteCodersAtWork/Personal-Workspace
|
4247d406c351c252f0a43a44feece1f16d017762
|
[
"MIT"
] | 2
|
2020-11-23T07:19:03.000Z
|
2020-12-08T02:46:53.000Z
|
from app import app
if __name__ == "__main__" :
app.secret_key = "secretkey"
from app import db
db.create_all()
app.run(debug = True)
| 21.428571
| 32
| 0.653333
| 22
| 150
| 4
| 0.681818
| 0.159091
| 0.295455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.24
| 150
| 7
| 33
| 21.428571
| 0.77193
| 0
| 0
| 0
| 0
| 0
| 0.112583
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 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
|
c36addd6ab5fa22991b164afdd0f877e296c2c0e
| 53
|
py
|
Python
|
CodeWithMosth/my_py_package/shipping.py
|
AymanTareq/Python_Scripts
|
ae41bd667c4e68f0f7024ec91b3444a082ea98ee
|
[
"CC0-1.0"
] | null | null | null |
CodeWithMosth/my_py_package/shipping.py
|
AymanTareq/Python_Scripts
|
ae41bd667c4e68f0f7024ec91b3444a082ea98ee
|
[
"CC0-1.0"
] | null | null | null |
CodeWithMosth/my_py_package/shipping.py
|
AymanTareq/Python_Scripts
|
ae41bd667c4e68f0f7024ec91b3444a082ea98ee
|
[
"CC0-1.0"
] | null | null | null |
def calc_shipping():
print("Calculate shipping")
| 26.5
| 31
| 0.716981
| 6
| 53
| 6.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 53
| 2
| 31
| 26.5
| 0.822222
| 0
| 0
| 0
| 0
| 0
| 0.339623
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
5ee6bb8cf39dff36d2b85108bb3b115b1935de2e
| 15
|
py
|
Python
|
test1.py
|
alibumaye81/topes
|
a63c5c555fcfb11ba55b4b775ac87c1fb51aaf80
|
[
"Apache-2.0"
] | null | null | null |
test1.py
|
alibumaye81/topes
|
a63c5c555fcfb11ba55b4b775ac87c1fb51aaf80
|
[
"Apache-2.0"
] | null | null | null |
test1.py
|
alibumaye81/topes
|
a63c5c555fcfb11ba55b4b775ac87c1fb51aaf80
|
[
"Apache-2.0"
] | null | null | null |
print('Topes')
| 7.5
| 14
| 0.666667
| 2
| 15
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 15
| 1
| 15
| 15
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 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
|
6f341ad4ad7c36e6028273b674c48e1b88d7090f
| 44
|
py
|
Python
|
utlib/__init__.py
|
gilramir/instmake
|
7b083a5061be43e9b92bdcf0f3badda7c4107eef
|
[
"BSD-3-Clause"
] | null | null | null |
utlib/__init__.py
|
gilramir/instmake
|
7b083a5061be43e9b92bdcf0f3badda7c4107eef
|
[
"BSD-3-Clause"
] | null | null | null |
utlib/__init__.py
|
gilramir/instmake
|
7b083a5061be43e9b92bdcf0f3badda7c4107eef
|
[
"BSD-3-Clause"
] | null | null | null |
# Copyright (c) 2012 by Cisco Systems, Inc.
| 22
| 43
| 0.704545
| 7
| 44
| 4.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0.181818
| 44
| 1
| 44
| 44
| 0.75
| 0.931818
| 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
|
6f6e86f430a14c5350094447e8d911702acfa449
| 4,717
|
py
|
Python
|
tests/test_changepointstudy.py
|
vishalbelsare/bayesloop
|
667db2dbd102629c16bd8675e2b8c4e365de9b28
|
[
"MIT"
] | 98
|
2015-10-07T11:18:41.000Z
|
2022-03-28T11:09:23.000Z
|
tests/test_changepointstudy.py
|
AndreasBauerGit/bayesloop
|
166dd18c6f60cab99c28da57048f0520bbe9b188
|
[
"MIT"
] | 28
|
2015-09-02T09:20:38.000Z
|
2021-12-07T08:53:06.000Z
|
tests/test_changepointstudy.py
|
AndreasBauerGit/bayesloop
|
166dd18c6f60cab99c28da57048f0520bbe9b188
|
[
"MIT"
] | 25
|
2016-12-06T15:15:41.000Z
|
2021-10-03T19:14:13.000Z
|
#!/usr/bin/env python
from __future__ import print_function, division
import bayesloop as bl
import numpy as np
import sympy.stats as stats
class TestTwoParameterModel:
def test_fit_1cp_1bp_2hp(self):
# carry out fit
S = bl.ChangepointStudy()
S.loadData(np.array([1, 2, 3, 4, 5]))
S.setOM(bl.om.Gaussian('mean', bl.cint(0, 6, 20), 'sigma', bl.oint(0, 2, 20), prior=lambda m, s: 1/s**3))
T = bl.tm.SerialTransitionModel(
bl.tm.Static(),
bl.tm.ChangePoint('ChangePoint', [0, 1]),
bl.tm.CombinedTransitionModel(
bl.tm.GaussianRandomWalk('sigma', bl.cint(0, 0.2, 2), target='mean'),
bl.tm.RegimeSwitch('log10pMin', [-3, -1])
),
bl.tm.BreakPoint('BreakPoint', 'all'),
bl.tm.Static()
)
S.setTM(T)
S.fit()
# test parameter distributions
np.testing.assert_allclose(S.getParameterDistributions('mean', density=False)[1][:, 5],
[0.01243717, 0.03016095, 0.016939, 0.00024909, 0.00024909],
rtol=1e-04, err_msg='Erroneous posterior distribution values.')
# test parameter mean values
np.testing.assert_allclose(S.getParameterMeanValues('mean'),
[0.96802204, 1.95705078, 3.47078681, 4.22225665, 4.22225665],
rtol=1e-05, err_msg='Erroneous posterior mean values.')
# test model evidence value
np.testing.assert_almost_equal(S.logEvidence, -15.072007461556161, decimal=5,
err_msg='Erroneous log-evidence value.')
# test hyper-parameter distribution
x, p = S.getHyperParameterDistribution('sigma')
np.testing.assert_allclose(np.array([x, p]),
[[0., 0.2], [0.4963324, 0.5036676]],
rtol=1e-05, err_msg='Erroneous values in hyper-parameter distribution.')
# test duration distribution
d, p = S.getDurationDistribution(['ChangePoint', 'BreakPoint'])
np.testing.assert_allclose(np.array([d, p]),
[[1., 2., 3.], [0.01039273, 0.49395867, 0.49564861]],
rtol=1e-05, err_msg='Erroneous values in duration distribution.')
def test_fit_hyperpriors(self):
# carry out fit
S = bl.ChangepointStudy()
S.loadData(np.array([1, 2, 3, 4, 5]))
S.setOM(bl.om.Gaussian('mean', bl.cint(0, 6, 20), 'sigma', bl.oint(0, 2, 20), prior=lambda m, s: 1/s**3))
T = bl.tm.SerialTransitionModel(
bl.tm.Static(),
bl.tm.ChangePoint('ChangePoint', [0, 1], prior=np.array([0.3, 0.7])),
bl.tm.CombinedTransitionModel(
bl.tm.GaussianRandomWalk('sigma', bl.oint(0, 0.2, 2), target='mean', prior=lambda s: 1./s),
bl.tm.RegimeSwitch('log10pMin', [-3, -1])
),
bl.tm.BreakPoint('BreakPoint', 'all', prior=stats.Normal('Normal', 3., 1.)),
bl.tm.Static()
)
S.setTM(T)
S.fit()
# test parameter distributions
np.testing.assert_allclose(S.getParameterDistributions('mean', density=False)[1][:, 5],
[0.03372851, 0.05087598, 0.02024129, 0.00020918, 0.00020918],
rtol=1e-04, err_msg='Erroneous posterior distribution values.')
# test parameter mean values
np.testing.assert_allclose(S.getParameterMeanValues('mean'),
[0.9894398, 1.92805399, 3.33966456, 4.28759449, 4.28759449],
rtol=1e-05, err_msg='Erroneous posterior mean values.')
# test model evidence value
np.testing.assert_almost_equal(S.logEvidence, -15.709534690217343, decimal=5,
err_msg='Erroneous log-evidence value.')
# test hyper-parameter distribution
x, p = S.getHyperParameterDistribution('sigma')
np.testing.assert_allclose(np.array([x, p]),
[[0.06666667, 0.13333333], [0.66515107, 0.33484893]],
rtol=1e-05, err_msg='Erroneous values in hyper-parameter distribution.')
# test duration distribution
d, p = S.getDurationDistribution(['ChangePoint', 'BreakPoint'])
np.testing.assert_allclose(np.array([d, p]),
[[1., 2., 3.], [0.00373717, 0.40402616, 0.59223667]],
rtol=1e-05, err_msg='Erroneous values in duration distribution.')
| 46.70297
| 113
| 0.547806
| 538
| 4,717
| 4.741636
| 0.245353
| 0.025088
| 0.0588
| 0.072129
| 0.786358
| 0.786358
| 0.775382
| 0.775382
| 0.731478
| 0.731478
| 0
| 0.129032
| 0.316515
| 4,717
| 100
| 114
| 47.17
| 0.662221
| 0.070808
| 0
| 0.637681
| 0
| 0
| 0.128146
| 0
| 0
| 0
| 0
| 0
| 0.144928
| 1
| 0.028986
| false
| 0
| 0.057971
| 0
| 0.101449
| 0.014493
| 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
|
489c3ae2d5146bd670041c789278636786ceea0e
| 33
|
py
|
Python
|
src/goa/__main__.py
|
deeplego/goa
|
308e452e871660e38b6350a5833de674de517679
|
[
"MIT"
] | null | null | null |
src/goa/__main__.py
|
deeplego/goa
|
308e452e871660e38b6350a5833de674de517679
|
[
"MIT"
] | null | null | null |
src/goa/__main__.py
|
deeplego/goa
|
308e452e871660e38b6350a5833de674de517679
|
[
"MIT"
] | null | null | null |
from goa import cli
cli.main()
| 6.6
| 19
| 0.69697
| 6
| 33
| 3.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.212121
| 33
| 4
| 20
| 8.25
| 0.884615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
5b0d952aa7ecee07ef875e24155e1f88c9517bb8
| 85
|
py
|
Python
|
pysimplecache/__init__.py
|
brsynth/simplecache
|
6bba737bf7216977f7c1a01f4e4732acabc2446e
|
[
"MIT"
] | null | null | null |
pysimplecache/__init__.py
|
brsynth/simplecache
|
6bba737bf7216977f7c1a01f4e4732acabc2446e
|
[
"MIT"
] | null | null | null |
pysimplecache/__init__.py
|
brsynth/simplecache
|
6bba737bf7216977f7c1a01f4e4732acabc2446e
|
[
"MIT"
] | null | null | null |
from pysimplecache.Cache import Cache
from pysimplecache._version import __version__
| 28.333333
| 46
| 0.882353
| 10
| 85
| 7
| 0.5
| 0.485714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094118
| 85
| 2
| 47
| 42.5
| 0.909091
| 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
|
5b17cad0a91a2829b7ed08a5208bfb8a2966c8f5
| 1,649
|
py
|
Python
|
tests/test_affine.py
|
mathieubrochard/starcipher
|
8cc36f65d88fe24c6ba34863c8bd8188293d392a
|
[
"MIT"
] | 1
|
2016-10-15T16:33:52.000Z
|
2016-10-15T16:33:52.000Z
|
tests/test_affine.py
|
mathieubrochard/starcipher
|
8cc36f65d88fe24c6ba34863c8bd8188293d392a
|
[
"MIT"
] | null | null | null |
tests/test_affine.py
|
mathieubrochard/starcipher
|
8cc36f65d88fe24c6ba34863c8bd8188293d392a
|
[
"MIT"
] | null | null | null |
import unittest
from starcipher.dictionnary import Dictionnary
from starcipher.affine import Affine
class TestAffine(unittest.TestCase):
def setUp(self):
self._dictionnary = Dictionnary('tests/en.dict')
def test_xgcd(self):
self.assertEqual(Affine.xgcd(7, 3), (1, 1, -2))
self.assertEqual(Affine.xgcd(14812, 1482), (2, 185, -1849))
def test_mod_inv(self):
self.assertEqual(Affine.mod_inv(7841, 41), 37)
self.assertNotEqual(Affine.mod_inv(451, 78), 1)
def test_is_prime(self):
self.assertEqual(Affine.is_prime(1), True)
self.assertEqual(Affine.is_prime(2), True)
self.assertEqual(Affine.is_prime(3), True)
self.assertEqual(Affine.is_prime(4), False)
self.assertEqual(Affine.is_prime(5), True)
self.assertEqual(Affine.is_prime(7), True)
self.assertEqual(Affine.is_prime(8), False)
def test_inv_mod(self):
self.assertEqual(Affine.mod_inv(3, 26), 9)
def test_encrypt(self):
self.assertEqual(
Affine.encrypt(3, 12, 'HEY, THIS IS THE AFFINE CIPHER!'),
'HYG, RHKO KO RHY MBBKZY SKFHYL!'
)
def test_decrypt(self):
self.assertEqual(
Affine.decrypt(3, 12, 'HYG, RHKO KO RHY MBBKZY SKFHYL!'),
'HEY, THIS IS THE AFFINE CIPHER!'
)
def test_brute_force(self):
self.assertEqual(
Affine.brute_force('GWZD ZD B GNDG RQ GWN BQQZON HZUWNA. Z WRUN ZG PZII EN HABHFNK!', self._dictionnary),
'THIS IS A TEST OF THE AFFINE CIPHER. I HOPE IT WILL BE CRACKED!'
)
| 35.085106
| 118
| 0.620376
| 219
| 1,649
| 4.561644
| 0.360731
| 0.21021
| 0.294294
| 0.175175
| 0.374374
| 0.318318
| 0
| 0
| 0
| 0
| 0
| 0.043765
| 0.265616
| 1,649
| 46
| 119
| 35.847826
| 0.781173
| 0
| 0
| 0.081081
| 0
| 0
| 0.164067
| 0
| 0
| 0
| 0
| 0
| 0.405405
| 1
| 0.216216
| false
| 0
| 0.081081
| 0
| 0.324324
| 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
|
5b1fa36075470b0c8bdfc98d1bbd75a7d22a77f7
| 238
|
py
|
Python
|
espython/settings.py
|
victormartinez/espython
|
1b1f78e39e6e02d1e526ce5b2f52d0c6fdbb2067
|
[
"MIT"
] | null | null | null |
espython/settings.py
|
victormartinez/espython
|
1b1f78e39e6e02d1e526ce5b2f52d0c6fdbb2067
|
[
"MIT"
] | null | null | null |
espython/settings.py
|
victormartinez/espython
|
1b1f78e39e6e02d1e526ce5b2f52d0c6fdbb2067
|
[
"MIT"
] | null | null | null |
from decouple import config
ELASTICSEARCH_HOSTS = config('ELASTICSEARCH_HOSTS', 'elasticsearch')
ELASTICSEARCH_USERNAME = config('ELASTICSEARCH_USERNAME', 'elastic')
ELASTICSEARCH_PASSWORD = config('ELASTICSEARCH_PASSWORD', 'changeme')
| 34
| 69
| 0.823529
| 22
| 238
| 8.636364
| 0.454545
| 0.4
| 0.252632
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07563
| 238
| 6
| 70
| 39.666667
| 0.863636
| 0
| 0
| 0
| 0
| 0
| 0.382353
| 0.184874
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.25
| 0.25
| 0
| 0.25
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
d28651401e57f284df1d2e90bc09be4a7d934520
| 239
|
py
|
Python
|
4 kyu/Square into Squares Protect trees.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 6
|
2020-09-03T09:32:25.000Z
|
2020-12-07T04:10:01.000Z
|
4 kyu/Square into Squares Protect trees.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 1
|
2021-12-13T15:30:21.000Z
|
2021-12-13T15:30:21.000Z
|
4 kyu/Square into Squares Protect trees.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | null | null | null |
def decompose(n):
return helper(n, n**2)
def helper(n, sum, arr=[]):
if sum==0:
return arr[::-1]
for i in range(n-1, -1, -1):
if i**2<=sum:
return helper(i, sum-i**2, arr+[i]) or helper(i, sum, arr)
| 29.875
| 71
| 0.497908
| 44
| 239
| 2.704545
| 0.363636
| 0.201681
| 0.168067
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047059
| 0.288703
| 239
| 8
| 71
| 29.875
| 0.652941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.125
| 0.625
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.