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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0c236bda3f95e3ddc5296e36748b8192b8c4cba7
| 243
|
py
|
Python
|
python/itertools/__init__.py
|
mxdzi/hackerrank
|
4455f73e4479a4204b2e1167253f6a02351aa5b7
|
[
"MIT"
] | null | null | null |
python/itertools/__init__.py
|
mxdzi/hackerrank
|
4455f73e4479a4204b2e1167253f6a02351aa5b7
|
[
"MIT"
] | null | null | null |
python/itertools/__init__.py
|
mxdzi/hackerrank
|
4455f73e4479a4204b2e1167253f6a02351aa5b7
|
[
"MIT"
] | null | null | null |
__all__ = [
'q1_itertools_product',
'q2_itertools_permutations',
'q3_itertools_combinations',
'q4_itertools_combinations_with_replacement',
'q5_compress_the_string',
'q6_iterables_and_iterators',
'q7_maximize_it'
]
| 24.3
| 49
| 0.744856
| 26
| 243
| 6.115385
| 0.846154
| 0.264151
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034314
| 0.160494
| 243
| 9
| 50
| 27
| 0.745098
| 0
| 0
| 0
| 0
| 0
| 0.716049
| 0.576132
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0c2409bc9c62a060ea1dd970501ce9b60b90f455
| 328
|
py
|
Python
|
flask_app/errors.py
|
yaelmi3/backslash
|
edf39caf97af2c926da01c340a83648f4874e97e
|
[
"BSD-3-Clause"
] | 17
|
2015-11-25T13:02:38.000Z
|
2021-12-14T20:18:36.000Z
|
flask_app/errors.py
|
yaelmi3/backslash
|
edf39caf97af2c926da01c340a83648f4874e97e
|
[
"BSD-3-Clause"
] | 533
|
2015-11-24T12:47:13.000Z
|
2022-02-12T07:59:08.000Z
|
flask_app/errors.py
|
parallelsystems/backslash
|
577cdd18d5f665a8b493c4b2e2a605b7e0f6e11b
|
[
"BSD-3-Clause"
] | 15
|
2015-11-22T13:25:54.000Z
|
2022-02-16T19:23:11.000Z
|
from flask import render_template, make_response
errors = {}
def _define_custom_error_page(code):
def _handler(err):
return make_response(render_template("errors/{}.html".format(code)), code)
errors[code] = _handler
_define_custom_error_page(500)
_define_custom_error_page(404)
_define_custom_error_page(403)
| 25.230769
| 82
| 0.777439
| 45
| 328
| 5.177778
| 0.488889
| 0.206009
| 0.291845
| 0.360515
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.121951
| 328
| 12
| 83
| 27.333333
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0.042683
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.111111
| 0.111111
| 0.444444
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
0c245d9448e6fdb9ab45b904024ec5eafadbdd59
| 213
|
py
|
Python
|
psltdsim/dtc/__init__.py
|
thadhaines/PSLTDSim
|
1bc598f3733c1369c164f54249e5f7757e6bf466
|
[
"MIT"
] | null | null | null |
psltdsim/dtc/__init__.py
|
thadhaines/PSLTDSim
|
1bc598f3733c1369c164f54249e5f7757e6bf466
|
[
"MIT"
] | null | null | null |
psltdsim/dtc/__init__.py
|
thadhaines/PSLTDSim
|
1bc598f3733c1369c164f54249e5f7757e6bf466
|
[
"MIT"
] | null | null | null |
# This imports functions that will be available as psltdsim.dynamicAgents.*
from .DTCAgent import DTCAgent
from .DTCTimerAgent import DTCTimerAgent
from .RTAgent import RTAgent
from .parseAction import parseAction
| 42.6
| 75
| 0.84507
| 26
| 213
| 6.923077
| 0.615385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117371
| 213
| 5
| 76
| 42.6
| 0.957447
| 0.342723
| 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
|
0c38e3332260e7fc0191653cbfb0f3694ed9a495
| 221
|
py
|
Python
|
test.py
|
chapman-phys227-2016s/hw-4-ChinmaiRaman
|
d339b093f6b4a682b6c527616b1506ef5ae82aef
|
[
"MIT"
] | null | null | null |
test.py
|
chapman-phys227-2016s/hw-4-ChinmaiRaman
|
d339b093f6b4a682b6c527616b1506ef5ae82aef
|
[
"MIT"
] | null | null | null |
test.py
|
chapman-phys227-2016s/hw-4-ChinmaiRaman
|
d339b093f6b4a682b6c527616b1506ef5ae82aef
|
[
"MIT"
] | null | null | null |
def test_test():
assert(1 == 1)
# I had no nosetests because I implemented all of the homework in ipython as instructed. However, Travis CI was throwing an error because of this, so I had to create a bogus test file.
| 55.25
| 184
| 0.746606
| 40
| 221
| 4.1
| 0.8
| 0.04878
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011299
| 0.199095
| 221
| 4
| 184
| 55.25
| 0.915254
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.5
| true
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
0c3ad67ed646e4b7d18d94656f58b4e08b815f26
| 96
|
py
|
Python
|
src/canuvit/__init__.py
|
k-sriram/canuvit
|
e75028999531506982724771f33dcd7514ed4e99
|
[
"Apache-2.0"
] | 2
|
2021-10-31T10:06:47.000Z
|
2021-11-01T06:24:59.000Z
|
src/canuvit/__init__.py
|
k-sriram/canuvit
|
e75028999531506982724771f33dcd7514ed4e99
|
[
"Apache-2.0"
] | 2
|
2021-11-01T05:41:43.000Z
|
2021-11-01T18:05:12.000Z
|
src/canuvit/__init__.py
|
k-sriram/canuvit
|
e75028999531506982724771f33dcd7514ed4e99
|
[
"Apache-2.0"
] | 1
|
2021-10-31T11:32:46.000Z
|
2021-10-31T11:32:46.000Z
|
from .canuvit import observe_VIS, observe_UV, observe
from ._canuvit_version import __version__
| 32
| 53
| 0.854167
| 13
| 96
| 5.692308
| 0.538462
| 0.297297
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104167
| 96
| 2
| 54
| 48
| 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 | 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
|
0c64b35f16a13c9207201f2e3ea10b2e23ba04b6
| 198
|
py
|
Python
|
finance/financeutil.py
|
codingwithchad/finance
|
4202692024ec0137670ff02a13b2f92f17da0cb2
|
[
"MIT"
] | null | null | null |
finance/financeutil.py
|
codingwithchad/finance
|
4202692024ec0137670ff02a13b2f92f17da0cb2
|
[
"MIT"
] | null | null | null |
finance/financeutil.py
|
codingwithchad/finance
|
4202692024ec0137670ff02a13b2f92f17da0cb2
|
[
"MIT"
] | null | null | null |
import re
def toFloat(amount):
if '(' in amount:
amount = amount.strip('()$')
return float(amount) * -1
else:
amount = amount.strip('$')
return float(amount)
| 22
| 36
| 0.540404
| 22
| 198
| 4.863636
| 0.545455
| 0.336449
| 0.317757
| 0.429907
| 0.635514
| 0.635514
| 0
| 0
| 0
| 0
| 0
| 0.007299
| 0.308081
| 198
| 8
| 37
| 24.75
| 0.773723
| 0
| 0
| 0
| 0
| 0
| 0.025253
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0.125
| 0
| 0.5
| 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
|
a74d571a905e6e494e789c67ff0a2b132b7c707c
| 70
|
py
|
Python
|
meituan/api/__init__.py
|
farseer810/openmeituan
|
307991ea64fee949917c261c06dee68187b14321
|
[
"MIT"
] | null | null | null |
meituan/api/__init__.py
|
farseer810/openmeituan
|
307991ea64fee949917c261c06dee68187b14321
|
[
"MIT"
] | null | null | null |
meituan/api/__init__.py
|
farseer810/openmeituan
|
307991ea64fee949917c261c06dee68187b14321
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from meituan.api.micro import MeituanMicroPay
| 23.333333
| 45
| 0.714286
| 9
| 70
| 5.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016393
| 0.128571
| 70
| 2
| 46
| 35
| 0.803279
| 0.3
| 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
|
a7505eacaa01312322dc65d07be2824c79ccf29c
| 141
|
py
|
Python
|
pub_site/src/pub_site/api/__init__.py
|
webee/pay
|
b48c6892686bf3f9014bb67ed119506e41050d45
|
[
"W3C"
] | 1
|
2019-10-14T11:51:49.000Z
|
2019-10-14T11:51:49.000Z
|
pub_site/src/pub_site/api/__init__.py
|
webee/pay
|
b48c6892686bf3f9014bb67ed119506e41050d45
|
[
"W3C"
] | null | null | null |
pub_site/src/pub_site/api/__init__.py
|
webee/pay
|
b48c6892686bf3f9014bb67ed119506e41050d45
|
[
"W3C"
] | null | null | null |
# -*- coding: utf-8 -*-
from flask import Blueprint
api_mod = Blueprint('api', __name__)
from . import views
from . import cheque, account
| 17.625
| 36
| 0.702128
| 19
| 141
| 4.947368
| 0.684211
| 0.255319
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008547
| 0.170213
| 141
| 7
| 37
| 20.142857
| 0.794872
| 0.148936
| 0
| 0
| 0
| 0
| 0.025424
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
a7ccf755ab86975553a2ea8993dc919235aa710c
| 36
|
py
|
Python
|
jupyterlabpymolpysnips/MolecularRepresentation/solventRadius.py
|
MooersLab/pymolpysnips
|
50a89c85adf8006d85c1d6cd3f8aad7e440a0b92
|
[
"MIT"
] | null | null | null |
jupyterlabpymolpysnips/MolecularRepresentation/solventRadius.py
|
MooersLab/pymolpysnips
|
50a89c85adf8006d85c1d6cd3f8aad7e440a0b92
|
[
"MIT"
] | null | null | null |
jupyterlabpymolpysnips/MolecularRepresentation/solventRadius.py
|
MooersLab/pymolpysnips
|
50a89c85adf8006d85c1d6cd3f8aad7e440a0b92
|
[
"MIT"
] | null | null | null |
cmd.do('set solvent_radius, 1.55;')
| 18
| 35
| 0.694444
| 7
| 36
| 3.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.083333
| 36
| 1
| 36
| 36
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0.694444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
38ec7a6afa2cc9ef1ef1a43849f55f486be9abb9
| 27
|
py
|
Python
|
gdcdatamodel/__init__.py
|
uc-cdis/gdcdatamodel
|
731c6fee160586dde4e5ff3bc76f131201c71543
|
[
"Apache-2.0"
] | 27
|
2016-06-24T20:32:44.000Z
|
2022-01-17T07:53:48.000Z
|
gdcdatamodel/__init__.py
|
NCI-GDC/gdcdatamodel
|
924fc8ab695b1cbb0131636ffcb6d3881db2e200
|
[
"Apache-2.0"
] | 63
|
2016-07-20T21:40:11.000Z
|
2021-08-12T18:39:21.000Z
|
gdcdatamodel/__init__.py
|
uc-cdis/gdcdatamodel
|
731c6fee160586dde4e5ff3bc76f131201c71543
|
[
"Apache-2.0"
] | 5
|
2016-10-20T20:00:09.000Z
|
2020-08-14T08:55:40.000Z
|
from gdcdatamodel import *
| 13.5
| 26
| 0.814815
| 3
| 27
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 27
| 1
| 27
| 27
| 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
|
ac11aee85d37a76ac849a4a1d3713cb6ab068203
| 74
|
py
|
Python
|
CodeWars/8 Kyu/Difference of Volumes of Cuboids.py
|
anubhab-code/Competitive-Programming
|
de28cb7d44044b9e7d8bdb475da61e37c018ac35
|
[
"MIT"
] | null | null | null |
CodeWars/8 Kyu/Difference of Volumes of Cuboids.py
|
anubhab-code/Competitive-Programming
|
de28cb7d44044b9e7d8bdb475da61e37c018ac35
|
[
"MIT"
] | null | null | null |
CodeWars/8 Kyu/Difference of Volumes of Cuboids.py
|
anubhab-code/Competitive-Programming
|
de28cb7d44044b9e7d8bdb475da61e37c018ac35
|
[
"MIT"
] | null | null | null |
def find_difference(a, b):
return abs((a[1]*a[2]*a[0])-b[1]*b[2]*b[0])
| 37
| 47
| 0.554054
| 19
| 74
| 2.105263
| 0.526316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.108108
| 74
| 2
| 47
| 37
| 0.515152
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ac293d09119264fa8ea62514289ce6ca148733f9
| 259
|
py
|
Python
|
3/3.4.4.3.py
|
cmp0xff/python_for_ss
|
4085c1c96bf9b65072ee257890097ba1e2be3653
|
[
"BSD-3-Clause"
] | null | null | null |
3/3.4.4.3.py
|
cmp0xff/python_for_ss
|
4085c1c96bf9b65072ee257890097ba1e2be3653
|
[
"BSD-3-Clause"
] | null | null | null |
3/3.4.4.3.py
|
cmp0xff/python_for_ss
|
4085c1c96bf9b65072ee257890097ba1e2be3653
|
[
"BSD-3-Clause"
] | null | null | null |
from string import ascii_lowercase
def main():
print ascii_lowercase
print zip(ascii_lowercase, range(1,27))
print dict(zip(ascii_lowercase, range(1,27)))
print sorted(dict(zip(ascii_lowercase, range(1,27))).items())
if __name__ == '__main__':
main()
| 21.583333
| 62
| 0.741313
| 39
| 259
| 4.589744
| 0.435897
| 0.391061
| 0.284916
| 0.368715
| 0.519553
| 0.519553
| 0.519553
| 0
| 0
| 0
| 0
| 0.039301
| 0.11583
| 259
| 11
| 63
| 23.545455
| 0.742358
| 0
| 0
| 0
| 0
| 0
| 0.030888
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.125
| null | null | 0.5
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
ac2e4e59acb3bf90b68dc451136cca7a45bcff72
| 277
|
py
|
Python
|
citekit/citation.py
|
hedythedev/citekit.py
|
7d0a7120e1a272af8c6cbbbbd721c3fa1299d927
|
[
"MIT"
] | 1
|
2020-08-19T08:53:40.000Z
|
2020-08-19T08:53:40.000Z
|
citekit/citation.py
|
hedythedev/citekit.py
|
7d0a7120e1a272af8c6cbbbbd721c3fa1299d927
|
[
"MIT"
] | null | null | null |
citekit/citation.py
|
hedythedev/citekit.py
|
7d0a7120e1a272af8c6cbbbbd721c3fa1299d927
|
[
"MIT"
] | null | null | null |
class Citation:
"""Basic citation class"""
def __init__(self, data: dict):
self.data = data
@property
def data_(self):
return self.data
def __str__(self):
return str(self.data)
def __repr(self):
return str(self.data)
| 17.3125
| 35
| 0.581227
| 34
| 277
| 4.411765
| 0.352941
| 0.266667
| 0.146667
| 0.226667
| 0.28
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.306859
| 277
| 15
| 36
| 18.466667
| 0.78125
| 0.072202
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0.3
| 0.8
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
ac8a3d4118eaf87b5a218d0aa0f56128bbc03dce
| 77
|
py
|
Python
|
projects/importing/__init__.py
|
tuomas777/kaavapino
|
ef2a6c70a29063fd22053598e3beba9f92c63295
|
[
"MIT"
] | null | null | null |
projects/importing/__init__.py
|
tuomas777/kaavapino
|
ef2a6c70a29063fd22053598e3beba9f92c63295
|
[
"MIT"
] | null | null | null |
projects/importing/__init__.py
|
tuomas777/kaavapino
|
ef2a6c70a29063fd22053598e3beba9f92c63295
|
[
"MIT"
] | 1
|
2017-12-20T12:54:30.000Z
|
2017-12-20T12:54:30.000Z
|
from .attribute import AttributeImporter, AttributeImporterException # noqa
| 38.5
| 76
| 0.857143
| 6
| 77
| 11
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103896
| 77
| 1
| 77
| 77
| 0.956522
| 0.051948
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
3bd13e3eb7a90e9d2bb85d12d660909c6d566798
| 214
|
py
|
Python
|
data_reports/utils.py
|
methods/phe-cv19-site
|
fd5f877b8a0725a9893fa3c24a54e9495e749744
|
[
"MIT"
] | 1
|
2020-09-21T16:35:16.000Z
|
2020-09-21T16:35:16.000Z
|
data_reports/utils.py
|
methods/phe-cv19-site
|
fd5f877b8a0725a9893fa3c24a54e9495e749744
|
[
"MIT"
] | 14
|
2020-03-25T10:29:26.000Z
|
2022-01-13T03:45:38.000Z
|
data_reports/utils.py
|
methods/phe-cv19-site
|
fd5f877b8a0725a9893fa3c24a54e9495e749744
|
[
"MIT"
] | null | null | null |
from data_reports.models import UsageReport
def create_daily_usage_report():
page_views_report_file = UsageReport.generate_report('page_views')
downloads_report_file = UsageReport.generate_report('downloads')
| 35.666667
| 68
| 0.845794
| 27
| 214
| 6.259259
| 0.592593
| 0.118343
| 0.177515
| 0.343195
| 0.414201
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.079439
| 214
| 5
| 69
| 42.8
| 0.857868
| 0
| 0
| 0
| 1
| 0
| 0.088785
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3beef30626fc36ef5f17ad9761a22806f03b9af7
| 14,970
|
py
|
Python
|
tests/e2e/test_provider_saml.py
|
BeryJu/passbook
|
350f0d836580f4411524614f361a76c4f27b8a2d
|
[
"MIT"
] | 15
|
2020-01-05T09:09:57.000Z
|
2020-11-28T05:27:39.000Z
|
tests/e2e/test_provider_saml.py
|
BeryJu/passbook
|
350f0d836580f4411524614f361a76c4f27b8a2d
|
[
"MIT"
] | 302
|
2020-01-21T08:03:59.000Z
|
2020-12-04T05:04:57.000Z
|
tests/e2e/test_provider_saml.py
|
BeryJu/passbook
|
350f0d836580f4411524614f361a76c4f27b8a2d
|
[
"MIT"
] | 3
|
2020-03-04T08:21:59.000Z
|
2020-08-01T20:37:18.000Z
|
"""test SAML Provider flow"""
from json import loads
from sys import platform
from time import sleep
from unittest.case import skipUnless
from docker import DockerClient, from_env
from docker.models.containers import Container
from docker.types import Healthcheck
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from authentik.core.models import Application
from authentik.core.tests.utils import create_test_cert
from authentik.flows.models import Flow
from authentik.policies.expression.models import ExpressionPolicy
from authentik.policies.models import PolicyBinding
from authentik.providers.saml.models import SAMLBindings, SAMLPropertyMapping, SAMLProvider
from authentik.sources.saml.processors.constants import SAML_BINDING_POST
from tests.e2e.utils import SeleniumTestCase, apply_migration, object_manager, retry
@skipUnless(platform.startswith("linux"), "requires local docker")
class TestProviderSAML(SeleniumTestCase):
"""test SAML Provider flow"""
container: Container
def setup_client(self, provider: SAMLProvider, force_post: bool = False) -> Container:
"""Setup client saml-sp container which we test SAML against"""
client: DockerClient = from_env()
metadata_url = (
self.url(
"authentik_api:samlprovider-metadata",
pk=provider.pk,
)
+ "?download"
)
if force_post:
metadata_url += f"&force_binding={SAML_BINDING_POST}"
container = client.containers.run(
image="ghcr.io/beryju/saml-test-sp:latest",
detach=True,
network_mode="host",
auto_remove=True,
healthcheck=Healthcheck(
test=["CMD", "wget", "--spider", "http://localhost:9009/health"],
interval=5 * 100 * 1000000,
start_period=1 * 100 * 1000000,
),
environment={
"SP_ENTITY_ID": provider.issuer,
"SP_SSO_BINDING": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
"SP_METADATA_URL": metadata_url,
},
)
while True:
container.reload()
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
if status == "healthy":
return container
self.logger.info("Container failed healthcheck")
sleep(1)
@retry()
@apply_migration("authentik_flows", "0008_default_flows")
@apply_migration("authentik_flows", "0011_flow_title")
@apply_migration("authentik_flows", "0010_provider_flows")
@apply_migration("authentik_crypto", "0002_create_self_signed_kp")
@object_manager
def test_sp_initiated_implicit(self):
"""test SAML Provider flow SP-initiated flow (implicit consent)"""
# Bootstrap all needed objects
authorization_flow = Flow.objects.get(
slug="default-provider-authorization-implicit-consent"
)
provider: SAMLProvider = SAMLProvider.objects.create(
name="saml-test",
acs_url="http://localhost:9009/saml/acs",
audience="authentik-e2e",
issuer="authentik-e2e",
sp_binding=SAMLBindings.POST,
authorization_flow=authorization_flow,
signing_kp=create_test_cert(),
)
provider.property_mappings.set(SAMLPropertyMapping.objects.all())
provider.save()
Application.objects.create(
name="SAML",
slug="authentik-saml",
provider=provider,
)
self.container = self.setup_client(provider)
self.driver.get("http://localhost:9009")
self.login()
self.wait_for_url("http://localhost:9009/")
body = loads(self.driver.find_element(By.CSS_SELECTOR, "pre").text)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"],
[self.user.name],
)
self.assertEqual(
body["attr"][
"http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"
],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/username"],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/uid"],
[str(self.user.pk)],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"],
[self.user.email],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"],
[self.user.email],
)
@retry()
@apply_migration("authentik_flows", "0008_default_flows")
@apply_migration("authentik_flows", "0011_flow_title")
@apply_migration("authentik_flows", "0010_provider_flows")
@apply_migration("authentik_crypto", "0002_create_self_signed_kp")
@object_manager
def test_sp_initiated_explicit(self):
"""test SAML Provider flow SP-initiated flow (explicit consent)"""
# Bootstrap all needed objects
authorization_flow = Flow.objects.get(
slug="default-provider-authorization-explicit-consent"
)
provider: SAMLProvider = SAMLProvider.objects.create(
name="saml-test",
acs_url="http://localhost:9009/saml/acs",
audience="authentik-e2e",
issuer="authentik-e2e",
sp_binding=SAMLBindings.POST,
authorization_flow=authorization_flow,
signing_kp=create_test_cert(),
)
provider.property_mappings.set(SAMLPropertyMapping.objects.all())
provider.save()
app = Application.objects.create(
name="SAML",
slug="authentik-saml",
provider=provider,
)
self.container = self.setup_client(provider)
self.driver.get("http://localhost:9009")
self.login()
self.wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "ak-flow-executor")))
flow_executor = self.get_shadow_root("ak-flow-executor")
consent_stage = self.get_shadow_root("ak-stage-consent", flow_executor)
self.assertIn(
app.name,
consent_stage.find_element(By.CSS_SELECTOR, "#header-text").text,
)
consent_stage.find_element(
By.CSS_SELECTOR,
("[type=submit]"),
).click()
self.wait_for_url("http://localhost:9009/")
body = loads(self.driver.find_element(By.CSS_SELECTOR, "pre").text)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"],
[self.user.name],
)
self.assertEqual(
body["attr"][
"http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"
],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/username"],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/uid"],
[str(self.user.pk)],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"],
[self.user.email],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"],
[self.user.email],
)
@retry()
@apply_migration("authentik_flows", "0008_default_flows")
@apply_migration("authentik_flows", "0011_flow_title")
@apply_migration("authentik_flows", "0010_provider_flows")
@apply_migration("authentik_crypto", "0002_create_self_signed_kp")
@object_manager
def test_sp_initiated_explicit_post(self):
"""test SAML Provider flow SP-initiated flow (explicit consent) (POST binding)"""
# Bootstrap all needed objects
authorization_flow = Flow.objects.get(
slug="default-provider-authorization-explicit-consent"
)
provider: SAMLProvider = SAMLProvider.objects.create(
name="saml-test",
acs_url="http://localhost:9009/saml/acs",
audience="authentik-e2e",
issuer="authentik-e2e",
sp_binding=SAMLBindings.POST,
authorization_flow=authorization_flow,
signing_kp=create_test_cert(),
)
provider.property_mappings.set(SAMLPropertyMapping.objects.all())
provider.save()
app = Application.objects.create(
name="SAML",
slug="authentik-saml",
provider=provider,
)
self.container = self.setup_client(provider, True)
self.driver.get("http://localhost:9009")
self.login()
self.wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "ak-flow-executor")))
flow_executor = self.get_shadow_root("ak-flow-executor")
consent_stage = self.get_shadow_root("ak-stage-consent", flow_executor)
self.assertIn(
app.name,
consent_stage.find_element(By.CSS_SELECTOR, "#header-text").text,
)
consent_stage.find_element(
By.CSS_SELECTOR,
("[type=submit]"),
).click()
self.wait_for_url("http://localhost:9009/")
body = loads(self.driver.find_element(By.CSS_SELECTOR, "pre").text)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"],
[self.user.name],
)
self.assertEqual(
body["attr"][
"http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"
],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/username"],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/uid"],
[str(self.user.pk)],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"],
[self.user.email],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"],
[self.user.email],
)
@retry()
@apply_migration("authentik_flows", "0008_default_flows")
@apply_migration("authentik_flows", "0011_flow_title")
@apply_migration("authentik_flows", "0010_provider_flows")
@apply_migration("authentik_crypto", "0002_create_self_signed_kp")
@object_manager
def test_idp_initiated_implicit(self):
"""test SAML Provider flow IdP-initiated flow (implicit consent)"""
# Bootstrap all needed objects
authorization_flow = Flow.objects.get(
slug="default-provider-authorization-implicit-consent"
)
provider: SAMLProvider = SAMLProvider.objects.create(
name="saml-test",
acs_url="http://localhost:9009/saml/acs",
audience="authentik-e2e",
issuer="authentik-e2e",
sp_binding=SAMLBindings.POST,
authorization_flow=authorization_flow,
signing_kp=create_test_cert(),
)
provider.property_mappings.set(SAMLPropertyMapping.objects.all())
provider.save()
Application.objects.create(
name="SAML",
slug="authentik-saml",
provider=provider,
)
self.container = self.setup_client(provider)
self.driver.get(
self.url(
"authentik_providers_saml:sso-init",
application_slug=provider.application.slug,
)
)
self.login()
sleep(1)
self.wait_for_url("http://localhost:9009/")
body = loads(self.driver.find_element(By.CSS_SELECTOR, "pre").text)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"],
[self.user.name],
)
self.assertEqual(
body["attr"][
"http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"
],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/username"],
[self.user.username],
)
self.assertEqual(
body["attr"]["http://schemas.goauthentik.io/2021/02/saml/uid"],
[str(self.user.pk)],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"],
[self.user.email],
)
self.assertEqual(
body["attr"]["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"],
[self.user.email],
)
@retry()
@apply_migration("authentik_flows", "0008_default_flows")
@apply_migration("authentik_flows", "0011_flow_title")
@apply_migration("authentik_flows", "0010_provider_flows")
@apply_migration("authentik_crypto", "0002_create_self_signed_kp")
@object_manager
def test_sp_initiated_denied(self):
"""test SAML Provider flow SP-initiated flow (Policy denies access)"""
# Bootstrap all needed objects
authorization_flow = Flow.objects.get(
slug="default-provider-authorization-implicit-consent"
)
negative_policy = ExpressionPolicy.objects.create(
name="negative-static", expression="return False"
)
provider: SAMLProvider = SAMLProvider.objects.create(
name="saml-test",
acs_url="http://localhost:9009/saml/acs",
audience="authentik-e2e",
issuer="authentik-e2e",
sp_binding=SAMLBindings.POST,
authorization_flow=authorization_flow,
signing_kp=create_test_cert(),
)
provider.property_mappings.set(SAMLPropertyMapping.objects.all())
provider.save()
app = Application.objects.create(
name="SAML",
slug="authentik-saml",
provider=provider,
)
PolicyBinding.objects.create(target=app, policy=negative_policy, order=0)
self.container = self.setup_client(provider)
self.driver.get("http://localhost:9009/")
self.login()
self.wait.until(ec.presence_of_element_located((By.CSS_SELECTOR, "header > h1")))
self.assertEqual(
self.driver.find_element(By.CSS_SELECTOR, "header > h1").text,
"Permission denied",
)
| 38.384615
| 95
| 0.610621
| 1,572
| 14,970
| 5.655852
| 0.142494
| 0.042177
| 0.051288
| 0.062085
| 0.784951
| 0.783826
| 0.783152
| 0.773816
| 0.766505
| 0.766505
| 0
| 0.028959
| 0.261857
| 14,970
| 389
| 96
| 38.48329
| 0.775656
| 0.038477
| 0
| 0.675287
| 0
| 0
| 0.251098
| 0.038121
| 0
| 0
| 0
| 0
| 0.077586
| 1
| 0.017241
| false
| 0
| 0.048851
| 0
| 0.074713
| 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
|
ce05d9b027d5c2254b9507fc74bbf23fb5cdca48
| 53
|
py
|
Python
|
reader/__init__.py
|
climberwb/bert-pli
|
0e6eda7a23b7502c86eab4c0d889fad1bbb57155
|
[
"MIT"
] | 5
|
2020-12-24T01:46:40.000Z
|
2022-03-18T19:15:10.000Z
|
reader/__init__.py
|
climberwb/bert-pli
|
0e6eda7a23b7502c86eab4c0d889fad1bbb57155
|
[
"MIT"
] | 1
|
2021-04-05T14:27:24.000Z
|
2021-04-05T14:27:24.000Z
|
reader/__init__.py
|
climberwb/bert-pli
|
0e6eda7a23b7502c86eab4c0d889fad1bbb57155
|
[
"MIT"
] | 4
|
2020-12-28T09:20:13.000Z
|
2021-12-10T13:33:21.000Z
|
from .reader import init_dataset, init_test_dataset
| 26.5
| 52
| 0.849057
| 8
| 53
| 5.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113208
| 53
| 1
| 53
| 53
| 0.893617
| 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
|
ce211f8e0952d9dccff9f1862a243f8adcfb962f
| 10,109
|
py
|
Python
|
keops_utils.py
|
plantonsanti/PartialMatchingVarifolds
|
032486e146262f6a2d08ec27215cc817eddb2928
|
[
"MIT"
] | 2
|
2021-07-01T03:30:07.000Z
|
2021-12-17T10:04:39.000Z
|
keops_utils.py
|
plantonsanti/PartialMatchingVarifolds
|
032486e146262f6a2d08ec27215cc817eddb2928
|
[
"MIT"
] | null | null | null |
keops_utils.py
|
plantonsanti/PartialMatchingVarifolds
|
032486e146262f6a2d08ec27215cc817eddb2928
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 19 11:30:25 2019
@author: pantonsanti
"""
import torch
from pykeops.torch import kernel_product, LazyTensor, Genred, Vi, Vj
from pykeops.torch.kernel_product.formula import *
################### GPU management #########################"
# torch type and device
def TestCuda(verbose = True):
use_cuda = torch.cuda.is_available()
if(verbose):
print("Use cuda : ",use_cuda)
torchdeviceId = torch.device('cuda:0') if use_cuda else 'cpu'
torchdtype = torch.float32
KernelMethod = 'CPU'
if(use_cuda):
torch.cuda.set_device(torchdeviceId)
KernelMethod = 'auto'
# PyKeOps counterpart
KeOpsdeviceId = torchdeviceId.index # id of Gpu device (in case Gpu is used)
KeOpsdtype = torchdtype.__str__().split('.')[1] # 'float32'
#print(KeOpsdtype)
return use_cuda,torchdeviceId,torchdtype,KeOpsdeviceId,KeOpsdtype,KernelMethod
use_cuda,torchdeviceId,torchdtype,KeOpsdeviceId,KeOpsdtype,KernelMethod = TestCuda(verbose=False)
############################################################
# function to transfer data on Gpu only if we use the Gpu
def CpuOrGpu(x):
if use_cuda:
if type(x)==tuple:
x = tuple(map(lambda x:x.cuda(device=torchdeviceId),x))
else:
x = x.cuda(device=torchdeviceId)
return x
###################################################################
# Define "Gaussian-CauchyBinet" kernel :math:`(K(x,y,u,v)b)_i = \sum_j \exp(-\|x_i-y_j\|^2) \langle u_i,v_j\rangle^2 b_j`
def GaussLinKernel(sigma):
x, y, u, v, b = Vi(0,3), Vj(1,3), Vi(2,3), Vj(3,3), Vj(4,1)
gamma = 1 / (sigma * sigma)
D2 = x.sqdist(y)
K = (-D2*gamma).exp() * (u*v).sum()**2
return (K*b).sum_reduction(axis=1)
def OrientedGaussLinKernel(sigma):
x, y, u, v, b = Vi(0,3), Vj(1,3), Vi(2,3), Vj(3,3), Vj(4,1)
gamma = 1 / (sigma * sigma)
D2 = x.sqdist(y)
K = (-D2*gamma).exp() * ((u*v).sum()).exp()
return (K*b).sum_reduction(axis=1)
def SobolevKernel():
D2 = x.sqdist(y)
K = D2.pow(3/2)
return (K).sum_reduction(axis=1)
def GenericGaussKernel(ref_scale,list_coefs = [1]):
"""
Given a deformation scale for the kernels, generates the sum of the kernels at the scale divided by the coeff.
Parameters
----------
ref_scale : torch tensor
The scale of the deformations kernels (that is to be divided by the coefficients of list_coefs)
list_coefs : list of floats
The coefficients that will divide the deformations scale and ponder the kernels.
Returns
-------
K : kernel -or sum of kernels- funtion.
"""
def K(x,y,b = None):
"""
The kernel function.
Parameters
----------
x,y : torch tensor
The points x.shape = (n_pts_x, dim) y.shape = (n_pts_y, dim)
b (Optional) : torch tensor
Optional momenta or weights. Default: None
Returns
-------
a_i : LazyTensor
If b is None, a_i = sum_j exp(-|x_i-y_j|^2)
else, a_i = sum_j exp(-|x_i-y_j|^2).b_i
"""
x_i = LazyTensor( x[:,None,:] ) # x_i.shape = (n_pts_x, 1, dim)
y_j = LazyTensor( y[None,:,:] ) # y_j.shape = ( 1, n_pts_y,dim)
D_ij = ((x_i - y_j)**2).sum(dim=2) # Symbolic (n_pts_x,n_pts_y,1) matrix of squared distances
ref_scale2 = 1/(ref_scale**2)
weighting = 1/len(list_coefs)
for i,coef in enumerate(list_coefs):
c2 = coef**2*ref_scale2
if i==0:
K_ij = weighting*(- D_ij*c2).exp() # # Symbolic (n_pts_x,n_pts_y,1) matrix
else:
K_ij += weighting*(- D_ij*c2).exp() # # Symbolic (n_pts_x,n_pts_y,1) matrix
if b is None:
a_i = K_ij.sum(axis=1)
else:
b = LazyTensor( b[None,:,:] )
a_i = (K_ij*b).sum(axis=1)
return a_i
return K
def PartialWeightedGaussLinKernel(sigma, epsilon = 0.0001):
"""
Given a deformation scale for the kernels, generates the sum of the kernels at the scale divided by the coeff.
Parameters
----------
ref_scale : torch tensor
The scale of the deformations kernels (that is to be divided by the coefficients of list_coefs)
list_coefs : list of floats
The coefficients that will divide the deformations scale and ponder the kernels.
Returns
-------
K : kernel -or sum of kernels- funtion.
"""
gamma = 1/sigma**2
def min_x1(x):
return .5*(x+1-(epsilon+(x-1)**2).sqrt())
def K(x, y, u, v, omega_x, omega_y, by):
"""
The kernel function.
Parameters
----------
x,y : torch tensor
The points x.shape = (n_pts_x, dim) y.shape = (n_pts_y, dim)
b (Optional) : list of integers
Optional momenta. Default: None
Returns
-------
a_i : LazyTensor
If b is None, a_i = sum_j exp(-|x_i-y_j|^2)
else, a_i = sum_j exp(-|x_i-y_j|^2).b_i
"""
x_i = LazyTensor( x[:,None,:] ) # x_i.shape = (n_pts_x, 1, dim)
y_j = LazyTensor( y[None,:,:] ) # y_j.shape = ( 1, n_pts_y,dim)
b_j = LazyTensor( by[None,:] )
u_i = LazyTensor( u[:,None,:] )
v_j = LazyTensor( v[None,:,:] )
D_ij = ((x_i - y_j)**2).sum(dim=2) # Symbolic (n_pts_x,n_pts_y,1) matrix of squared distances
omega_ij = (- D_ij*gamma).exp() * (u_i*v_j).sum()**2
M_compare = LazyTensor(omega_x[:,None,:])*LazyTensor((1/omega_y)[None,:,:])
matrix_weights = min_x1(M_compare)
omega_weighted_ij = (matrix_weights*omega_ij*b_j).sum(dim=1) #(n_pts_y,n_pts_y) LAZZY TENSOR
return omega_weighted_ij
return K
def PartialWeightedGaussKernel(sigma, epsilon = 0.0001):
"""
Given a deformation scale for the kernels, generates the sum of the kernels at the scale divided by the coeff.
Parameters
----------
ref_scale : torch tensor
The scale of the deformations kernels (that is to be divided by the coefficients of list_coefs)
list_coefs : list of floats
The coefficients that will divide the deformations scale and ponder the kernels.
Returns
-------
K : kernel -or sum of kernels- funtion.
"""
gamma = 1/sigma**2
def min_x1(x):
return .5*(x+1-(epsilon+(x-1)**2).sqrt())
def K(x, y, omega_x, omega_y, by):
"""
The kernel function.
Parameters
----------
x,y : torch tensor
The points x.shape = (n_pts_x, dim) y.shape = (n_pts_y, dim)
b (Optional) : list of integers
Optional momenta. Default: None
Returns
-------
a_i : LazyTensor
If b is None, a_i = sum_j exp(-|x_i-y_j|^2)
else, a_i = sum_j exp(-|x_i-y_j|^2).b_i
"""
x_i = LazyTensor( x[:,None,:] ) # x_i.shape = (n_pts_x, 1, dim)
y_j = LazyTensor( y[None,:,:] ) # y_j.shape = ( 1, n_pts_y,dim)
b_j = LazyTensor( by[None,:] )
D_ij = ((x_i - y_j)**2).sum(dim=2) # Symbolic (n_pts_x,n_pts_y,1) matrix of squared distances
omega_ij = (- D_ij*gamma).exp()
M_compare = LazyTensor(omega_x[:,None,:])*LazyTensor((1/omega_y)[None,:,:])
matrix_weights = min_x1(M_compare)
omega_weighted_ij = (matrix_weights*omega_ij*b_j).sum(dim=1) #(n_pts_y,n_pts_y) LAZZY TENSOR
return omega_weighted_ij
return K
def PartialWeightedGaussLinKernelOriented(sigma, epsilon = 0.0001):
"""
Given a deformation scale for the kernels, generates the sum of the kernels at the scale divided by the coeff.
Parameters
----------
ref_scale : torch tensor
The scale of the deformations kernels (that is to be divided by the coefficients of list_coefs)
list_coefs : list of floats
The coefficients that will divide the deformations scale and ponder the kernels.
Returns
-------
K : kernel -or sum of kernels- funtion.
"""
gamma = 1/sigma**2
def min_x1(x):
return .5*(x+1-(epsilon+(x-1)**2).sqrt())
def K(x, y, u, v, omega_x, omega_y, by):
"""
The kernel function.
Parameters
----------
x,y : torch tensor
The points x.shape = (n_pts_x, dim) y.shape = (n_pts_y, dim)
b (Optional) : list of integers
Optional momenta. Default: None
Returns
-------
a_i : LazyTensor
If b is None, a_i = sum_j exp(-|x_i-y_j|^2)
else, a_i = sum_j exp(-|x_i-y_j|^2).b_i
"""
x_i = LazyTensor( x[:,None,:] ) # x_i.shape = (n_pts_x, 1, dim)
y_j = LazyTensor( y[None,:,:] ) # y_j.shape = ( 1, n_pts_y,dim)
b_j = LazyTensor( by[None,:] )
u_i = LazyTensor( u[:,None,:] )
v_j = LazyTensor( v[None,:,:] )
D_ij = ((x_i - y_j)**2).sum(dim=2) # Symbolic (n_pts_x,n_pts_y,1) matrix of squared distances
omega_ij = (- D_ij*gamma).exp() * ((u_i*v_j).sum()).exp()
M_compare = LazyTensor(omega_x[:,None,:])*LazyTensor((1/omega_y)[None,:,:])
matrix_weights = min_x1(M_compare)
omega_weighted_ij = (matrix_weights*omega_ij*b_j).sum(dim=1) #(n_pts_y,n_pts_y) LAZZY TENSOR
return omega_weighted_ij
return K
###############################################################
################# SOME WRAPPING FUNCTIONS #####################
###############################################################
def Sum3GaussKernel(sigma = 100):
list_coefs = [1., 2., 4.]
K = GenericGaussKernel(sigma,list_coefs)
return K
def Sum4GaussKernel(sigma = 100):
list_coefs = [1., 4., 8., 16.]
K = GenericGaussKernel(sigma,list_coefs)
return K
def Sum4GaussKernel_bis(sigma = 100):
list_coefs = [1., 2., 4., 8.]
K = GenericGaussKernel(sigma,list_coefs)
return K
| 27.470109
| 121
| 0.557424
| 1,461
| 10,109
| 3.678303
| 0.123203
| 0.025307
| 0.018608
| 0.009676
| 0.782285
| 0.76256
| 0.758095
| 0.719017
| 0.708597
| 0.684592
| 0
| 0.023056
| 0.274904
| 10,109
| 367
| 122
| 27.544959
| 0.710096
| 0.405184
| 0
| 0.528926
| 0
| 0
| 0.005644
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.157025
| false
| 0
| 0.024793
| 0.024793
| 0.338843
| 0.008264
| 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
|
ce2b2dec6239a96e5c90d1b1662991dde06f6433
| 472
|
py
|
Python
|
server.py
|
Shamanskiy/portphotolio
|
8f5db0a6a2fa0eb6ed642947845c91fb0b70b4ea
|
[
"MIT"
] | null | null | null |
server.py
|
Shamanskiy/portphotolio
|
8f5db0a6a2fa0eb6ed642947845c91fb0b70b4ea
|
[
"MIT"
] | 1
|
2020-08-11T19:00:48.000Z
|
2020-08-11T19:00:48.000Z
|
server.py
|
Shamanskiy/portphotolio
|
8f5db0a6a2fa0eb6ed642947845c91fb0b70b4ea
|
[
"MIT"
] | null | null | null |
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template("home.html")
@app.route('/white_sea')
def white_sea():
return render_template("white_sea.html")
@app.route('/crimea')
def crimea():
return render_template("crimea.html")
@app.route('/test')
def test():
return render_template("test.html")
if __name__ == "__main__":
app.run(debug=True)
#app.run(host='192.168.0.4',port = "5010")
| 19.666667
| 46
| 0.675847
| 67
| 472
| 4.462687
| 0.41791
| 0.234114
| 0.267559
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029557
| 0.139831
| 472
| 23
| 47
| 20.521739
| 0.706897
| 0.086864
| 0
| 0
| 0
| 0
| 0.172093
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.0625
| 0.25
| 0.5625
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
cbec4d9e2db4c5d7b23fa5bafaf5807f6658a7b8
| 6,485
|
py
|
Python
|
tests/integration/views/surveys/test_upload_survey.py
|
uk-gov-mirror/ONSdigital.ras-frontstage
|
4bf0f779f37d2a9ce7efe9f11c9b55a7a398faae
|
[
"MIT"
] | null | null | null |
tests/integration/views/surveys/test_upload_survey.py
|
uk-gov-mirror/ONSdigital.ras-frontstage
|
4bf0f779f37d2a9ce7efe9f11c9b55a7a398faae
|
[
"MIT"
] | null | null | null |
tests/integration/views/surveys/test_upload_survey.py
|
uk-gov-mirror/ONSdigital.ras-frontstage
|
4bf0f779f37d2a9ce7efe9f11c9b55a7a398faae
|
[
"MIT"
] | null | null | null |
import io
import logging
import unittest
import requests_mock
from unittest.mock import patch
from requests.models import Response
from structlog import wrap_logger
from frontstage import app
from frontstage.exceptions.exceptions import CiUploadError
from tests.integration.mocked_services import business_party, case, encoded_jwt_token, survey, url_upload_ci, url_banner_api
logger = wrap_logger(logging.getLogger(__name__))
@requests_mock.mock()
class TestUploadSurvey(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.app.set_cookie('localhost', 'authorization', 'session_key')
self.headers = {
"Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoicmluZ3JhbUBub3d3aGVyZS5jb20iLCJ1c2VyX3Njb3BlcyI6WyJjaS5yZWFkIiwiY2kud3JpdGUiXX0.se0BJtNksVtk14aqjp7SvnXzRbEKoqXb8Q5U9VVdy54" # NOQA
}
self.survey_file = dict(file=(io.BytesIO(b'my file contents'), "testfile.xlsx"))
self.patcher = patch('redis.StrictRedis.get', return_value=encoded_jwt_token)
self.patcher.start()
def tearDown(self):
self.patcher.stop()
@patch('frontstage.controllers.collection_instrument_controller.upload_collection_instrument')
@patch('frontstage.controllers.party_controller.is_respondent_enrolled')
def test_upload_survey_success(self, mock_request, *_):
mock_request.get(url_banner_api, status_code=404)
self.survey_file = dict(file=(io.BytesIO(b'my file contents'), "testfile.xlsx"))
response = self.app.post(f'/surveys/upload-survey?case_id={case["id"]}&business_party_id={business_party["id"]}'
f'&survey_short_name={survey["shortName"]}', data=self.survey_file)
self.assertEqual(response.status_code, 200)
@patch('frontstage.controllers.collection_instrument_controller.upload_collection_instrument')
@patch('frontstage.controllers.party_controller.is_respondent_enrolled')
def test_upload_survey_fail_unexpected_error(self, mock_request, _, upload_ci):
mock_request.get(url_banner_api, status_code=404)
error_response = Response()
error_response.status_code = 500
error_response.url = url_upload_ci
error_message = "fail"
error = CiUploadError(logger, error_response, error_message)
upload_ci.side_effect = error
self.survey_file = dict(file=(io.BytesIO(b'my file contents'), "testfile.xlsx"))
response = self.app.post(f'/surveys/upload-survey?case_id={case["id"]}&business_party_id={business_party["id"]}'
f'&survey_short_name={survey["shortName"]}', data=self.survey_file)
self.assertEqual(response.status_code, 302)
self.assertTrue('/surveys/upload-failed'.encode() in response.data)
@patch('frontstage.controllers.collection_instrument_controller.upload_collection_instrument')
@patch('frontstage.controllers.party_controller.is_respondent_enrolled')
def test_upload_survey_fail_type_error(self, mock_request, _, upload_ci):
mock_request.get(url_banner_api, status_code=404)
error_response = Response()
error_response.status_code = 500
error_response.url = url_upload_ci
error_message = ".xlsx format"
error = CiUploadError(logger, error_response, error_message)
upload_ci.side_effect = error
self.survey_file = dict(file=(io.BytesIO(b'my file contents'), "testfile.xlsx"))
response = self.app.post(f'/surveys/upload-survey?case_id={case["id"]}&business_party_id={business_party["id"]}'
f'&survey_short_name={survey["shortName"]}', data=self.survey_file)
self.assertEqual(response.status_code, 302)
self.assertTrue('/surveys/upload-failed'.encode() in response.data)
@patch('frontstage.controllers.collection_instrument_controller.upload_collection_instrument')
@patch('frontstage.controllers.party_controller.is_respondent_enrolled')
def test_upload_survey_fail_char_limit_error(self, mock_request, _, upload_ci):
mock_request.get(url_banner_api, status_code=404)
error_response = Response()
error_response.status_code = 500
error_response.url = url_upload_ci
error_message = "50 characters"
error = CiUploadError(logger, error_response, error_message)
upload_ci.side_effect = error
self.survey_file = dict(file=(io.BytesIO(b'my file contents'), "testfile.xlsx"))
response = self.app.post(f'/surveys/upload-survey?case_id={case["id"]}&business_party_id={business_party["id"]}'
f'&survey_short_name={survey["shortName"]}', data=self.survey_file)
self.assertEqual(response.status_code, 302)
self.assertTrue('/surveys/upload-failed'.encode() in response.data)
@patch('frontstage.controllers.collection_instrument_controller.upload_collection_instrument')
@patch('frontstage.controllers.party_controller.is_respondent_enrolled')
def test_upload_survey_fail_size_error(self, mock_request, _, upload_ci):
mock_request.get(url_banner_api, status_code=404)
error_response = Response()
error_response.status_code = 500
error_response.url = url_upload_ci
error_message = "File too large"
error = CiUploadError(logger, error_response, error_message)
upload_ci.side_effect = error
self.survey_file = dict(file=(io.BytesIO(b'my file contents'), "testfile.xlsx"))
response = self.app.post(f'/surveys/upload-survey?case_id={case["id"]}&business_party_id={business_party["id"]}'
f'&survey_short_name={survey["shortName"]}', data=self.survey_file)
self.assertEqual(response.status_code, 302)
self.assertTrue('/surveys/upload-failed'.encode() in response.data)
def test_upload_survey_content_too_long(self, mock_request):
mock_request.get(url_banner_api, status_code=404)
file_data = 'a' * 21 * 1024 * 1024
over_size_file = dict(file=(io.BytesIO(file_data.encode()), "testfile.xlsx"))
response = self.app.post(f'/surveys/upload-survey?case_id={case["id"]}&business_party_id={business_party["id"]}'
f'&survey_short_name={survey["shortName"]}', data=over_size_file)
self.assertEqual(response.status_code, 302)
self.assertTrue('/surveys/upload-failed'.encode() in response.data)
| 53.595041
| 215
| 0.716114
| 780
| 6,485
| 5.661538
| 0.152564
| 0.036232
| 0.040761
| 0.046196
| 0.784194
| 0.779438
| 0.779438
| 0.779438
| 0.779438
| 0.779438
| 0
| 0.016927
| 0.17101
| 6,485
| 120
| 216
| 54.041667
| 0.804501
| 0.000617
| 0
| 0.63
| 0
| 0
| 0.317642
| 0.274888
| 0
| 0
| 0
| 0
| 0.11
| 1
| 0.08
| false
| 0
| 0.1
| 0
| 0.19
| 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
|
cbf0399b4f484a831ba30853d17c2a1afe39558d
| 102
|
py
|
Python
|
taxon-sets/all/nexusTofasta.py
|
lzlniu/GAGA_project
|
5ba6a2bb5dfa406c9b5d742d0a0d896cdd30be1f
|
[
"Apache-2.0"
] | null | null | null |
taxon-sets/all/nexusTofasta.py
|
lzlniu/GAGA_project
|
5ba6a2bb5dfa406c9b5d742d0a0d896cdd30be1f
|
[
"Apache-2.0"
] | null | null | null |
taxon-sets/all/nexusTofasta.py
|
lzlniu/GAGA_project
|
5ba6a2bb5dfa406c9b5d742d0a0d896cdd30be1f
|
[
"Apache-2.0"
] | null | null | null |
import sys
from Bio import SeqIO
SeqIO.write(SeqIO.parse(sys.argv[1], "nexus"), sys.argv[2], "fasta")
| 25.5
| 68
| 0.715686
| 18
| 102
| 4.055556
| 0.666667
| 0.191781
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021739
| 0.098039
| 102
| 3
| 69
| 34
| 0.771739
| 0
| 0
| 0
| 0
| 0
| 0.098039
| 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
|
023437f3bc64e08b1c0753c4a09d2014e7ae4c4d
| 67
|
py
|
Python
|
MNIST/test.py
|
guessable/machineLearning
|
69be1f53918c29d27c1a8707ea92ce71c0cc1bfb
|
[
"MIT"
] | 5
|
2020-09-13T09:41:49.000Z
|
2022-03-27T01:22:23.000Z
|
MNIST/test.py
|
guessable/machineLearning
|
69be1f53918c29d27c1a8707ea92ce71c0cc1bfb
|
[
"MIT"
] | null | null | null |
MNIST/test.py
|
guessable/machineLearning
|
69be1f53918c29d27c1a8707ea92ce71c0cc1bfb
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
# author:CT
# TODO
| 9.571429
| 22
| 0.626866
| 10
| 67
| 3.8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036364
| 0.179104
| 67
| 6
| 23
| 11.166667
| 0.654545
| 0.850746
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0.166667
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
023680f93927aeb6b1fcd95e7478caf9d0b1bb0b
| 280
|
py
|
Python
|
src/yellowdog_client/model/exceptions/session_close_exception.py
|
yellowdog/yellowdog-sdk-python-public
|
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
|
[
"Apache-2.0"
] | null | null | null |
src/yellowdog_client/model/exceptions/session_close_exception.py
|
yellowdog/yellowdog-sdk-python-public
|
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
|
[
"Apache-2.0"
] | null | null | null |
src/yellowdog_client/model/exceptions/session_close_exception.py
|
yellowdog/yellowdog-sdk-python-public
|
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
|
[
"Apache-2.0"
] | null | null | null |
from dataclasses import dataclass, field
from .base_custom_exception import BaseCustomException
from .error_type import ErrorType
@dataclass
class SessionCloseException(BaseCustomException):
errorType: ErrorType = field(default=ErrorType.SessionCloseException, init=False)
| 28
| 85
| 0.846429
| 28
| 280
| 8.357143
| 0.607143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 280
| 9
| 86
| 31.111111
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
| 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
|
0278894670a342d9e91455cfd659a7984393ff19
| 587
|
py
|
Python
|
atividade009.py
|
henrikysena/Atividades_CursosEmVideo_Python
|
2890c67ea4be2cde6f42c2489d4c96b47d7b597e
|
[
"MIT"
] | null | null | null |
atividade009.py
|
henrikysena/Atividades_CursosEmVideo_Python
|
2890c67ea4be2cde6f42c2489d4c96b47d7b597e
|
[
"MIT"
] | null | null | null |
atividade009.py
|
henrikysena/Atividades_CursosEmVideo_Python
|
2890c67ea4be2cde6f42c2489d4c96b47d7b597e
|
[
"MIT"
] | null | null | null |
t = int(input('Digite um número para ver sua tabudada: '))
print('-='*6)
# o {:2} é pra deixar alinhadinho unidade com unidade e dezena com dezena
print('{} * {:2} = {}'.format(t, 1, t*1))
print('{} * {:2} = {}'.format(t, 2, t*2))
print('{} * {:2} = {}'.format(t, 3, t*3))
print('{} * {:2} = {}'.format(t, 4, t*4))
print('{} * {:2} = {}'.format(t, 5, t*5))
print('{} * {:2} = {}'.format(t, 6, t*6))
print('{} * {:2} = {}'.format(t, 7, t*7))
print('{} * {:2} = {}'.format(t, 8, t*8))
print('{} * {:2} = {}'.format(t, 9, t*9))
print('{} * {:2} = {}'.format(t, 10, t*10))
print('-='*6)
| 30.894737
| 73
| 0.46167
| 97
| 587
| 2.793814
| 0.319588
| 0.221402
| 0.442804
| 0.479705
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071869
| 0.170358
| 587
| 18
| 74
| 32.611111
| 0.4846
| 0.120954
| 0
| 0.153846
| 0
| 0
| 0.357977
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.923077
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
5a0e8f9773e3a0e473b3d0d8379f1a829f9f7a00
| 27
|
py
|
Python
|
Sentip/__init__.py
|
hhej/Sentip
|
bc25ae4b8b248b86362f3fc29394235763a04981
|
[
"MIT"
] | 1
|
2021-05-28T08:01:00.000Z
|
2021-05-28T08:01:00.000Z
|
Sentip/__init__.py
|
hhej/Sentip
|
bc25ae4b8b248b86362f3fc29394235763a04981
|
[
"MIT"
] | null | null | null |
Sentip/__init__.py
|
hhej/Sentip
|
bc25ae4b8b248b86362f3fc29394235763a04981
|
[
"MIT"
] | null | null | null |
from Sentip.Sentip import *
| 27
| 27
| 0.814815
| 4
| 27
| 5.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 27
| 1
| 27
| 27
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
5a3e521b841f100f6baec3959d4c686465e9bb18
| 37
|
py
|
Python
|
tests/__init__.py
|
gecBurton/csv-json
|
27cdf1cddcd6afa9c0d13baacdef13d89a002122
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
gecBurton/csv-json
|
27cdf1cddcd6afa9c0d13baacdef13d89a002122
|
[
"MIT"
] | 4
|
2021-01-31T11:15:12.000Z
|
2021-01-31T11:19:56.000Z
|
tests/__init__.py
|
gecBurton/csvjson
|
27cdf1cddcd6afa9c0d13baacdef13d89a002122
|
[
"MIT"
] | null | null | null |
"""Unit test package for csvjson."""
| 18.5
| 36
| 0.675676
| 5
| 37
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135135
| 37
| 1
| 37
| 37
| 0.78125
| 0.810811
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5a55e4c19eec5cd071f5749a5c8a69cc8eb37a46
| 22
|
py
|
Python
|
samflow/__init__.py
|
samesense/chilin
|
d61893d58dc7ff98293ae9d3d11a03a247040404
|
[
"BSD-3-Clause"
] | 29
|
2016-09-27T15:33:27.000Z
|
2021-07-14T03:26:53.000Z
|
samflow/__init__.py
|
samesense/chilin
|
d61893d58dc7ff98293ae9d3d11a03a247040404
|
[
"BSD-3-Clause"
] | 15
|
2015-11-22T13:12:03.000Z
|
2022-01-19T02:18:25.000Z
|
samflow/__init__.py
|
samesense/chilin
|
d61893d58dc7ff98293ae9d3d11a03a247040404
|
[
"BSD-3-Clause"
] | 9
|
2015-03-30T14:37:26.000Z
|
2019-06-20T19:06:07.000Z
|
__author__ = 'ad9075'
| 11
| 21
| 0.727273
| 2
| 22
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210526
| 0.136364
| 22
| 1
| 22
| 22
| 0.421053
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 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
|
5a601f112604eeffb3eb5ed71dd75b488660948c
| 45
|
py
|
Python
|
src/__init__.py
|
CGUSTM/fwu_gen_metadata
|
cf9a20aca775e874823f39a4f38ad748a2e2197d
|
[
"BSD-2-Clause"
] | null | null | null |
src/__init__.py
|
CGUSTM/fwu_gen_metadata
|
cf9a20aca775e874823f39a4f38ad748a2e2197d
|
[
"BSD-2-Clause"
] | 1
|
2021-12-17T17:29:30.000Z
|
2021-12-17T17:29:30.000Z
|
src/__init__.py
|
CGUSTM/fwu_gen_metadata
|
cf9a20aca775e874823f39a4f38ad748a2e2197d
|
[
"BSD-2-Clause"
] | 1
|
2021-10-04T07:52:35.000Z
|
2021-10-04T07:52:35.000Z
|
#!/usr/bin/env python3
#-*-encoding:utf-8*-
| 11.25
| 22
| 0.622222
| 7
| 45
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04878
| 0.088889
| 45
| 3
| 23
| 15
| 0.634146
| 0.888889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
ce7ba0b7f376b99d837267d4dd31daf95d97b759
| 43
|
py
|
Python
|
WalletException.py
|
3crabs/wallet
|
dbabf9c830420ba883b753d1e9a12ff7074bd4fa
|
[
"WTFPL"
] | 1
|
2020-04-10T12:20:16.000Z
|
2020-04-10T12:20:16.000Z
|
WalletException.py
|
3crabs/wallet
|
dbabf9c830420ba883b753d1e9a12ff7074bd4fa
|
[
"WTFPL"
] | 3
|
2020-04-15T16:27:32.000Z
|
2020-05-07T17:16:50.000Z
|
WalletException.py
|
3crabs/wallet
|
dbabf9c830420ba883b753d1e9a12ff7074bd4fa
|
[
"WTFPL"
] | null | null | null |
class WalletException(Exception):
pass
| 14.333333
| 33
| 0.767442
| 4
| 43
| 8.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162791
| 43
| 2
| 34
| 21.5
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 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
|
ce9d32719f9a8a7bd15a44d7fdf7778cbb2a418e
| 86
|
py
|
Python
|
vendas/admin.py
|
G3Amis/CRM-Vendas
|
03c20ab7d5300014f66d5975fdec27b20bce2581
|
[
"MIT"
] | null | null | null |
vendas/admin.py
|
G3Amis/CRM-Vendas
|
03c20ab7d5300014f66d5975fdec27b20bce2581
|
[
"MIT"
] | null | null | null |
vendas/admin.py
|
G3Amis/CRM-Vendas
|
03c20ab7d5300014f66d5975fdec27b20bce2581
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Venda
admin.site.register(Venda)
| 21.5
| 32
| 0.825581
| 13
| 86
| 5.461538
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104651
| 86
| 4
| 33
| 21.5
| 0.922078
| 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
|
cea5a1a8a5382890dd72046faf74f3d5e4d66d43
| 50
|
py
|
Python
|
kings_and_pigs/ai/states/__init__.py
|
yumauri/kings_and_pigs
|
f22be6bbe988f430d72b5ce55283b78d3cc3fe9e
|
[
"MIT"
] | null | null | null |
kings_and_pigs/ai/states/__init__.py
|
yumauri/kings_and_pigs
|
f22be6bbe988f430d72b5ce55283b78d3cc3fe9e
|
[
"MIT"
] | 2
|
2021-12-02T11:05:53.000Z
|
2021-12-23T18:19:23.000Z
|
kings_and_pigs/ai/states/__init__.py
|
yumauri/kings_and_pigs
|
f22be6bbe988f430d72b5ce55283b78d3cc3fe9e
|
[
"MIT"
] | null | null | null |
from .idle import Idle
from .patrol import Patrol
| 16.666667
| 26
| 0.8
| 8
| 50
| 5
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 50
| 2
| 27
| 25
| 0.952381
| 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
|
cec81ef03e0a9d718f1186dadd21229c5a943fd1
| 239
|
py
|
Python
|
tests/__init__.py
|
mukaiu/HanLP
|
a5daff93a1cb0a58b6f1cee3c8e64bdd07171820
|
[
"Apache-2.0"
] | 1
|
2020-01-02T06:03:49.000Z
|
2020-01-02T06:03:49.000Z
|
tests/__init__.py
|
Lankovski/HanLP
|
69ad19aa56a656cad007993bb1716b3018d80751
|
[
"Apache-2.0"
] | null | null | null |
tests/__init__.py
|
Lankovski/HanLP
|
69ad19aa56a656cad007993bb1716b3018d80751
|
[
"Apache-2.0"
] | 1
|
2020-01-11T19:56:42.000Z
|
2020-01-11T19:56:42.000Z
|
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-06-13 23:43
import os
from tests.resources import project_root
def cdroot():
"""
cd to project root, so models are saved in the root folder
"""
os.chdir(project_root)
| 17.071429
| 62
| 0.65272
| 37
| 239
| 4.162162
| 0.810811
| 0.214286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069892
| 0.221757
| 239
| 13
| 63
| 18.384615
| 0.758065
| 0.493724
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.5
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
cecaa7aef6afe3fed88fdb495c42cfb15fa75ebb
| 226
|
py
|
Python
|
jsdb/data.py
|
talwrii/jsdb
|
a1134856326bee8625c4a893d595113506597b44
|
[
"BSD-2-Clause"
] | 2
|
2020-08-28T19:15:11.000Z
|
2020-09-05T01:49:25.000Z
|
jsdb/data.py
|
talwrii/jsdb
|
a1134856326bee8625c4a893d595113506597b44
|
[
"BSD-2-Clause"
] | null | null | null |
jsdb/data.py
|
talwrii/jsdb
|
a1134856326bee8625c4a893d595113506597b44
|
[
"BSD-2-Clause"
] | null | null | null |
import types
import collections
JSON_TYPES = (types.NoneType, bool, list, float, int, str, unicode, collections.MutableMapping, collections.MutableSequence)
JSON_VALUE_TYPES = (types.NoneType, bool, float, int, str, unicode)
| 37.666667
| 124
| 0.792035
| 28
| 226
| 6.285714
| 0.5
| 0.113636
| 0.204545
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106195
| 226
| 5
| 125
| 45.2
| 0.871287
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0c69bc8a8603785fbb0dee5eec6b7197c562db6e
| 81
|
py
|
Python
|
reddit.py
|
Pyprohly/powershell-bot
|
8da0831f09af95b2524a1988c44b6d6cb6d0ae0b
|
[
"MIT"
] | 4
|
2019-02-03T21:01:30.000Z
|
2019-04-15T19:09:27.000Z
|
reddit.py
|
Pyprohly/powershell-bot
|
8da0831f09af95b2524a1988c44b6d6cb6d0ae0b
|
[
"MIT"
] | null | null | null |
reddit.py
|
Pyprohly/powershell-bot
|
8da0831f09af95b2524a1988c44b6d6cb6d0ae0b
|
[
"MIT"
] | null | null | null |
import praw
from config import praw_config
reddit = praw.Reddit(**praw_config)
| 13.5
| 35
| 0.790123
| 12
| 81
| 5.166667
| 0.416667
| 0.322581
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135802
| 81
| 5
| 36
| 16.2
| 0.885714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0c6d5c7691fc43a1ca6b1827fb215fe8f66c0b73
| 252
|
py
|
Python
|
problem_5.py
|
vineeths96/SVM-and-Neural-Networks
|
84d734542d4f7fc718c49a8d63db07b0597ccbc7
|
[
"MIT"
] | 2
|
2020-12-07T09:51:40.000Z
|
2021-05-03T18:29:23.000Z
|
problem_5.py
|
vineeths96/SVM-and-Neural-Networks
|
84d734542d4f7fc718c49a8d63db07b0597ccbc7
|
[
"MIT"
] | null | null | null |
problem_5.py
|
vineeths96/SVM-and-Neural-Networks
|
84d734542d4f7fc718c49a8d63db07b0597ccbc7
|
[
"MIT"
] | 4
|
2021-02-22T16:36:50.000Z
|
2021-09-14T12:50:36.000Z
|
from problem_5.problem_5_SVM import problem_5_SVM
from problem_5.problem_5_DNN import problem_5_DNN
from problem_5.problem_5_LSTM import problem_5_LSTM
# Problem 5 SVM
problem_5_SVM()
# Problem 5 DNN
problem_5_DNN()
# Problem 5 CNN
problem_5_LSTM()
| 19.384615
| 51
| 0.833333
| 48
| 252
| 3.9375
| 0.166667
| 0.634921
| 0.232804
| 0.301587
| 0.592593
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067568
| 0.119048
| 252
| 13
| 52
| 19.384615
| 0.783784
| 0.162698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0caa3ab93d9279dc94eb0550b33317b1d966400e
| 290
|
py
|
Python
|
examples/jsonConfig_EXAMPLE.py
|
TanmoySG/configPy
|
2be9b53e8d945227a4f26638472c385062980e64
|
[
"MIT"
] | 1
|
2022-01-20T11:58:32.000Z
|
2022-01-20T11:58:32.000Z
|
examples/jsonConfig_EXAMPLE.py
|
TanmoySG/configPy
|
2be9b53e8d945227a4f26638472c385062980e64
|
[
"MIT"
] | 21
|
2022-01-19T09:19:16.000Z
|
2022-02-16T07:15:58.000Z
|
examples/jsonConfig_EXAMPLE.py
|
TanmoySG/configPy
|
2be9b53e8d945227a4f26638472c385062980e64
|
[
"MIT"
] | null | null | null |
from configPy import JSONConfigParser
importedConfigs = JSONConfigParser(configFilePath="./configFiles/sampleJSONConfig.json").getConfigurations()
print("Sample JSONConfigParser Test")
print("Module Name: ", importedConfigs["module_name"])
print("Purpose: ", importedConfigs["purpose"])
| 32.222222
| 108
| 0.803448
| 25
| 290
| 9.28
| 0.64
| 0.086207
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 290
| 8
| 109
| 36.25
| 0.859259
| 0
| 0
| 0
| 0
| 0
| 0.355172
| 0.12069
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 0
| 0.8
| 0.6
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
|
0
| 5
|
0cb2fd73d767b7c8e894964183a474457ad60924
| 3,200
|
py
|
Python
|
leetcode_python/Hash_table/find-anagram-mappings.py
|
yennanliu/Python_basics
|
6a597442d39468295946cefbfb11d08f61424dc3
|
[
"Unlicense"
] | 18
|
2019-08-01T07:45:02.000Z
|
2022-03-31T18:05:44.000Z
|
leetcode_python/Hash_table/find-anagram-mappings.py
|
yennanliu/Python_basics
|
6a597442d39468295946cefbfb11d08f61424dc3
|
[
"Unlicense"
] | null | null | null |
leetcode_python/Hash_table/find-anagram-mappings.py
|
yennanliu/Python_basics
|
6a597442d39468295946cefbfb11d08f61424dc3
|
[
"Unlicense"
] | 15
|
2019-12-29T08:46:20.000Z
|
2022-03-08T14:14:05.000Z
|
"""
LeetCode 760. Find Anagram Mappings
Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A.
We want to find an index mapping P, from A to B. A mapping P[i] = j means the ith element in A appears in B at index j.
These lists A and B may contain duplicates. If there are multiple answers, output any of them.
For example, given
A = [12, 28, 46, 32, 50]
B = [50, 12, 32, 46, 28]
We should return
[1, 4, 3, 2, 0]
as P[0] = 1 because the 0th element of A appears at B[1], and P[1] = 4 because the 1st element of A appears at B[4], and so on.
Note:
A, B have equal lengths in range [1, 100].
A[i], B[i] are integers in range [0, 10^5].
"""
# Time: O(n)
# Space: O(n)
# Given two lists Aand B, and B is an anagram of A.
# B is an anagram of A means B is made by randomizing the order of the elements in A.
#
# We want to find an index mapping P, from A to B. A mapping P[i] = j
# means the ith element in A appears in B at index j.
#
# These lists A and B may contain duplicates. If there are multiple answers, output any of them.
#
# For example, given
# A = [12, 28, 46, 32, 50]
# B = [50, 12, 32, 46, 28]
#
# We should return
# [1, 4, 3, 2, 0]
# as P[0] = 1 because the 0th element of A appears at B[1], and P[1] = 4
# because the 1st element of A appears at B[4], and so on.
#
# Note:
# - A, B have equal lengths in range [1, 100].
# - A[i], B[i] are integers in range [0, 10^5].
# V0
import collections
class Solution(object):
def anagramMappings(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: List[int]
"""
dmap = collections.defaultdict(list)
for i, x in enumerate(B):
dmap[x].append(i)
return [dmap[x].pop() for x in A]
# V0'
class Solution(object):
def anagramMappings(self, A, B):
res = []
for i in A:
res.append(B.index(i))
return res
# V1
from collections import OrderedDict
class Solution(object):
def anagramMappings(self, A, B):
lookup=OrderedDict()
for i in A:
#print (i)
if i in B:
#lookup[B.index(i)] = i
lookup[i] = B.index(i)
else:
pass
#print (lookup)
return list(lookup.values())
# V2
# http://bookshadow.com/weblog/2018/01/07/leetcode-find-anagram-mappings/
import collections
class Solution(object):
def anagramMappings(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: List[int]
"""
dmap = collections.defaultdict(list)
for i, x in enumerate(B):
dmap[x].append(i)
return [dmap[x].pop() for x in A]
# V3
import collections
class Solution(object):
def anagramMappings(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: List[int]
"""
lookup = collections.defaultdict(collections.deque)
for i, n in enumerate(B):
lookup[n].append(i)
result = []
for n in A:
result.append(lookup[n].popleft())
return result
| 27.586207
| 133
| 0.582813
| 527
| 3,200
| 3.538899
| 0.227704
| 0.009651
| 0.050938
| 0.058981
| 0.780697
| 0.780697
| 0.780697
| 0.780697
| 0.734584
| 0.734584
| 0
| 0.043633
| 0.298125
| 3,200
| 116
| 134
| 27.586207
| 0.786732
| 0.537813
| 0
| 0.575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0.025
| 0.1
| 0
| 0.475
| 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
|
0cb828278e341584d18db46279076d39e55b9509
| 150
|
py
|
Python
|
ConcurringAndParallelism/CPU_boundProblem/SillyFunction.py
|
Raghvender1205/Advance-Python
|
bc922d86a1a9b3f31b2ea61ab8c3e9e40b7049eb
|
[
"MIT"
] | null | null | null |
ConcurringAndParallelism/CPU_boundProblem/SillyFunction.py
|
Raghvender1205/Advance-Python
|
bc922d86a1a9b3f31b2ea61ab8c3e9e40b7049eb
|
[
"MIT"
] | null | null | null |
ConcurringAndParallelism/CPU_boundProblem/SillyFunction.py
|
Raghvender1205/Advance-Python
|
bc922d86a1a9b3f31b2ea61ab8c3e9e40b7049eb
|
[
"MIT"
] | null | null | null |
def cpu_bound(n):
return sum(i * i for i in range(n))
if __name__ == "__main__":
n = int(input())
res = cpu_bound(n)
print(res)
| 21.428571
| 40
| 0.56
| 25
| 150
| 2.96
| 0.68
| 0.216216
| 0.243243
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.286667
| 150
| 7
| 41
| 21.428571
| 0.691589
| 0
| 0
| 0
| 0
| 0
| 0.055172
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0.166667
| 0.333333
| 0.166667
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
0cc26bb368a9e733082de23355516efcf81b6071
| 465
|
py
|
Python
|
plotly/graph_objs/violin/__init__.py
|
gnestor/plotly.py
|
a8ae062795ddbf9867b8578fe6d9e244948c15ff
|
[
"MIT"
] | 12
|
2020-04-18T18:10:22.000Z
|
2021-12-06T10:11:15.000Z
|
plotly/graph_objs/violin/__init__.py
|
Vesauza/plotly.py
|
e53e626d59495d440341751f60aeff73ff365c28
|
[
"MIT"
] | 27
|
2020-04-28T21:23:12.000Z
|
2021-06-25T15:36:38.000Z
|
plotly/graph_objs/violin/__init__.py
|
Vesauza/plotly.py
|
e53e626d59495d440341751f60aeff73ff365c28
|
[
"MIT"
] | 6
|
2020-04-18T23:07:08.000Z
|
2021-11-18T07:53:06.000Z
|
from ._unselected import Unselected
from plotly.graph_objs.violin import unselected
from ._stream import Stream
from ._selected import Selected
from plotly.graph_objs.violin import selected
from ._meanline import Meanline
from ._marker import Marker
from plotly.graph_objs.violin import marker
from ._line import Line
from ._hoverlabel import Hoverlabel
from plotly.graph_objs.violin import hoverlabel
from ._box import Box
from plotly.graph_objs.violin import box
| 33.214286
| 47
| 0.849462
| 67
| 465
| 5.701493
| 0.208955
| 0.13089
| 0.196335
| 0.248691
| 0.405759
| 0.405759
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111828
| 465
| 13
| 48
| 35.769231
| 0.924939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
0cd92bf346f1e55bea651a3210c320350dc853ce
| 71
|
py
|
Python
|
meshparty/meshwork/__init__.py
|
aplbrain/MeshParty-1
|
c8ed01dd6ac2827bac3f9ff955b26cb2cd2c17b3
|
[
"Apache-2.0"
] | 16
|
2019-02-28T01:25:06.000Z
|
2022-03-10T23:26:37.000Z
|
meshparty/meshwork/__init__.py
|
aplbrain/MeshParty-1
|
c8ed01dd6ac2827bac3f9ff955b26cb2cd2c17b3
|
[
"Apache-2.0"
] | 61
|
2019-01-12T01:32:31.000Z
|
2022-02-03T12:29:29.000Z
|
meshparty/meshwork/__init__.py
|
aplbrain/MeshParty-1
|
c8ed01dd6ac2827bac3f9ff955b26cb2cd2c17b3
|
[
"Apache-2.0"
] | 14
|
2018-09-18T15:43:48.000Z
|
2022-02-08T17:46:17.000Z
|
from .meshwork import Meshwork, load_meshwork
from . import algorithms
| 23.666667
| 45
| 0.830986
| 9
| 71
| 6.444444
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126761
| 71
| 2
| 46
| 35.5
| 0.935484
| 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
|
0cda1ac264897172650e317a210b50ba6b656421
| 657
|
py
|
Python
|
hello.py
|
steven1695-cmis/steven1695-cmis-cs2
|
ccaaa58c45cfb7602b236a7df85e91bc13486f24
|
[
"CC0-1.0"
] | null | null | null |
hello.py
|
steven1695-cmis/steven1695-cmis-cs2
|
ccaaa58c45cfb7602b236a7df85e91bc13486f24
|
[
"CC0-1.0"
] | null | null | null |
hello.py
|
steven1695-cmis/steven1695-cmis-cs2
|
ccaaa58c45cfb7602b236a7df85e91bc13486f24
|
[
"CC0-1.0"
] | null | null | null |
print "Hello World"
print "LOOLOLOLOL"
print "I'm so good at programming. LLOLOL"
print "Git gud kid"
print "Eternal shame...."
print False
print True
print 2
print 3.1415926535
print False
print 03
print ("Nathan", "Happiness", "joy", "depression", 5)
print "Scew you mate", "You're a terrible friend"
print "how old are you?" "5?"
DanielsGPA = 1.4
print DanielsGPA
DanielsLoveLife = 2
print DanielsLoveLife
print DanielsGPA - DanielsLoveLife
print DanielsGPA + DanielsLoveLife
print DanielsGPA * DanielsLoveLife
print DanielsGPA / DanielsLoveLife
print DanielsGPA ** DanielsLoveLife
print DanielsGPA % DanielsLoveLife
print DanielsGPA // DanielsLoveLife
| 24.333333
| 53
| 0.7793
| 84
| 657
| 6.095238
| 0.488095
| 0.234375
| 0.46875
| 0.615234
| 0.439453
| 0.439453
| 0.439453
| 0.439453
| 0.439453
| 0.439453
| 0
| 0.03351
| 0.136986
| 657
| 26
| 54
| 25.269231
| 0.869489
| 0
| 0
| 0.08
| 0
| 0
| 0.253049
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.92
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
0b45a28169501545765263c9f1a028a095cec797
| 199
|
py
|
Python
|
devilry/devilry_message/tests/test_utils.py
|
aless80/devilry-django
|
416c262e75170d5662542f15e2d7fecf5ab84730
|
[
"BSD-3-Clause"
] | 29
|
2015-01-18T22:56:23.000Z
|
2020-11-10T21:28:27.000Z
|
devilry/devilry_message/tests/test_utils.py
|
aless80/devilry-django
|
416c262e75170d5662542f15e2d7fecf5ab84730
|
[
"BSD-3-Clause"
] | 786
|
2015-01-06T16:10:18.000Z
|
2022-03-16T11:10:50.000Z
|
devilry/devilry_message/tests/test_utils.py
|
aless80/devilry-django
|
416c262e75170d5662542f15e2d7fecf5ab84730
|
[
"BSD-3-Clause"
] | 15
|
2015-04-06T06:18:43.000Z
|
2021-02-24T12:28:30.000Z
|
from devilry.devilry_message.utils.subject_generator import SubjectTextGenerator
class SubjectTextTestGenerator(SubjectTextGenerator):
def get_subject_text(self):
return 'Test subject'
| 28.428571
| 80
| 0.819095
| 20
| 199
| 7.95
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125628
| 199
| 6
| 81
| 33.166667
| 0.913793
| 0
| 0
| 0
| 0
| 0
| 0.060302
| 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
|
0b4d0a942af8185c13a69583a502476c61fa0cb1
| 54
|
py
|
Python
|
datafaucet/elastic/__init__.py
|
SylarCS/datalabframework
|
273d91aa04ffb1e86c3a9ca7d58722cfd98537ae
|
[
"MIT"
] | 1
|
2019-10-31T08:38:47.000Z
|
2019-10-31T08:38:47.000Z
|
datafaucet/elastic/__init__.py
|
SylarCS/datalabframework
|
273d91aa04ffb1e86c3a9ca7d58722cfd98537ae
|
[
"MIT"
] | null | null | null |
datafaucet/elastic/__init__.py
|
SylarCS/datalabframework
|
273d91aa04ffb1e86c3a9ca7d58722cfd98537ae
|
[
"MIT"
] | 3
|
2019-06-25T09:26:40.000Z
|
2019-07-16T10:00:03.000Z
|
from datafaucet.elastic.readwrite import read, write
| 18
| 52
| 0.833333
| 7
| 54
| 6.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 54
| 2
| 53
| 27
| 0.9375
| 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
|
0b899b935b7dc1d467e414b628b6a76d4b1f84bb
| 1,586
|
py
|
Python
|
tests/test_to_multipoly.py
|
SaveTheRbtz/h3-py
|
f59a1eafed8915d4c35417bf60a6a2f169ea9f23
|
[
"Apache-2.0"
] | 498
|
2018-07-30T22:45:48.000Z
|
2022-03-30T13:59:45.000Z
|
tests/test_to_multipoly.py
|
SaveTheRbtz/h3-py
|
f59a1eafed8915d4c35417bf60a6a2f169ea9f23
|
[
"Apache-2.0"
] | 199
|
2018-07-31T16:55:23.000Z
|
2022-03-29T16:45:44.000Z
|
tests/test_to_multipoly.py
|
SaveTheRbtz/h3-py
|
f59a1eafed8915d4c35417bf60a6a2f169ea9f23
|
[
"Apache-2.0"
] | 107
|
2018-07-30T21:09:24.000Z
|
2022-01-30T22:58:44.000Z
|
import h3
def test_h3_set_to_multi_polygon():
h = '8928308280fffff'
hexes = h3.k_ring(h, 1)
mpoly = h3.h3_set_to_multi_polygon(hexes)
out = h3.polyfill_polygon(mpoly[0][0], 9, holes=None, lnglat_order=False)
assert out == hexes
def test_2_polys():
h = '8928308280fffff'
hexes = h3.hex_ring(h, 2)
hexes = hexes | {h}
# hexes should be a center hex, and the 2-ring around it
# (with the 1-ring being absent)
out = [
h3.polyfill_polygon(poly[0], 9, holes=poly[1:], lnglat_order=False)
for poly in h3.h3_set_to_multi_polygon(hexes, geo_json=False)
]
assert set.union(*out) == hexes
def test_2_polys_json():
h = '8928308280fffff'
hexes = h3.hex_ring(h, 2)
hexes = hexes | {h}
# hexes should be a center hex, and the 2-ring around it
# (with the 1-ring being absent)
# not deterministic which poly is first..
poly1, poly2 = h3.h3_set_to_multi_polygon(hexes, geo_json=True)
assert {len(poly1), len(poly2)} == {1, 2}
for poly in poly1, poly2:
for loop in poly:
assert loop[0] == loop[-1]
def test_2_polys_not_json():
h = '8928308280fffff'
hexes = h3.hex_ring(h, 2)
hexes = hexes | {h}
# hexes should be a center hex, and the 2-ring around it
# (with the 1-ring being absent)
# not deterministic which poly is first..
poly1, poly2 = h3.h3_set_to_multi_polygon(hexes, geo_json=False)
assert {len(poly1), len(poly2)} == {1, 2}
for poly in poly1, poly2:
for loop in poly:
assert loop[0] != loop[-1]
| 25.580645
| 77
| 0.631148
| 252
| 1,586
| 3.809524
| 0.218254
| 0.026042
| 0.036458
| 0.0625
| 0.79375
| 0.773958
| 0.730208
| 0.703125
| 0.703125
| 0.703125
| 0
| 0.079966
| 0.250946
| 1,586
| 61
| 78
| 26
| 0.728114
| 0.212484
| 0
| 0.470588
| 0
| 0
| 0.048387
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 1
| 0.117647
| false
| 0
| 0.029412
| 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
|
0ba8eabab929f6c591148673213f76672df907e9
| 46
|
py
|
Python
|
revgraph/core/functions/operations/gradient/__init__.py
|
shhoalex/revgraph
|
7060945aa46fbd9584861715f15b6fc8037ba53f
|
[
"MIT"
] | 9
|
2020-06-27T07:01:00.000Z
|
2020-10-23T13:50:04.000Z
|
revgraph/core/functions/operations/gradient/__init__.py
|
shinghinho/revgraph
|
7060945aa46fbd9584861715f15b6fc8037ba53f
|
[
"MIT"
] | null | null | null |
revgraph/core/functions/operations/gradient/__init__.py
|
shinghinho/revgraph
|
7060945aa46fbd9584861715f15b6fc8037ba53f
|
[
"MIT"
] | null | null | null |
from .base import *
from .optimizers import *
| 15.333333
| 25
| 0.73913
| 6
| 46
| 5.666667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 46
| 2
| 26
| 23
| 0.894737
| 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
|
e7ec00e6ff95d820a85e84be5ed2dd1c6d71d4f7
| 136
|
py
|
Python
|
jupyter_MyNodejs_kernel/__main__.py
|
nufeng1999/jupyter-MyNodejs-kernel
|
729e0c975d2087304b84418f30d33f9f2ed50dd4
|
[
"MIT"
] | null | null | null |
jupyter_MyNodejs_kernel/__main__.py
|
nufeng1999/jupyter-MyNodejs-kernel
|
729e0c975d2087304b84418f30d33f9f2ed50dd4
|
[
"MIT"
] | null | null | null |
jupyter_MyNodejs_kernel/__main__.py
|
nufeng1999/jupyter-MyNodejs-kernel
|
729e0c975d2087304b84418f30d33f9f2ed50dd4
|
[
"MIT"
] | null | null | null |
from ipykernel.kernelapp import IPKernelApp
from .kernel import MyNodejsKernel
IPKernelApp.launch_instance(kernel_class=MyNodejsKernel)
| 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
|
f05da1256a77f26ac9490696fac1a4b8c8bc7e94
| 124
|
py
|
Python
|
Grokking Algorithms/sum-dc.py
|
danielfsousa/algorithms-solutions
|
038c0c0bf6d89ffb1ecea596e7d4bb9bd4154ff1
|
[
"MIT"
] | 1
|
2020-03-17T23:54:32.000Z
|
2020-03-17T23:54:32.000Z
|
Grokking Algorithms/sum-dc.py
|
danielfsousa/algorithms-solutions
|
038c0c0bf6d89ffb1ecea596e7d4bb9bd4154ff1
|
[
"MIT"
] | null | null | null |
Grokking Algorithms/sum-dc.py
|
danielfsousa/algorithms-solutions
|
038c0c0bf6d89ffb1ecea596e7d4bb9bd4154ff1
|
[
"MIT"
] | null | null | null |
def sum(arr):
if len(arr) == 1:
return arr[0]
return arr[0] + sum(arr[1:])
print(sum([2, 2, 4, 6])) # 14
| 15.5
| 32
| 0.475806
| 23
| 124
| 2.565217
| 0.565217
| 0.20339
| 0.338983
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114943
| 0.298387
| 124
| 7
| 33
| 17.714286
| 0.563218
| 0.016129
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0
| 0
| 0.6
| 0.2
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
f063d67ef7bb09ebb932a25b98e2dc06a51338ff
| 405
|
py
|
Python
|
tests/test_simple_time.py
|
jaden-git/simple-utils
|
8526ea9a8357665722627ab2c44da527c2884006
|
[
"Apache-2.0"
] | 1
|
2021-03-08T09:54:05.000Z
|
2021-03-08T09:54:05.000Z
|
tests/test_simple_time.py
|
jaden-git/simple-utils
|
8526ea9a8357665722627ab2c44da527c2884006
|
[
"Apache-2.0"
] | null | null | null |
tests/test_simple_time.py
|
jaden-git/simple-utils
|
8526ea9a8357665722627ab2c44da527c2884006
|
[
"Apache-2.0"
] | null | null | null |
import datetime
import simple_utils
def test_get_kst():
print(simple_utils.time.get_kst())
def test_get_kst_ymd():
print(simple_utils.time.get_kst_ymd())
def get_month_dt_list():
print(simple_utils.time.get_month_dt_list(datetime.datetime(2015, 1, 1)))
# def get_kst():
# return datetime.now(timezone('Asia/Seoul'))
# def get_kst_ymd():
# return get_kst().strftime('%Y-%m-%d')
| 19.285714
| 77
| 0.711111
| 65
| 405
| 4.092308
| 0.384615
| 0.157895
| 0.180451
| 0.225564
| 0.281955
| 0.195489
| 0
| 0
| 0
| 0
| 0
| 0.017143
| 0.135802
| 405
| 20
| 78
| 20.25
| 0.742857
| 0.303704
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| true
| 0
| 0.25
| 0
| 0.625
| 0.375
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
f074be859421d873066f6f8e55c38ec5f267a72f
| 89
|
py
|
Python
|
util/env.py
|
xmadsen/mafia-slack
|
3ec384173e538a99c8b419be09e0e459bd84df64
|
[
"MIT"
] | null | null | null |
util/env.py
|
xmadsen/mafia-slack
|
3ec384173e538a99c8b419be09e0e459bd84df64
|
[
"MIT"
] | null | null | null |
util/env.py
|
xmadsen/mafia-slack
|
3ec384173e538a99c8b419be09e0e459bd84df64
|
[
"MIT"
] | null | null | null |
import os
def getEnvVar(name):
if name in os.environ:
return os.environ[name]
| 22.25
| 31
| 0.674157
| 14
| 89
| 4.285714
| 0.642857
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.235955
| 89
| 4
| 31
| 22.25
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
b2d0eadd78d0ad142d573283d1ee2d301507c29c
| 115
|
py
|
Python
|
programming_languages_classification/algorithms/__init__.py
|
contimatteo/Programming-Languages-Classification
|
34ccf1bd403f55226ed5131d57265df45d314b6f
|
[
"MIT"
] | 1
|
2022-03-18T12:54:52.000Z
|
2022-03-18T12:54:52.000Z
|
programming_languages_classification/algorithms/__init__.py
|
contimatteo/Programming-Languages-Classification
|
34ccf1bd403f55226ed5131d57265df45d314b6f
|
[
"MIT"
] | 5
|
2021-11-10T19:58:25.000Z
|
2022-03-19T18:17:41.000Z
|
programming_languages_classification/algorithms/__init__.py
|
contimatteo/programming-language-classifier
|
60847ab91cff4dc20ded1a024d272c75956194a0
|
[
"MIT"
] | null | null | null |
# /usr/bin/env python3
from .bayes import NaiveBayes
from .svm import SVM
from .cnn import CNN
from .nn import NN
| 16.428571
| 29
| 0.756522
| 20
| 115
| 4.35
| 0.55
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010526
| 0.173913
| 115
| 6
| 30
| 19.166667
| 0.905263
| 0.173913
| 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
|
650d5ecc34b604375e16eed1fa3b97b5b7ec81c9
| 164
|
py
|
Python
|
crontabdb/admin.py
|
mnosinov/celery_crontab_in_database
|
2f90e9892e9a702453e9d45cadc9eaeb2a9060be
|
[
"MIT"
] | null | null | null |
crontabdb/admin.py
|
mnosinov/celery_crontab_in_database
|
2f90e9892e9a702453e9d45cadc9eaeb2a9060be
|
[
"MIT"
] | null | null | null |
crontabdb/admin.py
|
mnosinov/celery_crontab_in_database
|
2f90e9892e9a702453e9d45cadc9eaeb2a9060be
|
[
"MIT"
] | 1
|
2022-03-26T02:11:50.000Z
|
2022-03-26T02:11:50.000Z
|
from django.contrib import admin
from .models import Scheduler
class SchedulerAdmin(admin.ModelAdmin):
pass
admin.site.register(Scheduler, SchedulerAdmin)
| 14.909091
| 46
| 0.79878
| 19
| 164
| 6.894737
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134146
| 164
| 10
| 47
| 16.4
| 0.922535
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
6524d0f28cbb2b97eb3a3697d3c68789a4b5ad9b
| 7,302
|
py
|
Python
|
model.py
|
TachyonFTL/multirelational-poincare
|
488b744f060037e6ef896a3343906c01707ae8ad
|
[
"MIT"
] | null | null | null |
model.py
|
TachyonFTL/multirelational-poincare
|
488b744f060037e6ef896a3343906c01707ae8ad
|
[
"MIT"
] | null | null | null |
model.py
|
TachyonFTL/multirelational-poincare
|
488b744f060037e6ef896a3343906c01707ae8ad
|
[
"MIT"
] | null | null | null |
import numpy as np
import torch.nn.functional as F
from torch import nn
from utils import *
class MuRP(torch.nn.Module):
def __init__(self, d, dim):
super(MuRP, self).__init__()
self.Eh = torch.nn.Embedding(len(d.entities), dim, padding_idx=0)
self.Eh.weight.data = (1e-3 * torch.randn((len(d.entities), dim), dtype=torch.double, device="cuda"))
self.rvh = torch.nn.Embedding(len(d.relations), dim, padding_idx=0)
self.rvh.weight.data = (1e-3 * torch.randn((len(d.relations), dim), dtype=torch.double, device="cuda"))
self.Wu = torch.nn.Parameter(torch.tensor(np.random.uniform(-1, 1, (len(d.relations),
dim)), dtype=torch.double, requires_grad=True, device="cuda"))
#self.bs = torch.nn.Parameter(torch.zeros(len(d.entities), dtype=torch.double, requires_grad=True, device="cuda"))
#self.bo = torch.nn.Parameter(torch.zeros(len(d.entities), dtype=torch.double, requires_grad=True, device="cuda"))
self.loss = torch.nn.BCEWithLogitsLoss()
def forward(self, u_idx, r_idx, v_idx):
u = self.Eh.weight[u_idx]
v = self.Eh.weight[v_idx]
Ru = self.Wu[r_idx]
rvh = self.rvh.weight[r_idx]
u = torch.where(torch.norm(u, 2, dim=-1, keepdim=True) >= 1,
u/(torch.norm(u, 2, dim=-1, keepdim=True)-1e-5), u)
v = torch.where(torch.norm(v, 2, dim=-1, keepdim=True) >= 1,
v/(torch.norm(v, 2, dim=-1, keepdim=True)-1e-5), v)
rvh = torch.where(torch.norm(rvh, 2, dim=-1, keepdim=True) >= 1,
rvh/(torch.norm(rvh, 2, dim=-1, keepdim=True)-1e-5), rvh)
u_e = p_log_map(u)
u_W = u_e * Ru
u_m = p_exp_map(u_W)
v_m = p_sum(v, rvh)
u_m = torch.where(torch.norm(u_m, 2, dim=-1, keepdim=True) >= 1,
u_m/(torch.norm(u_m, 2, dim=-1, keepdim=True)-1e-5), u_m)
v_m = torch.where(torch.norm(v_m, 2, dim=-1, keepdim=True) >= 1,
v_m/(torch.norm(v_m, 2, dim=-1, keepdim=True)-1e-5), v_m)
sqdist = (2.*artanh(torch.clamp(torch.norm(p_sum(-u_m, v_m), 2, dim=-1), 1e-10, 1-1e-5)))**2
return -sqdist
# + self.bs[u_idx] + self.bo[v_idx]
# Test:
# Number of data points: 5842
# Hits @10: 0.9984594317014721
# Hits @3: 0.984594317014721
# Hits @1: 0.8623758986648408
# Mean rank: 1.2516261554262238
# Mean reciprocal rank: 0.923340773888485
class MuRE(torch.nn.Module):
def __init__(self, d, dim):
super(MuRE, self).__init__()
self.E = torch.nn.Embedding(len(d.entities), dim, padding_idx=0)
self.E.weight.data = self.E.weight.data.double()
self.E.weight.data = (1e-3 * torch.randn((len(d.entities), dim), dtype=torch.double, device="cuda"))
self.Wu = torch.nn.Parameter(torch.tensor(np.random.uniform(-1, 1, (len(d.relations),
dim)), dtype=torch.double, requires_grad=True, device="cuda"))
print(self.Wu)
self.rv = torch.nn.Embedding(len(d.relations), dim, padding_idx=0)
self.rv.weight.data = self.rv.weight.data.double()
self.rv.weight.data = (1e-3 * torch.randn((len(d.relations), dim), dtype=torch.double, device="cuda"))
self.bs = torch.nn.Parameter(torch.zeros(len(d.entities), dtype=torch.double, requires_grad=True, device="cuda"))
self.bo = torch.nn.Parameter(torch.zeros(len(d.entities), dtype=torch.double, requires_grad=True, device="cuda"))
self.loss = torch.nn.BCEWithLogitsLoss()
def forward(self, u_idx, r_idx, v_idx):
u = self.E.weight[u_idx]
v = self.E.weight[v_idx]
Ru = self.Wu[r_idx]
rv = self.rv.weight[r_idx]
u_size = u.size()
print(u.size())
print(Ru.size())
exit()
u_W = u * Ru
sqdist = torch.sum(torch.pow(u_W - (v+rv), 2), dim=-1)
return -sqdist + self.bs[u_idx] + self.bo[v_idx]
class EMuRP(torch.nn.Module):
def __init__(self, d, dim, dim_hidden, dim_euclid, pretrain_embedding):
super(EMuRP, self).__init__()
self.Eh = torch.nn.Embedding(len(d.entities), dim, padding_idx=0)
self.Eh.weight.data = (1e-3 * torch.randn((len(d.entities), dim), dtype=torch.double, device="cuda"))
self.rvh = torch.nn.Embedding(len(d.relations), dim, padding_idx=0)
self.rvh.weight.data = (1e-3 * torch.randn((len(d.relations), dim), dtype=torch.double, device="cuda"))
self.Wu = torch.nn.Parameter(torch.tensor(np.random.uniform(-1, 1, (len(d.relations),
dim)), dtype=torch.double,
requires_grad=True, device="cuda"))
# self.bs = torch.nn.Parameter(torch.zeros(len(d.entities), dtype=torch.double, requires_grad=True, device="cuda"))
# self.bo = torch.nn.Parameter(torch.zeros(len(d.entities), dtype=torch.double, requires_grad=True, device="cuda"))
self.euclidean = nn.Embedding(len(d.entities), dim_euclid, padding_idx=0)
self.embedding.weight.data.copy_(pretrain_embedding)
self.embedding.weight.requires_grad = False
self.euclidean_map_0 = nn.Linear(dim_euclid, dim_hidden)
self.euclidean_map_1 = nn.Linear(dim_hidden, dim)
# self.projection = nn.Linear(dim_euclid, dim)
self.loss = torch.nn.BCEWithLogitsLoss()
self.loss_1 = torch.nn.MSELoss()
def forward(self, u_idx, r_idx, v_idx, phase=1):
if phase == 1:
u = self.Eh.weight[u_idx]
v = self.Eh.weight[v_idx]
return self.forward_1(u, r_idx, v)
elif phase == 2:
return self.forward_2(u_idx, r_idx, v_idx)
else:
u, v = self.forward_2(u_idx, r_idx, v_idx)
return self.forward_1(u, r_idx, v)
def forward_1(self, u, r_idx, v):
Ru = self.Wu[r_idx]
rvh = self.rvh.weight[r_idx]
u = torch.where(torch.norm(u, 2, dim=-1, keepdim=True) >= 1,
u / (torch.norm(u, 2, dim=-1, keepdim=True) - 1e-5), u)
v = torch.where(torch.norm(v, 2, dim=-1, keepdim=True) >= 1,
v / (torch.norm(v, 2, dim=-1, keepdim=True) - 1e-5), v)
rvh = torch.where(torch.norm(rvh, 2, dim=-1, keepdim=True) >= 1,
rvh / (torch.norm(rvh, 2, dim=-1, keepdim=True) - 1e-5), rvh)
u_e = p_log_map(u)
u_W = u_e * Ru
u_m = p_exp_map(u_W)
v_m = p_sum(v, rvh)
u_m = torch.where(torch.norm(u_m, 2, dim=-1, keepdim=True) >= 1,
u_m / (torch.norm(u_m, 2, dim=-1, keepdim=True) - 1e-5), u_m)
v_m = torch.where(torch.norm(v_m, 2, dim=-1, keepdim=True) >= 1,
v_m / (torch.norm(v_m, 2, dim=-1, keepdim=True) - 1e-5), v_m)
sqdist = (2. * artanh(torch.clamp(torch.norm(p_sum(-u_m, v_m), 2, dim=-1), 1e-10, 1 - 1e-5))) ** 2
return -sqdist
def forward_2(self, u_idx, r_idx, v_idx):
u = self.euclidean(u_idx)
v = self.euclidean(v_idx)
return self.euclidean_map_1(F.relu(self.euclidean_map_0(u))), \
self.euclidean_map_1(F.relu(self.euclidean_map_0(v)))
| 49.337838
| 123
| 0.578882
| 1,133
| 7,302
| 3.589585
| 0.096205
| 0.039587
| 0.028276
| 0.059012
| 0.799852
| 0.778461
| 0.772068
| 0.772068
| 0.759774
| 0.72117
| 0
| 0.041344
| 0.258012
| 7,302
| 147
| 124
| 49.673469
| 0.709302
| 0.09874
| 0
| 0.557522
| 0
| 0
| 0.006699
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.070796
| false
| 0
| 0.035398
| 0
| 0.19469
| 0.026549
| 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
|
652c6c90f2aa315619b5e124037b28cf3a13518b
| 251
|
py
|
Python
|
Cheetah/Unspecified.py
|
yegorich/cheetah3
|
35571a00395c4ef937a08ae5a3686700a53bd1d1
|
[
"MIT"
] | 111
|
2017-03-04T11:35:50.000Z
|
2022-02-15T08:10:28.000Z
|
Cheetah/Unspecified.py
|
yegorich/cheetah3
|
35571a00395c4ef937a08ae5a3686700a53bd1d1
|
[
"MIT"
] | 49
|
2017-03-21T18:31:43.000Z
|
2022-02-20T11:30:40.000Z
|
Cheetah/Unspecified.py
|
yegorich/cheetah3
|
35571a00395c4ef937a08ae5a3686700a53bd1d1
|
[
"MIT"
] | 38
|
2017-03-21T00:44:43.000Z
|
2021-09-18T09:45:13.000Z
|
try:
from ds.sys.Unspecified import Unspecified
except ImportError:
class _Unspecified:
def __repr__(self):
return 'Unspecified'
def __str__(self):
return 'Unspecified'
Unspecified = _Unspecified()
| 22.818182
| 46
| 0.63745
| 23
| 251
| 6.521739
| 0.608696
| 0.186667
| 0.28
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.290837
| 251
| 10
| 47
| 25.1
| 0.842697
| 0
| 0
| 0.222222
| 0
| 0
| 0.087649
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.222222
| 0.222222
| 0.777778
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
654b7b3c1371f62e5e6ab5752d8e2c722039caa6
| 4,921
|
py
|
Python
|
tests/test_basic.py
|
gwurster/ApplyPlus
|
56b88eb3cb63a887065cb172d1604498e4dd49f9
|
[
"MIT"
] | 1
|
2021-08-01T01:42:04.000Z
|
2021-08-01T01:42:04.000Z
|
tests/test_basic.py
|
gwurster/ApplyPlus
|
56b88eb3cb63a887065cb172d1604498e4dd49f9
|
[
"MIT"
] | 5
|
2021-09-07T00:31:43.000Z
|
2022-03-11T15:39:18.000Z
|
tests/test_basic.py
|
gwurster/ApplyPlus
|
56b88eb3cb63a887065cb172d1604498e4dd49f9
|
[
"MIT"
] | 1
|
2021-04-16T18:16:05.000Z
|
2021-04-16T18:16:05.000Z
|
#!/usr/bin/env python3
import unittest
import sys
import os
import re
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "."))
import scripts.patch_context.context_changes as context
import scripts.patch_apply.patchParser as parse
def GenerateTestName(filename):
if filename.endswith('.patch'):
filename = filename[:-6]
filename = filename.replace('-', '_')
filename = re.sub( r'[^\w]+', '', filename, flags=re.ASCII )
return filename
class AppliedPatchTests(type):
def __new__(mcls, name, bases, attrs):
obj = super().__new__(mcls, name, bases, attrs)
patchpath = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'patches', 'applied'))
for filename in os.listdir(patchpath):
if not filename.endswith('.patch'):
continue
testname = GenerateTestName(filename)
filename = os.path.join(patchpath, filename)
if not hasattr(obj, 'test_' + testname):
setattr(obj, 'test_' + testname, mcls.build_test(filename))
return obj
def build_test(test_filename):
def f(self):
patch_file = parse.PatchFile(test_filename)
patch_file.getPatch()
# There should only be one hunk in this file.
self.assertEqual( len(patch_file.patches), 1 )
for hunk in patch_file.patches:
result = context.context_changes(hunk)
self.assertEqual(result.messages, "No context related issues found.")
for hunk in patch_file.patches:
filename = os.path.join( os.getcwd(), hunk.getFileName() )
self.assertTrue( os.path.isfile(filename), filename )
result = hunk.canApply()
self.assertFalse( result, hunk )
return f
class TestApplied(unittest.TestCase, metaclass=AppliedPatchTests):
def setUp(self):
self.oldcwd=os.getcwd()
os.chdir(os.path.dirname(__file__))
def tearDown(self):
os.chdir(self.oldcwd)
pass
class PatchTests(type):
def __new__(mcls, name, bases, attrs):
obj = super().__new__(mcls, name, bases, attrs)
patchpath = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'patches', 'clean'))
for filename in os.listdir(patchpath):
if not filename.endswith('.patch'):
continue
testname = GenerateTestName(filename)
filename = os.path.join(patchpath, filename)
if not hasattr(obj, 'test_' + testname):
setattr(obj, 'test_' + testname, mcls.build_test(filename))
return obj
def build_test(test_filename):
def f(self):
patch_file = parse.PatchFile(test_filename)
patch_file.getPatch()
# There should only be one hunk in this file.
self.assertEqual( len(patch_file.patches), 1 )
for hunk in patch_file.patches:
result = context.context_changes(hunk)
self.assertEqual(result.messages, "No context related issues found.")
for hunk in patch_file.patches:
filename = os.path.join( os.getcwd(), hunk.getFileName() )
self.assertTrue( os.path.isfile(filename), filename )
result = hunk.canApply()
self.assertTrue( result, hunk )
return f
class TestPatches(unittest.TestCase, metaclass=PatchTests):
def setUp(self):
self.oldcwd=os.getcwd()
os.chdir(os.path.dirname(__file__))
def tearDown(self):
os.chdir(self.oldcwd)
def test_no_patch(self):
patch_file = parse.PatchFile("patches/does-not-exist.patch")
self.assertRaises( FileNotFoundError, patch_file.getPatch )
def test_no_file(self):
patch_file = parse.PatchFile("patches/no-file.patch")
patch_file.getPatch()
# There should only be one hunk in this file.
self.assertEqual( len(patch_file.patches), 1 )
for hunk in patch_file.patches:
result = context.context_changes(hunk)
self.assertRegex(result.messages, r'^The file .* does not exist$')
def test_name_change(self):
patch_file = parse.PatchFile("patches/name-change.patch")
patch_file.getPatch()
# There should only be one hunk in this file.
self.assertEqual( len(patch_file.patches), 1 )
for hunk in patch_file.patches:
result = context.context_changes(hunk)
self.assertRegex(result.messages, r'^The file .* does not exist$')
def test_two_changes(self):
patch_file = parse.PatchFile("patches/clean/two-changes.patch")
patch_file.getPatch()
# There should only be one hunk in this file.
self.assertEqual( len(patch_file.patches), 2 )
if __name__ == "__main__":
unittest.main()
| 33.026846
| 85
| 0.618777
| 576
| 4,921
| 5.121528
| 0.184028
| 0.070169
| 0.059661
| 0.03661
| 0.784068
| 0.769153
| 0.723051
| 0.713898
| 0.713898
| 0.713898
| 0
| 0.001951
| 0.271083
| 4,921
| 148
| 86
| 33.25
| 0.820463
| 0.048974
| 0
| 0.669903
| 0
| 0
| 0.065896
| 0.022465
| 0
| 0
| 0
| 0
| 0.135922
| 1
| 0.145631
| false
| 0.009709
| 0.058252
| 0
| 0.291262
| 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
|
e8eca9cc2907a1ee91ee3e45b7e7d7ffd88a0067
| 1,223
|
py
|
Python
|
utilities/configUtilities.py
|
devonps/talesfromticronem
|
6b6e9b039b0091cce2f52677974eeb832cf13e36
|
[
"MIT"
] | 4
|
2020-04-11T12:29:52.000Z
|
2021-01-25T00:37:56.000Z
|
utilities/configUtilities.py
|
devonps/talesfromticronem
|
6b6e9b039b0091cce2f52677974eeb832cf13e36
|
[
"MIT"
] | 66
|
2020-04-06T09:36:45.000Z
|
2022-03-12T00:36:29.000Z
|
utilities/configUtilities.py
|
devonps/talesfromticronem
|
6b6e9b039b0091cce2f52677974eeb832cf13e36
|
[
"MIT"
] | null | null | null |
import configparser
def load_config():
config = configparser.ConfigParser()
config.read('config.ini')
return config
def get_config_value_as_string(configfile, section, parameter):
# strip quotes from the string
raw_parameter = configfile[section][parameter]
clean_parm = raw_parameter.translate({ord(i): None for i in '\"\''})
return clean_parm
def get_config_value_as_text(configfile, section, parameter):
return configfile[section][parameter]
def get_config_value_as_integer(configfile, section, parameter):
return int(configfile[section][parameter])
def get_config_value_as_float(configfile, section, parameter):
return float(configfile[section][parameter])
def get_config_file_sections(configfile):
return configfile.sections()
def set_config_value(configfile, section, parameter, value):
configfile[section][parameter] = value
def get_config_value_as_list(configfile, section, parameter):
my_str = get_config_value_as_text(configfile, section, parameter)
# now break this out into a list
mylist = my_str.split(",")
return mylist
def update_game_state(configfile, section, parameter, value):
configfile[section][parameter] = value
| 25.479167
| 72
| 0.757155
| 153
| 1,223
| 5.803922
| 0.320261
| 0.268018
| 0.40991
| 0.108108
| 0.439189
| 0.387387
| 0.344595
| 0.344595
| 0
| 0
| 0
| 0
| 0.147997
| 1,223
| 47
| 73
| 26.021277
| 0.852207
| 0.048242
| 0
| 0.08
| 0
| 0
| 0.012059
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.36
| false
| 0
| 0.04
| 0.16
| 0.68
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
3331792980d99edf1303becc52c8f51fc94d418a
| 157
|
py
|
Python
|
My_blog/blueprints/blog.py
|
SinTod/My_blog
|
024d9032b59d97678dea75acc73a31150e81c540
|
[
"MIT"
] | null | null | null |
My_blog/blueprints/blog.py
|
SinTod/My_blog
|
024d9032b59d97678dea75acc73a31150e81c540
|
[
"MIT"
] | null | null | null |
My_blog/blueprints/blog.py
|
SinTod/My_blog
|
024d9032b59d97678dea75acc73a31150e81c540
|
[
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
'''
* @Author: SinTod
* @Date: 2018-10-15 17:33:14
* @Desc:
'''
from flask import Blueprint
blog_bp = Blueprint('blog', __name__)
| 15.7
| 37
| 0.611465
| 22
| 157
| 4.136364
| 0.909091
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 0.171975
| 157
| 9
| 38
| 17.444444
| 0.584615
| 0.490446
| 0
| 0
| 0
| 0
| 0.057971
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 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
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
33333cd94160d5097504a9d91403600fe684af80
| 23
|
py
|
Python
|
aliyun-python-sdk-ecs/aliyunsdkecs/__init__.py
|
silent-beaters/aliyun-openapi-python-sdk
|
7a025eabdad622af07affc3a7beeae1c5def469d
|
[
"Apache-2.0"
] | 1,001
|
2015-07-24T01:32:41.000Z
|
2022-03-25T01:28:18.000Z
|
aliyun-python-sdk-ecs/aliyunsdkecs/__init__.py
|
silent-beaters/aliyun-openapi-python-sdk
|
7a025eabdad622af07affc3a7beeae1c5def469d
|
[
"Apache-2.0"
] | 363
|
2015-10-20T03:15:00.000Z
|
2022-03-08T12:26:19.000Z
|
aliyun-python-sdk-ecs/aliyunsdkecs/__init__.py
|
silent-beaters/aliyun-openapi-python-sdk
|
7a025eabdad622af07affc3a7beeae1c5def469d
|
[
"Apache-2.0"
] | 682
|
2015-09-22T07:19:02.000Z
|
2022-03-22T09:51:46.000Z
|
__version__ = '4.24.11'
| 23
| 23
| 0.695652
| 4
| 23
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238095
| 0.086957
| 23
| 1
| 23
| 23
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0.291667
| 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
|
334d5b8edcbadd04e2fb7e3e592d7316d1243e7d
| 333
|
py
|
Python
|
aws/api/KMS.py
|
fdimant/aws-security-test
|
f751661e4b9a7a2c09c7a0464700e078820cf384
|
[
"Apache-2.0"
] | 9
|
2017-07-07T17:24:05.000Z
|
2021-05-18T14:49:29.000Z
|
aws/api/KMS.py
|
mikhailadvani/cis-aws-automation
|
f751661e4b9a7a2c09c7a0464700e078820cf384
|
[
"Apache-2.0"
] | 1
|
2017-08-20T13:54:29.000Z
|
2017-08-20T13:54:29.000Z
|
aws/api/KMS.py
|
mikhailadvani/cis-aws-automation
|
f751661e4b9a7a2c09c7a0464700e078820cf384
|
[
"Apache-2.0"
] | 13
|
2017-04-07T16:43:41.000Z
|
2020-11-07T15:37:39.000Z
|
import boto3
class KMS:
def __init__(self):
self.kms = boto3.client('kms')
def getKeys(self):
return self.kms.list_keys()
def getRotationStatus(self, keyId):
return self.kms.get_key_rotation_status(KeyId=keyId)
def describeKey(self, keyId):
return self.kms.describe_key(KeyId=keyId)
| 25.615385
| 60
| 0.672673
| 44
| 333
| 4.886364
| 0.454545
| 0.130233
| 0.181395
| 0.176744
| 0.204651
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007692
| 0.219219
| 333
| 13
| 61
| 25.615385
| 0.819231
| 0
| 0
| 0
| 0
| 0
| 0.008982
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.1
| 0.3
| 0.9
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
d79ceb80fba8da23af2c0ddff8af82082e67ba38
| 76
|
py
|
Python
|
lib/nn/__init__.py
|
zhjpqq/Detectron.pytorch
|
8315af319cd29b8884a7c0382c4700a96bf35bbc
|
[
"MIT"
] | 2,837
|
2018-04-16T17:29:46.000Z
|
2022-03-31T12:03:49.000Z
|
lib/nn/__init__.py
|
zhjpqq/Detectron.pytorch
|
8315af319cd29b8884a7c0382c4700a96bf35bbc
|
[
"MIT"
] | 208
|
2018-04-17T12:46:12.000Z
|
2021-07-30T14:40:15.000Z
|
lib/nn/__init__.py
|
zhjpqq/Detectron.pytorch
|
8315af319cd29b8884a7c0382c4700a96bf35bbc
|
[
"MIT"
] | 624
|
2018-04-16T20:52:25.000Z
|
2022-03-19T12:51:21.000Z
|
from .modules import *
from .parallel import DataParallel
from . import init
| 25.333333
| 34
| 0.802632
| 10
| 76
| 6.1
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144737
| 76
| 3
| 35
| 25.333333
| 0.938462
| 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
|
d7dcc9d3139a52ba188b020d6aa9655fa4b55955
| 86
|
py
|
Python
|
docs/tests/E1128.py
|
mrfyda/codacy-pylint-python3
|
e360f6c0407edebe274835d3a881d67e96adf8ba
|
[
"Apache-2.0"
] | 17
|
2016-01-26T13:30:04.000Z
|
2022-03-06T21:11:42.000Z
|
docs/tests/E1128.py
|
mrfyda/codacy-pylint-python3
|
e360f6c0407edebe274835d3a881d67e96adf8ba
|
[
"Apache-2.0"
] | 50
|
2019-08-14T16:14:45.000Z
|
2022-03-31T11:00:50.000Z
|
docs/tests/E1128.py
|
mrfyda/codacy-pylint-python3
|
e360f6c0407edebe274835d3a881d67e96adf8ba
|
[
"Apache-2.0"
] | 15
|
2015-11-18T12:18:50.000Z
|
2021-01-17T22:21:41.000Z
|
##Patterns: E1128
def test():
return None
##Err: E1128
no_value_returned = test()
| 14.333333
| 26
| 0.686047
| 12
| 86
| 4.75
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112676
| 0.174419
| 86
| 6
| 26
| 14.333333
| 0.690141
| 0.290698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
d7f9078d331e9f5211c55a2625681b19a8fc97ae
| 279
|
py
|
Python
|
python/hidebound/__init__.py
|
theNewFlesh/nerve
|
4e430db20cf69cb065318806edf13656b5b035c0
|
[
"MIT"
] | 3
|
2020-05-18T11:56:50.000Z
|
2021-12-27T17:23:34.000Z
|
python/hidebound/__init__.py
|
theNewFlesh/nerve
|
4e430db20cf69cb065318806edf13656b5b035c0
|
[
"MIT"
] | 8
|
2021-05-17T23:44:44.000Z
|
2021-07-13T00:58:04.000Z
|
python/hidebound/__init__.py
|
theNewFlesh/nerve
|
4e430db20cf69cb065318806edf13656b5b035c0
|
[
"MIT"
] | 1
|
2020-12-04T20:04:00.000Z
|
2020-12-04T20:04:00.000Z
|
'''
A local database framework for defining and validating assets.
Author: Alex Braun
Email: Alexander.G.Braun@gmail.com
Github: https://github.com/theNewFlesh
'''
import hidebound.core # noqa F401
import hidebound.exporters # noqa F401
import hidebound.server # noqa F401
| 21.461538
| 62
| 0.770609
| 38
| 279
| 5.657895
| 0.710526
| 0.209302
| 0.130233
| 0.213953
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0375
| 0.139785
| 279
| 12
| 63
| 23.25
| 0.858333
| 0.670251
| 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
| 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
|
cc251aa2461eea029f81c78e5feae7b7ad722062
| 83
|
py
|
Python
|
features/environment.py
|
aragaer/pa2human
|
855eafe35bfd332ac8ecd59cc84d66ac9f9a41d4
|
[
"MIT"
] | null | null | null |
features/environment.py
|
aragaer/pa2human
|
855eafe35bfd332ac8ecd59cc84d66ac9f9a41d4
|
[
"MIT"
] | null | null | null |
features/environment.py
|
aragaer/pa2human
|
855eafe35bfd332ac8ecd59cc84d66ac9f9a41d4
|
[
"MIT"
] | null | null | null |
from runner import Runner
def before_all(context):
context.runner = Runner()
| 13.833333
| 29
| 0.73494
| 11
| 83
| 5.454545
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180723
| 83
| 5
| 30
| 16.6
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0bd828e7ff3651646350896729bf40f7ffca25c3
| 4,442
|
py
|
Python
|
plots.py
|
Carmen-Lewis/SolarRadiation_QC
|
e396eba0112ee3c8d8b0ef3ecd73e639ba4a825b
|
[
"MIT"
] | null | null | null |
plots.py
|
Carmen-Lewis/SolarRadiation_QC
|
e396eba0112ee3c8d8b0ef3ecd73e639ba4a825b
|
[
"MIT"
] | null | null | null |
plots.py
|
Carmen-Lewis/SolarRadiation_QC
|
e396eba0112ee3c8d8b0ef3ecd73e639ba4a825b
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on Fri May 21 14:16:00 2021
@author: Carmen Lewis (carmen@solarXY.org)
Test and result plots for QC tests.
"""
import matplotlib.pyplot as plt
from matplotlib.pylab import rcParams
plt.rcParams.update({'font.size': 12, 'font.family': 'cmr10', 'mathtext.fontset': 'cm'})
import datetime as dt
from calendar import monthrange
import pandas as pd
import seaborn as sns
import numpy as np
#colour range
cl = ['#9e0142','#d53e4f','#f46d43','#fdae61', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2']
def GHI(df):
rcParams['figure.figsize'] = 20, 2
fig, ax = plt.subplots(1, 1)
#slice dataset to specific year & month
df1 = df[(df['DateTime'].dt.year == 2019) & (df['DateTime'].dt.month == 1)]
ax.plot(df1['SumSW'], lw=0.8, color=cl[1], label='Calculated')
ax.plot(df1['GHI'], lw=0.8, color='black', label='Measured')
ax.legend()
def DAA_compareTestPlot(df):
rcParams['figure.figsize'] = 20, 10
fig, ax = plt.subplots(3, 1, sharex=True, sharey=True)
#slice dataset to specific year & month
df1 = df[(df['DateTime'].dt.year == 2019) & (df['DateTime'].dt.month == 1)]
ax[0].title.set_text('DAA: QC Physical Tests')
ax[0].plot(df1['DateTime'], df1['GHI'], lw=0.8, color='black')
ax[0].plot(df1['G_flag1'], lw=5, color=cl[1])
ax[0].plot(df1['G_flag2'], lw=5, color=cl[6])
ax[0].set_ylabel('GHI')
ax[0].set_ylim(0, 1490)
ax[0].set_xlim(dt.datetime(2019, 1, 1, 0, 0, 0), dt.datetime(2019, 1, 30, 23, 59, 0))
ax[0].text(dt.datetime(2019, 1, 1, 5, 30, 0), 1350, 'T1')
ax[0].text(dt.datetime(2019, 1, 29, 12, 0, 0), 1350, "Failed: %s" %df1['F_G1_fail'].count())
ax[1].plot(df1['DateTime'], df1['DNI'], lw=0.8, color='black')
#ax[1].plot(df1['F_I1_fail'], lw=5, color=cl[1])
ax[1].set_ylabel('DNI')
ax[1].text(dt.datetime(2019, 1, 1, 5, 30, 0), 1350, 'T2')
ax[1].text(dt.datetime(2019, 1, 29, 12, 0, 0), 1350, "Failed: %s" %df1['F_I1_fail'].count())
ax[2].plot(df1['DateTime'], df1['DHI'], lw=0.8, color='black')
ax[2].plot(df1['D_flag1'], lw=5, color=cl[1])
ax[2].plot(df1['D_flag2'], lw=5, color=cl[6])
ax[2].set_ylabel('DHI')
ax[2].set_xlabel('Date')
ax[2].text(dt.datetime(2019, 1, 1, 5, 30, 0), 1350, 'T3')
ax[2].text(dt.datetime(2019, 1, 29, 12, 0, 0), 1350, "Failed: %s" %df1['F_D1_fail'].count())
fig.subplots_adjust(wspace=0, hspace=0)
plt.savefig('ComparativeTests_DAA.png', bbox_inches='tight', format='png', dpi=600)
def DAA_physicalTestPlot(df):
rcParams['figure.figsize'] = 20, 10
fig, ax = plt.subplots(3, 1, sharex=True, sharey=True)
#slice dataset to specific year & month
df1 = df[(df['DateTime'].dt.year == 2019) & (df['DateTime'].dt.month == 1)]
ax[0].title.set_text('DAA: QC Physical Tests')
ax[0].plot(df1['DateTime'], df1['GHI'], lw=0.8, color='black')
ax[0].plot(df1['F_G1_fail'], lw=5, color=cl[1])
ax[0].set_ylabel('GHI')
ax[0].set_ylim(0, 1490)
ax[0].set_xlim(dt.datetime(2019, 1, 1, 0, 0, 0), dt.datetime(2019, 1, 30, 23, 59, 0))
ax[0].text(dt.datetime(2019, 1, 1, 5, 30, 0), 1350, 'T1')
ax[0].text(dt.datetime(2019, 1, 29, 12, 0, 0), 1350, "Failed: %s" %df1['F_G1_fail'].count())
ax[1].plot(df1['DateTime'], df1['DNI'], lw=0.8, color='black')
ax[1].plot(df1['F_I1_fail'], lw=5, color=cl[1])
ax[1].set_ylabel('DNI')
ax[1].text(dt.datetime(2019, 1, 1, 5, 30, 0), 1350, 'T2')
ax[1].text(dt.datetime(2019, 1, 29, 12, 0, 0), 1350, "Failed: %s" %df1['F_I1_fail'].count())
ax[2].plot(df1['DateTime'], df1['DHI'], lw=0.8, color='black')
ax[2].plot(df1['F_D1_fail'], lw=5, color=cl[1])
ax[2].set_ylabel('DHI')
ax[2].set_xlabel('Date')
ax[2].text(dt.datetime(2019, 1, 1, 5, 30, 0), 1350, 'T3')
ax[2].text(dt.datetime(2019, 1, 29, 12, 0, 0), 1350, "Failed: %s" %df1['F_D1_fail'].count())
fig.subplots_adjust(wspace=0, hspace=0)
plt.savefig('PhysicalTests_DAA.png', bbox_inches='tight', format='png', dpi=600)
def press_temp(df):
#rcParams['figure.figsize'] = 20, 2
#fig, ax = plt.subplots(2, 1)
df['year'] = df.index.year
piv = pd.pivot_table(df, index=['doy'], columns=['year'], values=['T'])
piv.plot()
piv = pd.pivot_table(df, index=['doy'], columns=['year'], values=['P'])
piv.plot()
#ax.plot(piv)
#ax.legend()
| 37.965812
| 96
| 0.589374
| 764
| 4,442
| 3.362565
| 0.205497
| 0.019852
| 0.087193
| 0.093422
| 0.773063
| 0.766057
| 0.766057
| 0.719346
| 0.719346
| 0.719346
| 0
| 0.120746
| 0.179649
| 4,442
| 116
| 97
| 38.293103
| 0.584248
| 0.089149
| 0
| 0.589041
| 0
| 0
| 0.160834
| 0.011169
| 0
| 0
| 0
| 0
| 0
| 1
| 0.054795
| false
| 0
| 0.09589
| 0
| 0.150685
| 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
|
0406e85a6e0d580f5b96996c601e636eebb5c3b1
| 276
|
py
|
Python
|
dbsg/plugins/__init__.py
|
jjj4x/dbsg
|
c7379883e9f68453740ccfc21f49f4d2eaa8dc25
|
[
"Apache-2.0"
] | null | null | null |
dbsg/plugins/__init__.py
|
jjj4x/dbsg
|
c7379883e9f68453740ccfc21f49f4d2eaa8dc25
|
[
"Apache-2.0"
] | null | null | null |
dbsg/plugins/__init__.py
|
jjj4x/dbsg
|
c7379883e9f68453740ccfc21f49f4d2eaa8dc25
|
[
"Apache-2.0"
] | null | null | null |
"""
All the standard plugins.
Importing the package all the plugins will be auto-registered.
"""
from dbsg.plugins.json_plugin import JSONPlugin
from dbsg.plugins.python3_7_plugin import Python37Plugin
from dbsg.plugins.raw_introspection_plugin import RAWIntrospectionPlugin
| 30.666667
| 72
| 0.844203
| 37
| 276
| 6.162162
| 0.594595
| 0.105263
| 0.197368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016129
| 0.101449
| 276
| 8
| 73
| 34.5
| 0.903226
| 0.322464
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 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
|
040d9e152654985493c2f8ebacc66261f4dae5e2
| 153
|
py
|
Python
|
pygsuite/docs/footers.py
|
gitter-badger/pygsuite
|
536766c36f653edbc7585141f1c3327f508e19da
|
[
"MIT"
] | null | null | null |
pygsuite/docs/footers.py
|
gitter-badger/pygsuite
|
536766c36f653edbc7585141f1c3327f508e19da
|
[
"MIT"
] | null | null | null |
pygsuite/docs/footers.py
|
gitter-badger/pygsuite
|
536766c36f653edbc7585141f1c3327f508e19da
|
[
"MIT"
] | null | null | null |
class Footers(object):
def __init__(self, footers: dict, document):
# TODO
self._footers = footers
self._document = document
| 25.5
| 48
| 0.627451
| 16
| 153
| 5.625
| 0.5625
| 0.244444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.281046
| 153
| 5
| 49
| 30.6
| 0.818182
| 0.026144
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
04397be770313179dfdda0b4a967450bb1be6e88
| 31
|
py
|
Python
|
digipathos/__init__.py
|
bresan/digipathos_plant_pathology
|
fab70cb42e1ee8e32ec76ad04126b299d1ef3d9f
|
[
"MIT"
] | 25
|
2020-02-05T11:17:01.000Z
|
2020-05-25T20:36:12.000Z
|
digipathos/__init__.py
|
bresan/digipathos_plant_pathology
|
fab70cb42e1ee8e32ec76ad04126b299d1ef3d9f
|
[
"MIT"
] | 1
|
2020-09-19T09:18:26.000Z
|
2020-09-19T09:18:26.000Z
|
digipathos/__init__.py
|
bresan/digipathos_plant_pathology
|
fab70cb42e1ee8e32ec76ad04126b299d1ef3d9f
|
[
"MIT"
] | 7
|
2020-07-15T04:07:40.000Z
|
2021-02-20T10:37:47.000Z
|
# import digipathos.cli.browser
| 31
| 31
| 0.83871
| 4
| 31
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.064516
| 31
| 1
| 31
| 31
| 0.896552
| 0.935484
| 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
|
f0a425084682c4fbfb7d4618e35b79edca2c5bfb
| 186
|
py
|
Python
|
src/graph_transpiler/webdnn/backend/fallback/kernels/sqrt.py
|
urantialife/webdnn
|
dedc5da424288594cdfa605a015ddc7a3afcf2b7
|
[
"MIT"
] | 1
|
2021-04-09T15:55:35.000Z
|
2021-04-09T15:55:35.000Z
|
src/graph_transpiler/webdnn/backend/fallback/kernels/sqrt.py
|
urantialife/webdnn
|
dedc5da424288594cdfa605a015ddc7a3afcf2b7
|
[
"MIT"
] | null | null | null |
src/graph_transpiler/webdnn/backend/fallback/kernels/sqrt.py
|
urantialife/webdnn
|
dedc5da424288594cdfa605a015ddc7a3afcf2b7
|
[
"MIT"
] | null | null | null |
from webdnn.backend.fallback.kernels.elementwise import register_elementwise_kernel
from webdnn.graph.operators.sqrt import Sqrt
register_elementwise_kernel(Sqrt, "y = Math.sqrt(x0);")
| 37.2
| 83
| 0.83871
| 25
| 186
| 6.08
| 0.6
| 0.131579
| 0.328947
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00578
| 0.069892
| 186
| 4
| 84
| 46.5
| 0.872832
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f0ce895bc96f447fd39a0b5b1430e6d8c7510e6a
| 27
|
py
|
Python
|
flask_request_arg/__init__.py
|
Martlark/flask-request-arg
|
d6694beb0fa9d39ca93728a4e3b9391c07e4b013
|
[
"Apache-2.0"
] | null | null | null |
flask_request_arg/__init__.py
|
Martlark/flask-request-arg
|
d6694beb0fa9d39ca93728a4e3b9391c07e4b013
|
[
"Apache-2.0"
] | null | null | null |
flask_request_arg/__init__.py
|
Martlark/flask-request-arg
|
d6694beb0fa9d39ca93728a4e3b9391c07e4b013
|
[
"Apache-2.0"
] | null | null | null |
from .request_arg import *
| 13.5
| 26
| 0.777778
| 4
| 27
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 27
| 1
| 27
| 27
| 0.869565
| 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
|
0b1910e46b068e97be9b9a730f8ab47ae27896ad
| 68
|
py
|
Python
|
apps/characters/models/__init__.py
|
Sult/daf
|
a4da9e8c96f70577e2490c05e82bdf7d0de1a563
|
[
"MIT"
] | null | null | null |
apps/characters/models/__init__.py
|
Sult/daf
|
a4da9e8c96f70577e2490c05e82bdf7d0de1a563
|
[
"MIT"
] | null | null | null |
apps/characters/models/__init__.py
|
Sult/daf
|
a4da9e8c96f70577e2490c05e82bdf7d0de1a563
|
[
"MIT"
] | null | null | null |
from .characters import *
from .skills import *
from .misc import *
| 17
| 25
| 0.735294
| 9
| 68
| 5.555556
| 0.555556
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 68
| 3
| 26
| 22.666667
| 0.892857
| 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
|
9bde0210672871d7ee2f66ffbf2f4b459713d3f2
| 128
|
py
|
Python
|
Tr4PrFnPredLib/tokenizer/Tokenizer.py
|
Tr4PrFnPred/TransformerProteinFunctionPredLib
|
115dd4105631f96e05409fd9e7f6186ecb5df898
|
[
"MIT"
] | 1
|
2021-04-13T21:03:10.000Z
|
2021-04-13T21:03:10.000Z
|
Tr4PrFnPredLib/tokenizer/Tokenizer.py
|
Tr4PrFnPred/TransformerProteinFunctionPredLib
|
115dd4105631f96e05409fd9e7f6186ecb5df898
|
[
"MIT"
] | 1
|
2021-04-13T22:27:45.000Z
|
2021-04-13T22:27:45.000Z
|
Tr4PrFnPredLib/tokenizer/Tokenizer.py
|
Tr4PrFnPred/Tr4PrFnPredLib
|
115dd4105631f96e05409fd9e7f6186ecb5df898
|
[
"MIT"
] | null | null | null |
from abc import ABC, abstractmethod
class Tokenizer(ABC):
@abstractmethod
def tokenize(self, sequence):
pass
| 14.222222
| 35
| 0.6875
| 14
| 128
| 6.285714
| 0.785714
| 0.386364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.242188
| 128
| 8
| 36
| 16
| 0.907216
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
5004f03a18ba7d558186e8658cb7b71d9925ea43
| 129
|
py
|
Python
|
src/tokens/__init__.py
|
thelennylord/yamu
|
60c7130278cde696561b3de1c997f8e843ecc116
|
[
"MIT"
] | null | null | null |
src/tokens/__init__.py
|
thelennylord/yamu
|
60c7130278cde696561b3de1c997f8e843ecc116
|
[
"MIT"
] | null | null | null |
src/tokens/__init__.py
|
thelennylord/yamu
|
60c7130278cde696561b3de1c997f8e843ecc116
|
[
"MIT"
] | null | null | null |
from .indentation_token import IndentationToken
from .literal_token import LiteralToken
from .redirect_token import RedirectToken
| 43
| 47
| 0.891473
| 15
| 129
| 7.466667
| 0.6
| 0.294643
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085271
| 129
| 3
| 48
| 43
| 0.949153
| 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
|
500e4bea0a2b75bda57c4efaebce3f226d71cada
| 213
|
py
|
Python
|
balebot/filters/photo_filter.py
|
ehsanbarkhordar/reminder_bot
|
c72e664c71658dd2ec30bb610ffc836b53f000b9
|
[
"MIT"
] | null | null | null |
balebot/filters/photo_filter.py
|
ehsanbarkhordar/reminder_bot
|
c72e664c71658dd2ec30bb610ffc836b53f000b9
|
[
"MIT"
] | null | null | null |
balebot/filters/photo_filter.py
|
ehsanbarkhordar/reminder_bot
|
c72e664c71658dd2ec30bb610ffc836b53f000b9
|
[
"MIT"
] | null | null | null |
from balebot.models.messages.photo_message import PhotoMessage
from balebot.filters.filter import Filter
class PhotoFilter(Filter):
def match(self, message):
return isinstance(message, PhotoMessage)
| 26.625
| 62
| 0.788732
| 25
| 213
| 6.68
| 0.68
| 0.131737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.140845
| 213
| 7
| 63
| 30.428571
| 0.912568
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0.2
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
50257186174d8f0f0f336694e7a9860a20a73227
| 45
|
py
|
Python
|
src/functions/authorizers/slack/authorizer.py
|
brysontyrrell/Jackalope-Serverless
|
502ef727db4492f1a471b1dbeae7431a31705ce4
|
[
"MIT"
] | null | null | null |
src/functions/authorizers/slack/authorizer.py
|
brysontyrrell/Jackalope-Serverless
|
502ef727db4492f1a471b1dbeae7431a31705ce4
|
[
"MIT"
] | null | null | null |
src/functions/authorizers/slack/authorizer.py
|
brysontyrrell/Jackalope-Serverless
|
502ef727db4492f1a471b1dbeae7431a31705ce4
|
[
"MIT"
] | null | null | null |
def lambda_handler(event, context):
pass
| 15
| 35
| 0.733333
| 6
| 45
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177778
| 45
| 2
| 36
| 22.5
| 0.864865
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 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
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
503ae58c08283cd5aafe01089de3a24516fb4f79
| 77
|
py
|
Python
|
divmachines/topk/lfp/__init__.py
|
DanielMorales9/FactorizationPyTorch
|
50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
|
[
"MIT"
] | 4
|
2017-12-14T22:34:35.000Z
|
2019-07-12T17:18:34.000Z
|
divmachines/topk/lfp/__init__.py
|
DanielMorales9/FactorizationPyTorch
|
50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
|
[
"MIT"
] | null | null | null |
divmachines/topk/lfp/__init__.py
|
DanielMorales9/FactorizationPyTorch
|
50f0644fdb4a903550fb3f1ba78fb9fb8649ceb1
|
[
"MIT"
] | 1
|
2017-12-14T22:35:00.000Z
|
2017-12-14T22:35:00.000Z
|
from .mf import MF_LFP
from .fm import FM_LFP
__all__ = ['MF_LFP', 'FM_LFP']
| 19.25
| 30
| 0.714286
| 15
| 77
| 3.133333
| 0.4
| 0.212766
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155844
| 77
| 4
| 30
| 19.25
| 0.723077
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
503c364e1d372de082dd176caaf7aad5697dd0c1
| 245
|
py
|
Python
|
website/maintenance/admin/maintenance_provider.py
|
JobDoesburg/landolfio
|
4cbf31c2e6f93745f5aa0d20893bf20f3acecc6e
|
[
"MIT"
] | 1
|
2021-02-24T14:33:09.000Z
|
2021-02-24T14:33:09.000Z
|
website/maintenance/admin/maintenance_provider.py
|
JobDoesburg/landolfio
|
4cbf31c2e6f93745f5aa0d20893bf20f3acecc6e
|
[
"MIT"
] | 2
|
2022-01-13T04:03:38.000Z
|
2022-03-12T01:03:10.000Z
|
website/maintenance/admin/maintenance_provider.py
|
JobDoesburg/landolfio
|
4cbf31c2e6f93745f5aa0d20893bf20f3acecc6e
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from maintenance.models import MaintenanceProvider
@admin.register(MaintenanceProvider)
class AssetMaintenanceTicketAdmin(admin.ModelAdmin):
class Media:
"""Necessary to use AutocompleteFilter."""
| 24.5
| 52
| 0.795918
| 23
| 245
| 8.478261
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130612
| 245
| 9
| 53
| 27.222222
| 0.915493
| 0.146939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
ac8fb0a3485e44d61352b2ab0d7fd88199adf3d6
| 207
|
py
|
Python
|
tests/test_syntax.py
|
PrVrSs/pywebidl2
|
4f4d541495c4734b9e3f096fb409f1165b213bc2
|
[
"MIT"
] | 2
|
2020-06-16T11:39:36.000Z
|
2022-03-01T11:55:59.000Z
|
tests/test_syntax.py
|
PrVrSs/pywebidl2
|
4f4d541495c4734b9e3f096fb409f1165b213bc2
|
[
"MIT"
] | null | null | null |
tests/test_syntax.py
|
PrVrSs/pywebidl2
|
4f4d541495c4734b9e3f096fb409f1165b213bc2
|
[
"MIT"
] | null | null | null |
import json
from pywebidl2 import pretty_parse
def test_syntax(syntax_fixture):
with syntax_fixture.baseline.open() as expected:
assert pretty_parse(syntax_fixture.idl) == json.load(expected)
| 23
| 70
| 0.772947
| 28
| 207
| 5.5
| 0.642857
| 0.253247
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005682
| 0.149758
| 207
| 8
| 71
| 25.875
| 0.869318
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
aca93251cac59a6b9706bee9e2ed6d4360ea69ec
| 83
|
py
|
Python
|
atlas/scripts/utils/__init__.py
|
Leitemfa/atlas
|
59da38f63bb9f40ab0cf4b96fbc787b68ebecd7c
|
[
"BSD-3-Clause"
] | null | null | null |
atlas/scripts/utils/__init__.py
|
Leitemfa/atlas
|
59da38f63bb9f40ab0cf4b96fbc787b68ebecd7c
|
[
"BSD-3-Clause"
] | null | null | null |
atlas/scripts/utils/__init__.py
|
Leitemfa/atlas
|
59da38f63bb9f40ab0cf4b96fbc787b68ebecd7c
|
[
"BSD-3-Clause"
] | 1
|
2019-12-18T03:02:09.000Z
|
2019-12-18T03:02:09.000Z
|
from . import parsers_bbmap, parsers_checkm
from .utils import gen_names_for_range
| 27.666667
| 43
| 0.855422
| 13
| 83
| 5.076923
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 83
| 2
| 44
| 41.5
| 0.891892
| 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
|
acc79a39fdb73350e374677050dcfea577ff0e19
| 83
|
py
|
Python
|
spideroptic/bootstrap.py
|
fearless-spider/spideroptic-cli
|
f74b88ae9eeafa8a11e2b94c64b847f39792c0bb
|
[
"BSD-3-Clause"
] | 7
|
2019-05-17T06:56:37.000Z
|
2022-03-18T16:54:48.000Z
|
spideroptic/bootstrap.py
|
fearless-spider/spideroptic-cli
|
f74b88ae9eeafa8a11e2b94c64b847f39792c0bb
|
[
"BSD-3-Clause"
] | 5
|
2018-12-07T13:06:35.000Z
|
2019-12-13T15:32:51.000Z
|
spideroptic/bootstrap.py
|
fearless-spider/spideroptic-cli
|
f74b88ae9eeafa8a11e2b94c64b847f39792c0bb
|
[
"BSD-3-Clause"
] | 9
|
2019-08-22T06:15:39.000Z
|
2021-10-04T09:08:50.000Z
|
from .controllers.base import Base
def load(app):
app.handler.register(Base)
| 13.833333
| 34
| 0.73494
| 12
| 83
| 5.083333
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156627
| 83
| 5
| 35
| 16.6
| 0.871429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
acd1d0933bd96f2c1b17e538e3b170a245d00e13
| 41
|
py
|
Python
|
src/back/tests/__init__.py
|
khamidou/kite
|
c049faf8522c8346c22c70f2a35a35db6b4a155d
|
[
"BSD-3-Clause"
] | 136
|
2015-01-06T01:14:35.000Z
|
2022-01-20T17:04:52.000Z
|
src/back/tests/__init__.py
|
marufsiddiqui/kite
|
6cc1c644c6101f3b076969ad2c732842ed71f09b
|
[
"BSD-3-Clause"
] | 3
|
2016-01-14T21:37:10.000Z
|
2019-04-17T02:44:08.000Z
|
src/back/tests/__init__.py
|
marufsiddiqui/kite
|
6cc1c644c6101f3b076969ad2c732842ed71f09b
|
[
"BSD-3-Clause"
] | 38
|
2015-02-28T14:12:26.000Z
|
2021-01-17T21:01:02.000Z
|
# used to debug interactively unit tests
| 20.5
| 40
| 0.804878
| 6
| 41
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170732
| 41
| 1
| 41
| 41
| 0.970588
| 0.926829
| 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
|
ace6055aa6b589b4cb0439e022e237fc508d62c5
| 261
|
py
|
Python
|
apps/methodologies/admin.py
|
l3l3l/vulnman
|
f9d520dbf9f6838c459741bb1173a0382d5ecfd6
|
[
"MIT"
] | null | null | null |
apps/methodologies/admin.py
|
l3l3l/vulnman
|
f9d520dbf9f6838c459741bb1173a0382d5ecfd6
|
[
"MIT"
] | null | null | null |
apps/methodologies/admin.py
|
l3l3l/vulnman
|
f9d520dbf9f6838c459741bb1173a0382d5ecfd6
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from apps.methodologies import models
# Register your models here.
admin.site.register(models.Methodology)
admin.site.register(models.Task)
admin.site.register(models.ProjectMethodology)
admin.site.register(models.ProjectTask)
| 29
| 46
| 0.83908
| 34
| 261
| 6.441176
| 0.470588
| 0.164384
| 0.310502
| 0.420091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 261
| 8
| 47
| 32.625
| 0.901235
| 0.099617
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 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
|
4a0583c081927bd3e331b829d8c6926f68fb849b
| 138
|
py
|
Python
|
lib/egauge/constants.py
|
goztrk/django-htk
|
c56bf112e5d627780d2f4288460eae5cce80fa9e
|
[
"MIT"
] | 206
|
2015-10-15T07:05:08.000Z
|
2021-02-19T11:48:36.000Z
|
lib/egauge/constants.py
|
goztrk/django-htk
|
c56bf112e5d627780d2f4288460eae5cce80fa9e
|
[
"MIT"
] | 8
|
2017-10-16T10:18:31.000Z
|
2022-03-09T14:24:27.000Z
|
lib/egauge/constants.py
|
goztrk/django-htk
|
c56bf112e5d627780d2f4288460eae5cce80fa9e
|
[
"MIT"
] | 61
|
2015-10-15T08:12:44.000Z
|
2022-03-10T12:25:06.000Z
|
EGAUGE_API_URLS = {
'stored' : 'http://%s.egaug.es/cgi-bin/egauge-show',
'instantaneous' : 'http://%s.egaug.es/cgi-bin/egauge',
}
| 27.6
| 58
| 0.623188
| 20
| 138
| 4.2
| 0.6
| 0.119048
| 0.238095
| 0.285714
| 0.571429
| 0.571429
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0.130435
| 138
| 4
| 59
| 34.5
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0.652174
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
c5d126936a264cd6702b646ce0d614e0c82ac2ab
| 40
|
py
|
Python
|
{{cookiecutter.proj}}/settings.py
|
ruffyleaf/py-crisp
|
95cca5828f336fecee39e4f9c17e7abf7baf4fbd
|
[
"MIT"
] | 11
|
2016-06-23T03:59:12.000Z
|
2018-12-06T04:14:16.000Z
|
{{cookiecutter.proj}}/settings.py
|
ruffyleaf/py-crisp
|
95cca5828f336fecee39e4f9c17e7abf7baf4fbd
|
[
"MIT"
] | null | null | null |
{{cookiecutter.proj}}/settings.py
|
ruffyleaf/py-crisp
|
95cca5828f336fecee39e4f9c17e7abf7baf4fbd
|
[
"MIT"
] | 4
|
2015-08-28T08:59:49.000Z
|
2021-11-30T08:04:44.000Z
|
# Put all Project related settings here
| 20
| 39
| 0.8
| 6
| 40
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175
| 40
| 1
| 40
| 40
| 0.969697
| 0.925
| 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
|
c5de6d7f57dedae890f903baa2e66d6bd6753612
| 92
|
py
|
Python
|
manyq/__init__.py
|
exaQ-ai/manyQ
|
d943fc76d8ba1f858193fd4a1cd338b090252b5d
|
[
"Apache-2.0"
] | null | null | null |
manyq/__init__.py
|
exaQ-ai/manyQ
|
d943fc76d8ba1f858193fd4a1cd338b090252b5d
|
[
"Apache-2.0"
] | null | null | null |
manyq/__init__.py
|
exaQ-ai/manyQ
|
d943fc76d8ba1f858193fd4a1cd338b090252b5d
|
[
"Apache-2.0"
] | null | null | null |
from .manyq import Qreg, initQreg, runQ, measureAll, makeShots, H, CX, CZ,RZ,SX,X,Z, fSIM,IN
| 92
| 92
| 0.728261
| 17
| 92
| 3.941176
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119565
| 92
| 1
| 92
| 92
| 0.82716
| 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
|
c5f7ce6b519ce0b6d61d1e34078d101c9b87a389
| 964
|
py
|
Python
|
tests/__init__.py
|
mandagill/WAUnit
|
cf8d3612ccbe0889b9cd4bdf6cd0a7785d04cc9c
|
[
"Apache-2.0"
] | 8
|
2016-03-18T06:21:02.000Z
|
2020-07-17T09:14:18.000Z
|
tests/__init__.py
|
mandagill/WAUnit
|
cf8d3612ccbe0889b9cd4bdf6cd0a7785d04cc9c
|
[
"Apache-2.0"
] | 5
|
2016-08-09T03:39:42.000Z
|
2020-04-26T21:46:17.000Z
|
tests/__init__.py
|
mandagill/WAUnit
|
cf8d3612ccbe0889b9cd4bdf6cd0a7785d04cc9c
|
[
"Apache-2.0"
] | 5
|
2017-01-30T18:54:10.000Z
|
2020-03-15T12:26:49.000Z
|
# Copyright (c) 2016 Joao Correia. All rights reserved.
#
# This program is licensed to you under the Apache License Version 2.0,
# and you may not use this file except in compliance with the Apache License Version 2.0.
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the Apache License Version 2.0 is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
#
# Version: 0.1.0
# URL: -
#
# Authors: Joao Correia <joao.correia@gmail.com> https://joaocorreia.io
# Copyright: Copyright (c) 2016 Joao Correia
# License: Apache License Version 2.0
from waunit_parsers import *
from waunit_utils import *
from proxy_server import *
| 43.818182
| 113
| 0.75
| 152
| 964
| 4.736842
| 0.552632
| 0.019444
| 0.166667
| 0.175
| 0.2875
| 0.1875
| 0.083333
| 0
| 0
| 0
| 0
| 0.031606
| 0.179461
| 964
| 21
| 114
| 45.904762
| 0.878635
| 0.876556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c5fc229929a1e0b2ddc52bd4ccbc5c9e1a06a53b
| 207
|
py
|
Python
|
todolist/admin.py
|
yusukhobok/TodoAPI
|
9f9d93b54cfe3c841dbe2de91798c5e6a28c7edf
|
[
"MIT"
] | null | null | null |
todolist/admin.py
|
yusukhobok/TodoAPI
|
9f9d93b54cfe3c841dbe2de91798c5e6a28c7edf
|
[
"MIT"
] | 6
|
2020-06-05T20:06:44.000Z
|
2021-09-22T18:08:06.000Z
|
todolist/admin.py
|
Yus27/TodoAPI
|
1308aeac356b2168cec02045aa6774b16443d17b
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Todo, Category
# from rest_framework.authtoken.models import Token
admin.site.register(Todo)
admin.site.register(Category)
# admin.site.register(Token)
| 23
| 51
| 0.811594
| 29
| 207
| 5.758621
| 0.482759
| 0.161677
| 0.305389
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096618
| 207
| 8
| 52
| 25.875
| 0.893048
| 0.36715
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
680b65f11bc89af5a0393872911fedd8f84c0f95
| 7,719
|
py
|
Python
|
proper_forms/validators.py
|
jpsca/pforms
|
77c9da93e5224e79bb147aa873f28951e972bb21
|
[
"MIT"
] | 2
|
2020-09-30T22:41:00.000Z
|
2020-12-04T16:47:17.000Z
|
proper_forms/validators.py
|
jpsca/hyperform
|
d5c450ad8684a853fed26f8c2606877151125a9e
|
[
"MIT"
] | 2
|
2021-11-18T18:01:28.000Z
|
2021-11-18T18:03:29.000Z
|
proper_forms/validators.py
|
jpsca/hyperform
|
d5c450ad8684a853fed26f8c2606877151125a9e
|
[
"MIT"
] | null | null | null |
import datetime
from itertools import groupby
__all__ = (
"After",
"AfterNow",
"Before",
"BeforeNow",
"Confirmed",
"InRange",
"LessThan",
"LongerThan",
"MoreThan",
"ShorterThan",
)
def validate_values(values, test, message):
for value in values:
if not test(value):
return False, message
return True
class After(object):
"""Validates than the date happens after another.
date (date|datetime):
The soonest valid date.
message (str):
Error message to raise in case of a validation error.
"""
message = "Enter a valid date after %s."
def __init__(self, dt, message=None):
assert isinstance(dt, datetime.date)
if not isinstance(dt, datetime.datetime):
dt = datetime.datetime(dt.year, dt.month, dt.day)
self.dt = dt
if message is None:
message = self.message % "{}-{:02d}-{:02d}".format(
dt.year, dt.month, dt.day
)
self.message = message
def __call__(self, values):
def test(value):
assert isinstance(value, datetime.date)
if not isinstance(value, datetime.datetime):
value = datetime.datetime(value.year, value.month, value.day)
return value >= self.dt
return validate_values(values, test, self.message)
class AfterNow(object):
"""Validates than the date happens after now.
This will work with both date and datetime values.
message (str):
Error message to raise in case of a validation error.
"""
message = "Enter a valid date in the future."
def __init__(self, message=None):
if message is not None:
self.message = message
def __call__(self, values):
v = After(datetime.datetime.utcnow(), self.message)
return v(values)
class Before(object):
"""Validates than the date happens before another.
date (date|datetime):
The latest valid date.
message (str):
Error message to raise in case of a validation error.
"""
message = "Enter a valid date before %s."
def __init__(self, dt, message=None):
assert isinstance(dt, datetime.date)
if not isinstance(dt, datetime.datetime):
dt = datetime.datetime(dt.year, dt.month, dt.day)
self.dt = dt
if message is None:
message = self.message % "{}-{:02d}-{:02d}".format(
dt.year, dt.month, dt.day
)
self.message = message
def __call__(self, values):
def test(value):
assert isinstance(value, datetime.date)
if not isinstance(value, datetime.datetime):
value = datetime.datetime(value.year, value.month, value.day)
return value <= self.dt
return validate_values(values, test, self.message)
class BeforeNow(object):
"""Validates than the date happens before now.
This will work with both date and datetime values.
message (str):
Error message to raise in case of a validation error.
"""
message = "Enter a valid date in the past."
def __init__(self, message=None):
if message is not None:
self.message = message
def __call__(self, values):
v = Before(datetime.datetime.utcnow(), self.message)
return v(values)
class Confirmed(object):
"""Validates that a value is identical every time has been repeated.
Classic use is for password confirmation fields.
message (str):
Error message to raise in case of a validation error.
"""
message = "Values doesn't match."
def __init__(self, message=None):
if message is not None:
self.message = message
def __call__(self, values):
if len(values) < 2:
return False
g = groupby(values)
if next(g, True) and not next(g, False):
return True
return False, self.message
class InRange(object):
"""Validates that a value is between a minimum and maximum value.
This will work with integers, floats, decimals and strings.
minval (int|float):
The minimum value acceptable.
maxval (int|float):
The maximum value acceptable.
message (str):
Error message to raise in case of a validation error.
"""
message = "Number must be between %s and %s."
def __init__(self, minval, maxval, message=None):
self.minval = minval
self.maxval = maxval
if message is None:
message = self.message % (minval, maxval)
self.message = message
def __call__(self, values):
def test(value):
if value < self.minval:
return False
if value > self.maxval:
return False
return True
return validate_values(values, test, self.message)
class LessThan(object):
"""Validates that a value is less or equal than another.
This will work with integers, floats, decimals and strings.
value (int|float):
The maximum value acceptable.
message (str):
Error message to raise in case of a validation error.
"""
message = "Number must be less than %s."
def __init__(self, value, message=None):
self.value = value
if message is None:
message = self.message % (value,)
self.message = message
def __call__(self, values):
def test(value):
return value <= self.value
return validate_values(values, test, self.message)
class LongerThan(object):
"""Validates the length of a value is longer or equal than minimum.
length (int):
The minimum required length of the value.
message (str):
Error message to raise in case of a validation error.
"""
message = "Field must be at least %s character long."
def __init__(self, length, message=None):
assert isinstance(length, int)
self.length = length
if message is None:
message = self.message % (length,)
self.message = message
def __call__(self, values):
def test(value):
return len(value) >= self.length
return validate_values(values, test, self.message)
class MoreThan(object):
"""Validates that a value is greater or equal than another.
This will work with any integers, floats, decimals and strings.
value (int|float):
The minimum value acceptable.
message (str):
Error message to raise in case of a validation error.
"""
message = "Number must be greater than %s."
def __init__(self, value, message=None):
self.value = value
if message is None:
message = self.message % (value,)
self.message = message
def __call__(self, values):
def test(value):
return value >= self.value
return validate_values(values, test, self.message)
class ShorterThan(object):
"""Validates the length of a value is shorter or equal than maximum.
length (int):
The maximum allowed length of the value.
message (str):
Error message to raise in case of a validation error.
"""
message = "Field cannot be longer than %s characters."
def __init__(self, length, message=None):
assert isinstance(length, int)
self.length = length
if message is None:
message = self.message % (length,)
self.message = message
def __call__(self, values):
def test(value):
return len(value) <= self.length
return validate_values(values, test, self.message)
| 25.989899
| 77
| 0.609924
| 949
| 7,719
| 4.864067
| 0.131718
| 0.07149
| 0.032496
| 0.04766
| 0.800693
| 0.789428
| 0.757366
| 0.716854
| 0.679809
| 0.625433
| 0
| 0.001664
| 0.299132
| 7,719
| 296
| 78
| 26.077703
| 0.851571
| 0.267781
| 0
| 0.605442
| 0
| 0
| 0.08
| 0
| 0
| 0
| 0
| 0
| 0.040816
| 1
| 0.190476
| false
| 0
| 0.013605
| 0.027211
| 0.496599
| 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
|
a83a7e4aa4ec5d133358995b84263448d54bb2db
| 145
|
py
|
Python
|
CondTools/RPC/python/RPCCPPFLinkMapPopConAnalyzer_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 852
|
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
CondTools/RPC/python/RPCCPPFLinkMapPopConAnalyzer_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 30,371
|
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
CondTools/RPC/python/RPCCPPFLinkMapPopConAnalyzer_cff.py
|
ckamtsikis/cmssw
|
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
|
[
"Apache-2.0"
] | 3,240
|
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
import FWCore.ParameterSet.Config as cms
from CondCore.CondDB.CondDB_cfi import *
from CondTools.RPC.RPCCPPFLinkMapPopConAnalyzer_cfi import *
| 24.166667
| 60
| 0.848276
| 18
| 145
| 6.722222
| 0.722222
| 0.14876
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096552
| 145
| 5
| 61
| 29
| 0.923664
| 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
|
a866a8df7c8e75398b25280778b61aa641c36f5f
| 49
|
py
|
Python
|
model/__init__.py
|
massquantity/DNN-implementation
|
bca336749a2076fa2873f57d9c2b6f98ebf18a0d
|
[
"MIT"
] | null | null | null |
model/__init__.py
|
massquantity/DNN-implementation
|
bca336749a2076fa2873f57d9c2b6f98ebf18a0d
|
[
"MIT"
] | null | null | null |
model/__init__.py
|
massquantity/DNN-implementation
|
bca336749a2076fa2873f57d9c2b6f98ebf18a0d
|
[
"MIT"
] | null | null | null |
from .Network import Network, Network_mini_batch
| 24.5
| 48
| 0.857143
| 7
| 49
| 5.714286
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102041
| 49
| 1
| 49
| 49
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
a87bff55e0954c4f02368ff0a12cc1c96d24dad6
| 350
|
py
|
Python
|
tests/__init__.py
|
vishalbelsare/flexsolve
|
bbce46636b4498f5cb651a2bd1f8dc2c054ad72d
|
[
"MIT"
] | 10
|
2020-04-02T05:28:41.000Z
|
2022-03-07T23:31:32.000Z
|
tests/__init__.py
|
vishalbelsare/flexsolve
|
bbce46636b4498f5cb651a2bd1f8dc2c054ad72d
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
vishalbelsare/flexsolve
|
bbce46636b4498f5cb651a2bd1f8dc2c054ad72d
|
[
"MIT"
] | 2
|
2020-07-21T14:22:36.000Z
|
2020-08-20T19:16:12.000Z
|
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 12:38:20 2020
@author: yrc2
"""
import pytest
from .test_fixedpoint_array_solvers import test_fixedpoint_array_solvers
from .test_scalar_solvers import test_scalar_solvers
@pytest.mark.skip(reason="Runs all tests")
def test_flexsolve():
test_fixedpoint_array_solvers()
test_scalar_solvers()
| 25
| 72
| 0.777143
| 51
| 350
| 5.019608
| 0.588235
| 0.164063
| 0.222656
| 0.304688
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 0.12
| 350
| 14
| 73
| 25
| 0.785714
| 0.208571
| 0
| 0
| 0
| 0
| 0.051852
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| true
| 0
| 0.428571
| 0
| 0.571429
| 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
|
a8a5c04d536a65db5ca4c011aa6d67e5bb28da85
| 178
|
py
|
Python
|
wsgi_dogfood.py
|
jinjiaho/project57
|
32fdefa42b0a220efb0b7ca6552150f8d4c56c88
|
[
"MIT"
] | null | null | null |
wsgi_dogfood.py
|
jinjiaho/project57
|
32fdefa42b0a220efb0b7ca6552150f8d4c56c88
|
[
"MIT"
] | 7
|
2020-03-24T15:38:55.000Z
|
2022-01-13T00:42:41.000Z
|
wsgi_dogfood.py
|
jinjiaho/project57
|
32fdefa42b0a220efb0b7ca6552150f8d4c56c88
|
[
"MIT"
] | 1
|
2017-10-03T09:40:20.000Z
|
2017-10-03T09:40:20.000Z
|
from application import application
if __name__ == '__main__':
application.config.from_object('config.Config')
application.config.from_pyfile('dogfood.py')
application.run()
| 25.428571
| 48
| 0.792135
| 21
| 178
| 6.238095
| 0.571429
| 0.259542
| 0.320611
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08427
| 178
| 6
| 49
| 29.666667
| 0.803681
| 0
| 0
| 0
| 0
| 0
| 0.174157
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.2
| 0
| 0.2
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
769090cd77258937ae713ec4a7fe4fdc08215ffe
| 238
|
py
|
Python
|
credentials.py
|
jeffsgrover/twitter-bot-python-heroku
|
ad3d637afb5e45bb356d16f8ac66aab627e2846b
|
[
"MIT"
] | null | null | null |
credentials.py
|
jeffsgrover/twitter-bot-python-heroku
|
ad3d637afb5e45bb356d16f8ac66aab627e2846b
|
[
"MIT"
] | null | null | null |
credentials.py
|
jeffsgrover/twitter-bot-python-heroku
|
ad3d637afb5e45bb356d16f8ac66aab627e2846b
|
[
"MIT"
] | null | null | null |
CONSUMER_KEY= '107M6FEPg8nJYe4VGOq6GYFpi'
CONSUMER_SECRET= 'UN5eZUbv4s3uMU6XymncY1ZgRNaOqoP4t9mSmVH8XwB6DXwPvi'
ACCESS_KEY='1491446054675525637-aNTtW6SoFA4gK2tptrhjdwUQJ78Kaq'
ACCESS_SECRET= 'yoS7owUAzAFPrjOoYxmzeZkOKac0OdDohUIg4snIzhNB9'
| 59.5
| 69
| 0.920168
| 13
| 238
| 16.538462
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189655
| 0.02521
| 238
| 4
| 70
| 59.5
| 0.737069
| 0
| 0
| 0
| 0
| 0
| 0.711297
| 0.711297
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
76c98732dd63e56d4e5840348f3c3a1706a8f12b
| 569
|
py
|
Python
|
errors/handlers.py
|
sigma5710/python-flaskblog
|
50de7cd02db90a5822e8f0810ac42540be9a0ed2
|
[
"MIT"
] | null | null | null |
errors/handlers.py
|
sigma5710/python-flaskblog
|
50de7cd02db90a5822e8f0810ac42540be9a0ed2
|
[
"MIT"
] | null | null | null |
errors/handlers.py
|
sigma5710/python-flaskblog
|
50de7cd02db90a5822e8f0810ac42540be9a0ed2
|
[
"MIT"
] | null | null | null |
from flask import Blueprint, render_template
errors = Blueprint('errors', __name__)
# 'app_errorhandler' decorator applies to the entire application
# instead of just working on this blueprint
@errors.app_errorhandler(404)
def error_404(error):
# return 2 values
# 2nd value is code returned by page
return render_template('errors/404.html'), 404
@errors.app_errorhandler(403)
def error_403(error):
return render_template('errors/403.html'), 403
@errors.app_errorhandler(500)
def error_500(error):
return render_template('errors/500.html'), 500
| 28.45
| 64
| 0.764499
| 80
| 569
| 5.25
| 0.475
| 0.133333
| 0.190476
| 0.185714
| 0.147619
| 0
| 0
| 0
| 0
| 0
| 0
| 0.077551
| 0.13884
| 569
| 20
| 65
| 28.45
| 0.779592
| 0.272408
| 0
| 0
| 0
| 0
| 0.12439
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0.090909
| 0.272727
| 0.636364
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
4f20703717d9dd15cbb4b996c1c28f65d68cfd0a
| 75
|
py
|
Python
|
lib/datasets/__init__.py
|
vlievin/dgm-template
|
719d52378947d06d35e030f4bd967e833fa67dea
|
[
"MIT"
] | 1
|
2020-10-29T10:32:55.000Z
|
2020-10-29T10:32:55.000Z
|
lib/datasets/__init__.py
|
vlievin/dgm-template
|
719d52378947d06d35e030f4bd967e833fa67dea
|
[
"MIT"
] | null | null | null |
lib/datasets/__init__.py
|
vlievin/dgm-template
|
719d52378947d06d35e030f4bd967e833fa67dea
|
[
"MIT"
] | null | null | null |
from .binmnist import BinMNIST
from .initialization import init_dataloaders
| 37.5
| 44
| 0.88
| 9
| 75
| 7.222222
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093333
| 75
| 2
| 44
| 37.5
| 0.955882
| 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
|
4f6aaae2214ebe6a06a7ef3238e6c0bb698825bc
| 91
|
py
|
Python
|
tests/module.py
|
simonpercivall/bettertimeit
|
2a327efead373237df4196dbde4b4f6b6387a95a
|
[
"PSF-2.0"
] | 7
|
2015-03-16T16:57:47.000Z
|
2020-12-08T08:26:10.000Z
|
tests/module.py
|
simonpercivall/bettertimeit
|
2a327efead373237df4196dbde4b4f6b6387a95a
|
[
"PSF-2.0"
] | null | null | null |
tests/module.py
|
simonpercivall/bettertimeit
|
2a327efead373237df4196dbde4b4f6b6387a95a
|
[
"PSF-2.0"
] | 1
|
2020-12-08T08:26:11.000Z
|
2020-12-08T08:26:11.000Z
|
a = 5
b = 3
def timeit_1():
print(a + b)
c = 8
def timeit_2():
print(a + b + c)
| 8.272727
| 20
| 0.472527
| 19
| 91
| 2.157895
| 0.578947
| 0.439024
| 0.341463
| 0.390244
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.084746
| 0.351648
| 91
| 10
| 21
| 9.1
| 0.610169
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0
| 0.285714
| 0.285714
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4fa118cc427dc22993b9d8aba912c1bf778b51ac
| 17,958
|
py
|
Python
|
helios/south_migrations/0001_initial.py
|
nti-ufop/helios-server
|
57c43fd300b856a6429d85e49f7156d0da21de22
|
[
"Apache-2.0"
] | 2
|
2017-05-15T09:57:51.000Z
|
2018-10-02T19:58:54.000Z
|
helios/south_migrations/0001_initial.py
|
nti-ufop/helios-server
|
57c43fd300b856a6429d85e49f7156d0da21de22
|
[
"Apache-2.0"
] | 6
|
2016-03-31T16:43:45.000Z
|
2018-01-06T00:44:08.000Z
|
helios/south_migrations/0001_initial.py
|
nti-ufop/helios-server
|
57c43fd300b856a6429d85e49f7156d0da21de22
|
[
"Apache-2.0"
] | 6
|
2016-02-23T10:44:42.000Z
|
2020-01-12T12:17:29.000Z
|
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Election'
db.create_table('helios_election', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('admin', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios_auth.User'])),
('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
('short_name', self.gf('django.db.models.fields.CharField')(max_length=100)),
('name', self.gf('django.db.models.fields.CharField')(max_length=250)),
('description', self.gf('django.db.models.fields.TextField')()),
('public_key', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('private_key', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('questions', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('eligibility', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('openreg', self.gf('django.db.models.fields.BooleanField')(default=False)),
('featured_p', self.gf('django.db.models.fields.BooleanField')(default=False)),
('use_voter_aliases', self.gf('django.db.models.fields.BooleanField')(default=False)),
('cast_url', self.gf('django.db.models.fields.CharField')(max_length=500)),
('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('frozen_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('archived_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('registration_starts_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('voting_starts_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('voting_ends_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('tallying_starts_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('voting_started_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('voting_extended_until', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('voting_ended_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('tallying_started_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('tallying_finished_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('tallies_combined_at', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True)),
('voters_hash', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
('encrypted_tally', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('result', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('result_proof', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
))
db.send_create_signal('helios', ['Election'])
# Adding model 'ElectionLog'
db.create_table('helios_electionlog', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('election', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios.Election'])),
('log', self.gf('django.db.models.fields.CharField')(max_length=500)),
('at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
))
db.send_create_signal('helios', ['ElectionLog'])
# Adding model 'VoterFile'
db.create_table('helios_voterfile', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('election', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios.Election'])),
('voter_file', self.gf('django.db.models.fields.files.FileField')(max_length=250)),
('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('processing_started_at', self.gf('django.db.models.fields.DateTimeField')(null=True)),
('processing_finished_at', self.gf('django.db.models.fields.DateTimeField')(null=True)),
('num_voters', self.gf('django.db.models.fields.IntegerField')(null=True)),
))
db.send_create_signal('helios', ['VoterFile'])
# Adding model 'Voter'
db.create_table('helios_voter', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('election', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios.Election'])),
('name', self.gf('django.db.models.fields.CharField')(max_length=200, null=True)),
('voter_type', self.gf('django.db.models.fields.CharField')(max_length=100)),
('voter_id', self.gf('django.db.models.fields.CharField')(max_length=100)),
('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
('alias', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
('vote', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('vote_hash', self.gf('django.db.models.fields.CharField')(max_length=100, null=True)),
('cast_at', self.gf('django.db.models.fields.DateTimeField')(null=True)),
))
db.send_create_signal('helios', ['Voter'])
# Adding model 'CastVote'
db.create_table('helios_castvote', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('voter', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios.Voter'])),
('vote', self.gf('helios_auth.jsonfield.JSONField')()),
('vote_hash', self.gf('django.db.models.fields.CharField')(max_length=100)),
('cast_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('verified_at', self.gf('django.db.models.fields.DateTimeField')(null=True)),
('invalidated_at', self.gf('django.db.models.fields.DateTimeField')(null=True)),
))
db.send_create_signal('helios', ['CastVote'])
# Adding model 'AuditedBallot'
db.create_table('helios_auditedballot', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('election', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios.Election'])),
('raw_vote', self.gf('django.db.models.fields.TextField')()),
('vote_hash', self.gf('django.db.models.fields.CharField')(max_length=100)),
('added_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
))
db.send_create_signal('helios', ['AuditedBallot'])
# Adding model 'Trustee'
db.create_table('helios_trustee', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('election', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['helios.Election'])),
('uuid', self.gf('django.db.models.fields.CharField')(max_length=50)),
('name', self.gf('django.db.models.fields.CharField')(max_length=200)),
('email', self.gf('django.db.models.fields.EmailField')(max_length=75)),
('secret', self.gf('django.db.models.fields.CharField')(max_length=100)),
('public_key', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('public_key_hash', self.gf('django.db.models.fields.CharField')(max_length=100)),
('secret_key', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('pok', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('decryption_factors', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
('decryption_proofs', self.gf('helios_auth.jsonfield.JSONField')(null=True)),
))
db.send_create_signal('helios', ['Trustee'])
def backwards(self, orm):
# Deleting model 'Election'
db.delete_table('helios_election')
# Deleting model 'ElectionLog'
db.delete_table('helios_electionlog')
# Deleting model 'VoterFile'
db.delete_table('helios_voterfile')
# Deleting model 'Voter'
db.delete_table('helios_voter')
# Deleting model 'CastVote'
db.delete_table('helios_castvote')
# Deleting model 'AuditedBallot'
db.delete_table('helios_auditedballot')
# Deleting model 'Trustee'
db.delete_table('helios_trustee')
models = {
'helios_auth.user': {
'Meta': {'unique_together': "(('user_type', 'user_id'),)", 'object_name': 'User'},
'admin_p': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'info': ('helios_auth.jsonfield.JSONField', [], {}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}),
'token': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'user_id': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'user_type': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'helios.auditedballot': {
'Meta': {'object_name': 'AuditedBallot'},
'added_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Election']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'raw_vote': ('django.db.models.fields.TextField', [], {}),
'vote_hash': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'helios.castvote': {
'Meta': {'object_name': 'CastVote'},
'cast_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'invalidated_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'verified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'vote': ('helios_auth.jsonfield.JSONField', [], {}),
'vote_hash': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'voter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Voter']"})
},
'helios.election': {
'Meta': {'object_name': 'Election'},
'admin': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios_auth.User']"}),
'archived_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'cast_url': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {}),
'eligibility': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'encrypted_tally': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'featured_p': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'frozen_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'openreg': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'private_key': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'public_key': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'questions': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'registration_starts_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'result': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'result_proof': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'short_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'tallies_combined_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'tallying_finished_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'tallying_started_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'tallying_starts_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'use_voter_aliases': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'voters_hash': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'voting_ended_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'voting_ends_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'voting_extended_until': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'voting_started_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'}),
'voting_starts_at': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True'})
},
'helios.electionlog': {
'Meta': {'object_name': 'ElectionLog'},
'at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Election']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'log': ('django.db.models.fields.CharField', [], {'max_length': '500'})
},
'helios.trustee': {
'Meta': {'object_name': 'Trustee'},
'decryption_factors': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'decryption_proofs': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Election']"}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'pok': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'public_key': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'public_key_hash': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'secret': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'secret_key': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'helios.voter': {
'Meta': {'object_name': 'Voter'},
'alias': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'cast_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Election']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}),
'uuid': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'vote': ('helios_auth.jsonfield.JSONField', [], {'null': 'True'}),
'vote_hash': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'voter_id': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'voter_type': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'helios.voterfile': {
'Meta': {'object_name': 'VoterFile'},
'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Election']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'num_voters': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
'processing_finished_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'processing_started_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'voter_file': ('django.db.models.fields.files.FileField', [], {'max_length': '250'})
}
}
complete_apps = ['helios']
| 69.069231
| 121
| 0.59628
| 1,979
| 17,958
| 5.265286
| 0.069227
| 0.101344
| 0.176008
| 0.25144
| 0.831958
| 0.823608
| 0.799232
| 0.761036
| 0.686564
| 0.594722
| 0
| 0.008362
| 0.187549
| 17,958
| 259
| 122
| 69.335907
| 0.705826
| 0.020882
| 0
| 0.201794
| 0
| 0
| 0.518074
| 0.336369
| 0
| 0
| 0
| 0
| 0
| 1
| 0.008969
| false
| 0
| 0.017937
| 0
| 0.040359
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
4fa8200c8b2901c4ee2320a13a73ba41556afde3
| 55
|
py
|
Python
|
loss/__init__.py
|
Ramsha04/kits19-challenge
|
d8ec97001c7ab668d802e266a4a1fcafcb456701
|
[
"MIT"
] | 39
|
2019-08-15T17:43:02.000Z
|
2022-03-23T07:22:29.000Z
|
loss/__init__.py
|
linggood/kits19-challenge
|
1fb9b0d0622314054f2433c4f87ed2892ef38c21
|
[
"MIT"
] | 15
|
2019-09-10T04:12:52.000Z
|
2021-11-01T14:07:49.000Z
|
loss/__init__.py
|
linggood/kits19-challenge
|
1fb9b0d0622314054f2433c4f87ed2892ef38c21
|
[
"MIT"
] | 17
|
2019-11-18T01:31:08.000Z
|
2022-03-18T12:31:56.000Z
|
from .generalized_dice_loss import GeneralizedDiceLoss
| 27.5
| 54
| 0.909091
| 6
| 55
| 8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072727
| 55
| 1
| 55
| 55
| 0.941176
| 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
|
4fae57cddd37e057a7b9185fcaf5b91209189437
| 71
|
py
|
Python
|
N2G/__init__.py
|
jinjamator/N2G
|
2467924abd9fc8f2dd569339cd9cb982488d9cd2
|
[
"MIT"
] | 1
|
2022-01-01T20:44:49.000Z
|
2022-01-01T20:44:49.000Z
|
N2G/__init__.py
|
jinjamator/N2G
|
2467924abd9fc8f2dd569339cd9cb982488d9cd2
|
[
"MIT"
] | null | null | null |
N2G/__init__.py
|
jinjamator/N2G
|
2467924abd9fc8f2dd569339cd9cb982488d9cd2
|
[
"MIT"
] | null | null | null |
from .N2G_DrawIO import drawio_diagram
from .N2G_yEd import yed_diagram
| 35.5
| 38
| 0.873239
| 12
| 71
| 4.833333
| 0.5
| 0.241379
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.098592
| 71
| 2
| 39
| 35.5
| 0.875
| 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
|
96cd8b1ab9dd395bb91833b5714a9c5cd5e08388
| 56
|
py
|
Python
|
countries_field/tests/__init__.py
|
anatoliy-larin/django-countries-field
|
3ecf39fe24b9fb450da11a52d2746e79437fe955
|
[
"Unlicense"
] | 2
|
2015-06-25T08:19:23.000Z
|
2021-07-02T23:46:04.000Z
|
countries_field/tests/__init__.py
|
anatoliy-larin/django-countries-field
|
3ecf39fe24b9fb450da11a52d2746e79437fe955
|
[
"Unlicense"
] | null | null | null |
countries_field/tests/__init__.py
|
anatoliy-larin/django-countries-field
|
3ecf39fe24b9fb450da11a52d2746e79437fe955
|
[
"Unlicense"
] | 2
|
2015-03-23T16:10:54.000Z
|
2019-10-16T15:09:54.000Z
|
#coding: utf-8
from models import *
from tests import *
| 14
| 20
| 0.732143
| 9
| 56
| 4.555556
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021739
| 0.178571
| 56
| 3
| 21
| 18.666667
| 0.869565
| 0.232143
| 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
|
8c062a86d599ddbc1803a814daf07586a06940d7
| 52
|
py
|
Python
|
src/ekpmeasure/analysis/FE_switching/__init__.py
|
marwahaha/ekpmeasure
|
8a0e52f0393849b496d9df13d84fcef11b733f59
|
[
"MIT"
] | null | null | null |
src/ekpmeasure/analysis/FE_switching/__init__.py
|
marwahaha/ekpmeasure
|
8a0e52f0393849b496d9df13d84fcef11b733f59
|
[
"MIT"
] | null | null | null |
src/ekpmeasure/analysis/FE_switching/__init__.py
|
marwahaha/ekpmeasure
|
8a0e52f0393849b496d9df13d84fcef11b733f59
|
[
"MIT"
] | null | null | null |
from .main import *
from .functions_on_data import *
| 26
| 32
| 0.788462
| 8
| 52
| 4.875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134615
| 52
| 2
| 32
| 26
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 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
|
8c3ee44f47f7ba991ed5a7b3ca6e9d04b8c024e0
| 203
|
py
|
Python
|
src/accounts/tests.py
|
Makerspace-Door/door_commander
|
11ffcd08dff45ffaae35cdbd0e09180658e34442
|
[
"BSD-3-Clause"
] | 1
|
2021-11-06T10:55:06.000Z
|
2021-11-06T10:55:06.000Z
|
src/accounts/tests.py
|
Makerspace-Door/door_commander
|
11ffcd08dff45ffaae35cdbd0e09180658e34442
|
[
"BSD-3-Clause"
] | 5
|
2021-09-21T20:37:30.000Z
|
2021-11-23T10:34:15.000Z
|
src/accounts/tests.py
|
Makerspace-Door/door_commander
|
11ffcd08dff45ffaae35cdbd0e09180658e34442
|
[
"BSD-3-Clause"
] | null | null | null |
from django.test import TestCase
# Create your tests here.
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth import get_user_model
User = get_user_model()
| 29
| 71
| 0.842365
| 28
| 203
| 5.964286
| 0.607143
| 0.179641
| 0.203593
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103448
| 203
| 6
| 72
| 33.833333
| 0.917582
| 0.1133
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.